diff options
| author | Naveen Rawat <nrawat@qca.qualcomm.com> | 2016-05-09 22:57:37 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-05-10 17:59:17 +0530 |
| commit | 841987e22a18ea393f419e18de6721cf7b989723 (patch) | |
| tree | 5f2db71bad37c3ac4d9daaf41106922815b1c952 | |
| parent | dc90ec73be03882e64c09e6a47a1e9450037dd08 (diff) | |
qcacld-2.0: Add NDP reason codes in deferred rsp sent for NDP commands
Add NDP reason codes in deferred response sent for NDP commands so that
failure during processing of NDP cmds can be notified to service layer.
Change-Id: I731b520fde226c351464d94033a1ced2888a4d18
CRs-Fixed: 962367
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_nan_datapath.c | 61 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_nan_datapath.h | 4 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 63 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma_nan_datapath.c | 33 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_nan_datapath.h | 17 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 6 | ||||
| -rw-r--r-- | CORE/SME/src/nan/nan_datapath_api.c | 69 |
8 files changed, 145 insertions, 112 deletions
diff --git a/CORE/HDD/src/wlan_hdd_nan_datapath.c b/CORE/HDD/src/wlan_hdd_nan_datapath.c index 4075ba4f2766..b4b36834167e 100644 --- a/CORE/HDD/src/wlan_hdd_nan_datapath.c +++ b/CORE/HDD/src/wlan_hdd_nan_datapath.c @@ -751,7 +751,7 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter); bool create_fail = false; uint8_t create_transaction_id = 0; - uint8_t create_status = 0; + uint32_t create_status = 0; ENTER(); @@ -809,7 +809,8 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, /* Status return value */ if (nla_put_u32(vendor_event, - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, 0xA5)) { + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + ndi_rsp->reason)) { hddLog(LOGE, FL("VENDOR_ATTR_NDP_DRV_RETURN_VALUE put fail")); goto nla_put_failure; } @@ -823,7 +824,8 @@ static void hdd_ndp_iface_create_rsp_handler(hdd_adapter_t *adapter, hddLog(LOG2, FL("status code: %d, value: %d"), QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, create_status); hddLog(LOG2, FL("Return value: %d, value: %d"), - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, 0xA5); + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + ndi_rsp->reason); cfg80211_vendor_event(vendor_event, GFP_KERNEL); @@ -866,6 +868,7 @@ static void hdd_ndp_iface_delete_rsp_handler(hdd_adapter_t *adapter, { hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); struct ndi_delete_rsp *ndi_rsp = rsp_params; + struct nan_datapath_ctx *ndp_ctx; if (wlan_hdd_validate_context(hdd_ctx)) return; @@ -875,13 +878,17 @@ static void hdd_ndp_iface_delete_rsp_handler(hdd_adapter_t *adapter, return; } - if (ndi_rsp->status == VOS_STATUS_SUCCESS) + if (ndi_rsp->status == NDP_RSP_STATUS_SUCCESS) hddLog(LOGE, FL("NDI BSS successfully stopped")); else hddLog(LOGE, FL("NDI BSS stop failed with reason %d"), ndi_rsp->reason); + ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter); + ndp_ctx->ndi_delete_rsp_reason = ndi_rsp->reason; + ndp_ctx->ndi_delete_rsp_status = ndi_rsp->status; + wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); @@ -959,14 +966,16 @@ void hdd_ndp_session_end_handler(hdd_adapter_t *adapter) /* Status code */ if (nla_put_u32(vendor_event, - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, 0x0)) { + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, + ndp_ctx->ndi_delete_rsp_status)) { hddLog(LOGE, FL("VENDOR_ATTR_NDP_DRV_RETURN_TYPE put fail")); goto failure; } /* Status return value */ if (nla_put_u32(vendor_event, - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, 0x0)) { + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + ndp_ctx->ndi_delete_rsp_reason)) { hddLog(LOGE, FL("VENDOR_ATTR_NDP_DRV_RETURN_VALUE put fail")); goto failure; } @@ -979,9 +988,10 @@ void hdd_ndp_session_end_handler(hdd_adapter_t *adapter) ndp_ctx->ndp_delete_transaction_id); hddLog(LOG2, FL("status code: %d, value: %d"), QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, - true); + ndp_ctx->ndi_delete_rsp_status); hddLog(LOG2, FL("Return value: %d, value: %d"), - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, 0x5A); + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + ndp_ctx->ndi_delete_rsp_reason); ndp_ctx->ndp_delete_transaction_id = 0; ndp_ctx->state = NAN_DATA_NDI_DELETED_STATE; @@ -1038,22 +1048,22 @@ static void hdd_ndp_initiator_rsp_handler(hdd_adapter_t *adapter, rsp->transaction_id)) goto ndp_initiator_rsp_nla_failed; - if (nla_put_u16(vendor_event, - QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID, + if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID, rsp->ndp_instance_id)) goto ndp_initiator_rsp_nla_failed; if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE, - rsp->status)) + rsp->status)) goto ndp_initiator_rsp_nla_failed; if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, - 0)) + rsp->reason)) goto ndp_initiator_rsp_nla_failed; hddLog(LOG1, - FL("NDP Initiator rsp sent, tid:%d, instance id:%d, status:%d"), - rsp->transaction_id, rsp->ndp_instance_id, rsp->status); + FL("NDP Initiator rsp sent, tid:%d, instance id:%d, status:%d, reason: %d"), + rsp->transaction_id, rsp->ndp_instance_id, rsp->status, + rsp->reason); cfg80211_vendor_event(vendor_event, GFP_KERNEL); EXIT(); return; @@ -1187,9 +1197,11 @@ static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter, else if (ndp_confirm->rsp_code == NDP_RESPONSE_ACCEPT) ndp_ctx->active_ndp_sessions[idx]++; - data_len = (3 * sizeof(uint32_t)) + VOS_MAC_ADDR_SIZE + IFNAMSIZ + - sizeof(uint16_t) + NLMSG_HDRLEN + (7 * NLA_HDRLEN) + - ndp_confirm->ndp_info.ndp_app_info_len; + data_len = (4 * sizeof(uint32_t)) + VOS_MAC_ADDR_SIZE + IFNAMSIZ + + NLMSG_HDRLEN + (6 * NLA_HDRLEN); + + if (ndp_confirm->ndp_info.ndp_app_info_len) + data_len += NLA_HDRLEN + ndp_confirm->ndp_info.ndp_app_info_len; vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL, data_len, QCA_NL80211_VENDOR_SUBCMD_NDP_INDEX, @@ -1216,9 +1228,9 @@ static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter, goto ndp_confirm_nla_failed; if (ndp_confirm->ndp_info.ndp_app_info_len && nla_put(vendor_event, - QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO, - ndp_confirm->ndp_info.ndp_app_info_len, - ndp_confirm->ndp_info.ndp_app_info)) + QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO, + ndp_confirm->ndp_info.ndp_app_info_len, + ndp_confirm->ndp_info.ndp_app_info)) goto ndp_confirm_nla_failed; if (nla_put_u32(vendor_event, @@ -1226,6 +1238,11 @@ static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter, ndp_confirm->rsp_code)) goto ndp_confirm_nla_failed; + if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + ndp_confirm->reason_code)) + goto ndp_confirm_nla_failed; + cfg80211_vendor_event(vendor_event, GFP_KERNEL); hddLog(LOG1, FL("NDP confim sent, ndp instance id: %d, peer addr: %pM, ndp_cfg: %d, rsp_code: %d, reason_code: %d"), ndp_confirm->ndp_instance_id, @@ -1659,11 +1676,11 @@ void hdd_ndp_event_handler(hdd_adapter_t *adapter, { if (roam_status == eCSR_ROAM_NDP_STATUS_UPDATE) { switch (roam_result) { - case eCSR_ROAM_RESULT_NDP_CREATE_RSP: + case eCSR_ROAM_RESULT_NDI_CREATE_RSP: hdd_ndp_iface_create_rsp_handler(adapter, &roam_info->ndp.ndi_create_params); break; - case eCSR_ROAM_RESULT_NDP_DELETE_RSP: + case eCSR_ROAM_RESULT_NDI_DELETE_RSP: hdd_ndp_iface_delete_rsp_handler(adapter, &roam_info->ndp.ndi_delete_params); break; diff --git a/CORE/HDD/src/wlan_hdd_nan_datapath.h b/CORE/HDD/src/wlan_hdd_nan_datapath.h index a19392ab0868..0ee46a119eac 100644 --- a/CORE/HDD/src/wlan_hdd_nan_datapath.h +++ b/CORE/HDD/src/wlan_hdd_nan_datapath.h @@ -179,6 +179,8 @@ enum nan_datapath_state { * @ndp_key_installed: NDP security key installed * @ndp_enc_key: NDP encryption key info * @ndp_debug_state: debug state info + * @ndi_delete_rsp_reason: reason code for ndi_delete rsp + * @ndi_delete_rsp_status: status for ndi_delete rsp */ struct nan_datapath_ctx { enum nan_datapath_state state; @@ -190,6 +192,8 @@ struct nan_datapath_ctx { bool ndp_key_installed; tCsrRoamSetKey ndp_enc_key; uint32_t ndp_debug_state; + uint32_t ndi_delete_rsp_reason; + uint32_t ndi_delete_rsp_status; }; #ifdef WLAN_FEATURE_NAN_DATAPATH diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index bdbfe5d92cd2..c5d054301246 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -7076,6 +7076,53 @@ enum ndp_end_reason_code { }; /** + * enum nan_status_type - NDP status type + * @NDP_RSP_STATUS_SUCCESS: request was successful + * @NDP_RSP_STATUS_ERROR: request failed + */ +enum nan_status_type { + NDP_RSP_STATUS_SUCCESS = 0x00, + NDP_RSP_STATUS_ERROR = 0x01, +}; + +/** + * enum nan_reason_code - NDP command rsp reason code value + * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases + * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed + * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed + * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed + * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed + * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id + * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id + * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request + * @NDP_INVALID_APP_INFO_LEN: invalid app info length + * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request + * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response + * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm + * @NDP_END_FAILED: ndp end failed + * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end + * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures + */ +enum nan_reason_code { + NDP_UNSUPPORTED_CONCURRENCY = 9000, + NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001, + NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002, + NDP_DATA_INITIATOR_REQ_FAILED = 9003, + NDP_DATA_RESPONDER_REQ_FAILED = 9004, + NDP_INVALID_SERVICE_INSTANCE_ID = 9005, + NDP_INVALID_NDP_INSTANCE_ID = 9006, + NDP_INVALID_RSP_CODE = 9007, + NDP_INVALID_APP_INFO_LEN = 9008, + NDP_NMF_REQ_FAIL = 9009, + NDP_NMF_RSP_FAIL = 9010, + NDP_NMF_CNF_FAIL = 9011, + NDP_END_FAILED = 9012, + NDP_NMF_END_REQ_FAIL = 9013, + /* 9500 onwards vendor specific error codes */ + NDP_VENDOR_SPECIFIC_ERROR = 9500, +}; + +/** * struct ndp_cfg - ndp configuration * @tag: unique identifier * @ndp_cfg_len: ndp configuration length @@ -7127,37 +7174,22 @@ struct ndp_app_info { /** * struct ndi_create_rsp - ndi create response params - * @transaction_id: unique identifier * @status: request status * @reason: reason if any * */ struct ndi_create_rsp { - uint32_t transaction_id; uint32_t status; uint32_t reason; }; /** - * struct ndi_delete_req - ndi delete request params - * @transaction_id: unique identifier - * @iface_name: interface name - * - */ - struct ndi_delete_req { - uint32_t transaction_id; - char iface_name[IFACE_NAME_SIZE]; -}; - -/** * struct ndi_delete_rsp - ndi delete response params - * @transaction_id: unique identifier * @status: request status * @reason: reason if any * */ struct ndi_delete_rsp { - uint32_t transaction_id; uint32_t status; uint32_t reason; }; @@ -7199,6 +7231,7 @@ struct ndp_initiator_rsp { uint32_t vdev_id; uint32_t ndp_instance_id; uint32_t status; + uint32_t reason; }; /** diff --git a/CORE/SERVICES/WMA/wma_nan_datapath.c b/CORE/SERVICES/WMA/wma_nan_datapath.c index a25c6f507731..2295f9f485b5 100644 --- a/CORE/SERVICES/WMA/wma_nan_datapath.c +++ b/CORE/SERVICES/WMA/wma_nan_datapath.c @@ -55,18 +55,18 @@ VOS_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req) if (NULL == ndp_req) { WMA_LOGE(FL("Invalid ndp_req.")); - goto send_ndi_initiator_fail; + goto send_ndp_initiator_fail; } vdev_id = ndp_req->vdev_id; vdev = wma_find_vdev_by_id(wma_handle, vdev_id); if (!vdev) { WMA_LOGE(FL("vdev not found for vdev id %d."), vdev_id); - goto send_ndi_initiator_fail; + goto send_ndp_initiator_fail; } if (!WMA_IS_VDEV_IN_NDI_MODE(wma_handle->interfaces, vdev_id)) { WMA_LOGE(FL("vdev :%d, not in NDI mode"), vdev_id); - goto send_ndi_initiator_fail; + goto send_ndp_initiator_fail; } /* @@ -81,7 +81,7 @@ VOS_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req) buf = wmi_buf_alloc(wma_handle->wmi_handle, len); if (!buf) { WMA_LOGE(FL("wmi_buf_alloc failed")); - goto send_ndi_initiator_fail; + goto send_ndp_initiator_fail; } cmd = (wmi_ndp_initiator_req_fixed_param *) wmi_buf_data(buf); WMITLV_SET_HDR(&cmd->tlv_header, @@ -140,12 +140,12 @@ VOS_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req) WMA_LOGE(FL("WMI_NDP_INITIATOR_REQ_CMDID failed, ret: %d"), ret); wmi_buf_free(buf); - goto send_ndi_initiator_fail; + goto send_ndp_initiator_fail; } return VOS_STATUS_SUCCESS; -send_ndi_initiator_fail: +send_ndp_initiator_fail: status = VOS_STATUS_E_FAILURE; if (ndp_req) { rsp = vos_mem_malloc(sizeof(*rsp)); @@ -158,7 +158,8 @@ send_ndi_initiator_fail: rsp->vdev_id = ndp_req->vdev_id; rsp->transaction_id = ndp_req->transaction_id; rsp->ndp_instance_id = ndp_req->service_instance_id; - rsp->status = NDP_CMD_RSP_STATUS_ERROR; + rsp->status = NDP_RSP_STATUS_ERROR; + rsp->reason = NDP_DATA_INITIATOR_REQ_FAILED; } } else { /* unblock SME queue, but do not send rsp to HDD */ @@ -249,12 +250,12 @@ VOS_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle, vdev = wma_find_vdev_by_id(wma_handle, vdev_id); if (!vdev) { WMA_LOGE(FL("vdev not found for vdev id %d."), vdev_id); - goto send_ndi_responder_fail; + goto send_ndp_responder_fail; } if (!WMA_IS_VDEV_IN_NDI_MODE(wma_handle->interfaces, vdev_id)) { WMA_LOGE(FL("vdev :$%d, not in NDI mode"), vdev_id); - goto send_ndi_responder_fail; + goto send_ndp_responder_fail; } /* @@ -269,7 +270,7 @@ VOS_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle, buf = wmi_buf_alloc(wma_handle->wmi_handle, len); if (!buf) { WMA_LOGE(FL("wmi_buf_alloc failed")); - goto send_ndi_responder_fail; + goto send_ndp_responder_fail; } cmd = (wmi_ndp_responder_req_fixed_param *) wmi_buf_data(buf); WMITLV_SET_HDR(&cmd->tlv_header, @@ -315,14 +316,15 @@ VOS_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle, WMA_LOGE(FL("WMI_NDP_RESPONDER_REQ_CMDID failed, ret: %d"), ret); wmi_buf_free(buf); - goto send_ndi_responder_fail; + goto send_ndp_responder_fail; } return VOS_STATUS_SUCCESS; -send_ndi_responder_fail: +send_ndp_responder_fail: vos_mem_zero(&rsp, sizeof(rsp)); rsp.vdev_id = req_params->vdev_id; rsp.transaction_id = req_params->transaction_id; - rsp.status = VOS_STATUS_E_FAILURE; + rsp.status = NDP_RSP_STATUS_ERROR; + rsp.reason = NDP_DATA_RESPONDER_REQ_FAILED; wma_send_ndp_responder_rsp(&rsp); return VOS_STATUS_E_FAILURE; } @@ -401,7 +403,8 @@ send_ndp_end_fail: pe_msg.bodyval = true; } else { vos_mem_zero(end_rsp, sizeof(*end_rsp)); - end_rsp->status = NDP_CMD_RSP_STATUS_ERROR; + end_rsp->status = NDP_RSP_STATUS_ERROR; + end_rsp->reason = NDP_END_FAILED; end_rsp->transaction_id = req->transaction_id; pe_msg.bodyptr = end_rsp; } @@ -685,6 +688,7 @@ static int wma_ndp_end_response_event_handler(void *handle, if (end_rsp->num_peers == 0) { WMA_LOGE(FL("num_peers in NDP rsp should not be 0.")); end_rsp->status = NDP_CMD_RSP_STATUS_ERROR; + end_rsp->reason = NDP_END_FAILED; goto send_ndp_end_rsp; } /* copy per peer response to return path buffer */ @@ -828,6 +832,7 @@ static int wma_ndp_initiator_rsp_event_handler(void *handle, rsp->transaction_id = fixed_params->transaction_id; rsp->ndp_instance_id = fixed_params->ndp_instance_id; rsp->status = fixed_params->rsp_status; + rsp->reason = fixed_params->reason_code; pe_msg.type = SIR_HAL_NDP_INITIATOR_RSP; pe_msg.bodyptr = rsp; diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 65f712ebf2ab..151cd393d260 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -644,8 +644,8 @@ typedef enum eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_FAILURE, eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND, - eCSR_ROAM_RESULT_NDP_CREATE_RSP, - eCSR_ROAM_RESULT_NDP_DELETE_RSP, + eCSR_ROAM_RESULT_NDI_CREATE_RSP, + eCSR_ROAM_RESULT_NDI_DELETE_RSP, eCSR_ROAM_RESULT_NDP_INITIATOR_RSP, eCSR_ROAM_RESULT_NDP_NEW_PEER_IND, eCSR_ROAM_RESULT_NDP_CONFIRM_IND, diff --git a/CORE/SME/inc/sme_nan_datapath.h b/CORE/SME/inc/sme_nan_datapath.h index be1b285fb67d..43681c8250b7 100644 --- a/CORE/SME/inc/sme_nan_datapath.h +++ b/CORE/SME/inc/sme_nan_datapath.h @@ -99,13 +99,6 @@ void sme_ndp_message_processor(tpAniSirGlobal mac_ctx, uint16_t msg_type, VOS_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, uint32_t session_id, tCsrRoamProfile *profile); -void csr_roam_fill_roaminfo_ndp(tpAniSirGlobal mac_ctx, - tCsrRoamInfo *roam_info, - eCsrRoamResult roam_result, - tSirResultCodes status_code, - uint32_t reason_code, - uint32_t transaction_id); - void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx, tANI_U32 session_id, tCsrRoamProfile *roam_profile, @@ -140,16 +133,6 @@ static inline VOS_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, return VOS_STATUS_SUCCESS; } -/* Fill in ndp information in roam_info */ -static inline void csr_roam_fill_roaminfo_ndp(tpAniSirGlobal mac_ctx, - tCsrRoamInfo *roam_info, - eCsrRoamResult roam_result, - tSirResultCodes status_code, - uint32_t reason_code, - uint32_t transaction_id) -{ -} - static inline void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx, tANI_U32 session_id, tCsrRoamProfile *roam_profile, diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 20dc67c6b2b3..20ddeffd19b6 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -6383,9 +6383,6 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman if (CSR_IS_NDI(pProfile)) { csr_roam_update_ndp_return_params(pMac, Result, &roamStatus, &roamResult, &roamInfo); - csr_roam_fill_roaminfo_ndp(pMac, &roamInfo, roamResult, - pSmeStartBssRsp->statusCode, - 0, 0); } //Only tell upper layer is we start the BSS because Vista doesn't like multiple connection @@ -6476,9 +6473,6 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman if (CSR_IS_NDI(pProfile)) { csr_roam_update_ndp_return_params(pMac, Result, &roamStatus, &roamResult, &roamInfo); - csr_roam_fill_roaminfo_ndp(pMac, &roamInfo, roamResult, - (pSmeStartBssRsp) ? pSmeStartBssRsp->statusCode : - eHAL_STATUS_FAILURE, 0, 0); } if(Context) diff --git a/CORE/SME/src/nan/nan_datapath_api.c b/CORE/SME/src/nan/nan_datapath_api.c index 1764a916c690..47fb63846fe5 100644 --- a/CORE/SME/src/nan/nan_datapath_api.c +++ b/CORE/SME/src/nan/nan_datapath_api.c @@ -302,36 +302,6 @@ VOS_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, uint32_t session, } /** - * csr_roam_fill_roaminfo_ndp() - fill the ndi create struct inside roam info - * @mac_ctx: Global MAC context - * @roam_info: roam info to be updated with ndi create params - * @roam_result: roam result to update - * @status_code: status code to update - * @reason_code: reason code to update - * @transaction_id: transcation id to update - * - * Return: Nothing - */ -void csr_roam_fill_roaminfo_ndp(tpAniSirGlobal mac_ctx, - tCsrRoamInfo *roam_info, - eCsrRoamResult roam_result, - tSirResultCodes status_code, - uint32_t reason_code, - uint32_t transaction_id) -{ - struct ndi_create_rsp *rsp_params; - - smsLog(mac_ctx, LOG1, - FL("reason 0x%x, status 0x%x, transaction_id %d"), - reason_code, status_code, transaction_id); - rsp_params = (struct ndi_create_rsp *) - &roam_info->ndp.ndi_create_params; - rsp_params->reason = reason_code; - rsp_params->status = status_code; - rsp_params->transaction_id = transaction_id; -} - -/** * csr_roam_save_ndi_connected_info() - Save connected profile parameters * @mac_ctx: Global MAC context * @session_id: Session ID @@ -404,19 +374,32 @@ void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx, switch (result) { case eCsrStartBssSuccess: + roam_info->ndp.ndi_create_params.reason = 0; + roam_info->ndp.ndi_create_params.status = + NDP_RSP_STATUS_SUCCESS; + *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE; + *roam_result = eCSR_ROAM_RESULT_NDI_CREATE_RSP; + break; case eCsrStartBssFailure: + roam_info->ndp.ndi_create_params.status = NDP_RSP_STATUS_ERROR; + roam_info->ndp.ndi_create_params.reason = + NDP_NAN_DATA_IFACE_CREATE_FAILED; *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE; - *roam_result = eCSR_ROAM_RESULT_NDP_CREATE_RSP; + *roam_result = eCSR_ROAM_RESULT_NDI_CREATE_RSP; break; case eCsrStopBssSuccess: + roam_info->ndp.ndi_delete_params.reason = 0; + roam_info->ndp.ndi_delete_params.status = + NDP_RSP_STATUS_SUCCESS; *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE; - *roam_result = eCSR_ROAM_RESULT_NDP_DELETE_RSP; - roam_info->ndp.ndi_delete_params.status = VOS_STATUS_SUCCESS; + *roam_result = eCSR_ROAM_RESULT_NDI_DELETE_RSP; break; case eCsrStopBssFailure: + roam_info->ndp.ndi_delete_params.status = NDP_RSP_STATUS_ERROR; + roam_info->ndp.ndi_delete_params.reason = + NDP_NAN_DATA_IFACE_DELETE_FAILED; *roam_status = eCSR_ROAM_NDP_STATUS_UPDATE; - *roam_result = eCSR_ROAM_RESULT_NDP_DELETE_RSP; - roam_info->ndp.ndi_delete_params.status = VOS_STATUS_E_FAILURE; + *roam_result = eCSR_ROAM_RESULT_NDI_DELETE_RSP; break; default: smsLog(mac_ctx, LOGE, @@ -435,6 +418,7 @@ void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx, eHalStatus csr_process_ndp_initiator_request(tpAniSirGlobal mac_ctx, tSmeCmd *cmd) { + eHalStatus status; struct sir_sme_ndp_initiator_req *lim_msg; uint16_t msg_len; uint8_t *self_mac_addr = NULL; @@ -467,7 +451,20 @@ eHalStatus csr_process_ndp_initiator_request(tpAniSirGlobal mac_ctx, smsLog(mac_ctx, LOG1, FL("selfMac = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(self_mac_addr)); - return palSendMBMessage(mac_ctx->hHdd, lim_msg); + status = palSendMBMessage(mac_ctx->hHdd, lim_msg); + if (!HAL_STATUS_SUCCESS(status)) { + /* + * If fail, free up the ndp_cfg and ndp_app_info + * allocated in sme. + */ + vos_mem_free(cmd->u.initiator_req.ndp_info.ndp_app_info); + vos_mem_free(cmd->u.initiator_req.ndp_config.ndp_cfg); + cmd->u.initiator_req.ndp_info.ndp_app_info_len = 0; + cmd->u.initiator_req.ndp_config.ndp_cfg_len = 0; + cmd->u.initiator_req.ndp_config.ndp_cfg = NULL; + cmd->u.initiator_req.ndp_info.ndp_app_info = NULL; + } + return status; } /** |
