aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-10 22:58:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-05-11 14:54:54 -0400
commit0dc5a29044d56912bf0d4e5cd19127f82b90c29c (patch)
tree6b9432572a96232da24314b3fa6924d63042028e /drivers/net/wireless/libertas/assoc.c
parent889c05bdf3056b029b9fa95096eac4f0dfd3fb6f (diff)
[PATCH] libertas: remove WLAN_802_11_NETWORK_INFRASTRUCTURE enum
Use standard IW_MODE_* constants instead. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index cc6352ee4385..c260bd1b3d46 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,
23 ENTER(); 23 ENTER();
24 24
25 lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid); 25 lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
26 if (assoc_req->mode == wlan802_11infrastructure) { 26 if (assoc_req->mode == IW_MODE_INFRA) {
27 if (adapter->prescan) { 27 if (adapter->prescan) {
28 libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1); 28 libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
29 } 29 }
30 30
31 i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, 31 i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
32 NULL, wlan802_11infrastructure); 32 NULL, IW_MODE_INFRA);
33 if (i >= 0) { 33 if (i >= 0) {
34 lbs_pr_debug(1, 34 lbs_pr_debug(1,
35 "SSID found in scan list ... associating...\n"); 35 "SSID found in scan list ... associating...\n");
@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,
44 lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n", 44 lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
45 assoc_req->ssid.ssid); 45 assoc_req->ssid.ssid);
46 } 46 }
47 } else if (assoc_req->mode == wlan802_11ibss) { 47 } else if (assoc_req->mode == IW_MODE_ADHOC) {
48 /* Scan for the network, do not save previous results. Stale 48 /* Scan for the network, do not save previous results. Stale
49 * scan data will cause us to join a non-existant adhoc network 49 * scan data will cause us to join a non-existant adhoc network
50 */ 50 */
@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,
52 52
53 /* Search for the requested SSID in the scan table */ 53 /* Search for the requested SSID in the scan table */
54 i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, 54 i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
55 wlan802_11ibss); 55 IW_MODE_ADHOC);
56 if (i >= 0) { 56 if (i >= 0) {
57 lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret); 57 lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret);
58 libertas_join_adhoc_network(priv, &adapter->scantable[i]); 58 libertas_join_adhoc_network(priv, &adapter->scantable[i]);
@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv,
90 goto out; 90 goto out;
91 } 91 }
92 92
93 if (assoc_req->mode == wlan802_11infrastructure) { 93 if (assoc_req->mode == IW_MODE_INFRA) {
94 ret = wlan_associate(priv, &adapter->scantable[i]); 94 ret = wlan_associate(priv, &adapter->scantable[i]);
95 lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret); 95 lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret);
96 } else if (assoc_req->mode == wlan802_11ibss) { 96 } else if (assoc_req->mode == IW_MODE_ADHOC) {
97 libertas_join_adhoc_network(priv, &adapter->scantable[i]); 97 libertas_join_adhoc_network(priv, &adapter->scantable[i]);
98 } 98 }
99 memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid, 99 memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,
142 142
143 ENTER(); 143 ENTER();
144 144
145 if (assoc_req->mode == adapter->inframode) { 145 if (assoc_req->mode == adapter->mode) {
146 LEAVE(); 146 LEAVE();
147 return 0; 147 return 0;
148 } 148 }
149 149
150 if (assoc_req->mode == wlan802_11infrastructure) { 150 if (assoc_req->mode == IW_MODE_INFRA) {
151 if (adapter->psstate != PS_STATE_FULL_POWER) 151 if (adapter->psstate != PS_STATE_FULL_POWER)
152 libertas_ps_wakeup(priv, cmd_option_waitforrsp); 152 libertas_ps_wakeup(priv, cmd_option_waitforrsp);
153 adapter->psmode = wlan802_11powermodecam; 153 adapter->psmode = wlan802_11powermodecam;
154 } 154 }
155 155
156 adapter->inframode = assoc_req->mode; 156 adapter->mode = assoc_req->mode;
157 ret = libertas_prepare_and_send_command(priv, 157 ret = libertas_prepare_and_send_command(priv,
158 cmd_802_11_snmp_mib, 158 cmd_802_11_snmp_mib,
159 0, cmd_option_waitforrsp, 159 0, cmd_option_waitforrsp,
160 OID_802_11_INFRASTRUCTURE_MODE, 160 OID_802_11_INFRASTRUCTURE_MODE,
161 (void *) assoc_req->mode); 161 (void *) (size_t) assoc_req->mode);
162 162
163 LEAVE(); 163 LEAVE();
164 return ret; 164 return ret;
@@ -315,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
315 315
316 /* FIXME: deal with 'auto' mode somehow */ 316 /* FIXME: deal with 'auto' mode somehow */
317 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { 317 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
318 if (assoc_req->mode != wlan802_11infrastructure) 318 if (assoc_req->mode != IW_MODE_INFRA)
319 return 1; 319 return 1;
320 } 320 }
321 321
@@ -337,7 +337,7 @@ static int should_stop_adhoc(wlan_adapter *adapter,
337 337
338 /* FIXME: deal with 'auto' mode somehow */ 338 /* FIXME: deal with 'auto' mode somehow */
339 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { 339 if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
340 if (assoc_req->mode != wlan802_11ibss) 340 if (assoc_req->mode != IW_MODE_ADHOC)
341 return 1; 341 return 1;
342 } 342 }
343 343
@@ -381,7 +381,7 @@ void wlan_association_worker(struct work_struct *work)
381 } 381 }
382 382
383 if (find_any_ssid) { 383 if (find_any_ssid) {
384 enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode; 384 u8 new_mode;
385 385
386 ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid, 386 ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid,
387 assoc_req->mode, &new_mode); 387 assoc_req->mode, &new_mode);
@@ -392,7 +392,7 @@ void wlan_association_worker(struct work_struct *work)
392 } 392 }
393 393
394 /* Ensure we switch to the mode of the AP */ 394 /* Ensure we switch to the mode of the AP */
395 if (assoc_req->mode == wlan802_11autounknown) { 395 if (assoc_req->mode == IW_MODE_AUTO) {
396 set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); 396 set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
397 assoc_req->mode = new_mode; 397 assoc_req->mode = new_mode;
398 } 398 }
@@ -402,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)
402 * Check if the attributes being changing require deauthentication 402 * Check if the attributes being changing require deauthentication
403 * from the currently associated infrastructure access point. 403 * from the currently associated infrastructure access point.
404 */ 404 */
405 if (adapter->inframode == wlan802_11infrastructure) { 405 if (adapter->mode == IW_MODE_INFRA) {
406 if (should_deauth_infrastructure(adapter, assoc_req)) { 406 if (should_deauth_infrastructure(adapter, assoc_req)) {
407 ret = libertas_send_deauthentication(priv); 407 ret = libertas_send_deauthentication(priv);
408 if (ret) { 408 if (ret) {
@@ -411,7 +411,7 @@ void wlan_association_worker(struct work_struct *work)
411 ret); 411 ret);
412 } 412 }
413 } 413 }
414 } else if (adapter->inframode == wlan802_11ibss) { 414 } else if (adapter->mode == IW_MODE_ADHOC) {
415 if (should_stop_adhoc(adapter, assoc_req)) { 415 if (should_stop_adhoc(adapter, assoc_req)) {
416 ret = libertas_stop_adhoc_network(priv); 416 ret = libertas_stop_adhoc_network(priv);
417 if (ret) { 417 if (ret) {
@@ -542,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter)
542 assoc_req->channel = adapter->curbssparams.channel; 542 assoc_req->channel = adapter->curbssparams.channel;
543 543
544 if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) 544 if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
545 assoc_req->mode = adapter->inframode; 545 assoc_req->mode = adapter->mode;
546 546
547 if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { 547 if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
548 memcpy(&assoc_req->bssid, adapter->curbssparams.bssid, 548 memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,