linux/drivers/vdpa/octeon_ep/octep_vdpa.h

/* SPDX-License-Identifier: GPL-2.0-only
 * Copyright (C) 2024 Marvell.
 */
#ifndef __OCTEP_VDPA_H__
#define __OCTEP_VDPA_H__

#include <linux/pci.h>
#include <linux/pci_regs.h>
#include <linux/vdpa.h>
#include <linux/virtio_pci_modern.h>
#include <uapi/linux/virtio_net.h>
#include <uapi/linux/virtio_blk.h>
#include <uapi/linux/virtio_config.h>
#include <uapi/linux/virtio_pci.h>
#include <uapi/linux/vdpa.h>

#define OCTEP_VDPA_DEVID_CN106K_PF
#define OCTEP_VDPA_DEVID_CN106K_VF
#define OCTEP_VDPA_DEVID_CN105K_PF
#define OCTEP_VDPA_DEVID_CN105K_VF
#define OCTEP_VDPA_DEVID_CN103K_PF
#define OCTEP_VDPA_DEVID_CN103K_VF

#define OCTEP_HW_MBOX_BAR
#define OCTEP_HW_CAPS_BAR

#define OCTEP_DEV_READY_SIGNATURE

#define OCTEP_EPF_RINFO(x)
#define OCTEP_VF_MBOX_DATA(x)
#define OCTEP_PF_MBOX_DATA(x)

#define OCTEP_EPF_RINFO_RPVF(val)
#define OCTEP_EPF_RINFO_NVFS(val)

#define OCTEP_FW_READY_SIGNATURE0
#define OCTEP_FW_READY_SIGNATURE1

enum octep_vdpa_dev_status {};

struct octep_vring_info {};

struct octep_hw {};

u8 octep_hw_get_status(struct octep_hw *oct_hw);
void octep_hw_set_status(struct octep_hw *dev, uint8_t status);
void octep_hw_reset(struct octep_hw *oct_hw);
void octep_write_queue_select(struct octep_hw *oct_hw, u16 queue_id);
void octep_notify_queue(struct octep_hw *oct_hw, u16 qid);
void octep_read_dev_config(struct octep_hw *oct_hw, u64 offset, void *dst, int length);
int octep_set_vq_address(struct octep_hw *oct_hw, u16 qid, u64 desc_area, u64 driver_area,
			 u64 device_area);
void octep_set_vq_num(struct octep_hw *oct_hw, u16 qid, u32 num);
void octep_set_vq_ready(struct octep_hw *oct_hw, u16 qid, bool ready);
bool octep_get_vq_ready(struct octep_hw *oct_hw, u16 qid);
int octep_set_vq_state(struct octep_hw *oct_hw, u16 qid, const struct vdpa_vq_state *state);
int octep_get_vq_state(struct octep_hw *oct_hw, u16 qid, struct vdpa_vq_state *state);
u16 octep_get_vq_size(struct octep_hw *oct_hw);
int octep_hw_caps_read(struct octep_hw *oct_hw, struct pci_dev *pdev);
u64 octep_hw_get_dev_features(struct octep_hw *oct_hw);
void octep_hw_set_drv_features(struct octep_hw *oct_hw, u64 features);
u64 octep_hw_get_drv_features(struct octep_hw *oct_hw);
int octep_verify_features(u64 features);

#endif /* __OCTEP_VDPA_H__ */