diff options
| author | Manikandan Mohan <manikand@qti.qualcomm.com> | 2014-08-20 18:06:33 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-08-28 16:39:17 -0700 |
| commit | b76784c833f77c654f4a3fd39358472d565debac (patch) | |
| tree | dee86aaaa269410b26a7ce0674faa3f2ba7d7f1f | |
| parent | c31af8828ed88671efc32234eed433ea0d07b074 (diff) | |
HDD: Add AUTO Phymode support in iwpriv command
Added 2G Auto (b/g/n) and 5G Auto (a/n/ac) support in iwpriv
setphymode command. Also made this command available in SAP
mode.
Change-Id: I21e96fc49a3a348195929e6ca5a4550f49e06a0e
CRs-fixed: 712247
| -rw-r--r-- | CORE/HDD/inc/qc_sap_ioctl.h | 3 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_wext.h | 3 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 13 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_wext.c | 24 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/_ieee80211_common.h | 2 |
5 files changed, 43 insertions, 2 deletions
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h index 58400191e95a..b9acabb97589 100644 --- a/CORE/HDD/inc/qc_sap_ioctl.h +++ b/CORE/HDD/inc/qc_sap_ioctl.h @@ -238,7 +238,8 @@ enum { QCASAP_TX_CHAINMASK_CMD, QCASAP_RX_CHAINMASK_CMD, QCASAP_NSS_CMD, - QCSAP_IPA_UC_STAT + QCSAP_IPA_UC_STAT, + QCASAP_SET_PHYMODE, }; int iw_softap_get_channel_list(struct net_device *dev, diff --git a/CORE/HDD/inc/wlan_hdd_wext.h b/CORE/HDD/inc/wlan_hdd_wext.h index ced7250f16b1..b4667a1da119 100644 --- a/CORE/HDD/inc/wlan_hdd_wext.h +++ b/CORE/HDD/inc/wlan_hdd_wext.h @@ -435,5 +435,8 @@ VOS_STATUS wlan_hdd_set_powersave(hdd_adapter_t *pAdapter, int mode); int hdd_setBand(struct net_device *dev, u8 ui_band); int hdd_setBand_helper(struct net_device *dev, const char *command); +int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, + int new_phymode, + hdd_context_t *phddctx); #endif // __WEXT_IW_H__ diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 6897b439e43f..d2c46877d130 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -2657,6 +2657,13 @@ static iw_softap_setparam(struct net_device *dev, return ret; } #endif /* IPA_UC_OFFLOAD */ + case QCASAP_SET_PHYMODE: + { + hdd_context_t *phddctx = WLAN_HDD_GET_CTX(pHostapdAdapter); + + ret = wlan_hdd_update_phymode(dev, hHal, set_value, phddctx); + break; + } default: hddLog(LOGE, FL("Invalid setparam command %d value %d"), sub_cmd, set_value); @@ -4723,6 +4730,11 @@ static const struct iw_priv_args hostapd_private_args[] = { 0, "set_nss" }, + { QCASAP_SET_PHYMODE, + IW_PRIV_TYPE_INT| IW_PRIV_SIZE_FIXED | 1, + 0, + "setphymode" }, + { QCSAP_IOCTL_GETPARAM, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam" }, { QCSAP_IOCTL_GETPARAM, 0, @@ -4869,6 +4881,7 @@ static const struct iw_priv_args hostapd_private_args[] = { IW_PRIV_TYPE_INT| IW_PRIV_SIZE_FIXED | 1, 0, "setTrafficMon" }, + }; static const iw_handler hostapd_private[] = { diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index 64f2483e3158..2394753d95b2 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -4303,7 +4303,7 @@ int process_wma_set_command(int sessid, int paramid, return ret; } -static int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, +int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, int new_phymode, hdd_context_t *phddctx) { @@ -4456,6 +4456,28 @@ static int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, } break; #endif + case IEEE80211_MODE_2G_AUTO: + sme_SetPhyMode(hal, eCSR_DOT11_MODE_AUTO); + if ((hdd_setBand(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0)) { + phymode = eCSR_DOT11_MODE_AUTO; + chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; + curr_band = eCSR_BAND_24; + } else { + sme_SetPhyMode(hal, old_phymode); + return -EIO; + } + break; + case IEEE80211_MODE_5G_AUTO: + sme_SetPhyMode(hal, eCSR_DOT11_MODE_AUTO); + if ((hdd_setBand(net, WLAN_HDD_UI_BAND_5_GHZ) == 0)) { + phymode = eCSR_DOT11_MODE_AUTO; + chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; + curr_band = eCSR_BAND_5G; + } else { + sme_SetPhyMode(hal, old_phymode); + return -EIO; + } + break; default: return -EIO; } diff --git a/CORE/SERVICES/COMMON/_ieee80211_common.h b/CORE/SERVICES/COMMON/_ieee80211_common.h index 3a0c9a431c07..c52fb22517cd 100644 --- a/CORE/SERVICES/COMMON/_ieee80211_common.h +++ b/CORE/SERVICES/COMMON/_ieee80211_common.h @@ -59,6 +59,8 @@ enum ieee80211_phymode { IEEE80211_MODE_11AC_VHT40MINUS = 17, /* 5Ghz VHT40 (Ext ch -1) */ IEEE80211_MODE_11AC_VHT40 = 18, /* 5Ghz, VHT40 */ IEEE80211_MODE_11AC_VHT80 = 19, /* 5Ghz, VHT80 */ + IEEE80211_MODE_2G_AUTO = 20, /* 2G 11 b/g/n autoselect */ + IEEE80211_MODE_5G_AUTO = 21, /* 5G 11 a/n/ac autoselect */ }; #define IEEE80211_MODE_MAX (IEEE80211_MODE_11AC_VHT80 + 1) |
