Quellcode durchsuchen

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
Abhishek Singh vor 9 Jahren
Ursprung
Commit
7996eb7a8e

+ 3 - 0
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);

+ 2 - 2
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);
 

+ 0 - 8
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;

+ 3 - 0
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 */

+ 0 - 11
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);

+ 90 - 0
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

+ 1 - 1
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)

+ 2 - 2
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;

+ 16 - 2
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;

+ 2 - 2
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
 };
 

+ 8 - 9
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;
 }
 

+ 2 - 1
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);

+ 31 - 0
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;

+ 2 - 2
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;

+ 1 - 4
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 */

+ 1 - 6
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;

+ 1 - 13
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 =

+ 0 - 1
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. */

+ 4 - 1
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);

+ 43 - 12
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

+ 1 - 2
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);

+ 1 - 41
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