diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-25 22:30:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:43 -0400 |
commit | aeea0ab45ae3d761064ca926863bb41f0ad167ce (patch) | |
tree | 014af0acbc6920cb0cea7e3cb9377365f8ade54e /drivers | |
parent | ac26f81ccecc23ad5d8c20ebe1dd482fa395298b (diff) |
[PATCH] libertas: honor specific channel requests during association
Previously if a fixed channel was specified along with an SSID,
the channel request would be ignored during the association
process. Instead, when searching for an adhoc or infrastructure
network to join, allow filtering results based on channel so
that the driver doesn't pick a BSS on a different channel than
requested.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.h | 3 |
3 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index afce32761bfd..4fcc6a653d99 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -70,6 +70,7 @@ static int assoc_helper_essid(wlan_private *priv, | |||
70 | wlan_adapter *adapter = priv->adapter; | 70 | wlan_adapter *adapter = priv->adapter; |
71 | int ret = 0; | 71 | int ret = 0; |
72 | struct bss_descriptor * bss; | 72 | struct bss_descriptor * bss; |
73 | int channel = -1; | ||
73 | 74 | ||
74 | lbs_deb_enter(LBS_DEB_ASSOC); | 75 | lbs_deb_enter(LBS_DEB_ASSOC); |
75 | 76 | ||
@@ -77,6 +78,9 @@ static int assoc_helper_essid(wlan_private *priv, | |||
77 | * is set. | 78 | * is set. |
78 | */ | 79 | */ |
79 | 80 | ||
81 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) | ||
82 | channel = assoc_req->channel; | ||
83 | |||
80 | lbs_deb_assoc("New SSID requested: %s\n", assoc_req->ssid.ssid); | 84 | lbs_deb_assoc("New SSID requested: %s\n", assoc_req->ssid.ssid); |
81 | if (assoc_req->mode == IW_MODE_INFRA) { | 85 | if (assoc_req->mode == IW_MODE_INFRA) { |
82 | if (adapter->prescan) { | 86 | if (adapter->prescan) { |
@@ -84,7 +88,7 @@ static int assoc_helper_essid(wlan_private *priv, | |||
84 | } | 88 | } |
85 | 89 | ||
86 | bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, | 90 | bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, |
87 | NULL, IW_MODE_INFRA); | 91 | NULL, IW_MODE_INFRA, channel); |
88 | if (bss != NULL) { | 92 | if (bss != NULL) { |
89 | lbs_deb_assoc("SSID found in scan list, associating\n"); | 93 | lbs_deb_assoc("SSID found in scan list, associating\n"); |
90 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); | 94 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); |
@@ -101,7 +105,7 @@ static int assoc_helper_essid(wlan_private *priv, | |||
101 | 105 | ||
102 | /* Search for the requested SSID in the scan table */ | 106 | /* Search for the requested SSID in the scan table */ |
103 | bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, | 107 | bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, |
104 | IW_MODE_ADHOC); | 108 | IW_MODE_ADHOC, channel); |
105 | if (bss != NULL) { | 109 | if (bss != NULL) { |
106 | lbs_deb_assoc("SSID found joining\n"); | 110 | lbs_deb_assoc("SSID found joining\n"); |
107 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); | 111 | memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 8aaac5f6c9de..83b1612e84bf 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -1268,7 +1268,8 @@ struct bss_descriptor * libertas_find_BSSID_in_list(wlan_adapter * adapter, | |||
1268 | * @return index in BSSID list | 1268 | * @return index in BSSID list |
1269 | */ | 1269 | */ |
1270 | struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, | 1270 | struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, |
1271 | struct WLAN_802_11_SSID *ssid, u8 * bssid, u8 mode) | 1271 | struct WLAN_802_11_SSID *ssid, u8 * bssid, u8 mode, |
1272 | int channel) | ||
1272 | { | 1273 | { |
1273 | u8 bestrssi = 0; | 1274 | u8 bestrssi = 0; |
1274 | struct bss_descriptor * iter_bss = NULL; | 1275 | struct bss_descriptor * iter_bss = NULL; |
@@ -1286,6 +1287,8 @@ struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, | |||
1286 | continue; /* ssid doesn't match */ | 1287 | continue; /* ssid doesn't match */ |
1287 | if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) | 1288 | if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0) |
1288 | continue; /* bssid doesn't match */ | 1289 | continue; /* bssid doesn't match */ |
1290 | if ((channel > 0) && (iter_bss->channel != channel)) | ||
1291 | continue; /* channel doesn't match */ | ||
1289 | 1292 | ||
1290 | switch (mode) { | 1293 | switch (mode) { |
1291 | case IW_MODE_INFRA: | 1294 | case IW_MODE_INFRA: |
@@ -1661,7 +1664,7 @@ int libertas_get_scan(struct net_device *dev, struct iw_request_info *info, | |||
1661 | wlan_scan_networks(priv, NULL, 0); | 1664 | wlan_scan_networks(priv, NULL, 0); |
1662 | 1665 | ||
1663 | /* Update RSSI if current BSS is a locally created ad-hoc BSS */ | 1666 | /* Update RSSI if current BSS is a locally created ad-hoc BSS */ |
1664 | if ((adapter->inframode == wlan802_11ibss) && adapter->adhoccreate) { | 1667 | if ((adapter->mode == IW_MODE_ADHOC) && adapter->adhoccreate) { |
1665 | libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, | 1668 | libertas_prepare_and_send_command(priv, cmd_802_11_rssi, 0, |
1666 | cmd_option_waitforrsp, 0, NULL); | 1669 | cmd_option_waitforrsp, 0, NULL); |
1667 | } | 1670 | } |
diff --git a/drivers/net/wireless/libertas/scan.h b/drivers/net/wireless/libertas/scan.h index 4ad130ff6e7e..df7481c11f68 100644 --- a/drivers/net/wireless/libertas/scan.h +++ b/drivers/net/wireless/libertas/scan.h | |||
@@ -178,7 +178,8 @@ extern int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1, | |||
178 | struct WLAN_802_11_SSID *ssid2); | 178 | struct WLAN_802_11_SSID *ssid2); |
179 | 179 | ||
180 | struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, | 180 | struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, |
181 | struct WLAN_802_11_SSID *ssid, u8 * bssid, u8 mode); | 181 | struct WLAN_802_11_SSID *ssid, u8 * bssid, u8 mode, |
182 | int channel); | ||
182 | 183 | ||
183 | struct bss_descriptor * libertas_find_best_SSID_in_list(wlan_adapter * adapter, | 184 | struct bss_descriptor * libertas_find_best_SSID_in_list(wlan_adapter * adapter, |
184 | u8 mode); | 185 | u8 mode); |