aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-05-12 16:31:51 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-05-12 17:55:49 -0400
commit452a6b2bb6de677acdd2ccb8b39cf6e8fe06f306 (patch)
treebbbd67999fd1e9c0e108e87c8a1d91e0e88424e8 /drivers/block
parentb0f801273f7359a7d91fc94f5c6bf216bc17aaa1 (diff)
xen/blkback: Move include/xen/blkif.h into drivers/block/xen-blkback/common.h
Not point of the blkif.h file. It is not used by the frontend. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/common.h72
1 files changed, 71 insertions, 1 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 629546558a47..b8856fe2568f 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -38,15 +38,85 @@
38#include <asm/setup.h> 38#include <asm/setup.h>
39#include <asm/pgalloc.h> 39#include <asm/pgalloc.h>
40#include <asm/hypervisor.h> 40#include <asm/hypervisor.h>
41#include <xen/blkif.h>
42#include <xen/grant_table.h> 41#include <xen/grant_table.h>
43#include <xen/xenbus.h> 42#include <xen/xenbus.h>
43#include <xen/interface/io/ring.h>
44#include <xen/interface/io/blkif.h>
45#include <xen/interface/io/protocols.h>
44 46
45#define DRV_PFX "xen-blkback:" 47#define DRV_PFX "xen-blkback:"
46#define DPRINTK(fmt, args...) \ 48#define DPRINTK(fmt, args...) \
47 pr_debug(DRV_PFX "(%s:%d) " fmt ".\n", \ 49 pr_debug(DRV_PFX "(%s:%d) " fmt ".\n", \
48 __func__, __LINE__, ##args) 50 __func__, __LINE__, ##args)
49 51
52
53/* Not a real protocol. Used to generate ring structs which contain
54 * the elements common to all protocols only. This way we get a
55 * compiler-checkable way to use common struct elements, so we can
56 * avoid using switch(protocol) in a number of places. */
57struct blkif_common_request {
58 char dummy;
59};
60struct blkif_common_response {
61 char dummy;
62};
63
64/* i386 protocol version */
65#pragma pack(push, 4)
66struct blkif_x86_32_request {
67 uint8_t operation; /* BLKIF_OP_??? */
68 uint8_t nr_segments; /* number of segments */
69 blkif_vdev_t handle; /* only for read/write requests */
70 uint64_t id; /* private guest value, echoed in resp */
71 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
72 struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
73};
74struct blkif_x86_32_response {
75 uint64_t id; /* copied from request */
76 uint8_t operation; /* copied from request */
77 int16_t status; /* BLKIF_RSP_??? */
78};
79typedef struct blkif_x86_32_request blkif_x86_32_request_t;
80typedef struct blkif_x86_32_response blkif_x86_32_response_t;
81#pragma pack(pop)
82
83/* x86_64 protocol version */
84struct blkif_x86_64_request {
85 uint8_t operation; /* BLKIF_OP_??? */
86 uint8_t nr_segments; /* number of segments */
87 blkif_vdev_t handle; /* only for read/write requests */
88 uint64_t __attribute__((__aligned__(8))) id;
89 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
90 struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
91};
92struct blkif_x86_64_response {
93 uint64_t __attribute__((__aligned__(8))) id;
94 uint8_t operation; /* copied from request */
95 int16_t status; /* BLKIF_RSP_??? */
96};
97typedef struct blkif_x86_64_request blkif_x86_64_request_t;
98typedef struct blkif_x86_64_response blkif_x86_64_response_t;
99
100DEFINE_RING_TYPES(blkif_common, struct blkif_common_request,
101 struct blkif_common_response);
102DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request,
103 struct blkif_x86_32_response);
104DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request,
105 struct blkif_x86_64_response);
106
107union blkif_back_rings {
108 struct blkif_back_ring native;
109 struct blkif_common_back_ring common;
110 struct blkif_x86_32_back_ring x86_32;
111 struct blkif_x86_64_back_ring x86_64;
112};
113
114enum blkif_protocol {
115 BLKIF_PROTOCOL_NATIVE = 1,
116 BLKIF_PROTOCOL_X86_32 = 2,
117 BLKIF_PROTOCOL_X86_64 = 3,
118};
119
50struct vbd { 120struct vbd {
51 /* What the domain refers to this vbd as. */ 121 /* What the domain refers to this vbd as. */
52 blkif_vdev_t handle; 122 blkif_vdev_t handle;