diff options
author | Joe Perches <joe@perches.com> | 2010-07-26 17:39:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-27 15:14:13 -0400 |
commit | c96c31e499b70964cfc88744046c998bb710e4b8 (patch) | |
tree | 0157102fbc952e3646690f3491199607669eed69 /drivers/net/wireless/mac80211_hwsim.c | |
parent | e1db74fcc3d95c8a051ec457241b5aa65a01a603 (diff) |
drivers/net/wireless: Use wiphy_<level>
Standardize the logging macros used.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 99 |
1 files changed, 46 insertions, 53 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e7f299dc9ef5..01ad7f77383a 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -486,8 +486,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, | |||
486 | struct ieee80211_rx_status rx_status; | 486 | struct ieee80211_rx_status rx_status; |
487 | 487 | ||
488 | if (data->idle) { | 488 | if (data->idle) { |
489 | printk(KERN_DEBUG "%s: Trying to TX when idle - reject\n", | 489 | wiphy_debug(hw->wiphy, "trying to tx when idle - reject\n"); |
490 | wiphy_name(hw->wiphy)); | ||
491 | return false; | 490 | return false; |
492 | } | 491 | } |
493 | 492 | ||
@@ -576,7 +575,7 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
576 | static int mac80211_hwsim_start(struct ieee80211_hw *hw) | 575 | static int mac80211_hwsim_start(struct ieee80211_hw *hw) |
577 | { | 576 | { |
578 | struct mac80211_hwsim_data *data = hw->priv; | 577 | struct mac80211_hwsim_data *data = hw->priv; |
579 | printk(KERN_DEBUG "%s:%s\n", wiphy_name(hw->wiphy), __func__); | 578 | wiphy_debug(hw->wiphy, "%s\n", __func__); |
580 | data->started = 1; | 579 | data->started = 1; |
581 | return 0; | 580 | return 0; |
582 | } | 581 | } |
@@ -587,16 +586,15 @@ static void mac80211_hwsim_stop(struct ieee80211_hw *hw) | |||
587 | struct mac80211_hwsim_data *data = hw->priv; | 586 | struct mac80211_hwsim_data *data = hw->priv; |
588 | data->started = 0; | 587 | data->started = 0; |
589 | del_timer(&data->beacon_timer); | 588 | del_timer(&data->beacon_timer); |
590 | printk(KERN_DEBUG "%s:%s\n", wiphy_name(hw->wiphy), __func__); | 589 | wiphy_debug(hw->wiphy, "%s\n", __func__); |
591 | } | 590 | } |
592 | 591 | ||
593 | 592 | ||
594 | static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, | 593 | static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, |
595 | struct ieee80211_vif *vif) | 594 | struct ieee80211_vif *vif) |
596 | { | 595 | { |
597 | printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n", | 596 | wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n", |
598 | wiphy_name(hw->wiphy), __func__, vif->type, | 597 | __func__, vif->type, vif->addr); |
599 | vif->addr); | ||
600 | hwsim_set_magic(vif); | 598 | hwsim_set_magic(vif); |
601 | return 0; | 599 | return 0; |
602 | } | 600 | } |
@@ -605,9 +603,8 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, | |||
605 | static void mac80211_hwsim_remove_interface( | 603 | static void mac80211_hwsim_remove_interface( |
606 | struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 604 | struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
607 | { | 605 | { |
608 | printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n", | 606 | wiphy_debug(hw->wiphy, "%s (type=%d mac_addr=%pM)\n", |
609 | wiphy_name(hw->wiphy), __func__, vif->type, | 607 | __func__, vif->type, vif->addr); |
610 | vif->addr); | ||
611 | hwsim_check_magic(vif); | 608 | hwsim_check_magic(vif); |
612 | hwsim_clear_magic(vif); | 609 | hwsim_clear_magic(vif); |
613 | } | 610 | } |
@@ -670,13 +667,14 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) | |||
670 | [IEEE80211_SMPS_DYNAMIC] = "dynamic", | 667 | [IEEE80211_SMPS_DYNAMIC] = "dynamic", |
671 | }; | 668 | }; |
672 | 669 | ||
673 | printk(KERN_DEBUG "%s:%s (freq=%d/%s idle=%d ps=%d smps=%s)\n", | 670 | wiphy_debug(hw->wiphy, |
674 | wiphy_name(hw->wiphy), __func__, | 671 | "%s (freq=%d/%s idle=%d ps=%d smps=%s)\n", |
675 | conf->channel->center_freq, | 672 | __func__, |
676 | hwsim_chantypes[conf->channel_type], | 673 | conf->channel->center_freq, |
677 | !!(conf->flags & IEEE80211_CONF_IDLE), | 674 | hwsim_chantypes[conf->channel_type], |
678 | !!(conf->flags & IEEE80211_CONF_PS), | 675 | !!(conf->flags & IEEE80211_CONF_IDLE), |
679 | smps_modes[conf->smps_mode]); | 676 | !!(conf->flags & IEEE80211_CONF_PS), |
677 | smps_modes[conf->smps_mode]); | ||
680 | 678 | ||
681 | data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); | 679 | data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); |
682 | 680 | ||
@@ -696,7 +694,7 @@ static void mac80211_hwsim_configure_filter(struct ieee80211_hw *hw, | |||
696 | { | 694 | { |
697 | struct mac80211_hwsim_data *data = hw->priv; | 695 | struct mac80211_hwsim_data *data = hw->priv; |
698 | 696 | ||
699 | printk(KERN_DEBUG "%s:%s\n", wiphy_name(hw->wiphy), __func__); | 697 | wiphy_debug(hw->wiphy, "%s\n", __func__); |
700 | 698 | ||
701 | data->rx_filter = 0; | 699 | data->rx_filter = 0; |
702 | if (*total_flags & FIF_PROMISC_IN_BSS) | 700 | if (*total_flags & FIF_PROMISC_IN_BSS) |
@@ -717,26 +715,23 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, | |||
717 | 715 | ||
718 | hwsim_check_magic(vif); | 716 | hwsim_check_magic(vif); |
719 | 717 | ||
720 | printk(KERN_DEBUG "%s:%s(changed=0x%x)\n", | 718 | wiphy_debug(hw->wiphy, "%s(changed=0x%x)\n", __func__, changed); |
721 | wiphy_name(hw->wiphy), __func__, changed); | ||
722 | 719 | ||
723 | if (changed & BSS_CHANGED_BSSID) { | 720 | if (changed & BSS_CHANGED_BSSID) { |
724 | printk(KERN_DEBUG "%s:%s: BSSID changed: %pM\n", | 721 | wiphy_debug(hw->wiphy, "%s: BSSID changed: %pM\n", |
725 | wiphy_name(hw->wiphy), __func__, | 722 | __func__, info->bssid); |
726 | info->bssid); | ||
727 | memcpy(vp->bssid, info->bssid, ETH_ALEN); | 723 | memcpy(vp->bssid, info->bssid, ETH_ALEN); |
728 | } | 724 | } |
729 | 725 | ||
730 | if (changed & BSS_CHANGED_ASSOC) { | 726 | if (changed & BSS_CHANGED_ASSOC) { |
731 | printk(KERN_DEBUG " %s: ASSOC: assoc=%d aid=%d\n", | 727 | wiphy_debug(hw->wiphy, " ASSOC: assoc=%d aid=%d\n", |
732 | wiphy_name(hw->wiphy), info->assoc, info->aid); | 728 | info->assoc, info->aid); |
733 | vp->assoc = info->assoc; | 729 | vp->assoc = info->assoc; |
734 | vp->aid = info->aid; | 730 | vp->aid = info->aid; |
735 | } | 731 | } |
736 | 732 | ||
737 | if (changed & BSS_CHANGED_BEACON_INT) { | 733 | if (changed & BSS_CHANGED_BEACON_INT) { |
738 | printk(KERN_DEBUG " %s: BCNINT: %d\n", | 734 | wiphy_debug(hw->wiphy, " BCNINT: %d\n", info->beacon_int); |
739 | wiphy_name(hw->wiphy), info->beacon_int); | ||
740 | data->beacon_int = 1024 * info->beacon_int / 1000 * HZ / 1000; | 735 | data->beacon_int = 1024 * info->beacon_int / 1000 * HZ / 1000; |
741 | if (WARN_ON(!data->beacon_int)) | 736 | if (WARN_ON(!data->beacon_int)) |
742 | data->beacon_int = 1; | 737 | data->beacon_int = 1; |
@@ -746,31 +741,28 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, | |||
746 | } | 741 | } |
747 | 742 | ||
748 | if (changed & BSS_CHANGED_ERP_CTS_PROT) { | 743 | if (changed & BSS_CHANGED_ERP_CTS_PROT) { |
749 | printk(KERN_DEBUG " %s: ERP_CTS_PROT: %d\n", | 744 | wiphy_debug(hw->wiphy, " ERP_CTS_PROT: %d\n", |
750 | wiphy_name(hw->wiphy), info->use_cts_prot); | 745 | info->use_cts_prot); |
751 | } | 746 | } |
752 | 747 | ||
753 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { | 748 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
754 | printk(KERN_DEBUG " %s: ERP_PREAMBLE: %d\n", | 749 | wiphy_debug(hw->wiphy, " ERP_PREAMBLE: %d\n", |
755 | wiphy_name(hw->wiphy), info->use_short_preamble); | 750 | info->use_short_preamble); |
756 | } | 751 | } |
757 | 752 | ||
758 | if (changed & BSS_CHANGED_ERP_SLOT) { | 753 | if (changed & BSS_CHANGED_ERP_SLOT) { |
759 | printk(KERN_DEBUG " %s: ERP_SLOT: %d\n", | 754 | wiphy_debug(hw->wiphy, " ERP_SLOT: %d\n", info->use_short_slot); |
760 | wiphy_name(hw->wiphy), info->use_short_slot); | ||
761 | } | 755 | } |
762 | 756 | ||
763 | if (changed & BSS_CHANGED_HT) { | 757 | if (changed & BSS_CHANGED_HT) { |
764 | printk(KERN_DEBUG " %s: HT: op_mode=0x%x, chantype=%s\n", | 758 | wiphy_debug(hw->wiphy, " HT: op_mode=0x%x, chantype=%s\n", |
765 | wiphy_name(hw->wiphy), | 759 | info->ht_operation_mode, |
766 | info->ht_operation_mode, | 760 | hwsim_chantypes[info->channel_type]); |
767 | hwsim_chantypes[info->channel_type]); | ||
768 | } | 761 | } |
769 | 762 | ||
770 | if (changed & BSS_CHANGED_BASIC_RATES) { | 763 | if (changed & BSS_CHANGED_BASIC_RATES) { |
771 | printk(KERN_DEBUG " %s: BASIC_RATES: 0x%llx\n", | 764 | wiphy_debug(hw->wiphy, " BASIC_RATES: 0x%llx\n", |
772 | wiphy_name(hw->wiphy), | 765 | (unsigned long long) info->basic_rates); |
773 | (unsigned long long) info->basic_rates); | ||
774 | } | 766 | } |
775 | } | 767 | } |
776 | 768 | ||
@@ -824,10 +816,11 @@ static int mac80211_hwsim_conf_tx( | |||
824 | struct ieee80211_hw *hw, u16 queue, | 816 | struct ieee80211_hw *hw, u16 queue, |
825 | const struct ieee80211_tx_queue_params *params) | 817 | const struct ieee80211_tx_queue_params *params) |
826 | { | 818 | { |
827 | printk(KERN_DEBUG "%s:%s (queue=%d txop=%d cw_min=%d cw_max=%d " | 819 | wiphy_debug(hw->wiphy, |
828 | "aifs=%d)\n", | 820 | "%s (queue=%d txop=%d cw_min=%d cw_max=%d aifs=%d)\n", |
829 | wiphy_name(hw->wiphy), __func__, queue, | 821 | __func__, queue, |
830 | params->txop, params->cw_min, params->cw_max, params->aifs); | 822 | params->txop, params->cw_min, |
823 | params->cw_max, params->aifs); | ||
831 | return 0; | 824 | return 0; |
832 | } | 825 | } |
833 | 826 | ||
@@ -837,8 +830,7 @@ static int mac80211_hwsim_get_survey( | |||
837 | { | 830 | { |
838 | struct ieee80211_conf *conf = &hw->conf; | 831 | struct ieee80211_conf *conf = &hw->conf; |
839 | 832 | ||
840 | printk(KERN_DEBUG "%s:%s (idx=%d)\n", | 833 | wiphy_debug(hw->wiphy, "%s (idx=%d)\n", __func__, idx); |
841 | wiphy_name(hw->wiphy), __func__, idx); | ||
842 | 834 | ||
843 | if (idx != 0) | 835 | if (idx != 0) |
844 | return -ENOENT; | 836 | return -ENOENT; |
@@ -1108,8 +1100,9 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif) | |||
1108 | if (!vp->assoc) | 1100 | if (!vp->assoc) |
1109 | return; | 1101 | return; |
1110 | 1102 | ||
1111 | printk(KERN_DEBUG "%s:%s: send PS-Poll to %pM for aid %d\n", | 1103 | wiphy_debug(data->hw->wiphy, |
1112 | wiphy_name(data->hw->wiphy), __func__, vp->bssid, vp->aid); | 1104 | "%s: send PS-Poll to %pM for aid %d\n", |
1105 | __func__, vp->bssid, vp->aid); | ||
1113 | 1106 | ||
1114 | skb = dev_alloc_skb(sizeof(*pspoll)); | 1107 | skb = dev_alloc_skb(sizeof(*pspoll)); |
1115 | if (!skb) | 1108 | if (!skb) |
@@ -1137,8 +1130,9 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac, | |||
1137 | if (!vp->assoc) | 1130 | if (!vp->assoc) |
1138 | return; | 1131 | return; |
1139 | 1132 | ||
1140 | printk(KERN_DEBUG "%s:%s: send data::nullfunc to %pM ps=%d\n", | 1133 | wiphy_debug(data->hw->wiphy, |
1141 | wiphy_name(data->hw->wiphy), __func__, vp->bssid, ps); | 1134 | "%s: send data::nullfunc to %pM ps=%d\n", |
1135 | __func__, vp->bssid, ps); | ||
1142 | 1136 | ||
1143 | skb = dev_alloc_skb(sizeof(*hdr)); | 1137 | skb = dev_alloc_skb(sizeof(*hdr)); |
1144 | if (!skb) | 1138 | if (!skb) |
@@ -1473,9 +1467,8 @@ static int __init init_mac80211_hwsim(void) | |||
1473 | break; | 1467 | break; |
1474 | } | 1468 | } |
1475 | 1469 | ||
1476 | printk(KERN_DEBUG "%s: hwaddr %pM registered\n", | 1470 | wiphy_debug(hw->wiphy, "hwaddr %pm registered\n", |
1477 | wiphy_name(hw->wiphy), | 1471 | hw->wiphy->perm_addr); |
1478 | hw->wiphy->perm_addr); | ||
1479 | 1472 | ||
1480 | data->debugfs = debugfs_create_dir("hwsim", | 1473 | data->debugfs = debugfs_create_dir("hwsim", |
1481 | hw->wiphy->debugfsdir); | 1474 | hw->wiphy->debugfsdir); |