Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224694
b: refs/heads/master
c: 99ba2a1
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 24, 2010
1 parent cf43a63 commit 925bc10
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c063dbf52b998b852122dff07a8b8dd430b38437
refs/heads/master: 99ba2a14283be96a682e04455061c08a46bbf4ec
3 changes: 3 additions & 0 deletions trunk/net/mac80211/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ enum plink_state {
* @sta: station information we share with the driver
* @dead: set to true when sta is unlinked
* @uploaded: set to true when sta is uploaded to the driver
* @lost_packets: number of consecutive lost packets
*/
struct sta_info {
/* General information, mostly static */
Expand Down Expand Up @@ -335,6 +336,8 @@ struct sta_info {
} debugfs;
#endif

unsigned int lost_packets;

/* keep last! */
struct ieee80211_sta sta;
};
Expand Down
22 changes: 22 additions & 0 deletions trunk/net/mac80211/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb)
ieee80211_sta_tx_notify(sdata, (void *) skb->data);
}

/*
* Use a static threshold for now, best value to be determined
* by testing ...
* Should it depend on:
* - on # of retransmissions
* - current throughput (higher value for higher tpt)?
*/
#define STA_LOST_PKT_THRESHOLD 50

void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct sk_buff *skb2;
Expand Down Expand Up @@ -247,6 +256,19 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
if (!(info->flags & IEEE80211_TX_CTL_INJECTED) &&
(info->flags & IEEE80211_TX_STAT_ACK))
ieee80211_frame_acked(sta, skb);

if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) {
if (info->flags & IEEE80211_TX_STAT_ACK) {
if (sta->lost_packets)
sta->lost_packets = 0;
} else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) {
cfg80211_cqm_pktloss_notify(sta->sdata->dev,
sta->sta.addr,
sta->lost_packets,
GFP_ATOMIC);
sta->lost_packets = 0;
}
}
}

rcu_read_unlock();
Expand Down

0 comments on commit 925bc10

Please sign in to comment.