Showing the changes to include/uapi (2 of 22 files). Show all
Unified · Split
| @@ -52,7 +52,7 @@ · 51 unmodified lines | ||
| 52 | 52 | * rest are per-device feature bits. |
| 53 | 53 | */ |
| 54 | 54 | #define VIRTIO_TRANSPORT_F_START 28 |
| 55 | −#define VIRTIO_TRANSPORT_F_END 41 | |
| 55 | +#define VIRTIO_TRANSPORT_F_END 42 | |
| 56 | 56 | |
| 57 | 57 | #ifndef VIRTIO_CONFIG_NO_LEGACY |
| 58 | 58 | /* Do we get callbacks when the ring is completely used, even if we've |
| @@ -114,4 +114,10 @@ · 55 unmodified lines | ||
| 114 | 114 | * This feature indicates that the driver can reset a queue individually. |
| 115 | 115 | */ |
| 116 | 116 | #define VIRTIO_F_RING_RESET 40 |
| 117 | + | |
| 118 | +/* | |
| 119 | + * This feature indicates that the device support administration virtqueues. | |
| 120 | + */ | |
| 121 | +#define VIRTIO_F_ADMIN_VQ 41 | |
| 122 | + | |
| 117 | 123 | #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ |
| @@ -175,6 +175,9 @@ struct virtio_pci_modern_common_cfg { · 174 unmodified lines | ||
| 175 | 175 | |
| 176 | 176 | __le16 queue_notify_data; /* read-write */ |
| 177 | 177 | __le16 queue_reset; /* read-write */ |
| 178 | + | |
| 179 | + __le16 admin_queue_index; /* read-only */ | |
| 180 | + __le16 admin_queue_num; /* read-only */ | |
| 178 | 181 | }; |
| 179 | 182 | |
| 180 | 183 | /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */ |
| @@ -215,7 +218,72 @@ struct virtio_pci_cfg_cap { · 34 unmodified lines | ||
| 215 | 218 | #define VIRTIO_PCI_COMMON_Q_USEDHI 52 |
| 216 | 219 | #define VIRTIO_PCI_COMMON_Q_NDATA 56 |
| 217 | 220 | #define VIRTIO_PCI_COMMON_Q_RESET 58 |
| 221 | +#define VIRTIO_PCI_COMMON_ADM_Q_IDX 60 | |
| 222 | +#define VIRTIO_PCI_COMMON_ADM_Q_NUM 62 | |
| 218 | 223 | |
| 219 | 224 | #endif /* VIRTIO_PCI_NO_MODERN */ |
| 220 | 225 | |
| 226 | +/* Admin command status. */ | |
| 227 | +#define VIRTIO_ADMIN_STATUS_OK 0 | |
| 228 | + | |
| 229 | +/* Admin command opcode. */ | |
| 230 | +#define VIRTIO_ADMIN_CMD_LIST_QUERY 0x0 | |
| 231 | +#define VIRTIO_ADMIN_CMD_LIST_USE 0x1 | |
| 232 | + | |
| 233 | +/* Admin command group type. */ | |
| 234 | +#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1 | |
| 235 | + | |
| 236 | +/* Transitional device admin command. */ | |
| 237 | +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE 0x2 | |
| 238 | +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ 0x3 | |
| 239 | +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE 0x4 | |
| 240 | +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 | |
| 241 | +#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 | |
| 242 | + | |
| 243 | +struct __packed virtio_admin_cmd_hdr { | |
| 244 | + __le16 opcode; | |
| 245 | + /* | |
| 246 | + * 1 - SR-IOV | |
| 247 | + * 2-65535 - reserved | |
| 248 | + */ | |
| 249 | + __le16 group_type; | |
| 250 | + /* Unused, reserved for future extensions. */ | |
| 251 | + __u8 reserved1[12]; | |
| 252 | + __le64 group_member_id; | |
| 253 | +}; | |
| 254 | + | |
| 255 | +struct __packed virtio_admin_cmd_status { | |
| 256 | + __le16 status; | |
| 257 | + __le16 status_qualifier; | |
| 258 | + /* Unused, reserved for future extensions. */ | |
| 259 | + __u8 reserved2[4]; | |
| 260 | +}; | |
| 261 | + | |
| 262 | +struct __packed virtio_admin_cmd_legacy_wr_data { | |
| 263 | + __u8 offset; /* Starting offset of the register(s) to write. */ | |
| 264 | + __u8 reserved[7]; | |
| 265 | + __u8 registers[]; | |
| 266 | +}; | |
| 267 | + | |
| 268 | +struct __packed virtio_admin_cmd_legacy_rd_data { | |
| 269 | + __u8 offset; /* Starting offset of the register(s) to read. */ | |
| 270 | +}; | |
| 271 | + | |
| 272 | +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_END 0 | |
| 273 | +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_DEV 0x1 | |
| 274 | +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_MEM 0x2 | |
| 275 | + | |
| 276 | +#define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4 | |
| 277 | + | |
| 278 | +struct __packed virtio_admin_cmd_notify_info_data { | |
| 279 | + __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ | |
| 280 | + __u8 bar; /* BAR of the member or the owner device */ | |
| 281 | + __u8 padding[6]; | |
| 282 | + __le64 offset; /* Offset within bar. */ | |
| 283 | +}; | |
| 284 | + | |
| 285 | +struct virtio_admin_cmd_notify_info_result { | |
| 286 | + struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO]; | |
| 287 | +}; | |
| 288 | + | |
| 221 | 289 | #endif |