[APR-2053]wlbt: NAN R2 integration fxes

NAN R2 integration fixes

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

Change-Id: Ia2722ebe16345d1e7979323365cb0d9c4ac83f75
diff --git a/nan_data.h b/nan_data.h
index 28d0871..4b93d97 100755
--- a/nan_data.h
+++ b/nan_data.h
@@ -43,7 +43,7 @@
     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);
diff --git a/wifi_hal.cpp b/wifi_hal.cpp
index 6381949..11d32f0 100755
--- a/wifi_hal.cpp
+++ b/wifi_hal.cpp
@@ -405,6 +405,11 @@
     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;
diff --git a/wifi_nan.cpp b/wifi_nan.cpp
index 3c740ae..8fd9cc2 100755
--- a/wifi_nan.cpp
+++ b/wifi_nan.cpp
@@ -1376,15 +1376,15 @@
         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) {
-            ALOGE("failed NDP req; result = %d", result);
+            ALOGE("failed DATA-PATH req; result = %d", result);
             unregisterNanEvents();
         } else {
             datacmd.requestSuccess(id, data, subcmd);
@@ -1540,7 +1540,7 @@
     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);
 }
 
@@ -1551,7 +1551,7 @@
     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);
 
 }
@@ -1563,7 +1563,7 @@
     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);
 
 }
@@ -1575,7 +1575,7 @@
     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);
 
 }
@@ -1587,7 +1587,7 @@
     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);
 
 }
diff --git a/wifi_nan_data_path.cpp b/wifi_nan_data_path.cpp
index de4686a..dae84e1 100755
--- a/wifi_nan_data_path.cpp
+++ b/wifi_nan_data_path.cpp
@@ -302,16 +302,22 @@
     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:
+        transaction_id[idx_iface_create] = id;
+        return dataInterfaceCreateDelete((char *)data, subcmd, request);
     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:
+        transaction_id[idx_ndp_initiator] = id;
         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:
+        transaction_id[idx_ndp_end] = id;
         return dataEnd((NanDataPathEndRequest *)data, request);
     default:
         ALOGE("unknown subcmd :%d", subcmd);
@@ -322,23 +328,18 @@
 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:
-        transaction_id[idx_iface_delete] = id;
         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:
-        transaction_id[idx_ndp_responder] = id;
         dataIndicationResponseSuccess((NanDataPathIndicationResponse *)data);
         break;
     case SLSI_NL80211_VENDOR_SUBCMD_NAN_DATA_END:
-        transaction_id[idx_ndp_end] = id;
         dataEndSuccess((NanDataPathEndRequest *)data);
         break;
     }