diff options
-rw-r--r-- | include/net/cfg80211.h | 37 | ||||
-rw-r--r-- | net/wireless/core.c | 49 |
2 files changed, 12 insertions, 74 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 4c8c727d0cca..a0613ff62c97 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -2558,49 +2558,36 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2558 | /* wiphy_printk helpers, similar to dev_printk */ | 2558 | /* wiphy_printk helpers, similar to dev_printk */ |
2559 | 2559 | ||
2560 | #define wiphy_printk(level, wiphy, format, args...) \ | 2560 | #define wiphy_printk(level, wiphy, format, args...) \ |
2561 | printk(level "%s: " format, wiphy_name(wiphy), ##args) | 2561 | dev_printk(level, &(wiphy)->dev, format, ##args) |
2562 | #define wiphy_emerg(wiphy, format, args...) \ | 2562 | #define wiphy_emerg(wiphy, format, args...) \ |
2563 | wiphy_printk(KERN_EMERG, wiphy, format, ##args) | 2563 | dev_emerg(&(wiphy)->dev, format, ##args) |
2564 | #define wiphy_alert(wiphy, format, args...) \ | 2564 | #define wiphy_alert(wiphy, format, args...) \ |
2565 | wiphy_printk(KERN_ALERT, wiphy, format, ##args) | 2565 | dev_alert(&(wiphy)->dev, format, ##args) |
2566 | #define wiphy_crit(wiphy, format, args...) \ | 2566 | #define wiphy_crit(wiphy, format, args...) \ |
2567 | wiphy_printk(KERN_CRIT, wiphy, format, ##args) | 2567 | dev_crit(&(wiphy)->dev, format, ##args) |
2568 | #define wiphy_err(wiphy, format, args...) \ | 2568 | #define wiphy_err(wiphy, format, args...) \ |
2569 | wiphy_printk(KERN_ERR, wiphy, format, ##args) | 2569 | dev_err(&(wiphy)->dev, format, ##args) |
2570 | #define wiphy_warn(wiphy, format, args...) \ | 2570 | #define wiphy_warn(wiphy, format, args...) \ |
2571 | wiphy_printk(KERN_WARNING, wiphy, format, ##args) | 2571 | dev_warn(&(wiphy)->dev, format, ##args) |
2572 | #define wiphy_notice(wiphy, format, args...) \ | 2572 | #define wiphy_notice(wiphy, format, args...) \ |
2573 | wiphy_printk(KERN_NOTICE, wiphy, format, ##args) | 2573 | dev_notice(&(wiphy)->dev, format, ##args) |
2574 | #define wiphy_info(wiphy, format, args...) \ | 2574 | #define wiphy_info(wiphy, format, args...) \ |
2575 | wiphy_printk(KERN_INFO, wiphy, format, ##args) | 2575 | dev_info(&(wiphy)->dev, format, ##args) |
2576 | 2576 | ||
2577 | int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | 2577 | #define wiphy_debug(wiphy, format, args...) \ |
2578 | __attribute__ ((format (printf, 2, 3))); | ||
2579 | |||
2580 | #if defined(DEBUG) | ||
2581 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2582 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) | 2578 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) |
2583 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 2579 | |
2584 | #define wiphy_dbg(wiphy, format, args...) \ | 2580 | #define wiphy_dbg(wiphy, format, args...) \ |
2585 | dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) | 2581 | dev_dbg(&(wiphy)->dev, format, ##args) |
2586 | #else | ||
2587 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2588 | ({ \ | ||
2589 | if (0) \ | ||
2590 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2591 | 0; \ | ||
2592 | }) | ||
2593 | #endif | ||
2594 | 2582 | ||
2595 | #if defined(VERBOSE_DEBUG) | 2583 | #if defined(VERBOSE_DEBUG) |
2596 | #define wiphy_vdbg wiphy_dbg | 2584 | #define wiphy_vdbg wiphy_dbg |
2597 | #else | 2585 | #else |
2598 | |||
2599 | #define wiphy_vdbg(wiphy, format, args...) \ | 2586 | #define wiphy_vdbg(wiphy, format, args...) \ |
2600 | ({ \ | 2587 | ({ \ |
2601 | if (0) \ | 2588 | if (0) \ |
2602 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | 2589 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ |
2603 | 0; \ | 2590 | 0; \ |
2604 | }) | 2591 | }) |
2605 | #endif | 2592 | #endif |
2606 | 2593 | ||
diff --git a/net/wireless/core.c b/net/wireless/core.c index d52630bbab04..b8191cf86226 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -912,52 +912,3 @@ static void __exit cfg80211_exit(void) | |||
912 | destroy_workqueue(cfg80211_wq); | 912 | destroy_workqueue(cfg80211_wq); |
913 | } | 913 | } |
914 | module_exit(cfg80211_exit); | 914 | module_exit(cfg80211_exit); |
915 | |||
916 | static int ___wiphy_printk(const char *level, const struct wiphy *wiphy, | ||
917 | struct va_format *vaf) | ||
918 | { | ||
919 | if (!wiphy) | ||
920 | return printk("%s(NULL wiphy *): %pV", level, vaf); | ||
921 | |||
922 | return printk("%s%s: %pV", level, wiphy_name(wiphy), vaf); | ||
923 | } | ||
924 | |||
925 | int __wiphy_printk(const char *level, const struct wiphy *wiphy, | ||
926 | const char *fmt, ...) | ||
927 | { | ||
928 | struct va_format vaf; | ||
929 | va_list args; | ||
930 | int r; | ||
931 | |||
932 | va_start(args, fmt); | ||
933 | |||
934 | vaf.fmt = fmt; | ||
935 | vaf.va = &args; | ||
936 | |||
937 | r = ___wiphy_printk(level, wiphy, &vaf); | ||
938 | va_end(args); | ||
939 | |||
940 | return r; | ||
941 | } | ||
942 | EXPORT_SYMBOL(__wiphy_printk); | ||
943 | |||
944 | #define define_wiphy_printk_level(func, kern_level) \ | ||
945 | int func(const struct wiphy *wiphy, const char *fmt, ...) \ | ||
946 | { \ | ||
947 | struct va_format vaf; \ | ||
948 | va_list args; \ | ||
949 | int r; \ | ||
950 | \ | ||
951 | va_start(args, fmt); \ | ||
952 | \ | ||
953 | vaf.fmt = fmt; \ | ||
954 | vaf.va = &args; \ | ||
955 | \ | ||
956 | r = ___wiphy_printk(kern_level, wiphy, &vaf); \ | ||
957 | va_end(args); \ | ||
958 | \ | ||
959 | return r; \ | ||
960 | } \ | ||
961 | EXPORT_SYMBOL(func); | ||
962 | |||
963 | define_wiphy_printk_level(wiphy_debug, KERN_DEBUG); | ||