linux/drivers/vdpa/solidrun/snet_main.c

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

#include "snet_vdpa.h"

/* SNET DPU device ID */
#define SNET_DEVICE_ID
/* SNET signature */
#define SNET_SIGNATURE
/* Max. config version that we can work with */
#define SNET_CFG_VERSION
/* Queue align */
#define SNET_QUEUE_ALIGNMENT
/* Kick value to notify that new data is available */
#define SNET_KICK_VAL
#define SNET_CONFIG_OFF
/* How long we are willing to wait for a SNET device */
#define SNET_DETECT_TIMEOUT
/* How long should we wait for the DPU to read our config */
#define SNET_READ_CFG_TIMEOUT
/* Size of configs written to the DPU */
#define SNET_GENERAL_CFG_LEN
#define SNET_GENERAL_CFG_VQ_LEN

static struct snet *vdpa_to_snet(struct vdpa_device *vdpa)
{}

static irqreturn_t snet_cfg_irq_hndlr(int irq, void *data)
{}

static irqreturn_t snet_vq_irq_hndlr(int irq, void *data)
{}

static void snet_free_irqs(struct snet *snet)
{}

static int snet_set_vq_address(struct vdpa_device *vdev, u16 idx, u64 desc_area,
			       u64 driver_area, u64 device_area)
{}

static void snet_set_vq_num(struct vdpa_device *vdev, u16 idx, u32 num)
{}

static void snet_kick_vq(struct vdpa_device *vdev, u16 idx)
{}

static void snet_kick_vq_with_data(struct vdpa_device *vdev, u32 data)
{}

static void snet_set_vq_cb(struct vdpa_device *vdev, u16 idx, struct vdpa_callback *cb)
{}

static void snet_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready)
{}

static bool snet_get_vq_ready(struct vdpa_device *vdev, u16 idx)
{}

static bool snet_vq_state_is_initial(struct snet *snet, const struct vdpa_vq_state *state)
{}

static int snet_set_vq_state(struct vdpa_device *vdev, u16 idx, const struct vdpa_vq_state *state)
{}

static int snet_get_vq_state(struct vdpa_device *vdev, u16 idx, struct vdpa_vq_state *state)
{}

static int snet_get_vq_irq(struct vdpa_device *vdev, u16 idx)
{}

static u32 snet_get_vq_align(struct vdpa_device *vdev)
{}

static int snet_reset_dev(struct snet *snet)
{}

static int snet_reset(struct vdpa_device *vdev)
{}

static size_t snet_get_config_size(struct vdpa_device *vdev)
{}

static u64 snet_get_features(struct vdpa_device *vdev)
{}

static int snet_set_drv_features(struct vdpa_device *vdev, u64 features)
{}

static u64 snet_get_drv_features(struct vdpa_device *vdev)
{}

static u16 snet_get_vq_num_max(struct vdpa_device *vdev)
{}

static void snet_set_config_cb(struct vdpa_device *vdev, struct vdpa_callback *cb)
{}

static u32 snet_get_device_id(struct vdpa_device *vdev)
{}

static u32 snet_get_vendor_id(struct vdpa_device *vdev)
{}

static u8 snet_get_status(struct vdpa_device *vdev)
{}

static int snet_write_conf(struct snet *snet)
{}

static int snet_request_irqs(struct pci_dev *pdev, struct snet *snet)
{}

static void snet_set_status(struct vdpa_device *vdev, u8 status)
{}

static void snet_get_config(struct vdpa_device *vdev, unsigned int offset,
			    void *buf, unsigned int len)
{}

static void snet_set_config(struct vdpa_device *vdev, unsigned int offset,
			    const void *buf, unsigned int len)
{}

static int snet_suspend(struct vdpa_device *vdev)
{}

static int snet_resume(struct vdpa_device *vdev)
{}

static const struct vdpa_config_ops snet_config_ops =;

static int psnet_open_pf_bar(struct pci_dev *pdev, struct psnet *psnet)
{}

static int snet_open_vf_bar(struct pci_dev *pdev, struct snet *snet)
{}

static void snet_free_cfg(struct snet_cfg *cfg)
{}

/* Detect which BAR is used for communication with the device. */
static int psnet_detect_bar(struct psnet *psnet, u32 off)
{}

static void psnet_unmap_unused_bars(struct pci_dev *pdev, struct psnet *psnet)
{}

/* Read SNET config from PCI BAR */
static int psnet_read_cfg(struct pci_dev *pdev, struct psnet *psnet)
{}

static int psnet_alloc_irq_vector(struct pci_dev *pdev, struct psnet *psnet)
{}

static int snet_alloc_irq_vector(struct pci_dev *pdev, struct snet_dev_cfg *snet_cfg)
{}

static void snet_free_vqs(struct snet *snet)
{}

static int snet_build_vqs(struct snet *snet)
{}

static int psnet_get_next_irq_num(struct psnet *psnet)
{}

static void snet_reserve_irq_idx(struct pci_dev *pdev, struct snet *snet)
{}

/* Find a device config based on virtual function id */
static struct snet_dev_cfg *snet_find_dev_cfg(struct snet_cfg *cfg, u32 vfid)
{}

/* Probe function for a physical PCI function */
static int snet_vdpa_probe_pf(struct pci_dev *pdev)
{}

/* Probe function for a virtual PCI function */
static int snet_vdpa_probe_vf(struct pci_dev *pdev)
{}

static int snet_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void snet_vdpa_remove_pf(struct pci_dev *pdev)
{}

static void snet_vdpa_remove_vf(struct pci_dev *pdev)
{}

static void snet_vdpa_remove(struct pci_dev *pdev)
{}

static struct pci_device_id snet_driver_pci_ids[] =;

MODULE_DEVICE_TABLE(pci, snet_driver_pci_ids);

static struct pci_driver snet_vdpa_driver =;

module_pci_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();