aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-25 16:15:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:41 -0400
commitfcdb53dbc743f288bf72e485fefb3a967b733686 (patch)
treeceafcff8076af2da654214e3b72caa7b15164a28 /drivers/net/wireless/libertas/wext.c
parent90e8eafc93ed159846bb7126af8502f2a8570a11 (diff)
[PATCH] libertas: make scan result handling more flexible
- use a linked list for scan results - age scan results - pass bss_descriptors around instead of indexes into the scan table - lock access to the scan results - stop returning EAGAIN from SIOCGIWSCAN handler Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 4f0ae8026b0e..4759aa2bba5d 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -189,6 +189,8 @@ static int setcurrentchannel(wlan_private * priv, int channel)
189static int changeadhocchannel(wlan_private * priv, int channel) 189static int changeadhocchannel(wlan_private * priv, int channel)
190{ 190{
191 int ret = 0; 191 int ret = 0;
192 struct WLAN_802_11_SSID curadhocssid;
193 struct bss_descriptor * join_bss = NULL;
192 wlan_adapter *adapter = priv->adapter; 194 wlan_adapter *adapter = priv->adapter;
193 195
194 adapter->adhocchannel = channel; 196 adapter->adhocchannel = channel;
@@ -214,43 +216,38 @@ static int changeadhocchannel(wlan_private * priv, int channel)
214 goto out; 216 goto out;
215 } 217 }
216 218
217 if (adapter->connect_status == libertas_connected) { 219 if (adapter->connect_status != libertas_connected)
218 int i; 220 goto out;
219 struct WLAN_802_11_SSID curadhocssid;
220
221 lbs_deb_wext("channel changed while in IBSS\n");
222 221
223 /* Copy the current ssid */ 222 lbs_deb_wext("channel changed while in IBSS\n");
224 memcpy(&curadhocssid, &adapter->curbssparams.ssid,
225 sizeof(struct WLAN_802_11_SSID));
226 223
227 /* Exit Adhoc mode */ 224 /* Copy the current ssid */
228 lbs_deb_wext("in changeadhocchannel(): sending Adhoc stop\n"); 225 memcpy(&curadhocssid, &adapter->curbssparams.ssid,
229 ret = libertas_stop_adhoc_network(priv); 226 sizeof(struct WLAN_802_11_SSID));
230 227
231 if (ret) 228 /* Exit Adhoc mode */
232 goto out; 229 lbs_deb_wext("in changeadhocchannel(): sending Adhoc stop\n");
230 ret = libertas_stop_adhoc_network(priv);
231 if (ret)
232 goto out;
233 233
234 /* Scan for the network, do not save previous results. Stale 234 /* Scan for the network, do not save previous results. Stale
235 * scan data will cause us to join a non-existant adhoc network 235 * scan data will cause us to join a non-existant adhoc network
236 */ 236 */
237 libertas_send_specific_SSID_scan(priv, &curadhocssid, 0); 237 libertas_send_specific_SSID_scan(priv, &curadhocssid, 0);
238 238
239 // find out the BSSID that matches the current SSID 239 /* find out the BSSID that matches the current SSID */
240 i = libertas_find_SSID_in_list(adapter, &curadhocssid, NULL, 240 join_bss = libertas_find_SSID_in_list(adapter, &curadhocssid, NULL,
241 IW_MODE_ADHOC); 241 IW_MODE_ADHOC);
242 242
243 if (i >= 0) { 243 if (join_bss) {
244 lbs_deb_wext("SSID found at %d in list," 244 lbs_deb_wext("SSID found in list, so join\n");
245 "so join\n", i); 245 libertas_join_adhoc_network(priv, join_bss);
246 libertas_join_adhoc_network(priv, &adapter->scantable[i]); 246 } else {
247 } else { 247 lbs_deb_wext("SSID not found in list, "
248 // else send START command 248 "creating AdHoc with SSID '%s'\n",
249 lbs_deb_wext("SSID not found in list, " 249 curadhocssid.ssid);
250 "creating AdHoc with SSID '%s'\n", 250 libertas_start_adhoc_network(priv, &curadhocssid);
251 curadhocssid.ssid);
252 libertas_start_adhoc_network(priv, &curadhocssid);
253 } // end of else (START command)
254 } 251 }
255 252
256out: 253out: