b832a2a12407908405f270595f894209ead0e5b5
[openwrt/staging/ansuel.git] /
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
4 ieee80211_chanctx_conf
5
6 Will be used to explicitly assign a channel context to a wiphy radio.
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
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;
24
25 + int radio_idx;
26 u8 rx_chains_static, rx_chains_dynamic;
27
28 bool radar_enabled;
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,
37 + int radio_idx)
38 {
39 struct ieee80211_chanctx *ctx;
40
41 @@ -641,6 +642,7 @@ ieee80211_alloc_chanctx(struct ieee80211
42 ctx->conf.rx_chains_dynamic = 1;
43 ctx->mode = mode;
44 ctx->conf.radar_enabled = false;
45 + ctx->conf.radio_idx = radio_idx;
46 _ieee80211_recalc_chanctx_min_def(local, ctx, NULL);
47
48 return ctx;
49 @@ -680,7 +682,7 @@ ieee80211_new_chanctx(struct ieee80211_l
50
51 lockdep_assert_wiphy(local->hw.wiphy);
52
53 - ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
54 + ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);
55 if (!ctx)
56 return ERR_PTR(-ENOMEM);
57
58 @@ -1098,7 +1100,7 @@ int ieee80211_link_reserve_chanctx(struc
59 !list_empty(&curr_ctx->reserved_links))
60 return -EBUSY;
61
62 - new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
63 + new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);
64 if (!new_ctx)
65 return -ENOMEM;
66