diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-11-19 14:08:13 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-11-28 09:01:51 -0500 |
commit | f027c2aca0cf43e0f15fc8de8841f7b566163d94 (patch) | |
tree | 932656a5a8d8b1048d287dea276c9cf5a29fb10c /net/mac80211/status.c | |
parent | 7e1cdcbb092458f7b0cc247004c43f0b228fc970 (diff) |
mac80211: add ieee80211_tx_status_noskb
This can be used by drivers that cannot reliably map tx status
information onto specific skbs.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/status.c')
-rw-r--r-- | net/mac80211/status.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index fee9c5ee51ae..bb146f377ee4 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
@@ -656,6 +656,60 @@ static int ieee80211_tx_get_rates(struct ieee80211_hw *hw, | |||
656 | return rates_idx; | 656 | return rates_idx; |
657 | } | 657 | } |
658 | 658 | ||
659 | void ieee80211_tx_status_noskb(struct ieee80211_hw *hw, | ||
660 | struct ieee80211_sta *pubsta, | ||
661 | struct ieee80211_tx_info *info) | ||
662 | { | ||
663 | struct ieee80211_local *local = hw_to_local(hw); | ||
664 | struct ieee80211_supported_band *sband; | ||
665 | int retry_count; | ||
666 | int rates_idx; | ||
667 | bool acked; | ||
668 | |||
669 | rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); | ||
670 | |||
671 | sband = hw->wiphy->bands[info->band]; | ||
672 | |||
673 | acked = !!(info->flags & IEEE80211_TX_STAT_ACK); | ||
674 | if (pubsta) { | ||
675 | struct sta_info *sta; | ||
676 | |||
677 | sta = container_of(pubsta, struct sta_info, sta); | ||
678 | |||
679 | if (!acked) | ||
680 | sta->tx_retry_failed++; | ||
681 | sta->tx_retry_count += retry_count; | ||
682 | |||
683 | if (acked) { | ||
684 | sta->last_rx = jiffies; | ||
685 | |||
686 | if (sta->lost_packets) | ||
687 | sta->lost_packets = 0; | ||
688 | |||
689 | /* Track when last TDLS packet was ACKed */ | ||
690 | if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) | ||
691 | sta->last_tdls_pkt_time = jiffies; | ||
692 | } else { | ||
693 | ieee80211_lost_packet(sta, info); | ||
694 | } | ||
695 | |||
696 | rate_control_tx_status_noskb(local, sband, sta, info); | ||
697 | } | ||
698 | |||
699 | if (acked) { | ||
700 | local->dot11TransmittedFrameCount++; | ||
701 | if (!pubsta) | ||
702 | local->dot11MulticastTransmittedFrameCount++; | ||
703 | if (retry_count > 0) | ||
704 | local->dot11RetryCount++; | ||
705 | if (retry_count > 1) | ||
706 | local->dot11MultipleRetryCount++; | ||
707 | } else { | ||
708 | local->dot11FailedCount++; | ||
709 | } | ||
710 | } | ||
711 | EXPORT_SYMBOL(ieee80211_tx_status_noskb); | ||
712 | |||
659 | void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | 713 | void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) |
660 | { | 714 | { |
661 | struct sk_buff *skb2; | 715 | struct sk_buff *skb2; |