diff options
| author | kaliu <kaliu@qti.qualcomm.com> | 2016-04-26 09:04:51 +0800 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-29 15:10:11 +0530 |
| commit | 0915b202268c73bb524077d0b180dbb73eb7ed10 (patch) | |
| tree | 5c3813a496118636f831fe27692723e7a4a16e89 | |
| parent | 083fa571a0857422764b28bbd1cf605b10652557 (diff) | |
qcacld-2.0: Add interface to get channel width in sap mode
Add iwpriv interface to get channel width when working in sap mode.
Change-Id: I9900655861032636af1b4147ec6322e5aa76e614
CRs-Fixed: 1009861
| -rw-r--r-- | CORE/HDD/inc/qc_sap_ioctl.h | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 41 | ||||
| -rw-r--r-- | CORE/SAP/inc/sapApi.h | 2 | ||||
| -rw-r--r-- | CORE/SAP/src/sapModule.c | 19 |
4 files changed, 63 insertions, 0 deletions
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h index 439b4d77243b..570e6c03001a 100644 --- a/CORE/HDD/inc/qc_sap_ioctl.h +++ b/CORE/HDD/inc/qc_sap_ioctl.h @@ -267,6 +267,7 @@ enum { QCASAP_PARAM_TX_STBC, QCASAP_PARAM_RX_STBC, QCASAP_SET_RADAR_DBG, + QCSAP_PARAM_CHAN_WIDTH, }; int iw_get_channel_list(struct net_device *dev, diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 8a6de894828f..f821fc1c8673 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -2472,6 +2472,42 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel) return ret; } +/** + * hdd_sap_get_chan_width() - get channel width of sap + * @adapter: adapter being queried + * @value: where to store the value + * + * Return: 0 on success, negative errno on failure + */ +static int hdd_sap_get_chan_width(hdd_adapter_t *adapter, int *value) +{ + void *pvosctx; + uint32_t vht_channel_width = 0; + hdd_context_t *hdd_ctx; + hdd_hostapd_state_t *phostapdstate; + + ENTER(); + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + phostapdstate = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter); + + if (phostapdstate->bssState != BSS_START) { + *value = -EINVAL; + return -EINVAL; + } + +#ifdef WLAN_FEATURE_MBSSID + pvosctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter); +#else + pvosctx = hdd_ctx->pvosContext; +#endif + + wlansap_get_chan_width(pvosctx, &vht_channel_width); + *value = vht_channel_width; + hddLog(LOGW, FL("chan_width = %d"), vht_channel_width); + + return 0; +} + int static __iw_softap_set_ini_cfg(struct net_device *dev, struct iw_request_info *info, @@ -3792,6 +3828,9 @@ static __iw_softap_getparam(struct net_device *dev, ret = hdd_get_rx_stbc(pHostapdAdapter, value); break; + case QCSAP_PARAM_CHAN_WIDTH: + ret = hdd_sap_get_chan_width(pHostapdAdapter, value); + break; default: hddLog(LOGE, FL("Invalid getparam command %d"), sub_cmd); ret = -EINVAL; @@ -6687,6 +6726,8 @@ static const struct iw_priv_args hostapd_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_tx_stbc" }, { QCASAP_PARAM_RX_STBC, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rx_stbc" }, + { QCSAP_PARAM_CHAN_WIDTH, 0, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_chwidth" }, #ifdef WLAN_FEATURE_TSF { QCSAP_CAP_TSF, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "cap_tsf" }, diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index 52452d09ea4d..dd37c2ecca1c 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -2394,6 +2394,8 @@ wlansap_get_phymode(v_PVOID_t pctx); VOS_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal, uint16 tx_leakage_threshold); +VOS_STATUS wlansap_get_chan_width(void *pvosctx, + uint32_t *pchanwidth); #ifdef __cplusplus } diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index fe619deb637a..0b369cc52dc8 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -4007,3 +4007,22 @@ VOS_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal, return VOS_STATUS_SUCCESS; } +/** + * wlansap_get_chan_width() - get sap channel width. + * @pvosctx: pointer of global vos context + * @pchanwidth: pointer of channel width + * + * This function get channel width of sap. + * + * Return: VOS_STATUS. + */ +VOS_STATUS +wlansap_get_chan_width(void *pvosctx, uint32_t *pchanwidth) +{ + ptSapContext sapcontext; + sapcontext = VOS_GET_SAP_CB(pvosctx); + *pchanwidth = wlan_sap_get_vht_ch_width(sapcontext); + + return VOS_STATUS_SUCCESS; +} + |
