wifi: mac80211: consider reserved chanctx for mindef
authorJohannes Berg <johannes.berg@intel.com>
Thu, 4 May 2023 13:45:03 +0000 (16:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:14 +0000 (10:34 +0200)
commita0346006116463fd66a482e707756ffb691f14ca
treedda96b01c5c3642add28b52dac1afba0e554f59b
parentaefa37aa32cb4af9d3d24c469bdbe2b9cc083f61
wifi: mac80211: consider reserved chanctx for mindef

[ Upstream commit b72a455a2409fd94d6d9b4eb51d659a88213243b ]

When a chanctx is reserved for a new vif and we recalculate
the minimal definition for it, we need to consider the new
interface it's being reserved for before we assign it, so it
can be used directly with the correct min channel width.

Fix the code to - optionally - consider that, and use that
option just before doing the reassignment.

Also, when considering channel context reservations, we
should only consider the one link we're currently working with.
Change the boolean argument to a link pointer to do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230504134511.828474-4-gregory.greenman@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/chan.c
net/mac80211/ieee80211_i.h
net/mac80211/util.c