[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index b79dabc..6cea311 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -459,6 +459,7 @@
int index = IWL_INVALID_STATION;
struct iwl_station_entry *station;
unsigned long flags_spin;
+ DECLARE_MAC_BUF(mac);
spin_lock_irqsave(&priv->sta_lock, flags_spin);
if (is_ap)
@@ -493,7 +494,7 @@
}
- IWL_DEBUG_ASSOC("Add STA ID %d: " MAC_FMT "\n", index, MAC_ARG(addr));
+ IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr));
station = &priv->stations[index];
station->used = 1;
priv->num_stations++;
@@ -1083,6 +1084,7 @@
{
/* cast away the const for active_rxon in this function */
struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
+ DECLARE_MAC_BUF(mac);
int rc = 0;
if (!iwl_is_alive(priv))
@@ -1160,11 +1162,11 @@
IWL_DEBUG_INFO("Sending RXON\n"
"* with%s RXON_FILTER_ASSOC_MSK\n"
"* channel = %d\n"
- "* bssid = " MAC_FMT "\n",
+ "* bssid = %s\n",
((priv->staging_rxon.filter_flags &
RXON_FILTER_ASSOC_MSK) ? "" : "out"),
le16_to_cpu(priv->staging_rxon.channel),
- MAC_ARG(priv->staging_rxon.bssid_addr));
+ print_mac(mac, priv->staging_rxon.bssid_addr));
/* Apply the new configuration */
rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
@@ -2748,6 +2750,7 @@
{
int sta_id;
u16 fc = le16_to_cpu(hdr->frame_control);
+ DECLARE_MAC_BUF(mac);
/* If this frame is broadcast or not data then use the broadcast
* station id */
@@ -2781,9 +2784,9 @@
if (sta_id != IWL_INVALID_STATION)
return sta_id;
- IWL_DEBUG_DROP("Station " MAC_FMT " not in station map. "
+ IWL_DEBUG_DROP("Station %s not in station map. "
"Defaulting to broadcast...\n",
- MAC_ARG(hdr->addr1));
+ print_mac(mac, hdr->addr1));
iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
return priv->hw_setting.bcast_sta_id;
@@ -2859,8 +2862,10 @@
hdr_len = ieee80211_get_hdrlen(fc);
sta_id = iwl_get_sta_id(priv, hdr);
if (sta_id == IWL_INVALID_STATION) {
- IWL_DEBUG_DROP("Dropping - INVALID STATION: " MAC_FMT "\n",
- MAC_ARG(hdr->addr1));
+ DECLARE_MAC_BUF(mac);
+
+ IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
+ print_mac(mac, hdr->addr1));
goto drop;
}
@@ -4703,6 +4708,8 @@
#ifdef CONFIG_IWLWIFI_DEBUG
static void iwl_print_rx_config_cmd(struct iwl_rxon_cmd *rxon)
{
+ DECLARE_MAC_BUF(mac);
+
IWL_DEBUG_RADIO("RX CONFIG:\n");
iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
@@ -4713,10 +4720,10 @@
IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
rxon->ofdm_basic_rates);
IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
- IWL_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n",
- MAC_ARG(rxon->node_addr));
- IWL_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n",
- MAC_ARG(rxon->bssid_addr));
+ IWL_DEBUG_RADIO("u8[6] node_addr: %s\n",
+ print_mac(mac, rxon->node_addr));
+ IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
+ print_mac(mac, rxon->bssid_addr));
IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
}
#endif
@@ -6670,6 +6677,7 @@
static int __iwl_up(struct iwl_priv *priv)
{
+ DECLARE_MAC_BUF(mac);
int rc, i;
u32 hw_rf_kill = 0;
@@ -6742,8 +6750,8 @@
/* MAC Address location in EEPROM same for 3945/4965 */
get_eeprom_mac(priv, priv->mac_addr);
- IWL_DEBUG_INFO("MAC address: " MAC_FMT "\n",
- MAC_ARG(priv->mac_addr));
+ IWL_DEBUG_INFO("MAC address: %s\n",
+ print_mac(mac, priv->mac_addr));
SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
@@ -7096,14 +7104,16 @@
int rc = 0;
struct ieee80211_conf *conf = NULL;
+ DECLARE_MAC_BUF(mac);
if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
return;
}
- IWL_DEBUG_ASSOC("Associated as %d to: " MAC_FMT "\n",
- priv->assoc_id, MAC_ARG(priv->active_rxon.bssid_addr));
+ IWL_DEBUG_ASSOC("Associated as %d to: %s\n",
+ priv->assoc_id,
+ print_mac(mac, priv->active_rxon.bssid_addr));
if (test_bit(STATUS_EXIT_PENDING, &priv->status))
@@ -7299,11 +7309,12 @@
{
struct iwl_priv *priv = hw->priv;
unsigned long flags;
+ DECLARE_MAC_BUF(mac);
IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
if (conf->mac_addr)
- IWL_DEBUG_MAC80211("enter: MAC " MAC_FMT "\n",
- MAC_ARG(conf->mac_addr));
+ IWL_DEBUG_MAC80211("enter: MAC %s\n",
+ print_mac(mac, conf->mac_addr));
if (priv->interface_id) {
IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
@@ -7494,6 +7505,7 @@
struct ieee80211_if_conf *conf)
{
struct iwl_priv *priv = hw->priv;
+ DECLARE_MAC_BUF(mac);
unsigned long flags;
int rc;
@@ -7511,8 +7523,8 @@
IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
if (conf->bssid)
- IWL_DEBUG_MAC80211("bssid: " MAC_FMT "\n",
- MAC_ARG(conf->bssid));
+ IWL_DEBUG_MAC80211("bssid: %s\n",
+ print_mac(mac, conf->bssid));
if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) &&
!(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
@@ -7531,8 +7543,8 @@
if (!conf->bssid) {
conf->bssid = priv->mac_addr;
memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
- IWL_DEBUG_MAC80211("bssid was set to: " MAC_FMT "\n",
- MAC_ARG(conf->bssid));
+ IWL_DEBUG_MAC80211("bssid was set to: %s\n",
+ print_mac(mac, conf->bssid));
}
if (priv->ibss_beacon)
dev_kfree_skb(priv->ibss_beacon);
@@ -7666,6 +7678,7 @@
struct ieee80211_key_conf *key)
{
struct iwl_priv *priv = hw->priv;
+ DECLARE_MAC_BUF(mac);
int rc = 0;
u8 sta_id;
@@ -7682,8 +7695,8 @@
sta_id = iwl_hw_find_station(priv, addr);
if (sta_id == IWL_INVALID_STATION) {
- IWL_DEBUG_MAC80211("leave - " MAC_FMT " not in station map.\n",
- MAC_ARG(addr));
+ IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
+ print_mac(mac, addr));
return -EINVAL;
}