aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c136
1 files changed, 64 insertions, 72 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 88da68ee0f02..63bd692c7239 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -18,7 +18,6 @@ static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
18static int assoc_helper_essid(struct lbs_private *priv, 18static int assoc_helper_essid(struct lbs_private *priv,
19 struct assoc_request * assoc_req) 19 struct assoc_request * assoc_req)
20{ 20{
21 struct lbs_adapter *adapter = priv->adapter;
22 int ret = 0; 21 int ret = 0;
23 struct bss_descriptor * bss; 22 struct bss_descriptor * bss;
24 int channel = -1; 23 int channel = -1;
@@ -38,7 +37,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
38 lbs_send_specific_ssid_scan(priv, assoc_req->ssid, 37 lbs_send_specific_ssid_scan(priv, assoc_req->ssid,
39 assoc_req->ssid_len, 0); 38 assoc_req->ssid_len, 0);
40 39
41 bss = lbs_find_ssid_in_list(adapter, assoc_req->ssid, 40 bss = lbs_find_ssid_in_list(priv, assoc_req->ssid,
42 assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel); 41 assoc_req->ssid_len, NULL, IW_MODE_INFRA, channel);
43 if (bss != NULL) { 42 if (bss != NULL) {
44 memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor)); 43 memcpy(&assoc_req->bss, bss, sizeof(struct bss_descriptor));
@@ -54,7 +53,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
54 assoc_req->ssid_len, 1); 53 assoc_req->ssid_len, 1);
55 54
56 /* Search for the requested SSID in the scan table */ 55 /* Search for the requested SSID in the scan table */
57 bss = lbs_find_ssid_in_list(adapter, assoc_req->ssid, 56 bss = lbs_find_ssid_in_list(priv, assoc_req->ssid,
58 assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel); 57 assoc_req->ssid_len, NULL, IW_MODE_ADHOC, channel);
59 if (bss != NULL) { 58 if (bss != NULL) {
60 lbs_deb_assoc("SSID found, will join\n"); 59 lbs_deb_assoc("SSID found, will join\n");
@@ -78,7 +77,6 @@ static int assoc_helper_essid(struct lbs_private *priv,
78static int assoc_helper_bssid(struct lbs_private *priv, 77static int assoc_helper_bssid(struct lbs_private *priv,
79 struct assoc_request * assoc_req) 78 struct assoc_request * assoc_req)
80{ 79{
81 struct lbs_adapter *adapter = priv->adapter;
82 int ret = 0; 80 int ret = 0;
83 struct bss_descriptor * bss; 81 struct bss_descriptor * bss;
84 DECLARE_MAC_BUF(mac); 82 DECLARE_MAC_BUF(mac);
@@ -87,7 +85,7 @@ static int assoc_helper_bssid(struct lbs_private *priv,
87 print_mac(mac, assoc_req->bssid)); 85 print_mac(mac, assoc_req->bssid));
88 86
89 /* Search for index position in list for requested MAC */ 87 /* Search for index position in list for requested MAC */
90 bss = lbs_find_bssid_in_list(adapter, assoc_req->bssid, 88 bss = lbs_find_bssid_in_list(priv, assoc_req->bssid,
91 assoc_req->mode); 89 assoc_req->mode);
92 if (bss == NULL) { 90 if (bss == NULL) {
93 lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, " 91 lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, "
@@ -138,21 +136,20 @@ static int assoc_helper_associate(struct lbs_private *priv,
138static int assoc_helper_mode(struct lbs_private *priv, 136static int assoc_helper_mode(struct lbs_private *priv,
139 struct assoc_request * assoc_req) 137 struct assoc_request * assoc_req)
140{ 138{
141 struct lbs_adapter *adapter = priv->adapter;
142 int ret = 0; 139 int ret = 0;
143 140
144 lbs_deb_enter(LBS_DEB_ASSOC); 141 lbs_deb_enter(LBS_DEB_ASSOC);
145 142
146 if (assoc_req->mode == adapter->mode) 143 if (assoc_req->mode == priv->mode)
147 goto done; 144 goto done;
148 145
149 if (assoc_req->mode == IW_MODE_INFRA) { 146 if (assoc_req->mode == IW_MODE_INFRA) {
150 if (adapter->psstate != PS_STATE_FULL_POWER) 147 if (priv->psstate != PS_STATE_FULL_POWER)
151 lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP); 148 lbs_ps_wakeup(priv, CMD_OPTION_WAITFORRSP);
152 adapter->psmode = LBS802_11POWERMODECAM; 149 priv->psmode = LBS802_11POWERMODECAM;
153 } 150 }
154 151
155 adapter->mode = assoc_req->mode; 152 priv->mode = assoc_req->mode;
156 ret = lbs_prepare_and_send_command(priv, 153 ret = lbs_prepare_and_send_command(priv,
157 CMD_802_11_SNMP_MIB, 154 CMD_802_11_SNMP_MIB,
158 0, CMD_OPTION_WAITFORRSP, 155 0, CMD_OPTION_WAITFORRSP,
@@ -191,7 +188,6 @@ void lbs_sync_channel(struct work_struct *work)
191static int assoc_helper_channel(struct lbs_private *priv, 188static int assoc_helper_channel(struct lbs_private *priv,
192 struct assoc_request * assoc_req) 189 struct assoc_request * assoc_req)
193{ 190{
194 struct lbs_adapter *adapter = priv->adapter;
195 int ret = 0; 191 int ret = 0;
196 192
197 lbs_deb_enter(LBS_DEB_ASSOC); 193 lbs_deb_enter(LBS_DEB_ASSOC);
@@ -201,11 +197,11 @@ static int assoc_helper_channel(struct lbs_private *priv,
201 lbs_deb_assoc("ASSOC: channel: error getting channel."); 197 lbs_deb_assoc("ASSOC: channel: error getting channel.");
202 } 198 }
203 199
204 if (assoc_req->channel == adapter->curbssparams.channel) 200 if (assoc_req->channel == priv->curbssparams.channel)
205 goto done; 201 goto done;
206 202
207 lbs_deb_assoc("ASSOC: channel: %d -> %d\n", 203 lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
208 adapter->curbssparams.channel, assoc_req->channel); 204 priv->curbssparams.channel, assoc_req->channel);
209 205
210 ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, 206 ret = lbs_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL,
211 CMD_OPT_802_11_RF_CHANNEL_SET, 207 CMD_OPT_802_11_RF_CHANNEL_SET,
@@ -219,7 +215,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
219 lbs_deb_assoc("ASSOC: channel: error getting channel."); 215 lbs_deb_assoc("ASSOC: channel: error getting channel.");
220 } 216 }
221 217
222 if (assoc_req->channel != adapter->curbssparams.channel) { 218 if (assoc_req->channel != priv->curbssparams.channel) {
223 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d", 219 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d",
224 assoc_req->channel); 220 assoc_req->channel);
225 goto done; 221 goto done;
@@ -246,7 +242,6 @@ done:
246static int assoc_helper_wep_keys(struct lbs_private *priv, 242static int assoc_helper_wep_keys(struct lbs_private *priv,
247 struct assoc_request * assoc_req) 243 struct assoc_request * assoc_req)
248{ 244{
249 struct lbs_adapter *adapter = priv->adapter;
250 int i; 245 int i;
251 int ret = 0; 246 int ret = 0;
252 247
@@ -275,23 +270,23 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
275 270
276 /* enable/disable the MAC's WEP packet filter */ 271 /* enable/disable the MAC's WEP packet filter */
277 if (assoc_req->secinfo.wep_enabled) 272 if (assoc_req->secinfo.wep_enabled)
278 adapter->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE; 273 priv->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE;
279 else 274 else
280 adapter->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE; 275 priv->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE;
281 ret = lbs_set_mac_packet_filter(priv); 276 ret = lbs_set_mac_packet_filter(priv);
282 if (ret) 277 if (ret)
283 goto out; 278 goto out;
284 279
285 mutex_lock(&adapter->lock); 280 mutex_lock(&priv->lock);
286 281
287 /* Copy WEP keys into adapter wep key fields */ 282 /* Copy WEP keys into priv wep key fields */
288 for (i = 0; i < 4; i++) { 283 for (i = 0; i < 4; i++) {
289 memcpy(&adapter->wep_keys[i], &assoc_req->wep_keys[i], 284 memcpy(&priv->wep_keys[i], &assoc_req->wep_keys[i],
290 sizeof(struct enc_key)); 285 sizeof(struct enc_key));
291 } 286 }
292 adapter->wep_tx_keyidx = assoc_req->wep_tx_keyidx; 287 priv->wep_tx_keyidx = assoc_req->wep_tx_keyidx;
293 288
294 mutex_unlock(&adapter->lock); 289 mutex_unlock(&priv->lock);
295 290
296out: 291out:
297 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 292 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
@@ -301,14 +296,13 @@ out:
301static int assoc_helper_secinfo(struct lbs_private *priv, 296static int assoc_helper_secinfo(struct lbs_private *priv,
302 struct assoc_request * assoc_req) 297 struct assoc_request * assoc_req)
303{ 298{
304 struct lbs_adapter *adapter = priv->adapter;
305 int ret = 0; 299 int ret = 0;
306 u32 do_wpa; 300 u32 do_wpa;
307 u32 rsn = 0; 301 u32 rsn = 0;
308 302
309 lbs_deb_enter(LBS_DEB_ASSOC); 303 lbs_deb_enter(LBS_DEB_ASSOC);
310 304
311 memcpy(&adapter->secinfo, &assoc_req->secinfo, 305 memcpy(&priv->secinfo, &assoc_req->secinfo,
312 sizeof(struct lbs_802_11_security)); 306 sizeof(struct lbs_802_11_security));
313 307
314 ret = lbs_set_mac_packet_filter(priv); 308 ret = lbs_set_mac_packet_filter(priv);
@@ -396,17 +390,16 @@ out:
396static int assoc_helper_wpa_ie(struct lbs_private *priv, 390static int assoc_helper_wpa_ie(struct lbs_private *priv,
397 struct assoc_request * assoc_req) 391 struct assoc_request * assoc_req)
398{ 392{
399 struct lbs_adapter *adapter = priv->adapter;
400 int ret = 0; 393 int ret = 0;
401 394
402 lbs_deb_enter(LBS_DEB_ASSOC); 395 lbs_deb_enter(LBS_DEB_ASSOC);
403 396
404 if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { 397 if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
405 memcpy(&adapter->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len); 398 memcpy(&priv->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len);
406 adapter->wpa_ie_len = assoc_req->wpa_ie_len; 399 priv->wpa_ie_len = assoc_req->wpa_ie_len;
407 } else { 400 } else {
408 memset(&adapter->wpa_ie, 0, MAX_WPA_IE_LEN); 401 memset(&priv->wpa_ie, 0, MAX_WPA_IE_LEN);
409 adapter->wpa_ie_len = 0; 402 priv->wpa_ie_len = 0;
410 } 403 }
411 404
412 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 405 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
@@ -414,14 +407,14 @@ static int assoc_helper_wpa_ie(struct lbs_private *priv,
414} 407}
415 408
416 409
417static int should_deauth_infrastructure(struct lbs_adapter *adapter, 410static int should_deauth_infrastructure(struct lbs_private *priv,
418 struct assoc_request * assoc_req) 411 struct assoc_request * assoc_req)
419{ 412{
420 int ret = 0; 413 int ret = 0;
421 414
422 lbs_deb_enter(LBS_DEB_ASSOC); 415 lbs_deb_enter(LBS_DEB_ASSOC);
423 416
424 if (adapter->connect_status != LBS_CONNECTED) 417 if (priv->connect_status != LBS_CONNECTED)
425 return 0; 418 return 0;
426 419
427 if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { 420 if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
@@ -431,7 +424,7 @@ static int should_deauth_infrastructure(struct lbs_adapter *adapter,
431 } 424 }
432 425
433 if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { 426 if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
434 if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) { 427 if (priv->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {
435 lbs_deb_assoc("Deauthenticating due to new security\n"); 428 lbs_deb_assoc("Deauthenticating due to new security\n");
436 ret = 1; 429 ret = 1;
437 goto out; 430 goto out;
@@ -466,16 +459,16 @@ out:
466} 459}
467 460
468 461
469static int should_stop_adhoc(struct lbs_adapter *adapter, 462static int should_stop_adhoc(struct lbs_private *priv,
470 struct assoc_request * assoc_req) 463 struct assoc_request * assoc_req)
471{ 464{
472 lbs_deb_enter(LBS_DEB_ASSOC); 465 lbs_deb_enter(LBS_DEB_ASSOC);
473 466
474 if (adapter->connect_status != LBS_CONNECTED) 467 if (priv->connect_status != LBS_CONNECTED)
475 return 0; 468 return 0;
476 469
477 if (lbs_ssid_cmp(adapter->curbssparams.ssid, 470 if (lbs_ssid_cmp(priv->curbssparams.ssid,
478 adapter->curbssparams.ssid_len, 471 priv->curbssparams.ssid_len,
479 assoc_req->ssid, assoc_req->ssid_len) != 0) 472 assoc_req->ssid, assoc_req->ssid_len) != 0)
480 return 1; 473 return 1;
481 474
@@ -486,7 +479,7 @@ static int should_stop_adhoc(struct lbs_adapter *adapter,
486 } 479 }
487 480
488 if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { 481 if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) {
489 if (assoc_req->channel != adapter->curbssparams.channel) 482 if (assoc_req->channel != priv->curbssparams.channel)
490 return 1; 483 return 1;
491 } 484 }
492 485
@@ -499,7 +492,6 @@ void lbs_association_worker(struct work_struct *work)
499{ 492{
500 struct lbs_private *priv = container_of(work, struct lbs_private, 493 struct lbs_private *priv = container_of(work, struct lbs_private,
501 assoc_work.work); 494 assoc_work.work);
502 struct lbs_adapter *adapter = priv->adapter;
503 struct assoc_request * assoc_req = NULL; 495 struct assoc_request * assoc_req = NULL;
504 int ret = 0; 496 int ret = 0;
505 int find_any_ssid = 0; 497 int find_any_ssid = 0;
@@ -507,11 +499,11 @@ void lbs_association_worker(struct work_struct *work)
507 499
508 lbs_deb_enter(LBS_DEB_ASSOC); 500 lbs_deb_enter(LBS_DEB_ASSOC);
509 501
510 mutex_lock(&adapter->lock); 502 mutex_lock(&priv->lock);
511 assoc_req = adapter->pending_assoc_req; 503 assoc_req = priv->pending_assoc_req;
512 adapter->pending_assoc_req = NULL; 504 priv->pending_assoc_req = NULL;
513 adapter->in_progress_assoc_req = assoc_req; 505 priv->in_progress_assoc_req = assoc_req;
514 mutex_unlock(&adapter->lock); 506 mutex_unlock(&priv->lock);
515 507
516 if (!assoc_req) 508 if (!assoc_req)
517 goto done; 509 goto done;
@@ -569,8 +561,8 @@ void lbs_association_worker(struct work_struct *work)
569 * Check if the attributes being changing require deauthentication 561 * Check if the attributes being changing require deauthentication
570 * from the currently associated infrastructure access point. 562 * from the currently associated infrastructure access point.
571 */ 563 */
572 if (adapter->mode == IW_MODE_INFRA) { 564 if (priv->mode == IW_MODE_INFRA) {
573 if (should_deauth_infrastructure(adapter, assoc_req)) { 565 if (should_deauth_infrastructure(priv, assoc_req)) {
574 ret = lbs_send_deauthentication(priv); 566 ret = lbs_send_deauthentication(priv);
575 if (ret) { 567 if (ret) {
576 lbs_deb_assoc("Deauthentication due to new " 568 lbs_deb_assoc("Deauthentication due to new "
@@ -578,8 +570,8 @@ void lbs_association_worker(struct work_struct *work)
578 ret); 570 ret);
579 } 571 }
580 } 572 }
581 } else if (adapter->mode == IW_MODE_ADHOC) { 573 } else if (priv->mode == IW_MODE_ADHOC) {
582 if (should_stop_adhoc(adapter, assoc_req)) { 574 if (should_stop_adhoc(priv, assoc_req)) {
583 ret = lbs_stop_adhoc_network(priv); 575 ret = lbs_stop_adhoc_network(priv);
584 if (ret) { 576 if (ret) {
585 lbs_deb_assoc("Teardown of AdHoc network due to " 577 lbs_deb_assoc("Teardown of AdHoc network due to "
@@ -643,7 +635,7 @@ void lbs_association_worker(struct work_struct *work)
643 success = 0; 635 success = 0;
644 } 636 }
645 637
646 if (adapter->connect_status != LBS_CONNECTED) { 638 if (priv->connect_status != LBS_CONNECTED) {
647 lbs_deb_assoc("ASSOC: association unsuccessful, " 639 lbs_deb_assoc("ASSOC: association unsuccessful, "
648 "not connected\n"); 640 "not connected\n");
649 success = 0; 641 success = 0;
@@ -651,9 +643,9 @@ void lbs_association_worker(struct work_struct *work)
651 643
652 if (success) { 644 if (success) {
653 lbs_deb_assoc("ASSOC: associated to '%s', %s\n", 645 lbs_deb_assoc("ASSOC: associated to '%s', %s\n",
654 escape_essid(adapter->curbssparams.ssid, 646 escape_essid(priv->curbssparams.ssid,
655 adapter->curbssparams.ssid_len), 647 priv->curbssparams.ssid_len),
656 print_mac(mac, adapter->curbssparams.bssid)); 648 print_mac(mac, priv->curbssparams.bssid));
657 lbs_prepare_and_send_command(priv, 649 lbs_prepare_and_send_command(priv,
658 CMD_802_11_RSSI, 650 CMD_802_11_RSSI,
659 0, CMD_OPTION_WAITFORRSP, 0, NULL); 651 0, CMD_OPTION_WAITFORRSP, 0, NULL);
@@ -672,9 +664,9 @@ out:
672 ret); 664 ret);
673 } 665 }
674 666
675 mutex_lock(&adapter->lock); 667 mutex_lock(&priv->lock);
676 adapter->in_progress_assoc_req = NULL; 668 priv->in_progress_assoc_req = NULL;
677 mutex_unlock(&adapter->lock); 669 mutex_unlock(&priv->lock);
678 kfree(assoc_req); 670 kfree(assoc_req);
679 671
680done: 672done:
@@ -685,15 +677,15 @@ done:
685/* 677/*
686 * Caller MUST hold any necessary locks 678 * Caller MUST hold any necessary locks
687 */ 679 */
688struct assoc_request *lbs_get_association_request(struct lbs_adapter *adapter) 680struct assoc_request *lbs_get_association_request(struct lbs_private *priv)
689{ 681{
690 struct assoc_request * assoc_req; 682 struct assoc_request * assoc_req;
691 683
692 lbs_deb_enter(LBS_DEB_ASSOC); 684 lbs_deb_enter(LBS_DEB_ASSOC);
693 if (!adapter->pending_assoc_req) { 685 if (!priv->pending_assoc_req) {
694 adapter->pending_assoc_req = kzalloc(sizeof(struct assoc_request), 686 priv->pending_assoc_req = kzalloc(sizeof(struct assoc_request),
695 GFP_KERNEL); 687 GFP_KERNEL);
696 if (!adapter->pending_assoc_req) { 688 if (!priv->pending_assoc_req) {
697 lbs_pr_info("Not enough memory to allocate association" 689 lbs_pr_info("Not enough memory to allocate association"
698 " request!\n"); 690 " request!\n");
699 return NULL; 691 return NULL;
@@ -703,57 +695,57 @@ struct assoc_request *lbs_get_association_request(struct lbs_adapter *adapter)
703 /* Copy current configuration attributes to the association request, 695 /* Copy current configuration attributes to the association request,
704 * but don't overwrite any that are already set. 696 * but don't overwrite any that are already set.
705 */ 697 */
706 assoc_req = adapter->pending_assoc_req; 698 assoc_req = priv->pending_assoc_req;
707 if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { 699 if (!test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
708 memcpy(&assoc_req->ssid, &adapter->curbssparams.ssid, 700 memcpy(&assoc_req->ssid, &priv->curbssparams.ssid,
709 IW_ESSID_MAX_SIZE); 701 IW_ESSID_MAX_SIZE);
710 assoc_req->ssid_len = adapter->curbssparams.ssid_len; 702 assoc_req->ssid_len = priv->curbssparams.ssid_len;
711 } 703 }
712 704
713 if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) 705 if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags))
714 assoc_req->channel = adapter->curbssparams.channel; 706 assoc_req->channel = priv->curbssparams.channel;
715 707
716 if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) 708 if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags))
717 assoc_req->band = adapter->curbssparams.band; 709 assoc_req->band = priv->curbssparams.band;
718 710
719 if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) 711 if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
720 assoc_req->mode = adapter->mode; 712 assoc_req->mode = priv->mode;
721 713
722 if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { 714 if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
723 memcpy(&assoc_req->bssid, adapter->curbssparams.bssid, 715 memcpy(&assoc_req->bssid, priv->curbssparams.bssid,
724 ETH_ALEN); 716 ETH_ALEN);
725 } 717 }
726 718
727 if (!test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags)) { 719 if (!test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags)) {
728 int i; 720 int i;
729 for (i = 0; i < 4; i++) { 721 for (i = 0; i < 4; i++) {
730 memcpy(&assoc_req->wep_keys[i], &adapter->wep_keys[i], 722 memcpy(&assoc_req->wep_keys[i], &priv->wep_keys[i],
731 sizeof(struct enc_key)); 723 sizeof(struct enc_key));
732 } 724 }
733 } 725 }
734 726
735 if (!test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) 727 if (!test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags))
736 assoc_req->wep_tx_keyidx = adapter->wep_tx_keyidx; 728 assoc_req->wep_tx_keyidx = priv->wep_tx_keyidx;
737 729
738 if (!test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { 730 if (!test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
739 memcpy(&assoc_req->wpa_mcast_key, &adapter->wpa_mcast_key, 731 memcpy(&assoc_req->wpa_mcast_key, &priv->wpa_mcast_key,
740 sizeof(struct enc_key)); 732 sizeof(struct enc_key));
741 } 733 }
742 734
743 if (!test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { 735 if (!test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) {
744 memcpy(&assoc_req->wpa_unicast_key, &adapter->wpa_unicast_key, 736 memcpy(&assoc_req->wpa_unicast_key, &priv->wpa_unicast_key,
745 sizeof(struct enc_key)); 737 sizeof(struct enc_key));
746 } 738 }
747 739
748 if (!test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { 740 if (!test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
749 memcpy(&assoc_req->secinfo, &adapter->secinfo, 741 memcpy(&assoc_req->secinfo, &priv->secinfo,
750 sizeof(struct lbs_802_11_security)); 742 sizeof(struct lbs_802_11_security));
751 } 743 }
752 744
753 if (!test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { 745 if (!test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) {
754 memcpy(&assoc_req->wpa_ie, &adapter->wpa_ie, 746 memcpy(&assoc_req->wpa_ie, &priv->wpa_ie,
755 MAX_WPA_IE_LEN); 747 MAX_WPA_IE_LEN);
756 assoc_req->wpa_ie_len = adapter->wpa_ie_len; 748 assoc_req->wpa_ie_len = priv->wpa_ie_len;
757 } 749 }
758 750
759 lbs_deb_leave(LBS_DEB_ASSOC); 751 lbs_deb_leave(LBS_DEB_ASSOC);