提交 08ca944e 编写于 作者: H Helmut Schaa 提交者: John W. Linville

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: NHelmut Schaa <helmut.schaa@googlemail.com>
Reviewed-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 20ed3166
...@@ -1877,9 +1877,8 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx) ...@@ -1877,9 +1877,8 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
dev->stats.rx_packets++; dev->stats.rx_packets++;
dev->stats.rx_bytes += rx->skb->len; dev->stats.rx_bytes += rx->skb->len;
if (ieee80211_is_data(hdr->frame_control) && if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
!is_multicast_ether_addr(hdr->addr1) && !is_multicast_ether_addr(((struct ethhdr *)rx->skb->data)->h_dest)) {
local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) {
mod_timer(&local->dynamic_ps_timer, jiffies + mod_timer(&local->dynamic_ps_timer, jiffies +
msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册