]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: add radio index to ieee80211_chanctx_conf
authorFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 08:38:34 +0000 (10:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 9 Jul 2024 09:36:12 +0000 (11:36 +0200)
Will be used to explicitly assign a channel context to a wiphy radio.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/59f76f57d935f155099276be22badfa671d5bfd9.1720514221.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/chan.c

index bd0f8aefa797545ff6a2c7fa05535f2c37acf97a..e78ccbe38d6d5d1126a94e91e4482a6fb6aa817b 100644 (file)
@@ -250,6 +250,7 @@ struct ieee80211_chan_req {
  * @min_def: the minimum channel definition currently required.
  * @ap: the channel definition the AP actually is operating as,
  *     for use with (wider bandwidth) OFDMA
+ * @radio_idx: index of the wiphy radio used used for this channel
  * @rx_chains_static: The number of RX chains that must always be
  *     active on the channel to receive MIMO transmissions
  * @rx_chains_dynamic: The number of RX chains that must be enabled
@@ -264,6 +265,7 @@ struct ieee80211_chanctx_conf {
        struct cfg80211_chan_def min_def;
        struct cfg80211_chan_def ap;
 
+       int radio_idx;
        u8 rx_chains_static, rx_chains_dynamic;
 
        bool radar_enabled;
index 06a65dc6f6c6e5c6fbda9aa73005ffd4f0f91ca5..6c4d02cb07bb60ec7c5c3f220ba13dce3a7f5295 100644 (file)
@@ -656,7 +656,8 @@ ieee80211_chanctx_radar_required(struct ieee80211_local *local,
 static struct ieee80211_chanctx *
 ieee80211_alloc_chanctx(struct ieee80211_local *local,
                        const struct ieee80211_chan_req *chanreq,
-                       enum ieee80211_chanctx_mode mode)
+                       enum ieee80211_chanctx_mode mode,
+                       int radio_idx)
 {
        struct ieee80211_chanctx *ctx;
 
@@ -674,6 +675,7 @@ ieee80211_alloc_chanctx(struct ieee80211_local *local,
        ctx->conf.rx_chains_dynamic = 1;
        ctx->mode = mode;
        ctx->conf.radar_enabled = false;
+       ctx->conf.radio_idx = radio_idx;
        _ieee80211_recalc_chanctx_min_def(local, ctx, NULL, false);
 
        return ctx;
@@ -714,7 +716,7 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
 
        lockdep_assert_wiphy(local->hw.wiphy);
 
-       ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
+       ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);
        if (!ctx)
                return ERR_PTR(-ENOMEM);
 
@@ -1155,7 +1157,7 @@ int ieee80211_link_reserve_chanctx(struct ieee80211_link_data *link,
                            !list_empty(&curr_ctx->reserved_links))
                                return -EBUSY;
 
-                       new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode);
+                       new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1);
                        if (!new_ctx)
                                return -ENOMEM;