aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/sta_info.h3
-rw-r--r--net/mac80211/status.c21
2 files changed, 23 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 9dc7a9d6b0d2..42f68cb8957e 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -450,6 +450,9 @@ struct sta_info {
450 enum ieee80211_smps_mode known_smps_mode; 450 enum ieee80211_smps_mode known_smps_mode;
451 const struct ieee80211_cipher_scheme *cipher_scheme; 451 const struct ieee80211_cipher_scheme *cipher_scheme;
452 452
453 /* TDLS timeout data */
454 unsigned long last_tdls_pkt_time;
455
453 /* keep last! */ 456 /* keep last! */
454 struct ieee80211_sta sta; 457 struct ieee80211_sta sta;
455}; 458};
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 2800e1c65519..89290e33dafe 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -538,6 +538,8 @@ static void ieee80211_tx_latency_end_msrmnt(struct ieee80211_local *local,
538 * - current throughput (higher value for higher tpt)? 538 * - current throughput (higher value for higher tpt)?
539 */ 539 */
540#define STA_LOST_PKT_THRESHOLD 50 540#define STA_LOST_PKT_THRESHOLD 50
541#define STA_LOST_TDLS_PKT_THRESHOLD 10
542#define STA_LOST_TDLS_PKT_TIME (10*HZ) /* 10secs since last ACK */
541 543
542static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb) 544static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb)
543{ 545{
@@ -548,7 +550,20 @@ static void ieee80211_lost_packet(struct sta_info *sta, struct sk_buff *skb)
548 !(info->flags & IEEE80211_TX_STAT_AMPDU)) 550 !(info->flags & IEEE80211_TX_STAT_AMPDU))
549 return; 551 return;
550 552
551 if (++sta->lost_packets < STA_LOST_PKT_THRESHOLD) 553 sta->lost_packets++;
554 if (!sta->sta.tdls && sta->lost_packets < STA_LOST_PKT_THRESHOLD)
555 return;
556
557 /*
558 * If we're in TDLS mode, make sure that all STA_LOST_TDLS_PKT_THRESHOLD
559 * of the last packets were lost, and that no ACK was received in the
560 * last STA_LOST_TDLS_PKT_TIME ms, before triggering the CQM packet-loss
561 * mechanism.
562 */
563 if (sta->sta.tdls &&
564 (sta->lost_packets < STA_LOST_TDLS_PKT_THRESHOLD ||
565 time_before(jiffies,
566 sta->last_tdls_pkt_time + STA_LOST_TDLS_PKT_TIME)))
552 return; 567 return;
553 568
554 cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr, 569 cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr,
@@ -695,6 +710,10 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
695 if (info->flags & IEEE80211_TX_STAT_ACK) { 710 if (info->flags & IEEE80211_TX_STAT_ACK) {
696 if (sta->lost_packets) 711 if (sta->lost_packets)
697 sta->lost_packets = 0; 712 sta->lost_packets = 0;
713
714 /* Track when last TDLS packet was ACKed */
715 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH))
716 sta->last_tdls_pkt_time = jiffies;
698 } else { 717 } else {
699 ieee80211_lost_packet(sta, skb); 718 ieee80211_lost_packet(sta, skb);
700 } 719 }