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);
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;
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);
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);
}
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);
}
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);
}
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);
}
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);
}
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);
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;
}