diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-25 17:28:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:42 -0400 |
commit | 3cf20931fa8ffd765a95f72d7539ab34770684d9 (patch) | |
tree | 139a04214a99689234fa901252345f0075f878a2 /drivers/net/wireless/libertas | |
parent | 02eb229bbded41d189f1ec57dbd264f80c93b5c6 (diff) |
[PATCH] libertas: use compare_ether_addr() rather than memcmp() where appropriate
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index b18464224b95..afce32761bfd 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <linux/bitops.h> | 3 | #include <linux/bitops.h> |
4 | #include <net/ieee80211.h> | 4 | #include <net/ieee80211.h> |
5 | #include <linux/etherdevice.h> | ||
5 | 6 | ||
6 | #include "assoc.h" | 7 | #include "assoc.h" |
7 | #include "join.h" | 8 | #include "join.h" |
@@ -161,8 +162,8 @@ static int assoc_helper_associate(wlan_private *priv, | |||
161 | /* If we're given and 'any' BSSID, try associating based on SSID */ | 162 | /* If we're given and 'any' BSSID, try associating based on SSID */ |
162 | 163 | ||
163 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { | 164 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
164 | if (memcmp(bssid_any, assoc_req->bssid, ETH_ALEN) | 165 | if (compare_ether_addr(bssid_any, assoc_req->bssid) |
165 | && memcmp(bssid_off, assoc_req->bssid, ETH_ALEN)) { | 166 | && compare_ether_addr(bssid_off, assoc_req->bssid)) { |
166 | ret = assoc_helper_bssid(priv, assoc_req); | 167 | ret = assoc_helper_bssid(priv, assoc_req); |
167 | done = 1; | 168 | done = 1; |
168 | if (ret) { | 169 | if (ret) { |
@@ -488,8 +489,8 @@ void libertas_association_worker(struct work_struct *work) | |||
488 | 489 | ||
489 | /* But don't use 'any' SSID if there's a valid locked BSSID to use */ | 490 | /* But don't use 'any' SSID if there's a valid locked BSSID to use */ |
490 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { | 491 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
491 | if (memcmp(&assoc_req->bssid, bssid_any, ETH_ALEN) | 492 | if (compare_ether_addr(assoc_req->bssid, bssid_any) |
492 | && memcmp(&assoc_req->bssid, bssid_off, ETH_ALEN)) | 493 | && compare_ether_addr(assoc_req->bssid, bssid_off)) |
493 | find_any_ssid = 0; | 494 | find_any_ssid = 0; |
494 | } | 495 | } |
495 | 496 | ||
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 133be93d608e..abc9d563ce46 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -1238,7 +1238,7 @@ struct bss_descriptor * libertas_find_BSSID_in_list(wlan_adapter * adapter, | |||
1238 | */ | 1238 | */ |
1239 | mutex_lock(&adapter->lock); | 1239 | mutex_lock(&adapter->lock); |
1240 | list_for_each_entry (iter_bss, &adapter->network_list, list) { | 1240 | list_for_each_entry (iter_bss, &adapter->network_list, list) { |
1241 | if (memcmp(iter_bss->bssid, bssid, ETH_ALEN)) | 1241 | if (compare_ether_addr(iter_bss->bssid, bssid)) |
1242 | continue; /* bssid doesn't match */ | 1242 | continue; /* bssid doesn't match */ |
1243 | switch (mode) { | 1243 | switch (mode) { |
1244 | case IW_MODE_INFRA: | 1244 | case IW_MODE_INFRA: |
@@ -1284,7 +1284,7 @@ struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, | |||
1284 | 1284 | ||
1285 | if (libertas_SSID_cmp(&iter_bss->ssid, ssid) != 0) | 1285 | if (libertas_SSID_cmp(&iter_bss->ssid, ssid) != 0) |
1286 | continue; /* ssid doesn't match */ | 1286 | continue; /* ssid doesn't match */ |
1287 | if (bssid && memcmp(iter_bss->bssid, bssid, ETH_ALEN) != 0) | 1287 | if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) |
1288 | continue; /* bssid doesn't match */ | 1288 | continue; /* bssid doesn't match */ |
1289 | 1289 | ||
1290 | switch (mode) { | 1290 | switch (mode) { |