Skip to content

Commit fb4ea05

Browse files
committed
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 <[email protected]>
1 parent f2ac7e3 commit fb4ea05

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

net/mac80211/ieee80211_i.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,20 +1838,6 @@ static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
18381838
ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0);
18391839
}
18401840

1841-
static inline bool ieee80211_rx_reorder_ready(struct sk_buff_head *frames)
1842-
{
1843-
struct sk_buff *tail = skb_peek_tail(frames);
1844-
struct ieee80211_rx_status *status;
1845-
1846-
if (!tail)
1847-
return false;
1848-
1849-
status = IEEE80211_SKB_RXCB(tail);
1850-
if (status->flag & RX_FLAG_AMSDU_MORE)
1851-
return false;
1852-
1853-
return true;
1854-
}
18551841

18561842
extern const int ieee802_1d_to_ac[8];
18571843

net/mac80211/rx.c

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright 2006-2007 Jiri Benc <[email protected]>
55
* Copyright 2007-2010 Johannes Berg <[email protected]>
66
* Copyright 2013-2014 Intel Mobile Communications GmbH
7+
* Copyright(c) 2015 - 2016 Intel Deutschland GmbH
78
*
89
* This program is free software; you can redistribute it and/or modify
910
* 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)
798799
return RX_CONTINUE;
799800
}
800801

802+
static 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+
801819
static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
802820
struct tid_ampdu_rx *tid_agg_rx,
803821
int index,
@@ -812,7 +830,7 @@ static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
812830
if (skb_queue_empty(skb_list))
813831
goto no_frame;
814832

815-
if (!ieee80211_rx_reorder_ready(skb_list)) {
833+
if (!ieee80211_rx_reorder_ready(tid_agg_rx, index)) {
816834
__skb_queue_purge(skb_list);
817835
goto no_frame;
818836
}
@@ -866,7 +884,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
866884

867885
/* release the buffer until next missing frame */
868886
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) &&
870888
tid_agg_rx->stored_mpdu_num) {
871889
/*
872890
* 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,
875893
int skipped = 1;
876894
for (j = (index + 1) % tid_agg_rx->buf_size; j != index;
877895
j = (j + 1) % tid_agg_rx->buf_size) {
878-
if (!ieee80211_rx_reorder_ready(
879-
&tid_agg_rx->reorder_buf[j])) {
896+
if (!ieee80211_rx_reorder_ready(tid_agg_rx, j)) {
880897
skipped++;
881898
continue;
882899
}
@@ -903,8 +920,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
903920
skipped) & IEEE80211_SN_MASK;
904921
skipped = 0;
905922
}
906-
} else while (ieee80211_rx_reorder_ready(
907-
&tid_agg_rx->reorder_buf[index])) {
923+
} else while (ieee80211_rx_reorder_ready(tid_agg_rx, index)) {
908924
ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
909925
frames);
910926
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,
915931

916932
for (; j != (index - 1) % tid_agg_rx->buf_size;
917933
j = (j + 1) % tid_agg_rx->buf_size) {
918-
if (ieee80211_rx_reorder_ready(
919-
&tid_agg_rx->reorder_buf[j]))
934+
if (ieee80211_rx_reorder_ready(tid_agg_rx, j))
920935
break;
921936
}
922937

@@ -987,7 +1002,7 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_sub_if_data *sdata
9871002
index = mpdu_seq_num % tid_agg_rx->buf_size;
9881003

9891004
/* 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)) {
9911006
dev_kfree_skb(skb);
9921007
goto out;
9931008
}

0 commit comments

Comments
 (0)