diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-12-26 11:41:23 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 18:31:35 (GMT) |
commit | 36325f3a9fabe66b3c2442f63163958f992ff16e (patch) | |
tree | 02ce300a456d2bf01e22b1097c5662b1ac8d4421 /drivers/net/wireless/ipw2x00/libipw_rx.c | |
parent | 35df5388ac7cd205cc642b28eb90f940c816eaf7 (diff) | |
download | linux-36325f3a9fabe66b3c2442f63163958f992ff16e.tar.xz |
ipw2x00: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ipw2x00/libipw_rx.c')
-rw-r--r-- | drivers/net/wireless/ipw2x00/libipw_rx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c index 9ffe659..5c62538 100644 --- a/drivers/net/wireless/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/ipw2x00/libipw_rx.c @@ -874,13 +874,13 @@ void libipw_rx_any(struct libipw_device *ieee, switch (ieee->iw_mode) { case IW_MODE_ADHOC: /* our BSS and not from/to DS */ - if (memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) == 0) + if (ether_addr_equal(hdr->addr3, ieee->bssid)) if ((fc & (IEEE80211_FCTL_TODS+IEEE80211_FCTL_FROMDS)) == 0) { /* promisc: get all */ if (ieee->dev->flags & IFF_PROMISC) is_packet_for_us = 1; /* to us */ - else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0) + else if (ether_addr_equal(hdr->addr1, ieee->dev->dev_addr)) is_packet_for_us = 1; /* mcast */ else if (is_multicast_ether_addr(hdr->addr1)) @@ -889,18 +889,18 @@ void libipw_rx_any(struct libipw_device *ieee, break; case IW_MODE_INFRA: /* our BSS (== from our AP) and from DS */ - if (memcmp(hdr->addr2, ieee->bssid, ETH_ALEN) == 0) + if (ether_addr_equal(hdr->addr2, ieee->bssid)) if ((fc & (IEEE80211_FCTL_TODS+IEEE80211_FCTL_FROMDS)) == IEEE80211_FCTL_FROMDS) { /* promisc: get all */ if (ieee->dev->flags & IFF_PROMISC) is_packet_for_us = 1; /* to us */ - else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0) + else if (ether_addr_equal(hdr->addr1, ieee->dev->dev_addr)) is_packet_for_us = 1; /* mcast */ else if (is_multicast_ether_addr(hdr->addr1)) { /* not our own packet bcasted from AP */ - if (memcmp(hdr->addr3, ieee->dev->dev_addr, ETH_ALEN)) + if (!ether_addr_equal(hdr->addr3, ieee->dev->dev_addr)) is_packet_for_us = 1; } } |