Browse Source

qcacld-3.0: Refine API wlansap_get_chan_width()

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

Change-Id: Iec86249524c042ae6dba818bb5983fd91d9e61fd
CRs-Fixed: 2116267
Jeff Johnson 7 years ago
parent
commit
92675a5d15
3 changed files with 14 additions and 17 deletions
  1. 3 3
      core/hdd/src/wlan_hdd_hostapd.c
  2. 9 1
      core/sap/inc/sap_api.h
  3. 2 13
      core/sap/src/sap_module.c

+ 3 - 3
core/hdd/src/wlan_hdd_hostapd.c

@@ -2829,7 +2829,7 @@ static iw_softap_set_ini_cfg(struct net_device *dev,
 
 static int hdd_sap_get_chan_width(struct hdd_adapter *adapter, int *value)
 {
-	void *cds_ctx;
+	struct sap_context *sap_ctx;
 	hdd_hostapd_state_t *hostapdstate;
 
 	ENTER();
@@ -2840,9 +2840,9 @@ static int hdd_sap_get_chan_width(struct hdd_adapter *adapter, int *value)
 		return -EINVAL;
 	}
 
-	cds_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
+	sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
 
-	*value = wlansap_get_chan_width(cds_ctx);
+	*value = wlansap_get_chan_width(sap_ctx);
 	hdd_debug("chan_width = %d", *value);
 
 	return 0;

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

@@ -1349,7 +1349,15 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
 				tsap_Config_t *pconfig,
 				void *pusr_context);
 
-uint32_t wlansap_get_chan_width(void *cds_ctx);
+/**
+ * wlansap_get_chan_width() - get sap channel width.
+ * @sap_ctx: pointer to the SAP context
+ *
+ * This function get channel width of sap.
+ *
+ * Return: sap channel width
+ */
+uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx);
 
 QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
 			uint16_t tx_leakage_threshold);

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

@@ -2810,20 +2810,9 @@ void wlan_sap_enable_phy_error_logs(tHalHandle hal, bool enable_log)
 	mac_ctx->sap.enable_dfs_phy_error_logs = enable_log;
 }
 
-/**
- * wlansap_get_chan_width() - get sap channel width.
- * @cds_ctx: pointer of global cds context
- *
- * This function get channel width of sap.
- *
- * Return: sap channel width
- */
-uint32_t wlansap_get_chan_width(void *cds_ctx)
+uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx)
 {
-	struct sap_context *sapcontext;
-
-	sapcontext = CDS_GET_SAP_CB(cds_ctx);
-	return wlan_sap_get_vht_ch_width(sapcontext);
+	return wlan_sap_get_vht_ch_width(sap_ctx);
 }
 
 /**