summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hsu <ryanhsu@qca.qualcomm.com>2014-04-21 02:25:44 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-04-26 00:48:15 -0700
commit4b94121999b5bfddb4dc8d5d7eda8c65dee2dfa7 (patch)
tree6d25df4924254d404fdcb65a686f02d84678d255
parent0c5e3285f16ea565c9506889df7af738bd6a5da2 (diff)
qcacld: fix rts_threshold varaible overflow
cfg80211 set the wiphy->rts_threshold=-1 as disabling rts/cts. In commit a5b2dc05feded698193fbd9375fd9a84171f999a, and commit 78555092119c192c946475fa933c69a8ea34b136, both change the rts_threshold to the number that u16 can't carry. So whenever hostapd configure the rts_threshold=2347 to disable rts/cts, cld driver will set 0 to firmware which is incorrect. Change-Id: Id3f686e93001e74ba10649d798c627c337004d95 CRs-fixed: 647273
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c8
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 651942bb43ec..651e859a8ed3 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -7589,7 +7589,7 @@ static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
if (changed & WIPHY_PARAM_RTS_THRESHOLD)
{
- u16 rts_threshold = (wiphy->rts_threshold == -1) ?
+ u32 rts_threshold = (wiphy->rts_threshold == -1) ?
WNI_CFG_RTS_THRESHOLD_STAMAX :
wiphy->rts_threshold;
@@ -7597,7 +7597,7 @@ static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
(WNI_CFG_RTS_THRESHOLD_STAMAX < rts_threshold))
{
hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid RTS Threshold value %hu",
+ "%s: Invalid RTS Threshold value %u",
__func__, rts_threshold);
return -EINVAL;
}
@@ -7607,12 +7607,12 @@ static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
eANI_BOOLEAN_TRUE))
{
hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: ccmCfgSetInt failed for rts_threshold value %hu",
+ "%s: ccmCfgSetInt failed for rts_threshold value %u",
__func__, rts_threshold);
return -EIO;
}
- hddLog(VOS_TRACE_LEVEL_INFO_MED, "%s: set rts threshold %hu", __func__,
+ hddLog(VOS_TRACE_LEVEL_INFO_MED, "%s: set rts threshold %u", __func__,
rts_threshold);
}
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 0da8dd01ab50..d7031cd21556 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1804,7 +1804,7 @@ static iw_softap_setparam(struct net_device *dev,
ret = process_wma_set_command((int)pHostapdAdapter->sessionId,
(int)WMI_VDEV_PARAM_ENABLE_RTSCTS,
set_value, VDEV_CMD);
- if (!ret) {
+ if (ret) {
hddLog(LOGE, "FAILED TO SET RTSCTS at SAP");
ret = -EIO;
}