#include <linux/hyperv.h>
#include "mlx5_core.h"
#include "lib/hv.h"
#include "lib/hv_vhca.h"
struct mlx5_hv_vhca { … };
struct mlx5_hv_vhca_work { … };
struct mlx5_hv_vhca_data_block { … };
struct mlx5_hv_vhca_agent { … };
struct mlx5_hv_vhca *mlx5_hv_vhca_create(struct mlx5_core_dev *dev)
{ … }
void mlx5_hv_vhca_destroy(struct mlx5_hv_vhca *hv_vhca)
{ … }
static void mlx5_hv_vhca_invalidate_work(struct work_struct *work)
{ … }
void mlx5_hv_vhca_invalidate(void *context, u64 block_mask)
{ … }
#define AGENT_MASK(type) …
static void mlx5_hv_vhca_agents_control(struct mlx5_hv_vhca *hv_vhca,
struct mlx5_hv_vhca_control_block *block)
{ … }
static void mlx5_hv_vhca_capabilities(struct mlx5_hv_vhca *hv_vhca,
u32 *capabilities)
{ … }
static void
mlx5_hv_vhca_control_agent_invalidate(struct mlx5_hv_vhca_agent *agent,
u64 block_mask)
{ … }
static struct mlx5_hv_vhca_agent *
mlx5_hv_vhca_control_agent_create(struct mlx5_hv_vhca *hv_vhca)
{ … }
static void mlx5_hv_vhca_control_agent_destroy(struct mlx5_hv_vhca_agent *agent)
{ … }
int mlx5_hv_vhca_init(struct mlx5_hv_vhca *hv_vhca)
{ … }
void mlx5_hv_vhca_cleanup(struct mlx5_hv_vhca *hv_vhca)
{ … }
static void mlx5_hv_vhca_agents_update(struct mlx5_hv_vhca *hv_vhca)
{ … }
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 (*cleaup)(struct mlx5_hv_vhca_agent *agent),
void *priv)
{ … }
void mlx5_hv_vhca_agent_destroy(struct mlx5_hv_vhca_agent *agent)
{ … }
static int mlx5_hv_vhca_data_block_prepare(struct mlx5_hv_vhca_agent *agent,
struct mlx5_hv_vhca_data_block *data_block,
void *src, int len, int *offset)
{ … }
static void mlx5_hv_vhca_agent_seq_update(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)
{ … }