net/wireless: Use pr_<level> and netdev_<level>
No change in output for pr_<level> prefixes. netdev_<level> output is different, arguably improved. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
d7a066c923
commit
e9c0268f02
@@ -4,6 +4,8 @@
|
|||||||
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
|
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
@@ -216,8 +218,7 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
|
|||||||
rdev->wiphy.debugfsdir,
|
rdev->wiphy.debugfsdir,
|
||||||
rdev->wiphy.debugfsdir->d_parent,
|
rdev->wiphy.debugfsdir->d_parent,
|
||||||
newname))
|
newname))
|
||||||
printk(KERN_ERR "cfg80211: failed to rename debugfs dir to %s!\n",
|
pr_err("failed to rename debugfs dir to %s!\n", newname);
|
||||||
newname);
|
|
||||||
|
|
||||||
nl80211_notify_dev_rename(rdev);
|
nl80211_notify_dev_rename(rdev);
|
||||||
|
|
||||||
@@ -699,8 +700,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
|
|||||||
|
|
||||||
if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
|
if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
|
||||||
"phy80211")) {
|
"phy80211")) {
|
||||||
printk(KERN_ERR "wireless: failed to add phy80211 "
|
pr_err("failed to add phy80211 symlink to netdev!\n");
|
||||||
"symlink to netdev!\n");
|
|
||||||
}
|
}
|
||||||
wdev->netdev = dev;
|
wdev->netdev = dev;
|
||||||
wdev->sme_state = CFG80211_SME_IDLE;
|
wdev->sme_state = CFG80211_SME_IDLE;
|
||||||
|
@@ -13,6 +13,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <linux/ieee80211.h>
|
#include <linux/ieee80211.h>
|
||||||
@@ -224,8 +226,8 @@ int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
found:
|
found:
|
||||||
printk(KERN_DEBUG "lib80211_crypt: unregistered algorithm "
|
printk(KERN_DEBUG "lib80211_crypt: unregistered algorithm '%s'\n",
|
||||||
"'%s'\n", ops->name);
|
ops->name);
|
||||||
list_del(&alg->list);
|
list_del(&alg->list);
|
||||||
spin_unlock_irqrestore(&lib80211_crypto_lock, flags);
|
spin_unlock_irqrestore(&lib80211_crypto_lock, flags);
|
||||||
kfree(alg);
|
kfree(alg);
|
||||||
@@ -270,7 +272,7 @@ static struct lib80211_crypto_ops lib80211_crypt_null = {
|
|||||||
|
|
||||||
static int __init lib80211_init(void)
|
static int __init lib80211_init(void)
|
||||||
{
|
{
|
||||||
printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION "\n");
|
pr_info(DRV_DESCRIPTION "\n");
|
||||||
return lib80211_register_crypto_ops(&lib80211_crypt_null);
|
return lib80211_register_crypto_ops(&lib80211_crypt_null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
* more details.
|
* more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -99,8 +101,7 @@ static void *lib80211_tkip_init(int key_idx)
|
|||||||
priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
|
priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
|
||||||
CRYPTO_ALG_ASYNC);
|
CRYPTO_ALG_ASYNC);
|
||||||
if (IS_ERR(priv->tx_tfm_arc4)) {
|
if (IS_ERR(priv->tx_tfm_arc4)) {
|
||||||
printk(KERN_DEBUG "lib80211_crypt_tkip: could not allocate "
|
printk(KERN_DEBUG pr_fmt("could not allocate crypto API arc4\n"));
|
||||||
"crypto API arc4\n");
|
|
||||||
priv->tx_tfm_arc4 = NULL;
|
priv->tx_tfm_arc4 = NULL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -108,8 +109,7 @@ static void *lib80211_tkip_init(int key_idx)
|
|||||||
priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
|
priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
|
||||||
CRYPTO_ALG_ASYNC);
|
CRYPTO_ALG_ASYNC);
|
||||||
if (IS_ERR(priv->tx_tfm_michael)) {
|
if (IS_ERR(priv->tx_tfm_michael)) {
|
||||||
printk(KERN_DEBUG "lib80211_crypt_tkip: could not allocate "
|
printk(KERN_DEBUG pr_fmt("could not allocate crypto API michael_mic\n"));
|
||||||
"crypto API michael_mic\n");
|
|
||||||
priv->tx_tfm_michael = NULL;
|
priv->tx_tfm_michael = NULL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -117,8 +117,7 @@ static void *lib80211_tkip_init(int key_idx)
|
|||||||
priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
|
priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
|
||||||
CRYPTO_ALG_ASYNC);
|
CRYPTO_ALG_ASYNC);
|
||||||
if (IS_ERR(priv->rx_tfm_arc4)) {
|
if (IS_ERR(priv->rx_tfm_arc4)) {
|
||||||
printk(KERN_DEBUG "lib80211_crypt_tkip: could not allocate "
|
printk(KERN_DEBUG pr_fmt("could not allocate crypto API arc4\n"));
|
||||||
"crypto API arc4\n");
|
|
||||||
priv->rx_tfm_arc4 = NULL;
|
priv->rx_tfm_arc4 = NULL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -126,8 +125,7 @@ static void *lib80211_tkip_init(int key_idx)
|
|||||||
priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
|
priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
|
||||||
CRYPTO_ALG_ASYNC);
|
CRYPTO_ALG_ASYNC);
|
||||||
if (IS_ERR(priv->rx_tfm_michael)) {
|
if (IS_ERR(priv->rx_tfm_michael)) {
|
||||||
printk(KERN_DEBUG "lib80211_crypt_tkip: could not allocate "
|
printk(KERN_DEBUG pr_fmt("could not allocate crypto API michael_mic\n"));
|
||||||
"crypto API michael_mic\n");
|
|
||||||
priv->rx_tfm_michael = NULL;
|
priv->rx_tfm_michael = NULL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -536,7 +534,7 @@ static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,
|
|||||||
struct scatterlist sg[2];
|
struct scatterlist sg[2];
|
||||||
|
|
||||||
if (tfm_michael == NULL) {
|
if (tfm_michael == NULL) {
|
||||||
printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n");
|
pr_warn("%s(): tfm_michael == NULL\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
sg_init_table(sg, 2);
|
sg_init_table(sg, 2);
|
||||||
|
@@ -32,6 +32,9 @@
|
|||||||
* rely on some SHA1 checksum of the regdomain for example.
|
* rely on some SHA1 checksum of the regdomain for example.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
@@ -48,7 +51,7 @@
|
|||||||
#ifdef CONFIG_CFG80211_REG_DEBUG
|
#ifdef CONFIG_CFG80211_REG_DEBUG
|
||||||
#define REG_DBG_PRINT(format, args...) \
|
#define REG_DBG_PRINT(format, args...) \
|
||||||
do { \
|
do { \
|
||||||
printk(KERN_DEBUG "cfg80211: " format , ## args); \
|
printk(KERN_DEBUG pr_fmt(format), ##args); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define REG_DBG_PRINT(args...)
|
#define REG_DBG_PRINT(args...)
|
||||||
@@ -370,11 +373,10 @@ static int call_crda(const char *alpha2)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!is_world_regdom((char *) alpha2))
|
if (!is_world_regdom((char *) alpha2))
|
||||||
printk(KERN_INFO "cfg80211: Calling CRDA for country: %c%c\n",
|
pr_info("Calling CRDA for country: %c%c\n",
|
||||||
alpha2[0], alpha2[1]);
|
alpha2[0], alpha2[1]);
|
||||||
else
|
else
|
||||||
printk(KERN_INFO "cfg80211: Calling CRDA to update world "
|
pr_info("Calling CRDA to update world regulatory domain\n");
|
||||||
"regulatory domain\n");
|
|
||||||
|
|
||||||
/* query internal regulatory database (if it exists) */
|
/* query internal regulatory database (if it exists) */
|
||||||
reg_regdb_query(alpha2);
|
reg_regdb_query(alpha2);
|
||||||
@@ -1851,8 +1853,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
|
|||||||
const struct ieee80211_freq_range *freq_range = NULL;
|
const struct ieee80211_freq_range *freq_range = NULL;
|
||||||
const struct ieee80211_power_rule *power_rule = NULL;
|
const struct ieee80211_power_rule *power_rule = NULL;
|
||||||
|
|
||||||
printk(KERN_INFO " (start_freq - end_freq @ bandwidth), "
|
pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");
|
||||||
"(max_antenna_gain, max_eirp)\n");
|
|
||||||
|
|
||||||
for (i = 0; i < rd->n_reg_rules; i++) {
|
for (i = 0; i < rd->n_reg_rules; i++) {
|
||||||
reg_rule = &rd->reg_rules[i];
|
reg_rule = &rd->reg_rules[i];
|
||||||
@@ -1864,16 +1865,14 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
|
|||||||
* in certain regions
|
* in certain regions
|
||||||
*/
|
*/
|
||||||
if (power_rule->max_antenna_gain)
|
if (power_rule->max_antenna_gain)
|
||||||
printk(KERN_INFO " (%d KHz - %d KHz @ %d KHz), "
|
pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
|
||||||
"(%d mBi, %d mBm)\n",
|
|
||||||
freq_range->start_freq_khz,
|
freq_range->start_freq_khz,
|
||||||
freq_range->end_freq_khz,
|
freq_range->end_freq_khz,
|
||||||
freq_range->max_bandwidth_khz,
|
freq_range->max_bandwidth_khz,
|
||||||
power_rule->max_antenna_gain,
|
power_rule->max_antenna_gain,
|
||||||
power_rule->max_eirp);
|
power_rule->max_eirp);
|
||||||
else
|
else
|
||||||
printk(KERN_INFO " (%d KHz - %d KHz @ %d KHz), "
|
pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
|
||||||
"(N/A, %d mBm)\n",
|
|
||||||
freq_range->start_freq_khz,
|
freq_range->start_freq_khz,
|
||||||
freq_range->end_freq_khz,
|
freq_range->end_freq_khz,
|
||||||
freq_range->max_bandwidth_khz,
|
freq_range->max_bandwidth_khz,
|
||||||
@@ -1892,27 +1891,20 @@ static void print_regdomain(const struct ieee80211_regdomain *rd)
|
|||||||
rdev = cfg80211_rdev_by_wiphy_idx(
|
rdev = cfg80211_rdev_by_wiphy_idx(
|
||||||
last_request->wiphy_idx);
|
last_request->wiphy_idx);
|
||||||
if (rdev) {
|
if (rdev) {
|
||||||
printk(KERN_INFO "cfg80211: Current regulatory "
|
pr_info("Current regulatory domain updated by AP to: %c%c\n",
|
||||||
"domain updated by AP to: %c%c\n",
|
|
||||||
rdev->country_ie_alpha2[0],
|
rdev->country_ie_alpha2[0],
|
||||||
rdev->country_ie_alpha2[1]);
|
rdev->country_ie_alpha2[1]);
|
||||||
} else
|
} else
|
||||||
printk(KERN_INFO "cfg80211: Current regulatory "
|
pr_info("Current regulatory domain intersected:\n");
|
||||||
"domain intersected:\n");
|
|
||||||
} else
|
} else
|
||||||
printk(KERN_INFO "cfg80211: Current regulatory "
|
pr_info("Current regulatory domain intersected:\n");
|
||||||
"domain intersected:\n");
|
|
||||||
} else if (is_world_regdom(rd->alpha2))
|
} else if (is_world_regdom(rd->alpha2))
|
||||||
printk(KERN_INFO "cfg80211: World regulatory "
|
pr_info("World regulatory domain updated:\n");
|
||||||
"domain updated:\n");
|
|
||||||
else {
|
else {
|
||||||
if (is_unknown_alpha2(rd->alpha2))
|
if (is_unknown_alpha2(rd->alpha2))
|
||||||
printk(KERN_INFO "cfg80211: Regulatory domain "
|
pr_info("Regulatory domain changed to driver built-in settings (unknown country)\n");
|
||||||
"changed to driver built-in settings "
|
|
||||||
"(unknown country)\n");
|
|
||||||
else
|
else
|
||||||
printk(KERN_INFO "cfg80211: Regulatory domain "
|
pr_info("Regulatory domain changed to country: %c%c\n",
|
||||||
"changed to country: %c%c\n",
|
|
||||||
rd->alpha2[0], rd->alpha2[1]);
|
rd->alpha2[0], rd->alpha2[1]);
|
||||||
}
|
}
|
||||||
print_rd_rules(rd);
|
print_rd_rules(rd);
|
||||||
@@ -1920,8 +1912,7 @@ static void print_regdomain(const struct ieee80211_regdomain *rd)
|
|||||||
|
|
||||||
static void print_regdomain_info(const struct ieee80211_regdomain *rd)
|
static void print_regdomain_info(const struct ieee80211_regdomain *rd)
|
||||||
{
|
{
|
||||||
printk(KERN_INFO "cfg80211: Regulatory domain: %c%c\n",
|
pr_info("Regulatory domain: %c%c\n", rd->alpha2[0], rd->alpha2[1]);
|
||||||
rd->alpha2[0], rd->alpha2[1]);
|
|
||||||
print_rd_rules(rd);
|
print_rd_rules(rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1972,8 +1963,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!is_valid_rd(rd)) {
|
if (!is_valid_rd(rd)) {
|
||||||
printk(KERN_ERR "cfg80211: Invalid "
|
pr_err("Invalid regulatory domain detected:\n");
|
||||||
"regulatory domain detected:\n");
|
|
||||||
print_regdomain_info(rd);
|
print_regdomain_info(rd);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -2147,8 +2137,7 @@ int __init regulatory_init(void)
|
|||||||
* early boot for call_usermodehelper(). For now treat these
|
* early boot for call_usermodehelper(). For now treat these
|
||||||
* errors as non-fatal.
|
* errors as non-fatal.
|
||||||
*/
|
*/
|
||||||
printk(KERN_ERR "cfg80211: kobject_uevent_env() was unable "
|
pr_err("kobject_uevent_env() was unable to call CRDA during init\n");
|
||||||
"to call CRDA during init");
|
|
||||||
#ifdef CONFIG_CFG80211_REG_DEBUG
|
#ifdef CONFIG_CFG80211_REG_DEBUG
|
||||||
/* We want to find out exactly why when debugging */
|
/* We want to find out exactly why when debugging */
|
||||||
WARN_ON(err);
|
WARN_ON(err);
|
||||||
|
@@ -502,7 +502,7 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
|
|||||||
skb_orphan(skb);
|
skb_orphan(skb);
|
||||||
|
|
||||||
if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC)) {
|
if (pskb_expand_head(skb, head_need, 0, GFP_ATOMIC)) {
|
||||||
printk(KERN_ERR "failed to reallocate Tx buffer\n");
|
pr_err("failed to reallocate Tx buffer\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
skb->truesize += head_need;
|
skb->truesize += head_need;
|
||||||
@@ -685,20 +685,17 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
|
|||||||
continue;
|
continue;
|
||||||
if (rdev->ops->add_key(wdev->wiphy, dev, i, false, NULL,
|
if (rdev->ops->add_key(wdev->wiphy, dev, i, false, NULL,
|
||||||
&wdev->connect_keys->params[i])) {
|
&wdev->connect_keys->params[i])) {
|
||||||
printk(KERN_ERR "%s: failed to set key %d\n",
|
netdev_err(dev, "failed to set key %d\n", i);
|
||||||
dev->name, i);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (wdev->connect_keys->def == i)
|
if (wdev->connect_keys->def == i)
|
||||||
if (rdev->ops->set_default_key(wdev->wiphy, dev, i)) {
|
if (rdev->ops->set_default_key(wdev->wiphy, dev, i)) {
|
||||||
printk(KERN_ERR "%s: failed to set defkey %d\n",
|
netdev_err(dev, "failed to set defkey %d\n", i);
|
||||||
dev->name, i);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (wdev->connect_keys->defmgmt == i)
|
if (wdev->connect_keys->defmgmt == i)
|
||||||
if (rdev->ops->set_default_mgmt_key(wdev->wiphy, dev, i))
|
if (rdev->ops->set_default_mgmt_key(wdev->wiphy, dev, i))
|
||||||
printk(KERN_ERR "%s: failed to set mgtdef %d\n",
|
netdev_err(dev, "failed to set mgtdef %d\n", i);
|
||||||
dev->name, i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(wdev->connect_keys);
|
kfree(wdev->connect_keys);
|
||||||
|
@@ -467,8 +467,8 @@ void wireless_send_event(struct net_device * dev,
|
|||||||
* The best the driver could do is to log an error message.
|
* The best the driver could do is to log an error message.
|
||||||
* We will do it ourselves instead...
|
* We will do it ourselves instead...
|
||||||
*/
|
*/
|
||||||
printk(KERN_ERR "%s (WE) : Invalid/Unknown Wireless Event (0x%04X)\n",
|
netdev_err(dev, "(WE) : Invalid/Unknown Wireless Event (0x%04X)\n",
|
||||||
dev->name, cmd);
|
cmd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,11 +476,13 @@ void wireless_send_event(struct net_device * dev,
|
|||||||
if (descr->header_type == IW_HEADER_TYPE_POINT) {
|
if (descr->header_type == IW_HEADER_TYPE_POINT) {
|
||||||
/* Check if number of token fits within bounds */
|
/* Check if number of token fits within bounds */
|
||||||
if (wrqu->data.length > descr->max_tokens) {
|
if (wrqu->data.length > descr->max_tokens) {
|
||||||
printk(KERN_ERR "%s (WE) : Wireless Event too big (%d)\n", dev->name, wrqu->data.length);
|
netdev_err(dev, "(WE) : Wireless Event too big (%d)\n",
|
||||||
|
wrqu->data.length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wrqu->data.length < descr->min_tokens) {
|
if (wrqu->data.length < descr->min_tokens) {
|
||||||
printk(KERN_ERR "%s (WE) : Wireless Event too small (%d)\n", dev->name, wrqu->data.length);
|
netdev_err(dev, "(WE) : Wireless Event too small (%d)\n",
|
||||||
|
wrqu->data.length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Calculate extra_len - extra is NULL for restricted events */
|
/* Calculate extra_len - extra is NULL for restricted events */
|
||||||
|
Reference in New Issue
Block a user