diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-04 11:58:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-04 11:58:14 -0500 |
commit | 10be7eb36b93364b98688831ee7d26f58402bb96 (patch) | |
tree | eb13ae80fcaa8baacd804a721c5a4962a501a2a4 /drivers/net/wireless/libertas/assoc.c | |
parent | 90c30335a70e96b8b8493b7deb15e6b30e6d9fce (diff) | |
parent | 5ffaf8a361b4c9025963959a744f21d8173c7669 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 5e650f358415..f03d5e4e59c3 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -1160,11 +1160,11 @@ int lbs_adhoc_stop(struct lbs_private *priv) | |||
1160 | static inline int match_bss_no_security(struct lbs_802_11_security *secinfo, | 1160 | static inline int match_bss_no_security(struct lbs_802_11_security *secinfo, |
1161 | struct bss_descriptor *match_bss) | 1161 | struct bss_descriptor *match_bss) |
1162 | { | 1162 | { |
1163 | if (!secinfo->wep_enabled && !secinfo->WPAenabled | 1163 | if (!secinfo->wep_enabled && |
1164 | && !secinfo->WPA2enabled | 1164 | !secinfo->WPAenabled && !secinfo->WPA2enabled && |
1165 | && match_bss->wpa_ie[0] != WLAN_EID_GENERIC | 1165 | match_bss->wpa_ie[0] != WLAN_EID_GENERIC && |
1166 | && match_bss->rsn_ie[0] != WLAN_EID_RSN | 1166 | match_bss->rsn_ie[0] != WLAN_EID_RSN && |
1167 | && !(match_bss->capability & WLAN_CAPABILITY_PRIVACY)) | 1167 | !(match_bss->capability & WLAN_CAPABILITY_PRIVACY)) |
1168 | return 1; | 1168 | return 1; |
1169 | else | 1169 | else |
1170 | return 0; | 1170 | return 0; |
@@ -1173,9 +1173,9 @@ static inline int match_bss_no_security(struct lbs_802_11_security *secinfo, | |||
1173 | static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo, | 1173 | static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo, |
1174 | struct bss_descriptor *match_bss) | 1174 | struct bss_descriptor *match_bss) |
1175 | { | 1175 | { |
1176 | if (secinfo->wep_enabled && !secinfo->WPAenabled | 1176 | if (secinfo->wep_enabled && |
1177 | && !secinfo->WPA2enabled | 1177 | !secinfo->WPAenabled && !secinfo->WPA2enabled && |
1178 | && (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) | 1178 | (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) |
1179 | return 1; | 1179 | return 1; |
1180 | else | 1180 | else |
1181 | return 0; | 1181 | return 0; |
@@ -1184,8 +1184,8 @@ static inline int match_bss_static_wep(struct lbs_802_11_security *secinfo, | |||
1184 | static inline int match_bss_wpa(struct lbs_802_11_security *secinfo, | 1184 | static inline int match_bss_wpa(struct lbs_802_11_security *secinfo, |
1185 | struct bss_descriptor *match_bss) | 1185 | struct bss_descriptor *match_bss) |
1186 | { | 1186 | { |
1187 | if (!secinfo->wep_enabled && secinfo->WPAenabled | 1187 | if (!secinfo->wep_enabled && secinfo->WPAenabled && |
1188 | && (match_bss->wpa_ie[0] == WLAN_EID_GENERIC) | 1188 | (match_bss->wpa_ie[0] == WLAN_EID_GENERIC) |
1189 | /* privacy bit may NOT be set in some APs like LinkSys WRT54G | 1189 | /* privacy bit may NOT be set in some APs like LinkSys WRT54G |
1190 | && (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */ | 1190 | && (match_bss->capability & WLAN_CAPABILITY_PRIVACY) */ |
1191 | ) | 1191 | ) |
@@ -1210,11 +1210,11 @@ static inline int match_bss_wpa2(struct lbs_802_11_security *secinfo, | |||
1210 | static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo, | 1210 | static inline int match_bss_dynamic_wep(struct lbs_802_11_security *secinfo, |
1211 | struct bss_descriptor *match_bss) | 1211 | struct bss_descriptor *match_bss) |
1212 | { | 1212 | { |
1213 | if (!secinfo->wep_enabled && !secinfo->WPAenabled | 1213 | if (!secinfo->wep_enabled && |
1214 | && !secinfo->WPA2enabled | 1214 | !secinfo->WPAenabled && !secinfo->WPA2enabled && |
1215 | && (match_bss->wpa_ie[0] != WLAN_EID_GENERIC) | 1215 | (match_bss->wpa_ie[0] != WLAN_EID_GENERIC) && |
1216 | && (match_bss->rsn_ie[0] != WLAN_EID_RSN) | 1216 | (match_bss->rsn_ie[0] != WLAN_EID_RSN) && |
1217 | && (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) | 1217 | (match_bss->capability & WLAN_CAPABILITY_PRIVACY)) |
1218 | return 1; | 1218 | return 1; |
1219 | else | 1219 | else |
1220 | return 0; | 1220 | return 0; |
@@ -1525,8 +1525,8 @@ static int assoc_helper_associate(struct lbs_private *priv, | |||
1525 | /* If we're given and 'any' BSSID, try associating based on SSID */ | 1525 | /* If we're given and 'any' BSSID, try associating based on SSID */ |
1526 | 1526 | ||
1527 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { | 1527 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
1528 | if (compare_ether_addr(bssid_any, assoc_req->bssid) | 1528 | if (compare_ether_addr(bssid_any, assoc_req->bssid) && |
1529 | && compare_ether_addr(bssid_off, assoc_req->bssid)) { | 1529 | compare_ether_addr(bssid_off, assoc_req->bssid)) { |
1530 | ret = assoc_helper_bssid(priv, assoc_req); | 1530 | ret = assoc_helper_bssid(priv, assoc_req); |
1531 | done = 1; | 1531 | done = 1; |
1532 | } | 1532 | } |
@@ -1612,11 +1612,9 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
1612 | goto restore_mesh; | 1612 | goto restore_mesh; |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | if ( assoc_req->secinfo.wep_enabled | 1615 | if (assoc_req->secinfo.wep_enabled && |
1616 | && (assoc_req->wep_keys[0].len | 1616 | (assoc_req->wep_keys[0].len || assoc_req->wep_keys[1].len || |
1617 | || assoc_req->wep_keys[1].len | 1617 | assoc_req->wep_keys[2].len || assoc_req->wep_keys[3].len)) { |
1618 | || assoc_req->wep_keys[2].len | ||
1619 | || assoc_req->wep_keys[3].len)) { | ||
1620 | /* Make sure WEP keys are re-sent to firmware */ | 1618 | /* Make sure WEP keys are re-sent to firmware */ |
1621 | set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); | 1619 | set_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags); |
1622 | } | 1620 | } |
@@ -1983,14 +1981,14 @@ void lbs_association_worker(struct work_struct *work) | |||
1983 | assoc_req->secinfo.auth_mode); | 1981 | assoc_req->secinfo.auth_mode); |
1984 | 1982 | ||
1985 | /* If 'any' SSID was specified, find an SSID to associate with */ | 1983 | /* If 'any' SSID was specified, find an SSID to associate with */ |
1986 | if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags) | 1984 | if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags) && |
1987 | && !assoc_req->ssid_len) | 1985 | !assoc_req->ssid_len) |
1988 | find_any_ssid = 1; | 1986 | find_any_ssid = 1; |
1989 | 1987 | ||
1990 | /* But don't use 'any' SSID if there's a valid locked BSSID to use */ | 1988 | /* But don't use 'any' SSID if there's a valid locked BSSID to use */ |
1991 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { | 1989 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { |
1992 | if (compare_ether_addr(assoc_req->bssid, bssid_any) | 1990 | if (compare_ether_addr(assoc_req->bssid, bssid_any) && |
1993 | && compare_ether_addr(assoc_req->bssid, bssid_off)) | 1991 | compare_ether_addr(assoc_req->bssid, bssid_off)) |
1994 | find_any_ssid = 0; | 1992 | find_any_ssid = 0; |
1995 | } | 1993 | } |
1996 | 1994 | ||
@@ -2052,13 +2050,6 @@ void lbs_association_worker(struct work_struct *work) | |||
2052 | goto out; | 2050 | goto out; |
2053 | } | 2051 | } |
2054 | 2052 | ||
2055 | if ( test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) | ||
2056 | || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { | ||
2057 | ret = assoc_helper_wep_keys(priv, assoc_req); | ||
2058 | if (ret) | ||
2059 | goto out; | ||
2060 | } | ||
2061 | |||
2062 | if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { | 2053 | if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { |
2063 | ret = assoc_helper_secinfo(priv, assoc_req); | 2054 | ret = assoc_helper_secinfo(priv, assoc_req); |
2064 | if (ret) | 2055 | if (ret) |
@@ -2071,18 +2062,31 @@ void lbs_association_worker(struct work_struct *work) | |||
2071 | goto out; | 2062 | goto out; |
2072 | } | 2063 | } |
2073 | 2064 | ||
2074 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags) | 2065 | /* |
2075 | || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { | 2066 | * v10 FW wants WPA keys to be set/cleared before WEP key operations, |
2067 | * otherwise it will fail to correctly associate to WEP networks. | ||
2068 | * Other firmware versions don't appear to care. | ||
2069 | */ | ||
2070 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags) || | ||
2071 | test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { | ||
2076 | ret = assoc_helper_wpa_keys(priv, assoc_req); | 2072 | ret = assoc_helper_wpa_keys(priv, assoc_req); |
2077 | if (ret) | 2073 | if (ret) |
2078 | goto out; | 2074 | goto out; |
2079 | } | 2075 | } |
2080 | 2076 | ||
2077 | if (test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) || | ||
2078 | test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { | ||
2079 | ret = assoc_helper_wep_keys(priv, assoc_req); | ||
2080 | if (ret) | ||
2081 | goto out; | ||
2082 | } | ||
2083 | |||
2084 | |||
2081 | /* SSID/BSSID should be the _last_ config option set, because they | 2085 | /* SSID/BSSID should be the _last_ config option set, because they |
2082 | * trigger the association attempt. | 2086 | * trigger the association attempt. |
2083 | */ | 2087 | */ |
2084 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags) | 2088 | if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags) || |
2085 | || test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { | 2089 | test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { |
2086 | int success = 1; | 2090 | int success = 1; |
2087 | 2091 | ||
2088 | ret = assoc_helper_associate(priv, assoc_req); | 2092 | ret = assoc_helper_associate(priv, assoc_req); |