aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/join.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/join.c')
-rw-r--r--drivers/net/wireless/libertas/join.c139
1 files changed, 69 insertions, 70 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index d4926b83e145..10c31f56f38b 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -60,7 +60,7 @@ static int get_common_rates(wlan_adapter * adapter, u8 * rate1,
60 lbs_dbg_hex("rate1 (AP) rates:", tmp, sizeof(tmp)); 60 lbs_dbg_hex("rate1 (AP) rates:", tmp, sizeof(tmp));
61 lbs_dbg_hex("rate2 (Card) rates:", rate2, rate2_size); 61 lbs_dbg_hex("rate2 (Card) rates:", rate2, rate2_size);
62 lbs_dbg_hex("Common rates:", ptr, rate1_size); 62 lbs_dbg_hex("Common rates:", ptr, rate1_size);
63 lbs_pr_debug(1, "Tx datarate is set to 0x%X\n", adapter->datarate); 63 lbs_deb_join("Tx datarate is set to 0x%X\n", adapter->datarate);
64 64
65 if (!adapter->is_datarate_auto) { 65 if (!adapter->is_datarate_auto) {
66 while (*ptr) { 66 while (*ptr) {
@@ -109,16 +109,14 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc)
109 wlan_adapter *adapter = priv->adapter; 109 wlan_adapter *adapter = priv->adapter;
110 int ret; 110 int ret;
111 111
112 ENTER(); 112 lbs_deb_enter(LBS_DEB_JOIN);
113 113
114 ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, 114 ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate,
115 0, cmd_option_waitforrsp, 115 0, cmd_option_waitforrsp,
116 0, pbssdesc->macaddress); 116 0, pbssdesc->macaddress);
117 117
118 if (ret) { 118 if (ret)
119 LEAVE(); 119 goto done;
120 return ret;
121 }
122 120
123 /* set preamble to firmware */ 121 /* set preamble to firmware */
124 if (adapter->capinfo.shortpreamble && pbssdesc->cap.shortpreamble) 122 if (adapter->capinfo.shortpreamble && pbssdesc->cap.shortpreamble)
@@ -131,7 +129,8 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc)
131 ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate, 129 ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate,
132 0, cmd_option_waitforrsp, 0, pbssdesc); 130 0, cmd_option_waitforrsp, 0, pbssdesc);
133 131
134 LEAVE(); 132done:
133 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
135 return ret; 134 return ret;
136} 135}
137 136
@@ -150,19 +149,19 @@ int libertas_start_adhoc_network(wlan_private * priv, struct WLAN_802_11_SSID *a
150 adapter->adhoccreate = 1; 149 adapter->adhoccreate = 1;
151 150
152 if (!adapter->capinfo.shortpreamble) { 151 if (!adapter->capinfo.shortpreamble) {
153 lbs_pr_debug(1, "AdhocStart: Long preamble\n"); 152 lbs_deb_join("AdhocStart: Long preamble\n");
154 adapter->preamble = cmd_type_long_preamble; 153 adapter->preamble = cmd_type_long_preamble;
155 } else { 154 } else {
156 lbs_pr_debug(1, "AdhocStart: Short preamble\n"); 155 lbs_deb_join("AdhocStart: Short preamble\n");
157 adapter->preamble = cmd_type_short_preamble; 156 adapter->preamble = cmd_type_short_preamble;
158 } 157 }
159 158
160 libertas_set_radio_control(priv); 159 libertas_set_radio_control(priv);
161 160
162 lbs_pr_debug(1, "Adhoc channel = %d\n", adapter->adhocchannel); 161 lbs_deb_join("Adhoc channel = %d\n", adapter->adhocchannel);
163 lbs_pr_debug(1, "curbssparams.channel = %d\n", 162 lbs_deb_join("curbssparams.channel = %d\n",
164 adapter->curbssparams.channel); 163 adapter->curbssparams.channel);
165 lbs_pr_debug(1, "curbssparams.band = %d\n", adapter->curbssparams.band); 164 lbs_deb_join("curbssparams.band = %d\n", adapter->curbssparams.band);
166 165
167 ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, 166 ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start,
168 0, cmd_option_waitforrsp, 0, adhocssid); 167 0, cmd_option_waitforrsp, 0, adhocssid);
@@ -184,12 +183,12 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
184 wlan_adapter *adapter = priv->adapter; 183 wlan_adapter *adapter = priv->adapter;
185 int ret = 0; 184 int ret = 0;
186 185
187 lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid =%s\n", 186 lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid =%s\n",
188 adapter->curbssparams.ssid.ssid); 187 adapter->curbssparams.ssid.ssid);
189 lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid_len =%u\n", 188 lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid_len =%u\n",
190 adapter->curbssparams.ssid.ssidlength); 189 adapter->curbssparams.ssid.ssidlength);
191 lbs_pr_debug(1, "libertas_join_adhoc_network: ssid =%s\n", pbssdesc->ssid.ssid); 190 lbs_deb_join("libertas_join_adhoc_network: ssid =%s\n", pbssdesc->ssid.ssid);
192 lbs_pr_debug(1, "libertas_join_adhoc_network: ssid len =%u\n", 191 lbs_deb_join("libertas_join_adhoc_network: ssid len =%u\n",
193 pbssdesc->ssid.ssidlength); 192 pbssdesc->ssid.ssidlength);
194 193
195 /* check if the requested SSID is already joined */ 194 /* check if the requested SSID is already joined */
@@ -197,7 +196,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
197 && !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid) 196 && !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid)
198 && (adapter->mode == IW_MODE_ADHOC)) { 197 && (adapter->mode == IW_MODE_ADHOC)) {
199 198
200 lbs_pr_debug(1, 199 lbs_deb_join(
201 "ADHOC_J_CMD: New ad-hoc SSID is the same as current, " 200 "ADHOC_J_CMD: New ad-hoc SSID is the same as current, "
202 "not attempting to re-join"); 201 "not attempting to re-join");
203 202
@@ -207,18 +206,18 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
207 /*Use shortpreamble only when both creator and card supports 206 /*Use shortpreamble only when both creator and card supports
208 short preamble */ 207 short preamble */
209 if (!pbssdesc->cap.shortpreamble || !adapter->capinfo.shortpreamble) { 208 if (!pbssdesc->cap.shortpreamble || !adapter->capinfo.shortpreamble) {
210 lbs_pr_debug(1, "AdhocJoin: Long preamble\n"); 209 lbs_deb_join("AdhocJoin: Long preamble\n");
211 adapter->preamble = cmd_type_long_preamble; 210 adapter->preamble = cmd_type_long_preamble;
212 } else { 211 } else {
213 lbs_pr_debug(1, "AdhocJoin: Short preamble\n"); 212 lbs_deb_join("AdhocJoin: Short preamble\n");
214 adapter->preamble = cmd_type_short_preamble; 213 adapter->preamble = cmd_type_short_preamble;
215 } 214 }
216 215
217 libertas_set_radio_control(priv); 216 libertas_set_radio_control(priv);
218 217
219 lbs_pr_debug(1, "curbssparams.channel = %d\n", 218 lbs_deb_join("curbssparams.channel = %d\n",
220 adapter->curbssparams.channel); 219 adapter->curbssparams.channel);
221 lbs_pr_debug(1, "curbssparams.band = %c\n", adapter->curbssparams.band); 220 lbs_deb_join("curbssparams.band = %c\n", adapter->curbssparams.band);
222 221
223 adapter->adhoccreate = 0; 222 adapter->adhoccreate = 0;
224 223
@@ -281,14 +280,14 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
281 pauthenticate->authtype = 0x80; 280 pauthenticate->authtype = 0x80;
282 break; 281 break;
283 default: 282 default:
284 lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n", 283 lbs_deb_join("AUTH_CMD: invalid auth alg 0x%X\n",
285 adapter->secinfo.auth_mode); 284 adapter->secinfo.auth_mode);
286 goto out; 285 goto out;
287 } 286 }
288 287
289 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); 288 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
290 289
291 lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n", 290 lbs_deb_join("AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
292 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); 291 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
293 ret = 0; 292 ret = 0;
294 293
@@ -302,7 +301,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
302 wlan_adapter *adapter = priv->adapter; 301 wlan_adapter *adapter = priv->adapter;
303 struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth; 302 struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth;
304 303
305 ENTER(); 304 lbs_deb_enter(LBS_DEB_JOIN);
306 305
307 cmd->command = cpu_to_le16(cmd_802_11_deauthenticate); 306 cmd->command = cpu_to_le16(cmd_802_11_deauthenticate);
308 cmd->size = 307 cmd->size =
@@ -317,7 +316,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
317#define REASON_CODE_STA_LEAVING 3 316#define REASON_CODE_STA_LEAVING 3
318 dauth->reasoncode = cpu_to_le16(REASON_CODE_STA_LEAVING); 317 dauth->reasoncode = cpu_to_le16(REASON_CODE_STA_LEAVING);
319 318
320 LEAVE(); 319 lbs_deb_leave(LBS_DEB_JOIN);
321 return 0; 320 return 0;
322} 321}
323 322
@@ -338,7 +337,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
338 struct mrvlietypes_ratesparamset *rates; 337 struct mrvlietypes_ratesparamset *rates;
339 struct mrvlietypes_rsnparamset *rsn; 338 struct mrvlietypes_rsnparamset *rsn;
340 339
341 ENTER(); 340 lbs_deb_enter(LBS_DEB_JOIN);
342 341
343 pbssdesc = pdata_buf; 342 pbssdesc = pdata_buf;
344 pos = (u8 *) passo; 343 pos = (u8 *) passo;
@@ -427,7 +426,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
427 memcpy(&adapter->curbssparams.datarates, &rates->rates, 426 memcpy(&adapter->curbssparams.datarates, &rates->rates,
428 min_t(size_t, sizeof(adapter->curbssparams.datarates), rates->header.len)); 427 min_t(size_t, sizeof(adapter->curbssparams.datarates), rates->header.len));
429 428
430 lbs_pr_debug(1, "ASSOC_CMD: rates->header.len = %d\n", rates->header.len); 429 lbs_deb_join("ASSOC_CMD: rates->header.len = %d\n", rates->header.len);
431 430
432 /* set IBSS field */ 431 /* set IBSS field */
433 if (pbssdesc->mode == IW_MODE_INFRA) { 432 if (pbssdesc->mode == IW_MODE_INFRA) {
@@ -445,13 +444,13 @@ int libertas_cmd_80211_associate(wlan_private * priv,
445 /* set the capability info at last */ 444 /* set the capability info at last */
446 memcpy(&tmpcap, &pbssdesc->cap, sizeof(passo->capinfo)); 445 memcpy(&tmpcap, &pbssdesc->cap, sizeof(passo->capinfo));
447 tmpcap &= CAPINFO_MASK; 446 tmpcap &= CAPINFO_MASK;
448 lbs_pr_debug(1, "ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", 447 lbs_deb_join("ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
449 tmpcap, CAPINFO_MASK); 448 tmpcap, CAPINFO_MASK);
450 tmpcap = cpu_to_le16(tmpcap); 449 tmpcap = cpu_to_le16(tmpcap);
451 memcpy(&passo->capinfo, &tmpcap, sizeof(passo->capinfo)); 450 memcpy(&passo->capinfo, &tmpcap, sizeof(passo->capinfo));
452 451
453 done: 452done:
454 LEAVE(); 453 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
455 return ret; 454 return ret;
456} 455}
457 456
@@ -467,7 +466,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
467 struct bss_descriptor *pbssdesc; 466 struct bss_descriptor *pbssdesc;
468 struct WLAN_802_11_SSID *ssid = pssid; 467 struct WLAN_802_11_SSID *ssid = pssid;
469 468
470 ENTER(); 469 lbs_deb_enter(LBS_DEB_JOIN);
471 470
472 if (!adapter) { 471 if (!adapter) {
473 ret = -1; 472 ret = -1;
@@ -495,7 +494,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
495 494
496 memcpy(adhs->SSID, ssid->ssid, ssid->ssidlength); 495 memcpy(adhs->SSID, ssid->ssid, ssid->ssidlength);
497 496
498 lbs_pr_debug(1, "ADHOC_S_CMD: SSID = %s\n", adhs->SSID); 497 lbs_deb_join("ADHOC_S_CMD: SSID = %s\n", adhs->SSID);
499 498
500 memset(pbssdesc->ssid.ssid, 0, IW_ESSID_MAX_SIZE); 499 memset(pbssdesc->ssid.ssid, 0, IW_ESSID_MAX_SIZE);
501 memcpy(pbssdesc->ssid.ssid, ssid->ssid, ssid->ssidlength); 500 memcpy(pbssdesc->ssid.ssid, ssid->ssid, ssid->ssidlength);
@@ -516,7 +515,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
516 515
517 WARN_ON(!adapter->adhocchannel); 516 WARN_ON(!adapter->adhocchannel);
518 517
519 lbs_pr_debug(1, "ADHOC_S_CMD: Creating ADHOC on channel %d\n", 518 lbs_deb_join("ADHOC_S_CMD: Creating ADHOC on channel %d\n",
520 adapter->adhocchannel); 519 adapter->adhocchannel);
521 520
522 adapter->curbssparams.channel = adapter->adhocchannel; 521 adapter->curbssparams.channel = adapter->adhocchannel;
@@ -547,11 +546,11 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
547 546
548 /* set up privacy in adapter->scantable[i] */ 547 /* set up privacy in adapter->scantable[i] */
549 if (adapter->secinfo.wep_enabled) { 548 if (adapter->secinfo.wep_enabled) {
550 lbs_pr_debug(1, "ADHOC_S_CMD: WEP enabled, setting privacy on\n"); 549 lbs_deb_join("ADHOC_S_CMD: WEP enabled, setting privacy on\n");
551 pbssdesc->privacy = wlan802_11privfilter8021xWEP; 550 pbssdesc->privacy = wlan802_11privfilter8021xWEP;
552 adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON; 551 adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON;
553 } else { 552 } else {
554 lbs_pr_debug(1, "ADHOC_S_CMD: WEP disabled, setting privacy off\n"); 553 lbs_deb_join("ADHOC_S_CMD: WEP disabled, setting privacy off\n");
555 pbssdesc->privacy = wlan802_11privfilteracceptall; 554 pbssdesc->privacy = wlan802_11privfilteracceptall;
556 } 555 }
557 556
@@ -574,14 +573,14 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
574 memcpy(&adapter->curbssparams.datarates, 573 memcpy(&adapter->curbssparams.datarates,
575 &adhs->datarate, adapter->curbssparams.numofrates); 574 &adhs->datarate, adapter->curbssparams.numofrates);
576 575
577 lbs_pr_debug(1, "ADHOC_S_CMD: rates=%02x %02x %02x %02x \n", 576 lbs_deb_join("ADHOC_S_CMD: rates=%02x %02x %02x %02x \n",
578 adhs->datarate[0], adhs->datarate[1], 577 adhs->datarate[0], adhs->datarate[1],
579 adhs->datarate[2], adhs->datarate[3]); 578 adhs->datarate[2], adhs->datarate[3]);
580 579
581 lbs_pr_debug(1, "ADHOC_S_CMD: AD HOC Start command is ready\n"); 580 lbs_deb_join("ADHOC_S_CMD: AD HOC Start command is ready\n");
582 581
583 if (libertas_create_dnld_countryinfo_11d(priv)) { 582 if (libertas_create_dnld_countryinfo_11d(priv)) {
584 lbs_pr_debug(1, "ADHOC_S_CMD: dnld_countryinfo_11d failed\n"); 583 lbs_deb_join("ADHOC_S_CMD: dnld_countryinfo_11d failed\n");
585 ret = -1; 584 ret = -1;
586 goto done; 585 goto done;
587 } 586 }
@@ -596,7 +595,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
596 595
597 ret = 0; 596 ret = 0;
598done: 597done:
599 LEAVE(); 598 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
600 return ret; 599 return ret;
601} 600}
602 601
@@ -622,7 +621,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
622 u16 tmpcap; 621 u16 tmpcap;
623 int i; 622 int i;
624 623
625 ENTER(); 624 lbs_deb_enter(LBS_DEB_JOIN);
626 625
627 adapter->pattemptedbssdesc = pbssdesc; 626 adapter->pattemptedbssdesc = pbssdesc;
628 627
@@ -647,13 +646,13 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
647 memcpy(&tmpcap, &pbssdesc->cap, sizeof(struct ieeetypes_capinfo)); 646 memcpy(&tmpcap, &pbssdesc->cap, sizeof(struct ieeetypes_capinfo));
648 tmpcap &= CAPINFO_MASK; 647 tmpcap &= CAPINFO_MASK;
649 648
650 lbs_pr_debug(1, "ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", 649 lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
651 tmpcap, CAPINFO_MASK); 650 tmpcap, CAPINFO_MASK);
652 memcpy(&padhocjoin->bssdescriptor.cap, &tmpcap, 651 memcpy(&padhocjoin->bssdescriptor.cap, &tmpcap,
653 sizeof(struct ieeetypes_capinfo)); 652 sizeof(struct ieeetypes_capinfo));
654 653
655 /* information on BSSID descriptor passed to FW */ 654 /* information on BSSID descriptor passed to FW */
656 lbs_pr_debug(1, 655 lbs_deb_join(
657 "ADHOC_J_CMD: BSSID = %2x-%2x-%2x-%2x-%2x-%2x, SSID = %s\n", 656 "ADHOC_J_CMD: BSSID = %2x-%2x-%2x-%2x-%2x-%2x, SSID = %s\n",
658 padhocjoin->bssdescriptor.BSSID[0], 657 padhocjoin->bssdescriptor.BSSID[0],
659 padhocjoin->bssdescriptor.BSSID[1], 658 padhocjoin->bssdescriptor.BSSID[1],
@@ -685,7 +684,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
685 if (get_common_rates(adapter, padhocjoin->bssdescriptor.datarates, 684 if (get_common_rates(adapter, padhocjoin->bssdescriptor.datarates,
686 sizeof(padhocjoin->bssdescriptor.datarates), 685 sizeof(padhocjoin->bssdescriptor.datarates),
687 card_rates, card_rates_size)) { 686 card_rates, card_rates_size)) {
688 lbs_pr_debug(1, "ADHOC_J_CMD: get_common_rates returns error.\n"); 687 lbs_deb_join("ADHOC_J_CMD: get_common_rates returns error.\n");
689 ret = -1; 688 ret = -1;
690 goto done; 689 goto done;
691 } 690 }
@@ -742,8 +741,8 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
742 memcpy(&padhocjoin->bssdescriptor.cap, 741 memcpy(&padhocjoin->bssdescriptor.cap,
743 &tmpcap, sizeof(struct ieeetypes_capinfo)); 742 &tmpcap, sizeof(struct ieeetypes_capinfo));
744 743
745 done: 744done:
746 LEAVE(); 745 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
747 return ret; 746 return ret;
748} 747}
749 748
@@ -756,7 +755,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
756 struct ieeetypes_assocrsp *passocrsp; 755 struct ieeetypes_assocrsp *passocrsp;
757 struct bss_descriptor *pbssdesc; 756 struct bss_descriptor *pbssdesc;
758 757
759 ENTER(); 758 lbs_deb_enter(LBS_DEB_JOIN);
760 759
761 passocrsp = (struct ieeetypes_assocrsp *) & resp->params; 760 passocrsp = (struct ieeetypes_assocrsp *) & resp->params;
762 761
@@ -764,9 +763,8 @@ int libertas_ret_80211_associate(wlan_private * priv,
764 763
765 libertas_mac_event_disconnected(priv); 764 libertas_mac_event_disconnected(priv);
766 765
767 lbs_pr_debug(1, 766 lbs_deb_join("ASSOC_RESP: Association failed, status code = %d\n",
768 "ASSOC_RESP: Association failed, status code = %d\n", 767 passocrsp->statuscode);
769 passocrsp->statuscode);
770 768
771 ret = -1; 769 ret = -1;
772 goto done; 770 goto done;
@@ -781,7 +779,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
781 /* Set the attempted BSSID Index to current */ 779 /* Set the attempted BSSID Index to current */
782 pbssdesc = adapter->pattemptedbssdesc; 780 pbssdesc = adapter->pattemptedbssdesc;
783 781
784 lbs_pr_debug(1, "ASSOC_RESP: %s\n", pbssdesc->ssid.ssid); 782 lbs_deb_join("ASSOC_RESP: %s\n", pbssdesc->ssid.ssid);
785 783
786 /* Set the new SSID to current SSID */ 784 /* Set the new SSID to current SSID */
787 memcpy(&adapter->curbssparams.ssid, 785 memcpy(&adapter->curbssparams.ssid,
@@ -795,7 +793,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
795 memcpy(&adapter->curbssparams.bssdescriptor, 793 memcpy(&adapter->curbssparams.bssdescriptor,
796 pbssdesc, sizeof(struct bss_descriptor)); 794 pbssdesc, sizeof(struct bss_descriptor));
797 795
798 lbs_pr_debug(1, "ASSOC_RESP: currentpacketfilter is %x\n", 796 lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n",
799 adapter->currentpacketfilter); 797 adapter->currentpacketfilter);
800 798
801 adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0; 799 adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0;
@@ -809,25 +807,25 @@ int libertas_ret_80211_associate(wlan_private * priv,
809 netif_carrier_on(priv->wlan_dev.netdev); 807 netif_carrier_on(priv->wlan_dev.netdev);
810 netif_wake_queue(priv->wlan_dev.netdev); 808 netif_wake_queue(priv->wlan_dev.netdev);
811 809
812 lbs_pr_debug(1, "ASSOC_RESP: Associated \n"); 810 lbs_deb_join("ASSOC_RESP: Associated \n");
813 811
814 memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); 812 memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
815 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 813 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
816 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); 814 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
817 815
818 done: 816done:
819 LEAVE(); 817 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
820 return ret; 818 return ret;
821} 819}
822 820
823int libertas_ret_80211_disassociate(wlan_private * priv, 821int libertas_ret_80211_disassociate(wlan_private * priv,
824 struct cmd_ds_command *resp) 822 struct cmd_ds_command *resp)
825{ 823{
826 ENTER(); 824 lbs_deb_enter(LBS_DEB_JOIN);
827 825
828 libertas_mac_event_disconnected(priv); 826 libertas_mac_event_disconnected(priv);
829 827
830 LEAVE(); 828 lbs_deb_leave(LBS_DEB_JOIN);
831 return 0; 829 return 0;
832} 830}
833 831
@@ -842,13 +840,13 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
842 union iwreq_data wrqu; 840 union iwreq_data wrqu;
843 struct bss_descriptor *pbssdesc; 841 struct bss_descriptor *pbssdesc;
844 842
845 ENTER(); 843 lbs_deb_enter(LBS_DEB_JOIN);
846 844
847 padhocresult = &resp->params.result; 845 padhocresult = &resp->params.result;
848 846
849 lbs_pr_debug(1, "ADHOC_S_RESP: size = %d\n", le16_to_cpu(resp->size)); 847 lbs_deb_join("ADHOC_S_RESP: size = %d\n", le16_to_cpu(resp->size));
850 lbs_pr_debug(1, "ADHOC_S_RESP: command = %x\n", command); 848 lbs_deb_join("ADHOC_S_RESP: command = %x\n", command);
851 lbs_pr_debug(1, "ADHOC_S_RESP: result = %x\n", result); 849 lbs_deb_join("ADHOC_S_RESP: result = %x\n", result);
852 850
853 pbssdesc = adapter->pattemptedbssdesc; 851 pbssdesc = adapter->pattemptedbssdesc;
854 852
@@ -856,7 +854,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
856 * Join result code 0 --> SUCCESS 854 * Join result code 0 --> SUCCESS
857 */ 855 */
858 if (result) { 856 if (result) {
859 lbs_pr_debug(1, "ADHOC_RESP failed\n"); 857 lbs_deb_join("ADHOC_RESP failed\n");
860 if (adapter->connect_status == libertas_connected) { 858 if (adapter->connect_status == libertas_connected) {
861 libertas_mac_event_disconnected(priv); 859 libertas_mac_event_disconnected(priv);
862 } 860 }
@@ -864,15 +862,15 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
864 memset(&adapter->curbssparams.bssdescriptor, 862 memset(&adapter->curbssparams.bssdescriptor,
865 0x00, sizeof(adapter->curbssparams.bssdescriptor)); 863 0x00, sizeof(adapter->curbssparams.bssdescriptor));
866 864
867 LEAVE(); 865 ret = -1;
868 return -1; 866 goto done;
869 } 867 }
870 868
871 /* 869 /*
872 * Now the join cmd should be successful 870 * Now the join cmd should be successful
873 * If BSSID has changed use SSID to compare instead of BSSID 871 * If BSSID has changed use SSID to compare instead of BSSID
874 */ 872 */
875 lbs_pr_debug(1, "ADHOC_J_RESP %s\n", pbssdesc->ssid.ssid); 873 lbs_deb_join("ADHOC_J_RESP %s\n", pbssdesc->ssid.ssid);
876 874
877 /* Send a Media Connected event, according to the Spec */ 875 /* Send a Media Connected event, according to the Spec */
878 adapter->connect_status = libertas_connected; 876 adapter->connect_status = libertas_connected;
@@ -906,24 +904,25 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
906 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 904 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
907 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); 905 wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
908 906
909 lbs_pr_debug(1, "ADHOC_RESP: - Joined/Started Ad Hoc\n"); 907 lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n");
910 lbs_pr_debug(1, "ADHOC_RESP: channel = %d\n", adapter->adhocchannel); 908 lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->adhocchannel);
911 lbs_pr_debug(1, "ADHOC_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", 909 lbs_deb_join("ADHOC_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n",
912 padhocresult->BSSID[0], padhocresult->BSSID[1], 910 padhocresult->BSSID[0], padhocresult->BSSID[1],
913 padhocresult->BSSID[2], padhocresult->BSSID[3], 911 padhocresult->BSSID[2], padhocresult->BSSID[3],
914 padhocresult->BSSID[4], padhocresult->BSSID[5]); 912 padhocresult->BSSID[4], padhocresult->BSSID[5]);
915 913
916 LEAVE(); 914done:
915 lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
917 return ret; 916 return ret;
918} 917}
919 918
920int libertas_ret_80211_ad_hoc_stop(wlan_private * priv, 919int libertas_ret_80211_ad_hoc_stop(wlan_private * priv,
921 struct cmd_ds_command *resp) 920 struct cmd_ds_command *resp)
922{ 921{
923 ENTER(); 922 lbs_deb_enter(LBS_DEB_JOIN);
924 923
925 libertas_mac_event_disconnected(priv); 924 libertas_mac_event_disconnected(priv);
926 925
927 LEAVE(); 926 lbs_deb_leave(LBS_DEB_JOIN);
928 return 0; 927 return 0;
929} 928}