diff options
Diffstat (limited to 'drivers/net/wireless/libertas/join.c')
-rw-r--r-- | drivers/net/wireless/libertas/join.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index d80b6e05e27d..1550e6afb053 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c | |||
@@ -57,7 +57,7 @@ static int get_common_rates(struct lbs_adapter *adapter, | |||
57 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); | 57 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); |
58 | lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates); | 58 | lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates); |
59 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); | 59 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); |
60 | lbs_deb_join("Tx datarate is currently 0x%X\n", adapter->cur_rate); | 60 | lbs_deb_join("TX data rate 0x%02x\n", adapter->cur_rate); |
61 | 61 | ||
62 | if (!adapter->auto_rate) { | 62 | if (!adapter->auto_rate) { |
63 | for (i = 0; i < tmp_size; i++) { | 63 | for (i = 0; i < tmp_size; i++) { |
@@ -128,7 +128,7 @@ int lbs_associate(struct lbs_private *priv, struct assoc_request *assoc_req) | |||
128 | struct lbs_adapter *adapter = priv->adapter; | 128 | struct lbs_adapter *adapter = priv->adapter; |
129 | int ret; | 129 | int ret; |
130 | 130 | ||
131 | lbs_deb_enter(LBS_DEB_JOIN); | 131 | lbs_deb_enter(LBS_DEB_ASSOC); |
132 | 132 | ||
133 | ret = lbs_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE, | 133 | ret = lbs_prepare_and_send_command(priv, CMD_802_11_AUTHENTICATE, |
134 | 0, CMD_OPTION_WAITFORRSP, | 134 | 0, CMD_OPTION_WAITFORRSP, |
@@ -150,7 +150,7 @@ int lbs_associate(struct lbs_private *priv, struct assoc_request *assoc_req) | |||
150 | 0, CMD_OPTION_WAITFORRSP, 0, assoc_req); | 150 | 0, CMD_OPTION_WAITFORRSP, 0, assoc_req); |
151 | 151 | ||
152 | done: | 152 | done: |
153 | lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); | 153 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
154 | return ret; | 154 | return ret; |
155 | } | 155 | } |
156 | 156 | ||
@@ -324,7 +324,7 @@ int lbs_cmd_80211_authenticate(struct lbs_private *priv, | |||
324 | 324 | ||
325 | memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); | 325 | memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); |
326 | 326 | ||
327 | lbs_deb_join("AUTH_CMD: BSSID is : %s auth=0x%X\n", | 327 | lbs_deb_join("AUTH_CMD: BSSID %s, auth 0x%x\n", |
328 | print_mac(mac, bssid), pauthenticate->authtype); | 328 | print_mac(mac, bssid), pauthenticate->authtype); |
329 | ret = 0; | 329 | ret = 0; |
330 | 330 | ||
@@ -372,7 +372,7 @@ int lbs_cmd_80211_associate(struct lbs_private *priv, | |||
372 | struct mrvlietypes_ratesparamset *rates; | 372 | struct mrvlietypes_ratesparamset *rates; |
373 | struct mrvlietypes_rsnparamset *rsn; | 373 | struct mrvlietypes_rsnparamset *rsn; |
374 | 374 | ||
375 | lbs_deb_enter(LBS_DEB_JOIN); | 375 | lbs_deb_enter(LBS_DEB_ASSOC); |
376 | 376 | ||
377 | pos = (u8 *) passo; | 377 | pos = (u8 *) passo; |
378 | 378 | ||
@@ -426,7 +426,7 @@ int lbs_cmd_80211_associate(struct lbs_private *priv, | |||
426 | } | 426 | } |
427 | pos += sizeof(rates->header) + tmplen; | 427 | pos += sizeof(rates->header) + tmplen; |
428 | rates->header.len = cpu_to_le16(tmplen); | 428 | rates->header.len = cpu_to_le16(tmplen); |
429 | lbs_deb_join("ASSOC_CMD: num rates = %u\n", tmplen); | 429 | lbs_deb_assoc("ASSOC_CMD: num rates %u\n", tmplen); |
430 | 430 | ||
431 | /* Copy the infra. association rates into Current BSS state structure */ | 431 | /* Copy the infra. association rates into Current BSS state structure */ |
432 | memset(&adapter->curbssparams.rates, 0, sizeof(adapter->curbssparams.rates)); | 432 | memset(&adapter->curbssparams.rates, 0, sizeof(adapter->curbssparams.rates)); |
@@ -464,11 +464,10 @@ int lbs_cmd_80211_associate(struct lbs_private *priv, | |||
464 | if (bss->mode == IW_MODE_INFRA) | 464 | if (bss->mode == IW_MODE_INFRA) |
465 | tmpcap |= WLAN_CAPABILITY_ESS; | 465 | tmpcap |= WLAN_CAPABILITY_ESS; |
466 | passo->capability = cpu_to_le16(tmpcap); | 466 | passo->capability = cpu_to_le16(tmpcap); |
467 | lbs_deb_join("ASSOC_CMD: capability=%4X CAPINFO_MASK=%4X\n", | 467 | lbs_deb_assoc("ASSOC_CMD: capability 0x%04x\n", tmpcap); |
468 | tmpcap, CAPINFO_MASK); | ||
469 | 468 | ||
470 | done: | 469 | done: |
471 | lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); | 470 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
472 | return ret; | 471 | return ret; |
473 | } | 472 | } |
474 | 473 | ||
@@ -708,10 +707,10 @@ int lbs_ret_80211_associate(struct lbs_private *priv, | |||
708 | struct bss_descriptor * bss; | 707 | struct bss_descriptor * bss; |
709 | u16 status_code; | 708 | u16 status_code; |
710 | 709 | ||
711 | lbs_deb_enter(LBS_DEB_JOIN); | 710 | lbs_deb_enter(LBS_DEB_ASSOC); |
712 | 711 | ||
713 | if (!adapter->in_progress_assoc_req) { | 712 | if (!adapter->in_progress_assoc_req) { |
714 | lbs_deb_join("ASSOC_RESP: no in-progress association request\n"); | 713 | lbs_deb_assoc("ASSOC_RESP: no in-progress assoc request\n"); |
715 | ret = -1; | 714 | ret = -1; |
716 | goto done; | 715 | goto done; |
717 | } | 716 | } |
@@ -740,30 +739,25 @@ int lbs_ret_80211_associate(struct lbs_private *priv, | |||
740 | status_code = le16_to_cpu(passocrsp->statuscode); | 739 | status_code = le16_to_cpu(passocrsp->statuscode); |
741 | switch (status_code) { | 740 | switch (status_code) { |
742 | case 0x00: | 741 | case 0x00: |
743 | lbs_deb_join("ASSOC_RESP: Association succeeded\n"); | ||
744 | break; | 742 | break; |
745 | case 0x01: | 743 | case 0x01: |
746 | lbs_deb_join("ASSOC_RESP: Association failed; invalid " | 744 | lbs_deb_assoc("ASSOC_RESP: invalid parameters\n"); |
747 | "parameters (status code %d)\n", status_code); | ||
748 | break; | 745 | break; |
749 | case 0x02: | 746 | case 0x02: |
750 | lbs_deb_join("ASSOC_RESP: Association failed; internal timer " | 747 | lbs_deb_assoc("ASSOC_RESP: internal timer " |
751 | "expired while waiting for the AP (status code %d)" | 748 | "expired while waiting for the AP\n"); |
752 | "\n", status_code); | ||
753 | break; | 749 | break; |
754 | case 0x03: | 750 | case 0x03: |
755 | lbs_deb_join("ASSOC_RESP: Association failed; association " | 751 | lbs_deb_assoc("ASSOC_RESP: association " |
756 | "was refused by the AP (status code %d)\n", | 752 | "refused by AP\n"); |
757 | status_code); | ||
758 | break; | 753 | break; |
759 | case 0x04: | 754 | case 0x04: |
760 | lbs_deb_join("ASSOC_RESP: Association failed; authentication " | 755 | lbs_deb_assoc("ASSOC_RESP: authentication " |
761 | "was refused by the AP (status code %d)\n", | 756 | "refused by AP\n"); |
762 | status_code); | ||
763 | break; | 757 | break; |
764 | default: | 758 | default: |
765 | lbs_deb_join("ASSOC_RESP: Association failed; reason unknown " | 759 | lbs_deb_assoc("ASSOC_RESP: failure reason 0x%02x " |
766 | "(status code %d)\n", status_code); | 760 | " unknown\n", status_code); |
767 | break; | 761 | break; |
768 | } | 762 | } |
769 | 763 | ||
@@ -773,22 +767,19 @@ int lbs_ret_80211_associate(struct lbs_private *priv, | |||
773 | goto done; | 767 | goto done; |
774 | } | 768 | } |
775 | 769 | ||
776 | lbs_deb_hex(LBS_DEB_JOIN, "ASSOC_RESP", (void *)&resp->params, | 770 | lbs_deb_hex(LBS_DEB_ASSOC, "ASSOC_RESP", (void *)&resp->params, |
777 | le16_to_cpu(resp->size) - S_DS_GEN); | 771 | le16_to_cpu(resp->size) - S_DS_GEN); |
778 | 772 | ||
779 | /* Send a Media Connected event, according to the Spec */ | 773 | /* Send a Media Connected event, according to the Spec */ |
780 | adapter->connect_status = LBS_CONNECTED; | 774 | adapter->connect_status = LBS_CONNECTED; |
781 | 775 | ||
782 | lbs_deb_join("ASSOC_RESP: assocated to '%s'\n", | ||
783 | escape_essid(bss->ssid, bss->ssid_len)); | ||
784 | |||
785 | /* Update current SSID and BSSID */ | 776 | /* Update current SSID and BSSID */ |
786 | memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); | 777 | memcpy(&adapter->curbssparams.ssid, &bss->ssid, IW_ESSID_MAX_SIZE); |
787 | adapter->curbssparams.ssid_len = bss->ssid_len; | 778 | adapter->curbssparams.ssid_len = bss->ssid_len; |
788 | memcpy(adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); | 779 | memcpy(adapter->curbssparams.bssid, bss->bssid, ETH_ALEN); |
789 | 780 | ||
790 | lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n", | 781 | lbs_deb_assoc("ASSOC_RESP: currentpacketfilter is 0x%x\n", |
791 | adapter->currentpacketfilter); | 782 | adapter->currentpacketfilter); |
792 | 783 | ||
793 | adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0; | 784 | adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0; |
794 | adapter->NF[TYPE_RXPD][TYPE_AVG] = 0; | 785 | adapter->NF[TYPE_RXPD][TYPE_AVG] = 0; |
@@ -807,7 +798,7 @@ int lbs_ret_80211_associate(struct lbs_private *priv, | |||
807 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); | 798 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); |
808 | 799 | ||
809 | done: | 800 | done: |
810 | lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); | 801 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
811 | return ret; | 802 | return ret; |
812 | } | 803 | } |
813 | 804 | ||