All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit ab1faead authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6dc1cb03
......@@ -1194,18 +1194,14 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev,
}
memcpy(sdata->u.mgd.bssid, req->peer_addr, ETH_ALEN);
sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET;
/* TODO: req->chan */
sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL;
sdata->local->oper_channel = req->chan;
ieee80211_hw_config(sdata->local, 0);
if (req->ssid) {
sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET;
memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len);
sdata->u.mgd.ssid_len = req->ssid_len;
sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL;
}
if (!req->ssid)
return -EINVAL;
memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len);
sdata->u.mgd.ssid_len = req->ssid_len;
kfree(sdata->u.mgd.sme_auth_ie);
sdata->u.mgd.sme_auth_ie = NULL;
......@@ -1218,7 +1214,6 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev,
sdata->u.mgd.sme_auth_ie_len = req->ie_len;
}
sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME;
sdata->u.mgd.state = IEEE80211_STA_MLME_DIRECT_PROBE;
ieee80211_sta_req_auth(sdata);
return 0;
......@@ -1236,27 +1231,22 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev,
!(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED))
return -ENOLINK; /* not authenticated */
sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED;
sdata->u.mgd.flags &= ~IEEE80211_STA_DISABLE_11N;
for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||
req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP ||
req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104)
sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;
sdata->u.mgd.flags |= IEEE80211_STA_DISABLE_11N;
sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET;
sdata->local->oper_channel = req->chan;
ieee80211_hw_config(sdata->local, 0);
/* TODO: req->chan */
sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL;
if (!req->ssid)
return -EINVAL;
if (req->ssid) {
sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET;
memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len);
sdata->u.mgd.ssid_len = req->ssid_len;
sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL;
} else
sdata->u.mgd.flags |= IEEE80211_STA_AUTO_SSID_SEL;
memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len);
sdata->u.mgd.ssid_len = req->ssid_len;
ret = ieee80211_sta_set_extra_ie(sdata, req->ie, req->ie_len);
if (ret && ret != -EALREADY)
......@@ -1275,7 +1265,6 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev,
else
sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT;
sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME;
sdata->u.mgd.state = IEEE80211_STA_MLME_ASSOCIATE;
ieee80211_sta_req_auth(sdata);
return 0;
......
......@@ -111,9 +111,7 @@ IEEE80211_IF_FILE(auth_transaction, u.mgd.auth_transaction, DEC);
static ssize_t ieee80211_if_fmt_flags(
const struct ieee80211_sub_if_data *sdata, char *buf, int buflen)
{
return scnprintf(buf, buflen, "%s%s%s%s%s%s%s\n",
sdata->u.mgd.flags & IEEE80211_STA_SSID_SET ? "SSID\n" : "",
sdata->u.mgd.flags & IEEE80211_STA_BSSID_SET ? "BSSID\n" : "",
return scnprintf(buf, buflen, "%s%s%s%s%s\n",
sdata->u.mgd.flags & IEEE80211_STA_PREV_BSSID_SET ? "prev BSSID\n" : "",
sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED ? "AUTH\n" : "",
sdata->u.mgd.flags & IEEE80211_STA_ASSOCIATED ? "ASSOC\n" : "",
......
......@@ -228,28 +228,24 @@ struct mesh_preq_queue {
};
/* flags used in struct ieee80211_if_managed.flags */
#define IEEE80211_STA_SSID_SET BIT(0)
#define IEEE80211_STA_BSSID_SET BIT(1)
#define IEEE80211_STA_PREV_BSSID_SET BIT(2)
#define IEEE80211_STA_AUTHENTICATED BIT(3)
#define IEEE80211_STA_ASSOCIATED BIT(4)
#define IEEE80211_STA_PROBEREQ_POLL BIT(5)
#define IEEE80211_STA_CREATE_IBSS BIT(6)
#define IEEE80211_STA_CONTROL_PORT BIT(7)
#define IEEE80211_STA_WMM_ENABLED BIT(8)
/* hole at 9, please re-use */
#define IEEE80211_STA_AUTO_SSID_SEL BIT(10)
#define IEEE80211_STA_AUTO_BSSID_SEL BIT(11)
#define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12)
#define IEEE80211_STA_PRIVACY_INVOKED BIT(13)
#define IEEE80211_STA_TKIP_WEP_USED BIT(14)
#define IEEE80211_STA_CSA_RECEIVED BIT(15)
#define IEEE80211_STA_MFP_ENABLED BIT(16)
#define IEEE80211_STA_EXT_SME BIT(17)
enum ieee80211_sta_flags {
IEEE80211_STA_PREV_BSSID_SET = BIT(0),
IEEE80211_STA_AUTHENTICATED = BIT(1),
IEEE80211_STA_ASSOCIATED = BIT(2),
IEEE80211_STA_PROBEREQ_POLL = BIT(3),
IEEE80211_STA_CONTROL_PORT = BIT(4),
IEEE80211_STA_WMM_ENABLED = BIT(5),
IEEE80211_STA_DISABLE_11N = BIT(6),
IEEE80211_STA_CSA_RECEIVED = BIT(7),
IEEE80211_STA_MFP_ENABLED = BIT(8),
};
/* flags for MLME request */
#define IEEE80211_STA_REQ_SCAN 0
#define IEEE80211_STA_REQ_AUTH 1
#define IEEE80211_STA_REQ_RUN 2
enum ieee80211_sta_request {
IEEE80211_STA_REQ_SCAN,
IEEE80211_STA_REQ_AUTH,
IEEE80211_STA_REQ_RUN,
};
struct ieee80211_if_managed {
struct timer_list timer;
......@@ -936,10 +932,6 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;
void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
int ieee80211_sta_commit(struct ieee80211_sub_if_data *sdata);
int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len);
int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len);
int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid);
void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata);
int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason);
int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason);
......
......@@ -486,8 +486,6 @@ static int ieee80211_stop(struct net_device *dev)
synchronize_rcu();
skb_queue_purge(&sdata->u.mgd.skb_queue);
sdata->u.mgd.flags &= ~(IEEE80211_STA_PRIVACY_INVOKED |
IEEE80211_STA_TKIP_WEP_USED);
kfree(sdata->u.mgd.extra_ie);
sdata->u.mgd.extra_ie = NULL;
sdata->u.mgd.extra_ie_len = 0;
......
This diff is collapsed.
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