From 7996eb7a8ebb250bdecec53ee3a15c4cfa237613 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 30 Dec 2015 17:24:02 +0530 Subject: [PATCH] qcacld-3.0: Send management frame indication directly to HDD from PE qcacld-2.0 to qcacld-3.0 propagation. If MC thread stall while waiting on any event, In case of WPS, probe requests may get accumulated in PE message queue. Now every time MC thread process a probe request, eWNI_SME_MGMT_FRM_IND msg is posted in SME message queue. But unless PE queue is fully processed SME queue won't be processed. This will gradually use all vos message wrapper. To avoid this register a callback to send management frame indication directly to HDD from PE which avoids posting message to SME queue. Change-Id: Ib83700825112cc52dade594909bfa8993909ac29 CRs-Fixed: 944961 --- core/hdd/inc/wlan_hdd_main.h | 3 + core/hdd/inc/wlan_hdd_p2p.h | 4 +- core/hdd/src/wlan_hdd_assoc.c | 8 -- core/hdd/src/wlan_hdd_cfg80211.c | 3 + core/hdd/src/wlan_hdd_hostapd.c | 11 --- core/hdd/src/wlan_hdd_main.c | 90 +++++++++++++++++++ core/hdd/src/wlan_hdd_p2p.c | 2 +- core/mac/inc/ani_global.h | 4 +- core/mac/inc/sir_api.h | 18 +++- core/mac/inc/wni_api.h | 4 +- core/mac/src/pe/lim/lim_p2p.c | 17 ++-- .../src/pe/lim/lim_process_message_queue.c | 3 +- .../src/pe/lim/lim_process_sme_req_messages.c | 31 +++++++ .../src/sys/legacy/src/utils/src/mac_trace.c | 4 +- core/sap/inc/sap_api.h | 5 +- core/sap/src/sap_api_link_cntl.c | 7 +- core/sap/src/sap_fsm.c | 14 +-- core/sme/inc/csr_api.h | 1 - core/sme/inc/sme_api.h | 5 +- core/sme/src/common/sme_api.c | 55 +++++++++--- core/sme/src/csr/csr_util.c | 3 +- core/sme/src/p2p/p2p_api.c | 42 +-------- 22 files changed, 214 insertions(+), 120 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index cb7693f1cc3d..33776454ae7a 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1542,6 +1542,9 @@ void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx); void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx); void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx); const char *hdd_get_fwpath(void); +void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind); +hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, + uint32_t sme_session_id); uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel, uint8_t bw_offset); diff --git a/core/hdd/inc/wlan_hdd_p2p.h b/core/hdd/inc/wlan_hdd_p2p.h index ce1670bfd1c4..cfd9aaf686d1 100644 --- a/core/hdd/inc/wlan_hdd_p2p.h +++ b/core/hdd/inc/wlan_hdd_p2p.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -108,7 +108,7 @@ int hdd_set_p2p_ps(struct net_device *dev, void *msgData); int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command); int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command); -void hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, +void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, uint32_t nFrameLength, uint8_t *pbFrames, uint8_t frameType, uint32_t rxChan, int8_t rxRssi); diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index e9242d384b5a..12addc14c9b7 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -4168,14 +4168,6 @@ defined(FEATURE_WLAN_LFR)) } break; #endif - - case eCSR_ROAM_INDICATE_MGMT_FRAME: - hdd_indicate_mgmt_frame(pAdapter, - pRoamInfo->nFrameLength, - pRoamInfo->pbFrames, - pRoamInfo->frameType, - pRoamInfo->rxChan, pRoamInfo->rxRssi); - break; case eCSR_ROAM_REMAIN_CHAN_READY: hdd_remain_chan_ready_handler(pAdapter, pRoamInfo->roc_scan_id); break; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ac59b0b6890e..e80b293541fa 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5576,6 +5576,9 @@ void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter) ENTER(); + /* Register frame indication call back */ + sme_register_mgmt_frame_ind_callback(hHal, hdd_indicate_mgmt_frame); + /* Right now we are registering these frame when driver is getting initialized. Once we will move to 2.6.37 kernel, in which we have frame register ops, we will move this code as a part of that */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5361c76ac12d..c5ee4d860821 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1519,17 +1519,6 @@ CDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, cdf_mem_free(pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas); /* Release caller allocated memory here */ pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas = NULL; return CDF_STATUS_SUCCESS; - case eSAP_INDICATE_MGMT_FRAME: - hdd_indicate_mgmt_frame(pHostapdAdapter, - pSapEvent->sapevt.sapManagementFrameInfo. - nFrameLength, - pSapEvent->sapevt.sapManagementFrameInfo. - pbFrames, - pSapEvent->sapevt.sapManagementFrameInfo. - frameType, - pSapEvent->sapevt.sapManagementFrameInfo. - rxChan, 0); - return CDF_STATUS_SUCCESS; case eSAP_REMAIN_CHAN_READY: hdd_remain_chan_ready_handler(pHostapdAdapter, pSapEvent->sapevt.sap_roc_ind.scan_id); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cd4e695f1d18..31d5a88cd335 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3159,6 +3159,43 @@ hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *hdd_ctx, return NULL; } +/** + * hdd_get_adapter_by_sme_session_id() - Return adapter with + * the sessionid + * @hdd_ctx: hdd context. + * @sme_session_id: sme session is for the adapter to get. + * + * This function is used to get the adapter with provided session id + * + * Return: adapter pointer if found + * + */ +hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, + uint32_t sme_session_id) +{ + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + hdd_adapter_t *adapter; + CDF_STATUS cdf_status; + + + cdf_status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + + while ((NULL != adapter_node) && + (CDF_STATUS_SUCCESS == cdf_status)) { + adapter = adapter_node->pAdapter; + + if (adapter && + adapter->sessionId == sme_session_id) + return adapter; + + cdf_status = + hdd_get_next_adapter(hdd_ctx, + adapter_node, &next); + adapter_node = next; + } + return NULL; +} + hdd_adapter_t *hdd_get_adapter(hdd_context_t *hdd_ctx, device_mode_t mode) { hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL; @@ -4450,6 +4487,59 @@ static uint8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt, } return 0; } +/** + * hdd_indicate_mgmt_frame() - Wrapper to indicate management frame to + * user space + * @frame_ind: Management frame data to be informed. + * + * This function is used to indicate management frame to + * user space + * + * Return: None + * + */ +void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind) +{ + hdd_context_t *hdd_ctx = NULL; + hdd_adapter_t *adapter = NULL; + void *cds_context = NULL; + int i; + + /* Get the global VOSS context.*/ + cds_context = cds_get_global_context(); + if (!cds_context) { + hddLog(LOGE, FL("Global VOS context is Null")); + return; + } + /* Get the HDD context.*/ + hdd_ctx = + (hdd_context_t *)cds_get_context(CDF_MODULE_ID_HDD); + + if (0 != wlan_hdd_validate_context(hdd_ctx)) + return; + + if (SME_SESSION_ID_ANY == frame_ind->sessionId) { + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + adapter = + hdd_get_adapter_by_sme_session_id(hdd_ctx, i); + if (adapter) + break; + } + } else { + adapter = hdd_get_adapter_by_sme_session_id(hdd_ctx, + frame_ind->sessionId); + } + + if ((NULL != adapter) && + (WLAN_HDD_ADAPTER_MAGIC == adapter->magic)) + __hdd_indicate_mgmt_frame(adapter, + frame_ind->frame_len, + frame_ind->frameBuf, + frame_ind->frameType, + frame_ind->rxChan, + frame_ind->rxRssi); + return; +} /** * hdd_ch_avoid_cb() - Avoid notified channels from FW handler diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index f22f95e95e10..6bbf1c625c2d 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -2084,7 +2084,7 @@ int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) return ret; } -void hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, +void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, uint32_t nFrameLength, uint8_t *pbFrames, uint8_t frameType, uint32_t rxChan, int8_t rxRssi) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index d89063e831b6..c90e433e131d 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1041,7 +1041,7 @@ typedef struct sAniSirGlobal { bool enable_dot11p; uint32_t dual_mac_feature_disable; - + sir_mgmt_frame_ind_callback mgmt_frame_ind_cb; bool first_scan_done; int8_t first_scan_bucket_threshold; } tAniSirGlobal; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 77ed19180ed0..041a17b1aabe 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2577,8 +2577,7 @@ typedef struct sSirKeepAliveReq { } tSirKeepAliveReq, *tpSirKeepAliveReq; typedef struct sSirSmeMgmtFrameInd { - uint16_t mesgType; - uint16_t mesgLen; + uint16_t frame_len; uint32_t rxChan; uint8_t sessionId; uint8_t frameType; @@ -2586,6 +2585,21 @@ typedef struct sSirSmeMgmtFrameInd { uint8_t frameBuf[1]; /* variable */ } tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd; +typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind); +/** + * struct sir_sme_mgmt_frame_cb_req - Register a + * management frame callback req + * + * @message_type: message id + * @length: msg length + * @callback: callback for management frame indication + */ +struct sir_sme_mgmt_frame_cb_req { + uint16_t message_type; + uint16_t length; + sir_mgmt_frame_ind_callback callback; +}; + #ifdef WLAN_FEATURE_11W typedef struct sSirSmeUnprotMgmtFrameInd { uint8_t sessionId; diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index ca7bf580ecf1..12b874d5f02b 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -104,7 +104,6 @@ enum eWniMsgTypes { eWNI_SME_CHNG_MCC_BEACON_INTERVAL, eWNI_SME_REMAIN_ON_CHANNEL_REQ, eWNI_SME_REMAIN_ON_CHN_RSP, - eWNI_SME_MGMT_FRM_IND, eWNI_SME_REMAIN_ON_CHN_RDY_IND, eWNI_SME_SEND_ACTION_FRAME_IND, eWNI_SME_ACTION_FRAME_SEND_CNF, @@ -249,6 +248,7 @@ enum eWniMsgTypes { eWNI_SME_SET_IE_REQ, eWNI_SME_EXT_CHANGE_CHANNEL, eWNI_SME_EXT_CHANGE_CHANNEL_IND, + eWNI_SME_REGISTER_MGMT_FRAME_CB, eWNI_SME_MSG_TYPES_END }; diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c index 08ed8fce3ce3..8a776b99a540 100644 --- a/core/mac/src/pe/lim/lim_p2p.c +++ b/core/mac/src/pe/lim/lim_p2p.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014,2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -380,7 +380,6 @@ void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType, uint16_t sessionId, uint32_t rxChannel, tpPESession psessionEntry, int8_t rxRssi) { - tSirMsgQ mmhMsg; tpSirSmeMgmtFrameInd pSirSmeMgmtFrame = NULL; uint16_t length; @@ -394,8 +393,7 @@ void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType, } cdf_mem_set((void *)pSirSmeMgmtFrame, length, 0); - pSirSmeMgmtFrame->mesgType = eWNI_SME_MGMT_FRM_IND; - pSirSmeMgmtFrame->mesgLen = length; + pSirSmeMgmtFrame->frame_len = frameLen; pSirSmeMgmtFrame->sessionId = sessionId; pSirSmeMgmtFrame->frameType = frameType; pSirSmeMgmtFrame->rxRssi = rxRssi; @@ -404,11 +402,12 @@ void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType, cdf_mem_zero(pSirSmeMgmtFrame->frameBuf, frameLen); cdf_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen); - mmhMsg.type = eWNI_SME_MGMT_FRM_IND; - mmhMsg.bodyptr = pSirSmeMgmtFrame; - mmhMsg.bodyval = 0; - - lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); + if (pMac->mgmt_frame_ind_cb) + pMac->mgmt_frame_ind_cb(pSirSmeMgmtFrame); + else + lim_log(pMac, LOGW, + FL("Management indication callback not registered!!")); + cdf_mem_free(pSirSmeMgmtFrame); return; } diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index ca614fe4ea37..d6e314e7d962 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1354,6 +1354,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) case eWNI_SME_GET_TSM_STATS_REQ: #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ + case eWNI_SME_REGISTER_MGMT_FRAME_CB: case eWNI_SME_EXT_CHANGE_CHANNEL: /* These messages are from HDD.No need to respond to HDD */ lim_process_normal_hdd_msg(mac_ctx, msg, false); diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index c3f4705917f9..03121a6019fe 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4732,6 +4732,34 @@ __lim_process_sme_reset_ap_caps_change(tpAniSirGlobal pMac, uint32_t *pMsgBuf) return; } +/** + * lim_register_mgmt_frame_ind_cb() - Save the Management frame + * indication callback in PE. + * @mac_ptr: Mac pointer + * @msg_buf: Msg pointer containing the callback + * + * This function is used save the Management frame + * indication callback in PE. + * + * Return: None + */ +static void lim_register_mgmt_frame_ind_cb(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) +{ + struct sir_sme_mgmt_frame_cb_req *sme_req = + (struct sir_sme_mgmt_frame_cb_req *)msg_buf; + + if (NULL == msg_buf) { + lim_log(mac_ctx, LOGE, FL("msg_buf is null")); + return; + } + if (sme_req->callback) + mac_ctx->mgmt_frame_ind_cb = + (sir_mgmt_frame_ind_callback)sme_req->callback; + else + lim_log(mac_ctx, LOGE, FL("sme_req->callback is null")); +} + /** * lim_process_sme_req_messages() * @@ -4968,6 +4996,9 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) case eWNI_SME_SET_IE_REQ: lim_process_set_ie_req(pMac, pMsgBuf); break; + case eWNI_SME_REGISTER_MGMT_FRAME_CB: + lim_register_mgmt_frame_ind_cb(pMac, pMsgBuf); + break; case eWNI_SME_EXT_CHANGE_CHANNEL: lim_process_ext_change_channel(pMac, pMsgBuf); break; diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index 63f13c8fe787..10b000bb9227 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -283,7 +283,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_HIDE_SSID_REQ); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHANNEL_REQ); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RSP); - CASE_RETURN_STRING(eWNI_SME_MGMT_FRM_IND); CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RDY_IND); CASE_RETURN_STRING(eWNI_SME_SEND_ACTION_FRAME_IND); CASE_RETURN_STRING(eWNI_SME_ACTION_FRAME_SEND_CNF); @@ -334,6 +333,7 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_SET_HW_MODE_REQ); CASE_RETURN_STRING(eWNI_SME_SET_HW_MODE_RESP); CASE_RETURN_STRING(eWNI_SME_HW_MODE_TRANS_IND); + CASE_RETURN_STRING(eWNI_SME_REGISTER_MGMT_FRAME_CB); default: return (uint8_t *) "UNKNOWN"; break; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 75f92b5454d7..40f3b2d3073a 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -158,7 +158,6 @@ typedef enum { eSAP_GET_WPSPBC_SESSION_EVENT, /* Event send on WPS PBC probe request is received */ eSAP_WPS_PBC_PROBE_REQ_EVENT, - eSAP_INDICATE_MGMT_FRAME, eSAP_REMAIN_CHAN_READY, eSAP_SEND_ACTION_CNF, eSAP_DISCONNECT_ALL_P2P_CLIENT, @@ -448,8 +447,6 @@ typedef struct sap_Event_s { tSap_GetWPSPBCSessionEvent sapGetWPSPBCSessionEvent; /*eSAP_WPS_PBC_PROBE_REQ_EVENT */ tSap_WPSPBCProbeReqEvent sapPBCProbeReqEvent; - /*eSAP_INDICATE_MGMT_FRAME */ - tSap_ManagementFrameInfo sapManagementFrameInfo; /* eSAP_SEND_ACTION_CNF */ tSap_SendActionCnf sapActionCnf; /* eSAP_UNKNOWN_STA_JOIN */ diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 381f444d640b..0474e2120f14 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -888,11 +888,6 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId, FL("CSR roam_status = eCSR_ROAM_WPS_PBC_PROBE_REQ_IND (%d)\n"), roam_status); break; - case eCSR_ROAM_INDICATE_MGMT_FRAME: - sap_signal_hdd_event(sap_ctx, csr_roam_info, - eSAP_INDICATE_MGMT_FRAME, - (void *) eSAP_STATUS_SUCCESS); - break; case eCSR_ROAM_REMAIN_CHAN_READY: /* roamId contains scan identifier */ sap_ctx->roc_ind_scan_id = csr_roam_info->roc_scan_id; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b14deb41f103..8335de53ab5f 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -818,7 +818,6 @@ static uint8_t *sap_hdd_event_to_string(eSapHddEvent event) CASE_RETURN_STRING(eSAP_ASSOC_STA_CALLBACK_EVENT); CASE_RETURN_STRING(eSAP_GET_WPSPBC_SESSION_EVENT); CASE_RETURN_STRING(eSAP_WPS_PBC_PROBE_REQ_EVENT); - CASE_RETURN_STRING(eSAP_INDICATE_MGMT_FRAME); CASE_RETURN_STRING(eSAP_REMAIN_CHAN_READY); CASE_RETURN_STRING(eSAP_SEND_ACTION_CNF); CASE_RETURN_STRING(eSAP_DISCONNECT_ALL_P2P_CLIENT); @@ -2516,7 +2515,6 @@ CDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, tSap_StationDisassocCompleteEvent *disassoc_comp; tSap_StationSetKeyCompleteEvent *key_complete; tSap_StationMICFailureEvent *mic_failure; - tSap_ManagementFrameInfo *mgmt_frame; /* Format the Start BSS Complete event to return... */ if (NULL == sap_ctx->pfnSapEventCallback) { @@ -2732,16 +2730,6 @@ CDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, sizeof(tSirWPSPBCProbeReq)); break; - case eSAP_INDICATE_MGMT_FRAME: - sap_ap_event.sapHddEventCode = eSAP_INDICATE_MGMT_FRAME; - mgmt_frame = &sap_ap_event.sapevt.sapManagementFrameInfo; - - mgmt_frame->nFrameLength = csr_roaminfo->nFrameLength; - mgmt_frame->pbFrames = csr_roaminfo->pbFrames; - mgmt_frame->frameType = csr_roaminfo->frameType; - mgmt_frame->rxChan = csr_roaminfo->rxChan; - break; - case eSAP_REMAIN_CHAN_READY: sap_ap_event.sapHddEventCode = eSAP_REMAIN_CHAN_READY; sap_ap_event.sapevt.sap_roc_ind.scan_id = diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 08e3b15f3e37..0b16d7b54787 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -480,7 +480,6 @@ typedef enum { eCSR_ROAM_FT_RESPONSE, #endif eCSR_ROAM_FT_START, - eCSR_ROAM_INDICATE_MGMT_FRAME, eCSR_ROAM_REMAIN_CHAN_READY, eCSR_ROAM_SEND_ACTION_CNF, /* this mean error happens before assoc_start/roam_start is called. */ diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a00d847576b8..9ef7599b29ed 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -973,6 +973,9 @@ CDF_STATUS sme_set_rssi_monitoring(tHalHandle hal, CDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle hal, void (*cb)(void *, struct rssi_breach_event *)); +CDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal, + sir_mgmt_frame_ind_callback callback); + CDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss); bool sme_is_any_session_in_connected_state(tHalHandle h_hal); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 5178a8de8521..92bbe82a8a8d 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -74,8 +74,6 @@ extern void qos_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); extern CDF_STATUS p2p_process_remain_on_channel_cmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); extern CDF_STATUS sme_remain_on_chn_rsp(tpAniSirGlobal pMac, uint8_t *pMsg); -extern CDF_STATUS sme_mgmt_frm_ind(tHalHandle hHal, - tpSirSmeMgmtFrameInd pSmeMgmtFrm); extern CDF_STATUS sme_remain_on_chn_ready(tHalHandle hHal, uint8_t *pMsg); extern CDF_STATUS sme_send_action_cnf(tHalHandle hHal, uint8_t *pMsg); @@ -2350,15 +2348,6 @@ CDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg) pMsg->type); } break; - case eWNI_SME_MGMT_FRM_IND: - if (pMsg->bodyptr) { - sme_mgmt_frm_ind(pMac, pMsg->bodyptr); - cdf_mem_free(pMsg->bodyptr); - } else { - sms_log(pMac, LOGE, FL("Empty message for %d"), - pMsg->type); - } - break; case eWNI_SME_ACTION_FRAME_SEND_CNF: if (pMsg->bodyptr) { status = sme_send_action_cnf(pMac, pMsg->bodyptr); @@ -6128,6 +6117,48 @@ CDF_STATUS sme_get_operation_channel(tHalHandle hHal, uint32_t *pChannel, return CDF_STATUS_E_FAILURE; } /* sme_get_operation_channel ends here */ +/** + * sme_register_mgmt_frame_ind_callback() - Register a callback for + * management frame indication to PE. + * + * @hal: hal pointer + * @callback: callback pointer to be registered + * + * This function is used to register a callback for management + * frame indication to PE. + * + * Return: Success if msg is posted to PE else Failure. + */ +CDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal, + sir_mgmt_frame_ind_callback callback) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + struct sir_sme_mgmt_frame_cb_req *msg; + CDF_STATUS status = CDF_STATUS_SUCCESS; + + sms_log(mac_ctx, LOG1, FL(": ENTER")); + + if (CDF_STATUS_SUCCESS == + sme_acquire_global_lock(&mac_ctx->sme)) { + msg = cdf_mem_malloc(sizeof(*msg)); + if (NULL == msg) { + sms_log(mac_ctx, LOGE, + FL("Not able to allocate memory for eWNI_SME_REGISTER_MGMT_FRAME_CB")); + sme_release_global_lock(&mac_ctx->sme); + return CDF_STATUS_E_NOMEM; + } + cdf_mem_set(msg, sizeof(*msg), 0); + msg->message_type = eWNI_SME_REGISTER_MGMT_FRAME_CB; + msg->length = sizeof(*msg); + + msg->callback = callback; + status = cds_send_mb_message_to_mac(msg); + sme_release_global_lock(&mac_ctx->sme); + return status; + } + return CDF_STATUS_E_FAILURE; +} + /* --------------------------------------------------------------------------- \fn sme_RegisterMgtFrame diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 527c4d4090f7..e78d8b518ddc 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -203,7 +203,6 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val) CASE_RETURN_STR(eCSR_ROAM_FT_RESPONSE); #endif CASE_RETURN_STR(eCSR_ROAM_FT_START); - CASE_RETURN_STR(eCSR_ROAM_INDICATE_MGMT_FRAME); CASE_RETURN_STR(eCSR_ROAM_REMAIN_CHAN_READY); CASE_RETURN_STR(eCSR_ROAM_SEND_ACTION_CNF); CASE_RETURN_STR(eCSR_ROAM_SESSION_OPENED); diff --git a/core/sme/src/p2p/p2p_api.c b/core/sme/src/p2p/p2p_api.c index 36c17d435651..118f78ad3159 100644 --- a/core/sme/src/p2p/p2p_api.c +++ b/core/sme/src/p2p/p2p_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -139,46 +139,6 @@ CDF_STATUS sme_remain_on_chn_rsp(tpAniSirGlobal pMac, uint8_t *pMsg) return status; } -/*------------------------------------------------------------------ - * - * Handle the Mgmt frm ind from LIM and forward to HDD. - * - *------------------------------------------------------------------*/ - -CDF_STATUS sme_mgmt_frm_ind(tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - CDF_STATUS status = CDF_STATUS_SUCCESS; - tCsrRoamInfo pRoamInfo = { 0 }; - uint8_t i = 0; - uint32_t SessionId = pSmeMgmtFrm->sessionId; - - pRoamInfo.nFrameLength = - pSmeMgmtFrm->mesgLen - sizeof(tSirSmeMgmtFrameInd); - pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; - pRoamInfo.frameType = pSmeMgmtFrm->frameType; - pRoamInfo.rxChan = pSmeMgmtFrm->rxChan; - pRoamInfo.rxRssi = pSmeMgmtFrm->rxRssi; - if (CSR_IS_SESSION_ANY(SessionId)) { - for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { - if (CSR_IS_SESSION_VALID(pMac, i)) { - SessionId = i; - break; - } - } - } - - if (i == CSR_ROAM_SESSION_MAX) { - sms_log(pMac, LOGE, FL("No valid sessions found.")); - return CDF_STATUS_E_FAILURE; - } - /* forward the mgmt frame to HDD */ - csr_roam_call_callback(pMac, SessionId, &pRoamInfo, 0, - eCSR_ROAM_INDICATE_MGMT_FRAME, 0); - - return status; -} - /*------------------------------------------------------------------ * * Handle the remain on channel ready indication from PE