@@ -621,24 +621,13 @@ static void ieee80211_lost_packet(struct sta_info *sta,
621
621
sta -> lost_packets = 0 ;
622
622
}
623
623
624
- void ieee80211_tx_status (struct ieee80211_hw * hw , struct sk_buff * skb )
624
+ static int ieee80211_tx_get_rates (struct ieee80211_hw * hw ,
625
+ struct ieee80211_tx_info * info ,
626
+ int * retry_count )
625
627
{
626
- struct sk_buff * skb2 ;
627
- struct ieee80211_hdr * hdr = (struct ieee80211_hdr * ) skb -> data ;
628
- struct ieee80211_local * local = hw_to_local (hw );
629
- struct ieee80211_tx_info * info = IEEE80211_SKB_CB (skb );
630
- __le16 fc ;
631
- struct ieee80211_supported_band * sband ;
632
- struct ieee80211_sub_if_data * sdata ;
633
- struct net_device * prev_dev = NULL ;
634
- struct sta_info * sta , * tmp ;
635
- int retry_count = -1 , i ;
636
628
int rates_idx = -1 ;
637
- bool send_to_cooked ;
638
- bool acked ;
639
- struct ieee80211_bar * bar ;
640
- int rtap_len ;
641
- int shift = 0 ;
629
+ int count = -1 ;
630
+ int i ;
642
631
643
632
for (i = 0 ; i < IEEE80211_TX_MAX_RATES ; i ++ ) {
644
633
if ((info -> flags & IEEE80211_TX_CTL_AMPDU ) &&
@@ -656,12 +645,37 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
656
645
break ;
657
646
}
658
647
659
- retry_count += info -> status .rates [i ].count ;
648
+ count += info -> status .rates [i ].count ;
660
649
}
661
650
rates_idx = i - 1 ;
662
651
663
- if (retry_count < 0 )
664
- retry_count = 0 ;
652
+ if (count < 0 )
653
+ count = 0 ;
654
+
655
+ * retry_count = count ;
656
+ return rates_idx ;
657
+ }
658
+
659
+ void ieee80211_tx_status (struct ieee80211_hw * hw , struct sk_buff * skb )
660
+ {
661
+ struct sk_buff * skb2 ;
662
+ struct ieee80211_hdr * hdr = (struct ieee80211_hdr * ) skb -> data ;
663
+ struct ieee80211_local * local = hw_to_local (hw );
664
+ struct ieee80211_tx_info * info = IEEE80211_SKB_CB (skb );
665
+ __le16 fc ;
666
+ struct ieee80211_supported_band * sband ;
667
+ struct ieee80211_sub_if_data * sdata ;
668
+ struct net_device * prev_dev = NULL ;
669
+ struct sta_info * sta , * tmp ;
670
+ int retry_count ;
671
+ int rates_idx ;
672
+ bool send_to_cooked ;
673
+ bool acked ;
674
+ struct ieee80211_bar * bar ;
675
+ int rtap_len ;
676
+ int shift = 0 ;
677
+
678
+ rates_idx = ieee80211_tx_get_rates (hw , info , & retry_count );
665
679
666
680
rcu_read_lock ();
667
681
0 commit comments