linux/drivers/vdpa/solidrun/snet_vdpa.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * SolidRun DPU driver for control plane
 *
 * Copyright (C) 2022-2023 SolidRun
 *
 * Author: Alvaro Karsz <[email protected]>
 *
 */
#ifndef _SNET_VDPA_H_
#define _SNET_VDPA_H_

#include <linux/vdpa.h>
#include <linux/pci.h>

#define SNET_NAME_SIZE

#define SNET_ERR(pdev, fmt, ...)
#define SNET_WARN(pdev, fmt, ...)
#define SNET_INFO(pdev, fmt, ...)
#define SNET_DBG(pdev, fmt, ...)
#define SNET_HAS_FEATURE(s, f)
/* Check if negotiated config version is at least @ver */
#define SNET_CFG_VER(snet, ver)

/* VQ struct */
struct snet_vq {};

struct snet {};

struct snet_dev_cfg {} __packed;

struct snet_cfg {} __packed;

/* SolidNET PCIe device, one device per PCIe physical function */
struct psnet {};

enum snet_cfg_flags {};

#define PSNET_FLAG_ON(p, f)

static inline u32 psnet_read32(struct psnet *psnet, u32 off)
{}

static inline u32 snet_read32(struct snet *snet, u32 off)
{}

static inline void snet_write32(struct snet *snet, u32 off, u32 val)
{}

static inline u64 psnet_read64(struct psnet *psnet, u32 off)
{}

static inline void snet_write64(struct snet *snet, u32 off, u64 val)
{}

#if IS_ENABLED(CONFIG_HWMON)
void psnet_create_hwmon(struct pci_dev *pdev);
#endif

void snet_ctrl_clear(struct snet *snet);
int snet_destroy_dev(struct snet *snet);
int snet_read_vq_state(struct snet *snet, u16 idx, struct vdpa_vq_state *state);
int snet_suspend_dev(struct snet *snet);
int snet_resume_dev(struct snet *snet);

#endif //_SNET_VDPA_H_