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/iface.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/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 1f02b0610e82..1bf12a26b45e 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -752,7 +752,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, | |||
752 | ieee80211_mandatory_rates(sdata->local, | 752 | ieee80211_mandatory_rates(sdata->local, |
753 | sdata->local->hw.conf.channel->band); | 753 | sdata->local->hw.conf.channel->band); |
754 | sdata->drop_unencrypted = 0; | 754 | sdata->drop_unencrypted = 0; |
755 | sdata->use_4addr = 0; | 755 | if (type == NL80211_IFTYPE_STATION) |
756 | sdata->u.mgd.use_4addr = false; | ||
756 | 757 | ||
757 | return 0; | 758 | return 0; |
758 | } | 759 | } |
@@ -810,6 +811,12 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
810 | /* setup type-dependent data */ | 811 | /* setup type-dependent data */ |
811 | ieee80211_setup_sdata(sdata, type); | 812 | ieee80211_setup_sdata(sdata, type); |
812 | 813 | ||
814 | if (params) { | ||
815 | ndev->ieee80211_ptr->use_4addr = params->use_4addr; | ||
816 | if (type == NL80211_IFTYPE_STATION) | ||
817 | sdata->u.mgd.use_4addr = params->use_4addr; | ||
818 | } | ||
819 | |||
813 | ret = register_netdevice(ndev); | 820 | ret = register_netdevice(ndev); |
814 | if (ret) | 821 | if (ret) |
815 | goto fail; | 822 | goto fail; |
@@ -820,9 +827,6 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
820 | params->mesh_id_len, | 827 | params->mesh_id_len, |
821 | params->mesh_id); | 828 | params->mesh_id); |
822 | 829 | ||
823 | if (params && params->use_4addr >= 0) | ||
824 | sdata->use_4addr = !!params->use_4addr; | ||
825 | |||
826 | mutex_lock(&local->iflist_mtx); | 830 | mutex_lock(&local->iflist_mtx); |
827 | list_add_tail_rcu(&sdata->list, &local->interfaces); | 831 | list_add_tail_rcu(&sdata->list, &local->interfaces); |
828 | mutex_unlock(&local->iflist_mtx); | 832 | mutex_unlock(&local->iflist_mtx); |