2017-10-10 06:50:18

by Manikanta Pubbisetty

[permalink] [raw]
Subject: [PATCH 0/2] ath10k: more on tdls support for 10.4 firmwares

From: Manikanta Pubbisetty <[email protected]>

This patchset includes a bug fix and an enhancement of tdls functionality
for 10.4 firmwares.

First patch in this series is a bug fix, second one is an enhancement.

Manikanta Pubbisetty (2):
ath10k: update tdls teardown state to target
ath10k: handle tdls peer events

drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++
drivers/net/wireless/ath/ath10k/wmi.c | 59 +++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)

--
1.7.9.5


2017-10-10 06:51:13

by Manikanta Pubbisetty

[permalink] [raw]
Subject: [PATCH 2/2] ath10k: handle tdls peer events

From: Manikanta Pubbisetty <[email protected]>

Handle tdls peer events from the target. TDLS events for the peer
could be discover, teardown, etc. As of now, adding the logic to
handle tdls teardown events alone.

Teardown due to peer traffic indication(PTR) timeout is one such
teardown event from the target.

Tested this change on QCA9888 with 10.4-3.5.1-00018 fw version.

Signed-off-by: Manikanta Pubbisetty <[email protected]>
---
drivers/net/wireless/ath/ath10k/wmi.c | 59 +++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 38a9708..344f19c 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -29,6 +29,7 @@
#include "p2p.h"
#include "hw.h"
#include "hif.h"
+#include "txrx.h"

#define ATH10K_WMI_BARRIER_ECHO_ID 0xBA991E9
#define ATH10K_WMI_BARRIER_TIMEOUT_HZ (3 * HZ)
@@ -4456,6 +4457,61 @@ void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb)
__le32_to_cpu(ev->rate_max));
}

+void ath10k_wmi_handle_tdls_peer_event(struct ath10k *ar, struct sk_buff *skb)
+{
+ struct wmi_tdls_peer_event *ev;
+ struct ath10k_peer *peer;
+ struct ath10k_vif *arvif;
+ u8 reason;
+
+ ev = (struct wmi_tdls_peer_event *)skb->data;
+
+ spin_lock_bh(&ar->data_lock);
+ peer = ath10k_peer_find(ar, ev->vdev_id, ev->peer_macaddr.addr);
+ spin_unlock_bh(&ar->data_lock);
+
+ if (!peer) {
+ ath10k_warn(ar, "failed to find peer entry for %pM\n",
+ ev->peer_macaddr.addr);
+ return;
+ }
+
+ switch (ev->peer_status) {
+ case WMI_TDLS_SHOULD_TEARDOWN:
+ switch (ev->peer_reason) {
+ case WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT:
+ case WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE:
+ case WMI_TDLS_TEARDOWN_REASON_RSSI:
+ reason = WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE;
+ break;
+ default:
+ reason = WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED;
+ break;
+ }
+
+ arvif = ath10k_get_arvif(ar, ev->vdev_id);
+ if (!arvif) {
+ ath10k_warn(ar, "received tdls peer event for invalid vdev id %u\n",
+ ev->vdev_id);
+ return;
+ }
+
+ ieee80211_tdls_oper_request(arvif->vif, ev->peer_macaddr.addr,
+ NL80211_TDLS_TEARDOWN, reason,
+ GFP_ATOMIC);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "received tdls teardown event for peer %pM reason %u\n",
+ ev->peer_macaddr.addr, ev->peer_reason);
+ break;
+ default:
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "received unknown tdls peer event %u\n",
+ ev->peer_status);
+ break;
+ }
+}
+
void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb)
{
ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PDEV_FTM_INTG_EVENTID\n");
@@ -5477,6 +5533,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
case WMI_10_4_PDEV_TPC_CONFIG_EVENTID:
ath10k_wmi_event_pdev_tpc_config(ar, skb);
break;
+ case WMI_10_4_TDLS_PEER_EVENTID:
+ ath10k_wmi_handle_tdls_peer_event(ar, skb);
+ break;
default:
ath10k_warn(ar, "Unknown eventid: %d\n", id);
break;
--
1.7.9.5

2017-10-10 06:50:53

by Manikanta Pubbisetty

[permalink] [raw]
Subject: [PATCH 1/2] ath10k: update tdls teardown state to target

From: Manikanta Pubbisetty <[email protected]>

It is required to update the teardown state of the peer when
a tdls link with that peer is terminated. This information is
useful for the target to perform some cleanups wrt the tdls peer.

Without proper cleanup, target assumes that the peer is connected and
blocks future connection requests, updating the teardown state of the
peer addresses the problem.

Tested this change on QCA9888 with 10.4-3.5.1-00018 fw version.

Signed-off-by: Manikanta Pubbisetty <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 5683f1a..35b7523 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6183,6 +6183,16 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
"mac vdev %d peer delete %pM sta %pK (sta gone)\n",
arvif->vdev_id, sta->addr, sta);

+ if (sta->tdls) {
+ ret = ath10k_mac_tdls_peer_update(ar, arvif->vdev_id,
+ sta,
+ WMI_TDLS_PEER_STATE_TEARDOWN);
+ if (ret)
+ ath10k_warn(ar, "failed to update tdls peer state for %pM state %d: %i\n",
+ sta->addr,
+ WMI_TDLS_PEER_STATE_TEARDOWN, ret);
+ }
+
ret = ath10k_peer_delete(ar, arvif->vdev_id, sta->addr);
if (ret)
ath10k_warn(ar, "failed to delete peer %pM for vdev %d: %i\n",
--
1.7.9.5

2017-10-17 09:14:19

by Manikanta Pubbisetty

[permalink] [raw]
Subject: RE: [2/2] ath10k: handle tdls peer events

PlRoaXMgcGF0Y2ggaW50cm9kdWNlcyBuZXcgd2FybmluZ3M6DQo+DQo+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ZCBpbnQNCj5bdW5zaWduZWRdIFt1c2VydHlwZV0gdmRl
dl9pZA0KPmRyaXZlcnMvbmV0L3dpcmVsZXNzL2F0aC9hdGgxMGsvd21pLmM6NDQ5Mjo0ODogICAg
Z290IHJlc3RyaWN0ZWQgX19sZTMyDQo+W3VzZXJ0eXBlXSB2ZGV2X2lkDQo+ZHJpdmVycy9uZXQv
d2lyZWxlc3MvYXRoL2F0aDEway93bWkuYzo0NDc5OjE5OiB3YXJuaW5nOiByZXN0cmljdGVkIF9f
bGUzMg0KPmRlZ3JhZGVzIHRvIGludGVnZXINCj5kcml2ZXJzL25ldC93aXJlbGVzcy9hdGgvYXRo
MTBrL3dtaS5jOjQ0NjA6Njogd2FybmluZzogc3ltYm9sDQo+J2F0aDEwa193bWlfaGFuZGxlX3Rk
bHNfcGVlcl9ldmVudCcgd2FzIG5vdCBkZWNsYXJlZC4gU2hvdWxkIGl0IGJlIHN0YXRpYz8NCj4N
Cj4tLQ0KPmh0dHBzOi8vcGF0Y2h3b3JrLmtlcm5lbC5vcmcvcGF0Y2gvOTk5NTEzMS8NCj4NCj5o
dHRwczovL3dpcmVsZXNzLndpa2kua2VybmVsLm9yZy9lbi9kZXZlbG9wZXJzL2RvY3VtZW50YXRp
b24vc3VibWl0dGluZ3BhDQo+dGNoZXMNCg0KTXkgYmFkISENClRoYW5rcyBrYWxsZSwgSSB3aWxs
IGZpeCB0aGlzIGFuZCBzZW5kIGEgZm9sbG93IHVwIHZlcnNpb24uDQoNCk1hbmlrYW50YSBQdWJi
aXNldHR5DQo=

2017-10-13 12:18:34

by Kalle Valo

[permalink] [raw]
Subject: Re: [2/2] ath10k: handle tdls peer events

[email protected] wrote:

> Handle tdls peer events from the target. TDLS events for the peer
> could be discover, teardown, etc. As of now, adding the logic to
> handle tdls teardown events alone.
>
> Teardown due to peer traffic indication(PTR) timeout is one such
> teardown event from the target.
>
> Tested this change on QCA9888 with 10.4-3.5.1-00018 fw version.
>
> Signed-off-by: Manikanta Pubbisetty <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

This patch introduces new warnings:

$ ath10k-check
drivers/net/wireless/ath/ath10k/wmi.c:4470:39: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/ath/ath10k/wmi.c:4470:39: expected int [signed] vdev_id
drivers/net/wireless/ath/ath10k/wmi.c:4470:39: got restricted __le32 [usertype] vdev_id
drivers/net/wireless/ath/ath10k/wmi.c:4481:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/ath/ath10k/wmi.c:4481:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/ath/ath10k/wmi.c:4481:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/ath/ath10k/wmi.c:4492:48: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/ath/ath10k/wmi.c:4492:48: expected unsigned int [unsigned] [usertype] vdev_id
drivers/net/wireless/ath/ath10k/wmi.c:4492:48: got restricted __le32 [usertype] vdev_id
drivers/net/wireless/ath/ath10k/wmi.c:4479:19: warning: restricted __le32 degrades to integer
drivers/net/wireless/ath/ath10k/wmi.c:4460:6: warning: symbol 'ath10k_wmi_handle_tdls_peer_event' was not declared. Should it be static?

--
https://patchwork.kernel.org/patch/9995131/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches