drivers/net/dsa/mxl862xx/mxl862xx-api.h

Source file repositories/reference/linux-study-clean/drivers/net/dsa/mxl862xx/mxl862xx-api.h

File Facts

System
Linux kernel
Corpus path
drivers/net/dsa/mxl862xx/mxl862xx-api.h
Extension
.h
Size
62378 bytes
Lines
1585
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 mdio_relay_data {
	__le16 data;
	u8 phy;
	u8 mmd;
	__le16 reg;
} __packed;

/**
 * struct mxl862xx_register_mod - Register access parameter to directly
 *                                modify internal registers
 * @addr: Register address offset for modification
 * @data: Value to write to the register address
 * @mask: Mask of bits to be modified (1 to modify, 0 to ignore)
 *
 * Used for direct register modification operations.
 */
struct mxl862xx_register_mod {
	__le16 addr;
	__le16 data;
	__le16 mask;
} __packed;

/**
 * enum mxl862xx_mac_table_filter - Source/Destination MAC address filtering
 *
 * @MXL862XX_MAC_FILTER_NONE: no filter
 * @MXL862XX_MAC_FILTER_SRC: source address filter
 * @MXL862XX_MAC_FILTER_DEST: destination address filter
 * @MXL862XX_MAC_FILTER_BOTH: both source and destination filter
 */
enum mxl862xx_mac_table_filter {
	MXL862XX_MAC_FILTER_NONE = 0,
	MXL862XX_MAC_FILTER_SRC = BIT(0),
	MXL862XX_MAC_FILTER_DEST = BIT(1),
	MXL862XX_MAC_FILTER_BOTH = BIT(0) | BIT(1),
};

#define MXL862XX_TCI_VLAN_ID		GENMASK(11, 0)
#define MXL862XX_TCI_VLAN_CFI_DEI	BIT(12)
#define MXL862XX_TCI_VLAN_PRI		GENMASK(15, 13)

/* Set in port_id to use port_map[] as a portmap bitmap instead of a single
 * port ID. When clear, port_id selects one port; when set, the firmware
 * ignores the lower bits of port_id and writes port_map[] directly into
 * the PCE bridge port map.
 */
#define MXL862XX_PORTMAP_FLAG		BIT(31)

/**
 * struct mxl862xx_mac_table_add - MAC Table Entry to be added
 * @fid: Filtering Identifier (FID) (not supported by all switches)
 * @port_id: Ethernet Port number
 * @port_map: Bridge Port Map
 * @sub_if_id: Sub-Interface Identifier Destination
 * @age_timer: Aging Time in seconds
 * @vlan_id: STAG VLAN Id
 * @static_entry: Static Entry (value will be aged out if not set to static)
 * @traffic_class: Egress queue traffic class
 * @mac: MAC Address to add to the table
 * @filter_flag: See &enum mxl862xx_mac_table_filter
 * @igmp_controlled: Packet is marked as IGMP controlled if destination MAC
 *                   address matches MAC in this entry
 * @associated_mac: Associated Mac address
 * @tci: TCI for B-Step
 *	Bit [0:11] - VLAN ID
 *	Bit [12] - VLAN CFI/DEI
 *	Bit [13:15] - VLAN PRI
 */
struct mxl862xx_mac_table_add {
	__le16 fid;
	__le32 port_id;
	__le16 port_map[8];
	__le16 sub_if_id;
	__le32 age_timer;
	__le16 vlan_id;
	u8 static_entry;
	u8 traffic_class;
	u8 mac[ETH_ALEN];
	u8 filter_flag;
	u8 igmp_controlled;
	u8 associated_mac[ETH_ALEN];
	__le16 tci;
} __packed;

/**
 * struct mxl862xx_mac_table_remove - MAC Table Entry to be removed
 * @fid: Filtering Identifier (FID)
 * @mac: MAC Address to be removed from the table.
 * @filter_flag: See &enum mxl862xx_mac_table_filter
 * @tci: TCI for B-Step

Annotation

Implementation Notes