diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-s390/kvm_virtio.h | 10 | ||||
-rw-r--r-- | include/linux/virtio_9p.h | 2 | ||||
-rw-r--r-- | include/linux/virtio_balloon.h | 2 | ||||
-rw-r--r-- | include/linux/virtio_blk.h | 5 | ||||
-rw-r--r-- | include/linux/virtio_config.h | 16 | ||||
-rw-r--r-- | include/linux/virtio_console.h | 2 | ||||
-rw-r--r-- | include/linux/virtio_net.h | 2 | ||||
-rw-r--r-- | include/linux/virtio_pci.h | 5 | ||||
-rw-r--r-- | include/linux/virtio_ring.h | 2 | ||||
-rw-r--r-- | include/linux/virtio_rng.h | 2 |
10 files changed, 42 insertions, 6 deletions
diff --git a/include/asm-s390/kvm_virtio.h b/include/asm-s390/kvm_virtio.h index 5c871a990c29..146100224def 100644 --- a/include/asm-s390/kvm_virtio.h +++ b/include/asm-s390/kvm_virtio.h | |||
@@ -50,4 +50,14 @@ struct kvm_vqconfig { | |||
50 | #define KVM_S390_VIRTIO_RESET 1 | 50 | #define KVM_S390_VIRTIO_RESET 1 |
51 | #define KVM_S390_VIRTIO_SET_STATUS 2 | 51 | #define KVM_S390_VIRTIO_SET_STATUS 2 |
52 | 52 | ||
53 | #ifdef __KERNEL__ | ||
54 | /* early virtio console setup */ | ||
55 | #ifdef CONFIG_VIRTIO_CONSOLE | ||
56 | extern void s390_virtio_console_init(void); | ||
57 | #else | ||
58 | static inline void s390_virtio_console_init(void) | ||
59 | { | ||
60 | } | ||
61 | #endif /* CONFIG_VIRTIO_CONSOLE */ | ||
62 | #endif /* __KERNEL__ */ | ||
53 | #endif | 63 | #endif |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index 8eff0b53910b..b3c4a60ceeb3 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_9P_H | 1 | #ifndef _LINUX_VIRTIO_9P_H |
2 | #define _LINUX_VIRTIO_9P_H | 2 | #define _LINUX_VIRTIO_9P_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
4 | * compatible drivers/servers. */ | ||
3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
4 | 6 | ||
5 | /* The ID for virtio console */ | 7 | /* The ID for virtio console */ |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 979524ee75b7..c30c7bfbf39b 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_BALLOON_H | 1 | #ifndef _LINUX_VIRTIO_BALLOON_H |
2 | #define _LINUX_VIRTIO_BALLOON_H | 2 | #define _LINUX_VIRTIO_BALLOON_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
4 | * compatible drivers/servers. */ | ||
3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
4 | 6 | ||
5 | /* The ID for virtio_balloon */ | 7 | /* The ID for virtio_balloon */ |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 5f79a5f9de79..c1aef85243bf 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_BLK_H | 1 | #ifndef _LINUX_VIRTIO_BLK_H |
2 | #define _LINUX_VIRTIO_BLK_H | 2 | #define _LINUX_VIRTIO_BLK_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
4 | * compatible drivers/servers. */ | ||
3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
4 | 6 | ||
5 | /* The ID for virtio_block */ | 7 | /* The ID for virtio_block */ |
@@ -11,6 +13,7 @@ | |||
11 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 13 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
12 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | 14 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ |
13 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 15 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
16 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | ||
14 | 17 | ||
15 | struct virtio_blk_config | 18 | struct virtio_blk_config |
16 | { | 19 | { |
@@ -26,6 +29,8 @@ struct virtio_blk_config | |||
26 | __u8 heads; | 29 | __u8 heads; |
27 | __u8 sectors; | 30 | __u8 sectors; |
28 | } geometry; | 31 | } geometry; |
32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ | ||
33 | __u32 blk_size; | ||
29 | } __attribute__((packed)); | 34 | } __attribute__((packed)); |
30 | 35 | ||
31 | /* These two define direction. */ | 36 | /* These two define direction. */ |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index f364bbf63c34..bf8ec283b232 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -1,5 +1,8 @@ | |||
1 | #ifndef _LINUX_VIRTIO_CONFIG_H | 1 | #ifndef _LINUX_VIRTIO_CONFIG_H |
2 | #define _LINUX_VIRTIO_CONFIG_H | 2 | #define _LINUX_VIRTIO_CONFIG_H |
3 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | ||
4 | * anyone can use the definitions to implement compatible drivers/servers. */ | ||
5 | |||
3 | /* Virtio devices use a standardized configuration space to define their | 6 | /* Virtio devices use a standardized configuration space to define their |
4 | * features and pass configuration information, but each implementation can | 7 | * features and pass configuration information, but each implementation can |
5 | * store and access that space differently. */ | 8 | * store and access that space differently. */ |
@@ -15,6 +18,12 @@ | |||
15 | /* We've given up on this device. */ | 18 | /* We've given up on this device. */ |
16 | #define VIRTIO_CONFIG_S_FAILED 0x80 | 19 | #define VIRTIO_CONFIG_S_FAILED 0x80 |
17 | 20 | ||
21 | /* Some virtio feature bits (currently bits 28 through 31) are reserved for the | ||
22 | * transport being used (eg. virtio_ring), the rest are per-device feature | ||
23 | * bits. */ | ||
24 | #define VIRTIO_TRANSPORT_F_START 28 | ||
25 | #define VIRTIO_TRANSPORT_F_END 32 | ||
26 | |||
18 | /* Do we get callbacks when the ring is completely used, even if we've | 27 | /* Do we get callbacks when the ring is completely used, even if we've |
19 | * suppressed them? */ | 28 | * suppressed them? */ |
20 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
@@ -52,9 +61,10 @@ | |||
52 | * @get_features: get the array of feature bits for this device. | 61 | * @get_features: get the array of feature bits for this device. |
53 | * vdev: the virtio_device | 62 | * vdev: the virtio_device |
54 | * Returns the first 32 feature bits (all we currently need). | 63 | * Returns the first 32 feature bits (all we currently need). |
55 | * @set_features: confirm what device features we'll be using. | 64 | * @finalize_features: confirm what device features we'll be using. |
56 | * vdev: the virtio_device | 65 | * vdev: the virtio_device |
57 | * feature: the first 32 feature bits | 66 | * This gives the final feature bits for the device: it can change |
67 | * the dev->feature bits if it wants. | ||
58 | */ | 68 | */ |
59 | struct virtio_config_ops | 69 | struct virtio_config_ops |
60 | { | 70 | { |
@@ -70,7 +80,7 @@ struct virtio_config_ops | |||
70 | void (*callback)(struct virtqueue *)); | 80 | void (*callback)(struct virtqueue *)); |
71 | void (*del_vq)(struct virtqueue *vq); | 81 | void (*del_vq)(struct virtqueue *vq); |
72 | u32 (*get_features)(struct virtio_device *vdev); | 82 | u32 (*get_features)(struct virtio_device *vdev); |
73 | void (*set_features)(struct virtio_device *vdev, u32 features); | 83 | void (*finalize_features)(struct virtio_device *vdev); |
74 | }; | 84 | }; |
75 | 85 | ||
76 | /* If driver didn't advertise the feature, it will never appear. */ | 86 | /* If driver didn't advertise the feature, it will never appear. */ |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index ed2d4ead7eb7..19a0da0dba41 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_VIRTIO_CONSOLE_H | 1 | #ifndef _LINUX_VIRTIO_CONSOLE_H |
2 | #define _LINUX_VIRTIO_CONSOLE_H | 2 | #define _LINUX_VIRTIO_CONSOLE_H |
3 | #include <linux/virtio_config.h> | 3 | #include <linux/virtio_config.h> |
4 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | ||
5 | * anyone can use the definitions to implement compatible drivers/servers. */ | ||
4 | 6 | ||
5 | /* The ID for virtio console */ | 7 | /* The ID for virtio console */ |
6 | #define VIRTIO_ID_CONSOLE 3 | 8 | #define VIRTIO_ID_CONSOLE 3 |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 38c0571820fb..5e33761b9b8a 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_NET_H | 1 | #ifndef _LINUX_VIRTIO_NET_H |
2 | #define _LINUX_VIRTIO_NET_H | 2 | #define _LINUX_VIRTIO_NET_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
4 | * compatible drivers/servers. */ | ||
3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
4 | 6 | ||
5 | /* The ID for virtio_net */ | 7 | /* The ID for virtio_net */ |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index b3151659cf49..cdef35742932 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
@@ -9,9 +9,8 @@ | |||
9 | * Authors: | 9 | * Authors: |
10 | * Anthony Liguori <aliguori@us.ibm.com> | 10 | * Anthony Liguori <aliguori@us.ibm.com> |
11 | * | 11 | * |
12 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | 12 | * This header is BSD licensed so anyone can use the definitions to implement |
13 | * See the COPYING file in the top-level directory. | 13 | * compatible drivers/servers. |
14 | * | ||
15 | */ | 14 | */ |
16 | 15 | ||
17 | #ifndef _LINUX_VIRTIO_PCI_H | 16 | #ifndef _LINUX_VIRTIO_PCI_H |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index abe481ed990e..c4a598fb3826 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -120,6 +120,8 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
120 | void (*notify)(struct virtqueue *vq), | 120 | void (*notify)(struct virtqueue *vq), |
121 | void (*callback)(struct virtqueue *vq)); | 121 | void (*callback)(struct virtqueue *vq)); |
122 | void vring_del_virtqueue(struct virtqueue *vq); | 122 | void vring_del_virtqueue(struct virtqueue *vq); |
123 | /* Filter out transport-specific feature bits. */ | ||
124 | void vring_transport_features(struct virtio_device *vdev); | ||
123 | 125 | ||
124 | irqreturn_t vring_interrupt(int irq, void *_vq); | 126 | irqreturn_t vring_interrupt(int irq, void *_vq); |
125 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h index 331afb6c9f62..1a85dab8a940 100644 --- a/include/linux/virtio_rng.h +++ b/include/linux/virtio_rng.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_RNG_H | 1 | #ifndef _LINUX_VIRTIO_RNG_H |
2 | #define _LINUX_VIRTIO_RNG_H | 2 | #define _LINUX_VIRTIO_RNG_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
4 | * compatible drivers/servers. */ | ||
3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
4 | 6 | ||
5 | /* The ID for virtio_rng */ | 7 | /* The ID for virtio_rng */ |