mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
BACKPORT: cfg80211: VLAN offload support for set_key and set_sta_vlan
This provides an alternative mechanism for AP VLAN support where a single netdev is used with VLAN tagged frames instead of separate netdevs for each VLAN without tagged frames from the WLAN driver. By setting NL80211_EXT_FEATURE_VLAN_OFFLOAD flag the driver indicates support for a single netdev with VLAN tagged frames. Separate VLAN-specific netdevs can be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to Ethernet. NL80211_CMD_NEW_KEY (for group keys), NL80211_CMD_NEW_STATION, and NL80211_CMD_SET_STATION will optionally specify vlan_id using NL80211_ATTR_VLAN_ID. Bug: 154782456 Signed-off-by: Gurumoorthi Gnanasambandhan <[email protected]> Signed-off-by: Jouni Malinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]> Change-Id: I74c0d2664b1dbe5846a62a433754693a2ead9f2a (cherry picked from commit 14f34e36b36ceede9877ca422a62fcac17b52023) Signed-off-by: Vamsi Krishna <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9d21bcd489
commit
50635d9eba
3 changed files with 41 additions and 0 deletions
|
|
@ -628,6 +628,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
|
|||
.len = SAE_PASSWORD_MAX_LEN },
|
||||
[NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG },
|
||||
[NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy),
|
||||
[NL80211_ATTR_VLAN_ID] = NLA_POLICY_RANGE(NLA_U16, 1, VLAN_N_VID - 2),
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
|
|
@ -3944,6 +3945,10 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
|
|||
key.type != NL80211_KEYTYPE_GROUP)
|
||||
return -EINVAL;
|
||||
|
||||
if (key.type == NL80211_KEYTYPE_GROUP &&
|
||||
info->attrs[NL80211_ATTR_VLAN_ID])
|
||||
key.p.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]);
|
||||
|
||||
if (!rdev->ops->add_key)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
|
|
@ -5715,6 +5720,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
|
|||
if (info->attrs[NL80211_ATTR_STA_AID])
|
||||
params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
|
||||
|
||||
if (info->attrs[NL80211_ATTR_VLAN_ID])
|
||||
params.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]);
|
||||
|
||||
if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
|
||||
params.listen_interval =
|
||||
nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
|
||||
|
|
@ -5860,6 +5868,9 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
|
|||
params.listen_interval =
|
||||
nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
|
||||
|
||||
if (info->attrs[NL80211_ATTR_VLAN_ID])
|
||||
params.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]);
|
||||
|
||||
if (info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]) {
|
||||
params.support_p2p_ps =
|
||||
nla_get_u8(info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue