wifi: mt76: mt7921: add auto regdomain switch support

Implement 802.11d-based automatic regulatory domain switching to
dynamically determine the regulatory domain at runtime.

The scan-done event structure by reusing reserved padding and appending
new fields; the layout and values remains backward-compatible with
existing users.

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: JB Tsai <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
JB Tsai
2026-06-09 12:28:21 +02:00
committed by Felix Fietkau
parent cd3d2a68c9
commit 06d1ccbecd
6 changed files with 92 additions and 11 deletions
+10 -2
View File
@@ -1031,8 +1031,16 @@ void mt7921_scan_work(struct work_struct *work)
rxd = (struct mt76_connac2_mcu_rxd *)skb->data;
if (rxd->eid == MCU_EVENT_SCHED_SCAN_DONE) {
ieee80211_sched_scan_results(phy->mt76->hw);
} else if (test_and_clear_bit(MT76_HW_SCANNING,
&phy->mt76->state)) {
} else if (rxd->eid == MCU_EVENT_SCAN_DONE) {
struct mt76_connac_hw_scan_done *event = NULL;
skb_pull(skb, sizeof(*rxd));
event = (struct mt76_connac_hw_scan_done *)skb->data;
mt7921_regd_change(phy, event->alpha2);
}
if (test_and_clear_bit(MT76_HW_SCANNING,
&phy->mt76->state)) {
struct cfg80211_scan_info info = {
.aborted = false,
};