diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-09-30 20:59:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:50 -0400 |
commit | 9387b7caf3049168fc97a8a9111af8fe2143af18 (patch) | |
tree | 6a19e5477d6a6badf19788536a9d3e1913ae48e1 /drivers/net/wireless/ipw2200.c | |
parent | 2819f8ad6da1e24b5dd94a221978e61f2a9c972a (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>
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 153 |
1 files changed, 91 insertions, 62 deletions
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) | |||
4395 | static void ipw_rx_notification(struct ipw_priv *priv, | 4395 | static 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 | ||
5579 | static void ipw_merge_adhoc_network(struct work_struct *work) | 5590 | static 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 | ||
6038 | static void ipw_debug_config(struct ipw_priv *priv) | 6062 | static 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 */ |