Ver Fonte

qcacld-3.0: Refine API wlansap_stop_bss()

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

Change-Id: I225637ad0543e721bee34378cd3619e1fb785c60
CRs-Fixed: 2116267
Jeff Johnson há 7 anos atrás
pai
commit
16e29cd0de
2 ficheiros alterados com 18 adições e 32 exclusões
  1. 15 1
      core/sap/inc/sap_api.h
  2. 3 31
      core/sap/src/sap_module.c

+ 15 - 1
core/sap/inc/sap_api.h

@@ -919,6 +919,20 @@ QDF_STATUS wlansap_start_bss(struct sap_context *pSapCtx,
 			     tpWLAN_SAPEventCB pSapEventCallback,
 			     tsap_Config_t *pConfig, void *pUsrContext);
 
+/**
+ * wlansap_stop_bss() - stop BSS.
+ * @pSapCtx: Pointer to SAP context
+ *
+ * This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for
+ * stopping AP BSS
+ *
+ * Return: The result code associated with performing the operation
+ *         QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
+ *                             access would cause a page fault
+ *         QDF_STATUS_SUCCESS: Success
+ */
+QDF_STATUS wlansap_stop_bss(struct sap_context *pSapCtx);
+
 /**
  * wlan_sap_update_next_channel() - Update next channel configured using vendor
  * command in SAP context
@@ -949,7 +963,7 @@ QDF_STATUS wlan_sap_get_pre_cac_vdev_id(tHalHandle handle, uint8_t *vdev_id);
 uint16_t wlansap_check_cc_intf(struct sap_context *pSapCtx);
 #endif
 QDF_STATUS wlansap_set_mac_acl(void *p_cds_gctx, tsap_Config_t *pConfig);
-QDF_STATUS wlansap_stop_bss(void *p_cds_gctx);
+
 QDF_STATUS wlansap_disassoc_sta(void *p_cds_gctx,
 				struct tagCsrDelStaParams *p_del_sta_params);
 QDF_STATUS wlansap_deauth_sta(void *p_cds_gctx,

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

@@ -830,42 +830,14 @@ QDF_STATUS wlansap_set_mac_acl(void *pCtx,    /* pwextCtx */
 	return qdf_status;
 } /* wlansap_set_mac_acl */
 
-/**
- * wlansap_stop_bss() - stop BSS.
- * @pCtx: Pointer to the global cds context; a handle to SAP's control block
- *        can be extracted from its context. When MBSSID feature is enabled,
- *        SAP context is directly passed to SAP APIs.
- *
- * This api function provides SAP FSM event eSAP_HDD_STOP_INFRA_BSS for
- * stopping AP BSS
- *
- * Return: The result code associated with performing the operation
- *         QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL;
- *                             access would cause a page fault
- *         QDF_STATUS_SUCCESS: Success
- */
-QDF_STATUS wlansap_stop_bss(void *pCtx)
+QDF_STATUS wlansap_stop_bss(struct sap_context *pSapCtx)
 {
 	tWLAN_SAPEvent sapEvent;        /* State machine event */
-	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	struct sap_context *pSapCtx = NULL;
-	/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
-
-	/*------------------------------------------------------------------------
-	    Sanity check
-	    Extract SAP control block
-	   ------------------------------------------------------------------------*/
-	if (NULL == pCtx) {
-		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Invalid Global CDS handle", __func__);
-		return QDF_STATUS_E_FAULT;
-	}
-
-	pSapCtx = CDS_GET_SAP_CB(pCtx);
+	QDF_STATUS qdf_status;
 
 	if (NULL == pSapCtx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Invalid SAP pointer from pCtx", __func__);
+			  "%s: Invalid SAP pointer", __func__);
 		return QDF_STATUS_E_FAULT;
 	}