[APR-2987]wlbt: NAN R2 fix NDP terminate
authorJaya Prakash Sangaru <j.sangaru@samsung.com>
Wed, 25 Sep 2019 17:17:45 +0000 (22:47 +0530)
committerrobot <robot@samsung.com>
Wed, 20 Nov 2019 23:26:12 +0000 (08:26 +0900)
Fixed NDP terminate request to include correct number of
NDP ids.

Change-Id: I033492248d9588c82f0aab91242c6f2b4195639a
SCSC-Bug-Id: HOST-11012
Signed-off-by: Jaya Prakash Sangaru <j.sangaru@samsung.com>
wifi_nan.cpp
wifi_nan_data_path.cpp

index 86e7414fa2fc8f32daa467fba3201e725148c79d..5e1ac12989f5622c60f365e1181c5413a5d738c3 100755 (executable)
@@ -1280,7 +1280,7 @@ public:
         int id = event.get_vendor_id();
         int subcmd = event.get_vendor_subcmd();
 
-        ALOGI("NAN %s Id = %0x, subcmd = %d", __func__, id, subcmd);
+        ALOGI("NAN %s Id = 0x%x, subcmd = 0x%x", __func__, id, subcmd);
 
         switch(subcmd) {
         case SLSI_NAN_EVENT_MATCH:
@@ -1378,7 +1378,7 @@ public:
         int result;
         WifiRequest request(familyId(), ifaceId());
 
-        ALOGI("NAN DATA-PATH req subcmd:%d transaction_id:%d", subcmd, id);
+        ALOGI("NAN DATA-PATH req subcmd:0x%x transaction_id:%d", subcmd, id);
 
         result = datacmd.getDataPathNLMsg(id, data, subcmd, request);
         if (result != WIFI_SUCCESS) {
@@ -1390,7 +1390,7 @@ public:
             unregisterNanEvents();
         } else {
             datacmd.requestSuccess(id, data, subcmd);
-            ALOGD("NAN DATA-PATH req(subcmd:%d)...success", subcmd);
+            ALOGD("NAN DATA-PATH req(subcmd:0x%x)...success", subcmd);
         }
         return result;
     }
index dae84e12a4f2134c0c989ce9958042b6531fe781..a5a31bf4b7b277d754a6ccbd7d5b3d5ca01c4945 100755 (executable)
@@ -132,11 +132,11 @@ int NanDataCommand::dataEnd(NanDataPathEndRequest* msg, WifiRequest &request) {
     nlattr *data = newNlVendorMsg(SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END, request);
     if (!data)
         return WIFI_ERROR_UNKNOWN;
-
-    for(i=0; i<SLSI_NAN_MAX_NDP; i++) {
+    for(i=0; i<msg->num_ndp_instances; i++) {
         result = request.put_u32(NAN_REQ_ATTR_NDP_INSTANCE_ID, msg->ndp_instance_id[i]);
         CHECK_WIFI_STATUS_RETURN_FAIL(result, "Failed to put ndp_instance_id");
     }
+
     request.attr_end(data);
     return result;
 }
@@ -320,7 +320,7 @@ int NanDataCommand::getDataPathNLMsg(u16 id, void *data, int subcmd, WifiRequest
         transaction_id[idx_ndp_end] = id;
         return dataEnd((NanDataPathEndRequest *)data, request);
     default:
-        ALOGE("unknown subcmd :%d", subcmd);
+        ALOGE("unknown subcmd :0x%x", subcmd);
     }
     return WIFI_ERROR_UNKNOWN;
 }