drivers/net/wireless/mediatek/mt76/mt7615/usb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7615/usb.c- Extension
.c- Size
- 7032 bytes
- Lines
- 284
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/kernel.hlinux/module.hlinux/usb.hmt7615.hmac.hmcu.hregs.h
Detected Declarations
function mt7663u_rrfunction mt7663u_wrfunction mt7663u_rmwfunction mt7663u_copyfunction mt7663u_stopfunction mt7663u_cleanupfunction mt7663u_init_workfunction mt7663u_probefunction mt7663u_disconnectfunction mt7663u_suspendfunction mt7663u_resume
Annotated Snippet
mt7615_firmware_offload(dev)) {
int err;
err = mt76_connac_mcu_set_hif_suspend(&dev->mt76, true, true);
if (err < 0)
return err;
}
mt76u_stop_rx(&dev->mt76);
mt76u_stop_tx(&dev->mt76);
return 0;
}
static int mt7663u_resume(struct usb_interface *intf)
{
struct mt7615_dev *dev = usb_get_intfdata(intf);
int err;
err = mt76u_vendor_request(&dev->mt76, MT_VEND_FEATURE_SET,
USB_DIR_OUT | USB_TYPE_VENDOR,
0x5, 0x0, NULL, 0);
if (err)
return err;
err = mt76u_resume_rx(&dev->mt76);
if (err < 0)
return err;
if (!test_bit(MT76_STATE_SUSPEND, &dev->mphy.state) &&
mt7615_firmware_offload(dev))
err = mt76_connac_mcu_set_hif_suspend(&dev->mt76, false, true);
return err;
}
#endif /* CONFIG_PM */
MODULE_DEVICE_TABLE(usb, mt7615_device_table);
MODULE_FIRMWARE(MT7663_OFFLOAD_FIRMWARE_N9);
MODULE_FIRMWARE(MT7663_OFFLOAD_ROM_PATCH);
MODULE_FIRMWARE(MT7663_FIRMWARE_N9);
MODULE_FIRMWARE(MT7663_ROM_PATCH);
static struct usb_driver mt7663u_driver = {
.name = KBUILD_MODNAME,
.id_table = mt7615_device_table,
.probe = mt7663u_probe,
.disconnect = mt7663u_disconnect,
#ifdef CONFIG_PM
.suspend = mt7663u_suspend,
.resume = mt7663u_resume,
.reset_resume = mt7663u_resume,
#endif /* CONFIG_PM */
.soft_unbind = 1,
.disable_hub_initiated_lpm = 1,
};
module_usb_driver(mt7663u_driver);
MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
MODULE_AUTHOR("Lorenzo Bianconi <lorenzo@kernel.org>");
MODULE_DESCRIPTION("MediaTek MT7663U (USB) wireless driver");
MODULE_LICENSE("Dual BSD/GPL");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/usb.h`, `mt7615.h`, `mac.h`, `mcu.h`, `regs.h`.
- Detected declarations: `function mt7663u_rr`, `function mt7663u_wr`, `function mt7663u_rmw`, `function mt7663u_copy`, `function mt7663u_stop`, `function mt7663u_cleanup`, `function mt7663u_init_work`, `function mt7663u_probe`, `function mt7663u_disconnect`, `function mt7663u_suspend`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.