drivers/net/wireless/mediatek/mt76/mt7925/init.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7925/init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7925/init.c- Extension
.c- Size
- 7335 bytes
- Lines
- 294
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/thermal.hlinux/firmware.hmt7925.hregd.hmac.hmcu.h
Detected Declarations
function mt7925_thermal_temp_showfunction mt7925_thermal_initfunction mt7925_mac_init_basic_ratesfunction mt7925_mac_initfunction __mt7925_init_hardwarefunction mt7925_init_hardwarefunction mt7925_init_workfunction mt7925_register_deviceexport mt7925_mac_initexport mt7925_register_device
Annotated Snippet
if (ret) {
dev_warn(dev->mt76.dev,
"MT7927 DBDC enable failed: %d\n", ret);
ret = 0;
}
}
out:
return ret;
}
static int mt7925_init_hardware(struct mt792x_dev *dev)
{
int ret, i;
set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
for (i = 0; i < MT792x_MCU_INIT_RETRY_COUNT; i++) {
ret = __mt7925_init_hardware(dev);
if (!ret)
break;
mt792x_init_reset(dev);
}
if (i == MT792x_MCU_INIT_RETRY_COUNT) {
dev_err(dev->mt76.dev, "hardware init failed\n");
return ret;
}
return 0;
}
static void mt7925_init_work(struct work_struct *work)
{
struct mt792x_dev *dev = container_of(work, struct mt792x_dev,
init_work);
int ret;
ret = mt7925_init_hardware(dev);
if (ret)
return;
mt76_set_stream_caps(&dev->mphy, true);
mt7925_set_stream_he_eht_caps(&dev->phy);
mt792x_config_mac_addr_list(dev);
ret = mt7925_init_mlo_caps(&dev->phy);
if (ret) {
dev_err(dev->mt76.dev, "MLO init failed\n");
return;
}
ret = mt76_register_device(&dev->mt76, true, mt76_rates,
ARRAY_SIZE(mt76_rates));
if (ret) {
dev_err(dev->mt76.dev, "register device failed\n");
return;
}
ret = mt7925_init_debugfs(dev);
if (ret) {
dev_err(dev->mt76.dev, "register debugfs failed\n");
return;
}
ret = mt7925_thermal_init(&dev->phy);
if (ret) {
dev_err(dev->mt76.dev, "thermal init failed\n");
return;
}
ret = mt7925_mcu_set_thermal_protect(dev);
if (ret) {
dev_err(dev->mt76.dev, "thermal protection enable failed\n");
return;
}
/* we support chip reset now */
dev->hw_init_done = true;
mt7925_mcu_set_deep_sleep(dev, dev->pm.ds_enable);
}
int mt7925_register_device(struct mt792x_dev *dev)
{
struct ieee80211_hw *hw = mt76_hw(dev);
int ret;
dev->phy.dev = dev;
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/thermal.h`, `linux/firmware.h`, `mt7925.h`, `regd.h`, `mac.h`.
- Detected declarations: `function mt7925_thermal_temp_show`, `function mt7925_thermal_init`, `function mt7925_mac_init_basic_rates`, `function mt7925_mac_init`, `function __mt7925_init_hardware`, `function mt7925_init_hardware`, `function mt7925_init_work`, `function mt7925_register_device`, `export mt7925_mac_init`, `export mt7925_register_device`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.