Skip to content

Commit 06f7c88

Browse files
benilevInteljmberg-intel
authored andcommitted
cfg80211: consider VHT opmode on station update
Currently, this attribute is only fetched on station addition, but not on station change. Since this info is only present in the assoc request, with full station state support in the driver it cannot be present when the station is added. Thus, add support for changing the VHT opmode on station update if done before (or while) the station is marked as associated. After this, ignore it, since it used to be ignored. Signed-off-by: Beni Lev <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent d7f8424 commit 06f7c88

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

include/uapi/linux/nl80211.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,9 @@ enum nl80211_commands {
17721772
*
17731773
* @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
17741774
* Notification Element based on association request when used with
1775-
* %NL80211_CMD_NEW_STATION; u8 attribute.
1775+
* %NL80211_CMD_NEW_STATION or %NL80211_CMD_SET_STATION (only when
1776+
* %NL80211_FEATURE_FULL_AP_CLIENT_STATE is supported, or with TDLS);
1777+
* u8 attribute.
17761778
*
17771779
* @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
17781780
* %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)

net/wireless/nl80211.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4615,6 +4615,15 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
46154615
break;
46164616
}
46174617

4618+
/*
4619+
* Older kernel versions ignored this attribute entirely, so don't
4620+
* reject attempts to update it but mark it as unused instead so the
4621+
* driver won't look at the data.
4622+
*/
4623+
if (statype != CFG80211_STA_AP_CLIENT_UNASSOC &&
4624+
statype != CFG80211_STA_TDLS_PEER_SETUP)
4625+
params->opmode_notif_used = false;
4626+
46184627
return 0;
46194628
}
46204629
EXPORT_SYMBOL(cfg80211_check_station_change);
@@ -4854,6 +4863,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
48544863
params.local_pm = pm;
48554864
}
48564865

4866+
if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) {
4867+
params.opmode_notif_used = true;
4868+
params.opmode_notif =
4869+
nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]);
4870+
}
4871+
48574872
/* Include parameters for TDLS peer (will check later) */
48584873
err = nl80211_set_station_tdls(info, &params);
48594874
if (err)

0 commit comments

Comments
 (0)