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;
}
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);
+ ALOGE("unknown subcmd :0x%x", subcmd);
}
return WIFI_ERROR_UNKNOWN;
}
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;
}