aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-15 17:20:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-05 15:27:16 -0400
commitf0d232080fa5d040aaf73a39d127b003cdd2d0ae (patch)
tree7c6ee7c422152e2627040e466dc2d709a27f0469 /net/mac80211/ibss.c
parent6efb71b01e37296eb0bcd6c63f7fa3b2d996d589 (diff)
net: mac80211: Convert printk(KERN_DEBUG to pr_debug
Standardize the debugging to be able to use dynamic_debug. Coalesce formats, align arguments. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c88
1 files changed, 39 insertions, 49 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 33d9d0c3e3d0..148c27553024 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -282,9 +282,8 @@ static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
282 return sta_info_get(sdata, addr); 282 return sta_info_get(sdata, addr);
283 if (auth) { 283 if (auth) {
284#ifdef CONFIG_MAC80211_IBSS_DEBUG 284#ifdef CONFIG_MAC80211_IBSS_DEBUG
285 printk(KERN_DEBUG "TX Auth SA=%pM DA=%pM BSSID=%pM" 285 pr_debug("TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n",
286 "(auth_transaction=1)\n", sdata->vif.addr, 286 sdata->vif.addr, sdata->u.ibss.bssid, addr);
287 sdata->u.ibss.bssid, addr);
288#endif 287#endif
289 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, NULL, 0, 288 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, NULL, 0,
290 addr, sdata->u.ibss.bssid, NULL, 0, 0); 289 addr, sdata->u.ibss.bssid, NULL, 0, 0);
@@ -356,9 +355,9 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
356 if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) 355 if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1)
357 return; 356 return;
358#ifdef CONFIG_MAC80211_IBSS_DEBUG 357#ifdef CONFIG_MAC80211_IBSS_DEBUG
359 printk(KERN_DEBUG "%s: RX Auth SA=%pM DA=%pM BSSID=%pM." 358 pr_debug("%s: RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n",
360 "(auth_transaction=%d)\n", 359 sdata->name, mgmt->sa, mgmt->da, mgmt->bssid,
361 sdata->name, mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction); 360 auth_transaction);
362#endif 361#endif
363 sta_info_destroy_addr(sdata, mgmt->sa); 362 sta_info_destroy_addr(sdata, mgmt->sa);
364 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false); 363 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false);
@@ -423,13 +422,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
423 422
424 if (sta->sta.supp_rates[band] != prev_rates) { 423 if (sta->sta.supp_rates[band] != prev_rates) {
425#ifdef CONFIG_MAC80211_IBSS_DEBUG 424#ifdef CONFIG_MAC80211_IBSS_DEBUG
426 printk(KERN_DEBUG 425 pr_debug("%s: updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n",
427 "%s: updated supp_rates set " 426 sdata->name, sta->sta.addr,
428 "for %pM based on beacon" 427 prev_rates,
429 "/probe_resp (0x%x -> 0x%x)\n", 428 sta->sta.supp_rates[band]);
430 sdata->name, sta->sta.addr,
431 prev_rates,
432 sta->sta.supp_rates[band]);
433#endif 429#endif
434 rates_updated = true; 430 rates_updated = true;
435 } 431 }
@@ -546,20 +542,18 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
546 } 542 }
547 543
548#ifdef CONFIG_MAC80211_IBSS_DEBUG 544#ifdef CONFIG_MAC80211_IBSS_DEBUG
549 printk(KERN_DEBUG "RX beacon SA=%pM BSSID=" 545 pr_debug("RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n",
550 "%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n", 546 mgmt->sa, mgmt->bssid,
551 mgmt->sa, mgmt->bssid, 547 (unsigned long long)rx_timestamp,
552 (unsigned long long)rx_timestamp, 548 (unsigned long long)beacon_timestamp,
553 (unsigned long long)beacon_timestamp, 549 (unsigned long long)(rx_timestamp - beacon_timestamp),
554 (unsigned long long)(rx_timestamp - beacon_timestamp), 550 jiffies);
555 jiffies);
556#endif 551#endif
557 552
558 if (beacon_timestamp > rx_timestamp) { 553 if (beacon_timestamp > rx_timestamp) {
559#ifdef CONFIG_MAC80211_IBSS_DEBUG 554#ifdef CONFIG_MAC80211_IBSS_DEBUG
560 printk(KERN_DEBUG "%s: beacon TSF higher than " 555 pr_debug("%s: beacon TSF higher than local TSF - IBSS merge with BSSID %pM\n",
561 "local TSF - IBSS merge with BSSID %pM\n", 556 sdata->name, mgmt->bssid);
562 sdata->name, mgmt->bssid);
563#endif 557#endif
564 ieee80211_sta_join_ibss(sdata, bss); 558 ieee80211_sta_join_ibss(sdata, bss);
565 supp_rates = ieee80211_sta_get_rates(local, elems, band, NULL); 559 supp_rates = ieee80211_sta_get_rates(local, elems, band, NULL);
@@ -662,8 +656,8 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
662 if (ifibss->fixed_channel) 656 if (ifibss->fixed_channel)
663 return; 657 return;
664 658
665 printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " 659 pr_debug("%s: No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n",
666 "IBSS networks with same SSID (merge)\n", sdata->name); 660 sdata->name);
667 661
668 ieee80211_request_internal_scan(sdata, 662 ieee80211_request_internal_scan(sdata,
669 ifibss->ssid, ifibss->ssid_len, NULL); 663 ifibss->ssid, ifibss->ssid_len, NULL);
@@ -691,8 +685,8 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
691 bssid[0] |= 0x02; 685 bssid[0] |= 0x02;
692 } 686 }
693 687
694 printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", 688 pr_debug("%s: Creating new IBSS network, BSSID %pM\n",
695 sdata->name, bssid); 689 sdata->name, bssid);
696 690
697 capability = WLAN_CAPABILITY_IBSS; 691 capability = WLAN_CAPABILITY_IBSS;
698 692
@@ -724,8 +718,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
724 718
725 active_ibss = ieee80211_sta_active_ibss(sdata); 719 active_ibss = ieee80211_sta_active_ibss(sdata);
726#ifdef CONFIG_MAC80211_IBSS_DEBUG 720#ifdef CONFIG_MAC80211_IBSS_DEBUG
727 printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", 721 pr_debug("%s: sta_find_ibss (active_ibss=%d)\n",
728 sdata->name, active_ibss); 722 sdata->name, active_ibss);
729#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 723#endif /* CONFIG_MAC80211_IBSS_DEBUG */
730 724
731 if (active_ibss) 725 if (active_ibss)
@@ -750,13 +744,12 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
750 744
751 bss = (void *)cbss->priv; 745 bss = (void *)cbss->priv;
752#ifdef CONFIG_MAC80211_IBSS_DEBUG 746#ifdef CONFIG_MAC80211_IBSS_DEBUG
753 printk(KERN_DEBUG " sta_find_ibss: selected %pM current " 747 pr_debug(" sta_find_ibss: selected %pM current %pM\n",
754 "%pM\n", cbss->bssid, ifibss->bssid); 748 cbss->bssid, ifibss->bssid);
755#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 749#endif /* CONFIG_MAC80211_IBSS_DEBUG */
756 750
757 printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" 751 pr_debug("%s: Selected IBSS BSSID %pM based on configured SSID\n",
758 " based on configured SSID\n", 752 sdata->name, cbss->bssid);
759 sdata->name, cbss->bssid);
760 753
761 ieee80211_sta_join_ibss(sdata, bss); 754 ieee80211_sta_join_ibss(sdata, bss);
762 ieee80211_rx_bss_put(local, bss); 755 ieee80211_rx_bss_put(local, bss);
@@ -764,14 +757,14 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
764 } 757 }
765 758
766#ifdef CONFIG_MAC80211_IBSS_DEBUG 759#ifdef CONFIG_MAC80211_IBSS_DEBUG
767 printk(KERN_DEBUG " did not try to join ibss\n"); 760 pr_debug(" did not try to join ibss\n");
768#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 761#endif /* CONFIG_MAC80211_IBSS_DEBUG */
769 762
770 /* Selected IBSS not found in current scan results - try to scan */ 763 /* Selected IBSS not found in current scan results - try to scan */
771 if (time_after(jiffies, ifibss->last_scan_completed + 764 if (time_after(jiffies, ifibss->last_scan_completed +
772 IEEE80211_SCAN_INTERVAL)) { 765 IEEE80211_SCAN_INTERVAL)) {
773 printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " 766 pr_debug("%s: Trigger new scan to find an IBSS to join\n",
774 "join\n", sdata->name); 767 sdata->name);
775 768
776 ieee80211_request_internal_scan(sdata, 769 ieee80211_request_internal_scan(sdata,
777 ifibss->ssid, ifibss->ssid_len, 770 ifibss->ssid, ifibss->ssid_len,
@@ -785,9 +778,9 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
785 ieee80211_sta_create_ibss(sdata); 778 ieee80211_sta_create_ibss(sdata);
786 return; 779 return;
787 } 780 }
788 printk(KERN_DEBUG "%s: IBSS not allowed on" 781 pr_debug("%s: IBSS not allowed on %d MHz\n",
789 " %d MHz\n", sdata->name, 782 sdata->name,
790 local->hw.conf.channel->center_freq); 783 local->hw.conf.channel->center_freq);
791 784
792 /* No IBSS found - decrease scan interval and continue 785 /* No IBSS found - decrease scan interval and continue
793 * scanning. */ 786 * scanning. */
@@ -823,10 +816,9 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
823 tx_last_beacon = drv_tx_last_beacon(local); 816 tx_last_beacon = drv_tx_last_beacon(local);
824 817
825#ifdef CONFIG_MAC80211_IBSS_DEBUG 818#ifdef CONFIG_MAC80211_IBSS_DEBUG
826 printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" 819 pr_debug("%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n",
827 " (tx_last_beacon=%d)\n", 820 sdata->name, mgmt->sa, mgmt->da,
828 sdata->name, mgmt->sa, mgmt->da, 821 mgmt->bssid, tx_last_beacon);
829 mgmt->bssid, tx_last_beacon);
830#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 822#endif /* CONFIG_MAC80211_IBSS_DEBUG */
831 823
832 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da)) 824 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
@@ -841,9 +833,8 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
841 if (pos[0] != WLAN_EID_SSID || 833 if (pos[0] != WLAN_EID_SSID ||
842 pos + 2 + pos[1] > end) { 834 pos + 2 + pos[1] > end) {
843#ifdef CONFIG_MAC80211_IBSS_DEBUG 835#ifdef CONFIG_MAC80211_IBSS_DEBUG
844 printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " 836 pr_debug("%s: Invalid SSID IE in ProbeReq from %pM\n",
845 "from %pM\n", 837 sdata->name, mgmt->sa);
846 sdata->name, mgmt->sa);
847#endif 838#endif
848 return; 839 return;
849 } 840 }
@@ -862,8 +853,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
862 resp = (struct ieee80211_mgmt *) skb->data; 853 resp = (struct ieee80211_mgmt *) skb->data;
863 memcpy(resp->da, mgmt->sa, ETH_ALEN); 854 memcpy(resp->da, mgmt->sa, ETH_ALEN);
864#ifdef CONFIG_MAC80211_IBSS_DEBUG 855#ifdef CONFIG_MAC80211_IBSS_DEBUG
865 printk(KERN_DEBUG "%s: Sending ProbeResp to %pM\n", 856 pr_debug("%s: Sending ProbeResp to %pM\n", sdata->name, resp->da);
866 sdata->name, resp->da);
867#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 857#endif /* CONFIG_MAC80211_IBSS_DEBUG */
868 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 858 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
869 ieee80211_tx_skb(sdata, skb); 859 ieee80211_tx_skb(sdata, skb);