aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2100.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 20:59:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:42 -0400
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /drivers/net/wireless/ipw2100.c
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff)
[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>
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
-rw-r--r--drivers/net/wireless/ipw2100.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index b3c07b93afce..2d46a16c0945 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1922,6 +1922,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1922 u32 chan; 1922 u32 chan;
1923 char *txratename; 1923 char *txratename;
1924 u8 bssid[ETH_ALEN]; 1924 u8 bssid[ETH_ALEN];
1925 DECLARE_MAC_BUF(mac);
1925 1926
1926 /* 1927 /*
1927 * TBD: BSSID is usually 00:00:00:00:00:00 here and not 1928 * TBD: BSSID is usually 00:00:00:00:00:00 here and not
@@ -1983,9 +1984,9 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1983 } 1984 }
1984 1985
1985 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=" 1986 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID="
1986 MAC_FMT ")\n", 1987 "%s)\n",
1987 priv->net_dev->name, escape_essid(essid, essid_len), 1988 priv->net_dev->name, escape_essid(essid, essid_len),
1988 txratename, chan, MAC_ARG(bssid)); 1989 txratename, chan, print_mac(mac, bssid));
1989 1990
1990 /* now we copy read ssid into dev */ 1991 /* now we copy read ssid into dev */
1991 if (!(priv->config & CFG_STATIC_ESSID)) { 1992 if (!(priv->config & CFG_STATIC_ESSID)) {
@@ -2053,10 +2054,12 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2053 2054
2054static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) 2055static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
2055{ 2056{
2057 DECLARE_MAC_BUF(mac);
2058
2056 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, 2059 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
2057 "disassociated: '%s' " MAC_FMT " \n", 2060 "disassociated: '%s' %s \n",
2058 escape_essid(priv->essid, priv->essid_len), 2061 escape_essid(priv->essid, priv->essid_len),
2059 MAC_ARG(priv->bssid)); 2062 print_mac(mac, priv->bssid));
2060 2063
2061 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2064 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
2062 2065
@@ -4049,6 +4052,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4049 char *out = buf; 4052 char *out = buf;
4050 int length; 4053 int length;
4051 int ret; 4054 int ret;
4055 DECLARE_MAC_BUF(mac);
4052 4056
4053 if (priv->status & STATUS_RF_KILL_MASK) 4057 if (priv->status & STATUS_RF_KILL_MASK)
4054 return 0; 4058 return 0;
@@ -4076,9 +4080,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4076 __LINE__); 4080 __LINE__);
4077 4081
4078 out += sprintf(out, "ESSID: %s\n", essid); 4082 out += sprintf(out, "ESSID: %s\n", essid);
4079 out += sprintf(out, "BSSID: %02x:%02x:%02x:%02x:%02x:%02x\n", 4083 out += sprintf(out, "BSSID: %s\n", print_mac(mac, bssid));
4080 bssid[0], bssid[1], bssid[2],
4081 bssid[3], bssid[4], bssid[5]);
4082 out += sprintf(out, "Channel: %d\n", chan); 4084 out += sprintf(out, "Channel: %d\n", chan);
4083 4085
4084 return out - buf; 4086 return out - buf;
@@ -4652,19 +4654,20 @@ static void ipw2100_rx_free(struct ipw2100_priv *priv)
4652static int ipw2100_read_mac_address(struct ipw2100_priv *priv) 4654static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
4653{ 4655{
4654 u32 length = ETH_ALEN; 4656 u32 length = ETH_ALEN;
4655 u8 mac[ETH_ALEN]; 4657 u8 addr[ETH_ALEN];
4658 DECLARE_MAC_BUF(mac);
4656 4659
4657 int err; 4660 int err;
4658 4661
4659 err = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ADAPTER_MAC, mac, &length); 4662 err = ipw2100_get_ordinal(priv, IPW_ORD_STAT_ADAPTER_MAC, addr, &length);
4660 if (err) { 4663 if (err) {
4661 IPW_DEBUG_INFO("MAC address read failed\n"); 4664 IPW_DEBUG_INFO("MAC address read failed\n");
4662 return -EIO; 4665 return -EIO;
4663 } 4666 }
4664 IPW_DEBUG_INFO("card MAC is %02X:%02X:%02X:%02X:%02X:%02X\n",
4665 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
4666 4667
4667 memcpy(priv->net_dev->dev_addr, mac, ETH_ALEN); 4668 memcpy(priv->net_dev->dev_addr, addr, ETH_ALEN);
4669 IPW_DEBUG_INFO("card MAC is %s\n",
4670 print_mac(mac, priv->net_dev->dev_addr));
4668 4671
4669 return 0; 4672 return 0;
4670} 4673}
@@ -5043,10 +5046,10 @@ static int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 * bssid,
5043 int err; 5046 int err;
5044 5047
5045#ifdef CONFIG_IPW2100_DEBUG 5048#ifdef CONFIG_IPW2100_DEBUG
5049 DECLARE_MAC_BUF(mac);
5046 if (bssid != NULL) 5050 if (bssid != NULL)
5047 IPW_DEBUG_HC("MANDATORY_BSSID: %02X:%02X:%02X:%02X:%02X:%02X\n", 5051 IPW_DEBUG_HC("MANDATORY_BSSID: %s\n",
5048 bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], 5052 print_mac(mac, bssid));
5049 bssid[5]);
5050 else 5053 else
5051 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n"); 5054 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n");
5052#endif 5055#endif
@@ -6892,6 +6895,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6892 static const unsigned char off[] = { 6895 static const unsigned char off[] = {
6893 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 6896 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6894 }; 6897 };
6898 DECLARE_MAC_BUF(mac);
6895 6899
6896 // sanity checks 6900 // sanity checks
6897 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 6901 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
@@ -6917,13 +6921,8 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6917 6921
6918 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0); 6922 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0);
6919 6923
6920 IPW_DEBUG_WX("SET BSSID -> %02X:%02X:%02X:%02X:%02X:%02X\n", 6924 IPW_DEBUG_WX("SET BSSID -> %s\n",
6921 wrqu->ap_addr.sa_data[0] & 0xff, 6925 print_mac(mac, wrqu->ap_addr.sa_data));
6922 wrqu->ap_addr.sa_data[1] & 0xff,
6923 wrqu->ap_addr.sa_data[2] & 0xff,
6924 wrqu->ap_addr.sa_data[3] & 0xff,
6925 wrqu->ap_addr.sa_data[4] & 0xff,
6926 wrqu->ap_addr.sa_data[5] & 0xff);
6927 6926
6928 done: 6927 done:
6929 mutex_unlock(&priv->action_mutex); 6928 mutex_unlock(&priv->action_mutex);
@@ -6939,6 +6938,7 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6939 */ 6938 */
6940 6939
6941 struct ipw2100_priv *priv = ieee80211_priv(dev); 6940 struct ipw2100_priv *priv = ieee80211_priv(dev);
6941 DECLARE_MAC_BUF(mac);
6942 6942
6943 /* If we are associated, trying to associate, or have a statically 6943 /* If we are associated, trying to associate, or have a statically
6944 * configured BSSID then return that; otherwise return ANY */ 6944 * configured BSSID then return that; otherwise return ANY */
@@ -6948,8 +6948,8 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6948 } else 6948 } else
6949 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 6949 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
6950 6950
6951 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", 6951 IPW_DEBUG_WX("Getting WAP BSSID: %s\n",
6952 MAC_ARG(wrqu->ap_addr.sa_data)); 6952 print_mac(mac, wrqu->ap_addr.sa_data));
6953 return 0; 6953 return 0;
6954} 6954}
6955 6955