drivers/net/ethernet/marvell/prestera/prestera_hw.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/prestera/prestera_hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/prestera/prestera_hw.c- Extension
.c- Size
- 63497 bytes
- Lines
- 2553
- 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.
- 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/etherdevice.hlinux/if_bridge.hlinux/ethtool.hlinux/list.hprestera.hprestera_hw.hprestera_acl.hprestera_counter.hprestera_router_hw.h
Detected Declarations
struct prestera_fw_event_handlerstruct prestera_msg_cmdstruct prestera_msg_retstruct prestera_msg_common_reqstruct prestera_msg_common_respstruct prestera_msg_switch_attr_reqstruct prestera_msg_switch_init_respstruct prestera_msg_event_port_paramstruct prestera_msg_port_cap_paramstruct prestera_msg_port_flood_paramstruct prestera_msg_port_attr_reqstruct prestera_msg_port_attr_respstruct prestera_msg_port_stats_respstruct prestera_msg_port_info_reqstruct prestera_msg_port_info_respstruct prestera_msg_vlan_reqstruct prestera_msg_fdb_reqstruct prestera_msg_bridge_reqstruct prestera_msg_bridge_respstruct prestera_msg_vtcam_create_reqstruct prestera_msg_vtcam_destroy_reqstruct prestera_msg_vtcam_rule_del_reqstruct prestera_msg_vtcam_bind_reqstruct prestera_msg_vtcam_respstruct prestera_msg_acl_actionstruct prestera_msg_vtcam_rule_add_reqstruct prestera_msg_counter_reqstruct prestera_msg_counter_statsstruct prestera_msg_counter_respstruct prestera_msg_span_reqstruct prestera_msg_span_respstruct prestera_msg_stp_reqstruct prestera_msg_rxtx_reqstruct prestera_msg_rxtx_respstruct prestera_msg_ifacestruct prestera_msg_ip_addrstruct prestera_msg_nhstruct prestera_msg_rif_reqstruct prestera_msg_rif_respstruct prestera_msg_lpm_reqstruct prestera_msg_nh_reqstruct prestera_msg_nh_chunk_reqstruct prestera_msg_nh_chunk_respstruct prestera_msg_nh_grp_reqstruct prestera_msg_nh_grp_respstruct prestera_msg_vr_reqstruct prestera_msg_vr_respstruct prestera_msg_lag_req
Annotated Snippet
struct prestera_fw_event_handler {
struct list_head list;
struct rcu_head rcu;
enum prestera_event_type type;
prestera_event_cb_t func;
void *arg;
};
enum {
PRESTERA_HW_FLOOD_DOMAIN_PORT_TYPE_REG_PORT = 0,
PRESTERA_HW_FLOOD_DOMAIN_PORT_TYPE_LAG = 1,
PRESTERA_HW_FLOOD_DOMAIN_PORT_TYPE_MAX = 2,
};
struct prestera_msg_cmd {
__le32 type;
};
struct prestera_msg_ret {
struct prestera_msg_cmd cmd;
__le32 status;
};
struct prestera_msg_common_req {
struct prestera_msg_cmd cmd;
};
struct prestera_msg_common_resp {
struct prestera_msg_ret ret;
};
struct prestera_msg_switch_attr_req {
struct prestera_msg_cmd cmd;
__le32 attr;
union {
__le32 ageing_timeout_ms;
struct {
u8 mac[ETH_ALEN];
u8 __pad[2];
};
} param;
};
struct prestera_msg_switch_init_resp {
struct prestera_msg_ret ret;
__le32 port_count;
__le32 mtu_max;
__le32 size_tbl_router_nexthop;
u8 switch_id;
u8 lag_max;
u8 lag_member_max;
};
struct prestera_msg_event_port_param {
union {
struct {
__le32 mode;
__le32 speed;
u8 oper;
u8 duplex;
u8 fc;
u8 fec;
} mac;
struct {
__le64 lmode_bmap;
u8 mdix;
u8 fc;
u8 __pad[2];
} __packed phy; /* make sure always 12 bytes size */
};
};
struct prestera_msg_port_cap_param {
__le64 link_mode;
u8 type;
u8 fec;
u8 fc;
u8 transceiver;
};
struct prestera_msg_port_flood_param {
u8 type;
u8 enable;
u8 __pad[2];
};
union prestera_msg_port_param {
__le32 mtu;
__le32 speed;
__le32 link_mode;
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/if_bridge.h`, `linux/ethtool.h`, `linux/list.h`, `prestera.h`, `prestera_hw.h`, `prestera_acl.h`, `prestera_counter.h`.
- Detected declarations: `struct prestera_fw_event_handler`, `struct prestera_msg_cmd`, `struct prestera_msg_ret`, `struct prestera_msg_common_req`, `struct prestera_msg_common_resp`, `struct prestera_msg_switch_attr_req`, `struct prestera_msg_switch_init_resp`, `struct prestera_msg_event_port_param`, `struct prestera_msg_port_cap_param`, `struct prestera_msg_port_flood_param`.
- 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.