aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-10-13 18:55:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:27 -0400
commit4b4890cb6aebb1669879a02c51a3c3eff629dff0 (patch)
treecd4139a7a2e5ea6f89c85f55c0fec96f708c64d0
parentda169607ae17c4340fe2ab286130741266709b07 (diff)
wireless: ipw2x00: print SSID via %*pE
Instead of custom approach this allows to print escaped strings via recently added kernel extension: %*pE. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: "John W . Linville" <linville@tuxdriver.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c22
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c270
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c65
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_wx.c16
4 files changed, 126 insertions, 247 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index c3d726f334e3..6fabea0309dd 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -2005,7 +2005,6 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
2005 u32 chan; 2005 u32 chan;
2006 char *txratename; 2006 char *txratename;
2007 u8 bssid[ETH_ALEN]; 2007 u8 bssid[ETH_ALEN];
2008 DECLARE_SSID_BUF(ssid);
2009 2008
2010 /* 2009 /*
2011 * TBD: BSSID is usually 00:00:00:00:00:00 here and not 2010 * TBD: BSSID is usually 00:00:00:00:00:00 here and not
@@ -2067,8 +2066,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
2067 break; 2066 break;
2068 } 2067 }
2069 2068
2070 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n", 2069 IPW_DEBUG_INFO("%s: Associated with '%*pE' at %s, channel %d (BSSID=%pM)\n",
2071 priv->net_dev->name, print_ssid(ssid, essid, essid_len), 2070 priv->net_dev->name, essid_len, essid,
2072 txratename, chan, bssid); 2071 txratename, chan, bssid);
2073 2072
2074 /* now we copy read ssid into dev */ 2073 /* now we copy read ssid into dev */
@@ -2095,9 +2094,8 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2095 .host_command_length = ssid_len 2094 .host_command_length = ssid_len
2096 }; 2095 };
2097 int err; 2096 int err;
2098 DECLARE_SSID_BUF(ssid);
2099 2097
2100 IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len)); 2098 IPW_DEBUG_HC("SSID: '%*pE'\n", ssid_len, essid);
2101 2099
2102 if (ssid_len) 2100 if (ssid_len)
2103 memcpy(cmd.host_command_parameters, essid, ssid_len); 2101 memcpy(cmd.host_command_parameters, essid, ssid_len);
@@ -2138,11 +2136,8 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2138 2136
2139static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) 2137static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
2140{ 2138{
2141 DECLARE_SSID_BUF(ssid);
2142
2143 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, 2139 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
2144 "disassociated: '%s' %pM\n", 2140 "disassociated: '%*pE' %pM\n", priv->essid_len, priv->essid,
2145 print_ssid(ssid, priv->essid, priv->essid_len),
2146 priv->bssid); 2141 priv->bssid);
2147 2142
2148 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2143 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
@@ -6975,7 +6970,6 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6975 char *essid = ""; /* ANY */ 6970 char *essid = ""; /* ANY */
6976 int length = 0; 6971 int length = 0;
6977 int err = 0; 6972 int err = 0;
6978 DECLARE_SSID_BUF(ssid);
6979 6973
6980 mutex_lock(&priv->action_mutex); 6974 mutex_lock(&priv->action_mutex);
6981 if (!(priv->status & STATUS_INITIALIZED)) { 6975 if (!(priv->status & STATUS_INITIALIZED)) {
@@ -7005,8 +6999,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
7005 goto done; 6999 goto done;
7006 } 7000 }
7007 7001
7008 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", 7002 IPW_DEBUG_WX("Setting ESSID: '%*pE' (%d)\n", length, essid, length);
7009 print_ssid(ssid, essid, length), length);
7010 7003
7011 priv->essid_len = length; 7004 priv->essid_len = length;
7012 memcpy(priv->essid, essid, priv->essid_len); 7005 memcpy(priv->essid, essid, priv->essid_len);
@@ -7027,13 +7020,12 @@ static int ipw2100_wx_get_essid(struct net_device *dev,
7027 */ 7020 */
7028 7021
7029 struct ipw2100_priv *priv = libipw_priv(dev); 7022 struct ipw2100_priv *priv = libipw_priv(dev);
7030 DECLARE_SSID_BUF(ssid);
7031 7023
7032 /* If we are associated, trying to associate, or have a statically 7024 /* If we are associated, trying to associate, or have a statically
7033 * configured ESSID then return that; otherwise return ANY */ 7025 * configured ESSID then return that; otherwise return ANY */
7034 if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) { 7026 if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) {
7035 IPW_DEBUG_WX("Getting essid: '%s'\n", 7027 IPW_DEBUG_WX("Getting essid: '%*pE'\n",
7036 print_ssid(ssid, priv->essid, priv->essid_len)); 7028 priv->essid_len, priv->essid);
7037 memcpy(extra, priv->essid, priv->essid_len); 7029 memcpy(extra, priv->essid, priv->essid_len);
7038 wrqu->essid.length = priv->essid_len; 7030 wrqu->essid.length = priv->essid_len;
7039 wrqu->essid.flags = 1; /* active */ 7031 wrqu->essid.flags = 1; /* active */
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index f0c3c77a48d3..edc344334a75 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -4496,7 +4496,6 @@ static void handle_scan_event(struct ipw_priv *priv)
4496static void ipw_rx_notification(struct ipw_priv *priv, 4496static void ipw_rx_notification(struct ipw_priv *priv,
4497 struct ipw_rx_notification *notif) 4497 struct ipw_rx_notification *notif)
4498{ 4498{
4499 DECLARE_SSID_BUF(ssid);
4500 u16 size = le16_to_cpu(notif->size); 4499 u16 size = le16_to_cpu(notif->size);
4501 4500
4502 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, size); 4501 IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, size);
@@ -4509,9 +4508,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4509 case CMAS_ASSOCIATED:{ 4508 case CMAS_ASSOCIATED:{
4510 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4509 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4511 IPW_DL_ASSOC, 4510 IPW_DL_ASSOC,
4512 "associated: '%s' %pM\n", 4511 "associated: '%*pE' %pM\n",
4513 print_ssid(ssid, priv->essid, 4512 priv->essid_len, priv->essid,
4514 priv->essid_len),
4515 priv->bssid); 4513 priv->bssid);
4516 4514
4517 switch (priv->ieee->iw_mode) { 4515 switch (priv->ieee->iw_mode) {
@@ -4585,14 +4583,9 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4585 IPW_DEBUG(IPW_DL_NOTIF | 4583 IPW_DEBUG(IPW_DL_NOTIF |
4586 IPW_DL_STATE | 4584 IPW_DL_STATE |
4587 IPW_DL_ASSOC, 4585 IPW_DL_ASSOC,
4588 "deauthenticated: '%s' " 4586 "deauthenticated: '%*pE' %pM: (0x%04X) - %s\n",
4589 "%pM" 4587 priv->essid_len,
4590 ": (0x%04X) - %s\n", 4588 priv->essid,
4591 print_ssid(ssid,
4592 priv->
4593 essid,
4594 priv->
4595 essid_len),
4596 priv->bssid, 4589 priv->bssid,
4597 le16_to_cpu(auth->status), 4590 le16_to_cpu(auth->status),
4598 ipw_get_status_code 4591 ipw_get_status_code
@@ -4610,9 +4603,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4610 4603
4611 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4604 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4612 IPW_DL_ASSOC, 4605 IPW_DL_ASSOC,
4613 "authenticated: '%s' %pM\n", 4606 "authenticated: '%*pE' %pM\n",
4614 print_ssid(ssid, priv->essid, 4607 priv->essid_len, priv->essid,
4615 priv->essid_len),
4616 priv->bssid); 4608 priv->bssid);
4617 break; 4609 break;
4618 } 4610 }
@@ -4638,9 +4630,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4638 4630
4639 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4631 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4640 IPW_DL_ASSOC, 4632 IPW_DL_ASSOC,
4641 "disassociated: '%s' %pM\n", 4633 "disassociated: '%*pE' %pM\n",
4642 print_ssid(ssid, priv->essid, 4634 priv->essid_len, priv->essid,
4643 priv->essid_len),
4644 priv->bssid); 4635 priv->bssid);
4645 4636
4646 priv->status &= 4637 priv->status &=
@@ -4676,9 +4667,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4676 switch (auth->state) { 4667 switch (auth->state) {
4677 case CMAS_AUTHENTICATED: 4668 case CMAS_AUTHENTICATED:
4678 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, 4669 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
4679 "authenticated: '%s' %pM\n", 4670 "authenticated: '%*pE' %pM\n",
4680 print_ssid(ssid, priv->essid, 4671 priv->essid_len, priv->essid,
4681 priv->essid_len),
4682 priv->bssid); 4672 priv->bssid);
4683 priv->status |= STATUS_AUTH; 4673 priv->status |= STATUS_AUTH;
4684 break; 4674 break;
@@ -4695,9 +4685,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4695 } 4685 }
4696 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4686 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4697 IPW_DL_ASSOC, 4687 IPW_DL_ASSOC,
4698 "deauthenticated: '%s' %pM\n", 4688 "deauthenticated: '%*pE' %pM\n",
4699 print_ssid(ssid, priv->essid, 4689 priv->essid_len, priv->essid,
4700 priv->essid_len),
4701 priv->bssid); 4690 priv->bssid);
4702 4691
4703 priv->status &= ~(STATUS_ASSOCIATING | 4692 priv->status &= ~(STATUS_ASSOCIATING |
@@ -5516,16 +5505,13 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5516 int roaming) 5505 int roaming)
5517{ 5506{
5518 struct ipw_supported_rates rates; 5507 struct ipw_supported_rates rates;
5519 DECLARE_SSID_BUF(ssid);
5520 5508
5521 /* Verify that this network's capability is compatible with the 5509 /* Verify that this network's capability is compatible with the
5522 * current mode (AdHoc or Infrastructure) */ 5510 * current mode (AdHoc or Infrastructure) */
5523 if ((priv->ieee->iw_mode == IW_MODE_ADHOC && 5511 if ((priv->ieee->iw_mode == IW_MODE_ADHOC &&
5524 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5512 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5525 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to " 5513 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded due to capability mismatch.\n",
5526 "capability mismatch.\n", 5514 network->ssid_len, network->ssid,
5527 print_ssid(ssid, network->ssid,
5528 network->ssid_len),
5529 network->bssid); 5515 network->bssid);
5530 return 0; 5516 return 0;
5531 } 5517 }
@@ -5536,10 +5522,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5536 if ((network->ssid_len != match->network->ssid_len) || 5522 if ((network->ssid_len != match->network->ssid_len) ||
5537 memcmp(network->ssid, match->network->ssid, 5523 memcmp(network->ssid, match->network->ssid,
5538 network->ssid_len)) { 5524 network->ssid_len)) {
5539 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5525 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of non-network ESSID.\n",
5540 "because of non-network ESSID.\n", 5526 network->ssid_len, network->ssid,
5541 print_ssid(ssid, network->ssid,
5542 network->ssid_len),
5543 network->bssid); 5527 network->bssid);
5544 return 0; 5528 return 0;
5545 } 5529 }
@@ -5550,17 +5534,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5550 ((network->ssid_len != priv->essid_len) || 5534 ((network->ssid_len != priv->essid_len) ||
5551 memcmp(network->ssid, priv->essid, 5535 memcmp(network->ssid, priv->essid,
5552 min(network->ssid_len, priv->essid_len)))) { 5536 min(network->ssid_len, priv->essid_len)))) {
5553 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5537 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of ESSID mismatch: '%*pE'.\n",
5554 5538 network->ssid_len, network->ssid,
5555 strlcpy(escaped, 5539 network->bssid, priv->essid_len,
5556 print_ssid(ssid, network->ssid, 5540 priv->essid);
5557 network->ssid_len),
5558 sizeof(escaped));
5559 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5560 "because of ESSID mismatch: '%s'.\n",
5561 escaped, network->bssid,
5562 print_ssid(ssid, priv->essid,
5563 priv->essid_len));
5564 return 0; 5541 return 0;
5565 } 5542 }
5566 } 5543 }
@@ -5569,26 +5546,20 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5569 * testing everything else. */ 5546 * testing everything else. */
5570 5547
5571 if (network->time_stamp[0] < match->network->time_stamp[0]) { 5548 if (network->time_stamp[0] < match->network->time_stamp[0]) {
5572 IPW_DEBUG_MERGE("Network '%s excluded because newer than " 5549 IPW_DEBUG_MERGE("Network '%*pE excluded because newer than current network.\n",
5573 "current network.\n", 5550 match->network->ssid_len, match->network->ssid);
5574 print_ssid(ssid, match->network->ssid,
5575 match->network->ssid_len));
5576 return 0; 5551 return 0;
5577 } else if (network->time_stamp[1] < match->network->time_stamp[1]) { 5552 } else if (network->time_stamp[1] < match->network->time_stamp[1]) {
5578 IPW_DEBUG_MERGE("Network '%s excluded because newer than " 5553 IPW_DEBUG_MERGE("Network '%*pE excluded because newer than current network.\n",
5579 "current network.\n", 5554 match->network->ssid_len, match->network->ssid);
5580 print_ssid(ssid, match->network->ssid,
5581 match->network->ssid_len));
5582 return 0; 5555 return 0;
5583 } 5556 }
5584 5557
5585 /* Now go through and see if the requested network is valid... */ 5558 /* Now go through and see if the requested network is valid... */
5586 if (priv->ieee->scan_age != 0 && 5559 if (priv->ieee->scan_age != 0 &&
5587 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5560 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5588 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5561 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of age: %ums.\n",
5589 "because of age: %ums.\n", 5562 network->ssid_len, network->ssid,
5590 print_ssid(ssid, network->ssid,
5591 network->ssid_len),
5592 network->bssid, 5563 network->bssid,
5593 jiffies_to_msecs(jiffies - 5564 jiffies_to_msecs(jiffies -
5594 network->last_scanned)); 5565 network->last_scanned));
@@ -5597,10 +5568,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5597 5568
5598 if ((priv->config & CFG_STATIC_CHANNEL) && 5569 if ((priv->config & CFG_STATIC_CHANNEL) &&
5599 (network->channel != priv->channel)) { 5570 (network->channel != priv->channel)) {
5600 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5571 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of channel mismatch: %d != %d.\n",
5601 "because of channel mismatch: %d != %d.\n", 5572 network->ssid_len, network->ssid,
5602 print_ssid(ssid, network->ssid,
5603 network->ssid_len),
5604 network->bssid, 5573 network->bssid,
5605 network->channel, priv->channel); 5574 network->channel, priv->channel);
5606 return 0; 5575 return 0;
@@ -5609,10 +5578,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5609 /* Verify privacy compatibility */ 5578 /* Verify privacy compatibility */
5610 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5579 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5611 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5580 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5612 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5581 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of privacy mismatch: %s != %s.\n",
5613 "because of privacy mismatch: %s != %s.\n", 5582 network->ssid_len, network->ssid,
5614 print_ssid(ssid, network->ssid,
5615 network->ssid_len),
5616 network->bssid, 5583 network->bssid,
5617 priv-> 5584 priv->
5618 capability & CAP_PRIVACY_ON ? "on" : "off", 5585 capability & CAP_PRIVACY_ON ? "on" : "off",
@@ -5623,22 +5590,16 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5623 } 5590 }
5624 5591
5625 if (ether_addr_equal(network->bssid, priv->bssid)) { 5592 if (ether_addr_equal(network->bssid, priv->bssid)) {
5626 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5593 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of the same BSSID match: %pM.\n",
5627 "because of the same BSSID match: %pM" 5594 network->ssid_len, network->ssid,
5628 ".\n", print_ssid(ssid, network->ssid, 5595 network->bssid, priv->bssid);
5629 network->ssid_len),
5630 network->bssid,
5631 priv->bssid);
5632 return 0; 5596 return 0;
5633 } 5597 }
5634 5598
5635 /* Filter out any incompatible freq / mode combinations */ 5599 /* Filter out any incompatible freq / mode combinations */
5636 if (!libipw_is_valid_mode(priv->ieee, network->mode)) { 5600 if (!libipw_is_valid_mode(priv->ieee, network->mode)) {
5637 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5601 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of invalid frequency/mode combination.\n",
5638 "because of invalid frequency/mode " 5602 network->ssid_len, network->ssid,
5639 "combination.\n",
5640 print_ssid(ssid, network->ssid,
5641 network->ssid_len),
5642 network->bssid); 5603 network->bssid);
5643 return 0; 5604 return 0;
5644 } 5605 }
@@ -5646,20 +5607,15 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5646 /* Ensure that the rates supported by the driver are compatible with 5607 /* Ensure that the rates supported by the driver are compatible with
5647 * this AP, including verification of basic rates (mandatory) */ 5608 * this AP, including verification of basic rates (mandatory) */
5648 if (!ipw_compatible_rates(priv, network, &rates)) { 5609 if (!ipw_compatible_rates(priv, network, &rates)) {
5649 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5610 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because configured rate mask excludes AP mandatory rate.\n",
5650 "because configured rate mask excludes " 5611 network->ssid_len, network->ssid,
5651 "AP mandatory rate.\n",
5652 print_ssid(ssid, network->ssid,
5653 network->ssid_len),
5654 network->bssid); 5612 network->bssid);
5655 return 0; 5613 return 0;
5656 } 5614 }
5657 5615
5658 if (rates.num_rates == 0) { 5616 if (rates.num_rates == 0) {
5659 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5617 IPW_DEBUG_MERGE("Network '%*pE (%pM)' excluded because of no compatible rates.\n",
5660 "because of no compatible rates.\n", 5618 network->ssid_len, network->ssid,
5661 print_ssid(ssid, network->ssid,
5662 network->ssid_len),
5663 network->bssid); 5619 network->bssid);
5664 return 0; 5620 return 0;
5665 } 5621 }
@@ -5671,16 +5627,14 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5671 /* Set up 'new' AP to this network */ 5627 /* Set up 'new' AP to this network */
5672 ipw_copy_rates(&match->rates, &rates); 5628 ipw_copy_rates(&match->rates, &rates);
5673 match->network = network; 5629 match->network = network;
5674 IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n", 5630 IPW_DEBUG_MERGE("Network '%*pE (%pM)' is a viable match.\n",
5675 print_ssid(ssid, network->ssid, network->ssid_len), 5631 network->ssid_len, network->ssid, network->bssid);
5676 network->bssid);
5677 5632
5678 return 1; 5633 return 1;
5679} 5634}
5680 5635
5681static void ipw_merge_adhoc_network(struct work_struct *work) 5636static void ipw_merge_adhoc_network(struct work_struct *work)
5682{ 5637{
5683 DECLARE_SSID_BUF(ssid);
5684 struct ipw_priv *priv = 5638 struct ipw_priv *priv =
5685 container_of(work, struct ipw_priv, merge_networks); 5639 container_of(work, struct ipw_priv, merge_networks);
5686 struct libipw_network *network = NULL; 5640 struct libipw_network *network = NULL;
@@ -5710,9 +5664,8 @@ static void ipw_merge_adhoc_network(struct work_struct *work)
5710 5664
5711 mutex_lock(&priv->mutex); 5665 mutex_lock(&priv->mutex);
5712 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) { 5666 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
5713 IPW_DEBUG_MERGE("remove network %s\n", 5667 IPW_DEBUG_MERGE("remove network %*pE\n",
5714 print_ssid(ssid, priv->essid, 5668 priv->essid_len, priv->essid);
5715 priv->essid_len));
5716 ipw_remove_current_network(priv); 5669 ipw_remove_current_network(priv);
5717 } 5670 }
5718 5671
@@ -5728,7 +5681,6 @@ static int ipw_best_network(struct ipw_priv *priv,
5728 struct libipw_network *network, int roaming) 5681 struct libipw_network *network, int roaming)
5729{ 5682{
5730 struct ipw_supported_rates rates; 5683 struct ipw_supported_rates rates;
5731 DECLARE_SSID_BUF(ssid);
5732 5684
5733 /* Verify that this network's capability is compatible with the 5685 /* Verify that this network's capability is compatible with the
5734 * current mode (AdHoc or Infrastructure) */ 5686 * current mode (AdHoc or Infrastructure) */
@@ -5736,10 +5688,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5736 !(network->capability & WLAN_CAPABILITY_ESS)) || 5688 !(network->capability & WLAN_CAPABILITY_ESS)) ||
5737 (priv->ieee->iw_mode == IW_MODE_ADHOC && 5689 (priv->ieee->iw_mode == IW_MODE_ADHOC &&
5738 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5690 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5739 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to " 5691 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded due to capability mismatch.\n",
5740 "capability mismatch.\n", 5692 network->ssid_len, network->ssid,
5741 print_ssid(ssid, network->ssid,
5742 network->ssid_len),
5743 network->bssid); 5693 network->bssid);
5744 return 0; 5694 return 0;
5745 } 5695 }
@@ -5750,10 +5700,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5750 if ((network->ssid_len != match->network->ssid_len) || 5700 if ((network->ssid_len != match->network->ssid_len) ||
5751 memcmp(network->ssid, match->network->ssid, 5701 memcmp(network->ssid, match->network->ssid,
5752 network->ssid_len)) { 5702 network->ssid_len)) {
5753 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5703 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of non-network ESSID.\n",
5754 "because of non-network ESSID.\n", 5704 network->ssid_len, network->ssid,
5755 print_ssid(ssid, network->ssid,
5756 network->ssid_len),
5757 network->bssid); 5705 network->bssid);
5758 return 0; 5706 return 0;
5759 } 5707 }
@@ -5764,16 +5712,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5764 ((network->ssid_len != priv->essid_len) || 5712 ((network->ssid_len != priv->essid_len) ||
5765 memcmp(network->ssid, priv->essid, 5713 memcmp(network->ssid, priv->essid,
5766 min(network->ssid_len, priv->essid_len)))) { 5714 min(network->ssid_len, priv->essid_len)))) {
5767 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5715 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of ESSID mismatch: '%*pE'.\n",
5768 strlcpy(escaped, 5716 network->ssid_len, network->ssid,
5769 print_ssid(ssid, network->ssid, 5717 network->bssid, priv->essid_len,
5770 network->ssid_len), 5718 priv->essid);
5771 sizeof(escaped));
5772 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5773 "because of ESSID mismatch: '%s'.\n",
5774 escaped, network->bssid,
5775 print_ssid(ssid, priv->essid,
5776 priv->essid_len));
5777 return 0; 5719 return 0;
5778 } 5720 }
5779 } 5721 }
@@ -5781,16 +5723,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5781 /* If the old network rate is better than this one, don't bother 5723 /* If the old network rate is better than this one, don't bother
5782 * testing everything else. */ 5724 * testing everything else. */
5783 if (match->network && match->network->stats.rssi > network->stats.rssi) { 5725 if (match->network && match->network->stats.rssi > network->stats.rssi) {
5784 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5726 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because '%*pE (%pM)' has a stronger signal.\n",
5785 strlcpy(escaped, 5727 network->ssid_len, network->ssid,
5786 print_ssid(ssid, network->ssid, network->ssid_len), 5728 network->bssid, match->network->ssid_len,
5787 sizeof(escaped)); 5729 match->network->ssid, match->network->bssid);
5788 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "
5789 "'%s (%pM)' has a stronger signal.\n",
5790 escaped, network->bssid,
5791 print_ssid(ssid, match->network->ssid,
5792 match->network->ssid_len),
5793 match->network->bssid);
5794 return 0; 5730 return 0;
5795 } 5731 }
5796 5732
@@ -5798,11 +5734,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5798 * last 3 seconds, do not try and associate again... */ 5734 * last 3 seconds, do not try and associate again... */
5799 if (network->last_associate && 5735 if (network->last_associate &&
5800 time_after(network->last_associate + (HZ * 3UL), jiffies)) { 5736 time_after(network->last_associate + (HZ * 3UL), jiffies)) {
5801 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5737 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of storming (%ums since last assoc attempt).\n",
5802 "because of storming (%ums since last " 5738 network->ssid_len, network->ssid,
5803 "assoc attempt).\n",
5804 print_ssid(ssid, network->ssid,
5805 network->ssid_len),
5806 network->bssid, 5739 network->bssid,
5807 jiffies_to_msecs(jiffies - 5740 jiffies_to_msecs(jiffies -
5808 network->last_associate)); 5741 network->last_associate));
@@ -5812,10 +5745,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5812 /* Now go through and see if the requested network is valid... */ 5745 /* Now go through and see if the requested network is valid... */
5813 if (priv->ieee->scan_age != 0 && 5746 if (priv->ieee->scan_age != 0 &&
5814 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5747 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5815 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5748 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of age: %ums.\n",
5816 "because of age: %ums.\n", 5749 network->ssid_len, network->ssid,
5817 print_ssid(ssid, network->ssid,
5818 network->ssid_len),
5819 network->bssid, 5750 network->bssid,
5820 jiffies_to_msecs(jiffies - 5751 jiffies_to_msecs(jiffies -
5821 network->last_scanned)); 5752 network->last_scanned));
@@ -5824,10 +5755,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5824 5755
5825 if ((priv->config & CFG_STATIC_CHANNEL) && 5756 if ((priv->config & CFG_STATIC_CHANNEL) &&
5826 (network->channel != priv->channel)) { 5757 (network->channel != priv->channel)) {
5827 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5758 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of channel mismatch: %d != %d.\n",
5828 "because of channel mismatch: %d != %d.\n", 5759 network->ssid_len, network->ssid,
5829 print_ssid(ssid, network->ssid,
5830 network->ssid_len),
5831 network->bssid, 5760 network->bssid,
5832 network->channel, priv->channel); 5761 network->channel, priv->channel);
5833 return 0; 5762 return 0;
@@ -5836,10 +5765,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5836 /* Verify privacy compatibility */ 5765 /* Verify privacy compatibility */
5837 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5766 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5838 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5767 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5839 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5768 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of privacy mismatch: %s != %s.\n",
5840 "because of privacy mismatch: %s != %s.\n", 5769 network->ssid_len, network->ssid,
5841 print_ssid(ssid, network->ssid,
5842 network->ssid_len),
5843 network->bssid, 5770 network->bssid,
5844 priv->capability & CAP_PRIVACY_ON ? "on" : 5771 priv->capability & CAP_PRIVACY_ON ? "on" :
5845 "off", 5772 "off",
@@ -5850,31 +5777,24 @@ static int ipw_best_network(struct ipw_priv *priv,
5850 5777
5851 if ((priv->config & CFG_STATIC_BSSID) && 5778 if ((priv->config & CFG_STATIC_BSSID) &&
5852 !ether_addr_equal(network->bssid, priv->bssid)) { 5779 !ether_addr_equal(network->bssid, priv->bssid)) {
5853 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5780 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of BSSID mismatch: %pM.\n",
5854 "because of BSSID mismatch: %pM.\n", 5781 network->ssid_len, network->ssid,
5855 print_ssid(ssid, network->ssid,
5856 network->ssid_len),
5857 network->bssid, priv->bssid); 5782 network->bssid, priv->bssid);
5858 return 0; 5783 return 0;
5859 } 5784 }
5860 5785
5861 /* Filter out any incompatible freq / mode combinations */ 5786 /* Filter out any incompatible freq / mode combinations */
5862 if (!libipw_is_valid_mode(priv->ieee, network->mode)) { 5787 if (!libipw_is_valid_mode(priv->ieee, network->mode)) {
5863 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5788 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of invalid frequency/mode combination.\n",
5864 "because of invalid frequency/mode " 5789 network->ssid_len, network->ssid,
5865 "combination.\n",
5866 print_ssid(ssid, network->ssid,
5867 network->ssid_len),
5868 network->bssid); 5790 network->bssid);
5869 return 0; 5791 return 0;
5870 } 5792 }
5871 5793
5872 /* Filter out invalid channel in current GEO */ 5794 /* Filter out invalid channel in current GEO */
5873 if (!libipw_is_valid_channel(priv->ieee, network->channel)) { 5795 if (!libipw_is_valid_channel(priv->ieee, network->channel)) {
5874 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5796 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of invalid channel in current GEO\n",
5875 "because of invalid channel in current GEO\n", 5797 network->ssid_len, network->ssid,
5876 print_ssid(ssid, network->ssid,
5877 network->ssid_len),
5878 network->bssid); 5798 network->bssid);
5879 return 0; 5799 return 0;
5880 } 5800 }
@@ -5882,20 +5802,15 @@ static int ipw_best_network(struct ipw_priv *priv,
5882 /* Ensure that the rates supported by the driver are compatible with 5802 /* Ensure that the rates supported by the driver are compatible with
5883 * this AP, including verification of basic rates (mandatory) */ 5803 * this AP, including verification of basic rates (mandatory) */
5884 if (!ipw_compatible_rates(priv, network, &rates)) { 5804 if (!ipw_compatible_rates(priv, network, &rates)) {
5885 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5805 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because configured rate mask excludes AP mandatory rate.\n",
5886 "because configured rate mask excludes " 5806 network->ssid_len, network->ssid,
5887 "AP mandatory rate.\n",
5888 print_ssid(ssid, network->ssid,
5889 network->ssid_len),
5890 network->bssid); 5807 network->bssid);
5891 return 0; 5808 return 0;
5892 } 5809 }
5893 5810
5894 if (rates.num_rates == 0) { 5811 if (rates.num_rates == 0) {
5895 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5812 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' excluded because of no compatible rates.\n",
5896 "because of no compatible rates.\n", 5813 network->ssid_len, network->ssid,
5897 print_ssid(ssid, network->ssid,
5898 network->ssid_len),
5899 network->bssid); 5814 network->bssid);
5900 return 0; 5815 return 0;
5901 } 5816 }
@@ -5908,9 +5823,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5908 ipw_copy_rates(&match->rates, &rates); 5823 ipw_copy_rates(&match->rates, &rates);
5909 match->network = network; 5824 match->network = network;
5910 5825
5911 IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n", 5826 IPW_DEBUG_ASSOC("Network '%*pE (%pM)' is a viable match.\n",
5912 print_ssid(ssid, network->ssid, network->ssid_len), 5827 network->ssid_len, network->ssid, network->bssid);
5913 network->bssid);
5914 5828
5915 return 1; 5829 return 1;
5916} 5830}
@@ -6152,7 +6066,6 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
6152 6066
6153static void ipw_debug_config(struct ipw_priv *priv) 6067static void ipw_debug_config(struct ipw_priv *priv)
6154{ 6068{
6155 DECLARE_SSID_BUF(ssid);
6156 IPW_DEBUG_INFO("Scan completed, no valid APs matched " 6069 IPW_DEBUG_INFO("Scan completed, no valid APs matched "
6157 "[CFG 0x%08X]\n", priv->config); 6070 "[CFG 0x%08X]\n", priv->config);
6158 if (priv->config & CFG_STATIC_CHANNEL) 6071 if (priv->config & CFG_STATIC_CHANNEL)
@@ -6160,8 +6073,8 @@ static void ipw_debug_config(struct ipw_priv *priv)
6160 else 6073 else
6161 IPW_DEBUG_INFO("Channel unlocked.\n"); 6074 IPW_DEBUG_INFO("Channel unlocked.\n");
6162 if (priv->config & CFG_STATIC_ESSID) 6075 if (priv->config & CFG_STATIC_ESSID)
6163 IPW_DEBUG_INFO("ESSID locked to '%s'\n", 6076 IPW_DEBUG_INFO("ESSID locked to '%*pE'\n",
6164 print_ssid(ssid, priv->essid, priv->essid_len)); 6077 priv->essid_len, priv->essid);
6165 else 6078 else
6166 IPW_DEBUG_INFO("ESSID unlocked.\n"); 6079 IPW_DEBUG_INFO("ESSID unlocked.\n");
6167 if (priv->config & CFG_STATIC_BSSID) 6080 if (priv->config & CFG_STATIC_BSSID)
@@ -7385,7 +7298,6 @@ static int ipw_associate_network(struct ipw_priv *priv,
7385 struct ipw_supported_rates *rates, int roaming) 7298 struct ipw_supported_rates *rates, int roaming)
7386{ 7299{
7387 int err; 7300 int err;
7388 DECLARE_SSID_BUF(ssid);
7389 7301
7390 if (priv->config & CFG_FIXED_RATE) 7302 if (priv->config & CFG_FIXED_RATE)
7391 ipw_set_fixed_rate(priv, network->mode); 7303 ipw_set_fixed_rate(priv, network->mode);
@@ -7451,10 +7363,9 @@ static int ipw_associate_network(struct ipw_priv *priv,
7451 priv->assoc_request.capability &= 7363 priv->assoc_request.capability &=
7452 ~cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 7364 ~cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME);
7453 7365
7454 IPW_DEBUG_ASSOC("%ssociation attempt: '%s', channel %d, " 7366 IPW_DEBUG_ASSOC("%ssociation attempt: '%*pE', channel %d, 802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n",
7455 "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n",
7456 roaming ? "Rea" : "A", 7367 roaming ? "Rea" : "A",
7457 print_ssid(ssid, priv->essid, priv->essid_len), 7368 priv->essid_len, priv->essid,
7458 network->channel, 7369 network->channel,
7459 ipw_modes[priv->assoc_request.ieee_mode], 7370 ipw_modes[priv->assoc_request.ieee_mode],
7460 rates->num_rates, 7371 rates->num_rates,
@@ -7553,9 +7464,8 @@ static int ipw_associate_network(struct ipw_priv *priv,
7553 return err; 7464 return err;
7554 } 7465 }
7555 7466
7556 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM\n", 7467 IPW_DEBUG(IPW_DL_STATE, "associating: '%*pE' %pM\n",
7557 print_ssid(ssid, priv->essid, priv->essid_len), 7468 priv->essid_len, priv->essid, priv->bssid);
7558 priv->bssid);
7559 7469
7560 return 0; 7470 return 0;
7561} 7471}
@@ -7645,7 +7555,6 @@ static int ipw_associate(void *data)
7645 struct ipw_supported_rates *rates; 7555 struct ipw_supported_rates *rates;
7646 struct list_head *element; 7556 struct list_head *element;
7647 unsigned long flags; 7557 unsigned long flags;
7648 DECLARE_SSID_BUF(ssid);
7649 7558
7650 if (priv->ieee->iw_mode == IW_MODE_MONITOR) { 7559 if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
7651 IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n"); 7560 IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n");
@@ -7704,10 +7613,8 @@ static int ipw_associate(void *data)
7704 /* If there are no more slots, expire the oldest */ 7613 /* If there are no more slots, expire the oldest */
7705 list_del(&oldest->list); 7614 list_del(&oldest->list);
7706 target = oldest; 7615 target = oldest;
7707 IPW_DEBUG_ASSOC("Expired '%s' (%pM) from " 7616 IPW_DEBUG_ASSOC("Expired '%*pE' (%pM) from network list.\n",
7708 "network list.\n", 7617 target->ssid_len, target->ssid,
7709 print_ssid(ssid, target->ssid,
7710 target->ssid_len),
7711 target->bssid); 7618 target->bssid);
7712 list_add_tail(&target->list, 7619 list_add_tail(&target->list,
7713 &priv->ieee->network_free_list); 7620 &priv->ieee->network_free_list);
@@ -9093,7 +9000,6 @@ static int ipw_wx_set_essid(struct net_device *dev,
9093{ 9000{
9094 struct ipw_priv *priv = libipw_priv(dev); 9001 struct ipw_priv *priv = libipw_priv(dev);
9095 int length; 9002 int length;
9096 DECLARE_SSID_BUF(ssid);
9097 9003
9098 mutex_lock(&priv->mutex); 9004 mutex_lock(&priv->mutex);
9099 9005
@@ -9118,8 +9024,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
9118 return 0; 9024 return 0;
9119 } 9025 }
9120 9026
9121 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", 9027 IPW_DEBUG_WX("Setting ESSID: '%*pE' (%d)\n", length, extra, length);
9122 print_ssid(ssid, extra, length), length);
9123 9028
9124 priv->essid_len = length; 9029 priv->essid_len = length;
9125 memcpy(priv->essid, extra, priv->essid_len); 9030 memcpy(priv->essid, extra, priv->essid_len);
@@ -9138,15 +9043,14 @@ static int ipw_wx_get_essid(struct net_device *dev,
9138 union iwreq_data *wrqu, char *extra) 9043 union iwreq_data *wrqu, char *extra)
9139{ 9044{
9140 struct ipw_priv *priv = libipw_priv(dev); 9045 struct ipw_priv *priv = libipw_priv(dev);
9141 DECLARE_SSID_BUF(ssid);
9142 9046
9143 /* If we are associated, trying to associate, or have a statically 9047 /* If we are associated, trying to associate, or have a statically
9144 * configured ESSID then return that; otherwise return ANY */ 9048 * configured ESSID then return that; otherwise return ANY */
9145 mutex_lock(&priv->mutex); 9049 mutex_lock(&priv->mutex);
9146 if (priv->config & CFG_STATIC_ESSID || 9050 if (priv->config & CFG_STATIC_ESSID ||
9147 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { 9051 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) {
9148 IPW_DEBUG_WX("Getting essid: '%s'\n", 9052 IPW_DEBUG_WX("Getting essid: '%*pE'\n",
9149 print_ssid(ssid, priv->essid, priv->essid_len)); 9053 priv->essid_len, priv->essid);
9150 memcpy(extra, priv->essid, priv->essid_len); 9054 memcpy(extra, priv->essid, priv->essid_len);
9151 wrqu->essid.length = priv->essid_len; 9055 wrqu->essid.length = priv->essid_len;
9152 wrqu->essid.flags = 1; /* active */ 9056 wrqu->essid.flags = 1; /* active */
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index a586a85bfcfe..2d66984079bb 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -1120,7 +1120,6 @@ static int libipw_parse_info_param(struct libipw_info_element
1120 *info_element, u16 length, 1120 *info_element, u16 length,
1121 struct libipw_network *network) 1121 struct libipw_network *network)
1122{ 1122{
1123 DECLARE_SSID_BUF(ssid);
1124 u8 i; 1123 u8 i;
1125#ifdef CONFIG_LIBIPW_DEBUG 1124#ifdef CONFIG_LIBIPW_DEBUG
1126 char rates_str[64]; 1125 char rates_str[64];
@@ -1151,10 +1150,9 @@ static int libipw_parse_info_param(struct libipw_info_element
1151 memset(network->ssid + network->ssid_len, 0, 1150 memset(network->ssid + network->ssid_len, 0,
1152 IW_ESSID_MAX_SIZE - network->ssid_len); 1151 IW_ESSID_MAX_SIZE - network->ssid_len);
1153 1152
1154 LIBIPW_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n", 1153 LIBIPW_DEBUG_MGMT("WLAN_EID_SSID: '%*pE' len=%d.\n",
1155 print_ssid(ssid, network->ssid, 1154 network->ssid_len, network->ssid,
1156 network->ssid_len), 1155 network->ssid_len);
1157 network->ssid_len);
1158 break; 1156 break;
1159 1157
1160 case WLAN_EID_SUPP_RATES: 1158 case WLAN_EID_SUPP_RATES:
@@ -1399,8 +1397,6 @@ static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_r
1399 struct libipw_network *network, 1397 struct libipw_network *network,
1400 struct libipw_rx_stats *stats) 1398 struct libipw_rx_stats *stats)
1401{ 1399{
1402 DECLARE_SSID_BUF(ssid);
1403
1404 network->qos_data.active = 0; 1400 network->qos_data.active = 0;
1405 network->qos_data.supported = 0; 1401 network->qos_data.supported = 0;
1406 network->qos_data.param_count = 0; 1402 network->qos_data.param_count = 0;
@@ -1447,11 +1443,9 @@ static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_r
1447 } 1443 }
1448 1444
1449 if (network->mode == 0) { 1445 if (network->mode == 0) {
1450 LIBIPW_DEBUG_SCAN("Filtered out '%s (%pM)' " 1446 LIBIPW_DEBUG_SCAN("Filtered out '%*pE (%pM)' network.\n",
1451 "network.\n", 1447 network->ssid_len, network->ssid,
1452 print_ssid(ssid, network->ssid, 1448 network->bssid);
1453 network->ssid_len),
1454 network->bssid);
1455 return 1; 1449 return 1;
1456 } 1450 }
1457 1451
@@ -1563,11 +1557,9 @@ static void libipw_process_probe_response(struct libipw_device
1563 struct libipw_info_element *info_element = beacon->info_element; 1557 struct libipw_info_element *info_element = beacon->info_element;
1564#endif 1558#endif
1565 unsigned long flags; 1559 unsigned long flags;
1566 DECLARE_SSID_BUF(ssid);
1567 1560
1568 LIBIPW_DEBUG_SCAN("'%s' (%pM" 1561 LIBIPW_DEBUG_SCAN("'%*pE' (%pM): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1569 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1562 info_element->len, info_element->data,
1570 print_ssid(ssid, info_element->data, info_element->len),
1571 beacon->header.addr3, 1563 beacon->header.addr3,
1572 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', 1564 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
1573 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', 1565 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
@@ -1587,12 +1579,11 @@ static void libipw_process_probe_response(struct libipw_device
1587 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); 1579 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0');
1588 1580
1589 if (libipw_network_init(ieee, beacon, &network, stats)) { 1581 if (libipw_network_init(ieee, beacon, &network, stats)) {
1590 LIBIPW_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", 1582 LIBIPW_DEBUG_SCAN("Dropped '%*pE' (%pM) via %s.\n",
1591 print_ssid(ssid, info_element->data, 1583 info_element->len, info_element->data,
1592 info_element->len), 1584 beacon->header.addr3,
1593 beacon->header.addr3, 1585 is_beacon(beacon->header.frame_ctl) ?
1594 is_beacon(beacon->header.frame_ctl) ? 1586 "BEACON" : "PROBE RESPONSE");
1595 "BEACON" : "PROBE RESPONSE");
1596 return; 1587 return;
1597 } 1588 }
1598 1589
@@ -1624,11 +1615,9 @@ static void libipw_process_probe_response(struct libipw_device
1624 /* If there are no more slots, expire the oldest */ 1615 /* If there are no more slots, expire the oldest */
1625 list_del(&oldest->list); 1616 list_del(&oldest->list);
1626 target = oldest; 1617 target = oldest;
1627 LIBIPW_DEBUG_SCAN("Expired '%s' (%pM) from " 1618 LIBIPW_DEBUG_SCAN("Expired '%*pE' (%pM) from network list.\n",
1628 "network list.\n", 1619 target->ssid_len, target->ssid,
1629 print_ssid(ssid, target->ssid, 1620 target->bssid);
1630 target->ssid_len),
1631 target->bssid);
1632 libipw_network_reset(target); 1621 libipw_network_reset(target);
1633 } else { 1622 } else {
1634 /* Otherwise just pull from the free list */ 1623 /* Otherwise just pull from the free list */
@@ -1638,23 +1627,21 @@ static void libipw_process_probe_response(struct libipw_device
1638 } 1627 }
1639 1628
1640#ifdef CONFIG_LIBIPW_DEBUG 1629#ifdef CONFIG_LIBIPW_DEBUG
1641 LIBIPW_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", 1630 LIBIPW_DEBUG_SCAN("Adding '%*pE' (%pM) via %s.\n",
1642 print_ssid(ssid, network.ssid, 1631 network.ssid_len, network.ssid,
1643 network.ssid_len), 1632 network.bssid,
1644 network.bssid, 1633 is_beacon(beacon->header.frame_ctl) ?
1645 is_beacon(beacon->header.frame_ctl) ? 1634 "BEACON" : "PROBE RESPONSE");
1646 "BEACON" : "PROBE RESPONSE");
1647#endif 1635#endif
1648 memcpy(target, &network, sizeof(*target)); 1636 memcpy(target, &network, sizeof(*target));
1649 network.ibss_dfs = NULL; 1637 network.ibss_dfs = NULL;
1650 list_add_tail(&target->list, &ieee->network_list); 1638 list_add_tail(&target->list, &ieee->network_list);
1651 } else { 1639 } else {
1652 LIBIPW_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", 1640 LIBIPW_DEBUG_SCAN("Updating '%*pE' (%pM) via %s.\n",
1653 print_ssid(ssid, target->ssid, 1641 target->ssid_len, target->ssid,
1654 target->ssid_len), 1642 target->bssid,
1655 target->bssid, 1643 is_beacon(beacon->header.frame_ctl) ?
1656 is_beacon(beacon->header.frame_ctl) ? 1644 "BEACON" : "PROBE RESPONSE");
1657 "BEACON" : "PROBE RESPONSE");
1658 update_network(target, &network); 1645 update_network(target, &network);
1659 network.ibss_dfs = NULL; 1646 network.ibss_dfs = NULL;
1660 } 1647 }
diff --git a/drivers/net/wireless/ipw2x00/libipw_wx.c b/drivers/net/wireless/ipw2x00/libipw_wx.c
index 54aba4744438..dd29f46d086b 100644
--- a/drivers/net/wireless/ipw2x00/libipw_wx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_wx.c
@@ -272,7 +272,6 @@ int libipw_wx_get_scan(struct libipw_device *ieee,
272 char *ev = extra; 272 char *ev = extra;
273 char *stop = ev + wrqu->data.length; 273 char *stop = ev + wrqu->data.length;
274 int i = 0; 274 int i = 0;
275 DECLARE_SSID_BUF(ssid);
276 275
277 LIBIPW_DEBUG_WX("Getting scan\n"); 276 LIBIPW_DEBUG_WX("Getting scan\n");
278 277
@@ -290,12 +289,10 @@ int libipw_wx_get_scan(struct libipw_device *ieee,
290 ev = libipw_translate_scan(ieee, ev, stop, network, 289 ev = libipw_translate_scan(ieee, ev, stop, network,
291 info); 290 info);
292 else { 291 else {
293 LIBIPW_DEBUG_SCAN("Not showing network '%s (" 292 LIBIPW_DEBUG_SCAN("Not showing network '%*pE (%pM)' due to age (%ums).\n",
294 "%pM)' due to age (%ums).\n", 293 network->ssid_len, network->ssid,
295 print_ssid(ssid, network->ssid, 294 network->bssid,
296 network->ssid_len), 295 elapsed_jiffies_msecs(
297 network->bssid,
298 elapsed_jiffies_msecs(
299 network->last_scanned)); 296 network->last_scanned));
300 } 297 }
301 } 298 }
@@ -322,7 +319,6 @@ int libipw_wx_set_encode(struct libipw_device *ieee,
322 int i, key, key_provided, len; 319 int i, key, key_provided, len;
323 struct lib80211_crypt_data **crypt; 320 struct lib80211_crypt_data **crypt;
324 int host_crypto = ieee->host_encrypt || ieee->host_decrypt; 321 int host_crypto = ieee->host_encrypt || ieee->host_decrypt;
325 DECLARE_SSID_BUF(ssid);
326 322
327 LIBIPW_DEBUG_WX("SET_ENCODE\n"); 323 LIBIPW_DEBUG_WX("SET_ENCODE\n");
328 324
@@ -417,8 +413,8 @@ int libipw_wx_set_encode(struct libipw_device *ieee,
417 if (len > erq->length) 413 if (len > erq->length)
418 memset(sec.keys[key] + erq->length, 0, 414 memset(sec.keys[key] + erq->length, 0,
419 len - erq->length); 415 len - erq->length);
420 LIBIPW_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", 416 LIBIPW_DEBUG_WX("Setting key %d to '%*pE' (%d:%d bytes)\n",
421 key, print_ssid(ssid, sec.keys[key], len), 417 key, len, sec.keys[key],
422 erq->length, len); 418 erq->length, len);
423 sec.key_sizes[key] = len; 419 sec.key_sizes[key] = len;
424 if (*crypt) 420 if (*crypt)