[APR-2053]wlbt: NAN R2 integration fxes android-10-release-qsbs master MMI-QSAS30.62-24-10 MMI-QSAS30.62-24-11 MMI-QSAS30.62-24-12 MMI-QSAS30.62-24-13 MMI-QSAS30.62-24-14 MMI-QSAS30.62-24-26-14 MMI-QSBS30.62-17-12 MMI-QSBS30.62-17-4 MMI-QSBS30.62-17-5 MMI-QSBS30.62-17-7 MMI-QSBS30.62-17-8
authorJaya Prakash Sangaru <j.sangaru@samsung.com>
Wed, 18 Sep 2019 14:11:49 +0000 (19:41 +0530)
committerrobot <robot@samsung.com>
Mon, 7 Oct 2019 05:03:40 +0000 (14:03 +0900)
NAN R2 integration fixes

SCSC-Bug-Id: HOST-10958
Signed-off-by: Jaya Prakash Sangaru <j.sangaru@samsung.com>
Change-Id: Ia2722ebe16345d1e7979323365cb0d9c4ac83f75

nan_data.h
wifi_hal.cpp
wifi_nan.cpp
wifi_nan_data_path.cpp

index 28d0871bee70c91502c30c47a781b8211d81dd3a..4b93d970777ef8d3ef9bf49dfc50d2fedc2d5f0f 100755 (executable)
@@ -43,7 +43,7 @@ public:
     NanDataCommand();
     int processResponse(WifiEvent &reply, NanResponseMsg *response);
     void requestSuccess(u16 id, void *data, int subcmd);
     NanDataCommand();
     int processResponse(WifiEvent &reply, NanResponseMsg *response);
     void requestSuccess(u16 id, void *data, int subcmd);
-    int getDataPathNLMsg(void *data, int subcmd, WifiRequest &request);
+    int getDataPathNLMsg(u16 id, void *data, int subcmd, WifiRequest &request);
     void setMaxNdpSessions(int max_ndp);
     int handleEvent(WifiEvent &event, NanCallbackHandler &callbackEventHandler);
     int getResponseTransactionId(NanResponseMsg *res);
     void setMaxNdpSessions(int max_ndp);
     int handleEvent(WifiEvent &event, NanCallbackHandler &callbackEventHandler);
     int getResponseTransactionId(NanResponseMsg *res);
index 638194935155f0b4740c2b5b9bc1dd10c8d66acb..11d32f0a4738afdf6381e36b843c525f2cd26a9d 100755 (executable)
@@ -405,6 +405,11 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
     fn->wifi_nan_register_handler = nan_register_handler;
     fn->wifi_nan_get_version = nan_get_version;
     fn->wifi_nan_get_capabilities = nan_get_capabilities;
     fn->wifi_nan_register_handler = nan_register_handler;
     fn->wifi_nan_get_version = nan_get_version;
     fn->wifi_nan_get_capabilities = nan_get_capabilities;
+    fn->wifi_nan_data_interface_create = nan_data_interface_create;
+    fn->wifi_nan_data_interface_delete = nan_data_interface_delete;
+    fn->wifi_nan_data_request_initiator = nan_data_request_initiator;
+    fn->wifi_nan_data_indication_response = nan_data_indication_response;
+    fn->wifi_nan_data_end = nan_data_end;
     fn->wifi_get_roaming_capabilities = wifi_get_roaming_capabilities;
     fn->wifi_enable_firmware_roaming = wifi_enable_firmware_roaming;
     fn->wifi_get_packet_filter_capabilities = wifi_get_packet_filter_capabilities;
     fn->wifi_get_roaming_capabilities = wifi_get_roaming_capabilities;
     fn->wifi_enable_firmware_roaming = wifi_enable_firmware_roaming;
     fn->wifi_get_packet_filter_capabilities = wifi_get_packet_filter_capabilities;
index 3c740ae9806610dbd187f1af8a7ffed72571942c..8fd9cc2921a792e36a299a291a12a660d72e49f4 100755 (executable)
@@ -1376,15 +1376,15 @@ public:
         int result;
         WifiRequest request(familyId(), ifaceId());
 
         int result;
         WifiRequest request(familyId(), ifaceId());
 
-        ALOGI("NAN DATA-PATH req subcmd:%d", subcmd);
+        ALOGI("NAN DATA-PATH req subcmd:%d transaction_id:%d", subcmd, id);
 
 
-        result = datacmd.getDataPathNLMsg(data, subcmd, request);
+        result = datacmd.getDataPathNLMsg(id, data, subcmd, request);
         if (result != WIFI_SUCCESS) {
             return result;
         }
         result = requestResponse(request);
         if (result != WIFI_SUCCESS) {
         if (result != WIFI_SUCCESS) {
             return result;
         }
         result = requestResponse(request);
         if (result != WIFI_SUCCESS) {
-            ALOGE("failed NDP req; result = %d", result);
+            ALOGE("failed DATA-PATH req; result = %d", result);
             unregisterNanEvents();
         } else {
             datacmd.requestSuccess(id, data, subcmd);
             unregisterNanEvents();
         } else {
             datacmd.requestSuccess(id, data, subcmd);
@@ -1540,7 +1540,7 @@ wifi_error nan_data_interface_create(transaction_id id,
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
-    return (wifi_error)nanRequest->dataPathReq(id, iface,
+    return (wifi_error)nanRequest->dataPathReq(id, iface_name,
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE);
 }
 
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE);
 }
 
@@ -1551,7 +1551,7 @@ wifi_error nan_data_interface_delete(transaction_id id,
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
-    return (wifi_error)nanRequest->dataPathReq(id, iface,
+    return (wifi_error)nanRequest->dataPathReq(id, iface_name,
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE);
 
 }
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE);
 
 }
@@ -1563,7 +1563,7 @@ wifi_error nan_data_request_initiator(transaction_id id,
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
-    return (wifi_error)nanRequest->dataPathReq(id, iface,
+    return (wifi_error)nanRequest->dataPathReq(id, msg,
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR);
 
 }
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR);
 
 }
@@ -1575,7 +1575,7 @@ wifi_error nan_data_indication_response(transaction_id id,
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
-    return (wifi_error)nanRequest->dataPathReq(id, iface,
+    return (wifi_error)nanRequest->dataPathReq(id, msg,
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE);
 
 }
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE);
 
 }
@@ -1587,7 +1587,7 @@ wifi_error nan_data_end(transaction_id id,
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
     if (!nanRequest) {
         return WIFI_ERROR_OUT_OF_MEMORY;
     }
-    return (wifi_error)nanRequest->dataPathReq(id, iface,
+    return (wifi_error)nanRequest->dataPathReq(id, msg,
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END);
 
 }
                 SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END);
 
 }
index de4686a607316867b278268d2c9f3ae90cb85ee1..dae84e12a4f2134c0c989ce9958042b6531fe781 100755 (executable)
@@ -302,16 +302,22 @@ NanDataCommand::NanDataCommand() {
     memset(transaction_id, 0, sizeof(transaction_id));
 }
 
     memset(transaction_id, 0, sizeof(transaction_id));
 }
 
-int NanDataCommand::getDataPathNLMsg(void *data, int subcmd, WifiRequest &request) {
+int NanDataCommand::getDataPathNLMsg(u16 id, void *data, int subcmd, WifiRequest &request) {
     switch (subcmd) {
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE:
     switch (subcmd) {
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE:
+        transaction_id[idx_iface_create] = id;
+        return dataInterfaceCreateDelete((char *)data, subcmd, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE:
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE:
+        transaction_id[idx_iface_delete] = id;
         return dataInterfaceCreateDelete((char *)data, subcmd, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR:
         return dataInterfaceCreateDelete((char *)data, subcmd, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR:
+        transaction_id[idx_ndp_initiator] = id;
         return dataRequestInitiate((NanDataPathInitiatorRequest *)data, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE:
         return dataRequestInitiate((NanDataPathInitiatorRequest *)data, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE:
+        transaction_id[idx_ndp_responder] = id;
         return dataIndicationResponse((NanDataPathIndicationResponse *)data, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END:
         return dataIndicationResponse((NanDataPathIndicationResponse *)data, request);
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END:
+        transaction_id[idx_ndp_end] = id;
         return dataEnd((NanDataPathEndRequest *)data, request);
     default:
         ALOGE("unknown subcmd :%d", subcmd);
         return dataEnd((NanDataPathEndRequest *)data, request);
     default:
         ALOGE("unknown subcmd :%d", subcmd);
@@ -322,23 +328,18 @@ int NanDataCommand::getDataPathNLMsg(void *data, int subcmd, WifiRequest &reques
 void NanDataCommand::requestSuccess(u16 id, void *data, int subcmd) {
     switch (subcmd) {
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE:
 void NanDataCommand::requestSuccess(u16 id, void *data, int subcmd) {
     switch (subcmd) {
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_CREATE:
-        transaction_id[idx_iface_create] = id;
         dataInterfaceCreated((char *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE:
         dataInterfaceCreated((char *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INTERFACE_DELETE:
-        transaction_id[idx_iface_delete] = id;
         dataInterfaceDeleted((char *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR:
         dataInterfaceDeleted((char *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_REQUEST_INITIATOR:
-        transaction_id[idx_ndp_initiator] = id;
         dataRequestInitiateSuccess((NanDataPathInitiatorRequest *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE:
         dataRequestInitiateSuccess((NanDataPathInitiatorRequest *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_INDICATION_RESPONSE:
-        transaction_id[idx_ndp_responder] = id;
         dataIndicationResponseSuccess((NanDataPathIndicationResponse *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END:
         dataIndicationResponseSuccess((NanDataPathIndicationResponse *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END:
-        transaction_id[idx_ndp_end] = id;
         dataEndSuccess((NanDataPathEndRequest *)data);
         break;
     }
         dataEndSuccess((NanDataPathEndRequest *)data);
         break;
     }