Commit 0fb9a9ec authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

net/mac80211: Use wiphy_<level>

Standardize logging messages from
	printk(KERN_<level> "%s: " fmt , wiphy_name(foo), args);
to
	wiphy_<level>(foo, fmt, args);
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b62177a0
...@@ -1123,9 +1123,9 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy, ...@@ -1123,9 +1123,9 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
p.uapsd = false; p.uapsd = false;
if (drv_conf_tx(local, params->queue, &p)) { if (drv_conf_tx(local, params->queue, &p)) {
printk(KERN_DEBUG "%s: failed to set TX queue " wiphy_debug(local->hw.wiphy,
"parameters for queue %d\n", "failed to set TX queue parameters for queue %d\n",
wiphy_name(local->hw.wiphy), params->queue); params->queue);
return -EINVAL; return -EINVAL;
} }
......
...@@ -85,13 +85,15 @@ static ssize_t tsf_write(struct file *file, ...@@ -85,13 +85,15 @@ static ssize_t tsf_write(struct file *file,
if (strncmp(buf, "reset", 5) == 0) { if (strncmp(buf, "reset", 5) == 0) {
if (local->ops->reset_tsf) { if (local->ops->reset_tsf) {
drv_reset_tsf(local); drv_reset_tsf(local);
printk(KERN_INFO "%s: debugfs reset TSF\n", wiphy_name(local->hw.wiphy)); wiphy_info(local->hw.wiphy, "debugfs reset TSF\n");
} }
} else { } else {
tsf = simple_strtoul(buf, NULL, 0); tsf = simple_strtoul(buf, NULL, 0);
if (local->ops->set_tsf) { if (local->ops->set_tsf) {
drv_set_tsf(local, tsf); drv_set_tsf(local, tsf);
printk(KERN_INFO "%s: debugfs set TSF to %#018llx\n", wiphy_name(local->hw.wiphy), tsf); wiphy_info(local->hw.wiphy,
"debugfs set TSF to %#018llx\n", tsf);
} }
} }
......
...@@ -427,8 +427,8 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, ...@@ -427,8 +427,8 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
return NULL; return NULL;
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Adding new IBSS station %pM (dev=%s)\n", wiphy_debug(local->hw.wiphy, "Adding new IBSS station %pM (dev=%s)\n",
wiphy_name(local->hw.wiphy), addr, sdata->name); addr, sdata->name);
#endif #endif
sta = sta_info_alloc(sdata, addr, gfp); sta = sta_info_alloc(sdata, addr, gfp);
......
...@@ -1175,8 +1175,7 @@ static u32 ieee80211_idle_off(struct ieee80211_local *local, ...@@ -1175,8 +1175,7 @@ static u32 ieee80211_idle_off(struct ieee80211_local *local,
return 0; return 0;
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: device no longer idle - %s\n", wiphy_debug(local->hw.wiphy, "device no longer idle - %s\n", reason);
wiphy_name(local->hw.wiphy), reason);
#endif #endif
local->hw.conf.flags &= ~IEEE80211_CONF_IDLE; local->hw.conf.flags &= ~IEEE80211_CONF_IDLE;
...@@ -1189,8 +1188,7 @@ static u32 ieee80211_idle_on(struct ieee80211_local *local) ...@@ -1189,8 +1188,7 @@ static u32 ieee80211_idle_on(struct ieee80211_local *local)
return 0; return 0;
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: device now idle\n", wiphy_debug(local->hw.wiphy, "device now idle\n");
wiphy_name(local->hw.wiphy));
#endif #endif
drv_flush(local, false); drv_flush(local, false);
......
...@@ -87,10 +87,9 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key) ...@@ -87,10 +87,9 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP)
printk(KERN_ERR "mac80211-%s: failed to set key " wiphy_err(key->local->hw.wiphy,
"(%d, %pM) to hardware (%d)\n", "failed to set key (%d, %pM) to hardware (%d)\n",
wiphy_name(key->local->hw.wiphy), key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
} }
static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
...@@ -121,10 +120,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) ...@@ -121,10 +120,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
sta, &key->conf); sta, &key->conf);
if (ret) if (ret)
printk(KERN_ERR "mac80211-%s: failed to remove key " wiphy_err(key->local->hw.wiphy,
"(%d, %pM) from hardware (%d)\n", "failed to remove key (%d, %pM) from hardware (%d)\n",
wiphy_name(key->local->hw.wiphy), key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
} }
......
...@@ -713,16 +713,16 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -713,16 +713,16 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
result = ieee80211_wep_init(local); result = ieee80211_wep_init(local);
if (result < 0) if (result < 0)
printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n", wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
wiphy_name(local->hw.wiphy), result); result);
rtnl_lock(); rtnl_lock();
result = ieee80211_init_rate_ctrl_alg(local, result = ieee80211_init_rate_ctrl_alg(local,
hw->rate_control_algorithm); hw->rate_control_algorithm);
if (result < 0) { if (result < 0) {
printk(KERN_DEBUG "%s: Failed to initialize rate control " wiphy_debug(local->hw.wiphy,
"algorithm\n", wiphy_name(local->hw.wiphy)); "Failed to initialize rate control algorithm\n");
goto fail_rate; goto fail_rate;
} }
...@@ -731,8 +731,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -731,8 +731,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
result = ieee80211_if_add(local, "wlan%d", NULL, result = ieee80211_if_add(local, "wlan%d", NULL,
NL80211_IFTYPE_STATION, NULL); NL80211_IFTYPE_STATION, NULL);
if (result) if (result)
printk(KERN_WARNING "%s: Failed to add default virtual iface\n", wiphy_warn(local->hw.wiphy,
wiphy_name(local->hw.wiphy)); "Failed to add default virtual iface\n");
} }
rtnl_unlock(); rtnl_unlock();
...@@ -815,8 +815,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw) ...@@ -815,8 +815,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
if (skb_queue_len(&local->skb_queue) || if (skb_queue_len(&local->skb_queue) ||
skb_queue_len(&local->skb_queue_unreliable)) skb_queue_len(&local->skb_queue_unreliable))
printk(KERN_WARNING "%s: skb_queue not empty\n", wiphy_warn(local->hw.wiphy, "skb_queue not empty\n");
wiphy_name(local->hw.wiphy));
skb_queue_purge(&local->skb_queue); skb_queue_purge(&local->skb_queue);
skb_queue_purge(&local->skb_queue_unreliable); skb_queue_purge(&local->skb_queue_unreliable);
......
...@@ -778,16 +778,17 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local, ...@@ -778,16 +778,17 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
params.uapsd = uapsd; params.uapsd = uapsd;
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: WMM queue=%d aci=%d acm=%d aifs=%d " wiphy_debug(local->hw.wiphy,
"cWmin=%d cWmax=%d txop=%d uapsd=%d\n", "WMM queue=%d aci=%d acm=%d aifs=%d "
wiphy_name(local->hw.wiphy), queue, aci, acm, "cWmin=%d cWmax=%d txop=%d uapsd=%d\n",
params.aifs, params.cw_min, params.cw_max, params.txop, queue, aci, acm,
params.uapsd); params.aifs, params.cw_min, params.cw_max,
params.txop, params.uapsd);
#endif #endif
if (drv_conf_tx(local, queue, &params)) if (drv_conf_tx(local, queue, &params))
printk(KERN_DEBUG "%s: failed to set TX queue " wiphy_debug(local->hw.wiphy,
"parameters for queue %d\n", "failed to set TX queue parameters for queue %d\n",
wiphy_name(local->hw.wiphy), queue); queue);
} }
/* enable WMM or activate new settings */ /* enable WMM or activate new settings */
......
...@@ -366,8 +366,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, ...@@ -366,8 +366,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
ref = rate_control_alloc(name, local); ref = rate_control_alloc(name, local);
if (!ref) { if (!ref) {
printk(KERN_WARNING "%s: Failed to select rate control " wiphy_warn(local->hw.wiphy,
"algorithm\n", wiphy_name(local->hw.wiphy)); "Failed to select rate control algorithm\n");
return -ENOENT; return -ENOENT;
} }
...@@ -378,9 +378,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, ...@@ -378,9 +378,8 @@ int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
sta_info_flush(local, NULL); sta_info_flush(local, NULL);
} }
printk(KERN_DEBUG "%s: Selected rate control " wiphy_debug(local->hw.wiphy, "Selected rate control algorithm '%s'\n",
"algorithm '%s'\n", wiphy_name(local->hw.wiphy), ref->ops->name);
ref->ops->name);
return 0; return 0;
} }
......
...@@ -605,10 +605,8 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw, ...@@ -605,10 +605,8 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
#ifdef CONFIG_MAC80211_HT_DEBUG #ifdef CONFIG_MAC80211_HT_DEBUG
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_DEBUG "%s: release an RX reorder " wiphy_debug(hw->wiphy,
"frame due to timeout on earlier " "release an RX reorder frame due to timeout on earlier frames\n");
"frames\n",
wiphy_name(hw->wiphy));
#endif #endif
ieee80211_release_reorder_frame(hw, tid_agg_rx, ieee80211_release_reorder_frame(hw, tid_agg_rx,
j, frames); j, frames);
...@@ -2698,10 +2696,9 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, ...@@ -2698,10 +2696,9 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
skb_new = skb_copy(skb, GFP_ATOMIC); skb_new = skb_copy(skb, GFP_ATOMIC);
if (!skb_new) { if (!skb_new) {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_DEBUG "%s: failed to copy " wiphy_debug(local->hw.wiphy,
"multicast frame for %s\n", "failed to copy multicast frame for %s\n",
wiphy_name(local->hw.wiphy), prev->name);
prev->name);
goto next; goto next;
} }
ieee80211_invoke_rx_handlers(prev, &rx, skb_new); ieee80211_invoke_rx_handlers(prev, &rx, skb_new);
......
...@@ -174,8 +174,7 @@ static void __sta_info_free(struct ieee80211_local *local, ...@@ -174,8 +174,7 @@ static void __sta_info_free(struct ieee80211_local *local,
} }
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Destroyed STA %pM\n", wiphy_debug(local->hw.wiphy, "Destroyed STA %pM\n", sta->sta.addr);
wiphy_name(local->hw.wiphy), sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
kfree(sta); kfree(sta);
...@@ -262,8 +261,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -262,8 +261,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX); sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX);
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Allocated STA %pM\n", wiphy_debug(local->hw.wiphy, "Allocated STA %pM\n", sta->sta.addr);
wiphy_name(local->hw.wiphy), sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
...@@ -300,8 +298,9 @@ static int sta_info_finish_insert(struct sta_info *sta, bool async) ...@@ -300,8 +298,9 @@ static int sta_info_finish_insert(struct sta_info *sta, bool async)
sta->uploaded = true; sta->uploaded = true;
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
if (async) if (async)
printk(KERN_DEBUG "%s: Finished adding IBSS STA %pM\n", wiphy_debug(local->hw.wiphy,
wiphy_name(local->hw.wiphy), sta->sta.addr); "Finished adding IBSS STA %pM\n",
sta->sta.addr);
#endif #endif
} }
...@@ -411,8 +410,8 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) ...@@ -411,8 +410,8 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)
spin_unlock_irqrestore(&local->sta_lock, flags); spin_unlock_irqrestore(&local->sta_lock, flags);
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Added IBSS STA %pM\n", wiphy_debug(local->hw.wiphy, "Added IBSS STA %pM\n",
wiphy_name(local->hw.wiphy), sta->sta.addr); sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
ieee80211_queue_work(&local->hw, &local->sta_finish_work); ieee80211_queue_work(&local->hw, &local->sta_finish_work);
...@@ -459,8 +458,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) ...@@ -459,8 +458,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)
} }
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Inserted STA %pM\n", wiphy_debug(local->hw.wiphy, "Inserted STA %pM\n", sta->sta.addr);
wiphy_name(local->hw.wiphy), sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
/* move reference to rcu-protected */ /* move reference to rcu-protected */
...@@ -690,8 +688,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta) ...@@ -690,8 +688,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
#endif #endif
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Removed STA %pM\n", wiphy_debug(local->hw.wiphy, "Removed STA %pM\n", sta->sta.addr);
wiphy_name(local->hw.wiphy), sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
cancel_work_sync(&sta->drv_unblock_wk); cancel_work_sync(&sta->drv_unblock_wk);
......
...@@ -114,11 +114,10 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local, ...@@ -114,11 +114,10 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_DEBUG "%s: dropped TX filtered frame, " wiphy_debug(local->hw.wiphy,
"queue_len=%d PS=%d @%lu\n", "dropped TX filtered frame, queue_len=%d PS=%d @%lu\n",
wiphy_name(local->hw.wiphy), skb_queue_len(&sta->tx_filtered),
skb_queue_len(&sta->tx_filtered), !!test_sta_flags(sta, WLAN_STA_PS_STA), jiffies);
!!test_sta_flags(sta, WLAN_STA_PS_STA), jiffies);
#endif #endif
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
......
...@@ -351,8 +351,8 @@ static void purge_old_ps_buffers(struct ieee80211_local *local) ...@@ -351,8 +351,8 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
local->total_ps_buffered = total; local->total_ps_buffered = total;
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n", wiphy_debug(local->hw.wiphy, "PS buffers full - purged %d frames\n",
wiphy_name(local->hw.wiphy), purged); purged);
#endif #endif
} }
...@@ -1513,8 +1513,8 @@ static int ieee80211_skb_resize(struct ieee80211_local *local, ...@@ -1513,8 +1513,8 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
I802_DEBUG_INC(local->tx_expand_skb_head); I802_DEBUG_INC(local->tx_expand_skb_head);
if (pskb_expand_head(skb, head_need, tail_need, GFP_ATOMIC)) { if (pskb_expand_head(skb, head_need, tail_need, GFP_ATOMIC)) {
printk(KERN_DEBUG "%s: failed to reallocate TX buffer\n", wiphy_debug(local->hw.wiphy,
wiphy_name(local->hw.wiphy)); "failed to reallocate TX buffer\n");
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment