drivers/net/dsa/bcm_sf2.h
Source file repositories/reference/linux-study-clean/drivers/net/dsa/bcm_sf2.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/bcm_sf2.h- Extension
.h- Size
- 6193 bytes
- Lines
- 238
- 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/platform_device.hlinux/kernel.hlinux/io.hlinux/spinlock.hlinux/mutex.hlinux/mii.hlinux/ethtool.hlinux/types.hlinux/bitops.hlinux/if_vlan.hlinux/reset.hnet/dsa.hbcm_sf2_regs.hb53/b53_priv.h
Detected Declarations
struct bcm_sf2_hw_paramsstruct bcm_sf2_port_statusstruct bcm_sf2_cfp_privstruct bcm_sf2_privfunction bcm_sf2_mangle_addrfunction core_readlfunction core_writelfunction reg_readlfunction reg_writelfunction reg_led_readlfunction reg_led_writel
Annotated Snippet
struct bcm_sf2_hw_params {
u16 top_rev;
u16 core_rev;
u16 gphy_rev;
u32 num_gphy;
u8 num_acb_queue;
u8 num_rgmii;
u8 num_ports;
u8 fcb_pause_override:1;
u8 acb_packets_inflight:1;
};
#define BCM_SF2_REGS_NAME {\
"core", "reg", "intrl2_0", "intrl2_1", "fcb", "acb" \
}
#define BCM_SF2_REGS_NUM 6
struct bcm_sf2_port_status {
phy_interface_t mode;
unsigned int link;
bool enabled;
};
struct bcm_sf2_cfp_priv {
/* Mutex protecting concurrent accesses to the CFP registers */
struct mutex lock;
DECLARE_BITMAP(used, CFP_NUM_RULES);
DECLARE_BITMAP(unique, CFP_NUM_RULES);
unsigned int rules_cnt;
struct list_head rules_list;
};
struct bcm_sf2_priv {
/* Base registers, keep those in order with BCM_SF2_REGS_NAME */
void __iomem *core;
void __iomem *reg;
void __iomem *intrl2_0;
void __iomem *intrl2_1;
void __iomem *fcb;
void __iomem *acb;
struct reset_control *rcdev;
/* Register offsets indirection tables */
u32 type;
const u16 *reg_offsets;
unsigned int core_reg_align;
unsigned int num_cfp_rules;
unsigned int num_crossbar_int_ports;
unsigned int num_crossbar_ext_bits;
/* spinlock protecting access to the indirect registers */
spinlock_t indir_lock;
int irq0;
int irq1;
u32 irq0_stat;
u32 irq0_mask;
u32 irq1_stat;
u32 irq1_mask;
/* Backing b53_device */
struct b53_device *dev;
struct bcm_sf2_hw_params hw_params;
struct bcm_sf2_port_status port_sts[DSA_MAX_PORTS];
/* Mask of ports enabled for Wake-on-LAN */
u32 wol_ports_mask;
struct clk *clk;
struct clk *clk_mdiv;
/* MoCA port location */
int moca_port;
/* Bitmask of ports having an integrated PHY */
unsigned int int_phy_mask;
/* Master and slave MDIO bus controller */
unsigned int indir_phy_mask;
struct mii_bus *user_mii_bus;
struct mii_bus *master_mii_bus;
/* Bitmask of ports needing BRCM tags */
unsigned int brcm_tag_mask;
/* CFP rules context */
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/kernel.h`, `linux/io.h`, `linux/spinlock.h`, `linux/mutex.h`, `linux/mii.h`, `linux/ethtool.h`, `linux/types.h`.
- Detected declarations: `struct bcm_sf2_hw_params`, `struct bcm_sf2_port_status`, `struct bcm_sf2_cfp_priv`, `struct bcm_sf2_priv`, `function bcm_sf2_mangle_addr`, `function core_readl`, `function core_writel`, `function reg_readl`, `function reg_writel`, `function reg_led_readl`.
- 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.