drivers/net/ethernet/mellanox/mlxsw/spectrum.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/spectrum.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
Extension
.h
Size
52056 bytes
Lines
1498
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mlxsw_sp_port_mapping {
	u8 module;
	u8 slot_index;
	u8 width; /* Number of lanes used by the port */
	u8 module_width; /* Number of lanes in the module (static) */
	u8 lane;
};

struct mlxsw_sp_port_mapping_events {
	struct list_head queue;
	spinlock_t queue_lock; /* protects queue */
	struct work_struct work;
};

struct mlxsw_sp_parsing {
	refcount_t parsing_depth_ref;
	u16 parsing_depth;
	u16 vxlan_udp_dport;
	struct mutex lock; /* Protects parsing configuration */
};

struct mlxsw_sp {
	struct mlxsw_sp_port **ports;
	struct mlxsw_core *core;
	const struct mlxsw_bus_info *bus_info;
	unsigned char base_mac[ETH_ALEN];
	const unsigned char *mac_mask;
	struct mlxsw_sp_lag *lags;
	u16 max_lag;
	struct mlxsw_sp_port_mapping *port_mapping;
	struct mlxsw_sp_port_mapping_events port_mapping_events;
	struct rhashtable sample_trigger_ht;
	struct mlxsw_sp_sb *sb;
	struct mlxsw_sp_bridge *bridge;
	struct mlxsw_sp_router *router;
	struct mlxsw_sp_mr *mr;
	struct mlxsw_afa *afa;
	struct mlxsw_sp_acl *acl;
	struct mlxsw_sp_fid_core *fid_core;
	struct mlxsw_sp_policer_core *policer_core;
	struct mlxsw_sp_port_range_core *pr_core;
	struct mlxsw_sp_kvdl *kvdl;
	struct mlxsw_sp_nve *nve;
	struct notifier_block netdevice_nb;
	struct mlxsw_sp_ptp_clock *clock;
	struct mlxsw_sp_ptp_state *ptp_state;
	struct mlxsw_sp_counter_pool *counter_pool;
	struct mlxsw_sp_span *span;
	struct mlxsw_sp_trap *trap;
	struct mlxsw_sp_parsing parsing;
	const struct mlxsw_sp_switchdev_ops *switchdev_ops;
	const struct mlxsw_sp_kvdl_ops *kvdl_ops;
	const struct mlxsw_afa_ops *afa_ops;
	const struct mlxsw_afk_ops *afk_ops;
	const struct mlxsw_sp_mr_tcam_ops *mr_tcam_ops;
	const struct mlxsw_sp_acl_rulei_ops *acl_rulei_ops;
	const struct mlxsw_sp_acl_tcam_ops *acl_tcam_ops;
	const struct mlxsw_sp_acl_bf_ops *acl_bf_ops;
	const struct mlxsw_sp_nve_ops **nve_ops_arr;
	const struct mlxsw_sp_sb_vals *sb_vals;
	const struct mlxsw_sp_sb_ops *sb_ops;
	const struct mlxsw_sp_port_type_speed_ops *port_type_speed_ops;
	const struct mlxsw_sp_ptp_ops *ptp_ops;
	const struct mlxsw_sp_span_ops *span_ops;
	const struct mlxsw_sp_policer_core_ops *policer_core_ops;
	const struct mlxsw_sp_trap_ops *trap_ops;
	const struct mlxsw_sp_mall_ops *mall_ops;
	const struct mlxsw_sp_router_ops *router_ops;
	const struct mlxsw_listener *listeners;
	const struct mlxsw_sp_fid_core_ops *fid_core_ops;
	size_t listeners_count;
	u32 lowest_shaper_bs;
	struct rhashtable ipv6_addr_ht;
	struct mutex ipv6_addr_ht_lock; /* Protects ipv6_addr_ht */
	struct mlxsw_sp_pgt *pgt;
	bool pgt_smpe_index_valid;
	u16 lag_pgt_base;
};

struct mlxsw_sp_ptp_ops {
	struct mlxsw_sp_ptp_clock *
		(*clock_init)(struct mlxsw_sp *mlxsw_sp, struct device *dev);
	void (*clock_fini)(struct mlxsw_sp_ptp_clock *clock);

	struct mlxsw_sp_ptp_state *(*init)(struct mlxsw_sp *mlxsw_sp);
	void (*fini)(struct mlxsw_sp_ptp_state *ptp_state);

	/* Notify a driver that a packet that might be PTP was received. Driver
	 * is responsible for freeing the passed-in SKB.
	 */

Annotation

Implementation Notes