Commit 9387b7ca authored by John W. Linville's avatar John W. Linville

wireless: use individual buffers for printing ssid values

Also change escape_ssid to print_ssid to match print_mac semantics.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2819f8ad
...@@ -163,6 +163,8 @@ that only one external action is invoked at a time. ...@@ -163,6 +163,8 @@ that only one external action is invoked at a time.
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/pm_qos_params.h> #include <linux/pm_qos_params.h>
#include <net/lib80211.h>
#include "ipw2100.h" #include "ipw2100.h"
#define IPW2100_VERSION "git-1.2.2" #define IPW2100_VERSION "git-1.2.2"
...@@ -1914,6 +1916,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status) ...@@ -1914,6 +1916,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
u32 chan; u32 chan;
char *txratename; char *txratename;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
DECLARE_SSID_BUF(ssid);
/* /*
* TBD: BSSID is usually 00:00:00:00:00:00 here and not * 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,7 +1978,7 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
} }
IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n", IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n",
priv->net_dev->name, escape_ssid(essid, essid_len), priv->net_dev->name, print_ssid(ssid, essid, essid_len),
txratename, chan, bssid); txratename, chan, bssid);
/* now we copy read ssid into dev */ /* now we copy read ssid into dev */
...@@ -2002,8 +2005,9 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid, ...@@ -2002,8 +2005,9 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
.host_command_length = ssid_len .host_command_length = ssid_len
}; };
int err; int err;
DECLARE_SSID_BUF(ssid);
IPW_DEBUG_HC("SSID: '%s'\n", escape_ssid(essid, ssid_len)); IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len));
if (ssid_len) if (ssid_len)
memcpy(cmd.host_command_parameters, essid, ssid_len); memcpy(cmd.host_command_parameters, essid, ssid_len);
...@@ -2044,9 +2048,11 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid, ...@@ -2044,9 +2048,11 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
{ {
DECLARE_SSID_BUF(ssid);
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
"disassociated: '%s' %pM \n", "disassociated: '%s' %pM \n",
escape_ssid(priv->essid, priv->essid_len), print_ssid(ssid, priv->essid, priv->essid_len),
priv->bssid); priv->bssid);
priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
...@@ -6958,6 +6964,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev, ...@@ -6958,6 +6964,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
char *essid = ""; /* ANY */ char *essid = ""; /* ANY */
int length = 0; int length = 0;
int err = 0; int err = 0;
DECLARE_SSID_BUF(ssid);
mutex_lock(&priv->action_mutex); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
...@@ -6987,8 +6994,8 @@ static int ipw2100_wx_set_essid(struct net_device *dev, ...@@ -6987,8 +6994,8 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
goto done; goto done;
} }
IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_ssid(essid, length), IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n",
length); print_ssid(ssid, essid, length), length);
priv->essid_len = length; priv->essid_len = length;
memcpy(priv->essid, essid, priv->essid_len); memcpy(priv->essid, essid, priv->essid_len);
...@@ -7009,12 +7016,13 @@ static int ipw2100_wx_get_essid(struct net_device *dev, ...@@ -7009,12 +7016,13 @@ static int ipw2100_wx_get_essid(struct net_device *dev,
*/ */
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
DECLARE_SSID_BUF(ssid);
/* If we are associated, trying to associate, or have a statically /* If we are associated, trying to associate, or have a statically
* configured ESSID then return that; otherwise return ANY */ * configured ESSID then return that; otherwise return ANY */
if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) { if (priv->config & CFG_STATIC_ESSID || priv->status & STATUS_ASSOCIATED) {
IPW_DEBUG_WX("Getting essid: '%s'\n", IPW_DEBUG_WX("Getting essid: '%s'\n",
escape_ssid(priv->essid, priv->essid_len)); print_ssid(ssid, priv->essid, priv->essid_len));
memcpy(extra, priv->essid, priv->essid_len); memcpy(extra, priv->essid, priv->essid_len);
wrqu->essid.length = priv->essid_len; wrqu->essid.length = priv->essid_len;
wrqu->essid.flags = 1; /* active */ wrqu->essid.flags = 1; /* active */
......
...@@ -4395,6 +4395,7 @@ static void handle_scan_event(struct ipw_priv *priv) ...@@ -4395,6 +4395,7 @@ static void handle_scan_event(struct ipw_priv *priv)
static void ipw_rx_notification(struct ipw_priv *priv, static void ipw_rx_notification(struct ipw_priv *priv,
struct ipw_rx_notification *notif) struct ipw_rx_notification *notif)
{ {
DECLARE_SSID_BUF(ssid);
u16 size = le16_to_cpu(notif->size); u16 size = le16_to_cpu(notif->size);
notif->size = le16_to_cpu(notif->size); notif->size = le16_to_cpu(notif->size);
...@@ -4409,7 +4410,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4409,7 +4410,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
IPW_DL_ASSOC, IPW_DL_ASSOC,
"associated: '%s' %pM \n", "associated: '%s' %pM \n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len), priv->essid_len),
priv->bssid); priv->bssid);
...@@ -4490,7 +4491,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4490,7 +4491,8 @@ static void ipw_rx_notification(struct ipw_priv *priv,
"deauthenticated: '%s' " "deauthenticated: '%s' "
"%pM" "%pM"
": (0x%04X) - %s \n", ": (0x%04X) - %s \n",
escape_ssid(priv-> print_ssid(ssid,
priv->
essid, essid,
priv-> priv->
essid_len), essid_len),
...@@ -4512,7 +4514,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4512,7 +4514,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
IPW_DL_ASSOC, IPW_DL_ASSOC,
"authenticated: '%s' %pM\n", "authenticated: '%s' %pM\n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len), priv->essid_len),
priv->bssid); priv->bssid);
break; break;
...@@ -4540,7 +4542,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4540,7 +4542,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
IPW_DL_ASSOC, IPW_DL_ASSOC,
"disassociated: '%s' %pM \n", "disassociated: '%s' %pM \n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len), priv->essid_len),
priv->bssid); priv->bssid);
...@@ -4578,7 +4580,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4578,7 +4580,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
case CMAS_AUTHENTICATED: case CMAS_AUTHENTICATED:
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
"authenticated: '%s' %pM \n", "authenticated: '%s' %pM \n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len), priv->essid_len),
priv->bssid); priv->bssid);
priv->status |= STATUS_AUTH; priv->status |= STATUS_AUTH;
...@@ -4597,7 +4599,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, ...@@ -4597,7 +4599,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
IPW_DL_ASSOC, IPW_DL_ASSOC,
"deauthenticated: '%s' %pM\n", "deauthenticated: '%s' %pM\n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len), priv->essid_len),
priv->bssid); priv->bssid);
...@@ -5423,6 +5425,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5423,6 +5425,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
int roaming) int roaming)
{ {
struct ipw_supported_rates rates; struct ipw_supported_rates rates;
DECLARE_SSID_BUF(ssid);
/* Verify that this network's capability is compatible with the /* Verify that this network's capability is compatible with the
* current mode (AdHoc or Infrastructure) */ * current mode (AdHoc or Infrastructure) */
...@@ -5430,7 +5433,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5430,7 +5433,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
!(network->capability & WLAN_CAPABILITY_IBSS))) { !(network->capability & WLAN_CAPABILITY_IBSS))) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to "
"capability mismatch.\n", "capability mismatch.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5443,7 +5447,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5443,7 +5447,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
network->ssid_len)) { network->ssid_len)) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of non-network ESSID.\n", "because of non-network ESSID.\n",
escape_ssid(network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
...@@ -5458,12 +5462,13 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5458,12 +5462,13 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strncpy(escaped,
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
sizeof(escaped)); sizeof(escaped));
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of ESSID mismatch: '%s'.\n", "because of ESSID mismatch: '%s'.\n",
escaped, network->bssid, escaped, network->bssid,
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len)); priv->essid_len));
return 0; return 0;
} }
...@@ -5475,13 +5480,13 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5475,13 +5480,13 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
if (network->time_stamp[0] < match->network->time_stamp[0]) { if (network->time_stamp[0] < match->network->time_stamp[0]) {
IPW_DEBUG_MERGE("Network '%s excluded because newer than " IPW_DEBUG_MERGE("Network '%s excluded because newer than "
"current network.\n", "current network.\n",
escape_ssid(match->network->ssid, print_ssid(ssid, match->network->ssid,
match->network->ssid_len)); match->network->ssid_len));
return 0; return 0;
} else if (network->time_stamp[1] < match->network->time_stamp[1]) { } else if (network->time_stamp[1] < match->network->time_stamp[1]) {
IPW_DEBUG_MERGE("Network '%s excluded because newer than " IPW_DEBUG_MERGE("Network '%s excluded because newer than "
"current network.\n", "current network.\n",
escape_ssid(match->network->ssid, print_ssid(ssid, match->network->ssid,
match->network->ssid_len)); match->network->ssid_len));
return 0; return 0;
} }
...@@ -5491,7 +5496,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5491,7 +5496,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of age: %ums.\n", "because of age: %ums.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
jiffies_to_msecs(jiffies - jiffies_to_msecs(jiffies -
network->last_scanned)); network->last_scanned));
...@@ -5502,7 +5508,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5502,7 +5508,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
(network->channel != priv->channel)) { (network->channel != priv->channel)) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of channel mismatch: %d != %d.\n", "because of channel mismatch: %d != %d.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
network->channel, priv->channel); network->channel, priv->channel);
return 0; return 0;
...@@ -5513,7 +5520,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5513,7 +5520,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of privacy mismatch: %s != %s.\n", "because of privacy mismatch: %s != %s.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
priv-> priv->
capability & CAP_PRIVACY_ON ? "on" : "off", capability & CAP_PRIVACY_ON ? "on" : "off",
...@@ -5526,7 +5534,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5526,7 +5534,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of the same BSSID match: %pM" "because of the same BSSID match: %pM"
".\n", escape_ssid(network->ssid, ".\n", print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
network->bssid, network->bssid,
priv->bssid); priv->bssid);
...@@ -5538,7 +5546,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5538,7 +5546,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of invalid frequency/mode " "because of invalid frequency/mode "
"combination.\n", "combination.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5549,7 +5558,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5549,7 +5558,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because configured rate mask excludes " "because configured rate mask excludes "
"AP mandatory rate.\n", "AP mandatory rate.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5557,7 +5567,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5557,7 +5567,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
if (rates.num_rates == 0) { if (rates.num_rates == 0) {
IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
"because of no compatible rates.\n", "because of no compatible rates.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5570,7 +5581,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5570,7 +5581,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
ipw_copy_rates(&match->rates, &rates); ipw_copy_rates(&match->rates, &rates);
match->network = network; match->network = network;
IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n", IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid, network->ssid_len),
network->bssid); network->bssid);
return 1; return 1;
...@@ -5578,6 +5589,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, ...@@ -5578,6 +5589,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
static void ipw_merge_adhoc_network(struct work_struct *work) static void ipw_merge_adhoc_network(struct work_struct *work)
{ {
DECLARE_SSID_BUF(ssid);
struct ipw_priv *priv = struct ipw_priv *priv =
container_of(work, struct ipw_priv, merge_networks); container_of(work, struct ipw_priv, merge_networks);
struct ieee80211_network *network = NULL; struct ieee80211_network *network = NULL;
...@@ -5608,7 +5620,7 @@ static void ipw_merge_adhoc_network(struct work_struct *work) ...@@ -5608,7 +5620,7 @@ static void ipw_merge_adhoc_network(struct work_struct *work)
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) { if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
IPW_DEBUG_MERGE("remove network %s\n", IPW_DEBUG_MERGE("remove network %s\n",
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len)); priv->essid_len));
ipw_remove_current_network(priv); ipw_remove_current_network(priv);
} }
...@@ -5625,6 +5637,7 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5625,6 +5637,7 @@ static int ipw_best_network(struct ipw_priv *priv,
struct ieee80211_network *network, int roaming) struct ieee80211_network *network, int roaming)
{ {
struct ipw_supported_rates rates; struct ipw_supported_rates rates;
DECLARE_SSID_BUF(ssid);
/* Verify that this network's capability is compatible with the /* Verify that this network's capability is compatible with the
* current mode (AdHoc or Infrastructure) */ * current mode (AdHoc or Infrastructure) */
...@@ -5634,7 +5647,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5634,7 +5647,8 @@ static int ipw_best_network(struct ipw_priv *priv,
!(network->capability & WLAN_CAPABILITY_IBSS))) { !(network->capability & WLAN_CAPABILITY_IBSS))) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to "
"capability mismatch.\n", "capability mismatch.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5647,7 +5661,7 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5647,7 +5661,7 @@ static int ipw_best_network(struct ipw_priv *priv,
network->ssid_len)) { network->ssid_len)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of non-network ESSID.\n", "because of non-network ESSID.\n",
escape_ssid(network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
...@@ -5661,12 +5675,13 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5661,12 +5675,13 @@ static int ipw_best_network(struct ipw_priv *priv,
min(network->ssid_len, priv->essid_len)))) { min(network->ssid_len, priv->essid_len)))) {
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strncpy(escaped,
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
sizeof(escaped)); sizeof(escaped));
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of ESSID mismatch: '%s'.\n", "because of ESSID mismatch: '%s'.\n",
escaped, network->bssid, escaped, network->bssid,
escape_ssid(priv->essid, print_ssid(ssid, priv->essid,
priv->essid_len)); priv->essid_len));
return 0; return 0;
} }
...@@ -5677,12 +5692,12 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5677,12 +5692,12 @@ static int ipw_best_network(struct ipw_priv *priv,
if (match->network && match->network->stats.rssi > network->stats.rssi) { if (match->network && match->network->stats.rssi > network->stats.rssi) {
char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
strncpy(escaped, strncpy(escaped,
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid, network->ssid_len),
sizeof(escaped)); sizeof(escaped));
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "
"'%s (%pM)' has a stronger signal.\n", "'%s (%pM)' has a stronger signal.\n",
escaped, network->bssid, escaped, network->bssid,
escape_ssid(match->network->ssid, print_ssid(ssid, match->network->ssid,
match->network->ssid_len), match->network->ssid_len),
match->network->bssid); match->network->bssid);
return 0; return 0;
...@@ -5695,7 +5710,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5695,7 +5710,8 @@ static int ipw_best_network(struct ipw_priv *priv,
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of storming (%ums since last " "because of storming (%ums since last "
"assoc attempt).\n", "assoc attempt).\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
jiffies_to_msecs(jiffies - jiffies_to_msecs(jiffies -
network->last_associate)); network->last_associate));
...@@ -5707,7 +5723,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5707,7 +5723,8 @@ static int ipw_best_network(struct ipw_priv *priv,
time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of age: %ums.\n", "because of age: %ums.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
jiffies_to_msecs(jiffies - jiffies_to_msecs(jiffies -
network->last_scanned)); network->last_scanned));
...@@ -5718,7 +5735,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5718,7 +5735,8 @@ static int ipw_best_network(struct ipw_priv *priv,
(network->channel != priv->channel)) { (network->channel != priv->channel)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of channel mismatch: %d != %d.\n", "because of channel mismatch: %d != %d.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
network->channel, priv->channel); network->channel, priv->channel);
return 0; return 0;
...@@ -5729,7 +5747,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5729,7 +5747,8 @@ static int ipw_best_network(struct ipw_priv *priv,
((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of privacy mismatch: %s != %s.\n", "because of privacy mismatch: %s != %s.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, network->bssid,
priv->capability & CAP_PRIVACY_ON ? "on" : priv->capability & CAP_PRIVACY_ON ? "on" :
"off", "off",
...@@ -5742,7 +5761,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5742,7 +5761,8 @@ static int ipw_best_network(struct ipw_priv *priv,
memcmp(network->bssid, priv->bssid, ETH_ALEN)) { memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of BSSID mismatch: %pM.\n", "because of BSSID mismatch: %pM.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid, priv->bssid); network->bssid, priv->bssid);
return 0; return 0;
} }
...@@ -5752,7 +5772,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5752,7 +5772,8 @@ static int ipw_best_network(struct ipw_priv *priv,
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of invalid frequency/mode " "because of invalid frequency/mode "
"combination.\n", "combination.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5761,7 +5782,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5761,7 +5782,8 @@ static int ipw_best_network(struct ipw_priv *priv,
if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of invalid channel in current GEO\n", "because of invalid channel in current GEO\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5772,7 +5794,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5772,7 +5794,8 @@ static int ipw_best_network(struct ipw_priv *priv,
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because configured rate mask excludes " "because configured rate mask excludes "
"AP mandatory rate.\n", "AP mandatory rate.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5780,7 +5803,8 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5780,7 +5803,8 @@ static int ipw_best_network(struct ipw_priv *priv,
if (rates.num_rates == 0) { if (rates.num_rates == 0) {
IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
"because of no compatible rates.\n", "because of no compatible rates.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid); network->bssid);
return 0; return 0;
} }
...@@ -5794,7 +5818,7 @@ static int ipw_best_network(struct ipw_priv *priv, ...@@ -5794,7 +5818,7 @@ static int ipw_best_network(struct ipw_priv *priv,
match->network = network; match->network = network;
IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n", IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n",
escape_ssid(network->ssid, network->ssid_len), print_ssid(ssid, network->ssid, network->ssid_len),
network->bssid); network->bssid);
return 1; return 1;
...@@ -6037,6 +6061,7 @@ static void ipw_bg_adhoc_check(struct work_struct *work) ...@@ -6037,6 +6061,7 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
static void ipw_debug_config(struct ipw_priv *priv) static void ipw_debug_config(struct ipw_priv *priv)
{ {
DECLARE_SSID_BUF(ssid);
IPW_DEBUG_INFO("Scan completed, no valid APs matched " IPW_DEBUG_INFO("Scan completed, no valid APs matched "
"[CFG 0x%08X]\n", priv->config); "[CFG 0x%08X]\n", priv->config);
if (priv->config & CFG_STATIC_CHANNEL) if (priv->config & CFG_STATIC_CHANNEL)
...@@ -6045,7 +6070,7 @@ static void ipw_debug_config(struct ipw_priv *priv) ...@@ -6045,7 +6070,7 @@ static void ipw_debug_config(struct ipw_priv *priv)
IPW_DEBUG_INFO("Channel unlocked.\n"); IPW_DEBUG_INFO("Channel unlocked.\n");
if (priv->config & CFG_STATIC_ESSID) if (priv->config & CFG_STATIC_ESSID)
IPW_DEBUG_INFO("ESSID locked to '%s'\n", IPW_DEBUG_INFO("ESSID locked to '%s'\n",
escape_ssid(priv->essid, priv->essid_len)); print_ssid(ssid, priv->essid, priv->essid_len));
else else
IPW_DEBUG_INFO("ESSID unlocked.\n"); IPW_DEBUG_INFO("ESSID unlocked.\n");
if (priv->config & CFG_STATIC_BSSID) if (priv->config & CFG_STATIC_BSSID)
...@@ -7263,6 +7288,7 @@ static int ipw_associate_network(struct ipw_priv *priv, ...@@ -7263,6 +7288,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
struct ipw_supported_rates *rates, int roaming) struct ipw_supported_rates *rates, int roaming)
{ {
int err; int err;
DECLARE_SSID_BUF(ssid);
if (priv->config & CFG_FIXED_RATE) if (priv->config & CFG_FIXED_RATE)
ipw_set_fixed_rate(priv, network->mode); ipw_set_fixed_rate(priv, network->mode);
...@@ -7331,7 +7357,7 @@ static int ipw_associate_network(struct ipw_priv *priv, ...@@ -7331,7 +7357,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, " IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, "
"802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n", "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n",
roaming ? "Rea" : "A", roaming ? "Rea" : "A",
escape_ssid(priv->essid, priv->essid_len), print_ssid(ssid, priv->essid, priv->essid_len),
network->channel, network->channel,
ipw_modes[priv->assoc_request.ieee_mode], ipw_modes[priv->assoc_request.ieee_mode],
rates->num_rates, rates->num_rates,
...@@ -7431,7 +7457,7 @@ static int ipw_associate_network(struct ipw_priv *priv, ...@@ -7431,7 +7457,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
} }
IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM \n", IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM \n",
escape_ssid(priv->essid, priv->essid_len), print_ssid(ssid, priv->essid, priv->essid_len),
priv->bssid); priv->bssid);
return 0; return 0;
...@@ -7522,6 +7548,7 @@ static int ipw_associate(void *data) ...@@ -7522,6 +7548,7 @@ static int ipw_associate(void *data)
struct ipw_supported_rates *rates; struct ipw_supported_rates *rates;
struct list_head *element; struct list_head *element;
unsigned long flags; unsigned long flags;
DECLARE_SSID_BUF(ssid);
if (priv->ieee->iw_mode == IW_MODE_MONITOR) { if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n"); IPW_DEBUG_ASSOC("Not attempting association (monitor mode)\n");
...@@ -7583,7 +7610,7 @@ static int ipw_associate(void *data) ...@@ -7583,7 +7610,7 @@ static int ipw_associate(void *data)
target = oldest; target = oldest;
IPW_DEBUG_ASSOC("Expired '%s' (%pM) from " IPW_DEBUG_ASSOC("Expired '%s' (%pM) from "
"network list.\n", "network list.\n",
escape_ssid(target->ssid, print_ssid(ssid, target->ssid,
target->ssid_len), target->ssid_len),
target->bssid); target->bssid);
list_add_tail(&target->list, list_add_tail(&target->list,
...@@ -9012,6 +9039,7 @@ static int ipw_wx_set_essid(struct net_device *dev, ...@@ -9012,6 +9039,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
{ {
struct ipw_priv *priv = ieee80211_priv(dev); struct ipw_priv *priv = ieee80211_priv(dev);
int length; int length;
DECLARE_SSID_BUF(ssid);
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
...@@ -9036,8 +9064,8 @@ static int ipw_wx_set_essid(struct net_device *dev, ...@@ -9036,8 +9064,8 @@ static int ipw_wx_set_essid(struct net_device *dev,
return 0; return 0;
} }
IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", escape_ssid(extra, length), IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n",
length); print_ssid(ssid, extra, length), length);
priv->essid_len = length; priv->essid_len = length;
memcpy(priv->essid, extra, priv->essid_len); memcpy(priv->essid, extra, priv->essid_len);
...@@ -9056,6 +9084,7 @@ static int ipw_wx_get_essid(struct net_device *dev, ...@@ -9056,6 +9084,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
struct ipw_priv *priv = ieee80211_priv(dev); struct ipw_priv *priv = ieee80211_priv(dev);
DECLARE_SSID_BUF(ssid);
/* If we are associated, trying to associate, or have a statically /* If we are associated, trying to associate, or have a statically
* configured ESSID then return that; otherwise return ANY */ * configured ESSID then return that; otherwise return ANY */
...@@ -9063,7 +9092,7 @@ static int ipw_wx_get_essid(struct net_device *dev, ...@@ -9063,7 +9092,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
if (priv->config & CFG_STATIC_ESSID || if (priv->config & CFG_STATIC_ESSID ||
priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) {
IPW_DEBUG_WX("Getting essid: '%s'\n", IPW_DEBUG_WX("Getting essid: '%s'\n",
escape_ssid(priv->essid, priv->essid_len)); print_ssid(ssid, priv->essid, priv->essid_len));
memcpy(extra, priv->essid, priv->essid_len); memcpy(extra, priv->essid, priv->essid_len);
wrqu->essid.length = priv->essid_len; wrqu->essid.length = priv->essid_len;
wrqu->essid.flags = 1; /* active */ wrqu->essid.flags = 1; /* active */
......
...@@ -643,6 +643,7 @@ static void iwl_bg_request_scan(struct work_struct *data) ...@@ -643,6 +643,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
u8 n_probes = 2; u8 n_probes = 2;
u8 rx_chain = priv->hw_params.valid_rx_ant; u8 rx_chain = priv->hw_params.valid_rx_ant;
u8 rate; u8 rate;
DECLARE_SSID_BUF(ssid);
conf = ieee80211_get_hw_conf(priv->hw); conf = ieee80211_get_hw_conf(priv->hw);
...@@ -735,7 +736,7 @@ static void iwl_bg_request_scan(struct work_struct *data) ...@@ -735,7 +736,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
/* We should add the ability for user to lock to PASSIVE ONLY */ /* We should add the ability for user to lock to PASSIVE ONLY */
if (priv->one_direct_scan) { if (priv->one_direct_scan) {
IWL_DEBUG_SCAN("Start direct scan for '%s'\n", IWL_DEBUG_SCAN("Start direct scan for '%s'\n",
escape_ssid(priv->direct_ssid, print_ssid(ssid, priv->direct_ssid,
priv->direct_ssid_len)); priv->direct_ssid_len));
scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].id = WLAN_EID_SSID;
scan->direct_scan[0].len = priv->direct_ssid_len; scan->direct_scan[0].len = priv->direct_ssid_len;
...@@ -744,7 +745,7 @@ static void iwl_bg_request_scan(struct work_struct *data) ...@@ -744,7 +745,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
n_probes++; n_probes++;
} else if (!iwl_is_associated(priv) && priv->essid_len) { } else if (!iwl_is_associated(priv) && priv->essid_len) {
IWL_DEBUG_SCAN("Start direct scan for '%s' (not associated)\n", IWL_DEBUG_SCAN("Start direct scan for '%s' (not associated)\n",
escape_ssid(priv->essid, priv->essid_len)); print_ssid(ssid, priv->essid, priv->essid_len));
scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].id = WLAN_EID_SSID;
scan->direct_scan[0].len = priv->essid_len; scan->direct_scan[0].len = priv->essid_len;
memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
......
...@@ -6054,6 +6054,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) ...@@ -6054,6 +6054,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
struct ieee80211_conf *conf = NULL; struct ieee80211_conf *conf = NULL;
u8 n_probes = 2; u8 n_probes = 2;
enum ieee80211_band band; enum ieee80211_band band;
DECLARE_SSID_BUF(ssid);
conf = ieee80211_get_hw_conf(priv->hw); conf = ieee80211_get_hw_conf(priv->hw);
...@@ -6154,7 +6155,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data) ...@@ -6154,7 +6155,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
if (priv->one_direct_scan) { if (priv->one_direct_scan) {
IWL_DEBUG_SCAN IWL_DEBUG_SCAN
("Kicking off one direct scan for '%s'\n", ("Kicking off one direct scan for '%s'\n",
escape_ssid(priv->direct_ssid, priv->direct_ssid_len)); print_ssid(ssid, priv->direct_ssid,
priv->direct_ssid_len));
scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].id = WLAN_EID_SSID;
scan->direct_scan[0].len = priv->direct_ssid_len; scan->direct_scan[0].len = priv->direct_ssid_len;
memcpy(scan->direct_scan[0].ssid, memcpy(scan->direct_scan[0].ssid,
...@@ -6163,7 +6165,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) ...@@ -6163,7 +6165,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
} else if (!iwl3945_is_associated(priv) && priv->essid_len) { } else if (!iwl3945_is_associated(priv) && priv->essid_len) {
IWL_DEBUG_SCAN IWL_DEBUG_SCAN
("Kicking off one direct scan for '%s' when not associated\n", ("Kicking off one direct scan for '%s' when not associated\n",
escape_ssid(priv->essid, priv->essid_len)); print_ssid(ssid, priv->essid, priv->essid_len));
scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].id = WLAN_EID_SSID;
scan->direct_scan[0].len = priv->essid_len; scan->direct_scan[0].len = priv->essid_len;
memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 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,6 +6947,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
int rc = 0; int rc = 0;
unsigned long flags; unsigned long flags;
struct iwl3945_priv *priv = hw->priv; struct iwl3945_priv *priv = hw->priv;
DECLARE_SSID_BUF(ssid_buf);
IWL_DEBUG_MAC80211("enter\n"); IWL_DEBUG_MAC80211("enter\n");
...@@ -6978,7 +6981,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) ...@@ -6978,7 +6981,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
} }
if (len) { if (len) {
IWL_DEBUG_SCAN("direct scan for %s [%d]\n ", IWL_DEBUG_SCAN("direct scan for %s [%d]\n ",
escape_ssid(ssid, len), (int)len); print_ssid(ssid_buf, ssid, len), (int)len);
priv->one_direct_scan = 1; priv->one_direct_scan = 1;
priv->direct_ssid_len = (u8) priv->direct_ssid_len = (u8)
......
...@@ -153,17 +153,18 @@ static int lbs_adhoc_join(struct lbs_private *priv, ...@@ -153,17 +153,18 @@ static int lbs_adhoc_join(struct lbs_private *priv,
struct cmd_ds_802_11_ad_hoc_join cmd; struct cmd_ds_802_11_ad_hoc_join cmd;
struct bss_descriptor *bss = &assoc_req->bss; struct bss_descriptor *bss = &assoc_req->bss;
u8 preamble = RADIO_PREAMBLE_LONG; u8 preamble = RADIO_PREAMBLE_LONG;
DECLARE_SSID_BUF(ssid);
u16 ratesize = 0; u16 ratesize = 0;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_ASSOC); lbs_deb_enter(LBS_DEB_ASSOC);
lbs_deb_join("current SSID '%s', ssid length %u\n", lbs_deb_join("current SSID '%s', ssid length %u\n",
escape_ssid(priv->curbssparams.ssid, print_ssid(ssid, priv->curbssparams.ssid,
priv->curbssparams.ssid_len), priv->curbssparams.ssid_len),
priv->curbssparams.ssid_len); priv->curbssparams.ssid_len);
lbs_deb_join("requested ssid '%s', ssid length %u\n", lbs_deb_join("requested ssid '%s', ssid length %u\n",
escape_ssid(bss->ssid, bss->ssid_len), print_ssid(ssid, bss->ssid, bss->ssid_len),
bss->ssid_len); bss->ssid_len);
/* check if the requested SSID is already joined */ /* check if the requested SSID is already joined */
...@@ -308,6 +309,7 @@ static int lbs_adhoc_start(struct lbs_private *priv, ...@@ -308,6 +309,7 @@ static int lbs_adhoc_start(struct lbs_private *priv,
size_t ratesize = 0; size_t ratesize = 0;
u16 tmpcap = 0; u16 tmpcap = 0;
int ret = 0; int ret = 0;
DECLARE_SSID_BUF(ssid);
lbs_deb_enter(LBS_DEB_ASSOC); lbs_deb_enter(LBS_DEB_ASSOC);
...@@ -327,7 +329,7 @@ static int lbs_adhoc_start(struct lbs_private *priv, ...@@ -327,7 +329,7 @@ static int lbs_adhoc_start(struct lbs_private *priv,
memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len); memcpy(cmd.ssid, assoc_req->ssid, assoc_req->ssid_len);
lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n",
escape_ssid(assoc_req->ssid, assoc_req->ssid_len), print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len),
assoc_req->ssid_len); assoc_req->ssid_len);
cmd.bsstype = CMD_BSS_TYPE_IBSS; cmd.bsstype = CMD_BSS_TYPE_IBSS;
...@@ -695,6 +697,7 @@ static int assoc_helper_essid(struct lbs_private *priv, ...@@ -695,6 +697,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
int ret = 0; int ret = 0;
struct bss_descriptor * bss; struct bss_descriptor * bss;
int channel = -1; int channel = -1;
DECLARE_SSID_BUF(ssid);
lbs_deb_enter(LBS_DEB_ASSOC); lbs_deb_enter(LBS_DEB_ASSOC);
...@@ -706,7 +709,7 @@ static int assoc_helper_essid(struct lbs_private *priv, ...@@ -706,7 +709,7 @@ static int assoc_helper_essid(struct lbs_private *priv,
channel = assoc_req->channel; channel = assoc_req->channel;
lbs_deb_assoc("SSID '%s' requested\n", lbs_deb_assoc("SSID '%s' requested\n",
escape_ssid(assoc_req->ssid, assoc_req->ssid_len)); print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len));
if (assoc_req->mode == IW_MODE_INFRA) { if (assoc_req->mode == IW_MODE_INFRA) {
lbs_send_specific_ssid_scan(priv, assoc_req->ssid, lbs_send_specific_ssid_scan(priv, assoc_req->ssid,
assoc_req->ssid_len); assoc_req->ssid_len);
...@@ -1207,6 +1210,7 @@ void lbs_association_worker(struct work_struct *work) ...@@ -1207,6 +1210,7 @@ void lbs_association_worker(struct work_struct *work)
struct assoc_request * assoc_req = NULL; struct assoc_request * assoc_req = NULL;
int ret = 0; int ret = 0;
int find_any_ssid = 0; int find_any_ssid = 0;
DECLARE_SSID_BUF(ssid);
lbs_deb_enter(LBS_DEB_ASSOC); lbs_deb_enter(LBS_DEB_ASSOC);
...@@ -1230,7 +1234,7 @@ void lbs_association_worker(struct work_struct *work) ...@@ -1230,7 +1234,7 @@ void lbs_association_worker(struct work_struct *work)
" secinfo: %s%s%s\n" " secinfo: %s%s%s\n"
" auth_mode: %d\n", " auth_mode: %d\n",
assoc_req->flags, assoc_req->flags,
escape_ssid(assoc_req->ssid, assoc_req->ssid_len), print_ssid(ssid, assoc_req->ssid, assoc_req->ssid_len),
assoc_req->channel, assoc_req->band, assoc_req->mode, assoc_req->channel, assoc_req->band, assoc_req->mode,
assoc_req->bssid, assoc_req->bssid,
assoc_req->secinfo.WPAenabled ? " WPA" : "", assoc_req->secinfo.WPAenabled ? " WPA" : "",
...@@ -1767,6 +1771,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp) ...@@ -1767,6 +1771,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; struct cmd_ds_802_11_ad_hoc_result *adhoc_resp;
union iwreq_data wrqu; union iwreq_data wrqu;
struct bss_descriptor *bss; struct bss_descriptor *bss;
DECLARE_SSID_BUF(ssid);
lbs_deb_enter(LBS_DEB_JOIN); lbs_deb_enter(LBS_DEB_JOIN);
...@@ -1816,7 +1821,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp) ...@@ -1816,7 +1821,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n",
escape_ssid(bss->ssid, bss->ssid_len), print_ssid(ssid, bss->ssid, bss->ssid_len),
priv->curbssparams.bssid, priv->curbssparams.bssid,
priv->curbssparams.channel); priv->curbssparams.channel);
......
...@@ -1063,6 +1063,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan) ...@@ -1063,6 +1063,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan)
{ {
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
struct mrvl_meshie *ie; struct mrvl_meshie *ie;
DECLARE_SSID_BUF(ssid);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.channel = cpu_to_le16(chan); 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,7 +1094,7 @@ int lbs_mesh_config(struct lbs_private *priv, uint16_t action, uint16_t chan)
} }
lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n", lbs_deb_cmd("mesh config action %d type %x channel %d SSID %s\n",
action, priv->mesh_tlv, chan, action, priv->mesh_tlv, chan,
escape_ssid(priv->mesh_ssid, priv->mesh_ssid_len)); print_ssid(ssid, priv->mesh_ssid, priv->mesh_ssid_len));
return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv); return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
} }
......
...@@ -66,6 +66,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, ...@@ -66,6 +66,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
int numscansdone = 0, res; int numscansdone = 0, res;
unsigned long addr = get_zeroed_page(GFP_KERNEL); unsigned long addr = get_zeroed_page(GFP_KERNEL);
char *buf = (char *)addr; char *buf = (char *)addr;
DECLARE_SSID_BUF(ssid);
struct bss_descriptor * iter_bss; struct bss_descriptor * iter_bss;
pos += snprintf(buf+pos, len-pos, pos += snprintf(buf+pos, len-pos,
...@@ -86,7 +87,8 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, ...@@ -86,7 +87,8 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
spectrum_mgmt ? 'S' : ' '); spectrum_mgmt ? 'S' : ' ');
pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi)); pos += snprintf(buf+pos, len-pos, " %04d |", SCAN_RSSI(iter_bss->rssi));
pos += snprintf(buf+pos, len-pos, " %s\n", pos += snprintf(buf+pos, len-pos, " %s\n",
escape_ssid(iter_bss->ssid, iter_bss->ssid_len)); print_ssid(ssid, iter_bss->ssid,
iter_bss->ssid_len));
numscansdone++; numscansdone++;
} }
......
...@@ -362,6 +362,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan) ...@@ -362,6 +362,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
#ifdef CONFIG_LIBERTAS_DEBUG #ifdef CONFIG_LIBERTAS_DEBUG
struct bss_descriptor *iter; struct bss_descriptor *iter;
int i = 0; int i = 0;
DECLARE_SSID_BUF(ssid);
#endif #endif
lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); 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,7 +456,7 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
list_for_each_entry(iter, &priv->network_list, list) list_for_each_entry(iter, &priv->network_list, list)
lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n", lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n",
i++, iter->bssid, iter->rssi, i++, iter->bssid, iter->rssi,
escape_ssid(iter->ssid, iter->ssid_len)); print_ssid(ssid, iter->ssid, iter->ssid_len));
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
#endif #endif
...@@ -514,6 +515,7 @@ static int lbs_process_bss(struct bss_descriptor *bss, ...@@ -514,6 +515,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
struct ieeetypes_dsparamset *pDS; struct ieeetypes_dsparamset *pDS;
struct ieeetypes_cfparamset *pCF; struct ieeetypes_cfparamset *pCF;
struct ieeetypes_ibssparamset *pibss; struct ieeetypes_ibssparamset *pibss;
DECLARE_SSID_BUF(ssid);
struct ieeetypes_countryinfoset *pcountryinfo; struct ieeetypes_countryinfoset *pcountryinfo;
uint8_t *pos, *end, *p; uint8_t *pos, *end, *p;
uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; 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,7 +604,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
bss->ssid_len = min_t(int, 32, elem->len); bss->ssid_len = min_t(int, 32, elem->len);
memcpy(bss->ssid, elem->data, bss->ssid_len); memcpy(bss->ssid, elem->data, bss->ssid_len);
lbs_deb_scan("got SSID IE: '%s', len %u\n", lbs_deb_scan("got SSID IE: '%s', len %u\n",
escape_ssid(bss->ssid, bss->ssid_len), print_ssid(ssid, bss->ssid, bss->ssid_len),
bss->ssid_len); bss->ssid_len);
break; break;
...@@ -742,10 +744,11 @@ static int lbs_process_bss(struct bss_descriptor *bss, ...@@ -742,10 +744,11 @@ static int lbs_process_bss(struct bss_descriptor *bss,
int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid, int lbs_send_specific_ssid_scan(struct lbs_private *priv, uint8_t *ssid,
uint8_t ssid_len) uint8_t ssid_len)
{ {
DECLARE_SSID_BUF(ssid_buf);
int ret = 0; int ret = 0;
lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n", lbs_deb_enter_args(LBS_DEB_SCAN, "SSID '%s'\n",
escape_ssid(ssid, ssid_len)); print_ssid(ssid_buf, ssid, ssid_len));
if (!ssid_len) if (!ssid_len)
goto out; goto out;
...@@ -940,6 +943,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, ...@@ -940,6 +943,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv,
int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
DECLARE_SSID_BUF(ssid);
struct lbs_private *priv = dev->priv; struct lbs_private *priv = dev->priv;
int ret = 0; int ret = 0;
...@@ -969,7 +973,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -969,7 +973,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
priv->scan_ssid_len = req->essid_len; priv->scan_ssid_len = req->essid_len;
memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len); memcpy(priv->scan_ssid, req->essid, priv->scan_ssid_len);
lbs_deb_wext("set_scan, essid '%s'\n", lbs_deb_wext("set_scan, essid '%s'\n",
escape_ssid(priv->scan_ssid, priv->scan_ssid_len)); print_ssid(ssid, priv->scan_ssid, priv->scan_ssid_len));
} else { } else {
priv->scan_ssid_len = 0; priv->scan_ssid_len = 0;
} }
......
...@@ -1978,6 +1978,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, ...@@ -1978,6 +1978,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
u8 ssid_len = 0; u8 ssid_len = 0;
struct assoc_request * assoc_req; struct assoc_request * assoc_req;
int in_ssid_len = dwrq->length; int in_ssid_len = dwrq->length;
DECLARE_SSID_BUF(ssid_buf);
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
...@@ -2006,7 +2007,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info, ...@@ -2006,7 +2007,7 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
lbs_deb_wext("requested any SSID\n"); lbs_deb_wext("requested any SSID\n");
} else { } else {
lbs_deb_wext("requested SSID '%s'\n", lbs_deb_wext("requested SSID '%s'\n",
escape_ssid(ssid, ssid_len)); print_ssid(ssid_buf, ssid, ssid_len));
} }
out: out:
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef IEEE80211_H #ifndef LINUX_IEEE80211_H
#define IEEE80211_H #define LINUX_IEEE80211_H
#include <linux/types.h> #include <linux/types.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
...@@ -1114,4 +1114,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) ...@@ -1114,4 +1114,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
return hdr->addr1; return hdr->addr1;
} }
#endif /* IEEE80211_H */ #endif /* LINUX_IEEE80211_H */
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
#ifndef LIB80211_H #ifndef LIB80211_H
#define LIB80211_H #define LIB80211_H
/* escape_ssid() is intended to be used in debug (and possibly error) /* print_ssid() is intended to be used in debug (and possibly error)
* messages. It should never be used for passing ssid to user space. */ * messages. It should never be used for passing ssid to user space. */
const char *escape_ssid(const char *ssid, u8 ssid_len); const char *print_ssid(char *buf, const char *ssid, u8 ssid_len);
#define DECLARE_SSID_BUF(var) char var[32 * 4 + 1] __maybe_unused
#endif /* LIB80211_H */ #endif /* LIB80211_H */
...@@ -1124,6 +1124,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element ...@@ -1124,6 +1124,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
*info_element, u16 length, *info_element, u16 length,
struct ieee80211_network *network) struct ieee80211_network *network)
{ {
DECLARE_SSID_BUF(ssid);
u8 i; u8 i;
#ifdef CONFIG_IEEE80211_DEBUG #ifdef CONFIG_IEEE80211_DEBUG
char rates_str[64]; char rates_str[64];
...@@ -1155,7 +1156,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element ...@@ -1155,7 +1156,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
IW_ESSID_MAX_SIZE - network->ssid_len); IW_ESSID_MAX_SIZE - network->ssid_len);
IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
escape_ssid(network->ssid), print_ssid(ssid, network->ssid,
network->ssid_len),
network->ssid_len); network->ssid_len);
break; break;
...@@ -1401,6 +1403,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021 ...@@ -1401,6 +1403,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
struct ieee80211_network *network, struct ieee80211_network *network,
struct ieee80211_rx_stats *stats) struct ieee80211_rx_stats *stats)
{ {
DECLARE_SSID_BUF(ssid);
network->qos_data.active = 0; network->qos_data.active = 0;
network->qos_data.supported = 0; network->qos_data.supported = 0;
network->qos_data.param_count = 0; network->qos_data.param_count = 0;
...@@ -1449,7 +1453,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021 ...@@ -1449,7 +1453,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
if (network->mode == 0) { if (network->mode == 0) {
IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
"network.\n", "network.\n",
escape_ssid(network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
network->bssid); network->bssid);
return 1; return 1;
...@@ -1563,10 +1567,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1563,10 +1567,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
struct ieee80211_info_element *info_element = beacon->info_element; struct ieee80211_info_element *info_element = beacon->info_element;
#endif #endif
unsigned long flags; unsigned long flags;
DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_SCAN("'%s' (%pM" IEEE80211_DEBUG_SCAN("'%s' (%pM"
"): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
escape_ssid(info_element->data, info_element->len), print_ssid(ssid, info_element->data, info_element->len),
beacon->header.addr3, beacon->header.addr3,
(beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
(beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
...@@ -1587,7 +1592,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1587,7 +1592,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
if (ieee80211_network_init(ieee, beacon, &network, stats)) { if (ieee80211_network_init(ieee, beacon, &network, stats)) {
IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
escape_ssid(info_element->data, print_ssid(ssid, info_element->data,
info_element->len), info_element->len),
beacon->header.addr3, beacon->header.addr3,
is_beacon(beacon->header.frame_ctl) ? is_beacon(beacon->header.frame_ctl) ?
...@@ -1625,7 +1630,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1625,7 +1630,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
target = oldest; target = oldest;
IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
"network list.\n", "network list.\n",
escape_ssid(target->ssid, print_ssid(ssid, target->ssid,
target->ssid_len), target->ssid_len),
target->bssid); target->bssid);
ieee80211_network_reset(target); ieee80211_network_reset(target);
...@@ -1638,7 +1643,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1638,7 +1643,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
#ifdef CONFIG_IEEE80211_DEBUG #ifdef CONFIG_IEEE80211_DEBUG
IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
escape_ssid(network.ssid, print_ssid(ssid, network.ssid,
network.ssid_len), network.ssid_len),
network.bssid, network.bssid,
is_beacon(beacon->header.frame_ctl) ? is_beacon(beacon->header.frame_ctl) ?
...@@ -1649,7 +1654,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1649,7 +1654,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
list_add_tail(&target->list, &ieee->network_list); list_add_tail(&target->list, &ieee->network_list);
} else { } else {
IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
escape_ssid(target->ssid, print_ssid(ssid, target->ssid,
target->ssid_len), target->ssid_len),
target->bssid, target->bssid,
is_beacon(beacon->header.frame_ctl) ? is_beacon(beacon->header.frame_ctl) ?
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <net/lib80211.h>
#include <net/ieee80211.h> #include <net/ieee80211.h>
#include <linux/wireless.h> #include <linux/wireless.h>
...@@ -258,6 +259,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, ...@@ -258,6 +259,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
char *ev = extra; char *ev = extra;
char *stop = ev + wrqu->data.length; char *stop = ev + wrqu->data.length;
int i = 0; int i = 0;
DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_WX("Getting scan\n"); IEEE80211_DEBUG_WX("Getting scan\n");
...@@ -277,7 +279,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, ...@@ -277,7 +279,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
else else
IEEE80211_DEBUG_SCAN("Not showing network '%s (" IEEE80211_DEBUG_SCAN("Not showing network '%s ("
"%pM)' due to age (%dms).\n", "%pM)' due to age (%dms).\n",
escape_ssid(network->ssid, print_ssid(ssid, network->ssid,
network->ssid_len), network->ssid_len),
network->bssid, network->bssid,
jiffies_to_msecs(jiffies - jiffies_to_msecs(jiffies -
...@@ -307,6 +309,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ...@@ -307,6 +309,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
int i, key, key_provided, len; int i, key, key_provided, len;
struct ieee80211_crypt_data **crypt; struct ieee80211_crypt_data **crypt;
int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv; int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_WX("SET_ENCODE\n"); IEEE80211_DEBUG_WX("SET_ENCODE\n");
...@@ -402,7 +405,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ...@@ -402,7 +405,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
memset(sec.keys[key] + erq->length, 0, memset(sec.keys[key] + erq->length, 0,
len - erq->length); len - erq->length);
IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
key, escape_ssid(sec.keys[key], len), key, print_ssid(ssid, sec.keys[key], len),
erq->length, len); erq->length, len);
sec.key_sizes[key] = len; sec.key_sizes[key] = len;
if (*crypt) if (*crypt)
......
...@@ -19,11 +19,10 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); ...@@ -19,11 +19,10 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>"); MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
const char *escape_ssid(const char *ssid, u8 ssid_len) const char *print_ssid(char *buf, const char *ssid, u8 ssid_len)
{ {
static char escaped[IEEE80211_MAX_SSID_LEN * 4 + 1];
const char *s = ssid; const char *s = ssid;
char *d = escaped; char *d = buf;
ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
while (ssid_len--) { while (ssid_len--) {
...@@ -48,9 +47,9 @@ const char *escape_ssid(const char *ssid, u8 ssid_len) ...@@ -48,9 +47,9 @@ const char *escape_ssid(const char *ssid, u8 ssid_len)
s++; s++;
} }
*d = '\0'; *d = '\0';
return escaped; return buf;
} }
EXPORT_SYMBOL(escape_ssid); EXPORT_SYMBOL(print_ssid);
static int __init ieee80211_init(void) static int __init ieee80211_init(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment