浏览代码

qcacld-3.0: Refine API wlansap_close()

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

Change-Id: Ia0f05b1ed80b3cc317f8951e6d1ccd94eee35c9c
CRs-Fixed: 2116267
Jeff Johnson 7 年之前
父节点
当前提交
70955b5bdc
共有 2 个文件被更改,包括 17 次插入21 次删除
  1. 14 1
      core/sap/inc/sap_api.h
  2. 3 20
      core/sap/src/sap_module.c

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

@@ -803,6 +803,20 @@ struct sap_context;
  */
 struct sap_context *wlansap_open(void);
 
+/**
+ * wlansap_close - close per-BSS SAP
+ * @pSapCtx: Pointer to the SAP context
+ *
+ * Called during BSS close procedure. SAP will clean up all the
+ * internal resources.
+ *
+ * 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_close(struct sap_context *pSapCtx);
+
 void sap_cleanup_channel_list(void *sapContext);
 
 /**
@@ -818,7 +832,6 @@ QDF_STATUS wlansap_global_deinit(void);
 QDF_STATUS wlansap_start(void *p_cds_gctx, enum tQDF_ADAPTER_MODE mode,
 			 uint8_t *addr, uint32_t session_id);
 QDF_STATUS wlansap_stop(void *p_cds_gctx);
-QDF_STATUS wlansap_close(void *p_cds_gctx);
 typedef QDF_STATUS (*tpWLAN_SAPEventCB)(tpSap_Event pSapEvent,
 					void *pUsrContext);
 

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

@@ -431,38 +431,21 @@ QDF_STATUS wlansap_stop(void *pCtx)
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * wlansap_close - close SAP module.
- * @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.
- *
- * Called by cds_close during general driver close procedure. SAP will clean up
- * all the internal resources.
- *
- * 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_close(void *pCtx)
+QDF_STATUS wlansap_close(struct sap_context *pSapCtx)
 {
-	struct sap_context *pSapCtx = NULL;
 	tHalHandle hal;
 
-	/* Sanity check - Extract SAP control block */
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 		  "wlansap_close invoked");
 
-	pSapCtx = CDS_GET_SAP_CB(pCtx);
 	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;
 	}
 	/* Cleanup SAP control block */
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, FL("Enter"));
-	sap_cleanup_channel_list(pCtx);
+	sap_cleanup_channel_list(pSapCtx);
 	hal = CDS_GET_HAL_CB();
 	if (!hal)
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,