From: Jaya Prakash Sangaru Date: Wed, 18 Sep 2019 14:11:49 +0000 (+0530) Subject: [APR-2053]wlbt: NAN R2 integration fxes X-Git-Tag: MMI-QSBS30.62-17-8^0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;ds=inline;p=GitHub%2FMotorolaMobilityLLC%2Fhardware-samsung_slsi-scsc_wifibt-wifi_hal.git [APR-2053]wlbt: NAN R2 integration fxes NAN R2 integration fixes SCSC-Bug-Id: HOST-10958 Signed-off-by: Jaya Prakash Sangaru 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 @@ public: 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 @@ 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_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 @@ public: 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 @@ wifi_error nan_data_interface_create(transaction_id id, 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 @@ wifi_error nan_data_interface_delete(transaction_id id, 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 @@ wifi_error nan_data_request_initiator(transaction_id id, 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 @@ wifi_error nan_data_indication_response(transaction_id id, 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 @@ wifi_error nan_data_end(transaction_id id, 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 @@ NanDataCommand::NanDataCommand() { 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 @@ 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: - 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; }