drivers/net/wireless/mediatek/mt76/mt792x_mac.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt792x_mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt792x_mac.c- Extension
.c- Size
- 11009 bytes
- Lines
- 385
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hmt792x.hmt792x_regs.h
Detected Declarations
function mt792x_mac_workfunction mt792x_mac_set_timeingfunction mt792x_mac_update_mib_statsfunction mt792x_mac_rssi_iterfunction mt792x_mac_assoc_rssifunction mt792x_mac_reset_countersfunction mt792x_phy_get_nffunction mt792x_phy_update_channelfunction mt792x_update_channelfunction mt792x_resetfunction mt792x_mac_init_bandfunction mt792x_pm_wake_workfunction mt792x_pm_power_save_workexport mt792x_mac_workexport mt792x_mac_set_timeingexport mt792x_mac_update_mib_statsexport mt792x_rx_get_wcidexport mt792x_mac_assoc_rssiexport mt792x_mac_reset_countersexport mt792x_update_channelexport mt792x_resetexport mt792x_mac_init_bandexport mt792x_pm_wake_workexport mt792x_pm_power_save_work
Annotated Snippet
if (mt76_is_sdio(mdev)) {
mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
mt76_worker_schedule(&mdev->sdio.txrx_worker);
} else {
local_bh_disable();
mt76_for_each_q_rx(mdev, i)
napi_schedule(&mdev->napi[i]);
local_bh_enable();
mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
mt76_connac_tx_cleanup(mdev);
}
if (test_bit(MT76_STATE_RUNNING, &mphy->state))
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
MT792x_WATCHDOG_TIME);
}
ieee80211_wake_queues(mphy->hw);
wake_up(&dev->pm.wait);
}
EXPORT_SYMBOL_GPL(mt792x_pm_wake_work);
void mt792x_pm_power_save_work(struct work_struct *work)
{
struct mt792x_dev *dev;
unsigned long delta;
struct mt76_phy *mphy;
dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev,
pm.ps_work.work);
mphy = dev->phy.mt76;
delta = dev->pm.idle_timeout;
if (test_bit(MT76_HW_SCANNING, &mphy->state) ||
test_bit(MT76_HW_SCHED_SCANNING, &mphy->state) ||
dev->fw_assert)
goto out;
if (mutex_is_locked(&dev->mt76.mutex))
/* if mt76 mutex is held we should not put the device
* to sleep since we are currently accessing device
* register map. We need to wait for the next power_save
* trigger.
*/
goto out;
if (time_is_after_jiffies(dev->pm.last_activity + delta)) {
delta = dev->pm.last_activity + delta - jiffies;
goto out;
}
if (!mt792x_mcu_fw_pmctrl(dev)) {
cancel_delayed_work(&mphy->mac_work);
return;
}
out:
queue_delayed_work(dev->mt76.wq, &dev->pm.ps_work, delta);
}
EXPORT_SYMBOL_GPL(mt792x_pm_power_save_work);
Annotation
- Immediate include surface: `linux/module.h`, `mt792x.h`, `mt792x_regs.h`.
- Detected declarations: `function mt792x_mac_work`, `function mt792x_mac_set_timeing`, `function mt792x_mac_update_mib_stats`, `function mt792x_mac_rssi_iter`, `function mt792x_mac_assoc_rssi`, `function mt792x_mac_reset_counters`, `function mt792x_phy_get_nf`, `function mt792x_phy_update_channel`, `function mt792x_update_channel`, `function mt792x_reset`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
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.