Commit 47edb11b authored by Ayala Beker's avatar Ayala Beker Committed by Johannes Berg

cfg80211: allow changing station capabilities for unassociated stations

Currently, cfg80211 rejects capability updates for existing entries
and as a result it's impossible to update entries that were added
unassociated, but that is necessary to go through the full station
states from userspace, adding a station before authentication etc.

Fix this by allowing updates to capabilities for stations that the
driver (or mac80211) assigned unassociated state. Drivers setting
the full station state support flag must use the new station type
for proper operation.
Signed-off-by: default avatarAyala Beker <>
Signed-off-by: default avatarLuca Coelho <>
Signed-off-by: default avatarJohannes Berg <>
parent d0a77c65
......@@ -858,6 +858,8 @@ struct station_del_parameters {
* enum cfg80211_station_type - the type of station being modified
* @CFG80211_STA_AP_CLIENT: client of an AP interface
* @CFG80211_STA_AP_CLIENT_UNASSOC: client of an AP interface that is still
* unassociated (update properties for this type of client is permitted)
* @CFG80211_STA_AP_MLME_CLIENT: client of an AP interface that has
* the AP MLME in the device
* @CFG80211_STA_AP_STA: AP station on managed interface
......@@ -873,6 +875,7 @@ struct station_del_parameters {
enum cfg80211_station_type {
......@@ -4009,7 +4009,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
params->sta_flags_mask &= ~BIT(NL80211_STA_FLAG_TDLS_PEER);
if (statype != CFG80211_STA_TDLS_PEER_SETUP) {
if (statype != CFG80211_STA_TDLS_PEER_SETUP &&
statype != CFG80211_STA_AP_CLIENT_UNASSOC) {
/* reject other things that can't change */
if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD)
return -EINVAL;
......@@ -4021,7 +4022,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
return -EINVAL;
if (statype != CFG80211_STA_AP_CLIENT) {
if (statype != CFG80211_STA_AP_CLIENT &&
statype != CFG80211_STA_AP_CLIENT_UNASSOC) {
if (params->vlan)
return -EINVAL;
......@@ -4033,6 +4035,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
case CFG80211_STA_AP_CLIENT:
/* accept only the listed bits */
if (params->sta_flags_mask &
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment