diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-11-10 12:53:10 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-11 17:02:07 -0500 |
commit | 8b787643ca0a5130c647109d77fe512f89cfa611 (patch) | |
tree | b3b0f74c57843a90f8a3822d37237d637c8dcfd0 | |
parent | 1460dd158a520447b87661aea4afda1997d69cde (diff) |
nl80211: add a parameter for using 4-address frames on virtual interfaces
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/linux/nl80211.h | 4 | ||||
-rw-r--r-- | include/net/cfg80211.h | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 50afca3dcff1..203adef972cf 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -584,6 +584,8 @@ enum nl80211_commands { | |||
584 | * changed then the list changed and the dump should be repeated | 584 | * changed then the list changed and the dump should be repeated |
585 | * completely from scratch. | 585 | * completely from scratch. |
586 | * | 586 | * |
587 | * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface | ||
588 | * | ||
587 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 589 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
588 | * @__NL80211_ATTR_AFTER_LAST: internal use | 590 | * @__NL80211_ATTR_AFTER_LAST: internal use |
589 | */ | 591 | */ |
@@ -714,6 +716,8 @@ enum nl80211_attrs { | |||
714 | 716 | ||
715 | NL80211_ATTR_PID, | 717 | NL80211_ATTR_PID, |
716 | 718 | ||
719 | NL80211_ATTR_4ADDR, | ||
720 | |||
717 | /* add attributes here, update the policy in nl80211.c */ | 721 | /* add attributes here, update the policy in nl80211.c */ |
718 | 722 | ||
719 | __NL80211_ATTR_AFTER_LAST, | 723 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index ff67865de231..1ee41e4a92e2 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -206,10 +206,12 @@ struct ieee80211_supported_band { | |||
206 | * struct vif_params - describes virtual interface parameters | 206 | * struct vif_params - describes virtual interface parameters |
207 | * @mesh_id: mesh ID to use | 207 | * @mesh_id: mesh ID to use |
208 | * @mesh_id_len: length of the mesh ID | 208 | * @mesh_id_len: length of the mesh ID |
209 | * @use_4addr: use 4-address frames | ||
209 | */ | 210 | */ |
210 | struct vif_params { | 211 | struct vif_params { |
211 | u8 *mesh_id; | 212 | u8 *mesh_id; |
212 | int mesh_id_len; | 213 | int mesh_id_len; |
214 | int use_4addr; | ||
213 | }; | 215 | }; |
214 | 216 | ||
215 | /** | 217 | /** |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8ed62b6c172b..8c8e4eae6a17 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -138,6 +138,7 @@ static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = { | |||
138 | [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, | 138 | [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, |
139 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, | 139 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, |
140 | [NL80211_ATTR_PID] = { .type = NLA_U32 }, | 140 | [NL80211_ATTR_PID] = { .type = NLA_U32 }, |
141 | [NL80211_ATTR_4ADDR] = { .type = NLA_U8 }, | ||
141 | }; | 142 | }; |
142 | 143 | ||
143 | /* policy for the attributes */ | 144 | /* policy for the attributes */ |
@@ -987,6 +988,13 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) | |||
987 | change = true; | 988 | change = true; |
988 | } | 989 | } |
989 | 990 | ||
991 | if (info->attrs[NL80211_ATTR_4ADDR]) { | ||
992 | params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); | ||
993 | change = true; | ||
994 | } else { | ||
995 | params.use_4addr = -1; | ||
996 | } | ||
997 | |||
990 | if (info->attrs[NL80211_ATTR_MNTR_FLAGS]) { | 998 | if (info->attrs[NL80211_ATTR_MNTR_FLAGS]) { |
991 | if (ntype != NL80211_IFTYPE_MONITOR) { | 999 | if (ntype != NL80211_IFTYPE_MONITOR) { |
992 | err = -EINVAL; | 1000 | err = -EINVAL; |
@@ -1053,6 +1061,9 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) | |||
1053 | params.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]); | 1061 | params.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]); |
1054 | } | 1062 | } |
1055 | 1063 | ||
1064 | if (info->attrs[NL80211_ATTR_4ADDR]) | ||
1065 | params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); | ||
1066 | |||
1056 | err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ? | 1067 | err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ? |
1057 | info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, | 1068 | info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, |
1058 | &flags); | 1069 | &flags); |