diff options
| author | Zhang Qian <zhangq@qti.qualcomm.com> | 2016-07-15 16:03:25 +0800 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-08-08 16:10:51 +0530 |
| commit | 213b1380d23f2224cade71fdef83f7fd06082a72 (patch) | |
| tree | c93ad5486ad893c7b84a1a72a8c8aa3ba0a9f24f | |
| parent | 21f8a6ee0e7517b1e67f764455247857eb15d45a (diff) | |
qcacld-2.0: Refine cfg80211 AGG/MGMT/CTRL/PROPAGATION vendor configure setting
This change refines 'qcacld-2.0: Extend cfg80211 configure API'.
1. Unit for propagation delay should be micro second, but it is
millisecond in last change.
2. Max/Min values for limits check are replaced by Macros.
3. Refine code style for variable definition.
Change-Id: I1735bc540b9182c724d9fafa6e5e0878d23b96fa
CRs-Fixed: 1035577
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 11 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 29 |
2 files changed, 23 insertions, 17 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index ef6755af5212..270fc1314afb 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -1555,6 +1555,13 @@ enum qca_wlan_vendor_acs_hw_mode { QCA_ACS_MODE_IEEE80211AD, }; +#define CFG_NON_AGG_RETRY_MAX (31) +#define CFG_AGG_RETRY_MAX (31) +#define CFG_MGMT_RETRY_MAX (31) +#define CFG_CTRL_RETRY_MAX (31) +#define CFG_PROPAGATION_DELAY_MAX (63) +#define CFG_AGG_RETRY_MIN (5) + /** * enum qca_wlan_vendor_config: wifi config attr * @@ -1573,7 +1580,7 @@ enum qca_wlan_vendor_acs_hw_mode { * @QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY: management frame sw retry threshold * @QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY: control frame sw retry threshold * @QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY: - * propagtion delay for 2G/5G band(Units in ms) + * propagation delay for 2G/5G band(Units in us) * @QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT: Unsigned 32-bit value to * configure the number of unicast TX fail packet count. * The peer is disconnected once this threshold is reached. @@ -1601,7 +1608,7 @@ enum qca_wlan_vendor_config { /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = - QCA_WLAN_VENDOR_ATTR_CONFIG_LAST - 1 + QCA_WLAN_VENDOR_ATTR_CONFIG_LAST - 1 }; /** diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index bbcb44a4f31a..b04705b5936a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -8460,9 +8460,7 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, int ret_val = 0; u32 modulated_dtim; uint16_t stats_avg_factor, tx_rate; - uint8_t set_value; - uint8_t retry; - uint8_t delay; + uint8_t set_value, retry, delay; u32 guard_time; u32 ftm_capab; eHalStatus status; @@ -8595,8 +8593,8 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, retry = nla_get_u8( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_NON_AGG_RETRY]); - /* Maximum value is 31 */ - retry = retry > 31 ? 31 : retry; + retry = retry > CFG_NON_AGG_RETRY_MAX ? + CFG_NON_AGG_RETRY_MAX : retry; ret_val = process_wma_set_command((int)pAdapter->sessionId, (int)WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH, retry, PDEV_CMD); @@ -8606,11 +8604,12 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, retry = nla_get_u8( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY]); - /* Maximum value is 31(0x1f), 0 disable */ - retry = retry > 31 ? 31 : retry; + retry = retry > CFG_AGG_RETRY_MAX ? + CFG_AGG_RETRY_MAX : retry; - /* Value less than 5 has side effect to t-put */ - retry = ((retry > 0) && (retry < 5)) ? 5 : retry; + /* Value less than CFG_AGG_RETRY_MIN has side effect to t-put */ + retry = ((retry > 0) && (retry < CFG_AGG_RETRY_MIN)) ? + CFG_AGG_RETRY_MIN : retry; ret_val = process_wma_set_command((int)pAdapter->sessionId, (int)WMI_PDEV_PARAM_AGG_SW_RETRY_TH, retry, PDEV_CMD); @@ -8620,8 +8619,8 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, retry = nla_get_u8( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY]); - /* Maximum value is 31 */ - retry = retry > 31 ? 31 : retry; + retry = retry > CFG_MGMT_RETRY_MAX ? + CFG_MGMT_RETRY_MAX : retry; ret_val = process_wma_set_command((int)pAdapter->sessionId, (int)WMI_PDEV_PARAM_MGMT_RETRY_LIMIT, retry, PDEV_CMD); @@ -8630,8 +8629,8 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY]) { retry = nla_get_u8( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY]); - /* Maximum value is 31 */ - retry = retry > 31 ? 31 : retry; + retry = retry > CFG_CTRL_RETRY_MAX ? + CFG_CTRL_RETRY_MAX : retry; ret_val = process_wma_set_command((int)pAdapter->sessionId, (int)WMI_PDEV_PARAM_CTRL_RETRY_LIMIT, retry, PDEV_CMD); @@ -8640,8 +8639,8 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY]) { delay = nla_get_u8( tb[QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY]); - /* Maximum value is 63 */ - delay = delay > 63 ? 63 : delay; + delay = delay > CFG_PROPAGATION_DELAY_MAX ? + CFG_PROPAGATION_DELAY_MAX : delay; ret_val = process_wma_set_command((int)pAdapter->sessionId, (int)WMI_PDEV_PARAM_PROPAGATION_DELAY, delay, PDEV_CMD); |
