Macro VIRTIO_PCI_CONFIG assumes that userspace actually has a structure with a field named msix_enabled. Add VIRTIO_PCI_CONFIG_OFF that gets the msix_enabled by value instead, to make it useful for userspace. We still keep VIRTIO_PCI_CONFIG around for now, in case some userspace uses it.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -80,7 +80,9 @@ · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | /* The remaining space is defined by each driver as the per-driver |
| 82 | 82 | * configuration space */ |
| 83 | −#define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20) | |
| 83 | +#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20) | |
| 84 | +/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */ | |
| 85 | +#define VIRTIO_PCI_CONFIG(dev) VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled) | |
| 84 | 86 | |
| 85 | 87 | /* Virtio ABI version, this must match exactly */ |
| 86 | 88 | #define VIRTIO_PCI_ABI_VERSION 0 |