summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitesh Shah <niteshs@codeaurora.org>2016-09-06 19:45:13 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-09-11 17:12:28 -0700
commit4e2d5eb3e70b7dd66b425b005898e7ad5bc09343 (patch)
tree9a87bc1b2610c70e342f08322755095f58e253f5
parent4fc5715f8cbc6374de8a9e8c779360374e269118 (diff)
qcacld-3.0: Allow Link speed only for P2P GO/Client
Link speed is returning incorrect value. Fix is to allow link speed only for P2P GO/Client. Return error for other device modes, as link speed feature in FW is only supported for P2P interfaces as it was implemented to support Miracast. Change-Id: I5747d9ebbcbac3ae1ebf69f261d721a96e22d53c CRs-Fixed: 1063541 (cherry picked from commit 9327fc30217078d165f7be85a3fb277e9d09e669) (cherry picked from commit a346e371732b5fc24f171a3bde4666e7950f3c01)
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c9
-rw-r--r--core/hdd/src/wlan_hdd_wext.c8
2 files changed, 17 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index f556bc1824d5..07eb75f08ccd 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -5045,6 +5045,15 @@ int __iw_get_softap_linkspeed(struct net_device *dev,
hdd_notice("wrqu->data.length(%d)", wrqu->data.length);
+ /* Linkspeed is allowed only for P2P mode */
+ if (pHostapdAdapter->device_mode != QDF_P2P_GO_MODE) {
+ hdd_err("Link Speed is not allowed in Device mode %s(%d)",
+ hdd_device_mode_to_string(
+ pHostapdAdapter->device_mode),
+ pHostapdAdapter->device_mode);
+ return -ENOTSUPP;
+ }
+
if (wrqu->data.length >= MAC_ADDRESS_STR_LEN - 1) {
if (copy_from_user((void *)pmacAddress,
wrqu->data.pointer, MAC_ADDRESS_STR_LEN)) {
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 325152d3da28..68fff4a800f0 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -1520,6 +1520,14 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed)
if (ret)
return ret;
+ /* Linkspeed is allowed only for P2P mode */
+ if (sta_adapter->device_mode != QDF_P2P_CLIENT_MODE) {
+ hdd_err("Link Speed is not allowed in Device mode %s(%d)",
+ hdd_device_mode_to_string(sta_adapter->device_mode),
+ sta_adapter->device_mode);
+ return -ENOTSUPP;
+ }
+
if (eConnectionState_Associated != hdd_stactx->conn_info.connState) {
/* we are not connected so we don't have a classAstats */
*link_speed = 0;