summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Liu <kaliu@codeaurora.org>2016-09-28 22:55:44 +0800
committerqcabuildsw <qcabuildsw@localhost>2016-10-19 17:42:26 -0700
commitbdd5fcb83f160ce0213ebaf4af326171b2db8168 (patch)
tree340b80f5e57c0171b91ce03420ef07f3c1059a88
parent5047d513abd1fa7952c093c24e6fa8bfecab9891 (diff)
qcacld-3.0: Add interface to get channel width in sap mode
qcacld-2.0 to qcacld-3.0 propagation 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.h1
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c30
-rw-r--r--core/sap/inc/sap_api.h2
-rw-r--r--core/sap/src/sap_module.c17
4 files changed, 50 insertions, 0 deletions
diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h
index 70467c2a913e..6ef7ba1c0d65 100644
--- a/core/hdd/inc/qc_sap_ioctl.h
+++ b/core/hdd/inc/qc_sap_ioctl.h
@@ -246,6 +246,7 @@ enum {
QCASAP_PARAM_LDPC,
QCASAP_PARAM_TX_STBC,
QCASAP_PARAM_RX_STBC,
+ 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 3ec30f4352bb..35e96c32627e 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -2277,6 +2277,27 @@ static iw_softap_set_ini_cfg(struct net_device *dev,
return ret;
}
+static int hdd_sap_get_chan_width(hdd_adapter_t *adapter, int *value)
+{
+ void *cds_ctx;
+ hdd_hostapd_state_t *hostapdstate;
+
+ ENTER();
+ hostapdstate = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
+
+ if (hostapdstate->bssState != BSS_START) {
+ *value = -EINVAL;
+ return -EINVAL;
+ }
+
+ cds_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
+
+ *value = wlansap_get_chan_width(cds_ctx);
+ hdd_notice("chan_width = %d", *value);
+
+ return 0;
+}
+
int
static __iw_softap_get_ini_cfg(struct net_device *dev,
struct iw_request_info *info,
@@ -3373,6 +3394,11 @@ 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:
hdd_err("Invalid getparam command %d", sub_cmd);
ret = -EINVAL;
@@ -5324,6 +5350,10 @@ static const struct iw_priv_args hostapd_private_args[] = {
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"
+ }, {
QCASAP_TX_CHAINMASK_CMD, 0,
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
"get_txchainmask"
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index 1087fe2c44e0..7e251d3c6264 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -953,6 +953,8 @@ QDF_STATUS wlansap_acs_chselect(void *pvos_gctx,
tpWLAN_SAPEventCB pacs_event_callback,
tsap_Config_t *pconfig,
void *pusr_context);
+uint32_t wlansap_get_chan_width(void *cds_ctx);
+
#ifdef __cplusplus
}
#endif
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 6c159697210c..ef5f63c2fdd2 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -3619,3 +3619,20 @@ void wlan_sap_enable_phy_error_logs(tHalHandle hal, bool enable_log)
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
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)
+{
+ ptSapContext sapcontext;
+
+ sapcontext = CDS_GET_SAP_CB(cds_ctx);
+ return wlan_sap_get_vht_ch_width(sapcontext);
+}