drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
Extension
.h
Size
20174 bytes
Lines
634
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 bnx2x_sriov {
	u32 first_vf_in_pf;

	/* standard SRIOV capability fields, mostly for debugging */
	int pos;		/* capability position */
	int nres;		/* number of resources */
	u32 cap;		/* SR-IOV Capabilities */
	u16 ctrl;		/* SR-IOV Control */
	u16 total;		/* total VFs associated with the PF */
	u16 initial;		/* initial VFs associated with the PF */
	u16 nr_virtfn;		/* number of VFs available */
	u16 offset;		/* first VF Routing ID offset */
	u16 stride;		/* following VF stride */
	u32 pgsz;		/* page size for BAR alignment */
	u8 link;		/* Function Dependency Link */
};

/* bars */
struct bnx2x_vf_bar {
	u64 bar;
	u32 size;
};

struct bnx2x_vf_bar_info {
	struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS];
	u8 nr_bars;
};

/* vf queue (used both for rx or tx) */
struct bnx2x_vf_queue {
	struct eth_context		*cxt;

	/* MACs object */
	struct bnx2x_vlan_mac_obj	mac_obj;

	/* VLANs object */
	struct bnx2x_vlan_mac_obj	vlan_obj;

	/* VLAN-MACs object */
	struct bnx2x_vlan_mac_obj	vlan_mac_obj;

	unsigned long accept_flags;	/* last accept flags configured */

	/* Queue Slow-path State object */
	struct bnx2x_queue_sp_obj	sp_obj;

	u32 cid;
	u16 index;
	u16 sb_idx;
	bool is_leading;
	bool sp_initialized;
};

/* struct bnx2x_vf_queue_construct_params - prepare queue construction
 * parameters: q-init, q-setup and SB index
 */
struct bnx2x_vf_queue_construct_params {
	struct bnx2x_queue_state_params		qstate;
	struct bnx2x_queue_setup_params		prep_qsetup;
};

/* forward */
struct bnx2x_virtf;

/* VFOP definitions */

struct bnx2x_vf_mac_vlan_filter {
	int type;
#define BNX2X_VF_FILTER_MAC	BIT(0)
#define BNX2X_VF_FILTER_VLAN	BIT(1)
#define BNX2X_VF_FILTER_VLAN_MAC \
	(BNX2X_VF_FILTER_MAC | BNX2X_VF_FILTER_VLAN) /*shortcut*/

	bool add;
	bool applied;
	u8 *mac;
	u16 vid;
};

struct bnx2x_vf_mac_vlan_filters {
	int count;
	struct bnx2x_vf_mac_vlan_filter filters[];
};

/* vf context */
struct bnx2x_virtf {
	u16 cfg_flags;
#define VF_CFG_STATS_COALESCE	0x1
#define VF_CFG_EXT_BULLETIN	0x2
#define VF_CFG_VLAN_FILTER	0x4

Annotation

Implementation Notes