diff options
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 6e7a9d853191..5556c5fe489a 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -728,6 +728,41 @@ static const char *reg_initiator_name(enum nl80211_reg_initiator initiator) | |||
728 | return "Set by bug"; | 728 | return "Set by bug"; |
729 | } | 729 | } |
730 | } | 730 | } |
731 | |||
732 | static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan, | ||
733 | u32 desired_bw_khz, | ||
734 | const struct ieee80211_reg_rule *reg_rule) | ||
735 | { | ||
736 | const struct ieee80211_power_rule *power_rule; | ||
737 | const struct ieee80211_freq_range *freq_range; | ||
738 | char max_antenna_gain[32]; | ||
739 | |||
740 | power_rule = ®_rule->power_rule; | ||
741 | freq_range = ®_rule->freq_range; | ||
742 | |||
743 | if (!power_rule->max_antenna_gain) | ||
744 | snprintf(max_antenna_gain, 32, "N/A"); | ||
745 | else | ||
746 | snprintf(max_antenna_gain, 32, "%d", power_rule->max_antenna_gain); | ||
747 | |||
748 | REG_DBG_PRINT("cfg80211: Updating information on frequency %d MHz " | ||
749 | "for %d a MHz width channel with regulatory rule:\n", | ||
750 | chan->center_freq, | ||
751 | KHZ_TO_MHZ(desired_bw_khz)); | ||
752 | |||
753 | REG_DBG_PRINT("cfg80211: %d KHz - %d KHz @ KHz), (%s mBi, %d mBm)\n", | ||
754 | freq_range->start_freq_khz, | ||
755 | freq_range->end_freq_khz, | ||
756 | max_antenna_gain, | ||
757 | power_rule->max_eirp); | ||
758 | } | ||
759 | #else | ||
760 | static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan, | ||
761 | u32 desired_bw_khz, | ||
762 | const struct ieee80211_reg_rule *reg_rule) | ||
763 | { | ||
764 | return; | ||
765 | } | ||
731 | #endif | 766 | #endif |
732 | 767 | ||
733 | /* | 768 | /* |
@@ -790,6 +825,8 @@ static void handle_channel(struct wiphy *wiphy, | |||
790 | return; | 825 | return; |
791 | } | 826 | } |
792 | 827 | ||
828 | chan_reg_rule_print_dbg(chan, desired_bw_khz, reg_rule); | ||
829 | |||
793 | power_rule = ®_rule->power_rule; | 830 | power_rule = ®_rule->power_rule; |
794 | freq_range = ®_rule->freq_range; | 831 | freq_range = ®_rule->freq_range; |
795 | 832 | ||
@@ -1134,6 +1171,8 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
1134 | return; | 1171 | return; |
1135 | } | 1172 | } |
1136 | 1173 | ||
1174 | chan_reg_rule_print_dbg(chan, desired_bw_khz, reg_rule); | ||
1175 | |||
1137 | power_rule = ®_rule->power_rule; | 1176 | power_rule = ®_rule->power_rule; |
1138 | freq_range = ®_rule->freq_range; | 1177 | freq_range = ®_rule->freq_range; |
1139 | 1178 | ||