diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-09-30 17:17:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:48 -0400 |
commit | c5d3dce875ef055ed9b14f169cc967cc2c8faf1f (patch) | |
tree | 778402be72b858ec6318c480cd19261079cd1f77 | |
parent | 7e272fcff6f0a32a3d46e600ea5895f6058f4e2d (diff) |
wireless: remove NETWORK_EMPTY_ESSID flag
It is unnecessary and of questionable value. Also remove
is_empty_ssid, as it is also unnecessary.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 23 | ||||
-rw-r--r-- | include/net/ieee80211.h | 1 | ||||
-rw-r--r-- | include/net/lib80211.h | 16 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 15 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 12 | ||||
-rw-r--r-- | net/wireless/lib80211.c | 5 |
6 files changed, 6 insertions, 66 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 22278f87d1c1..6e0c55c64e1f 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -5435,16 +5435,6 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, | |||
5435 | return 0; | 5435 | return 0; |
5436 | } | 5436 | } |
5437 | 5437 | ||
5438 | /* If we do not have an ESSID for this AP, we can not associate with | ||
5439 | * it */ | ||
5440 | if (network->flags & NETWORK_EMPTY_ESSID) { | ||
5441 | IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " | ||
5442 | "because of hidden ESSID.\n", | ||
5443 | escape_ssid(network->ssid, network->ssid_len), | ||
5444 | network->bssid); | ||
5445 | return 0; | ||
5446 | } | ||
5447 | |||
5448 | if (unlikely(roaming)) { | 5438 | if (unlikely(roaming)) { |
5449 | /* If we are roaming, then ensure check if this is a valid | 5439 | /* If we are roaming, then ensure check if this is a valid |
5450 | * network to try and roam to */ | 5440 | * network to try and roam to */ |
@@ -5649,16 +5639,6 @@ static int ipw_best_network(struct ipw_priv *priv, | |||
5649 | return 0; | 5639 | return 0; |
5650 | } | 5640 | } |
5651 | 5641 | ||
5652 | /* If we do not have an ESSID for this AP, we can not associate with | ||
5653 | * it */ | ||
5654 | if (network->flags & NETWORK_EMPTY_ESSID) { | ||
5655 | IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " | ||
5656 | "because of hidden ESSID.\n", | ||
5657 | escape_ssid(network->ssid, network->ssid_len), | ||
5658 | network->bssid); | ||
5659 | return 0; | ||
5660 | } | ||
5661 | |||
5662 | if (unlikely(roaming)) { | 5642 | if (unlikely(roaming)) { |
5663 | /* If we are roaming, then ensure check if this is a valid | 5643 | /* If we are roaming, then ensure check if this is a valid |
5664 | * network to try and roam to */ | 5644 | * network to try and roam to */ |
@@ -6881,8 +6861,7 @@ static int ipw_qos_handle_probe_response(struct ipw_priv *priv, | |||
6881 | if ((priv->status & STATUS_ASSOCIATED) && | 6861 | if ((priv->status & STATUS_ASSOCIATED) && |
6882 | (priv->ieee->iw_mode == IW_MODE_ADHOC) && (active_network == 0)) { | 6862 | (priv->ieee->iw_mode == IW_MODE_ADHOC) && (active_network == 0)) { |
6883 | if (memcmp(network->bssid, priv->bssid, ETH_ALEN)) | 6863 | if (memcmp(network->bssid, priv->bssid, ETH_ALEN)) |
6884 | if ((network->capability & WLAN_CAPABILITY_IBSS) && | 6864 | if (network->capability & WLAN_CAPABILITY_IBSS) |
6885 | !(network->flags & NETWORK_EMPTY_ESSID)) | ||
6886 | if ((network->ssid_len == | 6865 | if ((network->ssid_len == |
6887 | priv->assoc_network->ssid_len) && | 6866 | priv->assoc_network->ssid_len) && |
6888 | !memcmp(network->ssid, | 6867 | !memcmp(network->ssid, |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index dec10c41e2ec..afa34d3be721 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -729,7 +729,6 @@ struct ieee80211_txb { | |||
729 | 729 | ||
730 | #define MAX_WPA_IE_LEN 64 | 730 | #define MAX_WPA_IE_LEN 64 |
731 | 731 | ||
732 | #define NETWORK_EMPTY_ESSID (1<<0) | ||
733 | #define NETWORK_HAS_OFDM (1<<1) | 732 | #define NETWORK_HAS_OFDM (1<<1) |
734 | #define NETWORK_HAS_CCK (1<<2) | 733 | #define NETWORK_HAS_CCK (1<<2) |
735 | 734 | ||
diff --git a/include/net/lib80211.h b/include/net/lib80211.h index 91a64f358cef..ce49a30033b6 100644 --- a/include/net/lib80211.h +++ b/include/net/lib80211.h | |||
@@ -12,20 +12,4 @@ | |||
12 | * messages. It should never be used for passing ssid to user space. */ | 12 | * messages. It should never be used for passing ssid to user space. */ |
13 | const char *escape_ssid(const char *ssid, u8 ssid_len); | 13 | const char *escape_ssid(const char *ssid, u8 ssid_len); |
14 | 14 | ||
15 | static inline int is_empty_ssid(const char *ssid, int ssid_len) | ||
16 | { | ||
17 | /* Single white space is for Linksys APs */ | ||
18 | if (ssid_len == 1 && ssid[0] == ' ') | ||
19 | return 1; | ||
20 | |||
21 | /* Otherwise, if the entire ssid is 0, we assume it is hidden */ | ||
22 | while (ssid_len) { | ||
23 | ssid_len--; | ||
24 | if (ssid[ssid_len] != '\0') | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | return 1; | ||
29 | } | ||
30 | |||
31 | #endif /* LIB80211_H */ | 15 | #endif /* LIB80211_H */ |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 876a004918b0..f15f82e7bbfd 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -1146,12 +1146,6 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element | |||
1146 | 1146 | ||
1147 | switch (info_element->id) { | 1147 | switch (info_element->id) { |
1148 | case MFIE_TYPE_SSID: | 1148 | case MFIE_TYPE_SSID: |
1149 | if (is_empty_ssid(info_element->data, | ||
1150 | info_element->len)) { | ||
1151 | network->flags |= NETWORK_EMPTY_ESSID; | ||
1152 | break; | ||
1153 | } | ||
1154 | |||
1155 | network->ssid_len = min(info_element->len, | 1149 | network->ssid_len = min(info_element->len, |
1156 | (u8) IW_ESSID_MAX_SIZE); | 1150 | (u8) IW_ESSID_MAX_SIZE); |
1157 | memcpy(network->ssid, info_element->data, | 1151 | memcpy(network->ssid, info_element->data, |
@@ -1161,7 +1155,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element | |||
1161 | IW_ESSID_MAX_SIZE - network->ssid_len); | 1155 | IW_ESSID_MAX_SIZE - network->ssid_len); |
1162 | 1156 | ||
1163 | IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", | 1157 | IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", |
1164 | network->ssid, network->ssid_len); | 1158 | escape_ssid(network->ssid), |
1159 | network->ssid_len); | ||
1165 | break; | 1160 | break; |
1166 | 1161 | ||
1167 | case MFIE_TYPE_RATES: | 1162 | case MFIE_TYPE_RATES: |
@@ -1391,9 +1386,6 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee | |||
1391 | network->mode |= IEEE_B; | 1386 | network->mode |= IEEE_B; |
1392 | } | 1387 | } |
1393 | 1388 | ||
1394 | if (is_empty_ssid(network->ssid, network->ssid_len)) | ||
1395 | network->flags |= NETWORK_EMPTY_ESSID; | ||
1396 | |||
1397 | memcpy(&network->stats, stats, sizeof(network->stats)); | 1389 | memcpy(&network->stats, stats, sizeof(network->stats)); |
1398 | 1390 | ||
1399 | if (ieee->handle_assoc_response != NULL) | 1391 | if (ieee->handle_assoc_response != NULL) |
@@ -1463,9 +1455,6 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021 | |||
1463 | return 1; | 1455 | return 1; |
1464 | } | 1456 | } |
1465 | 1457 | ||
1466 | if (is_empty_ssid(network->ssid, network->ssid_len)) | ||
1467 | network->flags |= NETWORK_EMPTY_ESSID; | ||
1468 | |||
1469 | memcpy(&network->stats, stats, sizeof(network->stats)); | 1458 | memcpy(&network->stats, stats, sizeof(network->stats)); |
1470 | 1459 | ||
1471 | return 0; | 1460 | return 0; |
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index 3b031c2910ac..3025140ae721 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c | |||
@@ -65,15 +65,9 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee, | |||
65 | /* Add the ESSID */ | 65 | /* Add the ESSID */ |
66 | iwe.cmd = SIOCGIWESSID; | 66 | iwe.cmd = SIOCGIWESSID; |
67 | iwe.u.data.flags = 1; | 67 | iwe.u.data.flags = 1; |
68 | if (network->flags & NETWORK_EMPTY_ESSID) { | 68 | iwe.u.data.length = min(network->ssid_len, (u8) 32); |
69 | iwe.u.data.length = sizeof("<hidden>"); | 69 | start = iwe_stream_add_point(info, start, stop, |
70 | start = iwe_stream_add_point(info, start, stop, | 70 | &iwe, network->ssid); |
71 | &iwe, "<hidden>"); | ||
72 | } else { | ||
73 | iwe.u.data.length = min(network->ssid_len, (u8) 32); | ||
74 | start = iwe_stream_add_point(info, start, stop, | ||
75 | &iwe, network->ssid); | ||
76 | } | ||
77 | 71 | ||
78 | /* Add the protocol name */ | 72 | /* Add the protocol name */ |
79 | iwe.cmd = SIOCGIWNAME; | 73 | iwe.cmd = SIOCGIWNAME; |
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c index b22d271fb675..872cc8dc00a3 100644 --- a/net/wireless/lib80211.c +++ b/net/wireless/lib80211.c | |||
@@ -24,11 +24,6 @@ const char *escape_ssid(const char *ssid, u8 ssid_len) | |||
24 | const char *s = ssid; | 24 | const char *s = ssid; |
25 | char *d = escaped; | 25 | char *d = escaped; |
26 | 26 | ||
27 | if (is_empty_ssid(ssid, ssid_len)) { | ||
28 | memcpy(escaped, "<hidden>", sizeof("<hidden>")); | ||
29 | return escaped; | ||
30 | } | ||
31 | |||
32 | ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); | 27 | ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); |
33 | while (ssid_len--) { | 28 | while (ssid_len--) { |
34 | if (*s == '\0') { | 29 | if (*s == '\0') { |