aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-22 06:48:38 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-22 06:53:06 -0400
commitd3b2fb53c7f82903880769d406c11c7e619b11a4 (patch)
tree22184cab9758fff87392ba2e19503dfe00874e6f /net/mac80211/rx.c
parent08ce5abe3d0e29a7c8b46c4bec891862941116d7 (diff)
mac80211: pass sdata to some RX functions
For better debugging, we would like to have the sdata pointer available later, so pass it into these functions. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 446a327b3de0..9f1bd692589b 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -554,11 +554,11 @@ static inline u16 seq_sub(u16 sq1, u16 sq2)
554} 554}
555 555
556 556
557static void ieee80211_release_reorder_frame(struct ieee80211_hw *hw, 557static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
558 struct tid_ampdu_rx *tid_agg_rx, 558 struct tid_ampdu_rx *tid_agg_rx,
559 int index) 559 int index)
560{ 560{
561 struct ieee80211_local *local = hw_to_local(hw); 561 struct ieee80211_local *local = sdata->local;
562 struct sk_buff *skb = tid_agg_rx->reorder_buf[index]; 562 struct sk_buff *skb = tid_agg_rx->reorder_buf[index];
563 struct ieee80211_rx_status *status; 563 struct ieee80211_rx_status *status;
564 564
@@ -578,7 +578,7 @@ no_frame:
578 tid_agg_rx->head_seq_num = seq_inc(tid_agg_rx->head_seq_num); 578 tid_agg_rx->head_seq_num = seq_inc(tid_agg_rx->head_seq_num);
579} 579}
580 580
581static void ieee80211_release_reorder_frames(struct ieee80211_hw *hw, 581static void ieee80211_release_reorder_frames(struct ieee80211_sub_if_data *sdata,
582 struct tid_ampdu_rx *tid_agg_rx, 582 struct tid_ampdu_rx *tid_agg_rx,
583 u16 head_seq_num) 583 u16 head_seq_num)
584{ 584{
@@ -589,7 +589,7 @@ static void ieee80211_release_reorder_frames(struct ieee80211_hw *hw,
589 while (seq_less(tid_agg_rx->head_seq_num, head_seq_num)) { 589 while (seq_less(tid_agg_rx->head_seq_num, head_seq_num)) {
590 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) % 590 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) %
591 tid_agg_rx->buf_size; 591 tid_agg_rx->buf_size;
592 ieee80211_release_reorder_frame(hw, tid_agg_rx, index); 592 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index);
593 } 593 }
594} 594}
595 595
@@ -604,7 +604,7 @@ static void ieee80211_release_reorder_frames(struct ieee80211_hw *hw,
604 */ 604 */
605#define HT_RX_REORDER_BUF_TIMEOUT (HZ / 10) 605#define HT_RX_REORDER_BUF_TIMEOUT (HZ / 10)
606 606
607static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw, 607static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
608 struct tid_ampdu_rx *tid_agg_rx) 608 struct tid_ampdu_rx *tid_agg_rx)
609{ 609{
610 int index, j; 610 int index, j;
@@ -634,10 +634,10 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
634 634
635#ifdef CONFIG_MAC80211_HT_DEBUG 635#ifdef CONFIG_MAC80211_HT_DEBUG
636 if (net_ratelimit()) 636 if (net_ratelimit())
637 wiphy_debug(hw->wiphy, 637 wiphy_debug(sdata->local->hw.wiphy,
638 "release an RX reorder frame due to timeout on earlier frames\n"); 638 "release an RX reorder frame due to timeout on earlier frames\n");
639#endif 639#endif
640 ieee80211_release_reorder_frame(hw, tid_agg_rx, j); 640 ieee80211_release_reorder_frame(sdata, tid_agg_rx, j);
641 641
642 /* 642 /*
643 * Increment the head seq# also for the skipped slots. 643 * Increment the head seq# also for the skipped slots.
@@ -647,7 +647,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
647 skipped = 0; 647 skipped = 0;
648 } 648 }
649 } else while (tid_agg_rx->reorder_buf[index]) { 649 } else while (tid_agg_rx->reorder_buf[index]) {
650 ieee80211_release_reorder_frame(hw, tid_agg_rx, index); 650 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index);
651 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) % 651 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) %
652 tid_agg_rx->buf_size; 652 tid_agg_rx->buf_size;
653 } 653 }
@@ -677,7 +677,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
677 * rcu_read_lock protection. It returns false if the frame 677 * rcu_read_lock protection. It returns false if the frame
678 * can be processed immediately, true if it was consumed. 678 * can be processed immediately, true if it was consumed.
679 */ 679 */
680static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, 680static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_sub_if_data *sdata,
681 struct tid_ampdu_rx *tid_agg_rx, 681 struct tid_ampdu_rx *tid_agg_rx,
682 struct sk_buff *skb) 682 struct sk_buff *skb)
683{ 683{
@@ -706,7 +706,8 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw,
706 if (!seq_less(mpdu_seq_num, head_seq_num + buf_size)) { 706 if (!seq_less(mpdu_seq_num, head_seq_num + buf_size)) {
707 head_seq_num = seq_inc(seq_sub(mpdu_seq_num, buf_size)); 707 head_seq_num = seq_inc(seq_sub(mpdu_seq_num, buf_size));
708 /* release stored frames up to new head to stack */ 708 /* release stored frames up to new head to stack */
709 ieee80211_release_reorder_frames(hw, tid_agg_rx, head_seq_num); 709 ieee80211_release_reorder_frames(sdata, tid_agg_rx,
710 head_seq_num);
710 } 711 }
711 712
712 /* Now the new frame is always in the range of the reordering buffer */ 713 /* Now the new frame is always in the range of the reordering buffer */
@@ -736,7 +737,7 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw,
736 tid_agg_rx->reorder_buf[index] = skb; 737 tid_agg_rx->reorder_buf[index] = skb;
737 tid_agg_rx->reorder_time[index] = jiffies; 738 tid_agg_rx->reorder_time[index] = jiffies;
738 tid_agg_rx->stored_mpdu_num++; 739 tid_agg_rx->stored_mpdu_num++;
739 ieee80211_sta_reorder_release(hw, tid_agg_rx); 740 ieee80211_sta_reorder_release(sdata, tid_agg_rx);
740 741
741 out: 742 out:
742 spin_unlock(&tid_agg_rx->reorder_lock); 743 spin_unlock(&tid_agg_rx->reorder_lock);
@@ -751,7 +752,6 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx)
751{ 752{
752 struct sk_buff *skb = rx->skb; 753 struct sk_buff *skb = rx->skb;
753 struct ieee80211_local *local = rx->local; 754 struct ieee80211_local *local = rx->local;
754 struct ieee80211_hw *hw = &local->hw;
755 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 755 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
756 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 756 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
757 struct sta_info *sta = rx->sta; 757 struct sta_info *sta = rx->sta;
@@ -813,7 +813,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx)
813 * sure that we cannot get to it any more before doing 813 * sure that we cannot get to it any more before doing
814 * anything with it. 814 * anything with it.
815 */ 815 */
816 if (ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, skb)) 816 if (ieee80211_sta_manage_reorder_buf(rx->sdata, tid_agg_rx, skb))
817 return; 817 return;
818 818
819 dont_reorder: 819 dont_reorder:
@@ -2058,8 +2058,6 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
2058static ieee80211_rx_result debug_noinline 2058static ieee80211_rx_result debug_noinline
2059ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx) 2059ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx)
2060{ 2060{
2061 struct ieee80211_local *local = rx->local;
2062 struct ieee80211_hw *hw = &local->hw;
2063 struct sk_buff *skb = rx->skb; 2061 struct sk_buff *skb = rx->skb;
2064 struct ieee80211_bar *bar = (struct ieee80211_bar *)skb->data; 2062 struct ieee80211_bar *bar = (struct ieee80211_bar *)skb->data;
2065 struct tid_ampdu_rx *tid_agg_rx; 2063 struct tid_ampdu_rx *tid_agg_rx;
@@ -2096,7 +2094,8 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx)
2096 2094
2097 spin_lock(&tid_agg_rx->reorder_lock); 2095 spin_lock(&tid_agg_rx->reorder_lock);
2098 /* release stored frames up to start of BAR */ 2096 /* release stored frames up to start of BAR */
2099 ieee80211_release_reorder_frames(hw, tid_agg_rx, start_seq_num); 2097 ieee80211_release_reorder_frames(rx->sdata, tid_agg_rx,
2098 start_seq_num);
2100 spin_unlock(&tid_agg_rx->reorder_lock); 2099 spin_unlock(&tid_agg_rx->reorder_lock);
2101 2100
2102 kfree_skb(skb); 2101 kfree_skb(skb);
@@ -2747,7 +2746,7 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
2747 return; 2746 return;
2748 2747
2749 spin_lock(&tid_agg_rx->reorder_lock); 2748 spin_lock(&tid_agg_rx->reorder_lock);
2750 ieee80211_sta_reorder_release(&sta->local->hw, tid_agg_rx); 2749 ieee80211_sta_reorder_release(sta->sdata, tid_agg_rx);
2751 spin_unlock(&tid_agg_rx->reorder_lock); 2750 spin_unlock(&tid_agg_rx->reorder_lock);
2752 2751
2753 ieee80211_rx_handlers(&rx); 2752 ieee80211_rx_handlers(&rx);