drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h- Extension
.h- Size
- 7314 bytes
- Lines
- 278
- 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.hlinux/etherdevice.hlinux/rtnetlink.hlinux/if_vlan.huapi/linux/if_bridge.hnet/switchdev.hlinux/if_bridge.hlinux/fsl/mc.hnet/pkt_cls.hsoc/fsl/dpaa2-io.hdpaa2-mac.hdpsw.h
Detected Declarations
struct ethsw_corestruct dpaa2_switch_fqstruct dpaa2_switch_fdbstruct dpaa2_switch_acl_entrystruct dpaa2_switch_mirror_entrystruct dpaa2_switch_filter_blockstruct ethsw_port_privstruct ethsw_corefunction dpaa2_switch_acl_tbl_is_fullfunction dpaa2_switch_get_indexfunction dpaa2_switch_supports_cpu_trafficfunction dpaa2_switch_port_is_type_phyfunction dpaa2_switch_port_has_mac
Annotated Snippet
struct dpaa2_switch_fq {
struct ethsw_core *ethsw;
enum dpsw_queue_type type;
struct dpaa2_io_store *store;
struct dpaa2_io_notification_ctx nctx;
struct napi_struct napi;
u32 fqid;
};
struct dpaa2_switch_fdb {
struct net_device *bridge_dev;
u16 fdb_id;
bool in_use;
};
struct dpaa2_switch_acl_entry {
struct list_head list;
u16 prio;
unsigned long cookie;
struct dpsw_acl_entry_cfg cfg;
struct dpsw_acl_key key;
};
struct dpaa2_switch_mirror_entry {
struct list_head list;
struct dpsw_reflection_cfg cfg;
unsigned long cookie;
u16 if_id;
};
struct dpaa2_switch_filter_block {
struct ethsw_core *ethsw;
u64 ports;
bool in_use;
struct list_head acl_entries;
u16 acl_id;
u8 num_acl_rules;
struct list_head mirror_entries;
};
static inline bool
dpaa2_switch_acl_tbl_is_full(struct dpaa2_switch_filter_block *filter_block)
{
if ((filter_block->num_acl_rules + DPAA2_ETHSW_PORT_DEFAULT_TRAPS) >=
DPAA2_ETHSW_PORT_MAX_ACL_ENTRIES)
return true;
return false;
}
/* Per port private data */
struct ethsw_port_priv {
struct net_device *netdev;
u16 idx;
struct ethsw_core *ethsw_data;
u8 link_state;
u8 stp_state;
u8 vlans[VLAN_VID_MASK + 1];
u16 pvid;
u16 tx_qdid;
struct dpaa2_switch_fdb *fdb;
bool bcast_flood;
bool ucast_flood;
bool learn_ena;
struct dpaa2_switch_filter_block *filter_block;
struct dpaa2_mac *mac;
/* Protects against changes to port_priv->mac */
struct mutex mac_lock;
};
/* Switch data */
struct ethsw_core {
struct device *dev;
struct fsl_mc_io *mc_io;
u16 dpsw_handle;
struct dpsw_attr sw_attr;
u16 major, minor;
unsigned long features;
int dev_id;
struct ethsw_port_priv **ports;
struct iommu_domain *iommu_domain;
u8 vlans[VLAN_VID_MASK + 1];
struct workqueue_struct *workqueue;
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/etherdevice.h`, `linux/rtnetlink.h`, `linux/if_vlan.h`, `uapi/linux/if_bridge.h`, `net/switchdev.h`, `linux/if_bridge.h`, `linux/fsl/mc.h`.
- Detected declarations: `struct ethsw_core`, `struct dpaa2_switch_fq`, `struct dpaa2_switch_fdb`, `struct dpaa2_switch_acl_entry`, `struct dpaa2_switch_mirror_entry`, `struct dpaa2_switch_filter_block`, `struct ethsw_port_priv`, `struct ethsw_core`, `function dpaa2_switch_acl_tbl_is_full`, `function dpaa2_switch_get_index`.
- 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.