Browse Source

qcacld-3.0: Refine API wlansap_channel_change_request()

See change "qcacld-3.0: Refine API wlansap_open()" for the API
history.  Update wlansap_channel_change_request() to use the
true struct pointer type.

Change-Id: I829d33be89e319d6e81b99b94badb023109c29b2
CRs-Fixed: 2116267
Jeff Johnson 7 năm trước cách đây
mục cha
commit
164b3bb59f

+ 21 - 2
core/sap/inc/sap_api.h

@@ -1244,8 +1244,27 @@ QDF_STATUS wlansap_de_register_mgmt_frame(struct sap_context *pSapCtx,
 					  uint8_t *match_data,
 					  uint16_t match_len);
 
-QDF_STATUS wlansap_channel_change_request(void *p_cds_gctx,
-		uint8_t tArgetChannel);
+/**
+ * wlansap_channel_change_request() - Send channel change request
+ * @sapContext: Pointer to the SAP context
+ * @target_channel: Target channel
+ *
+ * This API is used to send an Indication to SME/PE to change the
+ * current operating channel to a different target channel.
+ *
+ * The Channel change will be issued by SAP under the following
+ * scenarios.
+ * 1. A radar indication is received  during SAP CAC WAIT STATE and
+ *    channel change is required.
+ * 2. A radar indication is received during SAP STARTED STATE and
+ *    channel change is required.
+ *
+ * Return: The QDF_STATUS code associated with performing the operation
+ *   QDF_STATUS_SUCCESS:  Success
+ *
+ */
+QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext,
+					  uint8_t target_channel);
 
 /**
  * wlansap_start_beacon_req() - Send Start Beaconing Request

+ 5 - 20
core/sap/src/sap_api_link_cntl.c

@@ -289,29 +289,14 @@ static QDF_STATUS sap_hdd_signal_event_handler(void *ctx)
 	return status;
 }
 
-/**
- *
- * wlansap_pre_start_bss_acs_scan_callback() - callback for scan results
- *
- * hal_handle:    the hal_handle passed in with the scan request
- * pcontext:      the second context pass in for the caller, opaque sap Handle.
- * scanid:        scan id passed
- * sessionid:     session identifier
- * status:        status of scan -success, failure or abort
- *
- * Api for scan callback. This function is invoked as a result of scan
- * completion and reports the scan results.
- *
- * Return: The QDF_STATUS code associated with performing the operation
- */
-QDF_STATUS
-wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext,
-					uint8_t sessionid, uint32_t scanid,
-					eCsrScanStatus scan_status)
+QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle,
+						   struct sap_context *sap_ctx,
+						   uint8_t sessionid,
+						   uint32_t scanid,
+						   eCsrScanStatus scan_status)
 {
 	tScanResultHandle presult = NULL;
 	QDF_STATUS scan_get_result_status = QDF_STATUS_E_FAILURE;
-	struct sap_context *sap_ctx = pcontext;
 	uint8_t oper_channel = 0;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 

+ 2 - 2
core/sap/src/sap_fsm.c

@@ -3264,7 +3264,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx,
 					(void *)eSAP_STATUS_SUCCESS);
 
 				wlansap_channel_change_request(
-					(void *)t_sap_ctx,
+					t_sap_ctx,
 					mac_ctx->sap.SapDfsInfo.target_channel);
 			}
 		}
@@ -3546,7 +3546,7 @@ static QDF_STATUS sap_fsm_state_disconnecting(struct sap_context *sap_ctx,
 		 * Most likely, radar has been detected and SAP wants to
 		 * change the channel
 		 */
-		qdf_status = wlansap_channel_change_request((void *) sap_ctx,
+		qdf_status = wlansap_channel_change_request(sap_ctx,
 				mac_ctx->sap.SapDfsInfo.target_channel);
 
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,

+ 18 - 8
core/sap/src/sap_internal.h

@@ -303,14 +303,24 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle,
 				 uint8_t session_id,
 				 uint32_t scan_id, eCsrScanStatus scan_status);
 
-QDF_STATUS
-wlansap_pre_start_bss_acs_scan_callback(
-	tHalHandle hal_handle,
-	void *pcontext,
-	uint8_t sessionid,
-	uint32_t scanid,
-	eCsrScanStatus scan_status
-);
+/**
+ * wlansap_pre_start_bss_acs_scan_callback() - callback for scan results
+ * @hal_handle:    the hal_handle passed in with the scan request
+ * @sap_ctx:       the SAP context pointer.
+ * @scanid:        scan id passed
+ * @sessionid:     session identifier
+ * @scan_status:        status of scan -success, failure or abort
+ *
+ * Api for scan callback. This function is invoked as a result of scan
+ * completion and reports the scan results.
+ *
+ * Return: The QDF_STATUS code associated with performing the operation
+ */
+QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle,
+						   struct sap_context *sap_ctx,
+						   uint8_t sessionid,
+						   uint32_t scanid,
+						   eCsrScanStatus scan_status);
 
 QDF_STATUS
 wlansap_roam_callback

+ 2 - 31
core/sap/src/sap_module.c

@@ -1793,43 +1793,14 @@ QDF_STATUS wlansap_de_register_mgmt_frame(struct sap_context *pSapCtx,
 	return QDF_STATUS_E_FAULT;
 }
 
-/*==========================================================================
-   FUNCTION   wlansap_channel_change_request
-
-   DESCRIPTION
-   This API is used to send an Indication to SME/PE to change the
-   current operating channel to a different target channel.
-
-   The Channel change will be issued by SAP under the following
-   scenarios.
-   1. A radar indication is received  during SAP CAC WAIT STATE and
-      channel change is required.
-   2. A radar indication is received during SAP STARTED STATE and
-      channel change is required.
-   DEPENDENCIES
-   NA.
-
-   PARAMETERS
-   IN
-   pSapCtx: Pointer to cds global context structure
-
-   RETURN VALUE
-   The QDF_STATUS code associated with performing the operation
-
-   QDF_STATUS_SUCCESS:  Success
-
-   SIDE EFFECTS
-   ============================================================================*/
-QDF_STATUS
-wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
+QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext,
+					  uint8_t target_channel)
 {
-	struct sap_context *sapContext = NULL;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 	tpAniSirGlobal mac_ctx = NULL;
 	eCsrPhyMode phy_mode;
 	struct ch_params *ch_params;
-	sapContext = pSapCtx;
 
 	if (NULL == sapContext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,