Commit 8e6f0032 authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller

[MAC80211]: rx cleanups (1)

Make some really indented code more readable by outdenting.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJiri Benc <jbenc@suse.cz>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6e0d114d
...@@ -1079,21 +1079,24 @@ static inline ieee80211_txrx_result __ieee80211_invoke_rx_handlers( ...@@ -1079,21 +1079,24 @@ static inline ieee80211_txrx_result __ieee80211_invoke_rx_handlers(
for (handler = handlers; *handler != NULL; handler++) { for (handler = handlers; *handler != NULL; handler++) {
res = (*handler)(rx); res = (*handler)(rx);
if (res != TXRX_CONTINUE) {
if (res == TXRX_DROP) { switch (res) {
case TXRX_CONTINUE:
continue;
case TXRX_DROP:
I802_DEBUG_INC(local->rx_handlers_drop); I802_DEBUG_INC(local->rx_handlers_drop);
if (sta) if (sta)
sta->rx_dropped++; sta->rx_dropped++;
} break;
if (res == TXRX_QUEUED) case TXRX_QUEUED:
I802_DEBUG_INC(local->rx_handlers_queued); I802_DEBUG_INC(local->rx_handlers_queued);
break; break;
} }
break;
} }
if (res == TXRX_DROP) { if (res == TXRX_DROP)
dev_kfree_skb(rx->skb); dev_kfree_skb(rx->skb);
}
return res; return res;
} }
...@@ -1242,6 +1245,9 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1242,6 +1245,9 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
u16 type; u16 type;
int multicast; int multicast;
int radiotap_len = 0; int radiotap_len = 0;
struct ieee80211_sub_if_data *prev = NULL;
struct sk_buff *skb_new;
u8 *bssid;
if (status->flag & RX_FLAG_RADIOTAP) { if (status->flag & RX_FLAG_RADIOTAP) {
radiotap_len = ieee80211_get_radiotap_len(skb->data); radiotap_len = ieee80211_get_radiotap_len(skb->data);
...@@ -1289,10 +1295,11 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1289,10 +1295,11 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
rx.u.rx.ra_match = 1; rx.u.rx.ra_match = 1;
ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx, ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx,
sta); sta);
} else { sta_info_put(sta);
struct ieee80211_sub_if_data *prev = NULL; return;
struct sk_buff *skb_new; }
u8 *bssid = ieee80211_get_bssid(hdr, skb->len - radiotap_len);
bssid = ieee80211_get_bssid(hdr, skb->len - radiotap_len);
read_lock(&local->sub_if_lock); read_lock(&local->sub_if_lock);
list_for_each_entry(sdata, &local->sub_if_list, list) { list_for_each_entry(sdata, &local->sub_if_list, list) {
...@@ -1337,7 +1344,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1337,7 +1344,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
case IEEE80211_IF_TYPE_AP: case IEEE80211_IF_TYPE_AP:
if (!bssid) { if (!bssid) {
if (compare_ether_addr(sdata->dev->dev_addr, if (compare_ether_addr(sdata->dev->dev_addr,
hdr->addr1) != 0) hdr->addr1))
continue; continue;
} else if (!ieee80211_bssid_match(bssid, } else if (!ieee80211_bssid_match(bssid,
sdata->dev->dev_addr)) { sdata->dev->dev_addr)) {
...@@ -1345,8 +1352,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1345,8 +1352,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
continue; continue;
rx.u.rx.ra_match = 0; rx.u.rx.ra_match = 0;
} }
if (sdata->dev == local->mdev && if (sdata->dev == local->mdev && !rx.u.rx.in_scan)
!rx.u.rx.in_scan)
/* do not receive anything via /* do not receive anything via
* master device when not scanning */ * master device when not scanning */
continue; continue;
...@@ -1356,7 +1362,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1356,7 +1362,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
(rx.fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) (rx.fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
continue; continue;
if (compare_ether_addr(sdata->u.wds.remote_addr, if (compare_ether_addr(sdata->u.wds.remote_addr,
hdr->addr2) != 0) hdr->addr2))
continue; continue;
break; break;
} }
...@@ -1373,8 +1379,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1373,8 +1379,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
rx.skb = skb_new; rx.skb = skb_new;
rx.dev = prev->dev; rx.dev = prev->dev;
rx.sdata = prev; rx.sdata = prev;
ieee80211_invoke_rx_handlers(local, ieee80211_invoke_rx_handlers(local, local->rx_handlers,
local->rx_handlers,
&rx, sta); &rx, sta);
} }
prev = sdata; prev = sdata;
...@@ -1388,7 +1393,6 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1388,7 +1393,6 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
} else } else
dev_kfree_skb(skb); dev_kfree_skb(skb);
read_unlock(&local->sub_if_lock); read_unlock(&local->sub_if_lock);
}
end: end:
if (sta) if (sta)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment