diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-01 15:41:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:53 -0400 |
commit | ab1faead50d09165b58c2854997c7205ca9c0d22 (patch) | |
tree | 6eb456e24aab52cdd9ed152d09008635a1ebd555 /net/mac80211/cfg.c | |
parent | 6dc1cb0319997648f59b0f46b9e093e779f0353d (diff) |
mac80211: remove dead code, clean up
With mac80211 now always controlled by an external SME,
a lot of code is dead -- SSID, BSSID, channel selection
is always done externally, etc. Additionally, rename
IEEE80211_STA_TKIP_WEP_USED to IEEE80211_STA_DISABLE_11N
and clean up the code a bit.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 3c9774e36a80..7606571d4581 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1194,18 +1194,14 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev, | |||
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | memcpy(sdata->u.mgd.bssid, req->peer_addr, ETH_ALEN); | 1196 | memcpy(sdata->u.mgd.bssid, req->peer_addr, ETH_ALEN); |
1197 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; | ||
1198 | sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET; | ||
1199 | 1197 | ||
1200 | /* TODO: req->chan */ | 1198 | sdata->local->oper_channel = req->chan; |
1201 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL; | 1199 | ieee80211_hw_config(sdata->local, 0); |
1202 | 1200 | ||
1203 | if (req->ssid) { | 1201 | if (!req->ssid) |
1204 | sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET; | 1202 | return -EINVAL; |
1205 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); | 1203 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); |
1206 | sdata->u.mgd.ssid_len = req->ssid_len; | 1204 | sdata->u.mgd.ssid_len = req->ssid_len; |
1207 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL; | ||
1208 | } | ||
1209 | 1205 | ||
1210 | kfree(sdata->u.mgd.sme_auth_ie); | 1206 | kfree(sdata->u.mgd.sme_auth_ie); |
1211 | sdata->u.mgd.sme_auth_ie = NULL; | 1207 | sdata->u.mgd.sme_auth_ie = NULL; |
@@ -1218,7 +1214,6 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev, | |||
1218 | sdata->u.mgd.sme_auth_ie_len = req->ie_len; | 1214 | sdata->u.mgd.sme_auth_ie_len = req->ie_len; |
1219 | } | 1215 | } |
1220 | 1216 | ||
1221 | sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME; | ||
1222 | sdata->u.mgd.state = IEEE80211_STA_MLME_DIRECT_PROBE; | 1217 | sdata->u.mgd.state = IEEE80211_STA_MLME_DIRECT_PROBE; |
1223 | ieee80211_sta_req_auth(sdata); | 1218 | ieee80211_sta_req_auth(sdata); |
1224 | return 0; | 1219 | return 0; |
@@ -1236,27 +1231,22 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev, | |||
1236 | !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) | 1231 | !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) |
1237 | return -ENOLINK; /* not authenticated */ | 1232 | return -ENOLINK; /* not authenticated */ |
1238 | 1233 | ||
1239 | sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; | 1234 | sdata->u.mgd.flags &= ~IEEE80211_STA_DISABLE_11N; |
1240 | 1235 | ||
1241 | for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) | 1236 | for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) |
1242 | if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 || | 1237 | if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 || |
1243 | req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP || | 1238 | req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP || |
1244 | req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) | 1239 | req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) |
1245 | sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED; | 1240 | sdata->u.mgd.flags |= IEEE80211_STA_DISABLE_11N; |
1246 | 1241 | ||
1247 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; | 1242 | sdata->local->oper_channel = req->chan; |
1248 | sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET; | 1243 | ieee80211_hw_config(sdata->local, 0); |
1249 | 1244 | ||
1250 | /* TODO: req->chan */ | 1245 | if (!req->ssid) |
1251 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL; | 1246 | return -EINVAL; |
1252 | 1247 | ||
1253 | if (req->ssid) { | 1248 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); |
1254 | sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET; | 1249 | sdata->u.mgd.ssid_len = req->ssid_len; |
1255 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); | ||
1256 | sdata->u.mgd.ssid_len = req->ssid_len; | ||
1257 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL; | ||
1258 | } else | ||
1259 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_SSID_SEL; | ||
1260 | 1250 | ||
1261 | ret = ieee80211_sta_set_extra_ie(sdata, req->ie, req->ie_len); | 1251 | ret = ieee80211_sta_set_extra_ie(sdata, req->ie, req->ie_len); |
1262 | if (ret && ret != -EALREADY) | 1252 | if (ret && ret != -EALREADY) |
@@ -1275,7 +1265,6 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev, | |||
1275 | else | 1265 | else |
1276 | sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT; | 1266 | sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT; |
1277 | 1267 | ||
1278 | sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME; | ||
1279 | sdata->u.mgd.state = IEEE80211_STA_MLME_ASSOCIATE; | 1268 | sdata->u.mgd.state = IEEE80211_STA_MLME_ASSOCIATE; |
1280 | ieee80211_sta_req_auth(sdata); | 1269 | ieee80211_sta_req_auth(sdata); |
1281 | return 0; | 1270 | return 0; |