aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.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/ipw2200.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/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c207
1 files changed, 114 insertions, 93 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index afad8bb7e334..2119a79dcc86 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2247,8 +2247,8 @@ static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
2247 return -1; 2247 return -1;
2248 } 2248 }
2249 2249
2250 IPW_DEBUG_INFO("%s: Setting MAC to " MAC_FMT "\n", 2250 IPW_DEBUG_INFO("%s: Setting MAC to %s\n",
2251 priv->net_dev->name, MAC_ARG(mac)); 2251 priv->net_dev->name, print_mac(mac, mac));
2252 2252
2253 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac); 2253 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac);
2254} 2254}
@@ -3796,6 +3796,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3796{ 3796{
3797 struct ipw_station_entry entry; 3797 struct ipw_station_entry entry;
3798 int i; 3798 int i;
3799 DECLARE_MAC_BUF(mac);
3799 3800
3800 for (i = 0; i < priv->num_stations; i++) { 3801 for (i = 0; i < priv->num_stations; i++) {
3801 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) { 3802 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) {
@@ -3812,7 +3813,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3812 if (i == MAX_STATIONS) 3813 if (i == MAX_STATIONS)
3813 return IPW_INVALID_STATION; 3814 return IPW_INVALID_STATION;
3814 3815
3815 IPW_DEBUG_SCAN("Adding AdHoc station: " MAC_FMT "\n", MAC_ARG(bssid)); 3816 IPW_DEBUG_SCAN("Adding AdHoc station: %s\n", print_mac(mac, bssid));
3816 3817
3817 entry.reserved = 0; 3818 entry.reserved = 0;
3818 entry.support_mode = 0; 3819 entry.support_mode = 0;
@@ -3839,6 +3840,7 @@ static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid)
3839static void ipw_send_disassociate(struct ipw_priv *priv, int quiet) 3840static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3840{ 3841{
3841 int err; 3842 int err;
3843 DECLARE_MAC_BUF(mac);
3842 3844
3843 if (priv->status & STATUS_ASSOCIATING) { 3845 if (priv->status & STATUS_ASSOCIATING) {
3844 IPW_DEBUG_ASSOC("Disassociating while associating.\n"); 3846 IPW_DEBUG_ASSOC("Disassociating while associating.\n");
@@ -3851,9 +3853,9 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3851 return; 3853 return;
3852 } 3854 }
3853 3855
3854 IPW_DEBUG_ASSOC("Disassocation attempt from " MAC_FMT " " 3856 IPW_DEBUG_ASSOC("Disassocation attempt from %s "
3855 "on channel %d.\n", 3857 "on channel %d.\n",
3856 MAC_ARG(priv->assoc_request.bssid), 3858 print_mac(mac, priv->assoc_request.bssid),
3857 priv->assoc_request.channel); 3859 priv->assoc_request.channel);
3858 3860
3859 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED); 3861 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
@@ -4348,6 +4350,7 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv,
4348static void ipw_rx_notification(struct ipw_priv *priv, 4350static void ipw_rx_notification(struct ipw_priv *priv,
4349 struct ipw_rx_notification *notif) 4351 struct ipw_rx_notification *notif)
4350{ 4352{
4353 DECLARE_MAC_BUF(mac);
4351 notif->size = le16_to_cpu(notif->size); 4354 notif->size = le16_to_cpu(notif->size);
4352 4355
4353 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size); 4356 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size);
@@ -4360,11 +4363,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4360 case CMAS_ASSOCIATED:{ 4363 case CMAS_ASSOCIATED:{
4361 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4364 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4362 IPW_DL_ASSOC, 4365 IPW_DL_ASSOC,
4363 "associated: '%s' " MAC_FMT 4366 "associated: '%s' %s"
4364 " \n", 4367 " \n",
4365 escape_essid(priv->essid, 4368 escape_essid(priv->essid,
4366 priv->essid_len), 4369 priv->essid_len),
4367 MAC_ARG(priv->bssid)); 4370 print_mac(mac, priv->bssid));
4368 4371
4369 switch (priv->ieee->iw_mode) { 4372 switch (priv->ieee->iw_mode) {
4370 case IW_MODE_INFRA: 4373 case IW_MODE_INFRA:
@@ -4444,13 +4447,13 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4444 IPW_DL_STATE | 4447 IPW_DL_STATE |
4445 IPW_DL_ASSOC, 4448 IPW_DL_ASSOC,
4446 "deauthenticated: '%s' " 4449 "deauthenticated: '%s' "
4447 MAC_FMT 4450 "%s"
4448 ": (0x%04X) - %s \n", 4451 ": (0x%04X) - %s \n",
4449 escape_essid(priv-> 4452 escape_essid(priv->
4450 essid, 4453 essid,
4451 priv-> 4454 priv->
4452 essid_len), 4455 essid_len),
4453 MAC_ARG(priv->bssid), 4456 print_mac(mac, priv->bssid),
4454 ntohs(auth->status), 4457 ntohs(auth->status),
4455 ipw_get_status_code 4458 ipw_get_status_code
4456 (ntohs 4459 (ntohs
@@ -4467,11 +4470,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4467 4470
4468 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4471 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4469 IPW_DL_ASSOC, 4472 IPW_DL_ASSOC,
4470 "authenticated: '%s' " MAC_FMT 4473 "authenticated: '%s' %s"
4471 "\n", 4474 "\n",
4472 escape_essid(priv->essid, 4475 escape_essid(priv->essid,
4473 priv->essid_len), 4476 priv->essid_len),
4474 MAC_ARG(priv->bssid)); 4477 print_mac(mac, priv->bssid));
4475 break; 4478 break;
4476 } 4479 }
4477 4480
@@ -4496,11 +4499,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4496 4499
4497 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4500 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4498 IPW_DL_ASSOC, 4501 IPW_DL_ASSOC,
4499 "disassociated: '%s' " MAC_FMT 4502 "disassociated: '%s' %s"
4500 " \n", 4503 " \n",
4501 escape_essid(priv->essid, 4504 escape_essid(priv->essid,
4502 priv->essid_len), 4505 priv->essid_len),
4503 MAC_ARG(priv->bssid)); 4506 print_mac(mac, priv->bssid));
4504 4507
4505 priv->status &= 4508 priv->status &=
4506 ~(STATUS_DISASSOCIATING | 4509 ~(STATUS_DISASSOCIATING |
@@ -4535,10 +4538,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4535 switch (auth->state) { 4538 switch (auth->state) {
4536 case CMAS_AUTHENTICATED: 4539 case CMAS_AUTHENTICATED:
4537 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, 4540 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
4538 "authenticated: '%s' " MAC_FMT " \n", 4541 "authenticated: '%s' %s \n",
4539 escape_essid(priv->essid, 4542 escape_essid(priv->essid,
4540 priv->essid_len), 4543 priv->essid_len),
4541 MAC_ARG(priv->bssid)); 4544 print_mac(mac, priv->bssid));
4542 priv->status |= STATUS_AUTH; 4545 priv->status |= STATUS_AUTH;
4543 break; 4546 break;
4544 4547
@@ -4554,10 +4557,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4554 } 4557 }
4555 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4558 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4556 IPW_DL_ASSOC, 4559 IPW_DL_ASSOC,
4557 "deauthenticated: '%s' " MAC_FMT "\n", 4560 "deauthenticated: '%s' %s\n",
4558 escape_essid(priv->essid, 4561 escape_essid(priv->essid,
4559 priv->essid_len), 4562 priv->essid_len),
4560 MAC_ARG(priv->bssid)); 4563 print_mac(mac, priv->bssid));
4561 4564
4562 priv->status &= ~(STATUS_ASSOCIATING | 4565 priv->status &= ~(STATUS_ASSOCIATING |
4563 STATUS_AUTH | 4566 STATUS_AUTH |
@@ -5383,25 +5386,27 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5383 int roaming) 5386 int roaming)
5384{ 5387{
5385 struct ipw_supported_rates rates; 5388 struct ipw_supported_rates rates;
5389 DECLARE_MAC_BUF(mac);
5390 DECLARE_MAC_BUF(mac2);
5386 5391
5387 /* Verify that this network's capability is compatible with the 5392 /* Verify that this network's capability is compatible with the
5388 * current mode (AdHoc or Infrastructure) */ 5393 * current mode (AdHoc or Infrastructure) */
5389 if ((priv->ieee->iw_mode == IW_MODE_ADHOC && 5394 if ((priv->ieee->iw_mode == IW_MODE_ADHOC &&
5390 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5395 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5391 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded due to " 5396 IPW_DEBUG_MERGE("Network '%s (%s)' excluded due to "
5392 "capability mismatch.\n", 5397 "capability mismatch.\n",
5393 escape_essid(network->ssid, network->ssid_len), 5398 escape_essid(network->ssid, network->ssid_len),
5394 MAC_ARG(network->bssid)); 5399 print_mac(mac, network->bssid));
5395 return 0; 5400 return 0;
5396 } 5401 }
5397 5402
5398 /* If we do not have an ESSID for this AP, we can not associate with 5403 /* If we do not have an ESSID for this AP, we can not associate with
5399 * it */ 5404 * it */
5400 if (network->flags & NETWORK_EMPTY_ESSID) { 5405 if (network->flags & NETWORK_EMPTY_ESSID) {
5401 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5406 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5402 "because of hidden ESSID.\n", 5407 "because of hidden ESSID.\n",
5403 escape_essid(network->ssid, network->ssid_len), 5408 escape_essid(network->ssid, network->ssid_len),
5404 MAC_ARG(network->bssid)); 5409 print_mac(mac, network->bssid));
5405 return 0; 5410 return 0;
5406 } 5411 }
5407 5412
@@ -5411,11 +5416,11 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5411 if ((network->ssid_len != match->network->ssid_len) || 5416 if ((network->ssid_len != match->network->ssid_len) ||
5412 memcmp(network->ssid, match->network->ssid, 5417 memcmp(network->ssid, match->network->ssid,
5413 network->ssid_len)) { 5418 network->ssid_len)) {
5414 IPW_DEBUG_MERGE("Netowrk '%s (" MAC_FMT ")' excluded " 5419 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5415 "because of non-network ESSID.\n", 5420 "because of non-network ESSID.\n",
5416 escape_essid(network->ssid, 5421 escape_essid(network->ssid,
5417 network->ssid_len), 5422 network->ssid_len),
5418 MAC_ARG(network->bssid)); 5423 print_mac(mac, network->bssid));
5419 return 0; 5424 return 0;
5420 } 5425 }
5421 } else { 5426 } else {
@@ -5430,9 +5435,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5430 strncpy(escaped, 5435 strncpy(escaped,
5431 escape_essid(network->ssid, network->ssid_len), 5436 escape_essid(network->ssid, network->ssid_len),
5432 sizeof(escaped)); 5437 sizeof(escaped));
5433 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5438 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5434 "because of ESSID mismatch: '%s'.\n", 5439 "because of ESSID mismatch: '%s'.\n",
5435 escaped, MAC_ARG(network->bssid), 5440 escaped, print_mac(mac, network->bssid),
5436 escape_essid(priv->essid, 5441 escape_essid(priv->essid,
5437 priv->essid_len)); 5442 priv->essid_len));
5438 return 0; 5443 return 0;
@@ -5459,10 +5464,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5459 /* Now go through and see if the requested network is valid... */ 5464 /* Now go through and see if the requested network is valid... */
5460 if (priv->ieee->scan_age != 0 && 5465 if (priv->ieee->scan_age != 0 &&
5461 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5466 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5462 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5467 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5463 "because of age: %ums.\n", 5468 "because of age: %ums.\n",
5464 escape_essid(network->ssid, network->ssid_len), 5469 escape_essid(network->ssid, network->ssid_len),
5465 MAC_ARG(network->bssid), 5470 print_mac(mac, network->bssid),
5466 jiffies_to_msecs(jiffies - 5471 jiffies_to_msecs(jiffies -
5467 network->last_scanned)); 5472 network->last_scanned));
5468 return 0; 5473 return 0;
@@ -5470,10 +5475,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5470 5475
5471 if ((priv->config & CFG_STATIC_CHANNEL) && 5476 if ((priv->config & CFG_STATIC_CHANNEL) &&
5472 (network->channel != priv->channel)) { 5477 (network->channel != priv->channel)) {
5473 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5478 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5474 "because of channel mismatch: %d != %d.\n", 5479 "because of channel mismatch: %d != %d.\n",
5475 escape_essid(network->ssid, network->ssid_len), 5480 escape_essid(network->ssid, network->ssid_len),
5476 MAC_ARG(network->bssid), 5481 print_mac(mac, network->bssid),
5477 network->channel, priv->channel); 5482 network->channel, priv->channel);
5478 return 0; 5483 return 0;
5479 } 5484 }
@@ -5481,10 +5486,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5481 /* Verify privacy compatability */ 5486 /* Verify privacy compatability */
5482 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5487 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5483 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5488 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5484 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5489 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5485 "because of privacy mismatch: %s != %s.\n", 5490 "because of privacy mismatch: %s != %s.\n",
5486 escape_essid(network->ssid, network->ssid_len), 5491 escape_essid(network->ssid, network->ssid_len),
5487 MAC_ARG(network->bssid), 5492 print_mac(mac, network->bssid),
5488 priv-> 5493 priv->
5489 capability & CAP_PRIVACY_ON ? "on" : "off", 5494 capability & CAP_PRIVACY_ON ? "on" : "off",
5490 network-> 5495 network->
@@ -5494,40 +5499,41 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5494 } 5499 }
5495 5500
5496 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5501 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5497 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5502 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5498 "because of the same BSSID match: " MAC_FMT 5503 "because of the same BSSID match: %s"
5499 ".\n", escape_essid(network->ssid, 5504 ".\n", escape_essid(network->ssid,
5500 network->ssid_len), 5505 network->ssid_len),
5501 MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); 5506 print_mac(mac, network->bssid),
5507 print_mac(mac2, priv->bssid));
5502 return 0; 5508 return 0;
5503 } 5509 }
5504 5510
5505 /* Filter out any incompatible freq / mode combinations */ 5511 /* Filter out any incompatible freq / mode combinations */
5506 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5512 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5507 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5513 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5508 "because of invalid frequency/mode " 5514 "because of invalid frequency/mode "
5509 "combination.\n", 5515 "combination.\n",
5510 escape_essid(network->ssid, network->ssid_len), 5516 escape_essid(network->ssid, network->ssid_len),
5511 MAC_ARG(network->bssid)); 5517 print_mac(mac, network->bssid));
5512 return 0; 5518 return 0;
5513 } 5519 }
5514 5520
5515 /* Ensure that the rates supported by the driver are compatible with 5521 /* Ensure that the rates supported by the driver are compatible with
5516 * this AP, including verification of basic rates (mandatory) */ 5522 * this AP, including verification of basic rates (mandatory) */
5517 if (!ipw_compatible_rates(priv, network, &rates)) { 5523 if (!ipw_compatible_rates(priv, network, &rates)) {
5518 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5524 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5519 "because configured rate mask excludes " 5525 "because configured rate mask excludes "
5520 "AP mandatory rate.\n", 5526 "AP mandatory rate.\n",
5521 escape_essid(network->ssid, network->ssid_len), 5527 escape_essid(network->ssid, network->ssid_len),
5522 MAC_ARG(network->bssid)); 5528 print_mac(mac, network->bssid));
5523 return 0; 5529 return 0;
5524 } 5530 }
5525 5531
5526 if (rates.num_rates == 0) { 5532 if (rates.num_rates == 0) {
5527 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5533 IPW_DEBUG_MERGE("Network '%s (%s)' excluded "
5528 "because of no compatible rates.\n", 5534 "because of no compatible rates.\n",
5529 escape_essid(network->ssid, network->ssid_len), 5535 escape_essid(network->ssid, network->ssid_len),
5530 MAC_ARG(network->bssid)); 5536 print_mac(mac, network->bssid));
5531 return 0; 5537 return 0;
5532 } 5538 }
5533 5539
@@ -5538,9 +5544,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5538 /* Set up 'new' AP to this network */ 5544 /* Set up 'new' AP to this network */
5539 ipw_copy_rates(&match->rates, &rates); 5545 ipw_copy_rates(&match->rates, &rates);
5540 match->network = network; 5546 match->network = network;
5541 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' is a viable match.\n", 5547 IPW_DEBUG_MERGE("Network '%s (%s)' is a viable match.\n",
5542 escape_essid(network->ssid, network->ssid_len), 5548 escape_essid(network->ssid, network->ssid_len),
5543 MAC_ARG(network->bssid)); 5549 print_mac(mac, network->bssid));
5544 5550
5545 return 1; 5551 return 1;
5546} 5552}
@@ -5594,6 +5600,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5594 struct ieee80211_network *network, int roaming) 5600 struct ieee80211_network *network, int roaming)
5595{ 5601{
5596 struct ipw_supported_rates rates; 5602 struct ipw_supported_rates rates;
5603 DECLARE_MAC_BUF(mac);
5597 5604
5598 /* Verify that this network's capability is compatible with the 5605 /* Verify that this network's capability is compatible with the
5599 * current mode (AdHoc or Infrastructure) */ 5606 * current mode (AdHoc or Infrastructure) */
@@ -5601,20 +5608,20 @@ static int ipw_best_network(struct ipw_priv *priv,
5601 !(network->capability & WLAN_CAPABILITY_ESS)) || 5608 !(network->capability & WLAN_CAPABILITY_ESS)) ||
5602 (priv->ieee->iw_mode == IW_MODE_ADHOC && 5609 (priv->ieee->iw_mode == IW_MODE_ADHOC &&
5603 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5610 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5604 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded due to " 5611 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded due to "
5605 "capability mismatch.\n", 5612 "capability mismatch.\n",
5606 escape_essid(network->ssid, network->ssid_len), 5613 escape_essid(network->ssid, network->ssid_len),
5607 MAC_ARG(network->bssid)); 5614 print_mac(mac, network->bssid));
5608 return 0; 5615 return 0;
5609 } 5616 }
5610 5617
5611 /* If we do not have an ESSID for this AP, we can not associate with 5618 /* If we do not have an ESSID for this AP, we can not associate with
5612 * it */ 5619 * it */
5613 if (network->flags & NETWORK_EMPTY_ESSID) { 5620 if (network->flags & NETWORK_EMPTY_ESSID) {
5614 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5621 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5615 "because of hidden ESSID.\n", 5622 "because of hidden ESSID.\n",
5616 escape_essid(network->ssid, network->ssid_len), 5623 escape_essid(network->ssid, network->ssid_len),
5617 MAC_ARG(network->bssid)); 5624 print_mac(mac, network->bssid));
5618 return 0; 5625 return 0;
5619 } 5626 }
5620 5627
@@ -5624,11 +5631,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5624 if ((network->ssid_len != match->network->ssid_len) || 5631 if ((network->ssid_len != match->network->ssid_len) ||
5625 memcmp(network->ssid, match->network->ssid, 5632 memcmp(network->ssid, match->network->ssid,
5626 network->ssid_len)) { 5633 network->ssid_len)) {
5627 IPW_DEBUG_ASSOC("Netowrk '%s (" MAC_FMT ")' excluded " 5634 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5628 "because of non-network ESSID.\n", 5635 "because of non-network ESSID.\n",
5629 escape_essid(network->ssid, 5636 escape_essid(network->ssid,
5630 network->ssid_len), 5637 network->ssid_len),
5631 MAC_ARG(network->bssid)); 5638 print_mac(mac, network->bssid));
5632 return 0; 5639 return 0;
5633 } 5640 }
5634 } else { 5641 } else {
@@ -5642,9 +5649,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5642 strncpy(escaped, 5649 strncpy(escaped,
5643 escape_essid(network->ssid, network->ssid_len), 5650 escape_essid(network->ssid, network->ssid_len),
5644 sizeof(escaped)); 5651 sizeof(escaped));
5645 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5652 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5646 "because of ESSID mismatch: '%s'.\n", 5653 "because of ESSID mismatch: '%s'.\n",
5647 escaped, MAC_ARG(network->bssid), 5654 escaped, print_mac(mac, network->bssid),
5648 escape_essid(priv->essid, 5655 escape_essid(priv->essid,
5649 priv->essid_len)); 5656 priv->essid_len));
5650 return 0; 5657 return 0;
@@ -5658,12 +5665,12 @@ static int ipw_best_network(struct ipw_priv *priv,
5658 strncpy(escaped, 5665 strncpy(escaped,
5659 escape_essid(network->ssid, network->ssid_len), 5666 escape_essid(network->ssid, network->ssid_len),
5660 sizeof(escaped)); 5667 sizeof(escaped));
5661 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded because " 5668 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded because "
5662 "'%s (" MAC_FMT ")' has a stronger signal.\n", 5669 "'%s (%s)' has a stronger signal.\n",
5663 escaped, MAC_ARG(network->bssid), 5670 escaped, print_mac(mac, network->bssid),
5664 escape_essid(match->network->ssid, 5671 escape_essid(match->network->ssid,
5665 match->network->ssid_len), 5672 match->network->ssid_len),
5666 MAC_ARG(match->network->bssid)); 5673 print_mac(mac, match->network->bssid));
5667 return 0; 5674 return 0;
5668 } 5675 }
5669 5676
@@ -5671,11 +5678,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5671 * last 3 seconds, do not try and associate again... */ 5678 * last 3 seconds, do not try and associate again... */
5672 if (network->last_associate && 5679 if (network->last_associate &&
5673 time_after(network->last_associate + (HZ * 3UL), jiffies)) { 5680 time_after(network->last_associate + (HZ * 3UL), jiffies)) {
5674 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5681 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5675 "because of storming (%ums since last " 5682 "because of storming (%ums since last "
5676 "assoc attempt).\n", 5683 "assoc attempt).\n",
5677 escape_essid(network->ssid, network->ssid_len), 5684 escape_essid(network->ssid, network->ssid_len),
5678 MAC_ARG(network->bssid), 5685 print_mac(mac, network->bssid),
5679 jiffies_to_msecs(jiffies - 5686 jiffies_to_msecs(jiffies -
5680 network->last_associate)); 5687 network->last_associate));
5681 return 0; 5688 return 0;
@@ -5684,10 +5691,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5684 /* Now go through and see if the requested network is valid... */ 5691 /* Now go through and see if the requested network is valid... */
5685 if (priv->ieee->scan_age != 0 && 5692 if (priv->ieee->scan_age != 0 &&
5686 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5693 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5687 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5694 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5688 "because of age: %ums.\n", 5695 "because of age: %ums.\n",
5689 escape_essid(network->ssid, network->ssid_len), 5696 escape_essid(network->ssid, network->ssid_len),
5690 MAC_ARG(network->bssid), 5697 print_mac(mac, network->bssid),
5691 jiffies_to_msecs(jiffies - 5698 jiffies_to_msecs(jiffies -
5692 network->last_scanned)); 5699 network->last_scanned));
5693 return 0; 5700 return 0;
@@ -5695,10 +5702,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5695 5702
5696 if ((priv->config & CFG_STATIC_CHANNEL) && 5703 if ((priv->config & CFG_STATIC_CHANNEL) &&
5697 (network->channel != priv->channel)) { 5704 (network->channel != priv->channel)) {
5698 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5705 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5699 "because of channel mismatch: %d != %d.\n", 5706 "because of channel mismatch: %d != %d.\n",
5700 escape_essid(network->ssid, network->ssid_len), 5707 escape_essid(network->ssid, network->ssid_len),
5701 MAC_ARG(network->bssid), 5708 print_mac(mac, network->bssid),
5702 network->channel, priv->channel); 5709 network->channel, priv->channel);
5703 return 0; 5710 return 0;
5704 } 5711 }
@@ -5706,10 +5713,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5706 /* Verify privacy compatability */ 5713 /* Verify privacy compatability */
5707 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5714 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5708 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5715 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5709 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5716 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5710 "because of privacy mismatch: %s != %s.\n", 5717 "because of privacy mismatch: %s != %s.\n",
5711 escape_essid(network->ssid, network->ssid_len), 5718 escape_essid(network->ssid, network->ssid_len),
5712 MAC_ARG(network->bssid), 5719 print_mac(mac, network->bssid),
5713 priv->capability & CAP_PRIVACY_ON ? "on" : 5720 priv->capability & CAP_PRIVACY_ON ? "on" :
5714 "off", 5721 "off",
5715 network->capability & 5722 network->capability &
@@ -5719,48 +5726,48 @@ static int ipw_best_network(struct ipw_priv *priv,
5719 5726
5720 if ((priv->config & CFG_STATIC_BSSID) && 5727 if ((priv->config & CFG_STATIC_BSSID) &&
5721 memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5728 memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5722 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5729 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5723 "because of BSSID mismatch: " MAC_FMT ".\n", 5730 "because of BSSID mismatch: %s.\n",
5724 escape_essid(network->ssid, network->ssid_len), 5731 escape_essid(network->ssid, network->ssid_len),
5725 MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); 5732 print_mac(mac, network->bssid), print_mac(mac, priv->bssid));
5726 return 0; 5733 return 0;
5727 } 5734 }
5728 5735
5729 /* Filter out any incompatible freq / mode combinations */ 5736 /* Filter out any incompatible freq / mode combinations */
5730 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5737 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5731 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5738 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5732 "because of invalid frequency/mode " 5739 "because of invalid frequency/mode "
5733 "combination.\n", 5740 "combination.\n",
5734 escape_essid(network->ssid, network->ssid_len), 5741 escape_essid(network->ssid, network->ssid_len),
5735 MAC_ARG(network->bssid)); 5742 print_mac(mac, network->bssid));
5736 return 0; 5743 return 0;
5737 } 5744 }
5738 5745
5739 /* Filter out invalid channel in current GEO */ 5746 /* Filter out invalid channel in current GEO */
5740 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { 5747 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) {
5741 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5748 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5742 "because of invalid channel in current GEO\n", 5749 "because of invalid channel in current GEO\n",
5743 escape_essid(network->ssid, network->ssid_len), 5750 escape_essid(network->ssid, network->ssid_len),
5744 MAC_ARG(network->bssid)); 5751 print_mac(mac, network->bssid));
5745 return 0; 5752 return 0;
5746 } 5753 }
5747 5754
5748 /* Ensure that the rates supported by the driver are compatible with 5755 /* Ensure that the rates supported by the driver are compatible with
5749 * this AP, including verification of basic rates (mandatory) */ 5756 * this AP, including verification of basic rates (mandatory) */
5750 if (!ipw_compatible_rates(priv, network, &rates)) { 5757 if (!ipw_compatible_rates(priv, network, &rates)) {
5751 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5758 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5752 "because configured rate mask excludes " 5759 "because configured rate mask excludes "
5753 "AP mandatory rate.\n", 5760 "AP mandatory rate.\n",
5754 escape_essid(network->ssid, network->ssid_len), 5761 escape_essid(network->ssid, network->ssid_len),
5755 MAC_ARG(network->bssid)); 5762 print_mac(mac, network->bssid));
5756 return 0; 5763 return 0;
5757 } 5764 }
5758 5765
5759 if (rates.num_rates == 0) { 5766 if (rates.num_rates == 0) {
5760 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5767 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded "
5761 "because of no compatible rates.\n", 5768 "because of no compatible rates.\n",
5762 escape_essid(network->ssid, network->ssid_len), 5769 escape_essid(network->ssid, network->ssid_len),
5763 MAC_ARG(network->bssid)); 5770 print_mac(mac, network->bssid));
5764 return 0; 5771 return 0;
5765 } 5772 }
5766 5773
@@ -5772,9 +5779,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5772 ipw_copy_rates(&match->rates, &rates); 5779 ipw_copy_rates(&match->rates, &rates);
5773 match->network = network; 5780 match->network = network;
5774 5781
5775 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' is a viable match.\n", 5782 IPW_DEBUG_ASSOC("Network '%s (%s)' is a viable match.\n",
5776 escape_essid(network->ssid, network->ssid_len), 5783 escape_essid(network->ssid, network->ssid_len),
5777 MAC_ARG(network->bssid)); 5784 print_mac(mac, network->bssid));
5778 5785
5779 return 1; 5786 return 1;
5780} 5787}
@@ -6016,6 +6023,7 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
6016 6023
6017static void ipw_debug_config(struct ipw_priv *priv) 6024static void ipw_debug_config(struct ipw_priv *priv)
6018{ 6025{
6026 DECLARE_MAC_BUF(mac);
6019 IPW_DEBUG_INFO("Scan completed, no valid APs matched " 6027 IPW_DEBUG_INFO("Scan completed, no valid APs matched "
6020 "[CFG 0x%08X]\n", priv->config); 6028 "[CFG 0x%08X]\n", priv->config);
6021 if (priv->config & CFG_STATIC_CHANNEL) 6029 if (priv->config & CFG_STATIC_CHANNEL)
@@ -6028,8 +6036,8 @@ static void ipw_debug_config(struct ipw_priv *priv)
6028 else 6036 else
6029 IPW_DEBUG_INFO("ESSID unlocked.\n"); 6037 IPW_DEBUG_INFO("ESSID unlocked.\n");
6030 if (priv->config & CFG_STATIC_BSSID) 6038 if (priv->config & CFG_STATIC_BSSID)
6031 IPW_DEBUG_INFO("BSSID locked to " MAC_FMT "\n", 6039 IPW_DEBUG_INFO("BSSID locked to %s\n",
6032 MAC_ARG(priv->bssid)); 6040 print_mac(mac, priv->bssid));
6033 else 6041 else
6034 IPW_DEBUG_INFO("BSSID unlocked.\n"); 6042 IPW_DEBUG_INFO("BSSID unlocked.\n");
6035 if (priv->capability & CAP_PRIVACY_ON) 6043 if (priv->capability & CAP_PRIVACY_ON)
@@ -7221,6 +7229,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7221 struct ipw_supported_rates *rates, int roaming) 7229 struct ipw_supported_rates *rates, int roaming)
7222{ 7230{
7223 int err; 7231 int err;
7232 DECLARE_MAC_BUF(mac);
7224 7233
7225 if (priv->config & CFG_FIXED_RATE) 7234 if (priv->config & CFG_FIXED_RATE)
7226 ipw_set_fixed_rate(priv, network->mode); 7235 ipw_set_fixed_rate(priv, network->mode);
@@ -7388,9 +7397,9 @@ static int ipw_associate_network(struct ipw_priv *priv,
7388 return err; 7397 return err;
7389 } 7398 }
7390 7399
7391 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n", 7400 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %s \n",
7392 escape_essid(priv->essid, priv->essid_len), 7401 escape_essid(priv->essid, priv->essid_len),
7393 MAC_ARG(priv->bssid)); 7402 print_mac(mac, priv->bssid));
7394 7403
7395 return 0; 7404 return 0;
7396} 7405}
@@ -8202,6 +8211,9 @@ static void ipw_rx(struct ipw_priv *priv)
8202 struct ieee80211_hdr_4addr *header; 8211 struct ieee80211_hdr_4addr *header;
8203 u32 r, w, i; 8212 u32 r, w, i;
8204 u8 network_packet; 8213 u8 network_packet;
8214 DECLARE_MAC_BUF(mac);
8215 DECLARE_MAC_BUF(mac2);
8216 DECLARE_MAC_BUF(mac3);
8205 8217
8206 r = ipw_read32(priv, IPW_RX_READ_INDEX); 8218 r = ipw_read32(priv, IPW_RX_READ_INDEX);
8207 w = ipw_read32(priv, IPW_RX_WRITE_INDEX); 8219 w = ipw_read32(priv, IPW_RX_WRITE_INDEX);
@@ -8328,14 +8340,17 @@ static void ipw_rx(struct ipw_priv *priv)
8328 header))) 8340 header)))
8329 { 8341 {
8330 IPW_DEBUG_DROP("Dropping: " 8342 IPW_DEBUG_DROP("Dropping: "
8331 MAC_FMT ", " 8343 "%s, "
8332 MAC_FMT ", " 8344 "%s, "
8333 MAC_FMT "\n", 8345 "%s\n",
8334 MAC_ARG(header-> 8346 print_mac(mac,
8347 header->
8335 addr1), 8348 addr1),
8336 MAC_ARG(header-> 8349 print_mac(mac2,
8350 header->
8337 addr2), 8351 addr2),
8338 MAC_ARG(header-> 8352 print_mac(mac3,
8353 header->
8339 addr3)); 8354 addr3));
8340 break; 8355 break;
8341 } 8356 }
@@ -8867,6 +8882,7 @@ static int ipw_wx_set_wap(struct net_device *dev,
8867 union iwreq_data *wrqu, char *extra) 8882 union iwreq_data *wrqu, char *extra)
8868{ 8883{
8869 struct ipw_priv *priv = ieee80211_priv(dev); 8884 struct ipw_priv *priv = ieee80211_priv(dev);
8885 DECLARE_MAC_BUF(mac);
8870 8886
8871 static const unsigned char any[] = { 8887 static const unsigned char any[] = {
8872 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 8888 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@@ -8897,8 +8913,8 @@ static int ipw_wx_set_wap(struct net_device *dev,
8897 return 0; 8913 return 0;
8898 } 8914 }
8899 8915
8900 IPW_DEBUG_WX("Setting mandatory BSSID to " MAC_FMT "\n", 8916 IPW_DEBUG_WX("Setting mandatory BSSID to %s\n",
8901 MAC_ARG(wrqu->ap_addr.sa_data)); 8917 print_mac(mac, wrqu->ap_addr.sa_data));
8902 8918
8903 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); 8919 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
8904 8920
@@ -8916,6 +8932,8 @@ static int ipw_wx_get_wap(struct net_device *dev,
8916 union iwreq_data *wrqu, char *extra) 8932 union iwreq_data *wrqu, char *extra)
8917{ 8933{
8918 struct ipw_priv *priv = ieee80211_priv(dev); 8934 struct ipw_priv *priv = ieee80211_priv(dev);
8935 DECLARE_MAC_BUF(mac);
8936
8919 /* If we are associated, trying to associate, or have a statically 8937 /* If we are associated, trying to associate, or have a statically
8920 * configured BSSID then return that; otherwise return ANY */ 8938 * configured BSSID then return that; otherwise return ANY */
8921 mutex_lock(&priv->mutex); 8939 mutex_lock(&priv->mutex);
@@ -8926,8 +8944,8 @@ static int ipw_wx_get_wap(struct net_device *dev,
8926 } else 8944 } else
8927 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 8945 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
8928 8946
8929 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", 8947 IPW_DEBUG_WX("Getting WAP BSSID: %s\n",
8930 MAC_ARG(wrqu->ap_addr.sa_data)); 8948 print_mac(mac, wrqu->ap_addr.sa_data));
8931 mutex_unlock(&priv->mutex); 8949 mutex_unlock(&priv->mutex);
8932 return 0; 8950 return 0;
8933} 8951}
@@ -10133,6 +10151,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10133 u8 id, hdr_len, unicast; 10151 u8 id, hdr_len, unicast;
10134 u16 remaining_bytes; 10152 u16 remaining_bytes;
10135 int fc; 10153 int fc;
10154 DECLARE_MAC_BUF(mac);
10136 10155
10137 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10156 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
10138 switch (priv->ieee->iw_mode) { 10157 switch (priv->ieee->iw_mode) {
@@ -10143,8 +10162,8 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10143 id = ipw_add_station(priv, hdr->addr1); 10162 id = ipw_add_station(priv, hdr->addr1);
10144 if (id == IPW_INVALID_STATION) { 10163 if (id == IPW_INVALID_STATION) {
10145 IPW_WARNING("Attempt to send data to " 10164 IPW_WARNING("Attempt to send data to "
10146 "invalid cell: " MAC_FMT "\n", 10165 "invalid cell: %s\n",
10147 MAC_ARG(hdr->addr1)); 10166 print_mac(mac, hdr->addr1));
10148 goto drop; 10167 goto drop;
10149 } 10168 }
10150 } 10169 }
@@ -10460,13 +10479,15 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
10460{ 10479{
10461 struct ipw_priv *priv = ieee80211_priv(dev); 10480 struct ipw_priv *priv = ieee80211_priv(dev);
10462 struct sockaddr *addr = p; 10481 struct sockaddr *addr = p;
10482 DECLARE_MAC_BUF(mac);
10483
10463 if (!is_valid_ether_addr(addr->sa_data)) 10484 if (!is_valid_ether_addr(addr->sa_data))
10464 return -EADDRNOTAVAIL; 10485 return -EADDRNOTAVAIL;
10465 mutex_lock(&priv->mutex); 10486 mutex_lock(&priv->mutex);
10466 priv->config |= CFG_CUSTOM_MAC; 10487 priv->config |= CFG_CUSTOM_MAC;
10467 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 10488 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
10468 printk(KERN_INFO "%s: Setting MAC to " MAC_FMT "\n", 10489 printk(KERN_INFO "%s: Setting MAC to %s\n",
10469 priv->net_dev->name, MAC_ARG(priv->mac_addr)); 10490 priv->net_dev->name, print_mac(mac, priv->mac_addr));
10470 queue_work(priv->workqueue, &priv->adapter_restart); 10491 queue_work(priv->workqueue, &priv->adapter_restart);
10471 mutex_unlock(&priv->mutex); 10492 mutex_unlock(&priv->mutex);
10472 return 0; 10493 return 0;