From: Emery Hsin <emery.hsin@mediatek.com>
To: <nbd@nbd.name>, <lorenzo@kernel.org>
Cc: <Sean.Wang@mediatek.com>, <jb.tsai@mediatek.com>,
<Quan.Zhou@mediatek.com>, <linux-wireless@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
Emery Hsin <emery.hsin@mediatek.com>
Subject: [PATCH 04/28] wifi: mt76: mt792x: use named constants for the DBDC band
Date: Tue, 10 Nov 2026 11:12:20 +0800 [thread overview]
Message-ID: <20261110031244.369014-5-emery.hsin@mediatek.com> (raw)
In-Reply-To: <20261110031244.369014-1-emery.hsin@mediatek.com>
Replace the hard-coded 0xfe/0xff DBDC band values with a shared
mt792x_band_idx enum, covering the host band_idx and the mt7925/mt7921
ROC command band fields. No functional change.
This is a preparation patch before the MT7925 MLO hybrid/EMLSR work.
Signed-off-by: Emery Hsin <emery.hsin@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 12 ++++++------
drivers/net/wireless/mediatek/mt76/mt792x.h | 12 ++++++++++++
5 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index e23c6026442f..628f221fcc15 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -875,7 +875,7 @@ int mt7921_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_vif *vif,
.bw_from_ap = CMD_CBW_20MHZ,
.center_chan = center_ch,
.center_chan_from_ap = center_ch,
- .dbdcband = 0xff, /* auto */
+ .dbdcband = MT792x_BAND_AUTO,
},
};
@@ -922,7 +922,7 @@ int mt7921_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif,
.len = cpu_to_le16(sizeof(struct roc_abort_tlv)),
.tokenid = token_id,
.bss_idx = vif->bss_conf.mt76.idx,
- .dbdcband = 0xff, /* auto*/
+ .dbdcband = MT792x_BAND_AUTO,
},
};
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 5672af18afe9..66d962bcba85 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -800,7 +800,7 @@ mt7925_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
FIELD_PREP(MT_TXD1_OWN_MAC, omac_idx);
/* 0xff means BAND_AUTO to the firmware, and TGID cannot encode it */
- if (band_idx && band_idx != 0xff)
+ if (band_idx && band_idx != MT792x_BAND_AUTO)
val |= FIELD_PREP(MT_TXD1_TGID, band_idx);
txwi[1] = cpu_to_le32(val);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 250746014b72..4d593291a23a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -399,7 +399,7 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
mconf->mt76.omac_idx = ieee80211_vif_is_mld(vif) ?
0 : mconf->mt76.idx;
- mconf->mt76.band_idx = 0xff;
+ mconf->mt76.band_idx = MT792x_BAND_AUTO;
mconf->absent = false;
@@ -2075,7 +2075,7 @@ mt7925_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (!err)
roc_taken = true;
else if (!is_mt7927(&dev->mt76))
- mconf->mt76.band_idx = 0xff;
+ mconf->mt76.band_idx = MT792x_BAND_AUTO;
}
err = mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 7436101514cd..c8dab3cbb06b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -1592,10 +1592,10 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf
req.roc[i].center_chan2 = 0;
req.roc[i].center_chan2_from_ap = 0;
- /* STR : 0xfe indicates BAND_ALL with enabling DBDC
- * EMLSR : 0xff indicates (BAND_AUTO) without DBDC
- */
- req.roc[i].dbdcband = type == MT7925_ROC_REQ_JOIN ? 0xfe : 0xff;
+ /* STR enables DBDC on all bands; otherwise let firmware pick */
+ req.roc[i].dbdcband = type == MT7925_ROC_REQ_JOIN ?
+ MT792x_BAND_ALL :
+ MT792x_BAND_AUTO;
if (chan->hw_value < center_ch)
req.roc[i].sco = 1; /* SCA */
@@ -1666,7 +1666,7 @@ int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
.maxinterval = cpu_to_le32(duration),
.bss_idx = mconf->mt76.idx,
.control_channel = chan->hw_value,
- .dbdcband = 0xff, /* auto */
+ .dbdcband = MT792x_BAND_AUTO,
},
};
struct cfg80211_chan_def chandef;
@@ -1735,7 +1735,7 @@ int mt7925_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
.len = cpu_to_le16(sizeof(struct roc_abort_tlv)),
.tokenid = token_id,
.bss_idx = mconf->mt76.idx,
- .dbdcband = 0xff, /* auto*/
+ .dbdcband = MT792x_BAND_AUTO,
},
};
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index d54ade9c18dc..8a366356e560 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -26,6 +26,18 @@
#define MT792x_FW_CAP_NAN BIT(5)
#define MT792x_FW_CAP_CNM BIT(7)
+/* DBDC band index; 0xff lets firmware pick the band */
+enum mt792x_band_idx {
+ MT792x_BAND_0 = 0,
+ MT792x_BAND_1 = 1,
+ MT792x_BAND_2 = 2,
+ MT792x_BAND_3 = 3,
+ MT792x_BAND_LIT = 3,
+ MT792x_BAND_NUM,
+ MT792x_BAND_ALL = 0xfe,
+ MT792x_BAND_AUTO = 0xff,
+};
+
/* Chip capability bit positions reported by firmware.
* Use with BIT(): chip_cap & BIT(MT792x_CHIP_CAP_x).
*/
--
2.45.2
next prev parent reply other threads:[~2026-11-10 3:13 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 3:12 [PATCH 00/28] wifi: mt76: mt7925: add MLO hybrid and EMLSR support Emery Hsin
2026-11-10 3:12 ` [PATCH 01/28] wifi: mt76: mt7925: fix the basic rate sent in the STA phy TLV Emery Hsin
2026-11-10 3:12 ` [PATCH 02/28] wifi: mt76: mt7925: fix MLO sub-link memory leak on disconnect Emery Hsin
2026-11-10 3:12 ` [PATCH 03/28] wifi: mt76: mt792x: turn chip_cap bits into an enum of bit positions Emery Hsin
2026-11-10 3:12 ` Emery Hsin [this message]
2026-11-10 3:12 ` [PATCH 05/28] wifi: mt76: use named constants for the HT secondary channel offset Emery Hsin
2026-11-10 3:12 ` [PATCH 06/28] wifi: mt76: mt7925: factor out mt7925_mac_link_sta_free_wcid() Emery Hsin
2026-11-10 3:12 ` [PATCH 07/28] wifi: mt76: mt792x: add a gated mt792x_mcu_set_dev_active() helper Emery Hsin
2026-11-10 3:12 ` [PATCH 08/28] wifi: mt76: mt792x: route DEV (de)activation through mt792x_mcu_set_dev_active() Emery Hsin
2026-11-10 3:12 ` [PATCH 09/28] wifi: mt76: mt7925: deactivate the DEV and BSS on disconnect Emery Hsin
2026-11-10 3:12 ` [PATCH 10/28] wifi: mt76: mt7925: reactivate the DEV before (re)connect, scan and off-channel Emery Hsin
2026-11-10 3:12 ` [PATCH 11/28] wifi: mt76: mt7925: parse the FW hybrid-MLO third-link band limit Emery Hsin
2026-11-10 3:12 ` [PATCH 12/28] wifi: mt76: mt7925: gate EMLSR by AP vendor OUI allowlist Emery Hsin
2026-11-10 3:12 ` [PATCH 13/28] wifi: mt76: mt7925: support multi-link hybrid/EMLSR remain-on-channel Emery Hsin
2026-11-10 3:12 ` [PATCH 14/28] wifi: mt76: mt7925: describe the whole MLD in the STA/BSS MLD TLVs Emery Hsin
2026-11-10 3:12 ` [PATCH 15/28] wifi: mt76: mt7925: assign a per-MLD firmware link index Emery Hsin
2026-11-10 3:12 ` [PATCH 16/28] wifi: mt76: mt7925: share the primary OMAC across MLO links Emery Hsin
2026-11-10 3:12 ` [PATCH 17/28] wifi: mt76: mt7925: carry the STA decap offload to later links Emery Hsin
2026-11-10 3:12 ` [PATCH 18/28] wifi: mt76: mt7925: split link sta add into alloc and commit phases Emery Hsin
2026-11-10 3:12 ` [PATCH 19/28] wifi: mt76: mt7925: publish every link before sending any STA_REC Emery Hsin
2026-11-10 3:12 ` [PATCH 20/28] wifi: mt76: mt7925: add mt7925_mcu_add_bss_sec() helper Emery Hsin
2026-11-10 3:12 ` [PATCH 21/28] wifi: mt76: mt7925: only refresh the SEC tag when setting the first key Emery Hsin
2026-11-10 3:12 ` [PATCH 22/28] wifi: mt76: mt7925: add mt7925_set_links_key_iter() helper Emery Hsin
2026-11-10 3:12 ` [PATCH 23/28] wifi: mt76: mt7925: bring up all MLO links on authorization Emery Hsin
2026-11-10 3:12 ` [PATCH 24/28] wifi: mt76: mt7925: skip re-adding the primary MLD BSS_INFO in chanctx ops Emery Hsin
2026-11-10 3:12 ` [PATCH 25/28] wifi: mt76: mt7925: apply FW-reported MLO link state Emery Hsin
2026-11-10 3:12 ` [PATCH 26/28] wifi: mt76: mt7925: remap hybrid-MLO TX to the primary link OMAC Emery Hsin
2026-11-10 3:12 ` [PATCH 27/28] wifi: mt76: mt7925: clear the MLD BSS tag on deactivate Emery Hsin
2026-11-10 3:12 ` [PATCH 28/28] wifi: mt76: mt7925: add hm_alg_ctrl debugfs to override the MLO link plan Emery Hsin
2026-11-25 11:04 ` [PATCH 00/28] wifi: mt76: mt7925: add MLO hybrid and EMLSR support Felix Fietkau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110031244.369014-5-emery.hsin@mediatek.com \
--to=emery.hsin@mediatek.com \
--cc=Quan.Zhou@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=jb.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox