diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2010-11-30 06:19:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-30 13:58:07 -0500 |
commit | 08ca944eb240b2299e743c76b43fbc7c2dd251de (patch) | |
tree | 9782965ad4754969685cfd440b81ded25d4d6023 | |
parent | 20ed3166c84d145589a89d8cde12aa32cf2d17f4 (diff) |
mac80211: Minor optimization in ieee80211_rx_h_data
Remove a superfluous ieee80211_is_data check as that was checked a few
lines before already and we wont't get here for non-data frames at all.
Second, the frame was already converted to 802.3 header format and
reading the fc and addr1 fields was only possible because the 802.3
header is short enough and didn't overwrite the relevant parts of the
802.11 header. Make the code more obvious by checking the ethernet
header's h_dest field.
Furthermore reorder the conditions to reduce the number of checks
when dynamic powersave is not needed (AP mode for example).
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/rx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fdeabb19943..d83334bbb24 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1877,9 +1877,8 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx) | |||
1877 | dev->stats.rx_packets++; | 1877 | dev->stats.rx_packets++; |
1878 | dev->stats.rx_bytes += rx->skb->len; | 1878 | dev->stats.rx_bytes += rx->skb->len; |
1879 | 1879 | ||
1880 | if (ieee80211_is_data(hdr->frame_control) && | 1880 | if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 && |
1881 | !is_multicast_ether_addr(hdr->addr1) && | 1881 | !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) { |
1882 | local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) { | ||
1883 | mod_timer(&local->dynamic_ps_timer, jiffies + | 1882 | mod_timer(&local->dynamic_ps_timer, jiffies + |
1884 | msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); | 1883 | msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); |
1885 | } | 1884 | } |