drivers/net/ethernet/broadcom/bgmac.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bgmac.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bgmac.h- Extension
.h- Size
- 20625 bytes
- Lines
- 593
- 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/netdevice.hunimac.h
Detected Declarations
struct bgmac_slot_infostruct bgmac_dma_descstruct bgmac_dma_ringstruct bgmac_rx_headerstruct bgmacenum bgmac_dma_ring_typefunction bgmac_readfunction bgmac_writefunction bgmac_umac_readfunction bgmac_umac_writefunction bgmac_idm_readfunction bgmac_idm_writefunction bgmac_clk_enabledfunction bgmac_clk_enablefunction bgmac_cco_ctl_masksetfunction bgmac_get_bus_clockfunction bgmac_cmn_maskset32function bgmac_masksetfunction bgmac_maskfunction bgmac_setfunction bgmac_umac_masksetfunction bgmac_phy_connect
Annotated Snippet
struct bgmac_slot_info {
union {
struct sk_buff *skb;
void *buf;
};
dma_addr_t dma_addr;
};
struct bgmac_dma_desc {
__le32 ctl0;
__le32 ctl1;
__le32 addr_low;
__le32 addr_high;
} __packed;
enum bgmac_dma_ring_type {
BGMAC_DMA_RING_TX,
BGMAC_DMA_RING_RX,
};
/**
* bgmac_dma_ring - contains info about DMA ring (either TX or RX one)
* @start: index of the first slot containing data
* @end: index of a slot that can *not* be read (yet)
*
* Be really aware of the specific @end meaning. It's an index of a slot *after*
* the one containing data that can be read. If @start equals @end the ring is
* empty.
*/
struct bgmac_dma_ring {
u32 start;
u32 end;
struct bgmac_dma_desc *cpu_base;
dma_addr_t dma_base;
u32 index_base; /* Used for unaligned rings only, otherwise 0 */
u16 mmio_base;
bool unaligned;
struct bgmac_slot_info slots[BGMAC_RX_RING_SLOTS];
};
struct bgmac_rx_header {
__le16 len;
__le16 flags;
__le16 pad[12];
};
struct bgmac {
union {
struct {
void __iomem *base;
void __iomem *idm_base;
void __iomem *nicpm_base;
} plat;
struct {
struct bcma_device *core;
/* Reference to CMN core for BCM4706 */
struct bcma_device *cmn;
} bcma;
};
struct device *dev;
struct device *dma_dev;
u32 feature_flags;
struct net_device *net_dev;
struct napi_struct napi;
struct mii_bus *mii_bus;
/* DMA */
struct bgmac_dma_ring tx_ring[BGMAC_MAX_TX_RINGS];
struct bgmac_dma_ring rx_ring[BGMAC_MAX_RX_RINGS];
/* Stats */
bool stats_grabbed;
u32 mib_tx_regs[BGMAC_NUM_MIB_TX_REGS];
u32 mib_rx_regs[BGMAC_NUM_MIB_RX_REGS];
/* Int */
int irq;
u32 int_mask;
bool in_init;
/* Current MAC state */
int mac_speed;
int mac_duplex;
u8 phyaddr;
Annotation
- Immediate include surface: `linux/netdevice.h`, `unimac.h`.
- Detected declarations: `struct bgmac_slot_info`, `struct bgmac_dma_desc`, `struct bgmac_dma_ring`, `struct bgmac_rx_header`, `struct bgmac`, `enum bgmac_dma_ring_type`, `function bgmac_read`, `function bgmac_write`, `function bgmac_umac_read`, `function bgmac_umac_write`.
- 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.