aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/status.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index e6e574a307c8..bfa5326776ab 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -542,6 +542,23 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
542 */ 542 */
543#define STA_LOST_PKT_THRESHOLD 50 543#define STA_LOST_PKT_THRESHOLD 50
544 544
545static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb)
546{
547 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
548
549 /* This packet was aggregated but doesn't carry status info */
550 if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
551 !(info->flags & IEEE80211_TX_STAT_AMPDU))
552 return;
553
554 if (++sta->lost_packets < STA_LOST_PKT_THRESHOLD)
555 return;
556
557 cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr,
558 sta->lost_packets, GFP_ATOMIC);
559 sta->lost_packets = 0;
560}
561
545void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) 562void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
546{ 563{
547 struct sk_buff *skb2; 564 struct sk_buff *skb2;
@@ -680,12 +697,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
680 if (info->flags & IEEE80211_TX_STAT_ACK) { 697 if (info->flags & IEEE80211_TX_STAT_ACK) {
681 if (sta->lost_packets) 698 if (sta->lost_packets)
682 sta->lost_packets = 0; 699 sta->lost_packets = 0;
683 } else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) { 700 } else {
684 cfg80211_cqm_pktloss_notify(sta->sdata->dev, 701 ieee80211_lost_packet(sta, skb);
685 sta->sta.addr,
686 sta->lost_packets,
687 GFP_ATOMIC);
688 sta->lost_packets = 0;
689 } 702 }
690 } 703 }
691 704