#include <linux/mlx5/vport.h>
#include <linux/list.h>
#include "lib/devcom.h"
#include "mlx5_core.h"
static LIST_HEAD(devcom_dev_list);
static LIST_HEAD(devcom_comp_list);
static DEFINE_MUTEX(dev_list_lock);
static DEFINE_MUTEX(comp_list_lock);
#define devcom_for_each_component(iter) …
struct mlx5_devcom_dev { … };
struct mlx5_devcom_comp { … };
struct mlx5_devcom_comp_dev { … };
static bool devcom_dev_exists(struct mlx5_core_dev *dev)
{ … }
static struct mlx5_devcom_dev *
mlx5_devcom_dev_alloc(struct mlx5_core_dev *dev)
{ … }
struct mlx5_devcom_dev *
mlx5_devcom_register_device(struct mlx5_core_dev *dev)
{ … }
static void
mlx5_devcom_dev_release(struct kref *ref)
{ … }
void mlx5_devcom_unregister_device(struct mlx5_devcom_dev *devc)
{ … }
static struct mlx5_devcom_comp *
mlx5_devcom_comp_alloc(u64 id, u64 key, mlx5_devcom_event_handler_t handler)
{ … }
static void
mlx5_devcom_comp_release(struct kref *ref)
{ … }
static struct mlx5_devcom_comp_dev *
devcom_alloc_comp_dev(struct mlx5_devcom_dev *devc,
struct mlx5_devcom_comp *comp,
void *data)
{ … }
static void
devcom_free_comp_dev(struct mlx5_devcom_comp_dev *devcom)
{ … }
static bool
devcom_component_equal(struct mlx5_devcom_comp *devcom,
enum mlx5_devcom_component id,
u64 key)
{ … }
static struct mlx5_devcom_comp *
devcom_component_get(struct mlx5_devcom_dev *devc,
enum mlx5_devcom_component id,
u64 key,
mlx5_devcom_event_handler_t handler)
{ … }
struct mlx5_devcom_comp_dev *
mlx5_devcom_register_component(struct mlx5_devcom_dev *devc,
enum mlx5_devcom_component id,
u64 key,
mlx5_devcom_event_handler_t handler,
void *data)
{ … }
void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom)
{ … }
int mlx5_devcom_comp_get_size(struct mlx5_devcom_comp_dev *devcom)
{ … }
int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom,
int event, int rollback_event,
void *event_data)
{ … }
void mlx5_devcom_comp_set_ready(struct mlx5_devcom_comp_dev *devcom, bool ready)
{ … }
bool mlx5_devcom_comp_is_ready(struct mlx5_devcom_comp_dev *devcom)
{ … }
bool mlx5_devcom_for_each_peer_begin(struct mlx5_devcom_comp_dev *devcom)
{ … }
void mlx5_devcom_for_each_peer_end(struct mlx5_devcom_comp_dev *devcom)
{ … }
void *mlx5_devcom_get_next_peer_data(struct mlx5_devcom_comp_dev *devcom,
struct mlx5_devcom_comp_dev **pos)
{ … }
void *mlx5_devcom_get_next_peer_data_rcu(struct mlx5_devcom_comp_dev *devcom,
struct mlx5_devcom_comp_dev **pos)
{ … }
void mlx5_devcom_comp_lock(struct mlx5_devcom_comp_dev *devcom)
{ … }
void mlx5_devcom_comp_unlock(struct mlx5_devcom_comp_dev *devcom)
{ … }
int mlx5_devcom_comp_trylock(struct mlx5_devcom_comp_dev *devcom)
{ … }