diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-19 05:55:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-19 11:08:53 -0500 |
commit | 9bc383de37090ba7ca3ff32a12c9d809dc5867f0 (patch) | |
tree | 2b502b918f585427b45357e5a9a781ea9f06c263 /net/mac80211/cfg.c | |
parent | 5be83de54c16944dea9c16c6a5a53c1fa75ed304 (diff) |
cfg80211: introduce capability for 4addr mode
It's very likely that not many devices will support
four-address mode in station or AP mode so introduce
capability bits for both modes, set them in mac80211
and check them when userspace tries to use the mode.
Also, keep track of 4addr in cfg80211 (wireless_dev)
and not in mac80211 any more. mac80211 can also be
improved for the VLAN case by not looking at the
4addr flag but maintaining the station pointer for
it correctly. However, keep track of use_4addr for
station mode in mac80211 to avoid all the derefs.
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 | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 7d591816ed10..c484a882140e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -42,15 +42,6 @@ static bool nl80211_params_check(enum nl80211_iftype type, | |||
42 | if (!nl80211_type_check(type)) | 42 | if (!nl80211_type_check(type)) |
43 | return false; | 43 | return false; |
44 | 44 | ||
45 | if (params->use_4addr > 0) { | ||
46 | switch(type) { | ||
47 | case NL80211_IFTYPE_AP_VLAN: | ||
48 | case NL80211_IFTYPE_STATION: | ||
49 | break; | ||
50 | default: | ||
51 | return false; | ||
52 | } | ||
53 | } | ||
54 | return true; | 45 | return true; |
55 | } | 46 | } |
56 | 47 | ||
@@ -107,12 +98,16 @@ static int ieee80211_change_iface(struct wiphy *wiphy, | |||
107 | params->mesh_id_len, | 98 | params->mesh_id_len, |
108 | params->mesh_id); | 99 | params->mesh_id); |
109 | 100 | ||
110 | if (params->use_4addr >= 0) | ||
111 | sdata->use_4addr = !!params->use_4addr; | ||
112 | |||
113 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) | 101 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) |
114 | return 0; | 102 | return 0; |
115 | 103 | ||
104 | if (type == NL80211_IFTYPE_AP_VLAN && | ||
105 | params && params->use_4addr == 0) | ||
106 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); | ||
107 | else if (type == NL80211_IFTYPE_STATION && | ||
108 | params && params->use_4addr >= 0) | ||
109 | sdata->u.mgd.use_4addr = params->use_4addr; | ||
110 | |||
116 | sdata->u.mntr_flags = *flags; | 111 | sdata->u.mntr_flags = *flags; |
117 | return 0; | 112 | return 0; |
118 | } | 113 | } |
@@ -827,7 +822,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
827 | return -EINVAL; | 822 | return -EINVAL; |
828 | } | 823 | } |
829 | 824 | ||
830 | if (vlansdata->use_4addr) { | 825 | if (params->vlan->ieee80211_ptr->use_4addr) { |
831 | if (vlansdata->u.vlan.sta) | 826 | if (vlansdata->u.vlan.sta) |
832 | return -EBUSY; | 827 | return -EBUSY; |
833 | 828 | ||