drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h
Extension
.h
Size
2498 bytes
Lines
98
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 mlx5_hv_vhca_control_block {
	u32     capabilities;
	u32     control;
	u16     command;
	u16     command_ack;
	u16     version;
	u16     rings;
	u32     reserved1[28];
};

struct mlx5_hv_vhca *mlx5_hv_vhca_create(struct mlx5_core_dev *dev);
void mlx5_hv_vhca_destroy(struct mlx5_hv_vhca *hv_vhca);
int mlx5_hv_vhca_init(struct mlx5_hv_vhca *hv_vhca);
void mlx5_hv_vhca_cleanup(struct mlx5_hv_vhca *hv_vhca);
void mlx5_hv_vhca_invalidate(void *context, u64 block_mask);

struct mlx5_hv_vhca_agent *
mlx5_hv_vhca_agent_create(struct mlx5_hv_vhca *hv_vhca,
			  enum mlx5_hv_vhca_agent_type type,
			  void (*control)(struct mlx5_hv_vhca_agent*,
					  struct mlx5_hv_vhca_control_block *block),
			  void (*invalidate)(struct mlx5_hv_vhca_agent*,
					     u64 block_mask),
			  void (*cleanup)(struct mlx5_hv_vhca_agent *agent),
			  void *context);

void mlx5_hv_vhca_agent_destroy(struct mlx5_hv_vhca_agent *agent);
int mlx5_hv_vhca_agent_write(struct mlx5_hv_vhca_agent *agent,
			     void *buf, int len);
void *mlx5_hv_vhca_agent_priv(struct mlx5_hv_vhca_agent *agent);

#else

static inline struct mlx5_hv_vhca *
mlx5_hv_vhca_create(struct mlx5_core_dev *dev)
{
	return NULL;
}

static inline void mlx5_hv_vhca_destroy(struct mlx5_hv_vhca *hv_vhca)
{
}

static inline int mlx5_hv_vhca_init(struct mlx5_hv_vhca *hv_vhca)
{
	return 0;
}

static inline void mlx5_hv_vhca_cleanup(struct mlx5_hv_vhca *hv_vhca)
{
}

static inline void mlx5_hv_vhca_invalidate(void *context,
					   u64 block_mask)
{
}

static inline struct mlx5_hv_vhca_agent *
mlx5_hv_vhca_agent_create(struct mlx5_hv_vhca *hv_vhca,
			  enum mlx5_hv_vhca_agent_type type,
			  void (*control)(struct mlx5_hv_vhca_agent*,
					  struct mlx5_hv_vhca_control_block *block),
			  void (*invalidate)(struct mlx5_hv_vhca_agent*,
					     u64 block_mask),
			  void (*cleanup)(struct mlx5_hv_vhca_agent *agent),
			  void *context)
{
	return NULL;
}

static inline void mlx5_hv_vhca_agent_destroy(struct mlx5_hv_vhca_agent *agent)
{
}
#endif

#endif /* __LIB_HV_VHCA_H__ */

Annotation

Implementation Notes