| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/24 07:17 | flow | patch-triage |
5mArgs:null Results: {
"EnableConfigs": [
"MT7925U",
"MT7925E",
"WLAN_VENDOR_MEDIATEK",
"MAC80211",
"WLAN",
"USB"
],
"FocusSymbols": [
"mt7925_mac_update_chan_time",
"mt7925_update_channel",
"mt7925_mcu_get_chan_mib_info",
"__mt7925_start"
],
"KMSANReasoning": "The patch introduces channel survey time tracking for MT7925/MT7927 Wi-Fi devices. It updates channel state counters by querying the MCU firmware for MIB statistics (via mt7925_mcu_get_chan_mib_info) and reading hardware registers (MT_MIB_SDR37).\n\n1. No kernel-to-user memory info-leaks: All data structures exchanged with user space (via nl80211 survey info) are populated from integer counters; no raw kernel structs or uninitialized buffers are copied to user space (via copy_to_user, put_user, netlink skb attributes, etc.).\n2. Firmware request initialization: The stack-allocated struct `req` sent to the firmware is initialized using a designated initializer (`.hdr.band = band`) and explicit loop assignments, ensuring all fields and reserved bytes are fully initialized to zero without uninitialized padding holes.\n3. Heap data structures: The newly added `state_ts[2]` array in `struct mt792x_phy` is part of the `mt792x_dev` device structure, which is zero-allocated at initialization time with kzalloc.\n4. KASAN vs. KMSAN: Potential risks in this code (such as array indexing on `state_ts[band]`, skb bounds parsing, or NULL pointer dereference if `chan` or `state` is invalid) fall strictly under out-of-bounds and pointer checking, which are comprehensively detected by KASAN. There is no risk of uninitialized memory reads or information leaks requiring KMSAN.",
"NeedsKMSAN": false,
"Reasoning": "The patch implements channel survey / airtime MIB accounting for MediaTek MT7925/MT7927 wireless devices, introducing mt7925_mac_update_chan_time() and mt7925_mcu_get_chan_mib_info() which query hardware MIB info from the MCU and update channel airtime counters. The driver includes USB support (MT7925U) which is reachable in virtualized fuzzing environments via USB gadget emulation (e.g., Raw Gadget / dummy_hcd / vhci-hcd) and triggered via nl80211 survey dumping and mac80211 operations.",
"WorthFuzzing": true
} |
| 1/1 | 2026/10/24 07:17 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 86d241710ba0fbe23652a922bda0b161fc7faaa1\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Oct 24 07:17:19 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\nindex 7af996abe2940..4ec3712fe6147 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c\n@@ -1470,6 +1470,48 @@ void mt7925_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,\n }\n EXPORT_SYMBOL_GPL(mt7925_queue_rx_skb);\n \n+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n+{\n+\tstruct ieee80211_channel *chan = phy-\u003emt76-\u003echandef.chan;\n+\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\n+\tstruct mt792x_dev *dev = phy-\u003edev;\n+\tint i, n_bands = 1, band = 0;\n+\n+\t/* The MT7927 counts 2.4 GHz on band 0 and 5/6 GHz on band 1, and\n+\t * the band not in use keeps counting, so read both every time and\n+\t * only add the band the channel is on.\n+\t */\n+\tif (is_mt7927(\u0026dev-\u003emt76)) {\n+\t\tn_bands = ARRAY_SIZE(phy-\u003estate_ts);\n+\t\tif (chan)\n+\t\t\tband = mt7927_band_idx(chan-\u003eband);\n+\t}\n+\n+\tfor (i = 0; i \u003c n_bands; i++) {\n+\t\tbool add = !reset \u0026\u0026 i == band;\n+\t\tu32 bss_rx;\n+\n+\t\tbss_rx = mt76_get_field(dev, MT_MIB_SDR37(i),\n+\t\t\t\t\tMT_MIB_SDR37_RXTIME_MASK);\n+\t\tif (add)\n+\t\t\tstate-\u003ecc_bss_rx += bss_rx;\n+\n+\t\tmt7925_mcu_get_chan_mib_info(phy, i, add);\n+\t}\n+}\n+\n+void mt7925_update_channel(struct mt76_phy *mphy)\n+{\n+\tstruct mt792x_dev *dev = container_of(mphy-\u003edev, struct mt792x_dev, mt76);\n+\n+\tif (mt76_connac_pm_wake(mphy, \u0026dev-\u003epm))\n+\t\treturn;\n+\n+\tmt7925_mac_update_chan_time(mphy-\u003epriv, false);\n+\tmt76_connac_power_save_sched(mphy, \u0026dev-\u003epm);\n+}\n+EXPORT_SYMBOL_GPL(mt7925_update_channel);\n+\n static void\n mt7925_vif_connect_iter(void *priv, u8 *mac,\n \t\t\tstruct ieee80211_vif *vif)\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c\nindex 15d95ad326362..16dc974a1122f 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c\n@@ -351,6 +351,7 @@ int __mt7925_start(struct mt792x_phy *phy)\n \t\treturn err;\n \n \tmt792x_mac_reset_counters(phy);\n+\tmt7925_mac_update_chan_time(phy, true);\n \tset_bit(MT76_STATE_RUNNING, \u0026mphy-\u003estate);\n \n \tieee80211_queue_delayed_work(mphy-\u003ehw, \u0026mphy-\u003emac_work,\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\nindex 26cdb3f0a98ae..85006859f0851 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c\n@@ -1019,6 +1019,76 @@ int mt7925_mcu_get_temperature(struct mt792x_phy *phy)\n \treturn temperature;\n }\n \n+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)\n+{\n+\tenum {\n+\t\tIDX_BUSY_TIME,\n+\t\tIDX_TX_TIME,\n+\t\tIDX_RX_TIME,\n+\t\tIDX_NUM\n+\t};\n+\tstruct {\n+\t\tstruct {\n+\t\t\tu8 band;\n+\t\t\tu8 __rsv[3];\n+\t\t} hdr;\n+\t\tstruct {\n+\t\t\t__le16 tag;\n+\t\t\t__le16 len;\n+\t\t\t__le32 offs;\n+\t\t} data[IDX_NUM];\n+\t} __packed req = {\n+\t\t.hdr.band = band,\n+\t};\n+\tstatic const u32 offs[] = {\n+\t\t[IDX_BUSY_TIME] = UNI_MIB_BUSY_TIME,\n+\t\t[IDX_TX_TIME] = UNI_MIB_TX_TIME,\n+\t\t[IDX_RX_TIME] = UNI_MIB_RX_TIME,\n+\t};\n+\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\n+\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts[band];\n+\tstruct mt792x_dev *dev = phy-\u003edev;\n+\tstruct mt7925_mcu_mib *res;\n+\tstruct sk_buff *skb;\n+\tint i, ret;\n+\n+\tfor (i = 0; i \u003c IDX_NUM; i++) {\n+\t\treq.data[i].tag = cpu_to_le16(UNI_CMD_MIB_DATA);\n+\t\treq.data[i].len = cpu_to_le16(sizeof(req.data[i]));\n+\t\treq.data[i].offs = cpu_to_le32(offs[i]);\n+\t}\n+\n+\tret = mt76_mcu_send_and_get_msg(\u0026dev-\u003emt76,\n+\t\t\t\t\tMCU_WM_UNI_CMD_QUERY(GET_MIB_INFO),\n+\t\t\t\t\t\u0026req, sizeof(req), true, \u0026skb);\n+\tif (ret)\n+\t\treturn ret;\n+\tif (skb-\u003elen \u003c sizeof(req.hdr) + IDX_NUM * sizeof(*res)) {\n+\t\tdev_kfree_skb(skb);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tskb_pull(skb, sizeof(req.hdr));\n+\tres = (struct mt7925_mcu_mib *)skb-\u003edata;\n+\n+\tif (!add)\n+\t\tgoto out;\n+\n+#define __res_u64(s) le64_to_cpu(res[s].data)\n+\tstate-\u003ecc_busy += __res_u64(IDX_BUSY_TIME) - state_ts-\u003ecc_busy;\n+\tstate-\u003ecc_tx += __res_u64(IDX_TX_TIME) - state_ts-\u003ecc_tx;\n+\tstate-\u003ecc_rx += __res_u64(IDX_RX_TIME) - state_ts-\u003ecc_rx;\n+out:\n+\tstate_ts-\u003ecc_busy = __res_u64(IDX_BUSY_TIME);\n+\tstate_ts-\u003ecc_tx = __res_u64(IDX_TX_TIME);\n+\tstate_ts-\u003ecc_rx = __res_u64(IDX_RX_TIME);\n+#undef __res_u64\n+\n+\tdev_kfree_skb(skb);\n+\n+\treturn 0;\n+}\n+\n static void\n mt7925_mcu_parse_phy_cap(struct mt792x_dev *dev, char *data)\n {\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h\nindex 11f9eac13ffc6..f3e892dbb74c4 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h\n@@ -57,6 +57,23 @@ struct mt7925_mcu_reg_event {\n \t__le32 val;\n } __packed;\n \n+enum {\n+\tUNI_CMD_MIB_DATA,\n+};\n+\n+enum {\n+\tUNI_MIB_BUSY_TIME = 19,\n+\tUNI_MIB_RX_TIME = 20,\n+\tUNI_MIB_TX_TIME = 28,\n+};\n+\n+struct mt7925_mcu_mib {\n+\t__le16 tag;\n+\t__le16 len;\n+\t__le32 offs;\n+\t__le64 data;\n+} __packed;\n+\n struct mt7925_mcu_ant_id_config {\n \tu8 ant_id[4];\n } __packed;\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h\nindex 636efe0383925..706e67e8ec423 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h\n@@ -375,6 +375,9 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,\n int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,\n \t\t\t struct ieee80211_chanctx_conf *ctx);\n int mt7925_mcu_get_temperature(struct mt792x_phy *phy);\n+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add);\n+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset);\n+void mt7925_update_channel(struct mt76_phy *mphy);\n \n int mt7925_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,\n \t\t\t\t enum mt76_txq_id qid, struct mt76_wcid *wcid,\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c\nindex 0d477dc1086cc..939a46c0428b5 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c\n@@ -604,7 +604,7 @@ static int mt7925_pci_probe(struct pci_dev *pdev,\n \t\t.sta_add = mt7925_mac_sta_add,\n \t\t.sta_event = mt7925_mac_sta_event,\n \t\t.sta_remove = mt7925_mac_sta_remove,\n-\t\t.update_survey = mt792x_update_channel,\n+\t\t.update_survey = mt7925_update_channel,\n \t};\n \tstatic const struct mt792x_hif_ops mt7925_pcie_ops = {\n \t\t.init_reset = mt7925e_init_reset,\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c\nindex f97f787b2198b..2d3bf035fdfc2 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c\n+++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c\n@@ -174,7 +174,7 @@ static int mt7925u_probe(struct usb_interface *usb_intf,\n \t\t.sta_add = mt7925_mac_sta_add,\n \t\t.sta_event = mt7925_mac_sta_event,\n \t\t.sta_remove = mt7925_mac_sta_remove,\n-\t\t.update_survey = mt792x_update_channel,\n+\t\t.update_survey = mt7925_update_channel,\n \t};\n \tstatic const struct mt792x_hif_ops hif_ops = {\n \t\t.mcu_init = mt7925u_mcu_init,\ndiff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h\nindex a7d71e007da04..3ee513258d004 100644\n--- a/drivers/net/wireless/mediatek/mt76/mt792x.h\n+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h\n@@ -221,6 +221,7 @@ struct mt792x_phy {\n \tu32 ampdu_ref;\n \n \tstruct mt76_mib_stats mib;\n+\tstruct mt76_channel_state state_ts[2];\n \n \tu8 sta_work_count;\n \tu8 clc_chan_conf;\n"
} |
| 2/1 | 2026/10/24 07:17 | agent | patch-evaluator |
4mModel:core Args: null Results: {
"EnableConfigs": [
"MT7925U",
"MT7925E",
"WLAN_VENDOR_MEDIATEK",
"MAC80211",
"WLAN",
"USB"
],
"FocusSymbols": [
"mt7925_mac_update_chan_time",
"mt7925_update_channel",
"mt7925_mcu_get_chan_mib_info",
"__mt7925_start"
],
"Reasoning": "The patch implements channel survey / airtime MIB accounting for MediaTek MT7925/MT7927 wireless devices, introducing mt7925_mac_update_chan_time() and mt7925_mcu_get_chan_mib_info() which query hardware MIB info from the MCU and update channel airtime counters. The driver includes USB support (MT7925U) which is reachable in virtualized fuzzing environments via USB gadget emulation (e.g., Raw Gadget / dummy_hcd / vhci-hcd) and triggered via nl80211 survey dumping and mac80211 operations.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 86d241710ba0fbe23652a922bda0b161fc7faaa1
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Oct 24 07:17:19 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 7af996abe2940..4ec3712fe6147 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1470,6 +1470,48 @@ void mt7925_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
}
EXPORT_SYMBOL_GPL(mt7925_queue_rx_skb);
+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)
+{
+ struct ieee80211_channel *chan = phy->mt76->chandef.chan;
+ struct mt76_channel_state *state = phy->mt76->chan_state;
+ struct mt792x_dev *dev = phy->dev;
+ int i, n_bands = 1, band = 0;
+
+ /* The MT7927 counts 2.4 GHz on band 0 and 5/6 GHz on band 1, and
+ * the band not in use keeps counting, so read both every time and
+ * only add the band the channel is on.
+ */
+ if (is_mt7927(&dev->mt76)) {
+ n_bands = ARRAY_SIZE(phy->state_ts);
+ if (chan)
+ band = mt7927_band_idx(chan->band);
+ }
+
+ for (i = 0; i < n_bands; i++) {
+ bool add = !reset && i == band;
+ u32 bss_rx;
+
+ bss_rx = mt76_get_field(dev, MT_MIB_SDR37(i),
+ MT_MIB_SDR37_RXTIME_MASK);
+ if (add)
+ state->cc_bss_rx += bss_rx;
+
+ mt7925_mcu_get_chan_mib_info(phy, i, add);
+ }
+}
+
+void mt7925_update_channel(struct mt76_phy *mphy)
+{
+ struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76);
+
+ if (mt76_connac_pm_wake(mphy, &dev->pm))
+ return;
+
+ mt7925_mac_update_chan_time(mphy->priv, false);
+ mt76_connac_power_save_sched(mphy, &dev->pm);
+}
+EXPORT_SYMBOL_GPL(mt7925_update_channel);
+
static void
mt7925_vif_connect_iter(void *priv, u8 *mac,
struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 15d95ad326362..16dc974a1122f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -351,6 +351,7 @@ int __mt7925_start(struct mt792x_phy *phy)
return err;
mt792x_mac_reset_counters(phy);
+ mt7925_mac_update_chan_time(phy, true);
set_bit(MT76_STATE_RUNNING, &mphy->state);
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 26cdb3f0a98ae..85006859f0851 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -1019,6 +1019,76 @@ int mt7925_mcu_get_temperature(struct mt792x_phy *phy)
return temperature;
}
+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)
+{
+ enum {
+ IDX_BUSY_TIME,
+ IDX_TX_TIME,
+ IDX_RX_TIME,
+ IDX_NUM
+ };
+ struct {
+ struct {
+ u8 band;
+ u8 __rsv[3];
+ } hdr;
+ struct {
+ __le16 tag;
+ __le16 len;
+ __le32 offs;
+ } data[IDX_NUM];
+ } __packed req = {
+ .hdr.band = band,
+ };
+ static const u32 offs[] = {
+ [IDX_BUSY_TIME] = UNI_MIB_BUSY_TIME,
+ [IDX_TX_TIME] = UNI_MIB_TX_TIME,
+ [IDX_RX_TIME] = UNI_MIB_RX_TIME,
+ };
+ struct mt76_channel_state *state = phy->mt76->chan_state;
+ struct mt76_channel_state *state_ts = &phy->state_ts[band];
+ struct mt792x_dev *dev = phy->dev;
+ struct mt7925_mcu_mib *res;
+ struct sk_buff *skb;
+ int i, ret;
+
+ for (i = 0; i < IDX_NUM; i++) {
+ req.data[i].tag = cpu_to_le16(UNI_CMD_MIB_DATA);
+ req.data[i].len = cpu_to_le16(sizeof(req.data[i]));
+ req.data[i].offs = cpu_to_le32(offs[i]);
+ }
+
+ ret = mt76_mcu_send_and_get_msg(&dev->mt76,
+ MCU_WM_UNI_CMD_QUERY(GET_MIB_INFO),
+ &req, sizeof(req), true, &skb);
+ if (ret)
+ return ret;
+ if (skb->len < sizeof(req.hdr) + IDX_NUM * sizeof(*res)) {
+ dev_kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ skb_pull(skb, sizeof(req.hdr));
+ res = (struct mt7925_mcu_mib *)skb->data;
+
+ if (!add)
+ goto out;
+
+#define __res_u64(s) le64_to_cpu(res[s].data)
+ state->cc_busy += __res_u64(IDX_BUSY_TIME) - state_ts->cc_busy;
+ state->cc_tx += __res_u64(IDX_TX_TIME) - state_ts->cc_tx;
+ state->cc_rx += __res_u64(IDX_RX_TIME) - state_ts->cc_rx;
+out:
+ state_ts->cc_busy = __res_u64(IDX_BUSY_TIME);
+ state_ts->cc_tx = __res_u64(IDX_TX_TIME);
+ state_ts->cc_rx = __res_u64(IDX_RX_TIME);
+#undef __res_u64
+
+ dev_kfree_skb(skb);
+
+ return 0;
+}
+
static void
mt7925_mcu_parse_phy_cap(struct mt792x_dev *dev, char *data)
{
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
index 11f9eac13ffc6..f3e892dbb74c4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
@@ -57,6 +57,23 @@ struct mt7925_mcu_reg_event {
__le32 val;
} __packed;
+enum {
+ UNI_CMD_MIB_DATA,
+};
+
+enum {
+ UNI_MIB_BUSY_TIME = 19,
+ UNI_MIB_RX_TIME = 20,
+ UNI_MIB_TX_TIME = 28,
+};
+
+struct mt7925_mcu_mib {
+ __le16 tag;
+ __le16 len;
+ __le32 offs;
+ __le64 data;
+} __packed;
+
struct mt7925_mcu_ant_id_config {
u8 ant_id[4];
} __packed;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
index 636efe0383925..706e67e8ec423 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
@@ -375,6 +375,9 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,
int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
struct ieee80211_chanctx_conf *ctx);
int mt7925_mcu_get_temperature(struct mt792x_phy *phy);
+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add);
+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset);
+void mt7925_update_channel(struct mt76_phy *mphy);
int mt7925_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
enum mt76_txq_id qid, struct mt76_wcid *wcid,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index 0d477dc1086cc..939a46c0428b5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -604,7 +604,7 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
.sta_add = mt7925_mac_sta_add,
.sta_event = mt7925_mac_sta_event,
.sta_remove = mt7925_mac_sta_remove,
- .update_survey = mt792x_update_channel,
+ .update_survey = mt7925_update_channel,
};
static const struct mt792x_hif_ops mt7925_pcie_ops = {
.init_reset = mt7925e_init_reset,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
index f97f787b2198b..2d3bf035fdfc2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
@@ -174,7 +174,7 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
.sta_add = mt7925_mac_sta_add,
.sta_event = mt7925_mac_sta_event,
.sta_remove = mt7925_mac_sta_remove,
- .update_survey = mt792x_update_channel,
+ .update_survey = mt7925_update_channel,
};
static const struct mt792x_hif_ops hif_ops = {
.mcu_init = mt7925u_mcu_init,
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index a7d71e007da04..3ee513258d004 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -221,6 +221,7 @@ struct mt792x_phy {
u32 ampdu_ref;
struct mt76_mib_stats mib;
+ struct mt76_channel_state state_ts[2];
u8 sta_work_count;
u8 clc_chan_conf;
|
| 3/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6680 output: 48 thoughts: 930 Thoughts: **Initial Assessment of the Patch Series for the mt7925 Driver** Okay, so the task is to evaluate this patch series affecting the MediaTek mt7925 wireless driver, specifically in the `drivers/net/wireless/mediatek/mt76/` directory. My initial scan shows changes across several files: `mac.c`, `main.c`, `mcu.c`, `mcu.h`, `mt7925.h`, `pci.c`, `usb.c`, and `mt792x.h`. The core modifications seem to revolve around channel time updates (`mt7925_mac_update_chan_time`, `mt7925_update_channel`), MCU interactions (`mt7925_mcu_get_chan_mib_info`), and some supporting structure definitions in the header files. The `pci.c` and `usb.c` changes are particularly interesting, replacing calls to a generic `mt792x_update_channel` with the new `mt7925_update_channel` function. I see the addition of `struct mt76_channel_state state_ts[2];` to `struct mt792x_phy` in `mt792x.h`. The presence of `usb.c` is the key point here. Is this driver actually *reachable* in a standard virtualized environment? That's the critical question. This is a MediaTek Wi-Fi 7 / Wi-Fi 6E/7 chipset. The fact that it has a USB implementation strongly suggests the possibility of USB gadget/vhci-hcd emulation, which could be exploited, depending on whether we can trigger `mt7925u_probe` and its related functionality. If it's reachable, this is very interesting, since we should pursue this avenue and see if the patch adds potential attack surface that could be fuzzed! Right, let me double-check the project's fuzzing guidelines. First, REACHABILITY IS THE PRIMARY GATE: "Fuzzing can only discover bugs in code that can actually execute in standard virtualized environments". I immediately know that structurally unreachable code MUST NOT be fuzzed. Specifically, the following are not allowed: Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) requiring physical ASIC/PCIe cards. The positive criteria: Reachable Drivers and Protocols that are accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.). Now, back to the mt7925 driver. I need to dig into `mt7925/usb.c` to see if there's a chance to trigger the USB probe. I need to find the USB vendor/product IDs and check if a USB gadget setup or vhci-hcd is possible. I should also check if firmware is required and what the probe path is, to see if the driver initialization fails early, because that would kill my chances. Let's see if this USB driver is something we can play with! I need to carefully check `usb.c`, `mac.c`, and `main.c` now... |
| 4/2 | 2026/10/24 07:17 | tool | grepper |
0mArgs:{
"Expression": "mt7925u_probe",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/usb.c=150=static void mt7925u_stop(struct ieee80211_hw *hw, bool suspend)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-158-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:159:static int mt7925u_probe(struct usb_interface *usb_intf,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-160-\t\t\t const struct usb_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=377=static struct usb_driver mt7925u_driver = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-379-\t.id_table\t= mt7925u_device_table,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:380:\t.probe\t\t= mt7925u_probe,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-381-\t.disconnect\t= mt7925u_disconnect,\n"
} |
| 5/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8721 output: 50 thoughts: 49 Thoughts: Okay, let's dive into this. **Examining the MT7925 USB Probe Function** Right, so I need to understand how this MT7925 USB driver gets initialized. I'll take a look at `drivers/net/wireless/mediatek/mt76/mt7925/usb.c`, specifically around line 159. That should be where the `mt7925u_probe` function is defined. Hopefully, the code comments are good, but even if they aren't, I should be able to deduce the key steps in the probing process. I'm expecting to see things like USB device ID matching, resource allocation, and, of course, the actual setup of the MT7925 chip through its USB interface. I'll need to figure out how it handles any error conditions. Specifically, I'm interested in any interrupt setup, DMA engine configuration, and how it handles different firmware loading stages. Let's see what's actually in there. |
| 6/2 | 2026/10/24 07:17 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/usb.c",
"FirstLine": 159,
"LineCount": 80
}Results: {
"Contents": " 159:\tstatic int mt7925u_probe(struct usb_interface *usb_intf,\n 160:\t\t\t\t const struct usb_device_id *id)\n 161:\t{\n 162:\t\tstatic const struct mt76_driver_ops drv_ops = {\n 163:\t\t\t.txwi_size = MT_SDIO_TXD_SIZE,\n 164:\t\t\t.drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ |\n 165:\t\t\t\t MT_DRV_AMSDU_OFFLOAD,\n 166:\t\t\t.survey_flags = SURVEY_INFO_TIME_TX |\n 167:\t\t\t\t\tSURVEY_INFO_TIME_RX |\n 168:\t\t\t\t\tSURVEY_INFO_TIME_BSS_RX,\n 169:\t\t\t.tx_prepare_skb = mt7925_usb_sdio_tx_prepare_skb,\n 170:\t\t\t.tx_complete_skb = mt7925_usb_sdio_tx_complete_skb,\n 171:\t\t\t.tx_status_data = mt7925_usb_sdio_tx_status_data,\n 172:\t\t\t.rx_skb = mt7925_queue_rx_skb,\n 173:\t\t\t.rx_check = mt7925_rx_check,\n 174:\t\t\t.sta_add = mt7925_mac_sta_add,\n 175:\t\t\t.sta_event = mt7925_mac_sta_event,\n 176:\t\t\t.sta_remove = mt7925_mac_sta_remove,\n 177:\t\t\t.update_survey = mt7925_update_channel,\n 178:\t\t};\n 179:\t\tstatic const struct mt792x_hif_ops hif_ops = {\n 180:\t\t\t.mcu_init = mt7925u_mcu_init,\n 181:\t\t\t.init_reset = mt792xu_init_reset,\n 182:\t\t\t.reset = mt7925u_mac_reset,\n 183:\t\t};\n 184:\t\tstatic struct mt76_bus_ops bus_ops = {\n 185:\t\t\t.rr = mt792xu_rr,\n 186:\t\t\t.wr = mt792xu_wr,\n 187:\t\t\t.rmw = mt792xu_rmw,\n 188:\t\t\t.read_copy = mt76u_read_copy,\n 189:\t\t\t.write_copy = mt792xu_copy,\n 190:\t\t\t.type = MT76_BUS_USB,\n 191:\t\t};\n 192:\t\tstruct usb_device *udev = interface_to_usbdev(usb_intf);\n 193:\t\tstruct ieee80211_ops *ops;\n 194:\t\tstruct ieee80211_hw *hw;\n 195:\t\tstruct mt792x_dev *dev;\n 196:\t\tstruct mt76_dev *mdev;\n 197:\t\tu8 features;\n 198:\t\tint ret;\n 199:\t\n 200:\t\tops = mt792x_get_mac80211_ops(\u0026usb_intf-\u003edev, \u0026mt7925_ops,\n 201:\t\t\t\t\t (void *)id-\u003edriver_info, \u0026features);\n 202:\t\tif (!ops)\n 203:\t\t\treturn -ENOMEM;\n 204:\t\n 205:\t\tops-\u003estop = mt7925u_stop;\n 206:\t\n 207:\t\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\n 208:\t\tif (!mdev)\n 209:\t\t\treturn -ENOMEM;\n 210:\t\n 211:\t\tdev = container_of(mdev, struct mt792x_dev, mt76);\n 212:\t\tdev-\u003efw_features = features;\n 213:\t\tdev-\u003ehif_ops = \u0026hif_ops;\n 214:\t\tmt792xu_reset_work_init(dev);\n 215:\t\n 216:\t\tusb_reset_device(udev);\n 217:\t\n 218:\t\tusb_set_intfdata(usb_intf, dev);\n 219:\t\n 220:\t\tret = __mt76u_init(mdev, usb_intf, \u0026bus_ops);\n 221:\t\tif (ret \u003c 0)\n 222:\t\t\tgoto error;\n 223:\t\n 224:\t\tmdev-\u003erev = (mt76_rr(dev, MT_HW_CHIPID) \u003c\u003c 16) |\n 225:\t\t\t (mt76_rr(dev, MT_HW_REV) \u0026 0xff);\n 226:\t\tdev_dbg(mdev-\u003edev, \"ASIC revision: %04x\\n\", mdev-\u003erev);\n 227:\t\n 228:\t\tif (mt76_chip(mdev) == 0x6639) {\n 229:\t\t\tdev_dbg(mdev-\u003edev,\n 230:\t\t\t\t\"MT7927 raw CHIPID=0x%04x, forcing chip=0x7927\\n\",\n 231:\t\t\t\tmt76_chip(mdev));\n 232:\t\t\tmdev-\u003erev = (0x7927 \u003c\u003c 16) | (mdev-\u003erev \u0026 0xff);\n 233:\t\t}\n 234:\t\n 235:\t\tif (mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY)) {\n 236:\t\t\tret = mt792xu_wfsys_reset(dev);\n 237:\t\t\tif (ret)\n 238:\t\t\t\tgoto error;\n"
} |
| 7/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10612 output: 50 thoughts: 18 Thoughts: Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and written in the first person: **Diving into `mt7925u_probe`** Alright, let's get down to brass tacks. I need to understand what's unfolding within `mt7925u_probe`. This is where the real magic happens, the initial setup, and the genesis of interaction with this specific USB Wi-Fi adapter. I'm especially keen on the sequence of operations here. What's the initialization order? Are they probing for specific USB device descriptors? What resources are being allocated, and in what order? I'm anticipating some interesting DMA setup or perhaps early interrupt configuration to get things rolling. I also want to see how they're handling potential errors gracefully. Are there robust error checks after each USB transfer? Are they employing retries if things go sideways? Understanding the error handling logic is just as crucial as the successful path, especially for a USB device with potential power and communication issues. Ultimately, what are the key data structures used to manage the driver state and how are they passed around? I anticipate a good deal of pointer manipulation, configuration registers, and, hopefully, some well-commented code. Let's see if this driver's maintainers are following best practices, or whether I have to spend time untangling spaghetti code. |
| 8/2 | 2026/10/24 07:17 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/usb.c",
"FirstLine": 239,
"LineCount": 50
}Results: {
"Contents": " 239:\t\t}\n 240:\t\n 241:\t\tret = mt792xu_mcu_power_on(dev);\n 242:\t\tif (ret)\n 243:\t\t\tgoto error;\n 244:\t\n 245:\t\tret = mt76u_alloc_mcu_queue(\u0026dev-\u003emt76);\n 246:\t\tif (ret)\n 247:\t\t\tgoto error;\n 248:\t\n 249:\t\tret = mt76u_alloc_queues(\u0026dev-\u003emt76);\n 250:\t\tif (ret)\n 251:\t\t\tgoto error;\n 252:\t\n 253:\t\tret = mt792xu_dma_init(dev, false);\n 254:\t\tif (ret)\n 255:\t\t\tgoto error;\n 256:\t\n 257:\t\thw = mt76_hw(dev);\n 258:\t\t/* check hw sg support in order to enable AMSDU */\n 259:\t\thw-\u003emax_tx_fragments = mdev-\u003eusb.sg_en ? MT_HW_TXP_MAX_BUF_NUM : 1;\n 260:\t\n 261:\t\tret = mt7925_register_device(dev);\n 262:\t\tif (ret)\n 263:\t\t\tgoto error;\n 264:\t\n 265:\t\treturn 0;\n 266:\t\n 267:\terror:\n 268:\t\tmt76u_queues_deinit(\u0026dev-\u003emt76);\n 269:\t\tmt792xu_reset_work_cleanup(dev);\n 270:\t\n 271:\t\tusb_set_intfdata(usb_intf, NULL);\n 272:\t\n 273:\t\tmt76_free_device(\u0026dev-\u003emt76);\n 274:\t\n 275:\t\treturn ret;\n 276:\t}\n 277:\t\n 278:\t#ifdef CONFIG_PM\n 279:\tstatic int mt7925u_suspend(struct usb_interface *intf, pm_message_t state)\n 280:\t{\n 281:\t\tstruct mt792x_dev *dev = usb_get_intfdata(intf);\n 282:\t\tstruct mt76_connac_pm *pm = \u0026dev-\u003epm;\n 283:\t\tint err, ret;\n 284:\t\n 285:\t\tpm-\u003esuspended = true;\n 286:\t\tdev-\u003ehif_resumed = false;\n 287:\t\tflush_work(\u0026dev-\u003ereset_work);\n 288:\t\tcancel_delayed_work_sync(\u0026dev-\u003emlo_pm_work);\n"
} |
| 9/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11698 output: 33 thoughts: 85 Thoughts: **Analyzing the mt7925 Driver Initialization** Okay, so I'm looking at this initialization sequence and I see the call to `mt7925_register_device(dev)`. That's a key function, I can tell. But hold on a second... what *exactly* does `mt7925_register_device(dev)` do in this context? I need to understand its role in the overall device setup. And, critically, I need to know *what* triggers the execution of either `update_survey` or `__mt7925_start`. Understanding the control flow is essential, and those functions seem like important points. Right, time to dig in. Let me quickly search the codebase for both `update_survey` and, more importantly, `mt7925_register_device` itself. I need to understand the relationship between these functions and where they fit within the driver's state machine. That should clarify the device initialization procedure significantly. |
| 10/2 | 2026/10/24 07:17 | tool | grepper |
0mArgs:{
"Expression": "update_survey",
"PathPrefixes": [
"drivers/net/wireless/mediatek/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=1000=mt76_channel_state(struct mt76_phy *phy, struct ieee80211_channel *c)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1015-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1016:void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time)\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1017-{\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1023-}\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1024:EXPORT_SYMBOL_GPL(mt76_update_survey_active_time);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1025-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1026:void mt76_update_survey(struct mt76_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1027-{\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1030-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1031:\tif (dev-\u003edrv-\u003eupdate_survey)\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1032:\t\tdev-\u003edrv-\u003eupdate_survey(phy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1033-\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1034-\tcur_time = ktime_get_boottime();\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1035:\tmt76_update_survey_active_time(phy, cur_time);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1036-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1045-}\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1046:EXPORT_SYMBOL_GPL(mt76_update_survey);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1047-\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1048=void mt76_phy_chandef_set(struct mt76_phy *phy,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1053-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1054:\tmt76_update_survey(phy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1055-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1062=int __mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1073-\twait_event_timeout(dev-\u003etx_wait, !mt76_has_tx_pending(phy), timeout);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1074:\tmt76_update_survey(phy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1075-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1144=int mt76_get_survey(struct ieee80211_hw *hw, int idx,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1164-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1165:\t\tif (idx == 0 \u0026\u0026 phy-\u003edev-\u003edrv-\u003eupdate_survey)\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1166:\t\t\tmt76_update_survey(phy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1167-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=544=struct mt76_driver_ops {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-551-\ndrivers/net/wireless/mediatek/mt76/mt76.h:552:\tvoid (*update_survey)(struct mt76_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt76.h-553-\tint (*set_channel)(struct mt76_phy *phy);\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1563=int mt76_update_channel(struct mt76_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1564:void mt76_update_survey(struct mt76_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt76.h-1565-void mt76_phy_chandef_set(struct mt76_phy *phy,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1566-\t\t\t struct cfg80211_chan_def *chandef);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1567:void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time);\ndrivers/net/wireless/mediatek/mt76/mt76.h-1568-int mt76_get_survey(struct ieee80211_hw *hw, int idx,\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/init.c=8=const struct mt76_driver_ops mt7603_drv_ops = {\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/init.c-19-\t.sta_remove = mt7603_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7603/init.c:20:\t.update_survey = mt7603_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7603/init.c-21-\t.set_channel = mt7603_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=1879=void mt7603_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1890-\tdev-\u003emphy.mac_work_count++;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:1891:\tmt76_update_survey(\u0026dev-\u003emphy);\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1892-\tmt7603_edcca_check(dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1896=mt7615_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1926-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1927:static void mt7615_update_survey(struct mt7615_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1928-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1942-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1943:\tmt76_update_survey_active_time(\u0026mdev-\u003ephy, cur_time);\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1944-\tif (mphy_ext)\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1945:\t\tmt76_update_survey_active_time(mphy_ext, cur_time);\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1946-\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1951=void mt7615_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1957-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1958:\tmt7615_update_survey(dev);\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1959-\tmt76_connac_power_save_sched(\u0026dev-\u003emphy, \u0026dev-\u003epm);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=2071=void mt7615_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-2082-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:2083:\tmt7615_update_survey(phy-\u003edev);\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-2084-\tif (++mphy-\u003emac_work_count == 5) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c=166=int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c-183-\t\t.sta_remove = mt7615_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c:184:\t\t.update_survey = mt7615_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c-185-\t\t.set_channel = mt7615_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c=76=static int mt7663s_probe(struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c-88-\t\t.sta_remove = mt7615_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c:89:\t\t.update_survey = mt7615_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c-90-\t\t.set_channel = mt7615_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c=119=static int mt7663u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-131-\t\t.sta_remove = mt7615_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c:132:\t\t.update_survey = mt7615_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-133-\t\t.set_channel = mt7615_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c=154=mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c-161-\t\t.survey_flags = SURVEY_INFO_TIME_TX,\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c:162:\t\t.update_survey = mt76x02_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c-163-\t\t.set_channel = mt76x0_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c=213=static int mt76x0u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c-219-\t\t.survey_flags = SURVEY_INFO_TIME_TX,\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c:220:\t\t.update_survey = mt76x02_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c-221-\t\t.set_channel = mt76x0_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c=1201=void mt76x02_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1208-\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c:1209:\tmt76_update_survey(\u0026dev-\u003emphy);\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1210-\tfor (i = 0, idx = 0; i \u003c 16; i++) {\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c=20=mt76x2e_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c-27-\t\t.survey_flags = SURVEY_INFO_TIME_TX,\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c:28:\t\t.update_survey = mt76x02_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c-29-\t\t.set_channel = mt76x2e_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c=32=static int mt76x2u_probe(struct usb_interface *intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c-38-\t\t.survey_flags = SURVEY_INFO_TIME_TX,\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c:39:\t\t.update_survey = mt76x02_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c-40-\t\t.set_channel = mt76x2u_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=2006=void mt7915_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-2016-\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:2017:\tmt76_update_survey(mphy);\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-2018-\tif (++mphy-\u003emac_work_count == 5) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c=917=struct mt7915_dev *mt7915_mmio_probe(struct device *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-937-\t\t.sta_remove = mt7915_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c:938:\t\t.update_survey = mt7915_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-939-\t\t.set_channel = mt7915_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=259=static int mt7921_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-278-\t\t.sta_remove = mt7921_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:279:\t\t.update_survey = mt792x_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-280-\t\t.set_channel = mt7921_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=90=static int mt7921s_probe(struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-106-\t\t.sta_remove = mt7921_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:107:\t\t.update_survey = mt792x_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-108-\t\t.set_channel = mt7921_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c=150=static int mt7921u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-167-\t\t.sta_remove = mt7921_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:168:\t\t.update_survey = mt792x_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-169-\t\t.set_channel = mt7921_set_channel,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c=587=static int mt7925_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-606-\t\t.sta_remove = mt7925_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c:607:\t\t.update_survey = mt7925_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-608-\t};\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=159=static int mt7925u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-176-\t\t.sta_remove = mt7925_mac_sta_remove,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:177:\t\t.update_survey = mt7925_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-178-\t};\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c=9=void mt792x_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-19-\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:20:\tmt76_update_survey(mphy);\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-21-\tif (++mphy-\u003emac_work_count == 2) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2982=void mt7996_mac_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2992-\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2993:\tmt76_update_survey(mphy);\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2994-\tif (++mphy-\u003emac_work_count == 5) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c=832=struct mt7996_dev *mt7996_mmio_probe(struct device *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-853-\t\t.rx_rro_add_msdu_page = mt7996_rro_msdu_page_add,\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:854:\t\t.update_survey = mt7996_update_channel,\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-855-\t\t.set_channel = mt7996_set_channel,\n"
} |
| 11/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18081 output: 45 thoughts: 39 Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person: **Analyzing the mt7925u_probe Function** Right, let's take a look. `mt7925u_probe`. Ah, it's a USB probe function, which makes sense given the "u" suffix. My initial thought is to quickly confirm that understanding. Now, I want to immediately pivot to the broader configuration landscape. I'm going to quickly check the Kconfig entries to see exactly what enables the `mt7925` driver in both USB and PCI contexts. I need to understand the configuration dependencies to get the full picture. My focus here is going to be on the relationship between both bus types and any associated dependencies, because this is going to influence my understanding and ultimately, our troubleshooting and/or development of the driver. |
| 12/2 | 2026/10/24 07:17 | tool | grepper |
0mArgs:{
"Expression": "MT7925",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 820 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (18 files in total):\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:9\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile:3\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:20\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:34\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h:3\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:11\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:30\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.h:13\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:39\ndrivers/net/wireless/mediatek/mt76/mt7925/nan.c:9\ndrivers/net/wireless/mediatek/mt76/mt7925/nan.h:8\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c:35\ndrivers/net/wireless/mediatek/mt76/mt7925/regd.c:8\ndrivers/net/wireless/mediatek/mt76/mt7925/regd.h:3\ndrivers/net/wireless/mediatek/mt76/mt7925/regs.h:12\ndrivers/net/wireless/mediatek/mt76/mt7925/testmode.c:20\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:7\n\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:2:config MT7925_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-6-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:7:config MT7925E\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:8:\ttristate \"MediaTek MT7925E (PCIe) support\"\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:9:\tselect MT7925_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-10-\tdepends on MAC80211\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-12-\thelp\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:13:\t This adds support for MT7925-based wireless PCIe devices,\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-14-\t which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-18-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:19:config MT7925U\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:20:\ttristate \"MediaTek MT7925U (USB) support\"\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-21-\tselect MT792x_USB\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:22:\tselect MT7925_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-23-\tdepends on MAC80211\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-25-\thelp\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:26:\t This adds support for MT7925-based wireless USB devices,\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-27-\t which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile-2-\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile:3:obj-$(CONFIG_MT7925_COMMON) += mt7925-common.o\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile:4:obj-$(CONFIG_MT7925E) += mt7925e.o\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile:5:obj-$(CONFIG_MT7925U) += mt7925u.o\ndrivers/net/wireless/mediatek/mt76/mt7925/Makefile-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=8=static void mt7925_cal_cache_calc_layout(struct mt7925_cal_cache_layout *l)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-11-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:12:\tl-\u003ecommon_stride = hdr + MT7925_FACT_CAL_LEN_COM;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:13:\tl-\u003egroup_stride = hdr + MT7925_FACT_CAL_LEN_GRP;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:14:\tl-\u003echannel_stride = hdr + MT7925_FACT_CAL_LEN_CH;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-15-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-17-\tl-\u003egroup_off = l-\u003ecommon_off +\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:18:\t\tl-\u003ecommon_stride * MT7925_FACT_CAL_COMMON_BAND_NUM;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-19-\tl-\u003echannel_off = l-\u003egroup_off +\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:20:\t\tl-\u003egroup_stride * MT7925_FACT_CAL_GROUP_NUM;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-21-\tl-\u003emapping_off = l-\u003echannel_off +\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:22:\t\tl-\u003echannel_stride * MT7925_FACT_CAL_CH_NUM_ALL;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-23-\tl-\u003etotal = l-\u003emapping_off +\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=70=int mt7925_mcu_send_axidma_info(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-85-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:86:\treq-\u003eremap.tag = cpu_to_le16(MT7925_AXIDMA_TAG_REMAP);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-87-\treq-\u003eremap.len = cpu_to_le16(sizeof(req-\u003eremap));\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-89-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:90:\treq-\u003efact_cal.tag = cpu_to_le16(MT7925_AXIDMA_TAG_FACT_CAL);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-91-\treq-\u003efact_cal.len = cpu_to_le16(sizeof(req-\u003efact_cal));\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=127=static void mt7925_fact_cal_build_mapping_tbl(struct mt792x_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-158-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:159:\t\tfor (i = 0; i \u003c MT7925_FACT_CAL_COMMON_BAND_NUM; i++)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-160-\t\t\tif (mt7925_cal_cache_read_slot(dev, l.common_off,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-164-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:165:\t\tfor (i = 0; i \u003c MT7925_FACT_CAL_GROUP_NUM; i++)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-166-\t\t\tif (mt7925_cal_cache_read_slot(dev, l.group_off,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-170-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:171:\t\tfor (i = 0; i \u003c MT7925_FACT_CAL_CH_NUM_ALL; i++)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-172-\t\t\tif (mt7925_cal_cache_read_slot(dev, l.channel_off,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=188=static int mt7925_mcu_fact_cal_rapid_set(struct mt792x_dev *dev, u8 cal_type,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-194-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:195:\tif (data_len \u003e MT7925_FACT_CAL_DATA_BUF_LEN)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-196-\t\treturn -EINVAL;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-201-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:202:\treq-\u003eset.tag = cpu_to_le16(MT7925_FACT_CAL_TAG_RAPID_SET);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-203-\treq-\u003eset.len = cpu_to_le16(sizeof(req-\u003eset));\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=218=int mt7925_mcu_send_fact_cal_mapping_tbl(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-220-\tstruct mt7925_fact_cal_mapping_tbl *tbl;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:221:\t__le32 cfg[MT7925_FACT_CAL_BUF_CFG_LEN / sizeof(__le32)] = {0};\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-222-\tu32 seq = 0, off = 0, left;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-234-\tcfg[1] = cpu_to_le32(sizeof(*tbl));\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:235:\tcfg[2] = cpu_to_le32(MT7925_FACT_CAL_DATA_BUF_NUM_MAX);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:236:\tret = mt7925_mcu_fact_cal_rapid_set(dev, MT7925_FACT_CAL_TYPE_MAPPING_TBL,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-237-\t\t\t\t\t seq, false, cfg, sizeof(cfg));\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-246-\twhile (left) {\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:247:\t\tu32 chunk = min_t(u32, left, MT7925_FACT_CAL_DATA_BUF_LEN);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-248-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-249-\t\tret = mt7925_mcu_fact_cal_rapid_set(dev,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:250:\t\t\t\t\t\t MT7925_FACT_CAL_TYPE_MAPPING_TBL,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-251-\t\t\t\t\t\t ++seq, false,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-263-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:264:\tret = mt7925_mcu_fact_cal_rapid_set(dev, MT7925_FACT_CAL_TYPE_MAPPING_TBL,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-265-\t\t\t\t\t ++seq, true, NULL, 0);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=278=int mt7925_mcu_fact_cal_set_bypass(struct mt792x_dev *dev, bool enable)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-289-\t\t.update_flag = {\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:290:\t\t\t.tag = cpu_to_le16(MT7925_FACT_CAL_TAG_UPDATE_FLAG),\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-291-\t\t\t.len = cpu_to_le16(sizeof(req.update_flag)),\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=7=enum mt7925_axidma_info_tag {\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:8:\tMT7925_AXIDMA_TAG_REMAP = 0,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:9:\tMT7925_AXIDMA_TAG_FACT_CAL = 1,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:10:\tMT7925_AXIDMA_TAG_NUM\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-11-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=13=enum mt7925_fact_cal_tag {\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:14:\tMT7925_FACT_CAL_TAG_TRIGGER\t= 2,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:15:\tMT7925_FACT_CAL_TAG_UPDATE_FLAG\t= 3,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:16:\tMT7925_FACT_CAL_TAG_RAPID_GET\t= 4,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:17:\tMT7925_FACT_CAL_TAG_RAPID_SET\t= 5,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-18-};\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=20=enum mt7925_fact_cal_type {\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:21:\tMT7925_FACT_CAL_TYPE_COMMON\t\t= 0,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:22:\tMT7925_FACT_CAL_TYPE_GROUP\t\t= 1,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:23:\tMT7925_FACT_CAL_TYPE_CHANNEL\t\t= 2,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:24:\tMT7925_FACT_CAL_TYPE_MAPPING_TBL\t= 4,\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-25-};\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-26-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:27:#define MT7925_FACT_CAL_DATA_BUF_LEN\t\t1400\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:28:#define MT7925_FACT_CAL_BUF_CFG_LEN\t\t\t16\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:29:#define MT7925_FACT_CAL_DATA_BUF_NUM_MAX\t4\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:30:#define MT7925_FACT_CAL_BUF_CFG_U32_LEN\t\t4\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:31:#define MT7925_FACT_CAL_DATA_MAX_BUF_LEN \\\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:32:\t(MT7925_FACT_CAL_DATA_BUF_NUM_MAX * MT7925_FACT_CAL_BUF_CFG_U32_LEN)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-33-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:34:#define MT7925_FACT_CAL_COMMON_BAND_NUM\t\t2\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:35:#define MT7925_FACT_CAL_GROUP_NUM\t\t35\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:36:#define MT7925_FACT_CAL_CH_NUM_2G\t\t14\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:37:#define MT7925_FACT_CAL_CH_NUM_5G\t\t68\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:38:#define MT7925_FACT_CAL_CH_NUM_6G\t\t109\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:39:#define MT7925_FACT_CAL_CH_NUM_ALL \\\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:40:\t(MT7925_FACT_CAL_CH_NUM_2G + MT7925_FACT_CAL_CH_NUM_5G + \\\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:41:\t MT7925_FACT_CAL_CH_NUM_6G)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-42-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:43:#define MT7925_FACT_CAL_LEN_COM\t\t\t600\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:44:#define MT7925_FACT_CAL_LEN_GRP\t\t\t4500\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:45:#define MT7925_FACT_CAL_LEN_CH\t\t\t2800\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-46-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=47=struct mt7925_fact_cal_buf_info {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-55-\tu8 rsv[2];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:56:\t__le32 buf_cfg_info[MT7925_FACT_CAL_DATA_MAX_BUF_LEN];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-57-} __packed;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=62=struct mt7925_fact_cal_common_map {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-65-\t__le32 offset;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:66:\tu8 band[MT7925_FACT_CAL_COMMON_BAND_NUM];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-67-\tu8 rsv[2];\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=70=struct mt7925_fact_cal_group_map {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-73-\t__le32 offset;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:74:\tu8 group[MT7925_FACT_CAL_GROUP_NUM];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-75-\tu8 rsv;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=78=struct mt7925_fact_cal_channel_map {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-81-\t__le32 offset;\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:82:\t__le32 cal_param[MT7925_FACT_CAL_CH_NUM_ALL];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:83:\tu8 total_buf_num[MT7925_FACT_CAL_CH_NUM_ALL];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-84-\tu8 rsv;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=125=struct mt7925_fact_cal_req {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-136-\t\tu8 rsv[2];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:137:\t\tu8 buf_data[MT7925_FACT_CAL_DATA_BUF_LEN];\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-138-\t} __packed set;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=13=bool mt7925_mac_wtbl_update(struct mt792x_dev *dev, int idx, u32 mask)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-19-\telse\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:20:\t\twtbl_update = MT7925_WTBL_UPDATE;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-21-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h-3-\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h:4:#ifndef __MT7925_MAC_H\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h:5:#define __MT7925_MAC_H\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h-6-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h=15=static inline u32 mt7925_mac_wtbl_lmac_addr(struct mt792x_dev *dev, u16 wcid, u8 dw)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h-21-\telse\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h:22:\t\twdu_cr = MT7925_WTBLON_TOP_WDUCR;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.h-23-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=625=static int mt7925_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-636-\terr = mt7925_set_roc(phy, \u0026mvif-\u003ebss_conf,\n\n"
} |
| 13/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25880 output: 47 thoughts: 39 Thoughts: Okay, let's dive into this. Here's my thought process on the matter, summarized as requested: **Examining the MT7925 Wireless Driver Configuration** Right, let's start by zeroing in on the configuration file for the MT7925 wireless driver: `drivers/net/wireless/mediatek/mt76/mt7925/Kconfig`. I'll need to understand how this driver is configured within the larger kernel build system. Given my understanding of Kconfig, I'm expecting this file to define the various options, dependencies, and help text associated with this specific wireless driver. This includes build options, and any associated features. I imagine it should contain dependencies on various hardware or other software components. I need to read the first few lines to get a handle on the overall structure and the primary configurations exposed. Let's start with the initial 35 lines; that should be enough to get a grasp of its core purpose and any immediate, obvious settings. |
| 14/2 | 2026/10/24 07:17 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/Kconfig",
"FirstLine": 1,
"LineCount": 35
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n 2:\tconfig MT7925_COMMON\n 3:\t\ttristate\n 4:\t\tselect MT792x_LIB\n 5:\t\tselect WANT_DEV_COREDUMP\n 6:\t\n 7:\tconfig MT7925E\n 8:\t\ttristate \"MediaTek MT7925E (PCIe) support\"\n 9:\t\tselect MT7925_COMMON\n 10:\t\tdepends on MAC80211\n 11:\t\tdepends on PCI\n 12:\t\thelp\n 13:\t\t This adds support for MT7925-based wireless PCIe devices,\n 14:\t\t which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n 15:\t\t 2x2:2SS 4096-QAM, 160MHz channels.\n 16:\t\n 17:\t\t To compile this driver as a module, choose M here.\n 18:\t\n 19:\tconfig MT7925U\n 20:\t\ttristate \"MediaTek MT7925U (USB) support\"\n 21:\t\tselect MT792x_USB\n 22:\t\tselect MT7925_COMMON\n 23:\t\tdepends on MAC80211\n 24:\t\tdepends on USB\n 25:\t\thelp\n 26:\t\t This adds support for MT7925-based wireless USB devices,\n 27:\t\t which support operation at 6GHz, 5GHz, and 2.4GHz IEEE 802.11be\n 28:\t\t 2x2:2SS 4096-QAM, 160MHz channels.\n 29:\t\n 30:\t\t To compile this driver as a module, choose M here.\n"
} |
| 15/2 | 2026/10/24 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26660 output: 49 thoughts: 805 Thoughts: **Analyzing the MT7925U Driver's USB Probe Sequence** Alright, let's dive in. From what I see, the MT7925U driver clearly depends on the MAC80211 stack and USB. My immediate thought is, can we realistically probe and fuzz this thing within a QEMU/syzkaller environment using USB emulation, specifically utilizing something like usb-fuzzer or vhci-hcd? That's the key question. Now, let's get into the probe sequence, starting with `mt7925u_probe`. First, it looks like a `mt76_alloc_device` is being called, which allocates memory for the device structure. I'll need to double check the allocation size to see if it's correct. Next, the device structure is initialized. Crucially, the code resets the USB device, and sets an interrupt data pointer, which is standard, and then calls `__mt76u_init`. This is where the core initialization happens, it would seem. Following this, the hardware revision is read. I need to understand what the chip ID is doing here. Ah, it appears there's a specific check for a chip revision of 0x6639, possibly forcing it to 0x7927. This is likely a workaround or a version mapping. We'll need to trace down the implications of this. There's also a check for `MT_CONN_ON_MISC` and a call to `mt792xu_wfsys_reset` which looks important. And then there's an `mt792xu_mcu_power_on`. Next up, memory is allocated for MCU and other queues, and the DMA is initialized. The code also checks for hardware SG support which is used to set the max TX fragments value, presumably enabling AMSDU. The final call, `mt7925_register_device`, is where things get interesting, and this is the one I need to see what's going on. This is where the key registration of the device is. Let me switch gears to find where the function is defined, probably in `drivers/net/wireless/mediatek/mt76/mt7925/init.c` or something similar, and understand its purpose and whether it would be possible to trigger a vulnerability. |
| 16/2 | 2026/10/24 07:18 | tool | grepper |
0mArgs:{
"Expression": "mt7925_register_device",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/init.c=190=static void mt7925_init_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-242-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:243:int mt7925_register_device(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-244-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-331-}\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:332:EXPORT_SYMBOL_GPL(mt7925_register_device);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=282=int __mt7925_start(struct mt792x_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:283:int mt7925_register_device(struct mt792x_dev *dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-284-void mt7925_unregister_device(struct mt792x_dev *dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c=587=static int mt7925_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-763-\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c:764:\tret = mt7925_register_device(dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-765-\tif (ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=159=static int mt7925u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-260-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:261:\tret = mt7925_register_device(dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-262-\tif (ret)\n"
} |
| 17/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28748 output: 50 thoughts: 35 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving into the MT7925 Initialization** Okay, time to get my hands dirty with the MT7925 driver. I'm focusing on `drivers/net/wireless/mediatek/mt76/mt7925/init.c` specifically, and I'm zeroing in on the code around line 243. That area is likely where a significant portion of the early initialization work occurs. I'm probably looking for the hardware-specific register configuration, power-up sequence, or possibly the initial firmware loading process. I expect to see the low-level interactions that bring the MT7925's radio to life after the system starts. It's a critical spot to understand the foundation of how this device operates under the hood. I am probably looking at interrupt setup. |
| 18/2 | 2026/10/24 07:18 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/init.c",
"FirstLine": 243,
"LineCount": 80
}Results: {
"Contents": " 243:\tint mt7925_register_device(struct mt792x_dev *dev)\n 244:\t{\n 245:\t\tstruct ieee80211_hw *hw = mt76_hw(dev);\n 246:\t\tint ret;\n 247:\t\n 248:\t\tdev-\u003ephy.dev = dev;\n 249:\t\tdev-\u003ephy.mt76 = \u0026dev-\u003emt76.phy;\n 250:\t\tdev-\u003emt76.phy.priv = \u0026dev-\u003ephy;\n 251:\t\tdev-\u003emt76.tx_worker.fn = mt792x_tx_worker;\n 252:\t\n 253:\t\tINIT_DELAYED_WORK(\u0026dev-\u003epm.ps_work, mt792x_pm_power_save_work);\n 254:\t\tINIT_DELAYED_WORK(\u0026dev-\u003emlo_pm_work, mt7925_mlo_pm_work);\n 255:\t\tINIT_WORK(\u0026dev-\u003epm.wake_work, mt792x_pm_wake_work);\n 256:\t\tspin_lock_init(\u0026dev-\u003epm.wake.lock);\n 257:\t\tmutex_init(\u0026dev-\u003epm.mutex);\n 258:\t\tinit_waitqueue_head(\u0026dev-\u003epm.wait);\n 259:\t\tinit_waitqueue_head(\u0026dev-\u003ewait);\n 260:\t\tspin_lock_init(\u0026dev-\u003epm.txq_lock);\n 261:\t\tINIT_DELAYED_WORK(\u0026dev-\u003emphy.mac_work, mt792x_mac_work);\n 262:\t\tINIT_DELAYED_WORK(\u0026dev-\u003ephy.scan_work, mt7925_scan_work);\n 263:\t\tINIT_DELAYED_WORK(\u0026dev-\u003ecoredump.work, mt7925_coredump_work);\n 264:\t#if IS_ENABLED(CONFIG_IPV6)\n 265:\t\tINIT_WORK(\u0026dev-\u003eipv6_ns_work, mt7925_set_ipv6_ns_work);\n 266:\t\tskb_queue_head_init(\u0026dev-\u003eipv6_ns_list);\n 267:\t#endif\n 268:\t\tskb_queue_head_init(\u0026dev-\u003ephy.scan_event_list);\n 269:\t\tskb_queue_head_init(\u0026dev-\u003ecoredump.msg_list);\n 270:\t\n 271:\t\tINIT_WORK(\u0026dev-\u003ereset_work, mt7925_mac_reset_work);\n 272:\t\tINIT_WORK(\u0026dev-\u003einit_work, mt7925_init_work);\n 273:\t\tINIT_WORK(\u0026dev-\u003enan_deferred_work, mt7925_nan_deferred_work);\n 274:\t\tspin_lock_init(\u0026dev-\u003enan_deferred_lock);\n 275:\t\n 276:\t\tINIT_WORK(\u0026dev-\u003ephy.roc_work, mt7925_roc_work);\n 277:\t\ttimer_setup(\u0026dev-\u003ephy.roc_timer, mt792x_roc_timer, 0);\n 278:\t\tinit_waitqueue_head(\u0026dev-\u003ephy.roc_wait);\n 279:\t\n 280:\t\tdev-\u003epm.idle_timeout = MT792x_PM_TIMEOUT;\n 281:\t\tdev-\u003epm.stats.last_wake_event = jiffies;\n 282:\t\tdev-\u003epm.stats.last_doze_event = jiffies;\n 283:\t\t/* MT7927: runtime PM crashes BT firmware on the shared CONNINFRA domain */\n 284:\t\tif (!mt76_is_usb(\u0026dev-\u003emt76) \u0026\u0026 !is_mt7927(\u0026dev-\u003emt76)) {\n 285:\t\t\tdev-\u003epm.enable_user = true;\n 286:\t\t\tdev-\u003epm.enable = true;\n 287:\t\t\tdev-\u003epm.ds_enable_user = true;\n 288:\t\t\tdev-\u003epm.ds_enable = true;\n 289:\t\t}\n 290:\t\n 291:\t\tif (!mt76_is_mmio(\u0026dev-\u003emt76))\n 292:\t\t\thw-\u003eextra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;\n 293:\t\n 294:\t\tmt792x_init_acpi_sar(dev);\n 295:\t\n 296:\t\tret = mt792x_init_wcid(dev);\n 297:\t\tif (ret)\n 298:\t\t\treturn ret;\n 299:\t\n 300:\t\tret = mt792x_init_wiphy(hw);\n 301:\t\tif (ret)\n 302:\t\t\treturn ret;\n 303:\t\n 304:\t\thw-\u003ewiphy-\u003ereg_notifier = mt7925_regd_notifier;\n 305:\t\tdev-\u003emphy.sband_2g.sband.ht_cap.cap |=\n 306:\t\t\t\tIEEE80211_HT_CAP_LDPC_CODING |\n 307:\t\t\t\tIEEE80211_HT_CAP_MAX_AMSDU;\n 308:\t\tdev-\u003emphy.sband_2g.sband.ht_cap.ampdu_density =\n 309:\t\t\t\tIEEE80211_HT_MPDU_DENSITY_2;\n 310:\t\tdev-\u003emphy.sband_5g.sband.ht_cap.cap |=\n 311:\t\t\t\tIEEE80211_HT_CAP_LDPC_CODING |\n 312:\t\t\t\tIEEE80211_HT_CAP_MAX_AMSDU;\n 313:\t\tdev-\u003emphy.sband_2g.sband.ht_cap.ampdu_density =\n 314:\t\t\t\tIEEE80211_HT_MPDU_DENSITY_1;\n 315:\t\tdev-\u003emphy.sband_5g.sband.vht_cap.cap |=\n 316:\t\t\t\tIEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |\n 317:\t\t\t\tIEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |\n 318:\t\t\t\tIEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |\n 319:\t\t\t\tIEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |\n 320:\t\t\t\t(3 \u003c\u003c IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);\n 321:\t\tdev-\u003emphy.sband_5g.sband.vht_cap.cap |=\n 322:\t\t\t\tIEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |\n"
} |
| 19/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 30812 output: 50 thoughts: 17 Thoughts: Here's my summary, as if I were thinking these thoughts: **Peering into the Depths of `init.c`** Alright, let's dive back in. I need to understand the execution path after line 322 in `init.c`. This is likely where a crucial initialization phase completes or where a specific module gets brought online. The exact context, the relevant data structures, and the potential interactions with the kernel are all important to discern here. I have a hunch it will be a crucial point to understand. Time to step through it and dissect the call stack to see what's happening. I expect to be digging into some core system routines. Let's see what gems we find! |
| 20/2 | 2026/10/24 07:18 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/init.c",
"FirstLine": 323,
"LineCount": 40
}Results: {
"Contents": " 323:\t\t\t\tIEEE80211_VHT_CAP_SHORT_GI_160;\n 324:\t\n 325:\t\tdev-\u003emphy.hw-\u003ewiphy-\u003eavailable_antennas_rx = dev-\u003emphy.chainmask;\n 326:\t\tdev-\u003emphy.hw-\u003ewiphy-\u003eavailable_antennas_tx = dev-\u003emphy.chainmask;\n 327:\t\n 328:\t\tqueue_work(system_percpu_wq, \u0026dev-\u003einit_work);\n 329:\t\n 330:\t\treturn 0;\n 331:\t}\n 332:\tEXPORT_SYMBOL_GPL(mt7925_register_device);\n"
} |
| 21/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31224 output: 50 thoughts: 42 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Analyzing the Initialization Work Queue** Okay, hold on a second... that `queue_work(system_percpu_wq, &dev->init_work);` line is the key. Let me zero in on what's going on with that `mt7925_init_work` call. That signals that we are doing something interesting in the `init_work`. I need to figure out how the initialization process is being scheduled. I need to understand what aspects are being offloaded to the workqueue. What's the threading model here? Is this a synchronous or asynchronous initialization? Are there any potential race conditions I need to be aware of if multiple devices are being initialized simultaneously? I need to dig into the `mt7925_init_work` function right now. Let's see how they're handling potential resource contention, and, specifically, when the device is fully ready for traffic. |
| 22/2 | 2026/10/24 07:18 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/init.c",
"FirstLine": 190,
"LineCount": 55
}Results: {
"Contents": " 190:\tstatic void mt7925_init_work(struct work_struct *work)\n 191:\t{\n 192:\t\tstruct mt792x_dev *dev = container_of(work, struct mt792x_dev,\n 193:\t\t\t\t\t\t init_work);\n 194:\t\tint ret;\n 195:\t\n 196:\t\tret = mt7925_init_hardware(dev);\n 197:\t\tif (ret)\n 198:\t\t\treturn;\n 199:\t\n 200:\t\tmt76_set_stream_caps(\u0026dev-\u003emphy, true);\n 201:\t\tmt7925_set_stream_he_eht_caps(\u0026dev-\u003ephy);\n 202:\t\tmt792x_config_mac_addr_list(dev);\n 203:\t\n 204:\t\tret = mt7925_init_mlo_caps(\u0026dev-\u003ephy);\n 205:\t\tif (ret) {\n 206:\t\t\tdev_err(dev-\u003emt76.dev, \"MLO init failed\\n\");\n 207:\t\t\treturn;\n 208:\t\t}\n 209:\t\n 210:\t\tdev-\u003emt76.init_wiphy = mt7925_init_nan_cap;\n 211:\t\n 212:\t\tret = mt76_register_device(\u0026dev-\u003emt76, true, mt76_rates,\n 213:\t\t\t\t\t ARRAY_SIZE(mt76_rates));\n 214:\t\tif (ret) {\n 215:\t\t\tdev_err(dev-\u003emt76.dev, \"register device failed\\n\");\n 216:\t\t\treturn;\n 217:\t\t}\n 218:\t\n 219:\t\tret = mt7925_init_debugfs(dev);\n 220:\t\tif (ret) {\n 221:\t\t\tdev_err(dev-\u003emt76.dev, \"register debugfs failed\\n\");\n 222:\t\t\treturn;\n 223:\t\t}\n 224:\t\n 225:\t\tret = mt7925_thermal_init(\u0026dev-\u003ephy);\n 226:\t\tif (ret) {\n 227:\t\t\tdev_err(dev-\u003emt76.dev, \"thermal init failed\\n\");\n 228:\t\t\treturn;\n 229:\t\t}\n 230:\t\n 231:\t\tret = mt7925_mcu_set_thermal_protect(dev);\n 232:\t\tif (ret) {\n 233:\t\t\tdev_err(dev-\u003emt76.dev, \"thermal protection enable failed\\n\");\n 234:\t\t\treturn;\n 235:\t\t}\n 236:\t\n 237:\t\t/* we support chip reset now */\n 238:\t\tdev-\u003ehw_init_done = true;\n 239:\t\n 240:\t\tmt7925_mcu_set_deep_sleep(dev, dev-\u003epm.ds_enable);\n 241:\t}\n 242:\t\n 243:\tint mt7925_register_device(struct mt792x_dev *dev)\n 244:\t{\n"
} |
| 23/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 32384 output: 37 thoughts: 1998 Thoughts: **Fuzzing the MT7925U USB Wireless Driver: A Syzkaller Approach** Okay, so I'm looking at the `mt76` code, specifically the `mt76_register_device` function. I see that the `mt7925u` is a USB wireless device, and that's interesting because syzkaller can definitely fuzz USB drivers, using techniques like Raw Gadget/Dummy HCD or VHCI-HCD, to emulate USB devices. Can this driver even probe without real hardware? The Raw Gadget fuzzer provides the means to emulate USB devices, so descriptors, control requests, endpoints, and bulk transfers should all be fuzzable. I need to confirm that this is a good candidate for fuzzing. I'll check the "WorthFuzzing" criteria in the instructions. It looks like reachability is key. The goal is to find crashes, regressions, and latent bugs, particularly those exposed by the patch series, and it specifies that the code has to be executable in a standard virtualized environment. The goal is that if it is structurally unreachable, it shouldn't be fuzzed, unless it adds assertions or complex logic. Section 2 confirms it shouldn't be structurally unreachable hardware that's being fuzzed, like PCIe switches, SmartNICs, or GPU drivers, or unreachable execution paths like driver teardown callbacks that rely on physical unplugging. Section 3 emphasizes drivers accessible through virtual buses, like virtio, USB gadget, loopback, netlink, or sockets. So, MT7925U is a USB driver! It can be accessed via USB gadget (vhci_hcd / raw-gadget). So, this *is* a good candidate for fuzzing! Does MT7925E use the USB version? Let's confirm: `MT7925U` is the USB version. Now, let's see what happens during USB fuzzing of MT7925U. Can it probe and start, or does it require firmware? I'll need to remember that even if firmware is requested, syzkaller injects USB descriptors and packets. Does syzkaller's USB emulation work well for mt76? Based on past syzkaller bugs, it looks like it does. There have been numerous bugs found in `mt76` drivers via USB! Many CVEs and syzbot reports mention `mt76usb`, `mt7921u`, `mt76x0u`, and `mt76x2u`. I need to check if syzbot can reach `update_survey` and `mt7925_mac_update_chan_time`. I need to inspect the code to confirm reachability. I'm looking at `mt7925_mac_update_chan_time` and `mt7925_update_channel`. Where is `mt7925_update_channel` called? Ah, it's assigned to `.update_survey`. Where is `.update_survey` called? It is called in `drivers/net/wireless/mediatek/mt76/mac80211.c`: `mt76_update_survey` and it is called in `mt792x_mac_work`. And `mt76_update_survey` itself is called by functions that can be triggered by nl80211 from userspace! And also `mt792x_mac_work`. I need to look at `__mt7925_start`. It looks like `__mt7925_start` calls `mt7925_mac_update_chan_time(phy, true);` directly, and then queues `mphy->mac_work`, which calls `mt76_update_survey`, which calls `.update_survey`, which calls `mt7925_update_channel`, which calls `mt7925_mac_update_chan_time(mphy->priv, false);`! Now I can focus on `mt7925_mac_update_chan_time`. I'm inspecting the code closely. The key lines are: `struct mt76_channel_state *state = phy->mt76->chan_state;` and `if (add) state->cc_bss_rx += bss_rx;`. Could `state` be NULL? Is it possible for `chan` to be NULL? If `reset` is false (e.g., from `mt7925_update_channel`) and `i == 0` (the default band), `add` is true. So I need to determine what `phy->mt76->chan_state` |
| 24/2 | 2026/10/24 07:18 | tool | grepper |
0mArgs:{
"Expression": "chan_state",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=395=mt76_check_sband(struct mt76_phy *phy, struct mt76_sband *msband,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-415-\t\t\t\t\tNL80211_CHAN_HT20);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:416:\t\tphy-\u003echan_state = \u0026msband-\u003echan[0];\ndrivers/net/wireless/mediatek/mt76/mac80211.c-417-\t\tphy-\u003edev-\u003eband_phys[band] = phy;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1016=void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time)\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1017-{\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1018:\tstruct mt76_channel_state *state = phy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1019-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1026=void mt76_update_survey(struct mt76_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1037-\tif (dev-\u003edrv-\u003edrv_flags \u0026 MT_DRV_SW_RX_AIRTIME) {\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1038:\t\tstruct mt76_channel_state *state = phy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1039-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1048=void mt76_phy_chandef_set(struct mt76_phy *phy,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1057-\tphy-\u003emain_chandef = *chandef;\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1058:\tphy-\u003echan_state = mt76_channel_state(phy, chandef-\u003echan);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1059-}\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1062=int __mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1080-\tphy-\u003echandef = *chandef;\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1081:\tphy-\u003echan_state = mt76_channel_state(phy, chandef-\u003echan);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1082-\tphy-\u003eoffchannel = offchannel;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1087-\tif (chandef-\u003echan != phy-\u003emain_chandef.chan)\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1088:\t\tmemset(phy-\u003echan_state, 0, sizeof(*phy-\u003echan_state));\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1089-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=855=struct mt76_phy {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-890-\ndrivers/net/wireless/mediatek/mt76/mt76.h:891:\tstruct mt76_channel_state *chan_state;\ndrivers/net/wireless/mediatek/mt76/mt76.h-892-\tenum mt76_dfs_state dfs_state;\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=433=void mt7603_mac_sta_poll(struct mt7603_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-506-\tspin_lock_bh(\u0026dev-\u003emt76.cc_lock);\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:507:\tdev-\u003emphy.chan_state-\u003ecc_tx += total_airtime;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-508-\tspin_unlock_bh(\u0026dev-\u003emt76.cc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=1636=void mt7603_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1640-\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:1641:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1642-\tstate-\u003ecc_busy += mt76_rr(dev, MT_MIB_STAT_CCA);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1896=mt7615_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1918-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1919:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1920-\tstate-\u003ecc_busy += busy_time;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c=1043=void mt76x02_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1047-\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c:1048:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1049-\tstate-\u003ecc_busy += mt76_rr(dev, MT_CH_BUSY);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=1225=void mt7915_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1227-\tstruct mt7915_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:1228:\tstruct mt76_channel_state *state = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1229-\tint nf;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c=3178=int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3179-{\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3180:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3181-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1475-\tstruct ieee80211_channel *chan = phy-\u003emt76-\u003echandef.chan;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1476:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1477-\tstruct mt792x_dev *dev = phy-\u003edev;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=1022=int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1047-\t};\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1048:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1049-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts[band];\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c=224=mt792x_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-246-\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:247:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-248-\tstate-\u003ecc_busy += busy_time;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2181=void mt7996_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2183-\tstruct mt7996_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2184:\tstruct mt76_channel_state *state = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2185-\tint nf;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c=4583=int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4610-\t};\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4611:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4612-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts;\n"
} |
| 25/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 38649 output: 42 thoughts: 749 Thoughts: **Diving into `mt7925_mcu_get_chan_mib_info`** Okay, let's break down this `mt7925_mcu_get_chan_mib_info` function. The goal is clear: to fetch channel MIB information. I see it's taking a `mt792x_phy` pointer, a band, and a boolean `add` as inputs. It looks like it's querying the MCU for MIB data. I can see the standard structure of sending a message, waiting for a response in a `sk_buff`, and then parsing the results. The MIB data seems to be channel statistics, like busy time, transmit time, and receive time. It's using some sort of index array `offs` to offset into the MIB data structures. The use of `cpu_to_le16` and `cpu_to_le32` suggests handling endianness, as expected when communicating with an embedded device. The `add` flag makes me think this function is used to accumulate channel statistics. It's calculating the differences between current and previous values, which is quite common for accumulating counts over time. But wait a minute... I see `struct mt76_channel_state *state = phy->mt76->chan_state;`. And a conditional using the `add` variable. The `state` variable is dereferenced later, but what if `phy->mt76->chan_state` is NULL? That could lead to a null pointer dereference, which is a big deal! I need to trace back and figure out when and how `phy->mt76->chan_state` is initialized. Okay, let's see... it's initialized in `mt76_check_sband` like `phy->chan_state = &msband->chan[0];`. So `mt76_check_sband` *must* be responsible for setting this up. Now I need to know when `mt76_check_sband` is called. Let's fire up `grep` and see where this function is called. This is something that is easily overlooked and could be critical in a system this size. Gotta be careful with those null pointers! |
| 26/2 | 2026/10/24 07:18 | tool | grepper |
0mArgs:{
"Expression": "mt76_check_sband",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=394=static void\ndrivers/net/wireless/mediatek/mt76/mac80211.c:395:mt76_check_sband(struct mt76_phy *phy, struct mt76_sband *msband,\ndrivers/net/wireless/mediatek/mt76/mac80211.c-396-\t\t enum nl80211_band band)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=552=int mt76_register_phy(struct mt76_phy *phy, bool vht,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-585-\twiphy_read_of_freq_limits(phy-\u003ehw-\u003ewiphy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:586:\tmt76_check_sband(phy, \u0026phy-\u003esband_2g, NL80211_BAND_2GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:587:\tmt76_check_sband(phy, \u0026phy-\u003esband_5g, NL80211_BAND_5GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:588:\tmt76_check_sband(phy, \u0026phy-\u003esband_6g, NL80211_BAND_6GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-589-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=748=int mt76_register_device(struct mt76_dev *dev, bool vht,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-779-\twiphy_read_of_freq_limits(hw-\u003ewiphy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:780:\tmt76_check_sband(\u0026dev-\u003ephy, \u0026phy-\u003esband_2g, NL80211_BAND_2GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:781:\tmt76_check_sband(\u0026dev-\u003ephy, \u0026phy-\u003esband_5g, NL80211_BAND_5GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:782:\tmt76_check_sband(\u0026dev-\u003ephy, \u0026phy-\u003esband_6g, NL80211_BAND_6GHZ);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-783-\n"
} |
| 27/2 | 2026/10/24 07:18 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 40688 output: 53 thoughts: 691 Thoughts: **Potential NULL Pointer Dereference in `mt7925_mac_update_chan_time`** Okay, here's what I'm seeing. I'm looking at `mt7925_mac_update_chan_time` and immediately a red flag pops up. I'm thinking, "Wait a minute, what if `phy->mt76->chan_state` – which they've conveniently assigned to `state` – is actually NULL?" The code doesn't explicitly check for this possibility before dereferencing `state`. Specifically, I'm concerned about the lines `state->cc_bss_rx += bss_rx;` and, from what I know of the surrounding code, the calls within `mt7925_mcu_get_chan_mib_info` likely involve similar dereferencing. If `state` *is* NULL, then those statements would lead to a classic NULL pointer dereference, which is a crash waiting to happen. That would be a critical bug. The code, as written, sets up a loop that iterates through different "bands," and then uses a boolean `add` to determine whether to update the `state`'s internal data. The problem is, if `add` is true, but `state` is still NULL, then we are in trouble. My next immediate thought is: is this reachable? Can this condition actually occur? I've got to figure out the circumstances where `phy->mt76->chan_state` could be NULL when we get to this function. So, I start to think about the hardware. I know MT7925 comes in two flavors: the MT7925E (PCIe) and the MT7925U (USB). My first instinct is, can I replicate this scenario in a QEMU environment for debugging? Can I trigger it in emulation? It turns out the MT7925E is not a standard, emulated device in QEMU, so that avenue is likely a dead end. Okay, let's switch gears and focus on the MT7925U. I'll need to check the USB driver. I'll start by looking at the device table in `drivers/net/wireless/mediatek/mt76/mt7925/usb.c` to see which USB vendor/product IDs are associated with the MT7925U. From there, I'll need to carefully review the USB driver's initialization and de-initialization sequences to see if there's any point where `chan_state` isn't properly initialized. The goal is to see if any race condition or error can lead to `chan_state` being NULL when `mt7925_mac_update_chan_time` is called. |
| 28/2 | 2026/10/24 07:19 | tool | grepper |
0mArgs:{
"Expression": "mt7925u_device_table",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/usb.c"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/usb.c-11-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:12:static const struct usb_device_id mt7925u_device_table[] = {\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-13-\t{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x6639, 0xff, 0xff, 0xff),\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=360=static void mt7925u_disconnect(struct usb_interface *usb_intf)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-372-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:373:MODULE_DEVICE_TABLE(usb, mt7925u_device_table);\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-374-MODULE_FIRMWARE(MT7925_FIRMWARE_WM);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=377=static struct usb_driver mt7925u_driver = {\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-378-\t.name\t\t= KBUILD_MODNAME,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:379:\t.id_table\t= mt7925u_device_table,\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-380-\t.probe\t\t= mt7925u_probe,\n"
} |
| 29/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42539 output: 49 thoughts: 603 Thoughts: **My Analysis of the `mt7925u_driver` Probe Process** Okay, so I see that the `mt7925u_driver` is registered with the USB core. Interesting. And, syzkaller is successfully connecting a USB device with the specified VID/PID (0x0e8d:0x6639), which suggests a USB gadget – specifically, either a Raw Gadget, a Dummy HCD, or VHCI – can connect any USB device, regardless of its vendor ID and product ID. I need to understand what happens during the probe operation. Let's dive into the `mt7925u_probe` function. It seems that the probe starts by getting the USB device from the interface, and then calling `__mt76u_init` to initialize the device. Then, the code reads the hardware revision and ID from the device registers. It checks a flag (`MT_TOP_MISC2_FW_N9_RDY`) and calls `mt792xu_wfsys_reset` if the flag is set, which likely involves a system reset. The probe process also initializes the MCU, allocates the necessary queues for data transfer, and initializes DMA. The code then checks hardware support for scatter-gather (SG) lists and sets `hw->max_tx_fragments` accordingly, which is important for understanding how the driver handles data. Finally, it registers the device by calling `mt7925_register_device`. Now, I need to understand what's happening within `mt7925_register_device`. I see it schedules `dev->init_work` on the `system_percpu_wq`. This tells me that the device initialization is being deferred to a workqueue. Okay, I'll go check `mt7925_init_work`. And there it is: `mt7925_init_work` calls `mt7925_init_hardware`. That is my next step, I need to see what's happening within `mt7925_init_hardware`. |
| 30/2 | 2026/10/24 07:19 | tool | grepper |
0mArgs:{
"Expression": "mt7925_init_hardware",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/init.c=98=EXPORT_SYMBOL_GPL(mt7925_mac_init);\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-99-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:100:static int __mt7925_init_hardware(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-101-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-132-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:133:static int mt7925_init_hardware(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-134-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-144-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:145:\t\tret = __mt7925_init_hardware(dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-146-\t\tif (!ret)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c=190=static void mt7925_init_work(struct work_struct *work)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-195-\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:196:\tret = mt7925_init_hardware(dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c-197-\tif (ret)\n"
} |
| 31/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44176 output: 50 thoughts: 35 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving into mt7925 Initialization** Okay, time to get my hands dirty. I'm going to take a look at the Mediatek MT7925 driver code, specifically the `init.c` file. I'm focusing around line 100 – that's often where the core device initialization or module loading begins. I'm expecting to find the standard `module_init` calls, likely pointing to function(s) handling register setup, clock configuration, and possibly some basic hardware probing. I'll be looking to see how they're handling things like resource allocation, IRQ registration, and any early power-up sequences if they are included. I'm interested in how they structure the initialization steps, any error handling, and whether they're following best practices in terms of modularity and device tree integration. This should give me a good handle on how the driver sets up the fundamental hardware components and prepares the chipset for normal operation. |
| 32/2 | 2026/10/24 07:19 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7925/init.c",
"FirstLine": 100,
"LineCount": 45
}Results: {
"Contents": " 100:\tstatic int __mt7925_init_hardware(struct mt792x_dev *dev)\n 101:\t{\n 102:\t\tint ret;\n 103:\t\n 104:\t\tret = mt792x_mcu_init(dev);\n 105:\t\tif (ret)\n 106:\t\t\tgoto out;\n 107:\t\n 108:\t\tret = mt76_eeprom_override(\u0026dev-\u003emphy);\n 109:\t\tif (ret)\n 110:\t\t\tgoto out;\n 111:\t\n 112:\t\tret = mt7925_mcu_set_eeprom(dev);\n 113:\t\tif (ret)\n 114:\t\t\tgoto out;\n 115:\t\n 116:\t\tret = mt7925_mac_init(dev);\n 117:\t\tif (ret)\n 118:\t\t\tgoto out;\n 119:\t\n 120:\t\tif (is_mt7927(\u0026dev-\u003emt76)) {\n 121:\t\t\tret = mt7925_mcu_set_dbdc(\u0026dev-\u003emphy, true);\n 122:\t\t\tif (ret) {\n 123:\t\t\t\tdev_warn(dev-\u003emt76.dev,\n 124:\t\t\t\t\t \"MT7927 DBDC enable failed: %d\\n\", ret);\n 125:\t\t\t\tret = 0;\n 126:\t\t\t}\n 127:\t\t}\n 128:\t\n 129:\tout:\n 130:\t\treturn ret;\n 131:\t}\n 132:\t\n 133:\tstatic int mt7925_init_hardware(struct mt792x_dev *dev)\n 134:\t{\n 135:\t\tint ret, i;\n 136:\t\n 137:\t\tset_bit(MT76_STATE_INITIALIZED, \u0026dev-\u003emphy.state);\n 138:\t\n 139:\t\tfor (i = 0; i \u003c MT792x_MCU_INIT_RETRY_COUNT; i++) {\n 140:\t\t\tif (atomic_read(\u0026dev-\u003emt76.bus_hung)) {\n 141:\t\t\t\tret = -EIO;\n 142:\t\t\t\tbreak;\n 143:\t\t\t}\n 144:\t\n"
} |
| 33/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45122 output: 42 thoughts: 127 Thoughts: **Investigating the mt7925 Initialization Process for Fuzzing Potential** Okay, so I'm looking at this `__mt7925_init_hardware` function, and I see `ret = mt792x_mcu_init(dev);`. My immediate thought is, what *exactly* does `mt792x_mcu_init` do? Ah, right, it loads the firmware. That's a key point. Now, I'm shifting gears – in a Syzkaller standard fuzzing setup, is the `mt76` driver even targeted? It's a critical question. I need to confirm if Syzkaller includes `mt76` configurations. I should check if there are any reports of bugs related to `mt76` that Syzkaller has found. The most efficient way to find that info would be to search git history for direct mentions of Syzkaller or Syzbot in conjunction with `mt76`. That's where I need to start digging. |
| 34/2 | 2026/10/24 07:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "Reported-by:.*syzkaller",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"error": "no matches"
} |
| 35/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45527 output: 42 thoughts: 24 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person: **Diving into `mt76` with Syzbot** Right, let's get down to business. My first thought is to take a look at `syzbot` again, specifically focusing on the `drivers/net/wireless/mediatek/mt76` subtree. Given the volume of wireless bugs that often surface, this is a sensible starting point. I need to quickly ascertain the current state of any reported issues that are popping up and see if there are any immediate trends or critical vulnerabilities showing up in the results. I'm looking for patterns, common trigger conditions, and anything that stands out as particularly nasty or complex. We all know how insidious those wireless driver bugs can be; I'm expecting something interesting. Time to dig in and get my hands dirty. |
| 36/2 | 2026/10/24 07:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "Reported-by:.*syzbot",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"error": "no matches"
} |
| 37/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45794 output: 35 thoughts: 26 Thoughts: Here's my thought process, as if I were considering this search: **Investigating a Potentially Driver-Related, Fuzzing-Identified Kernel Bug** Okay, so I've got a hunch – a feeling that the issue I'm dealing with might be linked to a driver, specifically a wireless networking driver. I need to dig deeper. My instinct, based on experience, is to zero in on areas where bugs might be reported. That's why I'm thinking of searching the `drivers/net/wireless/` directory, knowing that's the likely location for code related to wireless drivers. The key here is the "Reported-by: syz" string. This is crucial because `syz` indicates that this bug has come from syzkaller, which is a powerful fuzzing tool. A lot of the time, the syzkaller bug reports will include this `Reported-by` tag. The reason I think this is important is because if this tag is present, it means that I can search the whole source tree and see if there are other bugs that also have that tag. I'm essentially searching for a pattern. It's an efficient way to quickly narrow down the scope of the problem and potentially find related, perhaps even root-cause, bugs that might be lurking elsewhere in the codebase. This is a targeted approach, using a specific indicator (`syz`) to find relevant information quickly. |
| 38/2 | 2026/10/24 07:19 | tool | grepper |
0mError:no matches Args: {
"Expression": "Reported-by:.*syz",
"PathPrefixes": [
"drivers/net/wireless/"
]
}Results: {
"error": "no matches"
} |
| 39/2 | 2026/10/24 07:19 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 46168 output: 49 thoughts: 2704 Thoughts: **WorthFuzzing Analysis: MT7925U and USB Gadget Emulation** Okay, so I initially used `git grep` and got misled; it searches only the *current* file content, not the commit logs. Note to self: use `grepper` for file contents. Never mind that, the real question is whether the changes are reachable and worth fuzzing. The prompt defines "WorthFuzzing=true" as code that touches reachable, executable code, and "WorthFuzzing=false" for non-executable changes or structurally unreachable hardware. The key is accessibility via virtual buses, specifically USB gadget. The initial search for "Reported-by:.*syz" in `drivers/net/wireless` was a dead end for finding a starting point for fuzzing. Now, I need to understand if the code changes in the patch are reachable. I see that section 3 explicitly mentions "USB gadget" as a virtual bus type. *That's* the trigger! And section 2 excludes "Structurally unreachable hardware". The code changes involve `mt7925u.c`, which is a USB driver (`CONFIG_MT7925U`) for the MT7925. Specifically, `mt7925u_probe` and several common files are modified. The `mt7925u` driver *can* be probed using USB gadget emulation. The code in `mac.c`, `main.c`, and `mcu.c` is part of `mt7925-common` which is selected by `MT7925U`. The changes involve `mt7925_update_channel` and `mt7925_mac_update_chan_time`, and this affects multiple files, and also `mcu.c` and `mt792x.h`. I can visualize this working with syzkaller, which can create a USB device with `raw-gadget` or `dummy-hcd`. During USB attachment (`mt7925u_probe`), the firmware is initialized, and crucially, USB control transfers and bulk endpoint transfers are used to communicate with the device. When the network interface is up, `__mt7925_start` gets called, and later calls `mt7925_update_channel` (triggered by NL80211 survey dumps) which calls `mt7925_mac_update_chan_time`. This then triggers an MCU command, `MCU_WM_UNI_CMD_QUERY(GET_MIB_INFO)` via USB. The critical code is the MIB info retrieval. Specifically, the function `mt7925_mcu_get_chan_mib_info` retrieves MIB information. **Potential NULL Pointer Dereference Bug!** In `mt7925_mcu_get_chan_mib_info`, there are checks of `state` that uses the `phy->mt76->chan_state`. If `phy->mt76->chan_state` is NULL, it would cause a NULL pointer dereference. The key is to trace the initialization of `phy->chan_state` which is `mt76_channel_state(phy, chan)`. If the `phy->chan_state` initialization path is not taken, then a NULL value can be passed to `mt7925_mac_update_chan_time`. The patch modifies code accessible via USB gadget, and the sequence of function calls reveals a possible NULL pointer dereference. **WorthFuzzing=true** |
| 40/2 | 2026/10/24 07:20 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mac80211.c",
"FirstLine": 995,
"LineCount": 30
}Results: {
"Contents": " 995:\t\treturn false;\n 996:\t}\n 997:\tEXPORT_SYMBOL_GPL(mt76_has_tx_pending);\n 998:\t\n 999:\tstatic struct mt76_channel_state *\n1000:\tmt76_channel_state(struct mt76_phy *phy, struct ieee80211_channel *c)\n1001:\t{\n1002:\t\tstruct mt76_sband *msband;\n1003:\t\tint idx;\n1004:\t\n1005:\t\tif (c-\u003eband == NL80211_BAND_2GHZ)\n1006:\t\t\tmsband = \u0026phy-\u003esband_2g;\n1007:\t\telse if (c-\u003eband == NL80211_BAND_6GHZ)\n1008:\t\t\tmsband = \u0026phy-\u003esband_6g;\n1009:\t\telse\n1010:\t\t\tmsband = \u0026phy-\u003esband_5g;\n1011:\t\n1012:\t\tidx = c - \u0026msband-\u003esband.channels[0];\n1013:\t\treturn \u0026msband-\u003echan[idx];\n1014:\t}\n1015:\t\n1016:\tvoid mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time)\n1017:\t{\n1018:\t\tstruct mt76_channel_state *state = phy-\u003echan_state;\n1019:\t\n1020:\t\tstate-\u003ecc_active += ktime_to_us(ktime_sub(time,\n1021:\t\t\t\t\t\t\t phy-\u003esurvey_time));\n1022:\t\tphy-\u003esurvey_time = time;\n1023:\t}\n1024:\tEXPORT_SYMBOL_GPL(mt76_update_survey_active_time);\n"
} |
| 41/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 50199 output: 39 thoughts: 404 Thoughts: **Analyzing Channel Time Updates in MT76** Okay, let's break down this `mt7925_mac_update_chan_time` function. The code's clearly designed to update channel usage statistics for an MT7925/MT7927-based Wi-Fi device. I see it starts by getting the channel, channel state, and device-specific data structures. The interesting part here is how it handles the different bands, particularly with the `MT7927`. It seems like the MT7927's hardware counts channel time separately for 2.4 GHz (band 0) and 5/6 GHz (band 1), and *crucially*, it keeps counting even if a band isn't currently in use. This implies a design where each radio can report independent activity. The code then iterates through the bands. The `if (is_mt7927(&dev->mt76))` check confirms this band separation. The loop variable, `n_bands`, is set to `ARRAY_SIZE(phy->state_ts)` if MT7927 is detected. Then the code figures out the actual band of the active channel. The inner loop gets the receiver time for each band, using `mt76_get_field` to access the relevant MIB register. Here, the `MT_MIB_SDR37_RXTIME_MASK` is retrieved, I bet that is the register that represents receiver time for each band. Then, it only adds to the channel state if the current band within the loop matches the active channel. So, the channel statistics, specifically `state->cc_bss_rx`, are incremented *only* for the active band. I need to keep an eye on how the `reset` parameter is used and how it affects the add boolean. I'll need to remember to check how that `state->cc_bss_rx` variable is used later, if I need to analyze channel statistics. Finally, `mt7925_mcu_get_chan_mib_info` is called, which probably fetches even *more* channel-related data from the MCU. Now, let's see what that `mt7927_band_idx` function is all about... I'll search the `mt76` codebase for its definition to understand how the band index is determined. This is crucial for correctly mapping the hardware counters to the logical channel. |
| 42/2 | 2026/10/24 07:20 | tool | grepper |
0mArgs:{
"Expression": "mt7927_band_idx",
"PathPrefixes": [
"drivers/net/wireless/mediatek/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1486-\t\tif (chan)\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1487:\t\t\tband = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1488-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=379=static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-411-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:412:\t\tmconf-\u003emt76.band_idx = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-413-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=2417=static int mt7925_assign_vif_chanctx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2442-\t\tif (is_mt7927(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:2443:\t\t\tband_idx = mt7927_band_idx(ctx-\u003edef.chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2444-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=2371=int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2403-\t\tif (chan)\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:2404:\t\t\treq.hdr.band_idx = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2405-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=2411=int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2466-\tif (is_mt7927(mphy-\u003edev))\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:2467:\t\treq.hdr.band_idx = mt7927_band_idx(chandef-\u003echan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2468-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=234=struct mt7925_txpwr {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-267-\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:268:static inline u8 mt7927_band_idx(enum nl80211_band band)\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-269-{\n"
} |
| 43/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 52266 output: 35 thoughts: 1892 Thoughts: **Fuzzing Feasibility Analysis for MT7925 Code** Okay, so I'm diving into this `__mt7925_start` function and trying to understand its behavior. Specifically, the check for `chan = phy->mt76->chandef.chan` being NULL, and how that interacts with `is_mt7927`. If `chan` is NULL, and `is_mt7927` is true, the `band` variable doesn't get set and the flow proceeds to `mt7925_mcu_get_chan_mib_info` where it appears `state_ts` gets updated. Then when `mt7925_update_channel` is called, `reset` is false so we are in a slightly different branch. My concern is what happens if `phy->mt76->chandef.chan` *remains* NULL during this whole process. It looks like `chan_state` could potentially be NULL, and the code might be accessing uninitialized memory at `phy->mt76->chan_state`. The interesting part is that `chan_state` *should* be initialized in `mt76_check_sband` to something like `&phy->sband_2g.chan[0]`. But now, the critical question: is this code worth fuzzing, according to the guidelines I have? I need to go back and carefully re-read those sections on the triage philosophy. My goal is to determine if this code is reachable by fuzzing. Section 1 states that "REACHABILITY IS THE PRIMARY GATE", which means I need to make sure that the code can actually execute in standard virtualized environments. It emphasizes not taking "NO FUNCTIONAL CHANGE" or "REFACTORING" claims at face value, which is good. I need to refer to Section 2. I need to make sure this isn't "Structurally unreachable hardware" like vendor-specific PCIe switches, or GPU drivers that require physical ASIC/PCIe cards. Section 3 states that "Reachable Drivers and Protocols" are good fuzzing targets. So, is this MT7925 code reachable? Specifically, this patch modifies the PCI and USB parts of the driver and shared code. Syzkaller *does* fuzz USB drivers, which is promising! Section 3 explicitly mentions "USB gadget." Does that mean the USB driver (`MT7925U`) *is* reachable? Yes! A USB gadget can emulate the MediaTek MT7925U's vendor/device IDs (`0x0e8d`, `0x6639`). That means I can use syzkaller to reach this code. I need to consider all the different code paths. And there isn't any structurally unreachable hardware like vendor-specific PCIe switches. The negative criterion specifically lists *those*. I need to confirm MT7925U is compilable and reachable on `amd64`. Looking at the Kconfig, `MT7925U` depends on `USB`, so it should be. The configs look good. Based on this analysis, I'm confident this code *is* a good candidate for fuzzing. The patch modifies code that is likely accessible via a USB gadget and is therefore reachable. The changes are a refactoring, making this an interesting fuzzing target. |
| 44/2 | 2026/10/24 07:20 | tool | grepper |
0mArgs:{
"Expression": "config MT792",
"PathPrefixes": [
"drivers/net/wireless/mediatek/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/Kconfig=28=config MT76_CONNAC_LIB\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-31-\ndrivers/net/wireless/mediatek/mt76/Kconfig:32:config MT792x_LIB\ndrivers/net/wireless/mediatek/mt76/Kconfig-33-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-35-\ndrivers/net/wireless/mediatek/mt76/Kconfig:36:config MT792x_USB\ndrivers/net/wireless/mediatek/mt76/Kconfig-37-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:2:config MT7921_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-6-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:7:config MT7921E\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-8-\ttristate \"MediaTek MT7921E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-16-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:17:config MT7921S\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-18-\ttristate \"MediaTek MT7921S (SDIO) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-27-\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig:28:config MT7921U\ndrivers/net/wireless/mediatek/mt76/mt7921/Kconfig-29-\ttristate \"MediaTek MT7921U (USB) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-1-# SPDX-License-Identifier: BSD-3-Clause-Clear\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:2:config MT7925_COMMON\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-3-\ttristate\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-6-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:7:config MT7925E\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-8-\ttristate \"MediaTek MT7925E (PCIe) support\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-18-\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig:19:config MT7925U\ndrivers/net/wireless/mediatek/mt76/mt7925/Kconfig-20-\ttristate \"MediaTek MT7925U (USB) support\"\n"
} |
| 45/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 55830 output: 41 thoughts: 38 Thoughts: Here's my take on the thought process: **Diving into the MT76 Driver Dependencies** Okay, so I need to get a handle on the build dependencies for the MT76, MT7925, and related drivers. My first instinct is always to go right to the Kconfig file for the drivers. Specifically, I'm thinking I should check out `drivers/net/wireless/mediatek/mt76/Kconfig`. That's where I'll find the configuration options and, critically, the dependencies that govern whether these drivers are compiled into the kernel or built as modules. From there, I can suss out what other kernel features or hardware configurations need to be in place for MT76's components to function correctly. This is the logical starting point for understanding how these drivers fit into the larger kernel build picture. |
| 46/2 | 2026/10/24 07:20 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/Kconfig",
"FirstLine": 1,
"LineCount": 70
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: BSD-3-Clause-Clear\n 2:\tconfig MT76_CORE\n 3:\t\ttristate\n 4:\t\tselect PAGE_POOL\n 5:\t\n 6:\tconfig MT76_LEDS\n 7:\t\tbool\n 8:\t\tdepends on MT76_CORE\n 9:\t\tdepends on LEDS_CLASS=y || MT76_CORE=LEDS_CLASS\n 10:\t\tdefault y\n 11:\t\n 12:\tconfig MT76_USB\n 13:\t\ttristate\n 14:\t\tdepends on MT76_CORE\n 15:\t\n 16:\tconfig MT76_SDIO\n 17:\t\ttristate\n 18:\t\tdepends on MT76_CORE\n 19:\t\n 20:\tconfig MT76x02_LIB\n 21:\t\ttristate\n 22:\t\tselect MT76_CORE\n 23:\t\n 24:\tconfig MT76x02_USB\n 25:\t\ttristate\n 26:\t\tselect MT76_USB\n 27:\t\n 28:\tconfig MT76_CONNAC_LIB\n 29:\t\ttristate\n 30:\t\tselect MT76_CORE\n 31:\t\n 32:\tconfig MT792x_LIB\n 33:\t\ttristate\n 34:\t\tselect MT76_CONNAC_LIB\n 35:\t\n 36:\tconfig MT792x_USB\n 37:\t\ttristate\n 38:\t\tselect MT76_USB\n 39:\t\n 40:\tconfig MT76_NPU\n 41:\t\ttristate\n 42:\t\tdepends on NET_AIROHA_NPU=y || MT76_CORE=NET_AIROHA_NPU\n 43:\t\tdepends on NET_AIROHA=y || NET_AIROHA=n || MT76_CORE=NET_AIROHA\n 44:\t\n 45:\tsource \"drivers/net/wireless/mediatek/mt76/mt76x0/Kconfig\"\n 46:\tsource \"drivers/net/wireless/mediatek/mt76/mt76x2/Kconfig\"\n 47:\tsource \"drivers/net/wireless/mediatek/mt76/mt7603/Kconfig\"\n 48:\tsource \"drivers/net/wireless/mediatek/mt76/mt7615/Kconfig\"\n 49:\tsource \"drivers/net/wireless/mediatek/mt76/mt7915/Kconfig\"\n 50:\tsource \"drivers/net/wireless/mediatek/mt76/mt7921/Kconfig\"\n 51:\tsource \"drivers/net/wireless/mediatek/mt76/mt7996/Kconfig\"\n 52:\tsource \"drivers/net/wireless/mediatek/mt76/mt7925/Kconfig\"\n"
} |
| 47/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 56848 output: 32 thoughts: 21 Thoughts: Here's my thought process, as requested: **Navigating the Kconfig Hierarchy** Okay, so I need to understand something related to the Mediatek wireless drivers. My immediate thought is to check the parent Kconfig file for a broader overview of the context. Specifically, I'll start with `drivers/net/wireless/mediatek/Kconfig`. This should give me a good starting point to see what top-level configuration options are available for this specific Mediatek wireless driver area. It's the logical first step to understand the overall framework before diving into specifics. This parent file will probably define the scope and provide the necessary dependencies for more granular configurations down the line. It's the foundation. |
| 48/2 | 2026/10/24 07:20 | tool | grepper |
0mArgs:{
"Expression": "source.*mt76",
"PathPrefixes": [
"drivers/net/wireless/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/Kconfig=13=if WLAN_VENDOR_MEDIATEK\ndrivers/net/wireless/mediatek/Kconfig:14:source \"drivers/net/wireless/mediatek/mt7601u/Kconfig\"\ndrivers/net/wireless/mediatek/Kconfig:15:source \"drivers/net/wireless/mediatek/mt76/Kconfig\"\ndrivers/net/wireless/mediatek/Kconfig-16-endif # WLAN_VENDOR_MEDIATEK\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig=40=config MT76_NPU\n--\ndrivers/net/wireless/mediatek/mt76/Kconfig-44-\ndrivers/net/wireless/mediatek/mt76/Kconfig:45:source \"drivers/net/wireless/mediatek/mt76/mt76x0/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:46:source \"drivers/net/wireless/mediatek/mt76/mt76x2/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:47:source \"drivers/net/wireless/mediatek/mt76/mt7603/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:48:source \"drivers/net/wireless/mediatek/mt76/mt7615/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:49:source \"drivers/net/wireless/mediatek/mt76/mt7915/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:50:source \"drivers/net/wireless/mediatek/mt76/mt7921/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:51:source \"drivers/net/wireless/mediatek/mt76/mt7996/Kconfig\"\ndrivers/net/wireless/mediatek/mt76/Kconfig:52:source \"drivers/net/wireless/mediatek/mt76/mt7925/Kconfig\"\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=413=static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-523-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:524:static void mt7921_mcu_parse_tx_resource(struct mt76_dev *dev,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-525-\t\t\t\t\t struct sk_buff *skb)\n"
} |
| 49/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 57771 output: 37 thoughts: 28 Thoughts: Here's my take on those thoughts: **Checking the Mediatek Configuration** Alright, let's dive right in. The immediate goal here is to understand the configuration related to the `WLAN_VENDOR_MEDIATEK` option. My initial thought process is to find this specific configuration symbol. I'll need to locate its definition, and the most logical place to begin is the `Kconfig` file within the Mediatek wireless driver directory. Specifically, I'm going to look in `drivers/net/wireless/mediatek/Kconfig`. This should reveal the symbol's context: where it's defined, its dependencies, its default value (if any), and its prompt text. Understanding those elements is essential for a high-level overview of how this specific configuration variable affects other parts of the system and, therefore, the kernel. |
| 50/2 | 2026/10/24 07:20 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/Kconfig",
"FirstLine": 1,
"LineCount": 20
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\tconfig WLAN_VENDOR_MEDIATEK\n 3:\t\tbool \"MediaTek devices\"\n 4:\t\tdefault y\n 5:\t\thelp\n 6:\t\t If you have a wireless card belonging to this class, say Y.\n 7:\t\n 8:\t\t Note that the answer to this question doesn't directly affect the\n 9:\t\t kernel: saying N will just cause the configurator to skip all the\n 10:\t\t questions about these cards. If you say Y, you will be asked for\n 11:\t\t your specific card in the following questions.\n 12:\t\n 13:\tif WLAN_VENDOR_MEDIATEK\n 14:\tsource \"drivers/net/wireless/mediatek/mt7601u/Kconfig\"\n 15:\tsource \"drivers/net/wireless/mediatek/mt76/Kconfig\"\n 16:\tendif # WLAN_VENDOR_MEDIATEK\n"
} |
| 51/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 58271 output: 48 thoughts: 378 Thoughts: **Analyzing the Fuzzing Potential of MT7925 Drivers** Okay, so `WLAN_VENDOR_MEDIATEK` enables the directory, got it. And `MT7925U` clearly depends on `MAC80211` and `USB`, while `MT7925E` uses `MAC80211` and `PCI`. The goal now is to figure out if this code is even remotely fuzzable with syzkaller. Let's break it down: First, can we access `MT7925` through USB? Well, `mt7925u` *is* a USB driver, so that's a positive. Next, what functions are actually modified that we might need to focus on? From the diff, it looks like: - `mt7925_mac_update_chan_time` - `mt7925_update_channel` - `mt7925_mcu_get_chan_mib_info` - `__mt7925_start` Now, are these inline or regular functions? Let's see: `mt7925_mac_update_chan_time` is in `mac.c`, so not inline, declared in `mt7925.h`. `mt7925_update_channel` is also in `mac.c` and is exported using `EXPORT_SYMBOL_GPL`. `mt7925_mcu_get_chan_mib_info` is in `mcu.c`, and again is not inline, declared in `mt7925.h`. Finally, `__mt7925_start` is in `main.c`, and is also not inline, declared in `mt7925.h`. Hang on a minute... I really need to check when `__mt7925_start` is actually called. That's a key function to understand the driver's flow. |
| 52/2 | 2026/10/24 07:20 | tool | grepper |
0mArgs:{
"Expression": "__mt7925_start",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76/mt7925/"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/main.c=325=void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-339-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:340:int __mt7925_start(struct mt792x_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-341-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-364-}\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:365:EXPORT_SYMBOL_GPL(__mt7925_start);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-366-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=367=static int mt7925_start(struct ieee80211_hw *hw)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-372-\tmt792x_mutex_acquire(phy-\u003edev);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:373:\terr = __mt7925_start(phy);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-374-\tmt792x_mutex_release(phy-\u003edev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=280=extern const struct ieee80211_ops mt7925_ops;\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-281-\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:282:int __mt7925_start(struct mt792x_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-283-int mt7925_register_device(struct mt792x_dev *dev);\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c=71=int mt7925e_mac_reset(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c-155-\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c:156:\terr = __mt7925_start(\u0026dev-\u003ephy);\ndrivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c-157-out:\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=80=static int mt7925u_mac_reset(struct mt792x_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-140-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:141:\terr = __mt7925_start(\u0026dev-\u003ephy);\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-142-out:\n"
} |
| 53/2 | 2026/10/24 07:20 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 60111 output: 35 thoughts: 3111 Thoughts: **Analysis of Fuzzing Reachability and Focus Symbols for MT7925 Driver** Okay, let's break this down. My initial assessment clearly shows that the changes introduced in this patch are reachable and should be considered for fuzzing. We have `mt7925_ops.start` which calls `mt7925_start`, and importantly, `mt7925u_mac_reset` calls `__mt7925_start`, and the driver registers with mac80211. Crucially, the USB probe is successful through firmware requests via `mt792x_mcu_init` and these firmware files are generally available in standard syzkaller environments, or can be emulated. The provided guidelines explicitly state that drivers accessible via virtual buses, such as USB gadgets, are within the scope of fuzzing, and the presence of `MT7925U` confirms this. The crucial point is that this code isn't falling into the negative criteria – it's not a vendor-specific ASIC/PCIe switch, a teardown callback, nor exclusive to a different architecture. Therefore, `WorthFuzzing` is unequivocally `true`. Now, we need to extract the `FocusSymbols` to guide the fuzzer effectively. We need to avoid generic hot-paths and target the feature-specific logic. Let's analyze the modified functions: 1. `mt7925_mac_update_chan_time`: This function is the core of the added logic, calculating `band` and calling `mt7925_mcu_get_chan_mib_info`. It's a non-ubiquitous, distinct function and a good candidate. 2. `mt7925_update_channel`: This is assigned to `drv_ops.update_survey` and also calls `mt7925_mac_update_chan_time`, and is also specific and non-ubiquitous. 3. `mt7925_mcu_get_chan_mib_info`: This function sends an MCU command to get MIB info and updates airtime counters. This is specific logic related to the new feature and is also a good symbol to focus. 4. `__mt7925_start`: While `mt7925_start` calls `__mt7925_start` and `__mt7925_start` then calls `mt7925_mac_update_chan_time` this function represents the entrypoint/start of the device when the interface is initialized, so this can be a good FocusSymbol. So, the extracted `FocusSymbols` are: `mt7925_mac_update_chan_time`, `mt7925_update_channel`, `mt7925_mcu_get_chan_mib_info`, and `__mt7925_start`. Finally, we have to verify the EnableConfigs needed to build and enable the code: * `WLAN_VENDOR_MEDIATEK`: Required because it's the top-level selection. * `MT7925_COMMON`: Needed to build the common part. * `MT7925U` or `MT7925E`: Needed, since the device can be either. * `MAC80211` : Needed by both USB and PCIe variants. * `USB` : Needed if `MT7925U` is selected. * `PCI` : Needed if `MT7925E` is selected. * `MT792x_USB` : Required if MT7925U is selected. * `MT792x_LIB`: This is automatically included when `MT7925_COMMON` is selected. * `WANT_DEV_COREDUMP`: Also included by `MT7925_COMMON`. With these configurations in place, the driver is buildable and fuzzing will be effective with the provided FocusSymbols. |
| 54/2 | 2026/10/24 07:21 | tool | grepper |
0mArgs:{
"Expression": "WLAN_VENDOR_MEDIATEK",
"PathPrefixes": [
"drivers/net/wireless/"
]
}Results: {
"Output": "drivers/net/wireless/Makefile=12=obj-$(CONFIG_WLAN_VENDOR_MARVELL) += marvell/\ndrivers/net/wireless/Makefile:13:obj-$(CONFIG_WLAN_VENDOR_MEDIATEK) += mediatek/\ndrivers/net/wireless/Makefile-14-obj-$(CONFIG_WLAN_VENDOR_MICROCHIP) += microchip/\n--\ndrivers/net/wireless/mediatek/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/net/wireless/mediatek/Kconfig:2:config WLAN_VENDOR_MEDIATEK\ndrivers/net/wireless/mediatek/Kconfig-3-\tbool \"MediaTek devices\"\n--\ndrivers/net/wireless/mediatek/Kconfig-12-\ndrivers/net/wireless/mediatek/Kconfig:13:if WLAN_VENDOR_MEDIATEK\ndrivers/net/wireless/mediatek/Kconfig-14-source \"drivers/net/wireless/mediatek/mt7601u/Kconfig\"\ndrivers/net/wireless/mediatek/Kconfig=15=source \"drivers/net/wireless/mediatek/mt76/Kconfig\"\ndrivers/net/wireless/mediatek/Kconfig:16:endif # WLAN_VENDOR_MEDIATEK\n"
} |
| 55/2 | 2026/10/24 07:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 64460 output: 32 thoughts: 20 Thoughts: Here's my thought process, as if I were considering this myself: **Investigating the Mediatek Wireless Driver Configuration** Okay, so I need to dig into the Mediatek wireless driver configuration. My initial move here is to check the `drivers/net/wireless/Kconfig` file. That's the standard place to start looking for configuration options related to a specific hardware vendor or module. It'll give me a good overview of the available features, dependencies, and settings for the Mediatek wireless drivers within the kernel build system. I’m thinking there will be options for enabling/disabling the driver, selecting specific Mediatek chipsets or features, and perhaps tweaking performance parameters. Hopefully, the file is well-documented! |
| 56/2 | 2026/10/24 07:21 | tool | grepper |
0mArgs:{
"Expression": "mediatek/Kconfig",
"PathPrefixes": [
"drivers/net/wireless/"
]
}Results: {
"Output": "drivers/net/wireless/Kconfig=27=source \"drivers/net/wireless/marvell/Kconfig\"\ndrivers/net/wireless/Kconfig:28:source \"drivers/net/wireless/mediatek/Kconfig\"\ndrivers/net/wireless/Kconfig-29-source \"drivers/net/wireless/microchip/Kconfig\"\n"
} |
| 57/2 | 2026/10/24 07:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 64762 output: 34 thoughts: 29 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and rendered in the first person: **Navigating the Wireless Network Driver Configuration** Alright, so I'm looking at a potential dependency issue. My gut tells me it's likely related to the overall WLAN configuration. I need to quickly ascertain if the `WLAN` option, defined within the kernel's wireless network driver configuration, is a required prerequisite for whatever I'm troubleshooting. Specifically, I'm going to jump into `drivers/net/wireless/Kconfig`. Line 28 seems a reasonable starting point, as Kconfig files often structure dependencies in a top-down fashion, and that's usually where the top-level configuration elements sit. Grabbing that section will quickly confirm whether enabling `WLAN` is a fundamental requirement. |
| 58/2 | 2026/10/24 07:21 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/Kconfig",
"FirstLine": 1,
"LineCount": 35
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# Wireless LAN device configuration\n 4:\t#\n 5:\t\n 6:\tmenuconfig WLAN\n 7:\t\tbool \"Wireless LAN\"\n 8:\t\tdepends on !S390\n 9:\t\tdepends on NET\n 10:\t\tselect WIRELESS\n 11:\t\tdefault y\n 12:\t\thelp\n 13:\t\t This section contains all the pre 802.11 and 802.11 wireless\n 14:\t\t device drivers. For a complete list of drivers and documentation\n 15:\t\t on them refer to the wireless wiki:\n 16:\t\n 17:\t\t https://wireless.wiki.kernel.org/en/users/Drivers\n 18:\t\n 19:\tif WLAN\n 20:\t\n 21:\tsource \"drivers/net/wireless/admtek/Kconfig\"\n 22:\tsource \"drivers/net/wireless/ath/Kconfig\"\n 23:\tsource \"drivers/net/wireless/atmel/Kconfig\"\n 24:\tsource \"drivers/net/wireless/broadcom/Kconfig\"\n 25:\tsource \"drivers/net/wireless/intel/Kconfig\"\n 26:\tsource \"drivers/net/wireless/intersil/Kconfig\"\n 27:\tsource \"drivers/net/wireless/marvell/Kconfig\"\n 28:\tsource \"drivers/net/wireless/mediatek/Kconfig\"\n 29:\tsource \"drivers/net/wireless/microchip/Kconfig\"\n 30:\tsource \"drivers/net/wireless/morsemicro/Kconfig\"\n 31:\tsource \"drivers/net/wireless/nxp/Kconfig\"\n 32:\tsource \"drivers/net/wireless/purelifi/Kconfig\"\n 33:\tsource \"drivers/net/wireless/ralink/Kconfig\"\n 34:\tsource \"drivers/net/wireless/realtek/Kconfig\"\n 35:\tsource \"drivers/net/wireless/rsi/Kconfig\"\n"
} |
| 59/2 | 2026/10/24 07:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 65530 output: 277 thoughts: 980 Thoughts: **Configuration Analysis for MT7925 Driver Fuzzing**
Alright, let's break this down systematically. First, I need to nail down the essential kernel configurations for fuzzing the MT7925 wireless driver. Starting with the basics, `USB` depends on `USB_SUPPORT`. Now, the MT7925U variant depends on `MAC80211` and `USB`, while MT7925E depends on `MAC80211` and `PCI`. A common element, `MT7925_COMMON`, is selected by both the USB and PCIe variants. I also need `WLAN_VENDOR_MEDIATEK` for the correct Kconfig to be sourced. Of course, `WLAN` (menuconfig for wireless) and `MAC80211` are fundamental. I'm noting the potential presence of `USB_RAW_GADGET` or `USB_DUMMY_HCD`, which syzkaller often sets, but those aren't *directly* driver specific.
My key configuration options here are:
* `MT7925U` (for the USB driver)
* `MT7925E` (for the PCIe driver)
* `MT7925_COMMON` (automatically selected, but still, good to keep in mind)
* `WLAN_VENDOR_MEDIATEK`
* `MAC80211`
* `WLAN`
* `USB`
Now, let's examine the Makefile in `drivers/net/wireless/mediatek/mt76/mt7925/`. This confirms my understanding. `CONFIG_MT7925_COMMON` compiles core modules, while `MT7925U` selects `MT7925_COMMON` and builds `mt7925u.o`, and `MT7925E` does the same for `mt7925e.o`.
So, the minimum configuration required is: `MT7925U` or `MT7925E`, plus `WLAN_VENDOR_MEDIATEK`, `MAC80211`, `USB`, `PCI`, and `WLAN`.
Okay, double-checking everything.
1. **`WorthFuzzing`**: Absolutely true. The patch directly modifies the MediaTek MT7925 wireless drivers, including both the USB and PCIe variants. The driver is accessible through virtual buses (raw-gadget, dummy_hcd, or vhci-hcd). New kernel code is introduced for channel survey / airtime MIB accounting via MCU commands. This is reachable kernel code.
2. **`FocusSymbols`**: The critical functions for fuzzing are:
* `mt7925_mac_update_chan_time`
* `mt7925_update_channel`
* `mt7925_mcu_get_chan_mib_info`
* `__mt7925_start`
3. **`EnableConfigs`**: The necessary kernel config options are:
* `MT7925U`
* `MT7925E`
* `WLAN_VENDOR_MEDIATEK`
* `MAC80211`
* `WLAN`
* `USB`
I've reviewed all required parameters: `WorthFuzzing`, `Reasoning`, `FocusSymbols`, and `EnableConfigs`. The analysis is complete and accurate. Time to call `set-results`.
|
| 60/2 | 2026/10/24 07:21 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"MT7925U",
"MT7925E",
"WLAN_VENDOR_MEDIATEK",
"MAC80211",
"WLAN",
"USB"
],
"FocusSymbols": [
"mt7925_mac_update_chan_time",
"mt7925_update_channel",
"mt7925_mcu_get_chan_mib_info",
"__mt7925_start"
],
"Reasoning": "The patch implements channel survey / airtime MIB accounting for MediaTek MT7925/MT7927 wireless devices, introducing mt7925_mac_update_chan_time() and mt7925_mcu_get_chan_mib_info() which query hardware MIB info from the MCU and update channel airtime counters. The driver includes USB support (MT7925U) which is reachable in virtualized fuzzing environments via USB gadget emulation (e.g., Raw Gadget / dummy_hcd / vhci-hcd) and triggered via nl80211 survey dumping and mac80211 operations.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"MT7925U",
"MT7925E",
"WLAN_VENDOR_MEDIATEK",
"MAC80211",
"WLAN",
"USB"
],
"FocusSymbols": [
"mt7925_mac_update_chan_time",
"mt7925_update_channel",
"mt7925_mcu_get_chan_mib_info",
"__mt7925_start"
],
"Reasoning": "The patch implements channel survey / airtime MIB accounting for MediaTek MT7925/MT7927 wireless devices, introducing mt7925_mac_update_chan_time() and mt7925_mcu_get_chan_mib_info() which query hardware MIB info from the MCU and update channel airtime counters. The driver includes USB support (MT7925U) which is reachable in virtualized fuzzing environments via USB gadget emulation (e.g., Raw Gadget / dummy_hcd / vhci-hcd) and triggered via nl80211 survey dumping and mac80211 operations.",
"WorthFuzzing": true
} |
| 61/1 | 2026/10/24 07:21 | action | If |
1mArgs:{
"WorthFuzzing": true
}Results: null |
| 62/2 | 2026/10/24 07:21 | agent | kmsan-evaluator |
1mModel:core Args: null Results: {
"KMSANReasoning": "The patch introduces channel survey time tracking for MT7925/MT7927 Wi-Fi devices. It updates channel state counters by querying the MCU firmware for MIB statistics (via mt7925_mcu_get_chan_mib_info) and reading hardware registers (MT_MIB_SDR37).\n\n1. No kernel-to-user memory info-leaks: All data structures exchanged with user space (via nl80211 survey info) are populated from integer counters; no raw kernel structs or uninitialized buffers are copied to user space (via copy_to_user, put_user, netlink skb attributes, etc.).\n2. Firmware request initialization: The stack-allocated struct `req` sent to the firmware is initialized using a designated initializer (`.hdr.band = band`) and explicit loop assignments, ensuring all fields and reserved bytes are fully initialized to zero without uninitialized padding holes.\n3. Heap data structures: The newly added `state_ts[2]` array in `struct mt792x_phy` is part of the `mt792x_dev` device structure, which is zero-allocated at initialization time with kzalloc.\n4. KASAN vs. KMSAN: Potential risks in this code (such as array indexing on `state_ts[band]`, skb bounds parsing, or NULL pointer dereference if `chan` or `state` is invalid) fall strictly under out-of-bounds and pointer checking, which are comprehensively detected by KASAN. There is no risk of uninitialized memory reads or information leaks requiring KMSAN.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 86d241710ba0fbe23652a922bda0b161fc7faaa1
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Oct 24 07:17:19 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 7af996abe2940..4ec3712fe6147 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1470,6 +1470,48 @@ void mt7925_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
}
EXPORT_SYMBOL_GPL(mt7925_queue_rx_skb);
+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)
+{
+ struct ieee80211_channel *chan = phy->mt76->chandef.chan;
+ struct mt76_channel_state *state = phy->mt76->chan_state;
+ struct mt792x_dev *dev = phy->dev;
+ int i, n_bands = 1, band = 0;
+
+ /* The MT7927 counts 2.4 GHz on band 0 and 5/6 GHz on band 1, and
+ * the band not in use keeps counting, so read both every time and
+ * only add the band the channel is on.
+ */
+ if (is_mt7927(&dev->mt76)) {
+ n_bands = ARRAY_SIZE(phy->state_ts);
+ if (chan)
+ band = mt7927_band_idx(chan->band);
+ }
+
+ for (i = 0; i < n_bands; i++) {
+ bool add = !reset && i == band;
+ u32 bss_rx;
+
+ bss_rx = mt76_get_field(dev, MT_MIB_SDR37(i),
+ MT_MIB_SDR37_RXTIME_MASK);
+ if (add)
+ state->cc_bss_rx += bss_rx;
+
+ mt7925_mcu_get_chan_mib_info(phy, i, add);
+ }
+}
+
+void mt7925_update_channel(struct mt76_phy *mphy)
+{
+ struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76);
+
+ if (mt76_connac_pm_wake(mphy, &dev->pm))
+ return;
+
+ mt7925_mac_update_chan_time(mphy->priv, false);
+ mt76_connac_power_save_sched(mphy, &dev->pm);
+}
+EXPORT_SYMBOL_GPL(mt7925_update_channel);
+
static void
mt7925_vif_connect_iter(void *priv, u8 *mac,
struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 15d95ad326362..16dc974a1122f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -351,6 +351,7 @@ int __mt7925_start(struct mt792x_phy *phy)
return err;
mt792x_mac_reset_counters(phy);
+ mt7925_mac_update_chan_time(phy, true);
set_bit(MT76_STATE_RUNNING, &mphy->state);
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 26cdb3f0a98ae..85006859f0851 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -1019,6 +1019,76 @@ int mt7925_mcu_get_temperature(struct mt792x_phy *phy)
return temperature;
}
+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)
+{
+ enum {
+ IDX_BUSY_TIME,
+ IDX_TX_TIME,
+ IDX_RX_TIME,
+ IDX_NUM
+ };
+ struct {
+ struct {
+ u8 band;
+ u8 __rsv[3];
+ } hdr;
+ struct {
+ __le16 tag;
+ __le16 len;
+ __le32 offs;
+ } data[IDX_NUM];
+ } __packed req = {
+ .hdr.band = band,
+ };
+ static const u32 offs[] = {
+ [IDX_BUSY_TIME] = UNI_MIB_BUSY_TIME,
+ [IDX_TX_TIME] = UNI_MIB_TX_TIME,
+ [IDX_RX_TIME] = UNI_MIB_RX_TIME,
+ };
+ struct mt76_channel_state *state = phy->mt76->chan_state;
+ struct mt76_channel_state *state_ts = &phy->state_ts[band];
+ struct mt792x_dev *dev = phy->dev;
+ struct mt7925_mcu_mib *res;
+ struct sk_buff *skb;
+ int i, ret;
+
+ for (i = 0; i < IDX_NUM; i++) {
+ req.data[i].tag = cpu_to_le16(UNI_CMD_MIB_DATA);
+ req.data[i].len = cpu_to_le16(sizeof(req.data[i]));
+ req.data[i].offs = cpu_to_le32(offs[i]);
+ }
+
+ ret = mt76_mcu_send_and_get_msg(&dev->mt76,
+ MCU_WM_UNI_CMD_QUERY(GET_MIB_INFO),
+ &req, sizeof(req), true, &skb);
+ if (ret)
+ return ret;
+ if (skb->len < sizeof(req.hdr) + IDX_NUM * sizeof(*res)) {
+ dev_kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ skb_pull(skb, sizeof(req.hdr));
+ res = (struct mt7925_mcu_mib *)skb->data;
+
+ if (!add)
+ goto out;
+
+#define __res_u64(s) le64_to_cpu(res[s].data)
+ state->cc_busy += __res_u64(IDX_BUSY_TIME) - state_ts->cc_busy;
+ state->cc_tx += __res_u64(IDX_TX_TIME) - state_ts->cc_tx;
+ state->cc_rx += __res_u64(IDX_RX_TIME) - state_ts->cc_rx;
+out:
+ state_ts->cc_busy = __res_u64(IDX_BUSY_TIME);
+ state_ts->cc_tx = __res_u64(IDX_TX_TIME);
+ state_ts->cc_rx = __res_u64(IDX_RX_TIME);
+#undef __res_u64
+
+ dev_kfree_skb(skb);
+
+ return 0;
+}
+
static void
mt7925_mcu_parse_phy_cap(struct mt792x_dev *dev, char *data)
{
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
index 11f9eac13ffc6..f3e892dbb74c4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
@@ -57,6 +57,23 @@ struct mt7925_mcu_reg_event {
__le32 val;
} __packed;
+enum {
+ UNI_CMD_MIB_DATA,
+};
+
+enum {
+ UNI_MIB_BUSY_TIME = 19,
+ UNI_MIB_RX_TIME = 20,
+ UNI_MIB_TX_TIME = 28,
+};
+
+struct mt7925_mcu_mib {
+ __le16 tag;
+ __le16 len;
+ __le32 offs;
+ __le64 data;
+} __packed;
+
struct mt7925_mcu_ant_id_config {
u8 ant_id[4];
} __packed;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
index 636efe0383925..706e67e8ec423 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
@@ -375,6 +375,9 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,
int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
struct ieee80211_chanctx_conf *ctx);
int mt7925_mcu_get_temperature(struct mt792x_phy *phy);
+int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add);
+void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset);
+void mt7925_update_channel(struct mt76_phy *mphy);
int mt7925_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
enum mt76_txq_id qid, struct mt76_wcid *wcid,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index 0d477dc1086cc..939a46c0428b5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -604,7 +604,7 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
.sta_add = mt7925_mac_sta_add,
.sta_event = mt7925_mac_sta_event,
.sta_remove = mt7925_mac_sta_remove,
- .update_survey = mt792x_update_channel,
+ .update_survey = mt7925_update_channel,
};
static const struct mt792x_hif_ops mt7925_pcie_ops = {
.init_reset = mt7925e_init_reset,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
index f97f787b2198b..2d3bf035fdfc2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
@@ -174,7 +174,7 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
.sta_add = mt7925_mac_sta_add,
.sta_event = mt7925_mac_sta_event,
.sta_remove = mt7925_mac_sta_remove,
- .update_survey = mt792x_update_channel,
+ .update_survey = mt7925_update_channel,
};
static const struct mt792x_hif_ops hif_ops = {
.mcu_init = mt7925u_mcu_init,
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index a7d71e007da04..3ee513258d004 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -221,6 +221,7 @@ struct mt792x_phy {
u32 ampdu_ref;
struct mt76_mib_stats mib;
+ struct mt76_channel_state state_ts[2];
u8 sta_work_count;
u8 clc_chan_conf;
|
| 63/3 | 2026/10/24 07:21 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 5892 output: 41 thoughts: 1057 Thoughts: **KMSAN Analysis of Mediatek mt7925 Wireless Driver Patch**
Alright, let's dive into this patch and assess potential uninitialized memory exposures that KMSAN would flag. My initial focus is the `mt7925` wireless driver modifications.
First, I see the core functions involved are `mt7925_mac_update_chan_time`, `mt7925_update_channel`, and `mt7925_mcu_get_chan_mib_info`. The last one is of immediate interest. `mt7925_mac_update_chan_time` seems to gather channel survey data, reading registers or querying the MCU and updating channel state counters, specifically `state->cc_bss_rx`. `mt7925_update_channel` is the handler for the `.update_survey` callback.
The crux of the matter appears to be in `mt7925_mcu_get_chan_mib_info`. It builds a request struct `req` to send to the MCU. Now, here's where my alarm bells start to go off. I notice the initializer: `= { .hdr.band = band }`. In C, struct initialization like this *should* zero-initialize the rest of the structure. I say "should" because I need to double-check that this is consistent across all compilers and environments. But, if that's the case, then this struct `req` is initialized and then populated in a loop with the `tag`, `len` and `offs` members of the `data` array.
Crucially, this `req` struct is *sent to the MCU*, not user space. The firmware, not the kernel, receives this data. The response is a `skb`, which appears to contain MIB information. The code checks for the validity of the data length. If all checks out, the `skb`'s data is interpreted as a `mt7925_mcu_mib` structure. `__res_u64` then processes the data. The data then updates various channel state statistics like `state->cc_busy`, `state->cc_tx`, and `state->cc_rx`.
So far, it looks relatively safe in that any uninitialized values in `req` are sent to the firmware which may or may not care, but this code doesn't pass the values directly back to userspace, so this part should be ok.
The patch also updates the `pci.c` and `usb.c` files, replacing the survey callback, and adds `state_ts` array to the `struct mt792x_phy`. I need to track down where this `struct mt792x_phy` is allocated and how it's initialized. That will determine whether any uninitialized memory in `state_ts` could potentially leak. I'll need to trace the initialization of `mt792x_phy` structures to determine where potential uninitialized memory might exist. That is the next area for analysis.
|
| 64/3 | 2026/10/24 07:21 | tool | grepper |
0mArgs:{
"Expression": "struct mt792x_phy",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 790 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (22 files in total):\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:2\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:1\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:27\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:9\ndrivers/net/wireless/mediatek/mt76/mt7921/mt7921.h:8\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.c:4\ndrivers/net/wireless/mediatek/mt76/mt7921/regd.h:3\ndrivers/net/wireless/mediatek/mt76/mt7921/testmode.c:2\ndrivers/net/wireless/mediatek/mt76/mt7925/init.c:2\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:2\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:28\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:19\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.h:4\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:13\ndrivers/net/wireless/mediatek/mt76/mt7925/regd.c:5\ndrivers/net/wireless/mediatek/mt76/mt7925/regd.h:3\ndrivers/net/wireless/mediatek/mt76/mt7925/testmode.c:2\ndrivers/net/wireless/mediatek/mt76/mt792x.h:13\ndrivers/net/wireless/mediatek/mt76/mt792x_acpi_sar.c:7\ndrivers/net/wireless/mediatek/mt76/mt792x_core.c:6\ndrivers/net/wireless/mediatek/mt76/mt792x_debugfs.c:2\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:6\n\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c=14=static ssize_t mt7921_thermal_temp_show(struct device *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-19-\tcase 0: {\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:20:\t\tstruct mt792x_phy *phy = dev_get_drvdata(dev);\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-21-\t\tstruct mt792x_dev *mdev = phy-\u003edev;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c=43=ATTRIBUTE_GROUPS(mt7921_hwmon);\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-44-\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c:45:static int mt7921_thermal_init(struct mt792x_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mt7921/init.c-46-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c=169=mt7921_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-177-\tstruct mt76_phy *mphy = \u0026dev-\u003emt76.phy;\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c:178:\tstruct mt792x_phy *phy = \u0026dev-\u003ephy;\ndrivers/net/wireless/mediatek/mt76/mt7921/mac.c-179-\tstruct ieee80211_supported_band *sband;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=13=static int\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:14:mt7921_init_he_caps(struct mt792x_phy *phy, enum nl80211_band band,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-15-\t\t struct ieee80211_sband_iftype_data *data)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-195-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:196:void mt7921_set_stream_he_caps(struct mt792x_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-197-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-226-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:227:int __mt7921_start(struct mt792x_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-228-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=272=static int mt7921_start(struct ieee80211_hw *hw)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-273-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:274:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-275-\tint err;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=301=mt7921_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-304-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:305:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-306-\tstruct mt76_txq *mtxq;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=362=static void mt7921_roc_iter(void *priv, u8 *mac,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-365-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:366:\tstruct mt792x_phy *phy = priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-367-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=371=void mt7921_roc_abort_sync(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-372-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:373:\tstruct mt792x_phy *phy = \u0026dev-\u003ephy;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-374-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=387=void mt7921_roc_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-388-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:389:\tstruct mt792x_phy *phy;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-390-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:391:\tphy = (struct mt792x_phy *)container_of(work, struct mt792x_phy,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-392-\t\t\t\t\t\troc_work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-405-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:406:static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-407-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-420-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:421:static int mt7921_set_roc(struct mt792x_phy *phy,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-422-\t\t\t struct mt792x_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=451=static int mt7921_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-457-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:458:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-459-\tint err;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=468=static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-471-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:472:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-473-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=477=int mt7921_set_channel(struct mt76_phy *mphy)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-478-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:479:\tstruct mt792x_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-480-\tstruct mt792x_dev *dev = phy-\u003edev;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=634=static int mt7921_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-636-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:637:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-638-\tint ret = 0;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=666=static void mt7921_configure_filter(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-671-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:672:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-673-\tu32 flags = MT7921_FILTER_ENABLE;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=693=static void mt7921_bss_info_changed(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-697-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:698:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-699-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=764=mt7921_regd_set_6ghz_power_type(struct ieee80211_vif *vif, bool is_add)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-766-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:767:\tstruct mt792x_phy *phy = mvif-\u003ephy;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-768-\tstruct mt792x_dev *dev = phy-\u003edev;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1018=void mt7921_scan_work(struct work_struct *work)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1019-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1020:\tstruct mt792x_phy *phy;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1021-\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1022:\tphy = (struct mt792x_phy *)container_of(work, struct mt792x_phy,\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1023-\t\t\t\t\t\tscan_work.work);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1122=mt7921_set_antenna(struct ieee80211_hw *hw, int radio_idx,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1125-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1126:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1127-\tint max_nss = hweight8(hw-\u003ewiphy-\u003eavailable_antennas_tx);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1149=static int mt7921_suspend(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1152-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1153:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1154-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1174=static int mt7921_resume(struct ieee80211_hw *hw)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1176-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1177:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1178-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1339=mt7921_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1342-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1343:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1344-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1367=mt7921_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1370-\tstruct mt792x_vif *mvif = (struct mt792x_vif *)vif-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1371:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1372-\tstruct mt792x_dev *dev = mt792x_hw_dev(hw);\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1409=mt7921_change_chanctx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1413-\tstruct mt792x_chanctx *mctx = (struct mt792x_chanctx *)ctx-\u003edrv_priv;\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1414:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1415-\tstruct ieee80211_vif *vif;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c=1552=static void mt7921_rfkill_poll(struct ieee80211_hw *hw)\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1553-{\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c:1554:\tstruct mt792x_phy *phy = mt792x_hw_phy(hw);\ndrivers/net/wireless/mediatek/mt76/mt7921/main.c-1555-\tint ret = 0;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=164=mt7921_mcu_scan_event(struct mt792x_dev *dev, struct sk_buff *skb)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-166-\tstruct mt76_phy *mphy = \u0026dev-\u003emt76.phy;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:167:\tstruct mt792x_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-168-\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=413=static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-418-\tstruct mt76_dev *mdev = \u0026dev-\u003emt76;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:419:\tstruct mt792x_phy *phy = \u0026dev-\u003ephy;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-420-\tconst struct firmware *fw;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=551=static void mt7921_mcu_parse_phy_cap(struct mt76_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-581-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:582:static int mt7921_mcu_get_nic_capability(struct mt792x_phy *mphy)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-583-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=702=int mt7921_mcu_set_tx(struct mt792x_dev *dev, struct ieee80211_vif *vif)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-795-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:796:int mt7921_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-797-\t\t struct ieee80211_channel *chan, int duration,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-862-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:863:int mt7921_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif,\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-864-\t\t\t u8 token_id)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-892-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:893:int mt7921_mcu_set_chan_info(struct mt792x_phy *phy, int cmd)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-894-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c=1434=int mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1436-{\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1437:\tstruct mt792x_phy *phy = (struct mt792x_phy *)\u0026dev-\u003ephy;\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1438-\tint i, ret;\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1458-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1459:int mt7921_mcu_get_temperature(struct mt792x_phy *phy)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1460-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1475-\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1476:int mt7921_mcu_wf_rf_pin_ctrl(struct mt792x_phy *phy, u8 action)\ndrivers/net/wireless/mediatek/mt76/mt7921/mcu.c-1477-{\n\n"
} |
| 65/3 | 2026/10/24 07:21 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14914 output: 63 thoughts: 40 Thoughts: Here's my thought process, distilled: **Finding the Allocation of the Physical Layer** Okay, so I need to trace the allocation of the physical layer object, either the `dev->phy` or the `struct mt792x_phy` instance. My initial instinct is to use `grep` – it's the fastest way to get a handle on where the `mt792x_dev` structure, presumably related to the device itself, is allocated. That should give me the entry point or, at least, point me to related code where the physical layer is likely instantiated. |
| 66/3 | 2026/10/24 07:21 | tool | grepper |
0mArgs:{
"Expression": "alloc.*mt792x_dev|alloc_etherdev|mt76_alloc_device|mt76_alloc_phy",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=518=struct mt76_phy *\ndrivers/net/wireless/mediatek/mt76/mac80211.c:519:mt76_alloc_phy(struct mt76_dev *dev, unsigned int size,\ndrivers/net/wireless/mediatek/mt76/mac80211.c-520-\t const struct ieee80211_ops *ops, u8 band_idx)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-549-}\ndrivers/net/wireless/mediatek/mt76/mac80211.c:550:EXPORT_SYMBOL_GPL(mt76_alloc_phy);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-551-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=669=struct mt76_dev *\ndrivers/net/wireless/mediatek/mt76/mac80211.c:670:mt76_alloc_device(struct device *pdev, unsigned int size,\ndrivers/net/wireless/mediatek/mt76/mac80211.c-671-\t\t const struct ieee80211_ops *ops,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-745-}\ndrivers/net/wireless/mediatek/mt76/mac80211.c:746:EXPORT_SYMBOL_GPL(mt76_alloc_device);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-747-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1309=__mt76_wcid_ptr(struct mt76_dev *dev, u16 idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-1317-\ndrivers/net/wireless/mediatek/mt76/mt76.h:1318:struct mt76_dev *mt76_alloc_device(struct device *pdev, unsigned int size,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1319-\t\t\t\t const struct ieee80211_ops *ops,\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=1328=struct mt76_phy *mt76_alloc_radio_phy(struct mt76_dev *dev, unsigned int size,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1329-\t\t\t\t u8 band_idx);\ndrivers/net/wireless/mediatek/mt76/mt76.h:1330:struct mt76_phy *mt76_alloc_phy(struct mt76_dev *dev, unsigned int size,\ndrivers/net/wireless/mediatek/mt76/mt76.h-1331-\t\t\t\tconst struct ieee80211_ops *ops,\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/pci.c=15=mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/pci.c-34-\ndrivers/net/wireless/mediatek/mt76/mt7603/pci.c:35:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), \u0026mt7603_ops,\ndrivers/net/wireless/mediatek/mt76/mt7603/pci.c-36-\t\t\t\t \u0026mt7603_drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/soc.c=10=mt76_wmac_probe(struct platform_device *pdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/soc.c-25-\ndrivers/net/wireless/mediatek/mt76/mt7603/soc.c:26:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), \u0026mt7603_ops,\ndrivers/net/wireless/mediatek/mt76/mt7603/soc.c-27-\t\t\t\t \u0026mt7603_drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/init.c=527=int mt7615_register_ext_phy(struct mt7615_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/init.c-542-\tmt7615_cap_dbdc_enable(dev);\ndrivers/net/wireless/mediatek/mt76/mt7615/init.c:543:\tmphy = mt76_alloc_phy(\u0026dev-\u003emt76, sizeof(*phy), \u0026mt7615_ops, MT_BAND1);\ndrivers/net/wireless/mediatek/mt76/mt7615/init.c-544-\tif (!mphy) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c=166=int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c-196-\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c:197:\tmdev = mt76_alloc_device(pdev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7615/mmio.c-198-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c=76=static int mt7663s_probe(struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c-111-\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c:112:\tmdev = mt76_alloc_device(\u0026func-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7615/sdio.c-113-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c=119=static int mt7663u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-155-\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c:156:\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7615/usb.c-157-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c=154=mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c-191-\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c:192:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), \u0026mt76x0e_ops,\ndrivers/net/wireless/mediatek/mt76/mt76x0/pci.c-193-\t\t\t\t \u0026drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c=213=static int mt76x0u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c-235-\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c:236:\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), \u0026mt76x0u_ops,\ndrivers/net/wireless/mediatek/mt76/mt76x0/usb.c-237-\t\t\t\t \u0026drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c=20=mt76x2e_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c-55-\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c:56:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), \u0026mt76x2_ops,\ndrivers/net/wireless/mediatek/mt76/mt76x2/pci.c-57-\t\t\t\t \u0026drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c=32=static int mt76x2u_probe(struct usb_interface *intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c-53-\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c:54:\tmdev = mt76_alloc_device(\u0026intf-\u003edev, sizeof(*dev), \u0026mt76x2u_ops,\ndrivers/net/wireless/mediatek/mt76/mt76x2/usb.c-55-\t\t\t\t \u0026drv_ops);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c=710=mt7915_alloc_ext_phy(struct mt7915_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-717-\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c:718:\tmphy = mt76_alloc_phy(\u0026dev-\u003emt76, sizeof(*phy), \u0026mt7915_ops, MT_BAND1);\ndrivers/net/wireless/mediatek/mt76/mt7915/init.c-719-\tif (!mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c=917=struct mt7915_dev *mt7915_mmio_probe(struct device *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-944-\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c:945:\tmdev = mt76_alloc_device(pdev, sizeof(*dev), \u0026mt7915_ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7915/mmio.c-946-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c=259=static int mt7921_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-343-\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c:344:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7921/pci.c-345-\tif (!mdev) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c=90=static int mt7921s_probe(struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-137-\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c:138:\tmdev = mt76_alloc_device(\u0026func-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7921/sdio.c-139-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c=150=static int mt7921u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-197-\tops-\u003estop = mt792xu_stop;\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c:198:\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7921/usb.c-199-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c=27=static u32 mt7925_cal_cache_region_size(void)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-35-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c:36:int mt7925_axidma_alloc(struct mt792x_dev *dev)\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.c-37-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h=125=struct mt7925_fact_cal_req {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-140-\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h:141:int mt7925_axidma_alloc(struct mt792x_dev *dev);\ndrivers/net/wireless/mediatek/mt76/mt7925/cached_cal.h-142-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c=587=static int mt7925_pci_probe(struct pci_dev *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-666-\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c:667:\tmdev = mt76_alloc_device(\u0026pdev-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7925/pci.c-668-\tif (!mdev) {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c=159=static int mt7925u_probe(struct usb_interface *usb_intf,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-206-\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c:207:\tmdev = mt76_alloc_device(\u0026usb_intf-\u003edev, sizeof(*dev), ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7925/usb.c-208-\tif (!mdev)\n--\ndrivers/net/wireless/mediatek/mt76/mt792x.h=522=void mt792x_dma_cleanup(struct mt792x_dev *dev);\ndrivers/net/wireless/mediatek/mt76/mt792x.h:523:int mt792x_dma_alloc_queues(struct mt792x_dev *dev,\ndrivers/net/wireless/mediatek/mt76/mt792x.h-524-\t\t\t const struct mt792x_dma_layout *layout);\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_dma.c=86=EXPORT_SYMBOL_GPL(mt792x_rx_poll_complete);\ndrivers/net/wireless/mediatek/mt76/mt792x_dma.c-87-\ndrivers/net/wireless/mediatek/mt76/mt792x_dma.c:88:int mt792x_dma_alloc_queues(struct mt792x_dev *dev,\ndrivers/net/wireless/mediatek/mt76/mt792x_dma.c-89-\t\t\t const struct mt792x_dma_layout *layout)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c=832=struct mt7996_dev *mt7996_mmio_probe(struct device *pdev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-862-\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c:863:\tmdev = mt76_alloc_device(pdev, sizeof(*dev), \u0026mt7996_ops, \u0026drv_ops);\ndrivers/net/wireless/mediatek/mt76/mt7996/mmio.c-864-\tif (!mdev)\n"
} |
| 67/3 | 2026/10/24 07:21 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19831 output: 49 thoughts: 56 Thoughts: Okay, let's dive into this. I need to figure out if the `mt76_alloc_device` function performs a zero-allocation for memory. That's a crucial detail for memory management and potential security implications, so let's start by looking at its implementation. I'll check the source code for `mt76_alloc_device`. I believe I'll find it in the `drivers/net/wireless/mediatek/mt76/mac80211.c` file. This should give me the answer. |
| 68/3 | 2026/10/24 07:21 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mac80211.c",
"FirstLine": 669,
"LineCount": 40
}Results: {
"Contents": " 669:\tstruct mt76_dev *\n 670:\tmt76_alloc_device(struct device *pdev, unsigned int size,\n 671:\t\t\t const struct ieee80211_ops *ops,\n 672:\t\t\t const struct mt76_driver_ops *drv_ops)\n 673:\t{\n 674:\t\tstruct ieee80211_hw *hw;\n 675:\t\tstruct mt76_phy *phy;\n 676:\t\tstruct mt76_dev *dev;\n 677:\t\tint i;\n 678:\t\n 679:\t\thw = ieee80211_alloc_hw(size, ops);\n 680:\t\tif (!hw)\n 681:\t\t\treturn NULL;\n 682:\t\n 683:\t\tdev = hw-\u003epriv;\n 684:\t\tdev-\u003ehw = hw;\n 685:\t\tdev-\u003edev = pdev;\n 686:\t\tdev-\u003einit_wiphy = NULL;\n 687:\t\tdev-\u003edrv = drv_ops;\n 688:\t\tdev-\u003edma_dev = pdev;\n 689:\t\n 690:\t\tphy = \u0026dev-\u003ephy;\n 691:\t\tphy-\u003edev = dev;\n 692:\t\tphy-\u003ehw = hw;\n 693:\t\tphy-\u003eband_idx = MT_BAND0;\n 694:\t\tdev-\u003ephys[phy-\u003eband_idx] = phy;\n 695:\t\n 696:\t\tspin_lock_init(\u0026dev-\u003erx_lock);\n 697:\t\tspin_lock_init(\u0026dev-\u003elock);\n 698:\t\tspin_lock_init(\u0026dev-\u003ecc_lock);\n 699:\t\tspin_lock_init(\u0026dev-\u003estatus_lock);\n 700:\t\tspin_lock_init(\u0026dev-\u003ewed_lock);\n 701:\t\tmutex_init(\u0026dev-\u003emutex);\n 702:\t\tinit_waitqueue_head(\u0026dev-\u003etx_wait);\n 703:\t\n 704:\t\tskb_queue_head_init(\u0026dev-\u003emcu.res_q);\n 705:\t\tinit_waitqueue_head(\u0026dev-\u003emcu.wait);\n 706:\t\tmutex_init(\u0026dev-\u003emcu.mutex);\n 707:\t\tdev-\u003etx_worker.fn = mt76_tx_worker;\n 708:\t\n"
} |
| 69/3 | 2026/10/24 07:21 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20691 output: 36 thoughts: 567 Thoughts: **Analyzing the Initialization and Usage of `chan_state` in the MT7925 Driver** Okay, so I'm looking at the MT7925 driver code, specifically the `mt7925_mac_update_chan_time` function. My initial thought is to trace the initialization of `struct mt76_channel_state`, which is accessed through `phy->mt76->chan_state`. Recall that `ieee80211_alloc_hw` uses `kzalloc` which will ensure that `hw->priv` is zero-initialized and thus everything pointed to by it. This implies that `dev->phy`, `phy->state_ts`, etc. will also be zero initialized. Now, let's look at this function, `mt7925_mac_update_chan_time`. From the code snippet, it looks like it gets called to update channel time information. I see it references `struct mt76_channel_state *state = phy->mt76->chan_state;`. The code proceeds to use `state->cc_bss_rx` and calls `mt7925_mcu_get_chan_mib_info` which probably also uses `chan_state` or `phy->mt76`. My immediate concern is: what if `chan_state` is NULL? The pointer is dereferenced, so that would be a problem. Did I miss something in the initialization sequence? Is `phy->mt76->chan_state` always guaranteed to be valid and initialized after the hardware allocation? This needs further investigation. I'll need to follow the data path and ensure that the pointer is always initialized properly. |
| 70/3 | 2026/10/24 07:21 | tool | grepper |
0mArgs:{
"Expression": "chan_state",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=395=mt76_check_sband(struct mt76_phy *phy, struct mt76_sband *msband,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-415-\t\t\t\t\tNL80211_CHAN_HT20);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:416:\t\tphy-\u003echan_state = \u0026msband-\u003echan[0];\ndrivers/net/wireless/mediatek/mt76/mac80211.c-417-\t\tphy-\u003edev-\u003eband_phys[band] = phy;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1016=void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time)\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1017-{\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1018:\tstruct mt76_channel_state *state = phy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1019-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1026=void mt76_update_survey(struct mt76_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1037-\tif (dev-\u003edrv-\u003edrv_flags \u0026 MT_DRV_SW_RX_AIRTIME) {\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1038:\t\tstruct mt76_channel_state *state = phy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1039-\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1048=void mt76_phy_chandef_set(struct mt76_phy *phy,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1057-\tphy-\u003emain_chandef = *chandef;\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1058:\tphy-\u003echan_state = mt76_channel_state(phy, chandef-\u003echan);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1059-}\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1062=int __mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1080-\tphy-\u003echandef = *chandef;\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1081:\tphy-\u003echan_state = mt76_channel_state(phy, chandef-\u003echan);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1082-\tphy-\u003eoffchannel = offchannel;\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1087-\tif (chandef-\u003echan != phy-\u003emain_chandef.chan)\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1088:\t\tmemset(phy-\u003echan_state, 0, sizeof(*phy-\u003echan_state));\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1089-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=855=struct mt76_phy {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-890-\ndrivers/net/wireless/mediatek/mt76/mt76.h:891:\tstruct mt76_channel_state *chan_state;\ndrivers/net/wireless/mediatek/mt76/mt76.h-892-\tenum mt76_dfs_state dfs_state;\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=433=void mt7603_mac_sta_poll(struct mt7603_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-506-\tspin_lock_bh(\u0026dev-\u003emt76.cc_lock);\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:507:\tdev-\u003emphy.chan_state-\u003ecc_tx += total_airtime;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-508-\tspin_unlock_bh(\u0026dev-\u003emt76.cc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=1636=void mt7603_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1640-\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:1641:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1642-\tstate-\u003ecc_busy += mt76_rr(dev, MT_MIB_STAT_CCA);\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1896=mt7615_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1918-\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1919:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1920-\tstate-\u003ecc_busy += busy_time;\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c=1043=void mt76x02_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1047-\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c:1048:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1049-\tstate-\u003ecc_busy += mt76_rr(dev, MT_CH_BUSY);\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=1225=void mt7915_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1227-\tstruct mt7915_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:1228:\tstruct mt76_channel_state *state = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1229-\tint nf;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c=3178=int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3179-{\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3180:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3181-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1475-\tstruct ieee80211_channel *chan = phy-\u003emt76-\u003echandef.chan;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1476:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1477-\tstruct mt792x_dev *dev = phy-\u003edev;\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=1022=int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1047-\t};\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1048:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1049-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts[band];\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c=224=mt792x_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-246-\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:247:\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-248-\tstate-\u003ecc_busy += busy_time;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c=2181=void mt7996_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2183-\tstruct mt7996_phy *phy = mphy-\u003epriv;\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c:2184:\tstruct mt76_channel_state *state = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7996/mac.c-2185-\tint nf;\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c=4583=int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4610-\t};\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4611:\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4612-\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts;\n"
} |
| 71/3 | 2026/10/24 07:21 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24864 output: 49 thoughts: 66 Thoughts: Here's my analysis of the provided thought process, summarized as you requested: **Diving into Channel MIB Information Retrieval** Okay, so I need to understand how we're pulling channel MIB information for these two different chipset families, the MT7915 and the MT7996. My immediate thought is to compare the functions responsible for this, namely `mt7915_mcu_get_chan_mib_info` and `mt7996_mcu_get_chan_mib_info`. I'm betting there are significant similarities and differences here. First, let's focus our attention on `mt7915_mcu_get_chan_mib_info`. I need to start by understanding its implementation to gain a baseline. From there, the comparisons to MT7996, and the reasons for its architecture, will make themselves clear. |
| 72/3 | 2026/10/24 07:22 | tool | grepper |
0mArgs:{
"Expression": "mt7915_mcu_get_chan_mib_info",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7915/mac.c=1105=void mt7915_mac_reset_counters(struct mt7915_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1121-\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:1122:\tmt7915_mcu_get_chan_mib_info(phy, true);\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1123-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c=1225=void mt7915_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1230-\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c:1231:\tmt7915_mcu_get_chan_mib_info(phy, false);\ndrivers/net/wireless/mediatek/mt76/mt7915/mac.c-1232-\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c=3126=int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3177-\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3178:int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3179-{\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mt7915.h=538=int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy);\ndrivers/net/wireless/mediatek/mt76/mt7915/mt7915.h:539:int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch);\ndrivers/net/wireless/mediatek/mt76/mt7915/mt7915.h-540-int mt7915_mcu_get_temperature(struct mt7915_phy *phy);\n"
} |
| 73/3 | 2026/10/24 07:22 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25883 output: 52 thoughts: 48 Thoughts: Here's my analysis of the provided thought process, tailored for an expert audience: **Diving into the MT7915 MCU Channel MIB Information Retrieval** Okay, so I'm thinking, let's zero in on this function, `mt7915_mcu_get_chan_mib_info`. The name itself is pretty clear; it's likely responsible for retrieving channel-specific Management Information Base (MIB) data from the MT7915's microcontroller unit (MCU). The location, `drivers/net/wireless/mediatek/mt76/mt7915/mcu.c`, confirms it's within the Mediatek wireless driver framework, and specifically within the MT7915 implementation, which is useful context. I'll need to remember to look for how this function is *called* to understand its place within the driver's channel selection or configuration flow. I also expect this information to be vital for regulatory domain compliance. Given that it's an MCU interaction, I bet there's some sort of message exchange involved. I need to be ready to understand the structure of the messages involved and the format of the channel MIB data to see if it's well-designed for efficient retrieval, and if it's got any room for performance optimizations. |
| 74/3 | 2026/10/24 07:22 | tool | read-file |
0mArgs:{
"File": "drivers/net/wireless/mediatek/mt76/mt7915/mcu.c",
"FirstLine": 3178,
"LineCount": 60
}Results: {
"Contents": "3178:\tint mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)\n3179:\t{\n3180:\t\tstruct mt76_channel_state *state = phy-\u003emt76-\u003echan_state;\n3181:\t\tstruct mt76_channel_state *state_ts = \u0026phy-\u003estate_ts;\n3182:\t\tstruct mt7915_dev *dev = phy-\u003edev;\n3183:\t\tstruct mt7915_mcu_mib *res, req[5];\n3184:\t\tstruct sk_buff *skb;\n3185:\t\tstatic const u32 *offs;\n3186:\t\tint i, ret, len, offs_cc;\n3187:\t\tu64 cc_tx;\n3188:\t\n3189:\t\t/* strict order */\n3190:\t\tif (is_mt7915(\u0026dev-\u003emt76)) {\n3191:\t\t\tstatic const u32 chip_offs[] = {\n3192:\t\t\t\tMIB_NON_WIFI_TIME,\n3193:\t\t\t\tMIB_TX_TIME,\n3194:\t\t\t\tMIB_RX_TIME,\n3195:\t\t\t\tMIB_OBSS_AIRTIME,\n3196:\t\t\t\tMIB_TXOP_INIT_COUNT,\n3197:\t\t\t};\n3198:\t\t\tlen = ARRAY_SIZE(chip_offs);\n3199:\t\t\toffs = chip_offs;\n3200:\t\t\toffs_cc = 20;\n3201:\t\t} else {\n3202:\t\t\tstatic const u32 chip_offs[] = {\n3203:\t\t\t\tMIB_NON_WIFI_TIME_V2,\n3204:\t\t\t\tMIB_TX_TIME_V2,\n3205:\t\t\t\tMIB_RX_TIME_V2,\n3206:\t\t\t\tMIB_OBSS_AIRTIME_V2\n3207:\t\t\t};\n3208:\t\t\tlen = ARRAY_SIZE(chip_offs);\n3209:\t\t\toffs = chip_offs;\n3210:\t\t\toffs_cc = 0;\n3211:\t\t}\n3212:\t\n3213:\t\tfor (i = 0; i \u003c len; i++) {\n3214:\t\t\treq[i].band = cpu_to_le32(phy-\u003emt76-\u003eband_idx);\n3215:\t\t\treq[i].offs = cpu_to_le32(offs[i]);\n3216:\t\t}\n3217:\t\n3218:\t\tret = mt76_mcu_send_and_get_msg(\u0026dev-\u003emt76, MCU_EXT_CMD(GET_MIB_INFO),\n3219:\t\t\t\t\t\treq, len * sizeof(req[0]), true, \u0026skb);\n3220:\t\tif (ret)\n3221:\t\t\treturn ret;\n3222:\t\n3223:\t\tres = (struct mt7915_mcu_mib *)(skb-\u003edata + offs_cc);\n3224:\t\n3225:\t#define __res_u64(s) le64_to_cpu(res[s].data)\n3226:\t\t/* subtract Tx backoff time from Tx duration for MT7915 */\n3227:\t\tif (is_mt7915(\u0026dev-\u003emt76)) {\n3228:\t\t\tu64 backoff = (__res_u64(4) \u0026 0xffff) * 79; /* 16us + 9us * 7 */\n3229:\t\t\tcc_tx = __res_u64(1) - backoff;\n3230:\t\t} else {\n3231:\t\t\tcc_tx = __res_u64(1);\n3232:\t\t}\n3233:\t\n3234:\t\tif (chan_switch)\n3235:\t\t\tgoto out;\n3236:\t\n3237:\t\tstate-\u003ecc_tx += cc_tx - state_ts-\u003ecc_tx;\n"
} |
| 75/3 | 2026/10/24 07:22 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27309 output: 50 thoughts: 1188 Thoughts: **Analyzing the Channel Survey MIB Query in mt7925** Okay, so `mt7915` already had some logic around this, and now `mt7925` is adding similar MIB querying functionality specifically for channel survey updates (`update_survey`). My focus now is on really understanding this `mt7925_mcu_get_chan_mib_info` function. It looks like the function is structured to query the MCU for channel MIB information. I see a `req` struct being built which contains header information, including the band, and a data array. This data array is populated with tags, lengths, and offsets corresponding to the specific MIB items I'm after: busy time, transmit time, and receive time. The `mt76_mcu_send_and_get_msg` function is used to send this request to the MCU and receive a response in a `sk_buff`. There are checks to ensure the received `skb` is large enough to contain the expected data. I then extract the response data, which seems to be of type `mt7925_mcu_mib`. A key part of the function concerns the processing of the MIB data itself. It extracts the returned MIB information and calculates the difference from the previous readings. The results, as 64-bit values, are added to the existing channel state counters (`state->cc_busy`, `state->cc_tx`, `state->cc_rx`). The previous timestamped values (`state_ts->cc_busy`, `state_ts->cc_tx`, `state_ts->cc_rx`) are also updated. The intention seems to be incremental update of survey data. I see the results of this operation are used, so I need to understand that. Now, a quick side-check - what exactly *is* a `struct mt7925_mcu_mib`? It's a structure with a tag, length, offset, and 64-bit data field. Based on the sizes, this should work. Crucially, I need to verify whether there is any direct copy of data to user space. I'm scanning for `copy_to_user`, `put_user`, any direct transfer of uninitialized structs through netlink attributes. Nope, nothing obvious jumps out. The survey data is manipulated internally within the kernel. So, where are the results of these channel surveys actually getting *used*? I need to track down how these `state->cc_busy`, `state->cc_tx`, and `state->cc_rx` values are accessed and presented to the user. My focus now needs to shift to how this channel state information, and specifically the survey data, is used within the mt76 framework, the cfg80211 layer, and ultimately, how it's exposed through nl80211. This is where I'll find how the user ultimately consumes this information. |
| 76/3 | 2026/10/24 07:22 | tool | grepper |
0mArgs:{
"Expression": "cc_busy|cc_tx|cc_rx|cc_bss_rx",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mac80211.c=1026=void mt76_update_survey(struct mt76_phy *phy)\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1040-\t\tspin_lock_bh(\u0026dev-\u003ecc_lock);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1041:\t\tstate-\u003ecc_bss_rx += dev-\u003ecur_cc_bss_rx;\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1042:\t\tdev-\u003ecur_cc_bss_rx = 0;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1043-\t\tspin_unlock_bh(\u0026dev-\u003ecc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1144=int mt76_get_survey(struct ieee80211_hw *hw, int idx,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1193-\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1194:\tsurvey-\u003etime_busy = div_u64(state-\u003ecc_busy, 1000);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1195:\tsurvey-\u003etime_rx = div_u64(state-\u003ecc_rx, 1000);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1196-\tsurvey-\u003etime = div_u64(state-\u003ecc_active, 1000);\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1199-\tspin_lock_bh(\u0026dev-\u003ecc_lock);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1200:\tsurvey-\u003etime_bss_rx = div_u64(state-\u003ecc_bss_rx, 1000);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1201:\tsurvey-\u003etime_tx = div_u64(state-\u003ecc_tx, 1000);\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1202-\tspin_unlock_bh(\u0026dev-\u003ecc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c=1388=mt76_airtime_report(struct mt76_dev *dev, struct mt76_rx_status *status,\n--\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1405-\tspin_lock(\u0026dev-\u003ecc_lock);\ndrivers/net/wireless/mediatek/mt76/mac80211.c:1406:\tdev-\u003ecur_cc_bss_rx += airtime;\ndrivers/net/wireless/mediatek/mt76/mac80211.c-1407-\tspin_unlock(\u0026dev-\u003ecc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=598=struct mt76_channel_state {\ndrivers/net/wireless/mediatek/mt76/mt76.h-599-\tu64 cc_active;\ndrivers/net/wireless/mediatek/mt76/mt76.h:600:\tu64 cc_busy;\ndrivers/net/wireless/mediatek/mt76/mt76.h:601:\tu64 cc_rx;\ndrivers/net/wireless/mediatek/mt76/mt76.h:602:\tu64 cc_bss_rx;\ndrivers/net/wireless/mediatek/mt76/mt76.h:603:\tu64 cc_tx;\ndrivers/net/wireless/mediatek/mt76/mt76.h-604-\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=931=struct mt76_dev {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-941-\ndrivers/net/wireless/mediatek/mt76/mt76.h:942:\tu32 cur_cc_bss_rx;\ndrivers/net/wireless/mediatek/mt76/mt76.h-943-\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=433=void mt7603_mac_sta_poll(struct mt7603_dev *dev)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-506-\tspin_lock_bh(\u0026dev-\u003emt76.cc_lock);\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:507:\tdev-\u003emphy.chan_state-\u003ecc_tx += total_airtime;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-508-\tspin_unlock_bh(\u0026dev-\u003emt76.cc_lock);\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c=1636=void mt7603_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1641-\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c:1642:\tstate-\u003ecc_busy += mt76_rr(dev, MT_MIB_STAT_CCA);\ndrivers/net/wireless/mediatek/mt76/mt7603/mac.c-1643-}\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c=1896=mt7615_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1919-\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1920:\tstate-\u003ecc_busy += busy_time;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1921:\tstate-\u003ecc_tx += tx_time;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1922:\tstate-\u003ecc_rx += rx_time + obss_time;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c:1923:\tstate-\u003ecc_bss_rx += rx_time;\ndrivers/net/wireless/mediatek/mt76/mt7615/mac.c-1924-\tstate-\u003enoise = -(phy-\u003enoise \u003e\u003e 4);\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c=1043=void mt76x02_update_channel(struct mt76_phy *mphy)\n--\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1048-\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c:1049:\tstate-\u003ecc_busy += mt76_rr(dev, MT_CH_BUSY);\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1050-\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1051-\tspin_lock_bh(\u0026dev-\u003emt76.cc_lock);\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c:1052:\tstate-\u003ecc_tx += dev-\u003etx_airtime;\ndrivers/net/wireless/mediatek/mt76/mt76x02_mac.c-1053-\tdev-\u003etx_airtime = 0;\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c=3178=int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3186-\tint i, ret, len, offs_cc;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3187:\tu64 cc_tx;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3188-\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3228-\t\tu64 backoff = (__res_u64(4) \u0026 0xffff) * 79; /* 16us + 9us * 7 */\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3229:\t\tcc_tx = __res_u64(1) - backoff;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3230-\t} else {\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3231:\t\tcc_tx = __res_u64(1);\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3232-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3236-\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3237:\tstate-\u003ecc_tx += cc_tx - state_ts-\u003ecc_tx;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3238:\tstate-\u003ecc_bss_rx += __res_u64(2) - state_ts-\u003ecc_bss_rx;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3239:\tstate-\u003ecc_rx += __res_u64(2) + __res_u64(3) - state_ts-\u003ecc_rx;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3240:\tstate-\u003ecc_busy += __res_u64(0) + cc_tx + __res_u64(2) + __res_u64(3) -\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3241:\t\t\t state_ts-\u003ecc_busy;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3242-\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3243-out:\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3244:\tstate_ts-\u003ecc_tx = cc_tx;\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3245:\tstate_ts-\u003ecc_bss_rx = __res_u64(2);\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3246:\tstate_ts-\u003ecc_rx = __res_u64(2) + __res_u64(3);\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3247:\tstate_ts-\u003ecc_busy = __res_u64(0) + cc_tx + __res_u64(2) + __res_u64(3);\ndrivers/net/wireless/mediatek/mt76/mt7915/mcu.c-3248-#undef __res_u64\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1496-\t\tif (add)\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1497:\t\t\tstate-\u003ecc_bss_rx += bss_rx;\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1498-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=1022=int mt7925_mcu_get_chan_mib_info(struct mt792x_phy *phy, u8 band, bool add)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1077-#define __res_u64(s) le64_to_cpu(res[s].data)\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1078:\tstate-\u003ecc_busy += __res_u64(IDX_BUSY_TIME) - state_ts-\u003ecc_busy;\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1079:\tstate-\u003ecc_tx += __res_u64(IDX_TX_TIME) - state_ts-\u003ecc_tx;\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1080:\tstate-\u003ecc_rx += __res_u64(IDX_RX_TIME) - state_ts-\u003ecc_rx;\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1081-out:\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1082:\tstate_ts-\u003ecc_busy = __res_u64(IDX_BUSY_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1083:\tstate_ts-\u003ecc_tx = __res_u64(IDX_TX_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:1084:\tstate_ts-\u003ecc_rx = __res_u64(IDX_RX_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-1085-#undef __res_u64\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c=224=mt792x_phy_update_channel(struct mt76_phy *mphy, int idx)\n--\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-247-\tstate = mphy-\u003echan_state;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:248:\tstate-\u003ecc_busy += busy_time;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:249:\tstate-\u003ecc_tx += tx_time;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:250:\tstate-\u003ecc_rx += rx_time + obss_time;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c:251:\tstate-\u003ecc_bss_rx += rx_time;\ndrivers/net/wireless/mediatek/mt76/mt792x_mac.c-252-\tstate-\u003enoise = -(phy-\u003enoise \u003e\u003e 4);\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c=4583=int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4636-#define __res_u64(s) le64_to_cpu(res[s].data)\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4637:\tstate-\u003ecc_tx += __res_u64(IDX_TX_TIME) - state_ts-\u003ecc_tx;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4638:\tstate-\u003ecc_bss_rx += __res_u64(IDX_RX_TIME) - state_ts-\u003ecc_bss_rx;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4639:\tstate-\u003ecc_rx += __res_u64(IDX_RX_TIME) +\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4640-\t\t\t__res_u64(IDX_OBSS_AIRTIME) -\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4641:\t\t\tstate_ts-\u003ecc_rx;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4642:\tstate-\u003ecc_busy += __res_u64(IDX_TX_TIME) +\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4643-\t\t\t __res_u64(IDX_RX_TIME) +\n--\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4645-\t\t\t __res_u64(IDX_NON_WIFI_TIME) -\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4646:\t\t\t state_ts-\u003ecc_busy;\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4647-out:\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4648:\tstate_ts-\u003ecc_tx = __res_u64(IDX_TX_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4649:\tstate_ts-\u003ecc_bss_rx = __res_u64(IDX_RX_TIME);\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4650:\tstate_ts-\u003ecc_rx = __res_u64(IDX_RX_TIME) + __res_u64(IDX_OBSS_AIRTIME);\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c:4651:\tstate_ts-\u003ecc_busy = __res_u64(IDX_TX_TIME) +\ndrivers/net/wireless/mediatek/mt76/mt7996/mcu.c-4652-\t\t\t __res_u64(IDX_RX_TIME) +\n"
} |
| 77/3 | 2026/10/24 07:22 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 34271 output: 42 thoughts: 1299 Thoughts: **KMSAN Analysis: MT76 Channel State and MCU Interaction**
Okay, so I'm diving into this `mt76_get_survey` and the surrounding code, trying to see if there are any potential uninitialized memory reads that could lead to information leaks. The basic flow is: we read busy time and other channel metrics (`state->cc_busy` etc.), which are accumulated integers and stored in `state_ts`, and report them via the `survey` struct in a nl80211 survey dump. The `req` struct gets sent to the MCU.
The `req` struct initialization in `mt7925_mcu_get_chan_mib_info` is important. It uses `= { .hdr.band = band }`, which means the entire struct `req` is initialized to zero, including the padding and other members. Then, the `req.data[i]` fields are explicitly initialized in the loop. This `req` is sent to the MCU (firmware) via `mt76_mcu_send_and_get_msg`. The MCU responds with an `skb`.
Now, the crucial part: we check the `skb` length, `skb_pull` the header, and cast the `skb->data` to `mt7925_mcu_mib *`. Then `le64_to_cpu(res[s].data)` is read. The important thing is that `req` is *sent* to the MCU, not userspace. The response, which *is* read by the kernel, is from firmware and is an skb that is properly handled. So no uninitialized `req` data is leaked. No, there aren't any uninitialized variables used in the code. I checked: `i`, `n_bands`, `band` are initialized, and other variables are also initialized.
Also, `state_ts` is a member of `struct mt792x_phy`, which is embedded within `struct mt792x_dev dev->phy`. `dev` is allocated using `ieee80211_alloc_hw`, which internally uses `kzalloc`. This ensures it's zero-initialized. Even if it was an `ext_phy`, the allocation would still use `kzalloc`. `state` itself is `phy->mt76->chan_state`, which is allocated by mac80211, also using `kzalloc`. So, that seems safe.
Now, the potential for padding or struct fields to leak: I'm focusing on the KMSAN criteria. My goal here is not out of bounds, but possible leaks.
* The structures sent to userspace, or related structures, are being filled, not just partially initialized.
* The code doesn't rely on uninitialized values.
* Data structures are initialized completely.
Let's check for NULL pointer issues with `chan`. If `chan` is NULL, that's a kernel crash, not a KMSAN issue. If band is out of bounds for `phy->state_ts[band]`, we need to check `mt7927_band_idx`. Let's see that code...
So, based on this review, I'm pretty confident that this patch *doesn't* introduce any uninitialized memory reads that would trigger a KMSAN warning.
|
| 78/3 | 2026/10/24 07:22 | tool | grepper |
0mArgs:{
"Expression": "mt7927_band_idx",
"PathPrefixes": [
"drivers/net/wireless/mediatek/mt76"
]
}Results: {
"Output": "drivers/net/wireless/mediatek/mt76/mt7925/mac.c=1473=void mt7925_mac_update_chan_time(struct mt792x_phy *phy, bool reset)\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1486-\t\tif (chan)\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c:1487:\t\t\tband = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mac.c-1488-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=379=static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-411-\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:412:\t\tmconf-\u003emt76.band_idx = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-413-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c=2417=static int mt7925_assign_vif_chanctx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2442-\t\tif (is_mt7927(\u0026dev-\u003emt76)) {\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c:2443:\t\t\tband_idx = mt7927_band_idx(ctx-\u003edef.chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/main.c-2444-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=2371=int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2403-\t\tif (chan)\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:2404:\t\t\treq.hdr.band_idx = mt7927_band_idx(chan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2405-\t}\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c=2411=int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2466-\tif (is_mt7927(mphy-\u003edev))\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c:2467:\t\treq.hdr.band_idx = mt7927_band_idx(chandef-\u003echan-\u003eband);\ndrivers/net/wireless/mediatek/mt76/mt7925/mcu.c-2468-\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h=234=struct mt7925_txpwr {\n--\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-267-\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h:268:static inline u8 mt7927_band_idx(enum nl80211_band band)\ndrivers/net/wireless/mediatek/mt76/mt7925/mt7925.h-269-{\n"
} |
| 79/3 | 2026/10/24 07:22 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 37442 output: 369 thoughts: 489 Thoughts: **Analyzing the KMSAN Requirements** Okay, let's break this down. First, regarding `mt7927_band_idx`, the check `return band != NL80211_BAND_2GHZ;` and the `ARRAY_SIZE(phy->state_ts)` being 2, indicates an index of either 0 or 1. Even if there was an out-of-bounds issue, KASAN would catch it. So, that's not a KMSAN concern. Now, let's look at the `req` structure within `mt7925_mcu_get_chan_mib_info`. It's stack-allocated, which is good. I need to make sure there are no padding issues. Examining the structure definition: It's `__packed`, so there shouldn't be any. The `hdr` is 4 bytes and `data` is 24 bytes, for a total of 28 bytes. The structure is initialized, and sent to the MCU, not copied to user space. Therefore, there's no way this patch introduces uninitialized data leaks or any data exposed to user space. No user-visible changes are taking place, or any uninitialized data is present. It does not introduce any complex structures or uninitialized fields exposed to uninitialized reads. Since we are talking about KASAN covering memory corruption risks and no uninitialized data leaks, or any other issues, KMSAN is not needed here. KASAN covers all the bases. So, the requirements are: `NeedsKMSAN: false` and `KMSANReasoning: detailed reasoning contrasting KASAN vs KMSAN applicability`. Everything seems solid. This should be a pretty straightforward tool call. |
| 80/3 | 2026/10/24 07:22 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch introduces channel survey time tracking for MT7925/MT7927 Wi-Fi devices. It updates channel state counters by querying the MCU firmware for MIB statistics (via mt7925_mcu_get_chan_mib_info) and reading hardware registers (MT_MIB_SDR37).\n\n1. No kernel-to-user memory info-leaks: All data structures exchanged with user space (via nl80211 survey info) are populated from integer counters; no raw kernel structs or uninitialized buffers are copied to user space (via copy_to_user, put_user, netlink skb attributes, etc.).\n2. Firmware request initialization: The stack-allocated struct `req` sent to the firmware is initialized using a designated initializer (`.hdr.band = band`) and explicit loop assignments, ensuring all fields and reserved bytes are fully initialized to zero without uninitialized padding holes.\n3. Heap data structures: The newly added `state_ts[2]` array in `struct mt792x_phy` is part of the `mt792x_dev` device structure, which is zero-allocated at initialization time with kzalloc.\n4. KASAN vs. KMSAN: Potential risks in this code (such as array indexing on `state_ts[band]`, skb bounds parsing, or NULL pointer dereference if `chan` or `state` is invalid) fall strictly under out-of-bounds and pointer checking, which are comprehensively detected by KASAN. There is no risk of uninitialized memory reads or information leaks requiring KMSAN.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch introduces channel survey time tracking for MT7925/MT7927 Wi-Fi devices. It updates channel state counters by querying the MCU firmware for MIB statistics (via mt7925_mcu_get_chan_mib_info) and reading hardware registers (MT_MIB_SDR37).\n\n1. No kernel-to-user memory info-leaks: All data structures exchanged with user space (via nl80211 survey info) are populated from integer counters; no raw kernel structs or uninitialized buffers are copied to user space (via copy_to_user, put_user, netlink skb attributes, etc.).\n2. Firmware request initialization: The stack-allocated struct `req` sent to the firmware is initialized using a designated initializer (`.hdr.band = band`) and explicit loop assignments, ensuring all fields and reserved bytes are fully initialized to zero without uninitialized padding holes.\n3. Heap data structures: The newly added `state_ts[2]` array in `struct mt792x_phy` is part of the `mt792x_dev` device structure, which is zero-allocated at initialization time with kzalloc.\n4. KASAN vs. KMSAN: Potential risks in this code (such as array indexing on `state_ts[band]`, skb bounds parsing, or NULL pointer dereference if `chan` or `state` is invalid) fall strictly under out-of-bounds and pointer checking, which are comprehensively detected by KASAN. There is no risk of uninitialized memory reads or information leaks requiring KMSAN.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|