From 92675a5d15e29d9850f46492c8faa7ae18effb2f Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 25 Sep 2017 15:35:19 -0700 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_hostapd.c | 6 +++--- core/sap/inc/sap_api.h | 10 +++++++++- core/sap/src/sap_module.c | 15 ++------------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index c84e0157f622..755e1d5b395f 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/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; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index d603391b83b0..407a3689c6f8 100644 --- a/core/sap/inc/sap_api.h +++ b/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); diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index b0e6f5af493c..0b8df8124fec 100644 --- a/core/sap/src/sap_module.c +++ b/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); } /**