diff options
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/btrfs.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/nvme.h | 26 | ||||
| -rw-r--r-- | include/uapi/linux/prctl.h | 5 | ||||
| -rw-r--r-- | include/uapi/linux/tc_act/Kbuild | 1 | ||||
| -rw-r--r-- | include/uapi/linux/vfio.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/virtio_balloon.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/virtio_blk.h | 17 | ||||
| -rw-r--r-- | include/uapi/linux/virtio_config.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/virtio_net.h | 42 | ||||
| -rw-r--r-- | include/uapi/linux/virtio_pci.h | 93 |
10 files changed, 174 insertions, 19 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h index 611e1c5893b4..b6dec05c7196 100644 --- a/include/uapi/linux/btrfs.h +++ b/include/uapi/linux/btrfs.h | |||
| @@ -495,8 +495,7 @@ struct btrfs_ioctl_send_args { | |||
| 495 | 495 | ||
| 496 | /* Error codes as returned by the kernel */ | 496 | /* Error codes as returned by the kernel */ |
| 497 | enum btrfs_err_code { | 497 | enum btrfs_err_code { |
| 498 | notused, | 498 | BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1, |
| 499 | BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET, | ||
| 500 | BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET, | 499 | BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET, |
| 501 | BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET, | 500 | BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET, |
| 502 | BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET, | 501 | BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET, |
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h index 26386cf3db44..aef9a81b2d75 100644 --- a/include/uapi/linux/nvme.h +++ b/include/uapi/linux/nvme.h | |||
| @@ -115,7 +115,13 @@ struct nvme_id_ns { | |||
| 115 | __le16 nawun; | 115 | __le16 nawun; |
| 116 | __le16 nawupf; | 116 | __le16 nawupf; |
| 117 | __le16 nacwu; | 117 | __le16 nacwu; |
| 118 | __u8 rsvd40[80]; | 118 | __le16 nabsn; |
| 119 | __le16 nabo; | ||
| 120 | __le16 nabspf; | ||
| 121 | __u16 rsvd46; | ||
| 122 | __le64 nvmcap[2]; | ||
| 123 | __u8 rsvd64[40]; | ||
| 124 | __u8 nguid[16]; | ||
| 119 | __u8 eui64[8]; | 125 | __u8 eui64[8]; |
| 120 | struct nvme_lbaf lbaf[16]; | 126 | struct nvme_lbaf lbaf[16]; |
| 121 | __u8 rsvd192[192]; | 127 | __u8 rsvd192[192]; |
| @@ -124,10 +130,22 @@ struct nvme_id_ns { | |||
| 124 | 130 | ||
| 125 | enum { | 131 | enum { |
| 126 | NVME_NS_FEAT_THIN = 1 << 0, | 132 | NVME_NS_FEAT_THIN = 1 << 0, |
| 133 | NVME_NS_FLBAS_LBA_MASK = 0xf, | ||
| 134 | NVME_NS_FLBAS_META_EXT = 0x10, | ||
| 127 | NVME_LBAF_RP_BEST = 0, | 135 | NVME_LBAF_RP_BEST = 0, |
| 128 | NVME_LBAF_RP_BETTER = 1, | 136 | NVME_LBAF_RP_BETTER = 1, |
| 129 | NVME_LBAF_RP_GOOD = 2, | 137 | NVME_LBAF_RP_GOOD = 2, |
| 130 | NVME_LBAF_RP_DEGRADED = 3, | 138 | NVME_LBAF_RP_DEGRADED = 3, |
| 139 | NVME_NS_DPC_PI_LAST = 1 << 4, | ||
| 140 | NVME_NS_DPC_PI_FIRST = 1 << 3, | ||
| 141 | NVME_NS_DPC_PI_TYPE3 = 1 << 2, | ||
| 142 | NVME_NS_DPC_PI_TYPE2 = 1 << 1, | ||
| 143 | NVME_NS_DPC_PI_TYPE1 = 1 << 0, | ||
| 144 | NVME_NS_DPS_PI_FIRST = 1 << 3, | ||
| 145 | NVME_NS_DPS_PI_MASK = 0x7, | ||
| 146 | NVME_NS_DPS_PI_TYPE1 = 1, | ||
| 147 | NVME_NS_DPS_PI_TYPE2 = 2, | ||
| 148 | NVME_NS_DPS_PI_TYPE3 = 3, | ||
| 131 | }; | 149 | }; |
| 132 | 150 | ||
| 133 | struct nvme_smart_log { | 151 | struct nvme_smart_log { |
| @@ -261,6 +279,10 @@ enum { | |||
| 261 | NVME_RW_DSM_LATENCY_LOW = 3 << 4, | 279 | NVME_RW_DSM_LATENCY_LOW = 3 << 4, |
| 262 | NVME_RW_DSM_SEQ_REQ = 1 << 6, | 280 | NVME_RW_DSM_SEQ_REQ = 1 << 6, |
| 263 | NVME_RW_DSM_COMPRESSED = 1 << 7, | 281 | NVME_RW_DSM_COMPRESSED = 1 << 7, |
| 282 | NVME_RW_PRINFO_PRCHK_REF = 1 << 10, | ||
| 283 | NVME_RW_PRINFO_PRCHK_APP = 1 << 11, | ||
| 284 | NVME_RW_PRINFO_PRCHK_GUARD = 1 << 12, | ||
| 285 | NVME_RW_PRINFO_PRACT = 1 << 13, | ||
| 264 | }; | 286 | }; |
| 265 | 287 | ||
| 266 | struct nvme_dsm_cmd { | 288 | struct nvme_dsm_cmd { |
| @@ -549,6 +571,8 @@ struct nvme_passthru_cmd { | |||
| 549 | __u32 result; | 571 | __u32 result; |
| 550 | }; | 572 | }; |
| 551 | 573 | ||
| 574 | #define NVME_VS(major, minor) (((major) << 16) | ((minor) << 8)) | ||
| 575 | |||
| 552 | #define nvme_admin_cmd nvme_passthru_cmd | 576 | #define nvme_admin_cmd nvme_passthru_cmd |
| 553 | 577 | ||
| 554 | #define NVME_IOCTL_ID _IO('N', 0x40) | 578 | #define NVME_IOCTL_ID _IO('N', 0x40) |
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h index 89f63503f903..31891d9535e2 100644 --- a/include/uapi/linux/prctl.h +++ b/include/uapi/linux/prctl.h | |||
| @@ -185,4 +185,9 @@ struct prctl_mm_map { | |||
| 185 | #define PR_MPX_ENABLE_MANAGEMENT 43 | 185 | #define PR_MPX_ENABLE_MANAGEMENT 43 |
| 186 | #define PR_MPX_DISABLE_MANAGEMENT 44 | 186 | #define PR_MPX_DISABLE_MANAGEMENT 44 |
| 187 | 187 | ||
| 188 | #define PR_SET_FP_MODE 45 | ||
| 189 | #define PR_GET_FP_MODE 46 | ||
| 190 | # define PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ | ||
| 191 | # define PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ | ||
| 192 | |||
| 188 | #endif /* _LINUX_PRCTL_H */ | 193 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild index 19d5219b0b99..242cf0c6e33d 100644 --- a/include/uapi/linux/tc_act/Kbuild +++ b/include/uapi/linux/tc_act/Kbuild | |||
| @@ -9,3 +9,4 @@ header-y += tc_pedit.h | |||
| 9 | header-y += tc_skbedit.h | 9 | header-y += tc_skbedit.h |
| 10 | header-y += tc_vlan.h | 10 | header-y += tc_vlan.h |
| 11 | header-y += tc_bpf.h | 11 | header-y += tc_bpf.h |
| 12 | header-y += tc_connmark.h | ||
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 29715d27548f..82889c30f4f5 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h | |||
| @@ -333,6 +333,7 @@ enum { | |||
| 333 | VFIO_PCI_MSI_IRQ_INDEX, | 333 | VFIO_PCI_MSI_IRQ_INDEX, |
| 334 | VFIO_PCI_MSIX_IRQ_INDEX, | 334 | VFIO_PCI_MSIX_IRQ_INDEX, |
| 335 | VFIO_PCI_ERR_IRQ_INDEX, | 335 | VFIO_PCI_ERR_IRQ_INDEX, |
| 336 | VFIO_PCI_REQ_IRQ_INDEX, | ||
| 336 | VFIO_PCI_NUM_IRQS | 337 | VFIO_PCI_NUM_IRQS |
| 337 | }; | 338 | }; |
| 338 | 339 | ||
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f7059e93..4b0488f20b2e 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h | |||
| @@ -36,8 +36,7 @@ | |||
| 36 | /* Size of a PFN in the balloon interface. */ | 36 | /* Size of a PFN in the balloon interface. */ |
| 37 | #define VIRTIO_BALLOON_PFN_SHIFT 12 | 37 | #define VIRTIO_BALLOON_PFN_SHIFT 12 |
| 38 | 38 | ||
| 39 | struct virtio_balloon_config | 39 | struct virtio_balloon_config { |
| 40 | { | ||
| 41 | /* Number of pages host wants Guest to give up. */ | 40 | /* Number of pages host wants Guest to give up. */ |
| 42 | __le32 num_pages; | 41 | __le32 num_pages; |
| 43 | /* Number of pages we've actually got in balloon. */ | 42 | /* Number of pages we've actually got in balloon. */ |
diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 247c8ba8544a..3c53eec4ae22 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h | |||
| @@ -31,22 +31,25 @@ | |||
| 31 | #include <linux/virtio_types.h> | 31 | #include <linux/virtio_types.h> |
| 32 | 32 | ||
| 33 | /* Feature bits */ | 33 | /* Feature bits */ |
| 34 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
| 35 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 34 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
| 36 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 35 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
| 37 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | 36 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ |
| 38 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 37 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
| 39 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 38 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
| 40 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
| 41 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
| 42 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ | 39 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ |
| 43 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
| 44 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ | 40 | #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ |
| 45 | 41 | ||
| 42 | /* Legacy feature bits */ | ||
| 43 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
| 44 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | ||
| 45 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | ||
| 46 | #define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ | ||
| 47 | #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ | ||
| 46 | #ifndef __KERNEL__ | 48 | #ifndef __KERNEL__ |
| 47 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ | 49 | /* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ |
| 48 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE | 50 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE |
| 49 | #endif | 51 | #endif |
| 52 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
| 50 | 53 | ||
| 51 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ | 54 | #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ |
| 52 | 55 | ||
| @@ -100,8 +103,10 @@ struct virtio_blk_config { | |||
| 100 | #define VIRTIO_BLK_T_IN 0 | 103 | #define VIRTIO_BLK_T_IN 0 |
| 101 | #define VIRTIO_BLK_T_OUT 1 | 104 | #define VIRTIO_BLK_T_OUT 1 |
| 102 | 105 | ||
| 106 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
| 103 | /* This bit says it's a scsi command, not an actual read or write. */ | 107 | /* This bit says it's a scsi command, not an actual read or write. */ |
| 104 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 108 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
| 109 | #endif /* VIRTIO_BLK_NO_LEGACY */ | ||
| 105 | 110 | ||
| 106 | /* Cache flush command */ | 111 | /* Cache flush command */ |
| 107 | #define VIRTIO_BLK_T_FLUSH 4 | 112 | #define VIRTIO_BLK_T_FLUSH 4 |
| @@ -109,8 +114,10 @@ struct virtio_blk_config { | |||
| 109 | /* Get device ID command */ | 114 | /* Get device ID command */ |
| 110 | #define VIRTIO_BLK_T_GET_ID 8 | 115 | #define VIRTIO_BLK_T_GET_ID 8 |
| 111 | 116 | ||
| 117 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
| 112 | /* Barrier before this op. */ | 118 | /* Barrier before this op. */ |
| 113 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 119 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
| 120 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
| 114 | 121 | ||
| 115 | /* This is the first element of the read scatter-gather list. */ | 122 | /* This is the first element of the read scatter-gather list. */ |
| 116 | struct virtio_blk_outhdr { | 123 | struct virtio_blk_outhdr { |
| @@ -122,12 +129,14 @@ struct virtio_blk_outhdr { | |||
| 122 | __virtio64 sector; | 129 | __virtio64 sector; |
| 123 | }; | 130 | }; |
| 124 | 131 | ||
| 132 | #ifndef VIRTIO_BLK_NO_LEGACY | ||
| 125 | struct virtio_scsi_inhdr { | 133 | struct virtio_scsi_inhdr { |
| 126 | __virtio32 errors; | 134 | __virtio32 errors; |
| 127 | __virtio32 data_len; | 135 | __virtio32 data_len; |
| 128 | __virtio32 sense_len; | 136 | __virtio32 sense_len; |
| 129 | __virtio32 residual; | 137 | __virtio32 residual; |
| 130 | }; | 138 | }; |
| 139 | #endif /* !VIRTIO_BLK_NO_LEGACY */ | ||
| 131 | 140 | ||
| 132 | /* And this is the final byte of the write scatter-gather list. */ | 141 | /* And this is the final byte of the write scatter-gather list. */ |
| 133 | #define VIRTIO_BLK_S_OK 0 | 142 | #define VIRTIO_BLK_S_OK 0 |
diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index a6d0cdeaacd4..c18264df9504 100644 --- a/include/uapi/linux/virtio_config.h +++ b/include/uapi/linux/virtio_config.h | |||
| @@ -49,12 +49,14 @@ | |||
| 49 | #define VIRTIO_TRANSPORT_F_START 28 | 49 | #define VIRTIO_TRANSPORT_F_START 28 |
| 50 | #define VIRTIO_TRANSPORT_F_END 33 | 50 | #define VIRTIO_TRANSPORT_F_END 33 |
| 51 | 51 | ||
| 52 | #ifndef VIRTIO_CONFIG_NO_LEGACY | ||
| 52 | /* Do we get callbacks when the ring is completely used, even if we've | 53 | /* Do we get callbacks when the ring is completely used, even if we've |
| 53 | * suppressed them? */ | 54 | * suppressed them? */ |
| 54 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 55 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
| 55 | 56 | ||
| 56 | /* Can the device handle any descriptor layout? */ | 57 | /* Can the device handle any descriptor layout? */ |
| 57 | #define VIRTIO_F_ANY_LAYOUT 27 | 58 | #define VIRTIO_F_ANY_LAYOUT 27 |
| 59 | #endif /* VIRTIO_CONFIG_NO_LEGACY */ | ||
| 58 | 60 | ||
| 59 | /* v1.0 compliant. */ | 61 | /* v1.0 compliant. */ |
| 60 | #define VIRTIO_F_VERSION_1 32 | 62 | #define VIRTIO_F_VERSION_1 32 |
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index b5f1677b291c..7bbee79ca293 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ | 35 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ |
| 36 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ | 36 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ |
| 37 | #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ | 37 | #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ |
| 38 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ | ||
| 39 | #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ | 38 | #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ |
| 40 | #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ | 39 | #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ |
| 41 | #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ | 40 | #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ |
| @@ -56,6 +55,10 @@ | |||
| 56 | * Steering */ | 55 | * Steering */ |
| 57 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ | 56 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ |
| 58 | 57 | ||
| 58 | #ifndef VIRTIO_NET_NO_LEGACY | ||
| 59 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ | ||
| 60 | #endif /* VIRTIO_NET_NO_LEGACY */ | ||
| 61 | |||
| 59 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 62 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
| 60 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ | 63 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ |
| 61 | 64 | ||
| @@ -71,19 +74,39 @@ struct virtio_net_config { | |||
| 71 | __u16 max_virtqueue_pairs; | 74 | __u16 max_virtqueue_pairs; |
| 72 | } __attribute__((packed)); | 75 | } __attribute__((packed)); |
| 73 | 76 | ||
| 77 | /* | ||
| 78 | * This header comes first in the scatter-gather list. If you don't | ||
| 79 | * specify GSO or CSUM features, you can simply ignore the header. | ||
| 80 | * | ||
| 81 | * This is bitwise-equivalent to the legacy struct virtio_net_hdr_mrg_rxbuf, | ||
| 82 | * only flattened. | ||
| 83 | */ | ||
| 84 | struct virtio_net_hdr_v1 { | ||
| 85 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */ | ||
| 86 | #define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */ | ||
| 87 | __u8 flags; | ||
| 88 | #define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */ | ||
| 89 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ | ||
| 90 | #define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */ | ||
| 91 | #define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ | ||
| 92 | #define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */ | ||
| 93 | __u8 gso_type; | ||
| 94 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ | ||
| 95 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ | ||
| 96 | __virtio16 csum_start; /* Position to start checksumming from */ | ||
| 97 | __virtio16 csum_offset; /* Offset after that to place checksum */ | ||
| 98 | __virtio16 num_buffers; /* Number of merged rx buffers */ | ||
| 99 | }; | ||
| 100 | |||
| 101 | #ifndef VIRTIO_NET_NO_LEGACY | ||
| 74 | /* This header comes first in the scatter-gather list. | 102 | /* This header comes first in the scatter-gather list. |
| 75 | * If VIRTIO_F_ANY_LAYOUT is not negotiated, it must | 103 | * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must |
| 76 | * be the first element of the scatter-gather list. If you don't | 104 | * be the first element of the scatter-gather list. If you don't |
| 77 | * specify GSO or CSUM features, you can simply ignore the header. */ | 105 | * specify GSO or CSUM features, you can simply ignore the header. */ |
| 78 | struct virtio_net_hdr { | 106 | struct virtio_net_hdr { |
| 79 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset | 107 | /* See VIRTIO_NET_HDR_F_* */ |
| 80 | #define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid | ||
| 81 | __u8 flags; | 108 | __u8 flags; |
| 82 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame | 109 | /* See VIRTIO_NET_HDR_GSO_* */ |
| 83 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) | ||
| 84 | #define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO) | ||
| 85 | #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP | ||
| 86 | #define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set | ||
| 87 | __u8 gso_type; | 110 | __u8 gso_type; |
| 88 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ | 111 | __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ |
| 89 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ | 112 | __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ |
| @@ -97,6 +120,7 @@ struct virtio_net_hdr_mrg_rxbuf { | |||
| 97 | struct virtio_net_hdr hdr; | 120 | struct virtio_net_hdr hdr; |
| 98 | __virtio16 num_buffers; /* Number of merged rx buffers */ | 121 | __virtio16 num_buffers; /* Number of merged rx buffers */ |
| 99 | }; | 122 | }; |
| 123 | #endif /* ...VIRTIO_NET_NO_LEGACY */ | ||
| 100 | 124 | ||
| 101 | /* | 125 | /* |
| 102 | * Control virtqueue data structures | 126 | * Control virtqueue data structures |
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 35b552c7f330..75301468359f 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #ifndef _LINUX_VIRTIO_PCI_H | 39 | #ifndef _LINUX_VIRTIO_PCI_H |
| 40 | #define _LINUX_VIRTIO_PCI_H | 40 | #define _LINUX_VIRTIO_PCI_H |
| 41 | 41 | ||
| 42 | #include <linux/virtio_config.h> | 42 | #include <linux/types.h> |
| 43 | 43 | ||
| 44 | #ifndef VIRTIO_PCI_NO_LEGACY | 44 | #ifndef VIRTIO_PCI_NO_LEGACY |
| 45 | 45 | ||
| @@ -99,4 +99,95 @@ | |||
| 99 | /* Vector value used to disable MSI for queue */ | 99 | /* Vector value used to disable MSI for queue */ |
| 100 | #define VIRTIO_MSI_NO_VECTOR 0xffff | 100 | #define VIRTIO_MSI_NO_VECTOR 0xffff |
| 101 | 101 | ||
| 102 | #ifndef VIRTIO_PCI_NO_MODERN | ||
| 103 | |||
| 104 | /* IDs for different capabilities. Must all exist. */ | ||
| 105 | |||
| 106 | /* Common configuration */ | ||
| 107 | #define VIRTIO_PCI_CAP_COMMON_CFG 1 | ||
| 108 | /* Notifications */ | ||
| 109 | #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 | ||
| 110 | /* ISR access */ | ||
| 111 | #define VIRTIO_PCI_CAP_ISR_CFG 3 | ||
| 112 | /* Device specific configuration */ | ||
| 113 | #define VIRTIO_PCI_CAP_DEVICE_CFG 4 | ||
| 114 | /* PCI configuration access */ | ||
| 115 | #define VIRTIO_PCI_CAP_PCI_CFG 5 | ||
| 116 | |||
| 117 | /* This is the PCI capability header: */ | ||
| 118 | struct virtio_pci_cap { | ||
| 119 | __u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */ | ||
| 120 | __u8 cap_next; /* Generic PCI field: next ptr. */ | ||
| 121 | __u8 cap_len; /* Generic PCI field: capability length */ | ||
| 122 | __u8 cfg_type; /* Identifies the structure. */ | ||
| 123 | __u8 bar; /* Where to find it. */ | ||
| 124 | __u8 padding[3]; /* Pad to full dword. */ | ||
| 125 | __le32 offset; /* Offset within bar. */ | ||
| 126 | __le32 length; /* Length of the structure, in bytes. */ | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct virtio_pci_notify_cap { | ||
| 130 | struct virtio_pci_cap cap; | ||
| 131 | __le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ | ||
| 132 | }; | ||
| 133 | |||
| 134 | /* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */ | ||
| 135 | struct virtio_pci_common_cfg { | ||
| 136 | /* About the whole device. */ | ||
| 137 | __le32 device_feature_select; /* read-write */ | ||
| 138 | __le32 device_feature; /* read-only */ | ||
| 139 | __le32 guest_feature_select; /* read-write */ | ||
| 140 | __le32 guest_feature; /* read-write */ | ||
| 141 | __le16 msix_config; /* read-write */ | ||
| 142 | __le16 num_queues; /* read-only */ | ||
| 143 | __u8 device_status; /* read-write */ | ||
| 144 | __u8 config_generation; /* read-only */ | ||
| 145 | |||
| 146 | /* About a specific virtqueue. */ | ||
| 147 | __le16 queue_select; /* read-write */ | ||
| 148 | __le16 queue_size; /* read-write, power of 2. */ | ||
| 149 | __le16 queue_msix_vector; /* read-write */ | ||
| 150 | __le16 queue_enable; /* read-write */ | ||
| 151 | __le16 queue_notify_off; /* read-only */ | ||
| 152 | __le32 queue_desc_lo; /* read-write */ | ||
| 153 | __le32 queue_desc_hi; /* read-write */ | ||
| 154 | __le32 queue_avail_lo; /* read-write */ | ||
| 155 | __le32 queue_avail_hi; /* read-write */ | ||
| 156 | __le32 queue_used_lo; /* read-write */ | ||
| 157 | __le32 queue_used_hi; /* read-write */ | ||
| 158 | }; | ||
| 159 | |||
| 160 | /* Macro versions of offsets for the Old Timers! */ | ||
| 161 | #define VIRTIO_PCI_CAP_VNDR 0 | ||
| 162 | #define VIRTIO_PCI_CAP_NEXT 1 | ||
| 163 | #define VIRTIO_PCI_CAP_LEN 2 | ||
| 164 | #define VIRTIO_PCI_CAP_CFG_TYPE 3 | ||
| 165 | #define VIRTIO_PCI_CAP_BAR 4 | ||
| 166 | #define VIRTIO_PCI_CAP_OFFSET 8 | ||
| 167 | #define VIRTIO_PCI_CAP_LENGTH 12 | ||
| 168 | |||
| 169 | #define VIRTIO_PCI_NOTIFY_CAP_MULT 16 | ||
| 170 | |||
| 171 | #define VIRTIO_PCI_COMMON_DFSELECT 0 | ||
| 172 | #define VIRTIO_PCI_COMMON_DF 4 | ||
| 173 | #define VIRTIO_PCI_COMMON_GFSELECT 8 | ||
| 174 | #define VIRTIO_PCI_COMMON_GF 12 | ||
| 175 | #define VIRTIO_PCI_COMMON_MSIX 16 | ||
| 176 | #define VIRTIO_PCI_COMMON_NUMQ 18 | ||
| 177 | #define VIRTIO_PCI_COMMON_STATUS 20 | ||
| 178 | #define VIRTIO_PCI_COMMON_CFGGENERATION 21 | ||
| 179 | #define VIRTIO_PCI_COMMON_Q_SELECT 22 | ||
| 180 | #define VIRTIO_PCI_COMMON_Q_SIZE 24 | ||
| 181 | #define VIRTIO_PCI_COMMON_Q_MSIX 26 | ||
| 182 | #define VIRTIO_PCI_COMMON_Q_ENABLE 28 | ||
| 183 | #define VIRTIO_PCI_COMMON_Q_NOFF 30 | ||
| 184 | #define VIRTIO_PCI_COMMON_Q_DESCLO 32 | ||
| 185 | #define VIRTIO_PCI_COMMON_Q_DESCHI 36 | ||
| 186 | #define VIRTIO_PCI_COMMON_Q_AVAILLO 40 | ||
| 187 | #define VIRTIO_PCI_COMMON_Q_AVAILHI 44 | ||
| 188 | #define VIRTIO_PCI_COMMON_Q_USEDLO 48 | ||
| 189 | #define VIRTIO_PCI_COMMON_Q_USEDHI 52 | ||
| 190 | |||
| 191 | #endif /* VIRTIO_PCI_NO_MODERN */ | ||
| 192 | |||
| 102 | #endif | 193 | #endif |
