Skip to contentSkip to conversation

ath10k: enable firmware STA quick kickout

PATCH Applied Kalle Valo 1 participant 3 messages Jan 20, 2014 – Jan 23, 2014 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

PATCH v2 1/1 ath10k: enable firmware STA quick kickout

Firmware has a feature to track if the associated STA is not acking the frames. When that happens, the firmware sends WMI_PEER_STA_KICKOUT_EVENTID event to the host. Enable that to faster detect when a STA has left BSS without sending a deauth frame.

Also set huge keepalive timeouts to avoid using the keepalive functionality in the firmware.

---
 drivers/net/wireless/ath/ath10k/core.h |   12 +++++++
 drivers/net/wireless/ath/ath10k/mac.c  |   58 ++++++++++++++++++++++++++++----
 drivers/net/wireless/ath/ath10k/wmi.c  |   22 ++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h  |    4 ++
 4 files changed, 88 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +12 -0
index ade1781..e6308f4 100644
@@ -46,6 +46,18 @@
 
 #define ATH10K_MAX_NUM_MGMT_PENDING 128
 
+/* number of failed packets */
+#define ATH10K_KICKOUT_THRESHOLD 50
+
+/*
+ * Use insanely high numbers to make sure that the firmware implementation
+ * won't start, we have the same functionality already in hostapd. Unit
+ * is seconds.
+ */
+#define ATH10K_KEEPALIVE_MIN_IDLE 3747
+#define ATH10K_KEEPALIVE_MAX_IDLE 3895
+#define ATH10K_KEEPALIVE_MAX_UNRESPONSIVE 3900
+
 struct ath10k;
 
 struct ath10k_skb_cb {
drivers/net/wireless/ath/ath10k/mac.c +51 -7

76 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/wmi.c +21 -1
index 712a606..0bc8543 100644
@@ -1116,7 +1116,27 @@ static void ath10k_wmi_event_vdev_stopped(struct ath10k *ar,
 static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar,
 					      struct sk_buff *skb)
 {
-	ath10k_dbg(ATH10K_DBG_WMI, "WMI_PEER_STA_KICKOUT_EVENTID\n");
+	struct wmi_peer_sta_kickout_event *ev;
+	struct ieee80211_sta *sta;
+
+	ev = (struct wmi_peer_sta_kickout_event *)skb->data;
+
+	ath10k_dbg(ATH10K_DBG_WMI, "wmi event peer sta kickout %pM\n",
+		   ev->peer_macaddr.addr);
+
+	rcu_read_lock();
+
+	sta = ieee80211_find_sta_by_ifaddr(ar->hw, ev->peer_macaddr.addr, NULL);
+	if (!sta) {
+		ath10k_warn("Spurious quick kickout for STA %pM\n",
+			    ev->peer_macaddr.addr);
+		goto exit;
+	}
+
+	ieee80211_report_low_ack(sta, 10);
+
+exit:
+	rcu_read_unlock();
 }
 
 /*
drivers/net/wireless/ath/ath10k/wmi.h +4 -0
index 4b5e7d3..9dc90c5 100644
@@ -4039,6 +4039,10 @@ struct wmi_chan_info_event {
 	__le32 cycle_count;
 } __packed;
 
+struct wmi_peer_sta_kickout_event {
+	struct wmi_mac_addr peer_macaddr;
+} __packed;
+
 #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
 
 /* FIXME: empirically extrapolated */
author
#1 lore raw
Quoted 9 lines · Kalle Valo

Firmware has a feature to track if the associated STA is not acking the frames. When that happens, the firmware sends WMI_PEER_STA_KICKOUT_EVENTID event to the host. Enable that to faster detect when a STA has left BSS without sending a deauth frame.

Also set huge keepalive timeouts to avoid using the keepalive functionality in the firmware.

In this v2 I fixed the warning messages.

Signature · 1 line
Kalle Valo
author Applied
#2 lore raw
In reply to Kalle Valo
Quoted 9 lines · Kalle Valo

Firmware has a feature to track if the associated STA is not acking the frames. When that happens, the firmware sends WMI_PEER_STA_KICKOUT_EVENTID event to the host. Enable that to faster detect when a STA has left BSS without sending a deauth frame.

Also set huge keepalive timeouts to avoid using the keepalive functionality in the firmware.

Applied.

Signature · 1 line
Kalle Valo