diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-12-11 09:31:10 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-01-14 05:13:09 -0500 |
commit | c799ba6eab7a1bf02792e2ced933be3ae5f8daa2 (patch) | |
tree | 27e6847873914c708ef17ca8ecd2e248024e380a /net/wireless | |
parent | 725da8dee445662beea77d3f42c3f4c79f7a7a0e (diff) |
cfg80211: remove CFG80211_REG_DEBUG
Instead of having this Kconfig option, which just *floods* the
kernel log,
* remove the per-channel prints that are fairly useless anyway
* convert the conditional printing to pr_debug()
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/Kconfig | 13 | ||||
-rw-r--r-- | net/wireless/reg.c | 122 |
2 files changed, 34 insertions, 101 deletions
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index da72ed32f143..ec3bf30dd526 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -61,19 +61,6 @@ config CFG80211_DEVELOPER_WARNINGS | |||
61 | on it (or mac80211). | 61 | on it (or mac80211). |
62 | 62 | ||
63 | 63 | ||
64 | config CFG80211_REG_DEBUG | ||
65 | bool "cfg80211 regulatory debugging" | ||
66 | depends on CFG80211 | ||
67 | default n | ||
68 | ---help--- | ||
69 | You can enable this if you want to debug regulatory changes. | ||
70 | For more information on cfg80211 regulatory refer to the wireless | ||
71 | wiki: | ||
72 | |||
73 | http://wireless.kernel.org/en/developers/Regulatory | ||
74 | |||
75 | If unsure, say N. | ||
76 | |||
77 | config CFG80211_CERTIFICATION_ONUS | 64 | config CFG80211_CERTIFICATION_ONUS |
78 | bool "cfg80211 certification onus" | 65 | bool "cfg80211 certification onus" |
79 | depends on CFG80211 && EXPERT | 66 | depends on CFG80211 && EXPERT |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 3b0ce1c484a3..bc76b281ed3a 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -60,13 +60,6 @@ | |||
60 | #include "regdb.h" | 60 | #include "regdb.h" |
61 | #include "nl80211.h" | 61 | #include "nl80211.h" |
62 | 62 | ||
63 | #ifdef CONFIG_CFG80211_REG_DEBUG | ||
64 | #define REG_DBG_PRINT(format, args...) \ | ||
65 | printk(KERN_DEBUG pr_fmt(format), ##args) | ||
66 | #else | ||
67 | #define REG_DBG_PRINT(args...) | ||
68 | #endif | ||
69 | |||
70 | /* | 63 | /* |
71 | * Grace period we give before making sure all current interfaces reside on | 64 | * Grace period we give before making sure all current interfaces reside on |
72 | * channels allowed by the current regulatory domain. | 65 | * channels allowed by the current regulatory domain. |
@@ -178,12 +171,10 @@ enum nl80211_dfs_regions reg_get_dfs_region(struct wiphy *wiphy) | |||
178 | if (wiphy_regd->dfs_region == regd->dfs_region) | 171 | if (wiphy_regd->dfs_region == regd->dfs_region) |
179 | goto out; | 172 | goto out; |
180 | 173 | ||
181 | REG_DBG_PRINT("%s: device specific dfs_region " | 174 | pr_debug("%s: device specific dfs_region (%s) disagrees with cfg80211's central dfs_region (%s)\n", |
182 | "(%s) disagrees with cfg80211's " | 175 | dev_name(&wiphy->dev), |
183 | "central dfs_region (%s)\n", | 176 | reg_dfs_region_str(wiphy_regd->dfs_region), |
184 | dev_name(&wiphy->dev), | 177 | reg_dfs_region_str(regd->dfs_region)); |
185 | reg_dfs_region_str(wiphy_regd->dfs_region), | ||
186 | reg_dfs_region_str(regd->dfs_region)); | ||
187 | 178 | ||
188 | out: | 179 | out: |
189 | return regd->dfs_region; | 180 | return regd->dfs_region; |
@@ -541,7 +532,7 @@ static DECLARE_DELAYED_WORK(crda_timeout, crda_timeout_work); | |||
541 | 532 | ||
542 | static void crda_timeout_work(struct work_struct *work) | 533 | static void crda_timeout_work(struct work_struct *work) |
543 | { | 534 | { |
544 | REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); | 535 | pr_debug("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); |
545 | rtnl_lock(); | 536 | rtnl_lock(); |
546 | reg_crda_timeouts++; | 537 | reg_crda_timeouts++; |
547 | restore_regulatory_settings(true); | 538 | restore_regulatory_settings(true); |
@@ -583,7 +574,7 @@ static int call_crda(const char *alpha2) | |||
583 | 574 | ||
584 | if (!is_world_regdom((char *) alpha2)) | 575 | if (!is_world_regdom((char *) alpha2)) |
585 | pr_debug("Calling CRDA for country: %c%c\n", | 576 | pr_debug("Calling CRDA for country: %c%c\n", |
586 | alpha2[0], alpha2[1]); | 577 | alpha2[0], alpha2[1]); |
587 | else | 578 | else |
588 | pr_debug("Calling CRDA to update world regulatory domain\n"); | 579 | pr_debug("Calling CRDA to update world regulatory domain\n"); |
589 | 580 | ||
@@ -1130,42 +1121,6 @@ const char *reg_initiator_name(enum nl80211_reg_initiator initiator) | |||
1130 | } | 1121 | } |
1131 | EXPORT_SYMBOL(reg_initiator_name); | 1122 | EXPORT_SYMBOL(reg_initiator_name); |
1132 | 1123 | ||
1133 | static void chan_reg_rule_print_dbg(const struct ieee80211_regdomain *regd, | ||
1134 | struct ieee80211_channel *chan, | ||
1135 | const struct ieee80211_reg_rule *reg_rule) | ||
1136 | { | ||
1137 | #ifdef CONFIG_CFG80211_REG_DEBUG | ||
1138 | const struct ieee80211_power_rule *power_rule; | ||
1139 | const struct ieee80211_freq_range *freq_range; | ||
1140 | char max_antenna_gain[32], bw[32]; | ||
1141 | |||
1142 | power_rule = ®_rule->power_rule; | ||
1143 | freq_range = ®_rule->freq_range; | ||
1144 | |||
1145 | if (!power_rule->max_antenna_gain) | ||
1146 | snprintf(max_antenna_gain, sizeof(max_antenna_gain), "N/A"); | ||
1147 | else | ||
1148 | snprintf(max_antenna_gain, sizeof(max_antenna_gain), "%d mBi", | ||
1149 | power_rule->max_antenna_gain); | ||
1150 | |||
1151 | if (reg_rule->flags & NL80211_RRF_AUTO_BW) | ||
1152 | snprintf(bw, sizeof(bw), "%d KHz, %d KHz AUTO", | ||
1153 | freq_range->max_bandwidth_khz, | ||
1154 | reg_get_max_bandwidth(regd, reg_rule)); | ||
1155 | else | ||
1156 | snprintf(bw, sizeof(bw), "%d KHz", | ||
1157 | freq_range->max_bandwidth_khz); | ||
1158 | |||
1159 | REG_DBG_PRINT("Updating information on frequency %d MHz with regulatory rule:\n", | ||
1160 | chan->center_freq); | ||
1161 | |||
1162 | REG_DBG_PRINT("(%d KHz - %d KHz @ %s), (%s, %d mBm)\n", | ||
1163 | freq_range->start_freq_khz, freq_range->end_freq_khz, | ||
1164 | bw, max_antenna_gain, | ||
1165 | power_rule->max_eirp); | ||
1166 | #endif | ||
1167 | } | ||
1168 | |||
1169 | static uint32_t reg_rule_to_chan_bw_flags(const struct ieee80211_regdomain *regd, | 1124 | static uint32_t reg_rule_to_chan_bw_flags(const struct ieee80211_regdomain *regd, |
1170 | const struct ieee80211_reg_rule *reg_rule, | 1125 | const struct ieee80211_reg_rule *reg_rule, |
1171 | const struct ieee80211_channel *chan) | 1126 | const struct ieee80211_channel *chan) |
@@ -1240,20 +1195,19 @@ static void handle_channel(struct wiphy *wiphy, | |||
1240 | if (lr->initiator == NL80211_REGDOM_SET_BY_DRIVER && | 1195 | if (lr->initiator == NL80211_REGDOM_SET_BY_DRIVER && |
1241 | request_wiphy && request_wiphy == wiphy && | 1196 | request_wiphy && request_wiphy == wiphy && |
1242 | request_wiphy->regulatory_flags & REGULATORY_STRICT_REG) { | 1197 | request_wiphy->regulatory_flags & REGULATORY_STRICT_REG) { |
1243 | REG_DBG_PRINT("Disabling freq %d MHz for good\n", | 1198 | pr_debug("Disabling freq %d MHz for good\n", |
1244 | chan->center_freq); | 1199 | chan->center_freq); |
1245 | chan->orig_flags |= IEEE80211_CHAN_DISABLED; | 1200 | chan->orig_flags |= IEEE80211_CHAN_DISABLED; |
1246 | chan->flags = chan->orig_flags; | 1201 | chan->flags = chan->orig_flags; |
1247 | } else { | 1202 | } else { |
1248 | REG_DBG_PRINT("Disabling freq %d MHz\n", | 1203 | pr_debug("Disabling freq %d MHz\n", |
1249 | chan->center_freq); | 1204 | chan->center_freq); |
1250 | chan->flags |= IEEE80211_CHAN_DISABLED; | 1205 | chan->flags |= IEEE80211_CHAN_DISABLED; |
1251 | } | 1206 | } |
1252 | return; | 1207 | return; |
1253 | } | 1208 | } |
1254 | 1209 | ||
1255 | regd = reg_get_regdomain(wiphy); | 1210 | regd = reg_get_regdomain(wiphy); |
1256 | chan_reg_rule_print_dbg(regd, chan, reg_rule); | ||
1257 | 1211 | ||
1258 | power_rule = ®_rule->power_rule; | 1212 | power_rule = ®_rule->power_rule; |
1259 | bw_flags = reg_rule_to_chan_bw_flags(regd, reg_rule, chan); | 1213 | bw_flags = reg_rule_to_chan_bw_flags(regd, reg_rule, chan); |
@@ -1391,18 +1345,15 @@ static bool ignore_reg_update(struct wiphy *wiphy, | |||
1391 | return true; | 1345 | return true; |
1392 | 1346 | ||
1393 | if (!lr) { | 1347 | if (!lr) { |
1394 | REG_DBG_PRINT("Ignoring regulatory request set by %s " | 1348 | pr_debug("Ignoring regulatory request set by %s since last_request is not set\n", |
1395 | "since last_request is not set\n", | 1349 | reg_initiator_name(initiator)); |
1396 | reg_initiator_name(initiator)); | ||
1397 | return true; | 1350 | return true; |
1398 | } | 1351 | } |
1399 | 1352 | ||
1400 | if (initiator == NL80211_REGDOM_SET_BY_CORE && | 1353 | if (initiator == NL80211_REGDOM_SET_BY_CORE && |
1401 | wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { | 1354 | wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { |
1402 | REG_DBG_PRINT("Ignoring regulatory request set by %s " | 1355 | pr_debug("Ignoring regulatory request set by %s since the driver uses its own custom regulatory domain\n", |
1403 | "since the driver uses its own custom " | 1356 | reg_initiator_name(initiator)); |
1404 | "regulatory domain\n", | ||
1405 | reg_initiator_name(initiator)); | ||
1406 | return true; | 1357 | return true; |
1407 | } | 1358 | } |
1408 | 1359 | ||
@@ -1413,10 +1364,8 @@ static bool ignore_reg_update(struct wiphy *wiphy, | |||
1413 | if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd && | 1364 | if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd && |
1414 | initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | 1365 | initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && |
1415 | !is_world_regdom(lr->alpha2)) { | 1366 | !is_world_regdom(lr->alpha2)) { |
1416 | REG_DBG_PRINT("Ignoring regulatory request set by %s " | 1367 | pr_debug("Ignoring regulatory request set by %s since the driver requires its own regulatory domain to be set first\n", |
1417 | "since the driver requires its own regulatory " | 1368 | reg_initiator_name(initiator)); |
1418 | "domain to be set first\n", | ||
1419 | reg_initiator_name(initiator)); | ||
1420 | return true; | 1369 | return true; |
1421 | } | 1370 | } |
1422 | 1371 | ||
@@ -1697,7 +1646,7 @@ static void reg_check_chans_work(struct work_struct *work) | |||
1697 | { | 1646 | { |
1698 | struct cfg80211_registered_device *rdev; | 1647 | struct cfg80211_registered_device *rdev; |
1699 | 1648 | ||
1700 | REG_DBG_PRINT("Verifying active interfaces after reg change\n"); | 1649 | pr_debug("Verifying active interfaces after reg change\n"); |
1701 | rtnl_lock(); | 1650 | rtnl_lock(); |
1702 | 1651 | ||
1703 | list_for_each_entry(rdev, &cfg80211_rdev_list, list) | 1652 | list_for_each_entry(rdev, &cfg80211_rdev_list, list) |
@@ -1779,8 +1728,8 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
1779 | } | 1728 | } |
1780 | 1729 | ||
1781 | if (IS_ERR(reg_rule)) { | 1730 | if (IS_ERR(reg_rule)) { |
1782 | REG_DBG_PRINT("Disabling freq %d MHz as custom regd has no rule that fits it\n", | 1731 | pr_debug("Disabling freq %d MHz as custom regd has no rule that fits it\n", |
1783 | chan->center_freq); | 1732 | chan->center_freq); |
1784 | if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) { | 1733 | if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) { |
1785 | chan->flags |= IEEE80211_CHAN_DISABLED; | 1734 | chan->flags |= IEEE80211_CHAN_DISABLED; |
1786 | } else { | 1735 | } else { |
@@ -1790,8 +1739,6 @@ static void handle_channel_custom(struct wiphy *wiphy, | |||
1790 | return; | 1739 | return; |
1791 | } | 1740 | } |
1792 | 1741 | ||
1793 | chan_reg_rule_print_dbg(regd, chan, reg_rule); | ||
1794 | |||
1795 | power_rule = ®_rule->power_rule; | 1742 | power_rule = ®_rule->power_rule; |
1796 | bw_flags = reg_rule_to_chan_bw_flags(regd, reg_rule, chan); | 1743 | bw_flags = reg_rule_to_chan_bw_flags(regd, reg_rule, chan); |
1797 | 1744 | ||
@@ -2522,7 +2469,7 @@ static void restore_alpha2(char *alpha2, bool reset_user) | |||
2522 | if (is_user_regdom_saved()) { | 2469 | if (is_user_regdom_saved()) { |
2523 | /* Unless we're asked to ignore it and reset it */ | 2470 | /* Unless we're asked to ignore it and reset it */ |
2524 | if (reset_user) { | 2471 | if (reset_user) { |
2525 | REG_DBG_PRINT("Restoring regulatory settings including user preference\n"); | 2472 | pr_debug("Restoring regulatory settings including user preference\n"); |
2526 | user_alpha2[0] = '9'; | 2473 | user_alpha2[0] = '9'; |
2527 | user_alpha2[1] = '7'; | 2474 | user_alpha2[1] = '7'; |
2528 | 2475 | ||
@@ -2532,24 +2479,24 @@ static void restore_alpha2(char *alpha2, bool reset_user) | |||
2532 | * back as they were for a full restore. | 2479 | * back as they were for a full restore. |
2533 | */ | 2480 | */ |
2534 | if (!is_world_regdom(ieee80211_regdom)) { | 2481 | if (!is_world_regdom(ieee80211_regdom)) { |
2535 | REG_DBG_PRINT("Keeping preference on module parameter ieee80211_regdom: %c%c\n", | 2482 | pr_debug("Keeping preference on module parameter ieee80211_regdom: %c%c\n", |
2536 | ieee80211_regdom[0], ieee80211_regdom[1]); | 2483 | ieee80211_regdom[0], ieee80211_regdom[1]); |
2537 | alpha2[0] = ieee80211_regdom[0]; | 2484 | alpha2[0] = ieee80211_regdom[0]; |
2538 | alpha2[1] = ieee80211_regdom[1]; | 2485 | alpha2[1] = ieee80211_regdom[1]; |
2539 | } | 2486 | } |
2540 | } else { | 2487 | } else { |
2541 | REG_DBG_PRINT("Restoring regulatory settings while preserving user preference for: %c%c\n", | 2488 | pr_debug("Restoring regulatory settings while preserving user preference for: %c%c\n", |
2542 | user_alpha2[0], user_alpha2[1]); | 2489 | user_alpha2[0], user_alpha2[1]); |
2543 | alpha2[0] = user_alpha2[0]; | 2490 | alpha2[0] = user_alpha2[0]; |
2544 | alpha2[1] = user_alpha2[1]; | 2491 | alpha2[1] = user_alpha2[1]; |
2545 | } | 2492 | } |
2546 | } else if (!is_world_regdom(ieee80211_regdom)) { | 2493 | } else if (!is_world_regdom(ieee80211_regdom)) { |
2547 | REG_DBG_PRINT("Keeping preference on module parameter ieee80211_regdom: %c%c\n", | 2494 | pr_debug("Keeping preference on module parameter ieee80211_regdom: %c%c\n", |
2548 | ieee80211_regdom[0], ieee80211_regdom[1]); | 2495 | ieee80211_regdom[0], ieee80211_regdom[1]); |
2549 | alpha2[0] = ieee80211_regdom[0]; | 2496 | alpha2[0] = ieee80211_regdom[0]; |
2550 | alpha2[1] = ieee80211_regdom[1]; | 2497 | alpha2[1] = ieee80211_regdom[1]; |
2551 | } else | 2498 | } else |
2552 | REG_DBG_PRINT("Restoring regulatory settings\n"); | 2499 | pr_debug("Restoring regulatory settings\n"); |
2553 | } | 2500 | } |
2554 | 2501 | ||
2555 | static void restore_custom_reg_settings(struct wiphy *wiphy) | 2502 | static void restore_custom_reg_settings(struct wiphy *wiphy) |
@@ -2661,14 +2608,14 @@ static void restore_regulatory_settings(bool reset_user) | |||
2661 | list_splice_tail_init(&tmp_reg_req_list, ®_requests_list); | 2608 | list_splice_tail_init(&tmp_reg_req_list, ®_requests_list); |
2662 | spin_unlock(®_requests_lock); | 2609 | spin_unlock(®_requests_lock); |
2663 | 2610 | ||
2664 | REG_DBG_PRINT("Kicking the queue\n"); | 2611 | pr_debug("Kicking the queue\n"); |
2665 | 2612 | ||
2666 | schedule_work(®_work); | 2613 | schedule_work(®_work); |
2667 | } | 2614 | } |
2668 | 2615 | ||
2669 | void regulatory_hint_disconnect(void) | 2616 | void regulatory_hint_disconnect(void) |
2670 | { | 2617 | { |
2671 | REG_DBG_PRINT("All devices are disconnected, going to restore regulatory settings\n"); | 2618 | pr_debug("All devices are disconnected, going to restore regulatory settings\n"); |
2672 | restore_regulatory_settings(false); | 2619 | restore_regulatory_settings(false); |
2673 | } | 2620 | } |
2674 | 2621 | ||
@@ -2716,10 +2663,10 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy, | |||
2716 | if (!reg_beacon) | 2663 | if (!reg_beacon) |
2717 | return -ENOMEM; | 2664 | return -ENOMEM; |
2718 | 2665 | ||
2719 | REG_DBG_PRINT("Found new beacon on frequency: %d MHz (Ch %d) on %s\n", | 2666 | pr_debug("Found new beacon on frequency: %d MHz (Ch %d) on %s\n", |
2720 | beacon_chan->center_freq, | 2667 | beacon_chan->center_freq, |
2721 | ieee80211_frequency_to_channel(beacon_chan->center_freq), | 2668 | ieee80211_frequency_to_channel(beacon_chan->center_freq), |
2722 | wiphy_name(wiphy)); | 2669 | wiphy_name(wiphy)); |
2723 | 2670 | ||
2724 | memcpy(®_beacon->chan, beacon_chan, | 2671 | memcpy(®_beacon->chan, beacon_chan, |
2725 | sizeof(struct ieee80211_channel)); | 2672 | sizeof(struct ieee80211_channel)); |
@@ -2798,8 +2745,7 @@ bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region) | |||
2798 | case NL80211_DFS_JP: | 2745 | case NL80211_DFS_JP: |
2799 | return true; | 2746 | return true; |
2800 | default: | 2747 | default: |
2801 | REG_DBG_PRINT("Ignoring uknown DFS master region: %d\n", | 2748 | pr_debug("Ignoring uknown DFS master region: %d\n", dfs_region); |
2802 | dfs_region); | ||
2803 | return false; | 2749 | return false; |
2804 | } | 2750 | } |
2805 | } | 2751 | } |