Skip to content

Commit 83e37e0

Browse files
Rakesh Pillaijmberg-intel
authored andcommitted
mac80211: Restore vif beacon interval if start ap fails
The starting of AP interface can fail due to invalid beacon interval, which does not match the minimum gcd requirement set by the wifi driver. In such case, the beacon interval of that interface gets updated with that invalid beacon interval. The next time that interface is brought up in AP mode, an interface combination check is performed and the beacon interval is taken from the previously set value. In a case where an invalid beacon interval, i.e. a beacon interval value which does not satisfy the minimum gcd criteria set by the driver, is set, all the subsequent trials to bring that interface in AP mode will fail, even if the subsequent trials have a valid beacon interval. To avoid this, in case of a failure in bringing up an interface in AP mode due to interface combination error, the interface beacon interval which is stored in bss conf, needs to be restored with the last working value of beacon interval. Tested on ath10k using WCN3990. Cc: stable@vger.kernel.org Fixes: 0c317a0 ("cfg80211: support virtual interfaces with different beacon intervals") Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 4ff3a9d commit 83e37e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/mac80211/cfg.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
941941
BSS_CHANGED_P2P_PS |
942942
BSS_CHANGED_TXPOWER;
943943
int err;
944+
int prev_beacon_int;
944945

945946
old = sdata_dereference(sdata->u.ap.beacon, sdata);
946947
if (old)
@@ -963,6 +964,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
963964

964965
sdata->needed_rx_chains = sdata->local->rx_chains;
965966

967+
prev_beacon_int = sdata->vif.bss_conf.beacon_int;
966968
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
967969

968970
if (params->he_cap)
@@ -974,8 +976,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
974976
if (!err)
975977
ieee80211_vif_copy_chanctx_to_vlans(sdata, false);
976978
mutex_unlock(&local->mtx);
977-
if (err)
979+
if (err) {
980+
sdata->vif.bss_conf.beacon_int = prev_beacon_int;
978981
return err;
982+
}
979983

980984
/*
981985
* Apply control port protocol, this allows us to

0 commit comments

Comments
 (0)