Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: add virtio IDs file

Virtio IDs are spread all over the tree which makes assigning new IDs
bothersome. Putting them together should make the process less error-prone.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

authored by

Fernando Luis Vazquez Cao and committed by
Rusty Russell
3ca4f5ca 3a20210d

+24 -17
+1
Documentation/lguest/lguest.c
··· 42 42 #include <signal.h> 43 43 #include "linux/lguest_launcher.h" 44 44 #include "linux/virtio_config.h" 45 + #include <linux/virtio_ids.h> 45 46 #include "linux/virtio_net.h" 46 47 #include "linux/virtio_blk.h" 47 48 #include "linux/virtio_console.h"
+1
drivers/block/virtio_blk.c
··· 3 3 #include <linux/blkdev.h> 4 4 #include <linux/hdreg.h> 5 5 #include <linux/virtio.h> 6 + #include <linux/virtio_ids.h> 6 7 #include <linux/virtio_blk.h> 7 8 #include <linux/scatterlist.h> 8 9
+1
drivers/char/hw_random/virtio-rng.c
··· 21 21 #include <linux/scatterlist.h> 22 22 #include <linux/spinlock.h> 23 23 #include <linux/virtio.h> 24 + #include <linux/virtio_ids.h> 24 25 #include <linux/virtio_rng.h> 25 26 26 27 /* The host will fill any buffer we give it with sweet, sweet randomness. We
+1
drivers/char/virtio_console.c
··· 31 31 #include <linux/err.h> 32 32 #include <linux/init.h> 33 33 #include <linux/virtio.h> 34 + #include <linux/virtio_ids.h> 34 35 #include <linux/virtio_console.h> 35 36 #include "hvc_console.h" 36 37
+1
drivers/net/virtio_net.c
··· 22 22 #include <linux/ethtool.h> 23 23 #include <linux/module.h> 24 24 #include <linux/virtio.h> 25 + #include <linux/virtio_ids.h> 25 26 #include <linux/virtio_net.h> 26 27 #include <linux/scatterlist.h> 27 28 #include <linux/if_vlan.h>
+1
drivers/virtio/virtio_balloon.c
··· 19 19 */ 20 20 //#define DEBUG 21 21 #include <linux/virtio.h> 22 + #include <linux/virtio_ids.h> 22 23 #include <linux/virtio_balloon.h> 23 24 #include <linux/swap.h> 24 25 #include <linux/kthread.h>
-2
include/linux/virtio_9p.h
··· 4 4 * compatible drivers/servers. */ 5 5 #include <linux/virtio_config.h> 6 6 7 - /* The ID for virtio console */ 8 - #define VIRTIO_ID_9P 9 9 7 /* Maximum number of virtio channels per partition (1 for now) */ 10 8 #define MAX_9P_CHAN 1 11 9
-3
include/linux/virtio_balloon.h
··· 4 4 * compatible drivers/servers. */ 5 5 #include <linux/virtio_config.h> 6 6 7 - /* The ID for virtio_balloon */ 8 - #define VIRTIO_ID_BALLOON 5 9 - 10 7 /* The feature bitmap for virtio balloon */ 11 8 #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ 12 9
-3
include/linux/virtio_blk.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/virtio_config.h> 7 7 8 - /* The ID for virtio_block */ 9 - #define VIRTIO_ID_BLOCK 2 10 - 11 8 /* Feature bits */ 12 9 #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ 13 10 #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
-3
include/linux/virtio_console.h
··· 5 5 /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 6 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 8 /* Feature bits */ 12 9 #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 13 10
+17
include/linux/virtio_ids.h
··· 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 */
-3
include/linux/virtio_net.h
··· 6 6 #include <linux/virtio_config.h> 7 7 #include <linux/if_ether.h> 8 8 9 - /* The ID for virtio_net */ 10 - #define VIRTIO_ID_NET 1 11 - 12 9 /* The feature bitmap for virtio net */ 13 10 #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ 14 11 #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
-3
include/linux/virtio_rng.h
··· 4 4 * compatible drivers/servers. */ 5 5 #include <linux/virtio_config.h> 6 6 7 - /* The ID for virtio_rng */ 8 - #define VIRTIO_ID_RNG 4 9 - 10 7 #endif /* _LINUX_VIRTIO_RNG_H */
+1
net/9p/trans_virtio.c
··· 43 43 #include <net/9p/transport.h> 44 44 #include <linux/scatterlist.h> 45 45 #include <linux/virtio.h> 46 + #include <linux/virtio_ids.h> 46 47 #include <linux/virtio_9p.h> 47 48 48 49 #define VIRTQUEUE_NUM 128