Skip to contentSkip to conversation

ath10k: fix beacon loss handling

PATCH New Michal Kazior 3 participants 13 messages May 6, 2013 – May 9, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

cover ath10k: fix beacon loss handling

FW is lying about tx status.

First two patches do a little cleanup. The last
one fixes beacon loss handling.

This can be considered a workaround depending on
what original FW design called for.

Michal Kazior (3):
ath10k: report mgmt tx retry status as no_ack
ath10k: cleanup tx completion
ath10k: pass NullFunc frames through mgmt tx path

 drivers/net/wireless/ath/ath10k/htt_rx.c |    5 ++---
 drivers/net/wireless/ath/ath10k/mac.c    |    6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 ath10k: report mgmt tx retry status as no_ack

---
 drivers/net/wireless/ath/ath10k/htt_rx.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -0
index cdedc5f..57f6386 100644
@@ -1077,6 +1077,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 			tx_done.discard = false;
 			break;
 		case HTT_MGMT_TX_STATUS_RETRY:
+			tx_done.no_ack = true;
+			break;
 		case HTT_MGMT_TX_STATUS_DROP:
 			tx_done.discard = true;
 			break;
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/3 ath10k: cleanup tx completion

In reply to Michal Kazior

The default values are false anyway. No need to
reassign.

---
 drivers/net/wireless/ath/ath10k/htt_rx.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +0 -3
index 57f6386..ccf6bc3 100644
@@ -1074,7 +1074,6 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 
 		switch (status) {
 		case HTT_MGMT_TX_STATUS_OK:
-			tx_done.discard = false;
 			break;
 		case HTT_MGMT_TX_STATUS_RETRY:
 			tx_done.no_ack = true;
@@ -1097,10 +1096,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		switch (status) {
 		case HTT_DATA_TX_STATUS_NO_ACK:
 			tx_done.no_ack = true;
-			tx_done.discard = false;
 			break;
 		case HTT_DATA_TX_STATUS_OK:
-			tx_done.discard = false;
 			break;
 		case HTT_DATA_TX_STATUS_DISCARD:
 		case HTT_DATA_TX_STATUS_POSTPONE:
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/3 ath10k: pass NullFunc frames through mgmt tx path

In reply to Michal Kazior

FW was reporting incorrect tx status for NullFunc
frames sent through data tx path.

mac80211 uses tx status when dealing with link/beacon loss. This patch fixes connection loss handling.

---
 drivers/net/wireless/ath/ath10k/mac.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath10k/mac.c +6 -0
index b5cc3c8..47900cc 100644
@@ -1294,6 +1294,12 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
 
 	if (ieee80211_is_mgmt(hdr->frame_control))
 		ret = ath10k_htt_mgmt_tx(ar->htt, skb);
+	else if (ieee80211_is_nullfunc(hdr->frame_control))
+		/* FW does not report tx status properly for NullFunc frames
+		 * unless they are sent through mgmt tx path. mac80211 sends
+		 * those frames when it detects link/beacon loss and depends on
+		 * the tx status to be correct. */
+		ret = ath10k_htt_mgmt_tx(ar->htt, skb);
 	else
 		ret = ath10k_htt_tx(ar->htt, skb);
 
Signature · 1 line
1.7.9.5
#5 lore raw

cover ath10k: fix beacon loss handling

In reply to Michal Kazior

ACK

Kalle, could you please submit/review these?
Fixes quite serious problem.

Bartosz

Quoted 18 lines · Michal Kazior

FW is lying about tx status.

First two patches do a little cleanup. The last
one fixes beacon loss handling.

This can be considered a workaround depending on
what original FW design called for.

Michal Kazior (3):
ath10k: report mgmt tx retry status as no_ack
ath10k: cleanup tx completion
ath10k: pass NullFunc frames through mgmt tx path

 drivers/net/wireless/ath/ath10k/htt_rx.c |    5 ++---
 drivers/net/wireless/ath/ath10k/mac.c    |    6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)
Quoted 8 lines

--
1.7.9.5

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20130509/67d7ab03/attachment.htm

#6 lore raw

cover ath10k: fix beacon loss handling

Quoted 1 line · Bartosz Markowski

Kalle, could you please submit/review these?

I will not commit any patches which have either RFC or RFT tag. And I also review them in lower priority.

So if you want me to commit something I recommend to use only PATCH.

Signature · 1 line
Kalle Valo
#7 lore raw

cover ath10k: fix beacon loss handling

Michal, could you please address Kalle's comments.

#8 lore raw

cover ath10k: fix beacon loss handling

In reply to Michal Kazior

FW is lying about tx status.

First two patches do a little cleanup. The last
one fixes beacon loss handling.

This can be considered a workaround depending on
what original FW design called for.

Michal Kazior (3):
ath10k: report mgmt tx retry status as no_ack
ath10k: cleanup tx completion
ath10k: pass NullFunc frames through mgmt tx path

 drivers/net/wireless/ath/ath10k/htt_rx.c |    5 ++---
 drivers/net/wireless/ath/ath10k/mac.c    |    6 ++++++
 2 files changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 1/3 ath10k: report mgmt tx retry status as no_ack

Retry status may mean FW either didn't send the frame or there was no ACK for it. Since we don't really support retrying (why should we?) lets report these frames as not acked.

This way if NullFunc frame is sent through mgmt tx path we can report it's status correctly to mac80211.

---
 drivers/net/wireless/ath/ath10k/htt_rx.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -0
index dac6439..a32dcad 100644
@@ -1084,6 +1084,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 			tx_done.discard = false;
 			break;
 		case HTT_MGMT_TX_STATUS_RETRY:
+			tx_done.no_ack = true;
+			break;
 		case HTT_MGMT_TX_STATUS_DROP:
 			tx_done.discard = true;
 			break;
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 2/3 ath10k: cleanup tx completion

In reply to Michal Kazior

The default values are false anyway. No need to
reassign.

---
 drivers/net/wireless/ath/ath10k/htt_rx.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +0 -3
index a32dcad..de058d7 100644
@@ -1081,7 +1081,6 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 
 		switch (status) {
 		case HTT_MGMT_TX_STATUS_OK:
-			tx_done.discard = false;
 			break;
 		case HTT_MGMT_TX_STATUS_RETRY:
 			tx_done.no_ack = true;
@@ -1104,10 +1103,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		switch (status) {
 		case HTT_DATA_TX_STATUS_NO_ACK:
 			tx_done.no_ack = true;
-			tx_done.discard = false;
 			break;
 		case HTT_DATA_TX_STATUS_OK:
-			tx_done.discard = false;
 			break;
 		case HTT_DATA_TX_STATUS_DISCARD:
 		case HTT_DATA_TX_STATUS_POSTPONE:
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH 3/3 ath10k: pass NullFunc frames through mgmt tx path

In reply to Michal Kazior

FW was reporting incorrect tx status for NullFunc frames sent through data tx path.

mac80211 uses tx status when dealing with link/beacon loss. Using mgmt tx path allows us to get reliable tx status. This patch fixes connection loss handling.

---
 drivers/net/wireless/ath/ath10k/mac.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath10k/mac.c +6 -0
index 930a092..b6f519e 100644
@@ -1299,6 +1299,12 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
 
 	if (ieee80211_is_mgmt(hdr->frame_control))
 		ret = ath10k_htt_mgmt_tx(ar->htt, skb);
+	else if (ieee80211_is_nullfunc(hdr->frame_control))
+		/* FW does not report tx status properly for NullFunc frames
+		 * unless they are sent through mgmt tx path. mac80211 sends
+		 * those frames when it detects link/beacon loss and depends on
+		 * the tx status to be correct. */
+		ret = ath10k_htt_mgmt_tx(ar->htt, skb);
 	else
 		ret = ath10k_htt_tx(ar->htt, skb);
 
Signature · 1 line
1.7.9.5
Applied
#12 lore raw

cover ath10k: fix beacon loss handling

In reply to Michal Kazior
Quoted 5 lines · Michal Kazior

FW is lying about tx status.

First two patches do a little cleanup. The last
one fixes beacon loss handling.

Quoted 7 lines

This can be considered a workaround depending on
what original FW design called for.

Michal Kazior (3):
ath10k: report mgmt tx retry status as no_ack
ath10k: cleanup tx completion
ath10k: pass NullFunc frames through mgmt tx path

Thanks, applied.

Signature · 1 line
Kalle Valo