mac80211: split IBSS/managed code
This patch splits out the ibss code and data from managed (station) mode. The reason to do this is to better separate the state machines, and have the code be contained better so it gets easier to determine what exactly a given change will affect, that in turn makes it easier to understand. This is quite some churn, especially because I split sdata->u.sta into sdata->u.mgd and sdata->u.ibss, but I think it's easier to maintain that way. I've also shuffled around some code -- null function sending is only applicable to managed interfaces so put that into that file, some other functions are needed from various places so put them into util, and also rearranged the prototypes in ieee80211_i.h accordingly. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
96f5e66e8a
commit
469002983f
@@ -1180,45 +1180,45 @@ static int set_mgmt_extra_ie_sta(struct ieee80211_sub_if_data *sdata,
|
||||
u8 subtype, u8 *ies, size_t ies_len)
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct ieee80211_if_sta *ifsta = &sdata->u.sta;
|
||||
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
|
||||
|
||||
switch (subtype) {
|
||||
case IEEE80211_STYPE_PROBE_REQ >> 4:
|
||||
if (local->ops->hw_scan)
|
||||
break;
|
||||
kfree(ifsta->ie_probereq);
|
||||
ifsta->ie_probereq = ies;
|
||||
ifsta->ie_probereq_len = ies_len;
|
||||
kfree(ifmgd->ie_probereq);
|
||||
ifmgd->ie_probereq = ies;
|
||||
ifmgd->ie_probereq_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_PROBE_RESP >> 4:
|
||||
kfree(ifsta->ie_proberesp);
|
||||
ifsta->ie_proberesp = ies;
|
||||
ifsta->ie_proberesp_len = ies_len;
|
||||
kfree(ifmgd->ie_proberesp);
|
||||
ifmgd->ie_proberesp = ies;
|
||||
ifmgd->ie_proberesp_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_AUTH >> 4:
|
||||
kfree(ifsta->ie_auth);
|
||||
ifsta->ie_auth = ies;
|
||||
ifsta->ie_auth_len = ies_len;
|
||||
kfree(ifmgd->ie_auth);
|
||||
ifmgd->ie_auth = ies;
|
||||
ifmgd->ie_auth_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_ASSOC_REQ >> 4:
|
||||
kfree(ifsta->ie_assocreq);
|
||||
ifsta->ie_assocreq = ies;
|
||||
ifsta->ie_assocreq_len = ies_len;
|
||||
kfree(ifmgd->ie_assocreq);
|
||||
ifmgd->ie_assocreq = ies;
|
||||
ifmgd->ie_assocreq_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_REASSOC_REQ >> 4:
|
||||
kfree(ifsta->ie_reassocreq);
|
||||
ifsta->ie_reassocreq = ies;
|
||||
ifsta->ie_reassocreq_len = ies_len;
|
||||
kfree(ifmgd->ie_reassocreq);
|
||||
ifmgd->ie_reassocreq = ies;
|
||||
ifmgd->ie_reassocreq_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_DEAUTH >> 4:
|
||||
kfree(ifsta->ie_deauth);
|
||||
ifsta->ie_deauth = ies;
|
||||
ifsta->ie_deauth_len = ies_len;
|
||||
kfree(ifmgd->ie_deauth);
|
||||
ifmgd->ie_deauth = ies;
|
||||
ifmgd->ie_deauth_len = ies_len;
|
||||
return 0;
|
||||
case IEEE80211_STYPE_DISASSOC >> 4:
|
||||
kfree(ifsta->ie_disassoc);
|
||||
ifsta->ie_disassoc = ies;
|
||||
ifsta->ie_disassoc_len = ies_len;
|
||||
kfree(ifmgd->ie_disassoc);
|
||||
ifmgd->ie_disassoc = ies;
|
||||
ifmgd->ie_disassoc_len = ies_len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1248,7 +1248,6 @@ static int ieee80211_set_mgmt_extra_ie(struct wiphy *wiphy,
|
||||
|
||||
switch (sdata->vif.type) {
|
||||
case NL80211_IFTYPE_STATION:
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
ret = set_mgmt_extra_ie_sta(sdata, params->subtype,
|
||||
ies, ies_len);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user