Merge branches 'acpi-scan', 'acpi-tad', 'acpi-extlog' and 'acpi-misc'
[linux-block.git] / drivers / vdpa / pds / vdpa_dev.h
CommitLineData
25d1270b
SN
1/* SPDX-License-Identifier: GPL-2.0-only */
2/* Copyright(c) 2023 Advanced Micro Devices, Inc */
3
4#ifndef _VDPA_DEV_H_
5#define _VDPA_DEV_H_
6
c16d5a41
SN
7#include <linux/pci.h>
8#include <linux/vdpa.h>
9
10struct pds_vdpa_vq_info {
11 bool ready;
12 u64 desc_addr;
13 u64 avail_addr;
14 u64 used_addr;
15 u32 q_len;
16 u16 qid;
17 int irq;
18 char irq_name[32];
19
20 void __iomem *notify;
21 dma_addr_t notify_pa;
22
23 u64 doorbell;
24 u16 avail_idx;
25 u16 used_idx;
25d1270b 26
c16d5a41
SN
27 struct vdpa_callback event_cb;
28 struct pds_vdpa_device *pdsv;
29};
30
31#define PDS_VDPA_MAX_QUEUES 65
32#define PDS_VDPA_MAX_QLEN 32768
25d1270b
SN
33struct pds_vdpa_device {
34 struct vdpa_device vdpa_dev;
35 struct pds_vdpa_aux *vdpa_aux;
c16d5a41
SN
36
37 struct pds_vdpa_vq_info vqs[PDS_VDPA_MAX_QUEUES];
abdf31bd
SN
38 u64 supported_features; /* supported device features */
39 u64 negotiated_features; /* negotiated features */
c16d5a41
SN
40 u8 vdpa_index; /* rsvd for future subdevice use */
41 u8 num_vqs; /* num vqs in use */
0cd2c13b 42 u8 mac[ETH_ALEN]; /* mac selected when the device was added */
c16d5a41 43 struct vdpa_callback config_cb;
67f27b8b 44 struct notifier_block nb;
25d1270b
SN
45};
46
151cc834
SN
47#define PDS_VDPA_PACKED_INVERT_IDX 0x8000
48
25d1270b
SN
49int pds_vdpa_get_mgmt_info(struct pds_vdpa_aux *vdpa_aux);
50#endif /* _VDPA_DEV_H_ */