aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2008-09-30 20:59:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:50 -0400
commit9387b7caf3049168fc97a8a9111af8fe2143af18 (patch)
tree6a19e5477d6a6badf19788536a9d3e1913ae48e1
parent2819f8ad6da1e24b5dd94a221978e61f2a9c972a (diff)
wireless: use individual buffers for printing ssid values
Also change escape_ssid to print_ssid to match print_mac semantics. Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ipw2100.c20
-rw-r--r--drivers/net/wireless/ipw2200.c153
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
-rw-r--r--drivers/net/wireless/libertas/assoc.c17
-rw-r--r--drivers/net/wireless/libertas/cmd.c3
-rw-r--r--drivers/net/wireless/libertas/debugfs.c4
-rw-r--r--drivers/net/wireless/libertas/scan.c12
-rw-r--r--drivers/net/wireless/libertas/wext.c3
-rw-r--r--include/linux/ieee80211.h6
-rw-r--r--include/net/lib80211.h5
-rw-r--r--net/ieee80211/ieee80211_rx.c19
-rw-r--r--net/ieee80211/ieee80211_wx.c7
-rw-r--r--net/wireless/lib80211.c9
14 files changed, 168 insertions, 106 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 223914e3e07e..062c9f280304 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -163,6 +163,8 @@ that only one external action is invoked at a time.
163#include <linux/ctype.h> 163#include <linux/ctype.h>
164#include <linux/pm_qos_params.h> 164#include <linux/pm_qos_params.h>
165 165
166#include <net/lib80211.h>
167
166#include "ipw2100.h" 168#include "ipw2100.h"
167 169
168#define IPW2100_VERSION "git-1.2.2" 170#define IPW2100_VERSION "git-1.2.2"
@@ -1914,6 +1916,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1914 u32 chan; 1916 u32 chan;
1915 char *txratename; 1917 char *txratename;
1916 u8 bssid[ETH_ALEN]; 1918 u8 bssid[ETH_ALEN];
1919 DECLARE_SSID_BUF(ssid);
1917 1920
1918 /* 1921 /*
1919 * TBD: BSSID is usually 00:00:00:00:00:00 here and not 1922 * TBD: BSSID is usually 00:00:00:00:00:00 here and not
@@ -1975,7 +1978,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1975 } 1978 }
1976 1979
1977 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n", 1980 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n",
1978 priv->net_dev->name, escape_ssid(essid, essid_len), 1981 priv->net_dev->name, print_ssid(ssid, essid, essid_len),
1979 txratename, chan, bssid); 1982 txratename, chan, bssid);
1980 1983
1981 /* now we copy read ssid into dev */ 1984 /* now we copy read ssid into dev */
@@ -2002,8 +2005,9 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2002 .host_command_length = ssid_len 2005 .host_command_length = ssid_len
2003 }; 2006 };
2004 int err; 2007 int err;
2008 DECLARE_SSID_BUF(ssid);
2005 2009
2006 IPW_DEBUG_HC("SSID: '%s'\n", escape_ssid(essid, ssid_len)); 2010 IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len));
2007 2011
2008 if (ssid_len) 2012 if (ssid_len)
2009 memcpy(cmd.host_command_parameters, essid, ssid_len); 2013 memcpy(cmd.host_command_parameters, essid, ssid_len);
@@ -2044,9 +2048,11 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2044 2048
2045static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) 2049static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
2046{ 2050{
2051 DECLARE_SSID_BUF(ssid);
2052
2047 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, 2053 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
2048 "disassociated: '%s' %pM \n", 2054 "disassociated: '%s' %pM \n",
2049 escape_ssid(priv->essid, priv->essid_len), 2055 print_ssid(ssid, priv->essid, priv->essid_len),
2050 priv->bssid); 2056 priv->bssid);
2051 2057
2052 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2058 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
@@ -6958,6 +6964,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6958 char *essid = ""; /* ANY */ 6964 char *essid = ""; /* ANY */
6959 int length = 0; 6965 int length = 0;
6960 int err = 0; 6966 int err = 0;
6967 DECLARE_SSID_BUF(ssid);
6961 6968
6962 mutex_lock(&priv->action_mutex); 6969 mutex_lock(&priv->action_mutex);
6963 if (!(priv->status & STATUS_INITIALIZED)) { 6970 if (!(priv->status & STATUS_INITIALIZED)) {
@@ -6987,8 +6994,8 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6987 goto done; 6994 goto done;
6988 } 6995 }
6989 6996
6990 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_ssid(essid, length), 6997 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n",
6991 length); 6998 print_ssid(ssid, essid, length), length);
6992 6999
6993 priv->essid_len = length; 7000 priv->essid_len = length;
6994 memcpy(priv->essid, essid, priv->essid_len); 7001 memcpy(priv->essid, essid, priv->essid_len);
@@ -7009,12 +7016,13 @@ static int ipw2100_wx_get_essid(struct net_device *dev,
7009 */ 7016 */
7010 7017
7011 struct ipw2100_priv *priv = ieee80211_priv(dev); 7018 struct ipw2100_priv *priv = ieee80211_priv(dev);
7019 DECLARE_SSID_BUF(ssid);
7012 7020
7013 /* If we are associated, trying to associate, or have a statically 7021 /* If we are associated, trying to associate, or have a statically
7014 * configured ESSID then return that; otherwise return ANY */ 7022 * configured ESSID then return that; otherwise return ANY */
7015 if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) { 7023 if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) {
7016 IPW_DEBUG_WX("Getting essid: '%s'\n", 7024 IPW_DEBUG_WX("Getting essid: '%s'\n",
7017 escape_ssid(priv->essid, priv->essid_len)); 7025 print_ssid(ssid, priv->essid, priv->essid_len));
7018 memcpy(extra, priv->essid, priv->essid_len); 7026 memcpy(extra, priv->essid, priv->essid_len);
7019 wrqu->essid.length = priv->essid_len; 7027 wrqu->essid.length = priv->essid_len;
7020 wrqu->essid.flags = 1; /* active */ 7028 wrqu->essid.flags = 1; /* active */
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 6e0c55c64e1f..2b9d96a5c10e 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -4395,6 +4395,7 @@ static void handle_scan_event(struct ipw_priv *priv)
4395static void ipw_rx_notification(struct ipw_priv *priv, 4395static void ipw_rx_notification(struct ipw_priv *priv,
4396 struct ipw_rx_notification *notif) 4396 struct ipw_rx_notification *notif)
4397{ 4397{
4398 DECLARE_SSID_BUF(ssid);
4398 u16 size = le16_to_cpu(notif->size); 4399 u16 size = le16_to_cpu(notif->size);
4399 notif->size = le16_to_cpu(notif->size); 4400 notif->size = le16_to_cpu(notif->size);
4400 4401
@@ -4409,8 +4410,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4409 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4410 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4410 IPW_DL_ASSOC, 4411 IPW_DL_ASSOC,
4411 "associated: '%s' %pM \n", 4412 "associated: '%s' %pM \n",
4412 escape_ssid(priv->essid, 4413 print_ssid(ssid, priv->essid,
4413 priv->essid_len), 4414 priv->essid_len),
4414 priv->bssid); 4415 priv->bssid);
4415 4416
4416 switch (priv->ieee->iw_mode) { 4417 switch (priv->ieee->iw_mode) {
@@ -4490,10 +4491,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4490 "deauthenticated: '%s' " 4491 "deauthenticated: '%s' "
4491 "%pM" 4492 "%pM"
4492 ": (0x%04X) - %s \n", 4493 ": (0x%04X) - %s \n",
4493 escape_ssid(priv-> 4494 print_ssid(ssid,
4494 essid, 4495 priv->
4495 priv-> 4496 essid,
4496 essid_len), 4497 priv->
4498 essid_len),
4497 priv->bssid, 4499 priv->bssid,
4498 le16_to_cpu(auth->status), 4500 le16_to_cpu(auth->status),
4499 ipw_get_status_code 4501 ipw_get_status_code
@@ -4512,8 +4514,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4512 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4514 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4513 IPW_DL_ASSOC, 4515 IPW_DL_ASSOC,
4514 "authenticated: '%s' %pM\n", 4516 "authenticated: '%s' %pM\n",
4515 escape_ssid(priv->essid, 4517 print_ssid(ssid, priv->essid,
4516 priv->essid_len), 4518 priv->essid_len),
4517 priv->bssid); 4519 priv->bssid);
4518 break; 4520 break;
4519 } 4521 }
@@ -4540,8 +4542,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4540 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4542 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4541 IPW_DL_ASSOC, 4543 IPW_DL_ASSOC,
4542 "disassociated: '%s' %pM \n", 4544 "disassociated: '%s' %pM \n",
4543 escape_ssid(priv->essid, 4545 print_ssid(ssid, priv->essid,
4544 priv->essid_len), 4546 priv->essid_len),
4545 priv->bssid); 4547 priv->bssid);
4546 4548
4547 priv->status &= 4549 priv->status &=
@@ -4578,8 +4580,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4578 case CMAS_AUTHENTICATED: 4580 case CMAS_AUTHENTICATED:
4579 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, 4581 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
4580 "authenticated: '%s' %pM \n", 4582 "authenticated: '%s' %pM \n",
4581 escape_ssid(priv->essid, 4583 print_ssid(ssid, priv->essid,
4582 priv->essid_len), 4584 priv->essid_len),
4583 priv->bssid); 4585 priv->bssid);
4584 priv->status |= STATUS_AUTH; 4586 priv->status |= STATUS_AUTH;
4585 break; 4587 break;
@@ -4597,8 +4599,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4597 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4599 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4598 IPW_DL_ASSOC, 4600 IPW_DL_ASSOC,
4599 "deauthenticated: '%s' %pM\n", 4601 "deauthenticated: '%s' %pM\n",
4600 escape_ssid(priv->essid, 4602 print_ssid(ssid, priv->essid,
4601 priv->essid_len), 4603 priv->essid_len),
4602 priv->bssid); 4604 priv->bssid);
4603 4605
4604 priv->status &= ~(STATUS_ASSOCIATING | 4606 priv->status &= ~(STATUS_ASSOCIATING |
@@ -5423,6 +5425,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5423 int roaming) 5425 int roaming)
5424{ 5426{
5425 struct ipw_supported_rates rates; 5427 struct ipw_supported_rates rates;
5428 DECLARE_SSID_BUF(ssid);
5426 5429
5427 /* Verify that this network's capability is compatible with the 5430 /* Verify that this network's capability is compatible with the
5428 * current mode (AdHoc or Infrastructure) */ 5431 * current mode (AdHoc or Infrastructure) */
@@ -5430,7 +5433,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5430 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5433 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5431 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to " 5434 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to "
5432 "capability mismatch.\n", 5435 "capability mismatch.\n",
5433 escape_ssid(network->ssid, network->ssid_len), 5436 print_ssid(ssid, network->ssid,
5437 network->ssid_len),
5434 network->bssid); 5438 network->bssid);
5435 return 0; 5439 return 0;
5436 } 5440 }
@@ -5443,8 +5447,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5443 network->ssid_len)) { 5447 network->ssid_len)) {
5444 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5448 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5445 "because of non-network ESSID.\n", 5449 "because of non-network ESSID.\n",
5446 escape_ssid(network->ssid, 5450 print_ssid(ssid, network->ssid,
5447 network->ssid_len), 5451 network->ssid_len),
5448 network->bssid); 5452 network->bssid);
5449 return 0; 5453 return 0;
5450 } 5454 }
@@ -5458,13 +5462,14 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5458 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5462 char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
5459 5463
5460 strncpy(escaped, 5464 strncpy(escaped,
5461 escape_ssid(network->ssid, network->ssid_len), 5465 print_ssid(ssid, network->ssid,
5466 network->ssid_len),
5462 sizeof(escaped)); 5467 sizeof(escaped));
5463 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5468 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5464 "because of ESSID mismatch: '%s'.\n", 5469 "because of ESSID mismatch: '%s'.\n",
5465 escaped, network->bssid, 5470 escaped, network->bssid,
5466 escape_ssid(priv->essid, 5471 print_ssid(ssid, priv->essid,
5467 priv->essid_len)); 5472 priv->essid_len));
5468 return 0; 5473 return 0;
5469 } 5474 }
5470 } 5475 }
@@ -5475,14 +5480,14 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5475 if (network->time_stamp[0] < match->network->time_stamp[0]) { 5480 if (network->time_stamp[0] < match->network->time_stamp[0]) {
5476 IPW_DEBUG_MERGE("Network '%s excluded because newer than " 5481 IPW_DEBUG_MERGE("Network '%s excluded because newer than "
5477 "current network.\n", 5482 "current network.\n",
5478 escape_ssid(match->network->ssid, 5483 print_ssid(ssid, match->network->ssid,
5479 match->network->ssid_len)); 5484 match->network->ssid_len));
5480 return 0; 5485 return 0;
5481 } else if (network->time_stamp[1] < match->network->time_stamp[1]) { 5486 } else if (network->time_stamp[1] < match->network->time_stamp[1]) {
5482 IPW_DEBUG_MERGE("Network '%s excluded because newer than " 5487 IPW_DEBUG_MERGE("Network '%s excluded because newer than "
5483 "current network.\n", 5488 "current network.\n",
5484 escape_ssid(match->network->ssid, 5489 print_ssid(ssid, match->network->ssid,
5485 match->network->ssid_len)); 5490 match->network->ssid_len));
5486 return 0; 5491 return 0;
5487 } 5492 }
5488 5493
@@ -5491,7 +5496,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5491 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5496 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5492 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5497 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5493 "because of age: %ums.\n", 5498 "because of age: %ums.\n",
5494 escape_ssid(network->ssid, network->ssid_len), 5499 print_ssid(ssid, network->ssid,
5500 network->ssid_len),
5495 network->bssid, 5501 network->bssid,
5496 jiffies_to_msecs(jiffies - 5502 jiffies_to_msecs(jiffies -
5497 network->last_scanned)); 5503 network->last_scanned));
@@ -5502,7 +5508,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5502 (network->channel != priv->channel)) { 5508 (network->channel != priv->channel)) {
5503 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5509 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5504 "because of channel mismatch: %d != %d.\n", 5510 "because of channel mismatch: %d != %d.\n",
5505 escape_ssid(network->ssid, network->ssid_len), 5511 print_ssid(ssid, network->ssid,
5512 network->ssid_len),
5506 network->bssid, 5513 network->bssid,
5507 network->channel, priv->channel); 5514 network->channel, priv->channel);
5508 return 0; 5515 return 0;
@@ -5513,7 +5520,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5513 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5520 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5514 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5521 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5515 "because of privacy mismatch: %s != %s.\n", 5522 "because of privacy mismatch: %s != %s.\n",
5516 escape_ssid(network->ssid, network->ssid_len), 5523 print_ssid(ssid, network->ssid,
5524 network->ssid_len),
5517 network->bssid, 5525 network->bssid,
5518 priv-> 5526 priv->
5519 capability & CAP_PRIVACY_ON ? "on" : "off", 5527 capability & CAP_PRIVACY_ON ? "on" : "off",
@@ -5526,8 +5534,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5526 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5534 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5527 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5535 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5528 "because of the same BSSID match: %pM" 5536 "because of the same BSSID match: %pM"
5529 ".\n", escape_ssid(network->ssid, 5537 ".\n", print_ssid(ssid, network->ssid,
5530 network->ssid_len), 5538 network->ssid_len),
5531 network->bssid, 5539 network->bssid,
5532 priv->bssid); 5540 priv->bssid);
5533 return 0; 5541 return 0;
@@ -5538,7 +5546,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5538 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5546 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5539 "because of invalid frequency/mode " 5547 "because of invalid frequency/mode "
5540 "combination.\n", 5548 "combination.\n",
5541 escape_ssid(network->ssid, network->ssid_len), 5549 print_ssid(ssid, network->ssid,
5550 network->ssid_len),
5542 network->bssid); 5551 network->bssid);
5543 return 0; 5552 return 0;
5544 } 5553 }
@@ -5549,7 +5558,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5549 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5558 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5550 "because configured rate mask excludes " 5559 "because configured rate mask excludes "
5551 "AP mandatory rate.\n", 5560 "AP mandatory rate.\n",
5552 escape_ssid(network->ssid, network->ssid_len), 5561 print_ssid(ssid, network->ssid,
5562 network->ssid_len),
5553 network->bssid); 5563 network->bssid);
5554 return 0; 5564 return 0;
5555 } 5565 }
@@ -5557,7 +5567,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5557 if (rates.num_rates == 0) { 5567 if (rates.num_rates == 0) {
5558 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5568 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5559 "because of no compatible rates.\n", 5569 "because of no compatible rates.\n",
5560 escape_ssid(network->ssid, network->ssid_len), 5570 print_ssid(ssid, network->ssid,
5571 network->ssid_len),
5561 network->bssid); 5572 network->bssid);
5562 return 0; 5573 return 0;
5563 } 5574 }
@@ -5570,7 +5581,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5570 ipw_copy_rates(&match->rates, &rates); 5581 ipw_copy_rates(&match->rates, &rates);
5571 match->network = network; 5582 match->network = network;
5572 IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n", 5583 IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n",
5573 escape_ssid(network->ssid, network->ssid_len), 5584 print_ssid(ssid, network->ssid, network->ssid_len),
5574 network->bssid); 5585 network->bssid);
5575 5586
5576 return 1; 5587 return 1;
@@ -5578,6 +5589,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5578 5589
5579static void ipw_merge_adhoc_network(struct work_struct *work) 5590static void ipw_merge_adhoc_network(struct work_struct *work)
5580{ 5591{
5592 DECLARE_SSID_BUF(ssid);
5581 struct ipw_priv *priv = 5593 struct ipw_priv *priv =
5582 container_of(work, struct ipw_priv, merge_networks); 5594 container_of(work, struct ipw_priv, merge_networks);
5583 struct ieee80211_network *network = NULL; 5595 struct ieee80211_network *network = NULL;
@@ -5608,8 +5620,8 @@ static void ipw_merge_adhoc_network(struct work_struct *work)
5608 mutex_lock(&priv->mutex); 5620 mutex_lock(&priv->mutex);
5609 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) { 5621 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
5610 IPW_DEBUG_MERGE("remove network %s\n", 5622 IPW_DEBUG_MERGE("remove network %s\n",
5611 escape_ssid(priv->essid, 5623 print_ssid(ssid, priv->essid,
5612 priv->essid_len)); 5624 priv->essid_len));
5613 ipw_remove_current_network(priv); 5625 ipw_remove_current_network(priv);
5614 } 5626 }
5615 5627
@@ -5625,6 +5637,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5625 struct ieee80211_network *network, int roaming) 5637 struct ieee80211_network *network, int roaming)
5626{ 5638{
5627 struct ipw_supported_rates rates; 5639 struct ipw_supported_rates rates;
5640 DECLARE_SSID_BUF(ssid);
5628 5641
5629 /* Verify that this network's capability is compatible with the 5642 /* Verify that this network's capability is compatible with the
5630 * current mode (AdHoc or Infrastructure) */ 5643 * current mode (AdHoc or Infrastructure) */
@@ -5634,7 +5647,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5634 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5647 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5635 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to " 5648 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to "
5636 "capability mismatch.\n", 5649 "capability mismatch.\n",
5637 escape_ssid(network->ssid, network->ssid_len), 5650 print_ssid(ssid, network->ssid,
5651 network->ssid_len),
5638 network->bssid); 5652 network->bssid);
5639 return 0; 5653 return 0;
5640 } 5654 }
@@ -5647,8 +5661,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5647 network->ssid_len)) { 5661 network->ssid_len)) {
5648 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5662 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5649 "because of non-network ESSID.\n", 5663 "because of non-network ESSID.\n",
5650 escape_ssid(network->ssid, 5664 print_ssid(ssid, network->ssid,
5651 network->ssid_len), 5665 network->ssid_len),
5652 network->bssid); 5666 network->bssid);
5653 return 0; 5667 return 0;
5654 } 5668 }
@@ -5661,13 +5675,14 @@ static int ipw_best_network(struct ipw_priv *priv,
5661 min(network->ssid_len, priv->essid_len)))) { 5675 min(network->ssid_len, priv->essid_len)))) {
5662 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5676 char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
5663 strncpy(escaped, 5677 strncpy(escaped,
5664 escape_ssid(network->ssid, network->ssid_len), 5678 print_ssid(ssid, network->ssid,
5679 network->ssid_len),
5665 sizeof(escaped)); 5680 sizeof(escaped));
5666 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5681 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5667 "because of ESSID mismatch: '%s'.\n", 5682 "because of ESSID mismatch: '%s'.\n",
5668 escaped, network->bssid, 5683 escaped, network->bssid,
5669 escape_ssid(priv->essid, 5684 print_ssid(ssid, priv->essid,
5670 priv->essid_len)); 5685 priv->essid_len));
5671 return 0; 5686 return 0;
5672 } 5687 }
5673 } 5688 }
@@ -5677,13 +5692,13 @@ static int ipw_best_network(struct ipw_priv *priv,
5677 if (match->network && match->network->stats.rssi > network->stats.rssi) { 5692 if (match->network && match->network->stats.rssi > network->stats.rssi) {
5678 char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 5693 char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
5679 strncpy(escaped, 5694 strncpy(escaped,
5680 escape_ssid(network->ssid, network->ssid_len), 5695 print_ssid(ssid, network->ssid, network->ssid_len),
5681 sizeof(escaped)); 5696 sizeof(escaped));
5682 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because " 5697 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "
5683 "'%s (%pM)' has a stronger signal.\n", 5698 "'%s (%pM)' has a stronger signal.\n",
5684 escaped, network->bssid, 5699 escaped, network->bssid,
5685 escape_ssid(match->network->ssid, 5700 print_ssid(ssid, match->network->ssid,
5686 match->network->ssid_len), 5701 match->network->ssid_len),
5687 match->network->bssid); 5702 match->network->bssid);
5688 return 0; 5703 return 0;
5689 } 5704 }
@@ -5695,7 +5710,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5695 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5710 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5696 "because of storming (%ums since last " 5711 "because of storming (%ums since last "
5697 "assoc attempt).\n", 5712 "assoc attempt).\n",
5698 escape_ssid(network->ssid, network->ssid_len), 5713 print_ssid(ssid, network->ssid,
5714 network->ssid_len),
5699 network->bssid, 5715 network->bssid,
5700 jiffies_to_msecs(jiffies - 5716 jiffies_to_msecs(jiffies -
5701 network->last_associate)); 5717 network->last_associate));
@@ -5707,7 +5723,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5707 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5723 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5708 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5724 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5709 "because of age: %ums.\n", 5725 "because of age: %ums.\n",
5710 escape_ssid(network->ssid, network->ssid_len), 5726 print_ssid(ssid, network->ssid,
5727 network->ssid_len),
5711 network->bssid, 5728 network->bssid,
5712 jiffies_to_msecs(jiffies - 5729 jiffies_to_msecs(jiffies -
5713 network->last_scanned)); 5730 network->last_scanned));
@@ -5718,7 +5735,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5718 (network->channel != priv->channel)) { 5735 (network->channel != priv->channel)) {
5719 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5736 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5720 "because of channel mismatch: %d != %d.\n", 5737 "because of channel mismatch: %d != %d.\n",
5721 escape_ssid(network->ssid, network->ssid_len), 5738 print_ssid(ssid, network->ssid,
5739 network->ssid_len),
5722 network->bssid, 5740 network->bssid,
5723 network->channel, priv->channel); 5741 network->channel, priv->channel);
5724 return 0; 5742 return 0;
@@ -5729,7 +5747,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5729 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5747 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5730 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5748 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5731 "because of privacy mismatch: %s != %s.\n", 5749 "because of privacy mismatch: %s != %s.\n",
5732 escape_ssid(network->ssid, network->ssid_len), 5750 print_ssid(ssid, network->ssid,
5751 network->ssid_len),
5733 network->bssid, 5752 network->bssid,
5734 priv->capability & CAP_PRIVACY_ON ? "on" : 5753 priv->capability & CAP_PRIVACY_ON ? "on" :
5735 "off", 5754 "off",
@@ -5742,7 +5761,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5742 memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5761 memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5743 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5762 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5744 "because of BSSID mismatch: %pM.\n", 5763 "because of BSSID mismatch: %pM.\n",
5745 escape_ssid(network->ssid, network->ssid_len), 5764 print_ssid(ssid, network->ssid,
5765 network->ssid_len),
5746 network->bssid, priv->bssid); 5766 network->bssid, priv->bssid);
5747 return 0; 5767 return 0;
5748 } 5768 }
@@ -5752,7 +5772,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5752 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5772 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5753 "because of invalid frequency/mode " 5773 "because of invalid frequency/mode "
5754 "combination.\n", 5774 "combination.\n",
5755 escape_ssid(network->ssid, network->ssid_len), 5775 print_ssid(ssid, network->ssid,
5776 network->ssid_len),
5756 network->bssid); 5777 network->bssid);
5757 return 0; 5778 return 0;
5758 } 5779 }
@@ -5761,7 +5782,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5761 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { 5782 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) {
5762 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5783 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5763 "because of invalid channel in current GEO\n", 5784 "because of invalid channel in current GEO\n",
5764 escape_ssid(network->ssid, network->ssid_len), 5785 print_ssid(ssid, network->ssid,
5786 network->ssid_len),
5765 network->bssid); 5787 network->bssid);
5766 return 0; 5788 return 0;
5767 } 5789 }
@@ -5772,7 +5794,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5772 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5794 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5773 "because configured rate mask excludes " 5795 "because configured rate mask excludes "
5774 "AP mandatory rate.\n", 5796 "AP mandatory rate.\n",
5775 escape_ssid(network->ssid, network->ssid_len), 5797 print_ssid(ssid, network->ssid,
5798 network->ssid_len),
5776 network->bssid); 5799 network->bssid);
5777 return 0; 5800 return 0;
5778 } 5801 }
@@ -5780,7 +5803,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5780 if (rates.num_rates == 0) { 5803 if (rates.num_rates == 0) {
5781 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5804 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5782 "because of no compatible rates.\n", 5805 "because of no compatible rates.\n",
5783 escape_ssid(network->ssid, network->ssid_len), 5806 print_ssid(ssid, network->ssid,
5807 network->ssid_len),
5784 network->bssid); 5808 network->bssid);
5785 return 0; 5809 return 0;
5786 } 5810 }
@@ -5794,7 +5818,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5794 match->network = network; 5818 match->network = network;
5795 5819
5796 IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n", 5820 IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n",
5797 escape_ssid(network->ssid, network->ssid_len), 5821 print_ssid(ssid, network->ssid, network->ssid_len),
5798 network->bssid); 5822 network->bssid);
5799 5823
5800 return 1; 5824 return 1;
@@ -6037,6 +6061,7 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
6037 6061
6038static void ipw_debug_config(struct ipw_priv *priv) 6062static void ipw_debug_config(struct ipw_priv *priv)
6039{ 6063{
6064 DECLARE_SSID_BUF(ssid);
6040 IPW_DEBUG_INFO("Scan completed, no valid APs matched " 6065 IPW_DEBUG_INFO("Scan completed, no valid APs matched "
6041 "[CFG 0x%08X]\n", priv->config); 6066 "[CFG 0x%08X]\n", priv->config);
6042 if (priv->config & CFG_STATIC_CHANNEL) 6067 if (priv->config & CFG_STATIC_CHANNEL)
@@ -6045,7 +6070,7 @@ static void ipw_debug_config(struct ipw_priv *priv)
6045 IPW_DEBUG_INFO("Channel unlocked.\n"); 6070 IPW_DEBUG_INFO("Channel unlocked.\n");
6046 if (priv->config & CFG_STATIC_ESSID) 6071 if (priv->config & CFG_STATIC_ESSID)
6047 IPW_DEBUG_INFO("ESSID locked to '%s'\n", 6072 IPW_DEBUG_INFO("ESSID locked to '%s'\n",
6048 escape_ssid(priv->essid, priv->essid_len)); 6073 print_ssid(ssid, priv->essid, priv->essid_len));
6049 else 6074 else
6050 IPW_DEBUG_INFO("ESSID unlocked.\n"); 6075 IPW_DEBUG_INFO("ESSID unlocked.\n");
6051 if (priv->config & CFG_STATIC_BSSID) 6076 if (priv->config & CFG_STATIC_BSSID)
@@ -7263,6 +7288,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7263 struct ipw_supported_rates *rates, int roaming) 7288 struct ipw_supported_rates *rates, int roaming)
7264{ 7289{
7265 int err; 7290 int err;
7291 DECLARE_SSID_BUF(ssid);
7266 7292
7267 if (priv->config & CFG_FIXED_RATE) 7293 if (priv->config & CFG_FIXED_RATE)
7268 ipw_set_fixed_rate(priv, network->mode); 7294 ipw_set_fixed_rate(priv, network->mode);
@@ -7331,7 +7357,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7331 IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, " 7357 IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, "
7332 "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n", 7358 "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n",
7333 roaming ? "Rea" : "A", 7359 roaming ? "Rea" : "A",
7334 escape_ssid(priv->essid, priv->essid_len), 7360 print_ssid(ssid, priv->essid, priv->essid_len),
7335 network->channel, 7361 network->channel,
7336 ipw_modes[priv->assoc_request.ieee_mode], 7362 ipw_modes[priv->assoc_request.ieee_mode],
7337 rates->num_rates, 7363 rates->num_rates,
@@ -7431,7 +7457,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7431 } 7457 }
7432 7458
7433 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM \n", 7459 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM \n",
7434 escape_ssid(priv->essid, priv->essid_len), 7460 print_ssid(ssid, priv->essid, priv->essid_len),
7435 priv->bssid); 7461 priv->bssid);
7436 7462
7437 return 0; 7463 return 0;
@@ -7522,6 +7548,7 @@ static int ipw_associate(void *data)
7522 struct ipw_supported_rates *rates; 7548 struct ipw_supported_rates *rates;
7523 struct list_head *element; 7549 struct list_head *element;
7524 unsigned long flags; 7550 unsigned long flags;
7551 DECLARE_SSID_BUF(ssid);
7525 7552
7526 if (priv->ieee->iw_mode == IW_MODE_MONITOR) { 7553 if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
7527 IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n"); 7554 IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n");
@@ -7583,8 +7610,8 @@ static int ipw_associate(void *data)
7583 target = oldest; 7610 target = oldest;
7584 IPW_DEBUG_ASSOC("Expired '%s' (%pM) from " 7611 IPW_DEBUG_ASSOC("Expired '%s' (%pM) from "
7585 "network list.\n", 7612 "network list.\n",
7586 escape_ssid(target->ssid, 7613 print_ssid(ssid, target->ssid,
7587 target->ssid_len), 7614 target->ssid_len),
7588 target->bssid); 7615 target->bssid);
7589 list_add_tail(&target->list, 7616 list_add_tail(&target->list,
7590 &priv->ieee->network_free_list); 7617 &priv->ieee->network_free_list);
@@ -9012,6 +9039,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
9012{ 9039{
9013 struct ipw_priv *priv = ieee80211_priv(dev); 9040 struct ipw_priv *priv = ieee80211_priv(dev);
9014 int length; 9041 int length;
9042 DECLARE_SSID_BUF(ssid);
9015 9043
9016 mutex_lock(&priv->mutex); 9044 mutex_lock(&priv->mutex);
9017 9045
@@ -9036,8 +9064,8 @@ static int ipw_wx_set_essid(struct net_device *dev,
9036 return 0; 9064 return 0;
9037 } 9065 }
9038 9066
9039 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_ssid(extra, length), 9067 IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n",
9040 length); 9068 print_ssid(ssid, extra, length), length);
9041 9069
9042 priv->essid_len = length; 9070 priv->essid_len = length;
9043 memcpy(priv->essid, extra, priv->essid_len); 9071 memcpy(priv->essid, extra, priv->essid_len);
@@ -9056,6 +9084,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
9056 union iwreq_data *wrqu, char *extra) 9084 union iwreq_data *wrqu, char *extra)
9057{ 9085{
9058 struct ipw_priv *priv = ieee80211_priv(dev); 9086 struct ipw_priv *priv = ieee80211_priv(dev);
9087 DECLARE_SSID_BUF(ssid);
9059 9088
9060 /* If we are associated, trying to associate, or have a statically 9089 /* If we are associated, trying to associate, or have a statically
9061 * configured ESSID then return that; otherwise return ANY */ 9090 * configured ESSID then return that; otherwise return ANY */
@@ -9063,7 +9092,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
9063 if (priv->config & CFG_STATIC_ESSID || 9092 if (priv->config & CFG_STATIC_ESSID ||
9064 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { 9093 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) {
9065 IPW_DEBUG_WX("Getting essid: '%s'\n", 9094 IPW_DEBUG_WX("Getting essid: '%s'\n",
9066 escape_ssid(priv->essid, priv->essid_len)); 9095 print_ssid(ssid, priv->essid, priv->essid_len));
9067 memcpy(extra, priv->essid, priv->essid_len); 9096 memcpy(extra, priv->essid, priv->essid_len);
9068 wrqu->essid.length = priv->essid_len; 9097 wrqu->essid.length = priv->essid_len;
9069 wrqu->essid.flags = 1; /* active */ 9098 wrqu->essid.flags = 1; /* active */
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 1cc8aa592821..3379b41fb5ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -643,6 +643,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
643 u8 n_probes = 2; 643 u8 n_probes = 2;
644 u8 rx_chain = priv->hw_params.valid_rx_ant; 644 u8 rx_chain = priv->hw_params.valid_rx_ant;
645 u8 rate; 645 u8 rate;
646 DECLARE_SSID_BUF(ssid);
646 647
647 conf = ieee80211_get_hw_conf(priv->hw); 648 conf = ieee80211_get_hw_conf(priv->hw);
648 649
@@ -735,8 +736,8 @@ static void iwl_bg_request_scan(struct work_struct *data)
735 /* We should add the ability for user to lock to PASSIVE ONLY */ 736 /* We should add the ability for user to lock to PASSIVE ONLY */
736 if (priv->one_direct_scan) { 737 if (priv->one_direct_scan) {
737 IWL_DEBUG_SCAN("Start direct scan for '%s'\n", 738 IWL_DEBUG_SCAN("Start direct scan for '%s'\n",
738 escape_ssid(priv->direct_ssid, 739 print_ssid(ssid, priv->direct_ssid,
739 priv->direct_ssid_len)); 740 priv->direct_ssid_len));
740 scan->direct_scan[0].id = WLAN_EID_SSID; 741 scan->direct_scan[0].id = WLAN_EID_SSID;
741 scan->direct_scan[0].len = priv->direct_ssid_len; 742 scan->direct_scan[0].len = priv->direct_ssid_len;
742 memcpy(scan->direct_scan[0].ssid, 743 memcpy(scan->direct_scan[0].ssid,
@@ -744,7 +745,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
744 n_probes++; 745 n_probes++;
745 } else if (!iwl_is_associated(priv) && priv->essid_len) { 746 } else if (!iwl_is_associated(priv) && priv->essid_len) {
746 IWL_DEBUG_SCAN("Start direct scan for '%s' (not associated)\n", 747 IWL_DEBUG_SCAN("Start direct scan for '%s' (not associated)\n",
747 escape_ssid(priv->essid, priv->essid_len)); 748 print_ssid(ssid, priv->essid, priv->essid_len));
748 scan->direct_scan[0].id = WLAN_EID_SSID; 749 scan->direct_scan[0].id = WLAN_EID_SSID;
749 scan->direct_scan[0].len = priv->essid_len; 750 scan->direct_scan[0].len = priv->essid_len;
750 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 751 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 370cc46b4888..8009094503e4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6054,6 +6054,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6054 struct ieee80211_conf *conf = NULL; 6054 struct ieee80211_conf *conf = NULL;
6055 u8 n_probes = 2; 6055 u8 n_probes = 2;
6056 enum ieee80211_band band; 6056 enum ieee80211_band band;
6057 DECLARE_SSID_BUF(ssid);
6057 6058
6058 conf = ieee80211_get_hw_conf(priv->hw); 6059 conf = ieee80211_get_hw_conf(priv->hw);
6059 6060
@@ -6154,7 +6155,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6154 if (priv->one_direct_scan) { 6155 if (priv->one_direct_scan) {
6155 IWL_DEBUG_SCAN 6156 IWL_DEBUG_SCAN
6156 ("Kicking off one direct scan for '%s'\n", 6157 ("Kicking off one direct scan for '%s'\n",
6157 escape_ssid(priv->direct_ssid, priv->direct_ssid_len)); 6158 print_ssid(ssid, priv->direct_ssid,
6159 priv->direct_ssid_len));
6158 scan->direct_scan[0].id = WLAN_EID_SSID; 6160 scan->direct_scan[0].id = WLAN_EID_SSID;
6159 scan->direct_scan[0].len = priv->direct_ssid_len; 6161 scan->direct_scan[0].len = priv->direct_ssid_len;
6160 memcpy(scan->direct_scan[0].ssid, 6162 memcpy(scan->direct_scan[0].ssid,
@@ -6163,7 +6165,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6163 } else if (!iwl3945_is_associated(priv) && priv->essid_len) { 6165 } else if (!iwl3945_is_associated(priv) && priv->essid_len) {
6164 IWL_DEBUG_SCAN 6166 IWL_DEBUG_SCAN
6165 ("Kicking off one direct scan for '%s' when not associated\n", 6167 ("Kicking off one direct scan for '%s' when not associated\n",
6166 escape_ssid(priv->essid, priv->essid_len)); 6168 print_ssid(ssid, priv->essid, priv->essid_len));
6167 scan->direct_scan[0].id = WLAN_EID_SSID; 6169 scan->direct_scan[0].id = WLAN_EID_SSID;
6168 scan->direct_scan[0].len = priv->essid_len; 6170 scan->direct_scan[0].len = priv->essid_len;
6169 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 6171 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -6945,6 +6947,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
6945 int rc = 0; 6947 int rc = 0;
6946 unsigned long flags; 6948 unsigned long flags;
6947 struct iwl3945_priv *priv = hw->priv; 6949 struct iwl3945_priv *priv = hw->priv;
6950 DECLARE_SSID_BUF(ssid_buf);
6948 6951
6949 IWL_DEBUG_MAC80211("enter\n"); 6952 IWL_DEBUG_MAC80211("enter\n");
6950 6953
@@ -6978,7 +6981,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
6978 } 6981 }
6979 if (len) { 6982 if (len) {
6980 IWL_DEBUG_SCAN("direct scan for %s [%d]\n ", 6983 IWL_DEBUG_SCAN("direct scan for %s [%d]\n ",
6981 escape_ssid(ssid, len), (int)len); 6984 print_ssid(ssid_buf, ssid, len), (int)len);
6982 6985
6983 priv->one_direct_scan = 1; 6986 priv->one_direct_scan = 1;
6984 priv->direct_ssid_len = (u8) 6987 priv->direct_ssid_len = (u8)
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 3492e89d1dd5..92863780286f 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -153,17 +153,18 @@ static int lbs_adhoc_join(struct lbs_private *priv,
153 struct cmd_ds_802_11_ad_hoc_join cmd; 153 struct cmd_ds_802_11_ad_hoc_join cmd;
154 struct bss_descriptor *bss = &assoc_req->bss; 154 struct bss_descriptor *bss = &assoc_req->bss;
155 u8 preamble = RADIO_PREAMBLE_LONG; 155 u8 preamble = RADIO_PREAMBLE_LONG;
156 DECLARE_SSID_BUF(ssid);
156 u16 ratesize = 0; 157 u16 ratesize = 0;
157 int ret = 0; 158 int ret = 0;
158 159
159 lbs_deb_enter(LBS_DEB_ASSOC); 160 lbs_deb_enter(LBS_DEB_ASSOC);
160 161
161 lbs_deb_join("current SSID '%s', ssid length %u\n", 162 lbs_deb_join("current SSID '%s', ssid length %u\n",
162 escape_ssid(priv->curbssparams.ssid, 163 print_ssid(ssid, priv->curbssparams.ssid,
163 priv->curbssparams.ssid_len), 164 priv->curbssparams.ssid_len),
164 priv->curbssparams.ssid_len); 165 priv->curbssparams.ssid_len);
165 lbs_deb_join("requested ssid '%s', ssid length %u\n", 166 lbs_deb_join("requested ssid '%s', ssid length %u\n",
166 escape_ssid(bss->ssid, bss->ssid_len), 167 print_ssid(ssid, bss->ssid, bss->ssid_len),
167 bss->ssid_len); 168 bss->ssid_len);
168 169
169 /* check if the requested SSID is already joined */ 170 /* check if the requested SSID is already joined */
@@ -308,6 +309,7 @@ static int lbs_adhoc_start(struct lbs_private *priv,
308 size_t ratesize = 0; 309 size_t ratesize = 0;
309 u16 tmpcap = 0; 310 u16 tmpcap = 0;
310 int ret = 0; 311 int ret = 0;
312 DECLARE_SSID_BUF(ssid);
311 313
312 lbs_deb_enter(LBS_DEB_ASSOC); 314 lbs_deb_enter(LBS_DEB_ASSOC);
313 315
@@ -327,7 +329,7 @@ static int lbs_adhoc_start(struct lbs_private *priv,
327 memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len); 329 memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len);
328 330
329 lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", 331 lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n",
330 escape_ssid(assoc_req->ssid, assoc_req->ssid_len), 332 print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len),
331 assoc_req->ssid_len); 333 assoc_req->ssid_len);
332 334
333 cmd.bsstype = CMD_BSS_TYPE_IBSS; 335 cmd.bsstype = CMD_BSS_TYPE_IBSS;
@@ -695,6 +697,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
695 int ret = 0; 697 int ret = 0;
696 struct bss_descriptor * bss; 698 struct bss_descriptor * bss;
697 int channel = -1; 699 int channel = -1;
700 DECLARE_SSID_BUF(ssid);
698 701
699 lbs_deb_enter(LBS_DEB_ASSOC); 702 lbs_deb_enter(LBS_DEB_ASSOC);
700 703
@@ -706,7 +709,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
706 channel = assoc_req->channel; 709 channel = assoc_req->channel;
707 710
708 lbs_deb_assoc("SSID '%s' requested\n", 711 lbs_deb_assoc("SSID '%s' requested\n",
709 escape_ssid(assoc_req->ssid, assoc_req->ssid_len)); 712 print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len));
710 if (assoc_req->mode == IW_MODE_INFRA) { 713 if (assoc_req->mode == IW_MODE_INFRA) {
711 lbs_send_specific_ssid_scan(priv, assoc_req->ssid, 714 lbs_send_specific_ssid_scan(priv, assoc_req->ssid,
712 assoc_req->ssid_len); 715 assoc_req->ssid_len);
@@ -1207,6 +1210,7 @@ void lbs_association_worker(struct work_struct *work)
1207 struct assoc_request * assoc_req = NULL; 1210 struct assoc_request * assoc_req = NULL;
1208 int ret = 0; 1211 int ret = 0;
1209 int find_any_ssid = 0; 1212 int find_any_ssid = 0;
1213 DECLARE_SSID_BUF(ssid);
1210 1214
1211 lbs_deb_enter(LBS_DEB_ASSOC); 1215 lbs_deb_enter(LBS_DEB_ASSOC);
1212 1216
@@ -1230,7 +1234,7 @@ void lbs_association_worker(struct work_struct *work)
1230 " secinfo: %s%s%s\n" 1234 " secinfo: %s%s%s\n"
1231 " auth_mode: %d\n", 1235 " auth_mode: %d\n",
1232 assoc_req->flags, 1236 assoc_req->flags,
1233 escape_ssid(assoc_req->ssid, assoc_req->ssid_len), 1237 print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len),
1234 assoc_req->channel, assoc_req->band, assoc_req->mode, 1238 assoc_req->channel, assoc_req->band, assoc_req->mode,
1235 assoc_req->bssid, 1239 assoc_req->bssid,
1236 assoc_req->secinfo.WPAenabled ? " WPA" : "", 1240 assoc_req->secinfo.WPAenabled ? " WPA" : "",
@@ -1767,6 +1771,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
1767 struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; 1771 struct cmd_ds_802_11_ad_hoc_result *adhoc_resp;
1768 union iwreq_data wrqu; 1772 union iwreq_data wrqu;
1769 struct bss_descriptor *bss; 1773 struct bss_descriptor *bss;
1774 DECLARE_SSID_BUF(ssid);
1770 1775
1771 lbs_deb_enter(LBS_DEB_JOIN); 1776 lbs_deb_enter(LBS_DEB_JOIN);
1772 1777
@@ -1816,7 +1821,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
1816 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); 1821 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
1817 1822
1818 lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", 1823 lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n",
1819 escape_ssid(bss->ssid, bss->ssid_len), 1824 print_ssid(ssid, bss->ssid, bss->ssid_len),
1820 priv->curbssparams.bssid, 1825 priv->curbssparams.bssid,
1821 priv->curbssparams.channel); 1826 priv->curbssparams.channel);
1822 1827
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 52feab69ee49..38843c8b919c 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1063,6 +1063,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan)
1063{ 1063{
1064 struct cmd_ds_mesh_config cmd; 1064 struct cmd_ds_mesh_config cmd;
1065 struct mrvl_meshie *ie; 1065 struct mrvl_meshie *ie;
1066 DECLARE_SSID_BUF(ssid);
1066 1067
1067 memset(&cmd, 0, sizeof(cmd)); 1068 memset(&cmd, 0, sizeof(cmd));
1068 cmd.channel = cpu_to_le16(chan); 1069 cmd.channel = cpu_to_le16(chan);
@@ -1093,7 +1094,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan)
1093 } 1094 }
1094 lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n", 1095 lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n",
1095 action, priv->mesh_tlv, chan, 1096 action, priv->mesh_tlv, chan,
1096 escape_ssid(priv->mesh_ssid, priv->mesh_ssid_len)); 1097 print_ssid(ssid, priv->mesh_ssid, priv->mesh_ssid_len));
1097 1098
1098 return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv); 1099 return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
1099} 1100}
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 84933203be74..ec4efd7ff3c8 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -66,6 +66,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
66 int numscansdone = 0, res; 66 int numscansdone = 0, res;
67 unsigned long addr = get_zeroed_page(GFP_KERNEL); 67 unsigned long addr = get_zeroed_page(GFP_KERNEL);
68 char *buf = (char *)addr; 68 char *buf = (char *)addr;
69 DECLARE_SSID_BUF(ssid);
69 struct bss_descriptor * iter_bss; 70 struct bss_descriptor * iter_bss;
70 71
71 pos += snprintf(buf+pos, len-pos, 72 pos += snprintf(buf+pos, len-pos,
@@ -86,7 +87,8 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
86 spectrum_mgmt ? 'S' : ' '); 87 spectrum_mgmt ? 'S' : ' ');
87 pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi)); 88 pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi));
88 pos += snprintf(buf+pos, len-pos, " %s\n", 89 pos += snprintf(buf+pos, len-pos, " %s\n",
89 escape_ssid(iter_bss->ssid, iter_bss->ssid_len)); 90 print_ssid(ssid, iter_bss->ssid,
91 iter_bss->ssid_len));
90 92
91 numscansdone++; 93 numscansdone++;
92 } 94 }
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 7881890a4e98..5c34ac588189 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -362,6 +362,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
362#ifdef CONFIG_LIBERTAS_DEBUG 362#ifdef CONFIG_LIBERTAS_DEBUG
363 struct bss_descriptor *iter; 363 struct bss_descriptor *iter;
364 int i = 0; 364 int i = 0;
365 DECLARE_SSID_BUF(ssid);
365#endif 366#endif
366 367
367 lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); 368 lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan);
@@ -455,7 +456,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
455 list_for_each_entry(iter, &priv->network_list, list) 456 list_for_each_entry(iter, &priv->network_list, list)
456 lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n", 457 lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n",
457 i++, iter->bssid, iter->rssi, 458 i++, iter->bssid, iter->rssi,
458 escape_ssid(iter->ssid, iter->ssid_len)); 459 print_ssid(ssid, iter->ssid, iter->ssid_len));
459 mutex_unlock(&priv->lock); 460 mutex_unlock(&priv->lock);
460#endif 461#endif
461 462
@@ -514,6 +515,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
514 struct ieeetypes_dsparamset *pDS; 515 struct ieeetypes_dsparamset *pDS;
515 struct ieeetypes_cfparamset *pCF; 516 struct ieeetypes_cfparamset *pCF;
516 struct ieeetypes_ibssparamset *pibss; 517 struct ieeetypes_ibssparamset *pibss;
518 DECLARE_SSID_BUF(ssid);
517 struct ieeetypes_countryinfoset *pcountryinfo; 519 struct ieeetypes_countryinfoset *pcountryinfo;
518 uint8_t *pos, *end, *p; 520 uint8_t *pos, *end, *p;
519 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; 521 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
@@ -602,7 +604,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
602 bss->ssid_len = min_t(int, 32, elem->len); 604 bss->ssid_len = min_t(int, 32, elem->len);
603 memcpy(bss->ssid, elem->data, bss->ssid_len); 605 memcpy(bss->ssid, elem->data, bss->ssid_len);
604 lbs_deb_scan("got SSID IE: '%s', len %u\n", 606 lbs_deb_scan("got SSID IE: '%s', len %u\n",
605 escape_ssid(bss->ssid, bss->ssid_len), 607 print_ssid(ssid, bss->ssid, bss->ssid_len),
606 bss->ssid_len); 608 bss->ssid_len);
607 break; 609 break;
608 610
@@ -742,10 +744,11 @@ done:
742int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid, 744int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid,
743 uint8_t ssid_len) 745 uint8_t ssid_len)
744{ 746{
747 DECLARE_SSID_BUF(ssid_buf);
745 int ret = 0; 748 int ret = 0;
746 749
747 lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n", 750 lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n",
748 escape_ssid(ssid, ssid_len)); 751 print_ssid(ssid_buf, ssid, ssid_len));
749 752
750 if (!ssid_len) 753 if (!ssid_len)
751 goto out; 754 goto out;
@@ -940,6 +943,7 @@ out:
940int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, 943int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
941 union iwreq_data *wrqu, char *extra) 944 union iwreq_data *wrqu, char *extra)
942{ 945{
946 DECLARE_SSID_BUF(ssid);
943 struct lbs_private *priv = dev->priv; 947 struct lbs_private *priv = dev->priv;
944 int ret = 0; 948 int ret = 0;
945 949
@@ -969,7 +973,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
969 priv->scan_ssid_len = req->essid_len; 973 priv->scan_ssid_len = req->essid_len;
970 memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len); 974 memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len);
971 lbs_deb_wext("set_scan, essid '%s'\n", 975 lbs_deb_wext("set_scan, essid '%s'\n",
972 escape_ssid(priv->scan_ssid, priv->scan_ssid_len)); 976 print_ssid(ssid, priv->scan_ssid, priv->scan_ssid_len));
973 } else { 977 } else {
974 priv->scan_ssid_len = 0; 978 priv->scan_ssid_len = 0;
975 } 979 }
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 247579951858..d4c6a659b562 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1978,6 +1978,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
1978 u8 ssid_len = 0; 1978 u8 ssid_len = 0;
1979 struct assoc_request * assoc_req; 1979 struct assoc_request * assoc_req;
1980 int in_ssid_len = dwrq->length; 1980 int in_ssid_len = dwrq->length;
1981 DECLARE_SSID_BUF(ssid_buf);
1981 1982
1982 lbs_deb_enter(LBS_DEB_WEXT); 1983 lbs_deb_enter(LBS_DEB_WEXT);
1983 1984
@@ -2006,7 +2007,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
2006 lbs_deb_wext("requested any SSID\n"); 2007 lbs_deb_wext("requested any SSID\n");
2007 } else { 2008 } else {
2008 lbs_deb_wext("requested SSID '%s'\n", 2009 lbs_deb_wext("requested SSID '%s'\n",
2009 escape_ssid(ssid, ssid_len)); 2010 print_ssid(ssid_buf, ssid, ssid_len));
2010 } 2011 }
2011 2012
2012out: 2013out:
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 64a4abce6d91..b0726e2079b5 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -12,8 +12,8 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#ifndef IEEE80211_H 15#ifndef LINUX_IEEE80211_H
16#define IEEE80211_H 16#define LINUX_IEEE80211_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <asm/byteorder.h> 19#include <asm/byteorder.h>
@@ -1114,4 +1114,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
1114 return hdr->addr1; 1114 return hdr->addr1;
1115} 1115}
1116 1116
1117#endif /* IEEE80211_H */ 1117#endif /* LINUX_IEEE80211_H */
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index ce49a30033b6..906d96f1b264 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -8,8 +8,9 @@
8#ifndef LIB80211_H 8#ifndef LIB80211_H
9#define LIB80211_H 9#define LIB80211_H
10 10
11/* escape_ssid() is intended to be used in debug (and possibly error) 11/* print_ssid() is intended to be used in debug (and possibly error)
12 * messages. It should never be used for passing ssid to user space. */ 12 * messages. It should never be used for passing ssid to user space. */
13const char *escape_ssid(const char *ssid, u8 ssid_len); 13const char *print_ssid(char *buf, const char *ssid, u8 ssid_len);
14#define DECLARE_SSID_BUF(var) char var[32 * 4 + 1] __maybe_unused
14 15
15#endif /* LIB80211_H */ 16#endif /* LIB80211_H */
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index f15f82e7bbfd..d19c8de6ef25 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -1124,6 +1124,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1124 *info_element, u16 length, 1124 *info_element, u16 length,
1125 struct ieee80211_network *network) 1125 struct ieee80211_network *network)
1126{ 1126{
1127 DECLARE_SSID_BUF(ssid);
1127 u8 i; 1128 u8 i;
1128#ifdef CONFIG_IEEE80211_DEBUG 1129#ifdef CONFIG_IEEE80211_DEBUG
1129 char rates_str[64]; 1130 char rates_str[64];
@@ -1155,7 +1156,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1155 IW_ESSID_MAX_SIZE - network->ssid_len); 1156 IW_ESSID_MAX_SIZE - network->ssid_len);
1156 1157
1157 IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", 1158 IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
1158 escape_ssid(network->ssid), 1159 print_ssid(ssid, network->ssid,
1160 network->ssid_len),
1159 network->ssid_len); 1161 network->ssid_len);
1160 break; 1162 break;
1161 1163
@@ -1401,6 +1403,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1401 struct ieee80211_network *network, 1403 struct ieee80211_network *network,
1402 struct ieee80211_rx_stats *stats) 1404 struct ieee80211_rx_stats *stats)
1403{ 1405{
1406 DECLARE_SSID_BUF(ssid);
1407
1404 network->qos_data.active = 0; 1408 network->qos_data.active = 0;
1405 network->qos_data.supported = 0; 1409 network->qos_data.supported = 0;
1406 network->qos_data.param_count = 0; 1410 network->qos_data.param_count = 0;
@@ -1449,7 +1453,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1449 if (network->mode == 0) { 1453 if (network->mode == 0) {
1450 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " 1454 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
1451 "network.\n", 1455 "network.\n",
1452 escape_ssid(network->ssid, 1456 print_ssid(ssid, network->ssid,
1453 network->ssid_len), 1457 network->ssid_len),
1454 network->bssid); 1458 network->bssid);
1455 return 1; 1459 return 1;
@@ -1563,10 +1567,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1563 struct ieee80211_info_element *info_element = beacon->info_element; 1567 struct ieee80211_info_element *info_element = beacon->info_element;
1564#endif 1568#endif
1565 unsigned long flags; 1569 unsigned long flags;
1570 DECLARE_SSID_BUF(ssid);
1566 1571
1567 IEEE80211_DEBUG_SCAN("'%s' (%pM" 1572 IEEE80211_DEBUG_SCAN("'%s' (%pM"
1568 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1573 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1569 escape_ssid(info_element->data, info_element->len), 1574 print_ssid(ssid, info_element->data, info_element->len),
1570 beacon->header.addr3, 1575 beacon->header.addr3,
1571 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', 1576 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
1572 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', 1577 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
@@ -1587,7 +1592,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1587 1592
1588 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1593 if (ieee80211_network_init(ieee, beacon, &network, stats)) {
1589 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", 1594 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
1590 escape_ssid(info_element->data, 1595 print_ssid(ssid, info_element->data,
1591 info_element->len), 1596 info_element->len),
1592 beacon->header.addr3, 1597 beacon->header.addr3,
1593 is_beacon(beacon->header.frame_ctl) ? 1598 is_beacon(beacon->header.frame_ctl) ?
@@ -1625,7 +1630,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1625 target = oldest; 1630 target = oldest;
1626 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " 1631 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
1627 "network list.\n", 1632 "network list.\n",
1628 escape_ssid(target->ssid, 1633 print_ssid(ssid, target->ssid,
1629 target->ssid_len), 1634 target->ssid_len),
1630 target->bssid); 1635 target->bssid);
1631 ieee80211_network_reset(target); 1636 ieee80211_network_reset(target);
@@ -1638,7 +1643,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1638 1643
1639#ifdef CONFIG_IEEE80211_DEBUG 1644#ifdef CONFIG_IEEE80211_DEBUG
1640 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", 1645 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
1641 escape_ssid(network.ssid, 1646 print_ssid(ssid, network.ssid,
1642 network.ssid_len), 1647 network.ssid_len),
1643 network.bssid, 1648 network.bssid,
1644 is_beacon(beacon->header.frame_ctl) ? 1649 is_beacon(beacon->header.frame_ctl) ?
@@ -1649,7 +1654,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1649 list_add_tail(&target->list, &ieee->network_list); 1654 list_add_tail(&target->list, &ieee->network_list);
1650 } else { 1655 } else {
1651 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", 1656 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
1652 escape_ssid(target->ssid, 1657 print_ssid(ssid, target->ssid,
1653 target->ssid_len), 1658 target->ssid_len),
1654 target->bssid, 1659 target->bssid,
1655 is_beacon(beacon->header.frame_ctl) ? 1660 is_beacon(beacon->header.frame_ctl) ?
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 3025140ae721..29eb41695a82 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -34,6 +34,7 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/jiffies.h> 35#include <linux/jiffies.h>
36 36
37#include <net/lib80211.h>
37#include <net/ieee80211.h> 38#include <net/ieee80211.h>
38#include <linux/wireless.h> 39#include <linux/wireless.h>
39 40
@@ -258,6 +259,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
258 char *ev = extra; 259 char *ev = extra;
259 char *stop = ev + wrqu->data.length; 260 char *stop = ev + wrqu->data.length;
260 int i = 0; 261 int i = 0;
262 DECLARE_SSID_BUF(ssid);
261 263
262 IEEE80211_DEBUG_WX("Getting scan\n"); 264 IEEE80211_DEBUG_WX("Getting scan\n");
263 265
@@ -277,7 +279,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
277 else 279 else
278 IEEE80211_DEBUG_SCAN("Not showing network '%s (" 280 IEEE80211_DEBUG_SCAN("Not showing network '%s ("
279 "%pM)' due to age (%dms).\n", 281 "%pM)' due to age (%dms).\n",
280 escape_ssid(network->ssid, 282 print_ssid(ssid, network->ssid,
281 network->ssid_len), 283 network->ssid_len),
282 network->bssid, 284 network->bssid,
283 jiffies_to_msecs(jiffies - 285 jiffies_to_msecs(jiffies -
@@ -307,6 +309,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
307 int i, key, key_provided, len; 309 int i, key, key_provided, len;
308 struct ieee80211_crypt_data **crypt; 310 struct ieee80211_crypt_data **crypt;
309 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv; 311 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
312 DECLARE_SSID_BUF(ssid);
310 313
311 IEEE80211_DEBUG_WX("SET_ENCODE\n"); 314 IEEE80211_DEBUG_WX("SET_ENCODE\n");
312 315
@@ -402,7 +405,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
402 memset(sec.keys[key] + erq->length, 0, 405 memset(sec.keys[key] + erq->length, 0,
403 len - erq->length); 406 len - erq->length);
404 IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", 407 IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
405 key, escape_ssid(sec.keys[key], len), 408 key, print_ssid(ssid, sec.keys[key], len),
406 erq->length, len); 409 erq->length, len);
407 sec.key_sizes[key] = len; 410 sec.key_sizes[key] = len;
408 if (*crypt) 411 if (*crypt)
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
index b8e34d31e757..e71f7d085621 100644
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -19,11 +19,10 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
19MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>"); 19MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>");
20MODULE_LICENSE("GPL"); 20MODULE_LICENSE("GPL");
21 21
22const char *escape_ssid(const char *ssid, u8 ssid_len) 22const char *print_ssid(char *buf, const char *ssid, u8 ssid_len)
23{ 23{
24 static char escaped[IEEE80211_MAX_SSID_LEN * 4 + 1];
25 const char *s = ssid; 24 const char *s = ssid;
26 char *d = escaped; 25 char *d = buf;
27 26
28 ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); 27 ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
29 while (ssid_len--) { 28 while (ssid_len--) {
@@ -48,9 +47,9 @@ const char *escape_ssid(const char *ssid, u8 ssid_len)
48 s++; 47 s++;
49 } 48 }
50 *d = '\0'; 49 *d = '\0';
51 return escaped; 50 return buf;
52} 51}
53EXPORT_SYMBOL(escape_ssid); 52EXPORT_SYMBOL(print_ssid);
54 53
55static int __init ieee80211_init(void) 54static int __init ieee80211_init(void)
56{ 55{