1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 5 Jun 2024 10:41:34 +0200
3 Subject: [PATCH] wifi: mac80211: add radio index to
6 Will be used to explicitly assign a channel context to a wiphy radio.
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/include/net/mac80211.h
12 +++ b/include/net/mac80211.h
13 @@ -250,6 +250,7 @@ struct ieee80211_chan_req {
14 * @min_def: the minimum channel definition currently required.
15 * @ap: the channel definition the AP actually is operating as,
16 * for use with (wider bandwidth) OFDMA
17 + * @radio_idx: index of the wiphy radio used used for this channel
18 * @rx_chains_static: The number of RX chains that must always be
19 * active on the channel to receive MIMO transmissions
20 * @rx_chains_dynamic: The number of RX chains that must be enabled
21 @@ -264,6 +265,7 @@ struct ieee80211_chanctx_conf {
22 struct cfg80211_chan_def min_def;
23 struct cfg80211_chan_def ap;
26 u8 rx_chains_static, rx_chains_dynamic;
29 --- a/net/mac80211/chan.c
30 +++ b/net/mac80211/chan.c
31 @@ -623,7 +623,8 @@ ieee80211_chanctx_radar_required(struct
32 static struct ieee80211_chanctx *
33 ieee80211_alloc_chanctx(struct ieee80211_local *local,
34 const struct ieee80211_chan_req *chanreq,
35 - enum ieee80211_chanctx_mode mode)
36 + enum ieee80211_chanctx_mode mode,
39 struct ieee80211_chanctx *ctx;
41 @@ -641,6 +642,7 @@ ieee80211_alloc_chanctx(struct ieee80211
42 ctx->conf.rx_chains_dynamic = 1;
44 ctx->conf.radar_enabled = false;
45 + ctx->conf.radio_idx = radio_idx;
46 _ieee80211_recalc_chanctx_min_def(local, ctx, NULL);
49 @@ -680,7 +682,7 @@ ieee80211_new_chanctx(struct ieee80211_l
51 lockdep_assert_wiphy(local->hw.wiphy);
53 - ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
54 + ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);
56 return ERR_PTR(-ENOMEM);
58 @@ -1098,7 +1100,7 @@ int ieee80211_link_reserve_chanctx(struc
59 !list_empty(&curr_ctx->reserved_links))
62 - new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
63 + new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);