summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-22 05:29:50 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-24 05:32:29 -0400
commitbdcbd8e0e3ffdad32b14b6373e67bfcf5fd3f002 (patch)
treeb636f2229570dc95edef997272bd0656cf19224d /net/mac80211/mlme.c
parentd3b2fb53c7f82903880769d406c11c7e619b11a4 (diff)
mac80211: clean up debugging
There are a few things that make the logging and debugging in mac80211 less useful than it should be right now: * a lot of messages should be pr_info, not pr_debug * wholesale use of pr_debug makes it require *both* Kconfig and dynamic configuration * there are still a lot of ifdefs * the style is very inconsistent, sometimes the sdata->name is printed in front Clean up everything, introducing new macros and separating out the station MLME debugging into a new Kconfig symbol. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c203
1 files changed, 93 insertions, 110 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2b450f541993..e11cd0e033ef 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1186,19 +1186,16 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
1186 params.txop = get_unaligned_le16(pos + 2); 1186 params.txop = get_unaligned_le16(pos + 2);
1187 params.uapsd = uapsd; 1187 params.uapsd = uapsd;
1188 1188
1189#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1189 mlme_dbg(sdata,
1190 wiphy_debug(local->hw.wiphy, 1190 "WMM queue=%d aci=%d acm=%d aifs=%d cWmin=%d cWmax=%d txop=%d uapsd=%d\n",
1191 "WMM queue=%d aci=%d acm=%d aifs=%d " 1191 queue, aci, acm,
1192 "cWmin=%d cWmax=%d txop=%d uapsd=%d\n", 1192 params.aifs, params.cw_min, params.cw_max,
1193 queue, aci, acm, 1193 params.txop, params.uapsd);
1194 params.aifs, params.cw_min, params.cw_max,
1195 params.txop, params.uapsd);
1196#endif
1197 sdata->tx_conf[queue] = params; 1194 sdata->tx_conf[queue] = params;
1198 if (drv_conf_tx(local, sdata, queue, &params)) 1195 if (drv_conf_tx(local, sdata, queue, &params))
1199 wiphy_debug(local->hw.wiphy, 1196 sdata_err(sdata,
1200 "failed to set TX queue parameters for queue %d\n", 1197 "failed to set TX queue parameters for queue %d\n",
1201 queue); 1198 queue);
1202 } 1199 }
1203 1200
1204 /* enable WMM or activate new settings */ 1201 /* enable WMM or activate new settings */
@@ -1565,11 +1562,10 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
1565 goto out; 1562 goto out;
1566 } 1563 }
1567 1564
1568#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1569 if (beacon) 1565 if (beacon)
1570 net_dbg_ratelimited("%s: detected beacon loss from AP - sending probe request\n", 1566 mlme_dbg_ratelimited(sdata,
1571 sdata->name); 1567 "detected beacon loss from AP - sending probe request\n");
1572#endif 1568
1573 ieee80211_cqm_rssi_notify(&sdata->vif, 1569 ieee80211_cqm_rssi_notify(&sdata->vif,
1574 NL80211_CQM_RSSI_BEACON_LOSS_EVENT, GFP_KERNEL); 1570 NL80211_CQM_RSSI_BEACON_LOSS_EVENT, GFP_KERNEL);
1575 1571
@@ -1654,7 +1650,7 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)
1654 1650
1655 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 1651 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1656 1652
1657 pr_debug("%s: Connection to AP %pM lost\n", sdata->name, bssid); 1653 sdata_info(sdata, "Connection to AP %pM lost\n", bssid);
1658 1654
1659 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 1655 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
1660 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, 1656 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY,
@@ -1788,8 +1784,8 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1788 return RX_MGMT_NONE; 1784 return RX_MGMT_NONE;
1789 1785
1790 if (status_code != WLAN_STATUS_SUCCESS) { 1786 if (status_code != WLAN_STATUS_SUCCESS) {
1791 pr_debug("%s: %pM denied authentication (status %d)\n", 1787 sdata_info(sdata, "%pM denied authentication (status %d)\n",
1792 sdata->name, mgmt->sa, status_code); 1788 mgmt->sa, status_code);
1793 ieee80211_destroy_auth_data(sdata, false); 1789 ieee80211_destroy_auth_data(sdata, false);
1794 return RX_MGMT_CFG80211_RX_AUTH; 1790 return RX_MGMT_CFG80211_RX_AUTH;
1795 } 1791 }
@@ -1812,7 +1808,7 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1812 return RX_MGMT_NONE; 1808 return RX_MGMT_NONE;
1813 } 1809 }
1814 1810
1815 pr_debug("%s: authenticated\n", sdata->name); 1811 sdata_info(sdata, "authenticated\n");
1816 ifmgd->auth_data->done = true; 1812 ifmgd->auth_data->done = true;
1817 ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC; 1813 ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC;
1818 run_again(ifmgd, ifmgd->auth_data->timeout); 1814 run_again(ifmgd, ifmgd->auth_data->timeout);
@@ -1825,7 +1821,7 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1825 goto out_err; 1821 goto out_err;
1826 } 1822 }
1827 if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) { 1823 if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
1828 pr_debug("%s: failed moving %pM to auth\n", sdata->name, bssid); 1824 sdata_info(sdata, "failed moving %pM to auth\n", bssid);
1829 goto out_err; 1825 goto out_err;
1830 } 1826 }
1831 mutex_unlock(&sdata->local->sta_mtx); 1827 mutex_unlock(&sdata->local->sta_mtx);
@@ -1859,8 +1855,8 @@ ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1859 1855
1860 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); 1856 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
1861 1857
1862 pr_debug("%s: deauthenticated from %pM (Reason: %u)\n", 1858 sdata_info(sdata, "deauthenticated from %pM (Reason: %u)\n",
1863 sdata->name, bssid, reason_code); 1859 bssid, reason_code);
1864 1860
1865 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 1861 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
1866 1862
@@ -1890,8 +1886,8 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1890 1886
1891 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); 1887 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
1892 1888
1893 pr_debug("%s: disassociated from %pM (Reason: %u)\n", 1889 sdata_info(sdata, "disassociated from %pM (Reason: %u)\n",
1894 sdata->name, mgmt->sa, reason_code); 1890 mgmt->sa, reason_code);
1895 1891
1896 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 1892 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
1897 1893
@@ -1983,15 +1979,15 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
1983 capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info); 1979 capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
1984 1980
1985 if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14))) 1981 if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
1986 pr_debug("%s: invalid AID value 0x%x; bits 15:14 not set\n", 1982 sdata_info(sdata, "invalid AID value 0x%x; bits 15:14 not set\n",
1987 sdata->name, aid); 1983 aid);
1988 aid &= ~(BIT(15) | BIT(14)); 1984 aid &= ~(BIT(15) | BIT(14));
1989 1985
1990 ifmgd->broken_ap = false; 1986 ifmgd->broken_ap = false;
1991 1987
1992 if (aid == 0 || aid > IEEE80211_MAX_AID) { 1988 if (aid == 0 || aid > IEEE80211_MAX_AID) {
1993 pr_debug("%s: invalid AID value %d (out of range), turn off PS\n", 1989 sdata_info(sdata, "invalid AID value %d (out of range), turn off PS\n",
1994 sdata->name, aid); 1990 aid);
1995 aid = 0; 1991 aid = 0;
1996 ifmgd->broken_ap = true; 1992 ifmgd->broken_ap = true;
1997 } 1993 }
@@ -2000,8 +1996,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
2000 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); 1996 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
2001 1997
2002 if (!elems.supp_rates) { 1998 if (!elems.supp_rates) {
2003 pr_debug("%s: no SuppRates element in AssocResp\n", 1999 sdata_info(sdata, "no SuppRates element in AssocResp\n");
2004 sdata->name);
2005 return false; 2000 return false;
2006 } 2001 }
2007 2002
@@ -2041,8 +2036,9 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
2041 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) 2036 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
2042 err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED); 2037 err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED);
2043 if (err) { 2038 if (err) {
2044 pr_debug("%s: failed to move station %pM to desired state\n", 2039 sdata_info(sdata,
2045 sdata->name, sta->sta.addr); 2040 "failed to move station %pM to desired state\n",
2041 sta->sta.addr);
2046 WARN_ON(__sta_info_destroy(sta)); 2042 WARN_ON(__sta_info_destroy(sta));
2047 mutex_unlock(&sdata->local->sta_mtx); 2043 mutex_unlock(&sdata->local->sta_mtx);
2048 return false; 2044 return false;
@@ -2125,9 +2121,10 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2125 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); 2121 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
2126 aid = le16_to_cpu(mgmt->u.assoc_resp.aid); 2122 aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
2127 2123
2128 pr_debug("%s: RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n", 2124 sdata_info(sdata,
2129 sdata->name, reassoc ? "Rea" : "A", mgmt->sa, 2125 "RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n",
2130 capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14)))); 2126 reassoc ? "Rea" : "A", mgmt->sa,
2127 capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14))));
2131 2128
2132 pos = mgmt->u.assoc_resp.variable; 2129 pos = mgmt->u.assoc_resp.variable;
2133 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); 2130 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
@@ -2138,8 +2135,9 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2138 u32 tu, ms; 2135 u32 tu, ms;
2139 tu = get_unaligned_le32(elems.timeout_int + 1); 2136 tu = get_unaligned_le32(elems.timeout_int + 1);
2140 ms = tu * 1024 / 1000; 2137 ms = tu * 1024 / 1000;
2141 pr_debug("%s: %pM rejected association temporarily; comeback duration %u TU (%u ms)\n", 2138 sdata_info(sdata,
2142 sdata->name, mgmt->sa, tu, ms); 2139 "%pM rejected association temporarily; comeback duration %u TU (%u ms)\n",
2140 mgmt->sa, tu, ms);
2143 assoc_data->timeout = jiffies + msecs_to_jiffies(ms); 2141 assoc_data->timeout = jiffies + msecs_to_jiffies(ms);
2144 if (ms > IEEE80211_ASSOC_TIMEOUT) 2142 if (ms > IEEE80211_ASSOC_TIMEOUT)
2145 run_again(ifmgd, assoc_data->timeout); 2143 run_again(ifmgd, assoc_data->timeout);
@@ -2149,11 +2147,11 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2149 *bss = assoc_data->bss; 2147 *bss = assoc_data->bss;
2150 2148
2151 if (status_code != WLAN_STATUS_SUCCESS) { 2149 if (status_code != WLAN_STATUS_SUCCESS) {
2152 pr_debug("%s: %pM denied association (code=%d)\n", 2150 sdata_info(sdata, "%pM denied association (code=%d)\n",
2153 sdata->name, mgmt->sa, status_code); 2151 mgmt->sa, status_code);
2154 ieee80211_destroy_assoc_data(sdata, false); 2152 ieee80211_destroy_assoc_data(sdata, false);
2155 } else { 2153 } else {
2156 pr_debug("%s: associated\n", sdata->name); 2154 sdata_info(sdata, "associated\n");
2157 2155
2158 if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { 2156 if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) {
2159 /* oops -- internal error -- send timeout for now */ 2157 /* oops -- internal error -- send timeout for now */
@@ -2261,7 +2259,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
2261 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies && 2259 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies &&
2262 ether_addr_equal(mgmt->bssid, ifmgd->auth_data->bss->bssid)) { 2260 ether_addr_equal(mgmt->bssid, ifmgd->auth_data->bss->bssid)) {
2263 /* got probe response, continue with auth */ 2261 /* got probe response, continue with auth */
2264 pr_debug("%s: direct probe responded\n", sdata->name); 2262 sdata_info(sdata, "direct probe responded\n");
2265 ifmgd->auth_data->tries = 0; 2263 ifmgd->auth_data->tries = 0;
2266 ifmgd->auth_data->timeout = jiffies; 2264 ifmgd->auth_data->timeout = jiffies;
2267 run_again(ifmgd, ifmgd->auth_data->timeout); 2265 run_again(ifmgd, ifmgd->auth_data->timeout);
@@ -2397,10 +2395,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2397 } 2395 }
2398 2396
2399 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) { 2397 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) {
2400#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2398 mlme_dbg_ratelimited(sdata,
2401 net_dbg_ratelimited("%s: cancelling probereq poll due to a received beacon\n", 2399 "cancelling probereq poll due to a received beacon\n");
2402 sdata->name);
2403#endif
2404 mutex_lock(&local->mtx); 2400 mutex_lock(&local->mtx);
2405 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; 2401 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL;
2406 ieee80211_run_deferred_scan(local); 2402 ieee80211_run_deferred_scan(local);
@@ -2625,8 +2621,8 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
2625 auth_data->tries++; 2621 auth_data->tries++;
2626 2622
2627 if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { 2623 if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) {
2628 pr_debug("%s: authentication with %pM timed out\n", 2624 sdata_info(sdata, "authentication with %pM timed out\n",
2629 sdata->name, auth_data->bss->bssid); 2625 auth_data->bss->bssid);
2630 2626
2631 /* 2627 /*
2632 * Most likely AP is not in the range so remove the 2628 * Most likely AP is not in the range so remove the
@@ -2638,9 +2634,9 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
2638 } 2634 }
2639 2635
2640 if (auth_data->bss->proberesp_ies) { 2636 if (auth_data->bss->proberesp_ies) {
2641 pr_debug("%s: send auth to %pM (try %d/%d)\n", 2637 sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
2642 sdata->name, auth_data->bss->bssid, auth_data->tries, 2638 auth_data->bss->bssid, auth_data->tries,
2643 IEEE80211_AUTH_MAX_TRIES); 2639 IEEE80211_AUTH_MAX_TRIES);
2644 2640
2645 auth_data->expected_transaction = 2; 2641 auth_data->expected_transaction = 2;
2646 ieee80211_send_auth(sdata, 1, auth_data->algorithm, 2642 ieee80211_send_auth(sdata, 1, auth_data->algorithm,
@@ -2650,9 +2646,9 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
2650 } else { 2646 } else {
2651 const u8 *ssidie; 2647 const u8 *ssidie;
2652 2648
2653 pr_debug("%s: direct probe to %pM (try %d/%i)\n", 2649 sdata_info(sdata, "direct probe to %pM (try %d/%i)\n",
2654 sdata->name, auth_data->bss->bssid, auth_data->tries, 2650 auth_data->bss->bssid, auth_data->tries,
2655 IEEE80211_AUTH_MAX_TRIES); 2651 IEEE80211_AUTH_MAX_TRIES);
2656 2652
2657 ssidie = ieee80211_bss_get_ie(auth_data->bss, WLAN_EID_SSID); 2653 ssidie = ieee80211_bss_get_ie(auth_data->bss, WLAN_EID_SSID);
2658 if (!ssidie) 2654 if (!ssidie)
@@ -2680,8 +2676,8 @@ static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata)
2680 2676
2681 assoc_data->tries++; 2677 assoc_data->tries++;
2682 if (assoc_data->tries > IEEE80211_ASSOC_MAX_TRIES) { 2678 if (assoc_data->tries > IEEE80211_ASSOC_MAX_TRIES) {
2683 pr_debug("%s: association with %pM timed out\n", 2679 sdata_info(sdata, "association with %pM timed out\n",
2684 sdata->name, assoc_data->bss->bssid); 2680 assoc_data->bss->bssid);
2685 2681
2686 /* 2682 /*
2687 * Most likely AP is not in the range so remove the 2683 * Most likely AP is not in the range so remove the
@@ -2692,9 +2688,9 @@ static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata)
2692 return -ETIMEDOUT; 2688 return -ETIMEDOUT;
2693 } 2689 }
2694 2690
2695 pr_debug("%s: associate with %pM (try %d/%d)\n", 2691 sdata_info(sdata, "associate with %pM (try %d/%d)\n",
2696 sdata->name, assoc_data->bss->bssid, assoc_data->tries, 2692 assoc_data->bss->bssid, assoc_data->tries,
2697 IEEE80211_ASSOC_MAX_TRIES); 2693 IEEE80211_ASSOC_MAX_TRIES);
2698 ieee80211_send_assoc(sdata); 2694 ieee80211_send_assoc(sdata);
2699 2695
2700 assoc_data->timeout = jiffies + IEEE80211_ASSOC_TIMEOUT; 2696 assoc_data->timeout = jiffies + IEEE80211_ASSOC_TIMEOUT;
@@ -2767,45 +2763,31 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
2767 ieee80211_reset_ap_probe(sdata); 2763 ieee80211_reset_ap_probe(sdata);
2768 else if (ifmgd->nullfunc_failed) { 2764 else if (ifmgd->nullfunc_failed) {
2769 if (ifmgd->probe_send_count < max_tries) { 2765 if (ifmgd->probe_send_count < max_tries) {
2770#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2766 mlme_dbg(sdata,
2771 wiphy_debug(local->hw.wiphy, 2767 "No ack for nullfunc frame to AP %pM, try %d/%i\n",
2772 "%s: No ack for nullfunc frame to" 2768 bssid, ifmgd->probe_send_count,
2773 " AP %pM, try %d/%i\n", 2769 max_tries);
2774 sdata->name, bssid,
2775 ifmgd->probe_send_count, max_tries);
2776#endif
2777 ieee80211_mgd_probe_ap_send(sdata); 2770 ieee80211_mgd_probe_ap_send(sdata);
2778 } else { 2771 } else {
2779#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2772 mlme_dbg(sdata,
2780 wiphy_debug(local->hw.wiphy, 2773 "No ack for nullfunc frame to AP %pM, disconnecting.\n",
2781 "%s: No ack for nullfunc frame to" 2774 bssid);
2782 " AP %pM, disconnecting.\n",
2783 sdata->name, bssid);
2784#endif
2785 ieee80211_sta_connection_lost(sdata, bssid, 2775 ieee80211_sta_connection_lost(sdata, bssid,
2786 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 2776 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
2787 } 2777 }
2788 } else if (time_is_after_jiffies(ifmgd->probe_timeout)) 2778 } else if (time_is_after_jiffies(ifmgd->probe_timeout))
2789 run_again(ifmgd, ifmgd->probe_timeout); 2779 run_again(ifmgd, ifmgd->probe_timeout);
2790 else if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) { 2780 else if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) {
2791#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2781 mlme_dbg(sdata,
2792 wiphy_debug(local->hw.wiphy, 2782 "Failed to send nullfunc to AP %pM after %dms, disconnecting\n",
2793 "%s: Failed to send nullfunc to AP %pM" 2783 bssid, probe_wait_ms);
2794 " after %dms, disconnecting.\n",
2795 sdata->name,
2796 bssid, probe_wait_ms);
2797#endif
2798 ieee80211_sta_connection_lost(sdata, bssid, 2784 ieee80211_sta_connection_lost(sdata, bssid,
2799 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 2785 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
2800 } else if (ifmgd->probe_send_count < max_tries) { 2786 } else if (ifmgd->probe_send_count < max_tries) {
2801#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2787 mlme_dbg(sdata,
2802 wiphy_debug(local->hw.wiphy, 2788 "No probe response from AP %pM after %dms, try %d/%i\n",
2803 "%s: No probe response from AP %pM" 2789 bssid, probe_wait_ms,
2804 " after %dms, try %d/%i\n", 2790 ifmgd->probe_send_count, max_tries);
2805 sdata->name,
2806 bssid, probe_wait_ms,
2807 ifmgd->probe_send_count, max_tries);
2808#endif
2809 ieee80211_mgd_probe_ap_send(sdata); 2791 ieee80211_mgd_probe_ap_send(sdata);
2810 } else { 2792 } else {
2811 /* 2793 /*
@@ -2920,11 +2902,8 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)
2920 sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; 2902 sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME;
2921 mutex_lock(&ifmgd->mtx); 2903 mutex_lock(&ifmgd->mtx);
2922 if (ifmgd->associated) { 2904 if (ifmgd->associated) {
2923#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2905 mlme_dbg(sdata,
2924 wiphy_debug(sdata->local->hw.wiphy, 2906 "driver requested disconnect after resume\n");
2925 "%s: driver requested disconnect after resume.\n",
2926 sdata->name);
2927#endif
2928 ieee80211_sta_connection_lost(sdata, 2907 ieee80211_sta_connection_lost(sdata,
2929 ifmgd->associated->bssid, 2908 ifmgd->associated->bssid,
2930 WLAN_REASON_UNSPECIFIED); 2909 WLAN_REASON_UNSPECIFIED);
@@ -3065,10 +3044,11 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3065 * since we look at probe response/beacon data here 3044 * since we look at probe response/beacon data here
3066 * it should be OK. 3045 * it should be OK.
3067 */ 3046 */
3068 pr_debug("%s: Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n", 3047 sdata_info(sdata,
3069 sdata->name, cbss->channel->center_freq, 3048 "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n",
3070 ht_cfreq, ht_oper->primary_chan, 3049 cbss->channel->center_freq,
3071 cbss->channel->band); 3050 ht_cfreq, ht_oper->primary_chan,
3051 cbss->channel->band);
3072 ht_oper = NULL; 3052 ht_oper = NULL;
3073 } 3053 }
3074 } 3054 }
@@ -3092,8 +3072,8 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3092 if (!ieee80211_set_channel_type(local, sdata, channel_type)) { 3072 if (!ieee80211_set_channel_type(local, sdata, channel_type)) {
3093 /* can only fail due to HT40+/- mismatch */ 3073 /* can only fail due to HT40+/- mismatch */
3094 channel_type = NL80211_CHAN_HT20; 3074 channel_type = NL80211_CHAN_HT20;
3095 pr_debug("%s: disabling 40 MHz due to multi-vif mismatch\n", 3075 sdata_info(sdata,
3096 sdata->name); 3076 "disabling 40 MHz due to multi-vif mismatch\n");
3097 ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; 3077 ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ;
3098 WARN_ON(!ieee80211_set_channel_type(local, sdata, 3078 WARN_ON(!ieee80211_set_channel_type(local, sdata,
3099 channel_type)); 3079 channel_type));
@@ -3122,8 +3102,8 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3122 * we can connect -- with a warning. 3102 * we can connect -- with a warning.
3123 */ 3103 */
3124 if (!basic_rates && min_rate_index >= 0) { 3104 if (!basic_rates && min_rate_index >= 0) {
3125 pr_debug("%s: No basic rates, using min rate instead\n", 3105 sdata_info(sdata,
3126 sdata->name); 3106 "No basic rates, using min rate instead\n");
3127 basic_rates = BIT(min_rate_index); 3107 basic_rates = BIT(min_rate_index);
3128 } 3108 }
3129 3109
@@ -3149,8 +3129,9 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3149 err = sta_info_insert(sta); 3129 err = sta_info_insert(sta);
3150 sta = NULL; 3130 sta = NULL;
3151 if (err) { 3131 if (err) {
3152 pr_debug("%s: failed to insert STA entry for the AP (error %d)\n", 3132 sdata_info(sdata,
3153 sdata->name, err); 3133 "failed to insert STA entry for the AP (error %d)\n",
3134 err);
3154 return err; 3135 return err;
3155 } 3136 }
3156 } else 3137 } else
@@ -3228,7 +3209,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
3228 if (ifmgd->associated) 3209 if (ifmgd->associated)
3229 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 3210 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
3230 3211
3231 pr_debug("%s: authenticate with %pM\n", sdata->name, req->bss->bssid); 3212 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);
3232 3213
3233 err = ieee80211_prep_connection(sdata, req->bss, false); 3214 err = ieee80211_prep_connection(sdata, req->bss, false);
3234 if (err) 3215 if (err)
@@ -3410,8 +3391,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3410 * Wait up to one beacon interval ... 3391 * Wait up to one beacon interval ...
3411 * should this be more if we miss one? 3392 * should this be more if we miss one?
3412 */ 3393 */
3413 pr_debug("%s: waiting for beacon from %pM\n", 3394 sdata_info(sdata, "waiting for beacon from %pM\n",
3414 sdata->name, ifmgd->bssid); 3395 ifmgd->bssid);
3415 assoc_data->timeout = TU_TO_EXP_TIME(req->bss->beacon_interval); 3396 assoc_data->timeout = TU_TO_EXP_TIME(req->bss->beacon_interval);
3416 } else { 3397 } else {
3417 assoc_data->have_beacon = true; 3398 assoc_data->have_beacon = true;
@@ -3430,8 +3411,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3430 corrupt_type = "beacon"; 3411 corrupt_type = "beacon";
3431 } else if (bss->corrupt_data & IEEE80211_BSS_CORRUPT_PROBE_RESP) 3412 } else if (bss->corrupt_data & IEEE80211_BSS_CORRUPT_PROBE_RESP)
3432 corrupt_type = "probe response"; 3413 corrupt_type = "probe response";
3433 pr_debug("%s: associating with AP with corrupt %s\n", 3414 sdata_info(sdata, "associating with AP with corrupt %s\n",
3434 sdata->name, corrupt_type); 3415 corrupt_type);
3435 } 3416 }
3436 3417
3437 err = 0; 3418 err = 0;
@@ -3460,8 +3441,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
3460 return 0; 3441 return 0;
3461 } 3442 }
3462 3443
3463 pr_debug("%s: deauthenticating from %pM by local choice (reason=%d)\n", 3444 sdata_info(sdata,
3464 sdata->name, req->bssid, req->reason_code); 3445 "deauthenticating from %pM by local choice (reason=%d)\n",
3446 req->bssid, req->reason_code);
3465 3447
3466 if (ifmgd->associated && 3448 if (ifmgd->associated &&
3467 ether_addr_equal(ifmgd->associated->bssid, req->bssid)) 3449 ether_addr_equal(ifmgd->associated->bssid, req->bssid))
@@ -3503,8 +3485,9 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
3503 return -ENOLINK; 3485 return -ENOLINK;
3504 } 3486 }
3505 3487
3506 pr_debug("%s: disassociating from %pM by local choice (reason=%d)\n", 3488 sdata_info(sdata,
3507 sdata->name, req->bss->bssid, req->reason_code); 3489 "disassociating from %pM by local choice (reason=%d)\n",
3490 req->bss->bssid, req->reason_code);
3508 3491
3509 memcpy(bssid, req->bss->bssid, ETH_ALEN); 3492 memcpy(bssid, req->bss->bssid, ETH_ALEN);
3510 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC, 3493 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC,