Skip to content

Commit

Permalink
virtio: add virtio IDs file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fernando Luis Vazquez Cao authored and Rusty Russell committed Sep 23, 2009
1 parent 3a20210 commit 3ca4f5c
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 17 deletions.
1 change: 1 addition & 0 deletions Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <signal.h>
#include "linux/lguest_launcher.h"
#include "linux/virtio_config.h"
#include <linux/virtio_ids.h>
#include "linux/virtio_net.h"
#include "linux/virtio_blk.h"
#include "linux/virtio_console.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_blk.h>
#include <linux/scatterlist.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/char/hw_random/virtio-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/scatterlist.h>
#include <linux/spinlock.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_rng.h>

/* The host will fill any buffer we give it with sweet, sweet randomness. We
Expand Down
1 change: 1 addition & 0 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_console.h>
#include "hvc_console.h"

Expand Down
1 change: 1 addition & 0 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_net.h>
#include <linux/scatterlist.h>
#include <linux/if_vlan.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/virtio/virtio_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
//#define DEBUG
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_balloon.h>
#include <linux/swap.h>
#include <linux/kthread.h>
Expand Down
2 changes: 0 additions & 2 deletions include/linux/virtio_9p.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* compatible drivers/servers. */
#include <linux/virtio_config.h>

/* The ID for virtio console */
#define VIRTIO_ID_9P 9
/* Maximum number of virtio channels per partition (1 for now) */
#define MAX_9P_CHAN 1

Expand Down
3 changes: 0 additions & 3 deletions include/linux/virtio_balloon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* compatible drivers/servers. */
#include <linux/virtio_config.h>

/* The ID for virtio_balloon */
#define VIRTIO_ID_BALLOON 5

/* The feature bitmap for virtio balloon */
#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */

Expand Down
3 changes: 0 additions & 3 deletions include/linux/virtio_blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include <linux/types.h>
#include <linux/virtio_config.h>

/* The ID for virtio_block */
#define VIRTIO_ID_BLOCK 2

/* Feature bits */
#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
Expand Down
3 changes: 0 additions & 3 deletions include/linux/virtio_console.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
* anyone can use the definitions to implement compatible drivers/servers. */

/* The ID for virtio console */
#define VIRTIO_ID_CONSOLE 3

/* Feature bits */
#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */

Expand Down
17 changes: 17 additions & 0 deletions include/linux/virtio_ids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef _LINUX_VIRTIO_IDS_H
#define _LINUX_VIRTIO_IDS_H
/*
* Virtio IDs
*
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*/

#define VIRTIO_ID_NET 1 /* virtio net */
#define VIRTIO_ID_BLOCK 2 /* virtio block */
#define VIRTIO_ID_CONSOLE 3 /* virtio console */
#define VIRTIO_ID_RNG 4 /* virtio ring */
#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
#define VIRTIO_ID_9P 9 /* 9p virtio console */

#endif /* _LINUX_VIRTIO_IDS_H */
3 changes: 0 additions & 3 deletions include/linux/virtio_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#include <linux/virtio_config.h>
#include <linux/if_ether.h>

/* The ID for virtio_net */
#define VIRTIO_ID_NET 1

/* The feature bitmap for virtio net */
#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
Expand Down
3 changes: 0 additions & 3 deletions include/linux/virtio_rng.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
* compatible drivers/servers. */
#include <linux/virtio_config.h>

/* The ID for virtio_rng */
#define VIRTIO_ID_RNG 4

#endif /* _LINUX_VIRTIO_RNG_H */
1 change: 1 addition & 0 deletions net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <net/9p/transport.h>
#include <linux/scatterlist.h>
#include <linux/virtio.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_9p.h>

#define VIRTQUEUE_NUM 128
Expand Down

0 comments on commit 3ca4f5c

Please sign in to comment.