summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-01-28 09:19:24 -0500
committerJohannes Berg <johannes.berg@intel.com>2016-02-24 03:04:31 -0500
commitfb4ea054857ec719dba84c3b5a7c4ee50d42bd5b (patch)
tree1f704be2e91470d6bd29ae5c88c21034aa8e4ebb /net/mac80211/rx.c
parentf2ac7e301ae6397669ff3f79e691942a9b5d2f39 (diff)
mac80211: change ieee80211_rx_reorder_ready() arguments
Clean up ieee80211_rx_reorder_ready() callers by passing the RX TID struct and the index, instead of the frames list. This will make it more extensible as well. While at it, move the inline to rx.c as it's only used there. 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, 24 insertions, 9 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 664e8861edbe..1153871b570f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4,6 +4,7 @@
4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
5 * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net> 5 * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net>
6 * Copyright 2013-2014 Intel Mobile Communications GmbH 6 * Copyright 2013-2014 Intel Mobile Communications GmbH
7 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -798,6 +799,23 @@ static ieee80211_rx_result ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
798 return RX_CONTINUE; 799 return RX_CONTINUE;
799} 800}
800 801
802static inline bool ieee80211_rx_reorder_ready(struct tid_ampdu_rx *tid_agg_rx,
803 int index)
804{
805 struct sk_buff_head *frames = &tid_agg_rx->reorder_buf[index];
806 struct sk_buff *tail = skb_peek_tail(frames);
807 struct ieee80211_rx_status *status;
808
809 if (!tail)
810 return false;
811
812 status = IEEE80211_SKB_RXCB(tail);
813 if (status->flag & RX_FLAG_AMSDU_MORE)
814 return false;
815
816 return true;
817}
818
801static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata, 819static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
802 struct tid_ampdu_rx *tid_agg_rx, 820 struct tid_ampdu_rx *tid_agg_rx,
803 int index, 821 int index,
@@ -812,7 +830,7 @@ static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
812 if (skb_queue_empty(skb_list)) 830 if (skb_queue_empty(skb_list))
813 goto no_frame; 831 goto no_frame;
814 832
815 if (!ieee80211_rx_reorder_ready(skb_list)) { 833 if (!ieee80211_rx_reorder_ready(tid_agg_rx, index)) {
816 __skb_queue_purge(skb_list); 834 __skb_queue_purge(skb_list);
817 goto no_frame; 835 goto no_frame;
818 } 836 }
@@ -866,7 +884,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
866 884
867 /* release the buffer until next missing frame */ 885 /* release the buffer until next missing frame */
868 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size; 886 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
869 if (!ieee80211_rx_reorder_ready(&tid_agg_rx->reorder_buf[index]) && 887 if (!ieee80211_rx_reorder_ready(tid_agg_rx, index) &&
870 tid_agg_rx->stored_mpdu_num) { 888 tid_agg_rx->stored_mpdu_num) {
871 /* 889 /*
872 * No buffers ready to be released, but check whether any 890 * No buffers ready to be released, but check whether any
@@ -875,8 +893,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
875 int skipped = 1; 893 int skipped = 1;
876 for (j = (index + 1) % tid_agg_rx->buf_size; j != index; 894 for (j = (index + 1) % tid_agg_rx->buf_size; j != index;
877 j = (j + 1) % tid_agg_rx->buf_size) { 895 j = (j + 1) % tid_agg_rx->buf_size) {
878 if (!ieee80211_rx_reorder_ready( 896 if (!ieee80211_rx_reorder_ready(tid_agg_rx, j)) {
879 &tid_agg_rx->reorder_buf[j])) {
880 skipped++; 897 skipped++;
881 continue; 898 continue;
882 } 899 }
@@ -903,8 +920,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
903 skipped) & IEEE80211_SN_MASK; 920 skipped) & IEEE80211_SN_MASK;
904 skipped = 0; 921 skipped = 0;
905 } 922 }
906 } else while (ieee80211_rx_reorder_ready( 923 } else while (ieee80211_rx_reorder_ready(tid_agg_rx, index)) {
907 &tid_agg_rx->reorder_buf[index])) {
908 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index, 924 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
909 frames); 925 frames);
910 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size; 926 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
@@ -915,8 +931,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
915 931
916 for (; j != (index - 1) % tid_agg_rx->buf_size; 932 for (; j != (index - 1) % tid_agg_rx->buf_size;
917 j = (j + 1) % tid_agg_rx->buf_size) { 933 j = (j + 1) % tid_agg_rx->buf_size) {
918 if (ieee80211_rx_reorder_ready( 934 if (ieee80211_rx_reorder_ready(tid_agg_rx, j))
919 &tid_agg_rx->reorder_buf[j]))
920 break; 935 break;
921 } 936 }
922 937
@@ -987,7 +1002,7 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_sub_if_data *sdata
987 index = mpdu_seq_num % tid_agg_rx->buf_size; 1002 index = mpdu_seq_num % tid_agg_rx->buf_size;
988 1003
989 /* check if we already stored this frame */ 1004 /* check if we already stored this frame */
990 if (ieee80211_rx_reorder_ready(&tid_agg_rx->reorder_buf[index])) { 1005 if (ieee80211_rx_reorder_ready(tid_agg_rx, index)) {
991 dev_kfree_skb(skb); 1006 dev_kfree_skb(skb);
992 goto out; 1007 goto out;
993 } 1008 }