drivers/net/ethernet/mediatek/mtk_wed.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mediatek/mtk_wed.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mediatek/mtk_wed.h- Extension
.h- Size
- 4253 bytes
- Lines
- 227
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/soc/mediatek/mtk_wed.hlinux/debugfs.hlinux/regmap.hlinux/netdevice.hmtk_wed_regs.h
Detected Declarations
struct mtk_ethstruct mtk_wed_wostruct mtk_wed_soc_datastruct mtk_wed_amsdustruct mtk_wed_hwstruct mtk_wdma_infofunction mtk_wed_is_v1function mtk_wed_is_v2function mtk_wed_is_v3function mtk_wed_is_v3_or_greaterfunction wed_w32function wed_r32function wdma_w32function wdma_r32function wpdma_tx_r32function wpdma_tx_w32function wpdma_rx_r32function wpdma_rx_w32function wpdma_txfree_r32function wpdma_txfree_w32function mtk_wed_get_pcie_basefunction mtk_wed_add_hwfunction mtk_wed_flow_removefunction mtk_wed_hw_add_debugfs
Annotated Snippet
struct mtk_wed_soc_data {
struct {
u32 tx_bm_tkid;
u32 wpdma_rx_ring[MTK_WED_RX_QUEUES];
u32 reset_idx_tx_mask;
u32 reset_idx_rx_mask;
} regmap;
u32 tx_ring_desc_size;
u32 wdma_desc_size;
};
struct mtk_wed_amsdu {
void *txd;
dma_addr_t txd_phy;
};
struct mtk_wed_hw {
const struct mtk_wed_soc_data *soc;
struct device_node *node;
struct mtk_eth *eth;
struct regmap *regs;
struct regmap *hifsys;
struct device *dev;
void __iomem *wdma;
phys_addr_t wdma_phy;
struct regmap *mirror;
struct dentry *debugfs_dir;
struct mtk_wed_device *wed_dev;
struct mtk_wed_wo *wed_wo;
struct mtk_wed_amsdu *wed_amsdu;
u32 pcie_base;
u32 debugfs_reg;
u32 num_flows;
u8 version;
char dirname[5];
int irq;
int index;
};
struct mtk_wdma_info {
u8 wdma_idx;
u8 queue;
u16 wcid;
u8 bss;
u8 amsdu;
};
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
static inline bool mtk_wed_is_v1(struct mtk_wed_hw *hw)
{
return hw->version == 1;
}
static inline bool mtk_wed_is_v2(struct mtk_wed_hw *hw)
{
return hw->version == 2;
}
static inline bool mtk_wed_is_v3(struct mtk_wed_hw *hw)
{
return hw->version == 3;
}
static inline bool mtk_wed_is_v3_or_greater(struct mtk_wed_hw *hw)
{
return hw->version > 2;
}
static inline void
wed_w32(struct mtk_wed_device *dev, u32 reg, u32 val)
{
regmap_write(dev->hw->regs, reg, val);
}
static inline u32
wed_r32(struct mtk_wed_device *dev, u32 reg)
{
unsigned int val;
regmap_read(dev->hw->regs, reg, &val);
return val;
}
static inline void
wdma_w32(struct mtk_wed_device *dev, u32 reg, u32 val)
{
writel(val, dev->hw->wdma + reg);
}
Annotation
- Immediate include surface: `linux/soc/mediatek/mtk_wed.h`, `linux/debugfs.h`, `linux/regmap.h`, `linux/netdevice.h`, `mtk_wed_regs.h`.
- Detected declarations: `struct mtk_eth`, `struct mtk_wed_wo`, `struct mtk_wed_soc_data`, `struct mtk_wed_amsdu`, `struct mtk_wed_hw`, `struct mtk_wdma_info`, `function mtk_wed_is_v1`, `function mtk_wed_is_v2`, `function mtk_wed_is_v3`, `function mtk_wed_is_v3_or_greater`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.