aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 22:11:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 22:11:49 -0400
commit832fe9c222c7d431c2bff5765a0ac61bcb3df8c8 (patch)
treece4a482723db61955c47a028b14e3227d290d3be /include
parented9559d38a87a44e3bda87d73a50aab92471d7dc (diff)
parente34f87256794b87e7f4a8f1812538be7b7b5214c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: virtio: Add transport feature handling stub for virtio_ring. virtio: Rename set_features to finalize_features virtio: Formally reserve bits 28-31 to be 'transport' features. s390: use virtio_console for KVM on s390 virtio: console as a config option virtio_console: use virtqueue notification for hvc_console hvc_console: rework setup to replace irq functions with callbacks virtio_blk: check for hardsector size from host virtio: Use bus_type probe and remove methods virtio: don't always force a notification when ring is full virtio: clarify that ABI is usable by any implementations virtio: Recycle unused recv buffer pages for large skbs in net driver virtio net: Allow receiving SG packets virtio net: Add ethtool ops for SG/GSO virtio: fix virtio_net xmit of freed skb bug
Diffstat (limited to 'include')
-rw-r--r--include/asm-s390/kvm_virtio.h10
-rw-r--r--include/linux/virtio_9p.h2
-rw-r--r--include/linux/virtio_balloon.h2
-rw-r--r--include/linux/virtio_blk.h5
-rw-r--r--include/linux/virtio_config.h16
-rw-r--r--include/linux/virtio_console.h2
-rw-r--r--include/linux/virtio_net.h2
-rw-r--r--include/linux/virtio_pci.h5
-rw-r--r--include/linux/virtio_ring.h2
-rw-r--r--include/linux/virtio_rng.h2
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
56extern void s390_virtio_console_init(void);
57#else
58static 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
15struct virtio_blk_config 18struct 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 */
59struct virtio_config_ops 69struct 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));
122void vring_del_virtqueue(struct virtqueue *vq); 122void vring_del_virtqueue(struct virtqueue *vq);
123/* Filter out transport-specific feature bits. */
124void vring_transport_features(struct virtio_device *vdev);
123 125
124irqreturn_t vring_interrupt(int irq, void *_vq); 126irqreturn_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 */