drivers/net/ethernet/broadcom/bgmac.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bgmac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bgmac.c- Extension
.c- Size
- 43503 bytes
- Lines
- 1630
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bcma/bcma.hlinux/etherdevice.hlinux/interrupt.hlinux/bcm47xx_nvram.hlinux/phy.hlinux/phy_fixed.hnet/dsa.hbgmac.h
Detected Declarations
struct bgmac_statfunction bgmac_dma_tx_resetfunction bgmac_dma_tx_enablefunction bgmac_dma_tx_add_buffunction bgmac_dma_tx_addfunction bgmac_dma_tx_freefunction bgmac_dma_rx_resetfunction bgmac_dma_rx_enablefunction bgmac_dma_rx_skb_for_slotfunction bgmac_dma_rx_update_indexfunction bgmac_dma_rx_setup_descfunction bgmac_dma_rx_poison_buffunction bgmac_dma_rx_readfunction bgmac_dma_unalignedfunction bgmac_dma_tx_ring_freefunction bgmac_dma_rx_ring_freefunction bgmac_dma_ring_desc_freefunction bgmac_dma_cleanupfunction bgmac_dma_freefunction bgmac_dma_allocfunction bgmac_dma_initfunction bgmac_umac_cmd_masksetfunction bgmac_write_mac_addressfunction bgmac_set_rx_modefunction bgmac_chip_stats_updatefunction bgmac_clear_mibfunction bgmac_mac_speedfunction bgmac_miiconfigfunction bgmac_chip_reset_idm_configfunction bgmac_chip_resetfunction bgmac_chip_intrs_onfunction bgmac_chip_intrs_offfunction bgmac_enablefunction bgmac_chip_initfunction bgmac_interruptfunction bgmac_pollfunction bgmac_openfunction bgmac_stopfunction bgmac_start_xmitfunction bgmac_set_mac_addressfunction bgmac_change_mtufunction bgmac_get_sset_countfunction bgmac_get_stringsfunction bgmac_get_ethtool_statsfunction bgmac_get_drvinfofunction bgmac_adjust_linkfunction bgmac_phy_connect_directfunction bgmac_enet_probe
Annotated Snippet
static const struct net_device_ops bgmac_netdev_ops = {
.ndo_open = bgmac_open,
.ndo_stop = bgmac_stop,
.ndo_start_xmit = bgmac_start_xmit,
.ndo_set_rx_mode = bgmac_set_rx_mode,
.ndo_set_mac_address = bgmac_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_eth_ioctl = phy_do_ioctl_running,
.ndo_change_mtu = bgmac_change_mtu,
};
/**************************************************
* ethtool_ops
**************************************************/
struct bgmac_stat {
u8 size;
u32 offset;
const char *name;
};
static struct bgmac_stat bgmac_get_strings_stats[] = {
{ 8, BGMAC_TX_GOOD_OCTETS, "tx_good_octets" },
{ 4, BGMAC_TX_GOOD_PKTS, "tx_good" },
{ 8, BGMAC_TX_OCTETS, "tx_octets" },
{ 4, BGMAC_TX_PKTS, "tx_pkts" },
{ 4, BGMAC_TX_BROADCAST_PKTS, "tx_broadcast" },
{ 4, BGMAC_TX_MULTICAST_PKTS, "tx_multicast" },
{ 4, BGMAC_TX_LEN_64, "tx_64" },
{ 4, BGMAC_TX_LEN_65_TO_127, "tx_65_127" },
{ 4, BGMAC_TX_LEN_128_TO_255, "tx_128_255" },
{ 4, BGMAC_TX_LEN_256_TO_511, "tx_256_511" },
{ 4, BGMAC_TX_LEN_512_TO_1023, "tx_512_1023" },
{ 4, BGMAC_TX_LEN_1024_TO_1522, "tx_1024_1522" },
{ 4, BGMAC_TX_LEN_1523_TO_2047, "tx_1523_2047" },
{ 4, BGMAC_TX_LEN_2048_TO_4095, "tx_2048_4095" },
{ 4, BGMAC_TX_LEN_4096_TO_8191, "tx_4096_8191" },
{ 4, BGMAC_TX_LEN_8192_TO_MAX, "tx_8192_max" },
{ 4, BGMAC_TX_JABBER_PKTS, "tx_jabber" },
{ 4, BGMAC_TX_OVERSIZE_PKTS, "tx_oversize" },
{ 4, BGMAC_TX_FRAGMENT_PKTS, "tx_fragment" },
{ 4, BGMAC_TX_UNDERRUNS, "tx_underruns" },
{ 4, BGMAC_TX_TOTAL_COLS, "tx_total_cols" },
{ 4, BGMAC_TX_SINGLE_COLS, "tx_single_cols" },
{ 4, BGMAC_TX_MULTIPLE_COLS, "tx_multiple_cols" },
{ 4, BGMAC_TX_EXCESSIVE_COLS, "tx_excessive_cols" },
{ 4, BGMAC_TX_LATE_COLS, "tx_late_cols" },
{ 4, BGMAC_TX_DEFERED, "tx_defered" },
{ 4, BGMAC_TX_CARRIER_LOST, "tx_carrier_lost" },
{ 4, BGMAC_TX_PAUSE_PKTS, "tx_pause" },
{ 4, BGMAC_TX_UNI_PKTS, "tx_unicast" },
{ 4, BGMAC_TX_Q0_PKTS, "tx_q0" },
{ 8, BGMAC_TX_Q0_OCTETS, "tx_q0_octets" },
{ 4, BGMAC_TX_Q1_PKTS, "tx_q1" },
{ 8, BGMAC_TX_Q1_OCTETS, "tx_q1_octets" },
{ 4, BGMAC_TX_Q2_PKTS, "tx_q2" },
{ 8, BGMAC_TX_Q2_OCTETS, "tx_q2_octets" },
{ 4, BGMAC_TX_Q3_PKTS, "tx_q3" },
{ 8, BGMAC_TX_Q3_OCTETS, "tx_q3_octets" },
{ 8, BGMAC_RX_GOOD_OCTETS, "rx_good_octets" },
{ 4, BGMAC_RX_GOOD_PKTS, "rx_good" },
{ 8, BGMAC_RX_OCTETS, "rx_octets" },
{ 4, BGMAC_RX_PKTS, "rx_pkts" },
{ 4, BGMAC_RX_BROADCAST_PKTS, "rx_broadcast" },
{ 4, BGMAC_RX_MULTICAST_PKTS, "rx_multicast" },
{ 4, BGMAC_RX_LEN_64, "rx_64" },
{ 4, BGMAC_RX_LEN_65_TO_127, "rx_65_127" },
{ 4, BGMAC_RX_LEN_128_TO_255, "rx_128_255" },
{ 4, BGMAC_RX_LEN_256_TO_511, "rx_256_511" },
{ 4, BGMAC_RX_LEN_512_TO_1023, "rx_512_1023" },
{ 4, BGMAC_RX_LEN_1024_TO_1522, "rx_1024_1522" },
{ 4, BGMAC_RX_LEN_1523_TO_2047, "rx_1523_2047" },
{ 4, BGMAC_RX_LEN_2048_TO_4095, "rx_2048_4095" },
{ 4, BGMAC_RX_LEN_4096_TO_8191, "rx_4096_8191" },
{ 4, BGMAC_RX_LEN_8192_TO_MAX, "rx_8192_max" },
{ 4, BGMAC_RX_JABBER_PKTS, "rx_jabber" },
{ 4, BGMAC_RX_OVERSIZE_PKTS, "rx_oversize" },
{ 4, BGMAC_RX_FRAGMENT_PKTS, "rx_fragment" },
{ 4, BGMAC_RX_MISSED_PKTS, "rx_missed" },
{ 4, BGMAC_RX_CRC_ALIGN_ERRS, "rx_crc_align" },
{ 4, BGMAC_RX_UNDERSIZE, "rx_undersize" },
{ 4, BGMAC_RX_CRC_ERRS, "rx_crc" },
{ 4, BGMAC_RX_ALIGN_ERRS, "rx_align" },
{ 4, BGMAC_RX_SYMBOL_ERRS, "rx_symbol" },
{ 4, BGMAC_RX_PAUSE_PKTS, "rx_pause" },
{ 4, BGMAC_RX_NONPAUSE_PKTS, "rx_nonpause" },
{ 4, BGMAC_RX_SACHANGES, "rx_sa_changes" },
{ 4, BGMAC_RX_UNI_PKTS, "rx_unicast" },
};
Annotation
- Immediate include surface: `linux/bcma/bcma.h`, `linux/etherdevice.h`, `linux/interrupt.h`, `linux/bcm47xx_nvram.h`, `linux/phy.h`, `linux/phy_fixed.h`, `net/dsa.h`, `bgmac.h`.
- Detected declarations: `struct bgmac_stat`, `function bgmac_dma_tx_reset`, `function bgmac_dma_tx_enable`, `function bgmac_dma_tx_add_buf`, `function bgmac_dma_tx_add`, `function bgmac_dma_tx_free`, `function bgmac_dma_rx_reset`, `function bgmac_dma_rx_enable`, `function bgmac_dma_rx_skb_for_slot`, `function bgmac_dma_rx_update_index`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.