aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio.h2
-rw-r--r--include/linux/virtio_9p.h2
-rw-r--r--include/linux/virtio_balloon.h3
-rw-r--r--include/linux/virtio_blk.h18
-rw-r--r--include/linux/virtio_console.h3
-rw-r--r--include/linux/virtio_ids.h17
-rw-r--r--include/linux/virtio_net.h3
-rw-r--r--include/linux/virtio_rng.h3
8 files changed, 33 insertions, 18 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 4fca4f5440ba..057a2e010758 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -34,7 +34,7 @@ struct virtqueue {
34 * out_num: the number of sg readable by other side 34 * out_num: the number of sg readable by other side
35 * in_num: the number of sg which are writable (after readable ones) 35 * in_num: the number of sg which are writable (after readable ones)
36 * data: the token identifying the buffer. 36 * data: the token identifying the buffer.
37 * Returns 0 or an error. 37 * Returns remaining capacity of queue (sg segments) or a negative error.
38 * @kick: update after add_buf 38 * @kick: update after add_buf
39 * vq: the struct virtqueue 39 * vq: the struct virtqueue
40 * After one or more add_buf calls, invoke this to kick the other side. 40 * After one or more add_buf calls, invoke this to kick the other side.
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index b3c4a60ceeb3..ea7226a45acb 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -4,8 +4,6 @@
4 * compatible drivers/servers. */ 4 * compatible drivers/servers. */
5#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
6 6
7/* The ID for virtio console */
8#define VIRTIO_ID_9P 9
9/* Maximum number of virtio channels per partition (1 for now) */ 7/* Maximum number of virtio channels per partition (1 for now) */
10#define MAX_9P_CHAN 1 8#define MAX_9P_CHAN 1
11 9
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h
index 8726ff77763e..09d730085060 100644
--- a/include/linux/virtio_balloon.h
+++ b/include/linux/virtio_balloon.h
@@ -4,9 +4,6 @@
4 * compatible drivers/servers. */ 4 * compatible drivers/servers. */
5#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
6 6
7/* The ID for virtio_balloon */
8#define VIRTIO_ID_BALLOON 5
9
10/* The feature bitmap for virtio balloon */ 7/* The feature bitmap for virtio balloon */
11#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ 8#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
12 9
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index 8dab9f2b8832..15cb666581d7 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -5,9 +5,6 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/virtio_config.h> 6#include <linux/virtio_config.h>
7 7
8/* The ID for virtio_block */
9#define VIRTIO_ID_BLOCK 2
10
11/* Feature bits */ 8/* Feature bits */
12#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ 9#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
13#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ 10#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
@@ -17,6 +14,7 @@
17#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 14#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
18#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ 15#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
19#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ 16#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */
17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */
20 18
21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ 19#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */
22 20
@@ -38,6 +36,17 @@ struct virtio_blk_config {
38 __u8 identify[VIRTIO_BLK_ID_BYTES]; 36 __u8 identify[VIRTIO_BLK_ID_BYTES];
39} __attribute__((packed)); 37} __attribute__((packed));
40 38
39/*
40 * Command types
41 *
42 * Usage is a bit tricky as some bits are used as flags and some are not.
43 *
44 * Rules:
45 * VIRTIO_BLK_T_OUT may be combined with VIRTIO_BLK_T_SCSI_CMD or
46 * VIRTIO_BLK_T_BARRIER. VIRTIO_BLK_T_FLUSH is a command of its own
47 * and may not be combined with any of the other flags.
48 */
49
41/* These two define direction. */ 50/* These two define direction. */
42#define VIRTIO_BLK_T_IN 0 51#define VIRTIO_BLK_T_IN 0
43#define VIRTIO_BLK_T_OUT 1 52#define VIRTIO_BLK_T_OUT 1
@@ -45,6 +54,9 @@ struct virtio_blk_config {
45/* This bit says it's a scsi command, not an actual read or write. */ 54/* This bit says it's a scsi command, not an actual read or write. */
46#define VIRTIO_BLK_T_SCSI_CMD 2 55#define VIRTIO_BLK_T_SCSI_CMD 2
47 56
57/* Cache flush command */
58#define VIRTIO_BLK_T_FLUSH 4
59
48/* Barrier before this op. */ 60/* Barrier before this op. */
49#define VIRTIO_BLK_T_BARRIER 0x80000000 61#define VIRTIO_BLK_T_BARRIER 0x80000000
50 62
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index dc161115ae35..b5f519806014 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -5,9 +5,6 @@
5/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 5/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
6 * anyone can use the definitions to implement compatible drivers/servers. */ 6 * anyone can use the definitions to implement compatible drivers/servers. */
7 7
8/* The ID for virtio console */
9#define VIRTIO_ID_CONSOLE 3
10
11/* Feature bits */ 8/* Feature bits */
12#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 9#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
13 10
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h
new file mode 100644
index 000000000000..06660c0a78d7
--- /dev/null
+++ b/include/linux/virtio_ids.h
@@ -0,0 +1,17 @@
1#ifndef _LINUX_VIRTIO_IDS_H
2#define _LINUX_VIRTIO_IDS_H
3/*
4 * Virtio IDs
5 *
6 * This header is BSD licensed so anyone can use the definitions to implement
7 * compatible drivers/servers.
8 */
9
10#define VIRTIO_ID_NET 1 /* virtio net */
11#define VIRTIO_ID_BLOCK 2 /* virtio block */
12#define VIRTIO_ID_CONSOLE 3 /* virtio console */
13#define VIRTIO_ID_RNG 4 /* virtio ring */
14#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
15#define VIRTIO_ID_9P 9 /* 9p virtio console */
16
17#endif /* _LINUX_VIRTIO_IDS_H */
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index d8dd539c9f48..1f41734bbb77 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -6,9 +6,6 @@
6#include <linux/virtio_config.h> 6#include <linux/virtio_config.h>
7#include <linux/if_ether.h> 7#include <linux/if_ether.h>
8 8
9/* The ID for virtio_net */
10#define VIRTIO_ID_NET 1
11
12/* The feature bitmap for virtio net */ 9/* The feature bitmap for virtio net */
13#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ 10#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
14#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ 11#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h
index 1a85dab8a940..48121c3c434b 100644
--- a/include/linux/virtio_rng.h
+++ b/include/linux/virtio_rng.h
@@ -4,7 +4,4 @@
4 * compatible drivers/servers. */ 4 * compatible drivers/servers. */
5#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
6 6
7/* The ID for virtio_rng */
8#define VIRTIO_ID_RNG 4
9
10#endif /* _LINUX_VIRTIO_RNG_H */ 7#endif /* _LINUX_VIRTIO_RNG_H */