From: Xinming Hu <[email protected]>
An issue about tdls uapsd was fixed in latest firmware, this
patch add module parameter to control tdls uapsd support,
which is default disabled, could be a workaround to the
old firmware. At the same time, it is optional to enable
this feature in specific case.
Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Cathy Luo <[email protected]>
---
v2: add more comments for disable tdls_uapsd. (Brian)
---
drivers/net/wireless/marvell/mwifiex/init.c | 5 +++++
drivers/net/wireless/marvell/mwifiex/main.h | 1 +
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 8 +++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index 3ecb59f..2cc8e54 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -25,6 +25,10 @@
#include "wmm.h"
#include "11n.h"
+static bool tdls_uapsd;
+module_param(tdls_uapsd, bool, 0000);
+MODULE_PARM_DESC(tdls_uapsd, "tdls uapsd support enable:1, disable:0");
+
/*
* This function adds a BSS priority table to the table list.
*
@@ -154,6 +158,7 @@ int mwifiex_init_priv(struct mwifiex_private *priv)
priv->del_list_idx = 0;
priv->hs2_enabled = false;
priv->check_tdls_tx = false;
+ priv->tdls_uapsd_support = tdls_uapsd;
memcpy(priv->tos_to_tid_inv, tos_to_tid_inv, MAX_NUM_TID);
mwifiex_init_11h_params(priv);
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index f8cf307..ef5eac72 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -660,6 +660,7 @@ struct mwifiex_private {
u8 check_tdls_tx;
struct timer_list auto_tdls_timer;
bool auto_tdls_timer_active;
+ u8 tdls_uapsd_support;
struct idr ack_status_frames;
/* spin lock for ack status */
spinlock_t ack_status_lock;
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 534d94a..d5da565 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -1789,9 +1789,11 @@ static int mwifiex_cmd_chan_region_cfg(struct mwifiex_private *priv,
put_unaligned_le16(params->capability, pos);
config_len += sizeof(params->capability);
- qos_info = params->uapsd_queues | (params->max_sp << 5);
- wmm_qos_info = (struct mwifiex_ie_types_qos_info *)(pos +
- config_len);
+ if (priv->tdls_uapsd_support)
+ qos_info = params->uapsd_queues | (params->max_sp << 5);
+ else
+ qos_info = 0;
+ wmm_qos_info = (void *)(pos + config_len);
wmm_qos_info->header.type = cpu_to_le16(WLAN_EID_QOS_CAPA);
wmm_qos_info->header.len = cpu_to_le16(sizeof(qos_info));
wmm_qos_info->qos_info = qos_info;
--
1.9.1
SGksDQoNClBsZWFzZSBkcm9wIHRoaXMgcGF0Y2gsIGFzIHRoZXJlIGlzIGEgcmVwbGFjZSB2ZXJz
aW9uIGFscmVhZHkuDQoNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBY
aW5taW5nIEh1IFttYWlsdG86aHV4aW5taW5nODIwQGdtYWlsLmNvbV0NCj4gU2VudDogMjAxN8Tq
N9TCMjDI1SAxOTowNg0KPiBUbzogTGludXggV2lyZWxlc3MNCj4gQ2M6IEthbGxlIFZhbG87IEJy
aWFuIE5vcnJpczsgRG1pdHJ5IFRvcm9raG92OyByYWphdGphQGdvb2dsZS5jb207IFpoaXl1YW4N
Cj4gWWFuZzsgVGltIFNvbmc7IENhdGh5IEx1bzsgWGlubWluZyBIdQ0KPiBTdWJqZWN0OiBbUEFU
Q0ggdjJdIG13aWZpZXg6IGFkZCB0ZGxzIHVhcHNkIHN1cHBvcnQgbW9kdWxlIHBhcmFtZXRlcg0K
PiANCj4gRnJvbTogWGlubWluZyBIdSA8aHV4bUBtYXJ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