linux/drivers/misc/mrvl_cn10k_dpi.c

// SPDX-License-Identifier: GPL-2.0
/* Marvell Octeon CN10K DPI driver
 *
 * Copyright (C) 2024 Marvell.
 *
 */

#include <linux/bitfield.h>
#include <linux/compat.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/irq.h>
#include <linux/interrupt.h>

#include <uapi/misc/mrvl_cn10k_dpi.h>

/* PCI device IDs */
#define PCI_DEVID_MRVL_CN10K_DPI_PF
#define PCI_SUBDEVID_MRVL_CN10K_DPI_PF

/* PCI BAR Number */
#define PCI_DPI_CFG_BAR

/* MSI-X interrupts */
#define DPI_MAX_REQQ_INT
#define DPI_MAX_CC_INT

/* MBOX MSI-X interrupt vector index */
#define DPI_MBOX_PF_VF_INT_IDX

#define DPI_MAX_IRQS

#define DPI_MAX_VFS

#define DPI_MAX_ENG_FIFO_SZ
#define DPI_MAX_ENG_MOLR

#define DPI_DMA_IDS_DMA_NPA_PF_FUNC(x)
#define DPI_DMA_IDS_INST_STRM(x)
#define DPI_DMA_IDS_DMA_STRM(x)
#define DPI_DMA_ENG_EN_MOLR(x)
#define DPI_EBUS_PORTX_CFG_MPS(x)
#define DPI_DMA_IDS_DMA_SSO_PF_FUNC(x)
#define DPI_DMA_IDS2_INST_AURA(x)
#define DPI_DMA_IBUFF_CSIZE_CSIZE(x)
#define DPI_EBUS_PORTX_CFG_MRRS(x)
#define DPI_ENG_BUF_BLKS(x)
#define DPI_DMA_CONTROL_DMA_ENB

#define DPI_DMA_CONTROL_O_MODE
#define DPI_DMA_CONTROL_LDWB
#define DPI_DMA_CONTROL_WQECSMODE1
#define DPI_DMA_CONTROL_ZBWCSEN
#define DPI_DMA_CONTROL_WQECSOFF(ofst)
#define DPI_DMA_CONTROL_WQECSDIS
#define DPI_DMA_CONTROL_PKT_EN
#define DPI_DMA_IBUFF_CSIZE_NPA_FREE

#define DPI_CTL_EN
#define DPI_DMA_CC_INT
#define DPI_DMA_QRST

#define DPI_REQQ_INT_INSTRFLT
#define DPI_REQQ_INT_RDFLT
#define DPI_REQQ_INT_WRFLT
#define DPI_REQQ_INT_CSFLT
#define DPI_REQQ_INT_INST_DBO
#define DPI_REQQ_INT_INST_ADDR_NULL
#define DPI_REQQ_INT_INST_FILL_INVAL
#define DPI_REQQ_INT_INSTR_PSN

#define DPI_REQQ_INT

#define DPI_PF_RAS_EBI_DAT_PSN
#define DPI_PF_RAS_NCB_DAT_PSN
#define DPI_PF_RAS_NCB_CMD_PSN

#define DPI_PF_RAS_INT

/* Message fields in word_l of DPI mailbox structure */
#define DPI_MBOX_VFID(msg)
#define DPI_MBOX_CMD(msg)
#define DPI_MBOX_CBUF_SIZE(msg)
#define DPI_MBOX_CBUF_AURA(msg)
#define DPI_MBOX_SSO_PFFUNC(msg)

/* Message fields in word_h of DPI mailbox structure */
#define DPI_MBOX_NPA_PFFUNC(msg)
#define DPI_MBOX_WQES_COMPL(msg)
#define DPI_MBOX_WQES_OFFSET(msg)

#define DPI_DMAX_IBUFF_CSIZE(x)
#define DPI_DMAX_IDS(x)
#define DPI_DMAX_IDS2(x)
#define DPI_DMAX_QRST(x)

#define DPI_CTL
#define DPI_DMA_CONTROL
#define DPI_PF_RAS
#define DPI_PF_RAS_ENA_W1C
#define DPI_MBOX_VF_PF_INT
#define DPI_MBOX_VF_PF_INT_W1S
#define DPI_MBOX_VF_PF_INT_ENA_W1C
#define DPI_MBOX_VF_PF_INT_ENA_W1S

#define DPI_DMA_ENGX_EN(x)
#define DPI_ENGX_BUF(x)
#define DPI_EBUS_PORTX_CFG(x)
#define DPI_DMA_CCX_INT(x)
#define DPI_DMA_CCX_INT_ENA_W1C(x)
#define DPI_REQQX_INT(x)
#define DPI_REQQX_INT_ENA_W1C(x)
#define DPI_MBOX_PF_VF_DATA0(x)
#define DPI_MBOX_PF_VF_DATA1(x)

#define DPI_WCTL_FIF_THR

#define DPI_EBUS_MAX_PORTS

#define DPI_EBUS_MRRS_MIN
#define DPI_EBUS_MRRS_MAX
#define DPI_EBUS_MPS_MIN
#define DPI_EBUS_MPS_MAX
#define DPI_WCTL_FIFO_THRESHOLD

#define DPI_QUEUE_OPEN
#define DPI_QUEUE_CLOSE
#define DPI_REG_DUMP
#define DPI_GET_REG_CFG
#define DPI_QUEUE_OPEN_V2

enum dpi_mbox_rsp_type {};

struct dpivf_config {};

struct dpipf_vf {};

/* DPI device mailbox */
struct dpi_mbox {};

struct dpipf {};

struct dpi_mbox_message {};

static inline void dpi_reg_write(struct dpipf *dpi, u64 offset, u64 val)
{}

static inline u64 dpi_reg_read(struct dpipf *dpi, u64 offset)
{}

static void dpi_wqe_cs_offset(struct dpipf *dpi, u8 offset)
{}

static int dpi_queue_init(struct dpipf *dpi, struct dpipf_vf *dpivf, u8 vf)
{}

static void dpi_queue_fini(struct dpipf *dpi, u8 vf)
{}

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

static int queue_config(struct dpipf *dpi, struct dpipf_vf *dpivf, struct dpi_mbox_message *msg)
{}

static void dpi_pfvf_mbox_work(struct work_struct *work)
{}

/* Setup registers for a PF mailbox */
static void dpi_setup_mbox_regs(struct dpipf *dpi, int vf)
{}

static int dpi_pfvf_mbox_setup(struct dpipf *dpi)
{}

static void dpi_pfvf_mbox_destroy(struct dpipf *dpi)
{}

static void dpi_init(struct dpipf *dpi)
{}

static void dpi_fini(struct dpipf *dpi)
{}

static void dpi_free_irq_vectors(void *pdev)
{}

static int dpi_irq_init(struct dpipf *dpi)
{}

static int dpi_mps_mrrs_config(struct dpipf *dpi, void __user *arg)
{}

static int dpi_engine_config(struct dpipf *dpi, void __user *arg)
{}

static long dpi_dev_ioctl(struct file *fptr, unsigned int cmd, unsigned long data)
{}

static const struct file_operations dpi_device_fops =;

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

static void dpi_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id dpi_id_table[] =;

static struct pci_driver dpi_driver =;

module_pci_driver();
MODULE_DEVICE_TABLE(pci, dpi_id_table);
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();