aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw
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/zd1211rw
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/zd1211rw')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c3
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 495904218b1b..750c0f99e86f 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -377,6 +377,7 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
377 [0] = { .addr = CR_MAC_ADDR_P1 }, 377 [0] = { .addr = CR_MAC_ADDR_P1 },
378 [1] = { .addr = CR_MAC_ADDR_P2 }, 378 [1] = { .addr = CR_MAC_ADDR_P2 },
379 }; 379 };
380 DECLARE_MAC_BUF(mac);
380 381
381 reqs[0].value = (mac_addr[3] << 24) 382 reqs[0].value = (mac_addr[3] << 24)
382 | (mac_addr[2] << 16) 383 | (mac_addr[2] << 16)
@@ -386,7 +387,7 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
386 | mac_addr[4]; 387 | mac_addr[4];
387 388
388 dev_dbg_f(zd_chip_dev(chip), 389 dev_dbg_f(zd_chip_dev(chip),
389 "mac addr " MAC_FMT "\n", MAC_ARG(mac_addr)); 390 "mac addr %s\n", print_mac(mac, mac_addr));
390 391
391 mutex_lock(&chip->mutex); 392 mutex_lock(&chip->mutex);
392 r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs)); 393 r = zd_iowrite32a_locked(chip, reqs, ARRAY_SIZE(reqs));
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 451308d7095d..06b342b39792 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -289,12 +289,13 @@ int zd_mac_set_mac_address(struct net_device *netdev, void *p)
289 struct sockaddr *addr = p; 289 struct sockaddr *addr = p;
290 struct zd_mac *mac = zd_netdev_mac(netdev); 290 struct zd_mac *mac = zd_netdev_mac(netdev);
291 struct zd_chip *chip = &mac->chip; 291 struct zd_chip *chip = &mac->chip;
292 DECLARE_MAC_BUF(mac2);
292 293
293 if (!is_valid_ether_addr(addr->sa_data)) 294 if (!is_valid_ether_addr(addr->sa_data))
294 return -EADDRNOTAVAIL; 295 return -EADDRNOTAVAIL;
295 296
296 dev_dbg_f(zd_mac_dev(mac), 297 dev_dbg_f(zd_mac_dev(mac),
297 "Setting MAC to " MAC_FMT "\n", MAC_ARG(addr->sa_data)); 298 "Setting MAC to %s\n", print_mac(mac2, addr->sa_data));
298 299
299 if (netdev->flags & IFF_UP) { 300 if (netdev->flags & IFF_UP) {
300 r = zd_write_mac_addr(chip, addr->sa_data); 301 r = zd_write_mac_addr(chip, addr->sa_data);
@@ -329,6 +330,7 @@ void zd_mac_set_multicast_list(struct net_device *dev)
329 struct zd_mc_hash hash; 330 struct zd_mc_hash hash;
330 struct dev_mc_list *mc; 331 struct dev_mc_list *mc;
331 unsigned long flags; 332 unsigned long flags;
333 DECLARE_MAC_BUF(mac2);
332 334
333 if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI) || 335 if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI) ||
334 ieee->iw_mode == IW_MODE_MONITOR) { 336 ieee->iw_mode == IW_MODE_MONITOR) {
@@ -336,8 +338,8 @@ void zd_mac_set_multicast_list(struct net_device *dev)
336 } else { 338 } else {
337 zd_mc_clear(&hash); 339 zd_mc_clear(&hash);
338 for (mc = dev->mc_list; mc; mc = mc->next) { 340 for (mc = dev->mc_list; mc; mc = mc->next) {
339 dev_dbg_f(zd_mac_dev(mac), "mc addr " MAC_FMT "\n", 341 dev_dbg_f(zd_mac_dev(mac), "mc addr %s\n",
340 MAC_ARG(mc->dmi_addr)); 342 print_mac(mac2, mc->dmi_addr));
341 zd_mc_add_addr(&hash, mc->dmi_addr); 343 zd_mc_add_addr(&hash, mc->dmi_addr);
342 } 344 }
343 } 345 }