Browse Source

qcacld-3.0: Fix sme message callback context param

The SME message callback is currently being used in a manner that is
inconsistent with its signature. The signature specifies that a
tHalHandle should be passed but PE actually passes a tpAniSirGlobal.
Since this is a MAC internal interface update the logic to
consistently use a tpAniSirGlobal.

Change-Id: I8bf94a3dd603b76bdbe7c0db3555736692f64cb7
CRs-Fixed: 2266188
Jeff Johnson 6 years ago
parent
commit
5f9ce2d24d
4 changed files with 27 additions and 24 deletions
  1. 1 1
      core/mac/inc/ani_global.h
  2. 2 1
      core/mac/inc/sir_api.h
  3. 18 4
      core/sme/inc/sme_api.h
  4. 6 18
      core/sme/src/common/sme_api.c

+ 1 - 1
core/mac/inc/ani_global.h

@@ -759,7 +759,7 @@ typedef struct sAniSirLim {
 	uint8_t gLimDfsChanSwTxCount;
 	uint8_t gLimDfsTargetChanNum;
 	QDF_STATUS(*sme_msg_callback)
-		(tHalHandle hal, struct scheduler_msg *msg);
+		(tpAniSirGlobal mac, struct scheduler_msg *msg);
 	uint8_t retry_packet_cnt;
 	uint8_t beacon_probe_rsp_cnt_per_scan;
 	wlan_scan_requester req_id;

+ 2 - 1
core/mac/inc/sir_api.h

@@ -412,7 +412,8 @@ typedef struct sSirSmeReadyReq {
 	uint16_t transactionId;
 	void *csr_roam_synch_cb;
 	void *pe_roam_synch_cb;
-	void *sme_msg_cb;
+	QDF_STATUS (*sme_msg_cb)(tpAniSirGlobal mac,
+				 struct scheduler_msg *msg);
 } tSirSmeReadyReq, *tpSirSmeReadyReq;
 
 /**

+ 18 - 4
core/sme/inc/sme_api.h

@@ -340,7 +340,21 @@ QDF_STATUS sme_hdd_ready_ind(tHalHandle hHal);
  */
 QDF_STATUS sme_ser_cmd_callback(void *buf,
 				enum wlan_serialization_cb_reason reason);
-QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg);
+
+/*
+ * sme_process_msg() - The main message processor for SME.
+ * @mac: The global mac context
+ * @msg: The message to be processed.
+ *
+ * This function is called by a message dispatcher when to process a message
+ * targeted for SME.
+ * This is a synchronous call
+ *
+ * Return: QDF_STATUS_SUCCESS - SME successfully processed the message.
+ * Other status means SME failed to process the message to HAL.
+ */
+QDF_STATUS sme_process_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg);
+
 QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg);
 QDF_STATUS sme_scan_get_result(tHalHandle hHal, uint8_t sessionId,
 		tCsrScanResultFilter *pFilter,
@@ -1945,15 +1959,15 @@ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id);
 
 /**
  * sme_process_msg_callback() - process callback message from LIM
- * @hal: global hal handle
+ * @mac: global mac context
  * @msg: scheduler message
  *
  * This function process the callback messages from LIM.
  *
  * Return: QDF_STATUS enumeration.
  */
-QDF_STATUS sme_process_msg_callback(tHalHandle hal,
-				struct scheduler_msg *msg);
+QDF_STATUS sme_process_msg_callback(tpAniSirGlobal mac,
+				    struct scheduler_msg *msg);
 
 /**
  * sme_set_bmiss_bcnt() - set bmiss config parameters

+ 6 - 18
core/sme/src/common/sme_api.c

@@ -1952,21 +1952,9 @@ static QDF_STATUS sme_process_antenna_mode_resp(tpAniSirGlobal mac,
 	return QDF_STATUS_SUCCESS;
 }
 
-/*
- * sme_process_msg() - The main message processor for SME.
- *  The function is called by a message dispatcher when to process a message
- *  targeted for SME.
- *  This is a synchronous call
- *
- * hHal - The handle returned by mac_open.
- * pMsg - A pointer to a caller allocated object of tSirMsgQ.
- * Return QDF_STATUS_SUCCESS - SME successfully process the message.
- * Other status means SME failed to process the message to HAL.
- */
-QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
+QDF_STATUS sme_process_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
 	struct sir_peer_info *peer_stats;
 	struct sir_peer_info_resp *peer_info_rsp;
 
@@ -2179,7 +2167,7 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
 		MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_WMA_MSG,
 				 NO_SESSION, pMsg->type));
 		if (pMsg->bodyptr) {
-			sme_nan_event(hHal, pMsg->bodyptr);
+			sme_nan_event(MAC_HANDLE(pMac), pMsg->bodyptr);
 			qdf_mem_free(pMsg->bodyptr);
 		}
 		break;
@@ -2403,7 +2391,7 @@ QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg)
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	return sme_process_msg((tHalHandle)mac_ctx, msg);
+	return sme_process_msg(mac_ctx, msg);
 }
 
 /**
@@ -15636,8 +15624,8 @@ QDF_STATUS sme_get_chain_rssi(tHalHandle hal,
 	return status;
 }
 
-QDF_STATUS sme_process_msg_callback(tHalHandle hal,
-				struct scheduler_msg *msg)
+QDF_STATUS sme_process_msg_callback(tpAniSirGlobal mac,
+				    struct scheduler_msg *msg)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
@@ -15645,7 +15633,7 @@ QDF_STATUS sme_process_msg_callback(tHalHandle hal,
 		sme_err("Empty message for SME Msg callback");
 		return status;
 	}
-	status = sme_process_msg(hal, msg);
+	status = sme_process_msg(mac, msg);
 	return status;
 }