drivers/net/dsa/b53/b53_common.c
Source file repositories/reference/linux-study-clean/drivers/net/dsa/b53/b53_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/b53/b53_common.c- Extension
.c- Size
- 84037 bytes
- Lines
- 3334
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/export.hlinux/gpio/consumer.hlinux/kernel.hlinux/math.hlinux/minmax.hlinux/module.hlinux/platform_data/b53.hlinux/phy.hlinux/phylink.hlinux/etherdevice.hlinux/if_bridge.hlinux/if_vlan.hnet/dsa.hb53_regs.hb53_priv.h
Detected Declarations
struct b53_mib_descstruct b53_chip_dataenum b53_devlink_resource_idfunction b53_do_vlan_opfunction b53_set_vlan_entryfunction b53_get_vlan_entryfunction b53_set_eap_modefunction b53_set_forwardingfunction b53_enable_vlanfunction b53_set_jumbofunction b53_flush_arlfunction b53_fast_age_portfunction b53_fast_age_vlanfunction b53_imp_vlan_setupfunction b53_port_set_ucast_floodfunction b53_port_set_mcast_floodfunction b53_port_set_learningfunction b53_port_set_isolatedfunction b53_eee_enable_setfunction b53_setup_portfunction b53_enable_portfunction b53_disable_portfunction b53_brcm_hdr_setupfunction b53_enable_cpu_portfunction b53_enable_mibfunction b53_enable_stpfunction b53_default_pvidfunction b53_vlan_port_needs_forced_taggedfunction b53_vlan_port_may_join_untaggedfunction b53_configure_vlanfunction b53_for_each_portfunction b53_switch_reset_gpiofunction b53_switch_resetfunction b53_phy_read16function b53_phy_write16function b53_reset_switchfunction b53_apply_configfunction b53_reset_mibfunction b53_get_mib_sizefunction b53_get_stringsfunction b53_get_ethtool_statsfunction b53_get_ethtool_phy_statsfunction b53_get_sset_countfunction b53_devlink_vlan_table_getfunction b53_setup_devlink_resourcesfunction b53_setupfunction b53_teardownfunction b53_force_link
Annotated Snippet
struct b53_mib_desc {
u8 size;
u8 offset;
const char *name;
};
/* BCM5365 MIB counters */
static const struct b53_mib_desc b53_mibs_65[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "TxExcessiveCollision" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "Pkts1024to1522Octets" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
};
#define B53_MIBS_65_SIZE ARRAY_SIZE(b53_mibs_65)
/* BCM63xx MIB counters */
static const struct b53_mib_desc b53_mibs_63xx[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x0c, "TxQoSPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "TxExcessiveCollision" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x3c, "TxQoSOctets" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "Pkts1024to1522Octets" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
{ 4, 0xa0, "RxSymbolErrors" },
{ 4, 0xa4, "RxQoSPkts" },
{ 8, 0xa8, "RxQoSOctets" },
{ 4, 0xb0, "Pkts1523to2047Octets" },
{ 4, 0xb4, "Pkts2048to4095Octets" },
{ 4, 0xb8, "Pkts4096to8191Octets" },
{ 4, 0xbc, "Pkts8192to9728Octets" },
{ 4, 0xc0, "RxDiscarded" },
};
Annotation
- Immediate include surface: `linux/delay.h`, `linux/export.h`, `linux/gpio/consumer.h`, `linux/kernel.h`, `linux/math.h`, `linux/minmax.h`, `linux/module.h`, `linux/platform_data/b53.h`.
- Detected declarations: `struct b53_mib_desc`, `struct b53_chip_data`, `enum b53_devlink_resource_id`, `function b53_do_vlan_op`, `function b53_set_vlan_entry`, `function b53_get_vlan_entry`, `function b53_set_eap_mode`, `function b53_set_forwarding`, `function b53_enable_vlan`, `function b53_set_jumbo`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.