diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-05-12 16:31:51 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-05-12 17:55:49 -0400 |
commit | 452a6b2bb6de677acdd2ccb8b39cf6e8fe06f306 (patch) | |
tree | bbbd67999fd1e9c0e108e87c8a1d91e0e88424e8 | |
parent | b0f801273f7359a7d91fc94f5c6bf216bc17aaa1 (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>
-rw-r--r-- | drivers/block/xen-blkback/common.h | 72 | ||||
-rw-r--r-- | include/xen/blkif.h | 95 |
2 files changed, 71 insertions, 96 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. */ | ||
57 | struct blkif_common_request { | ||
58 | char dummy; | ||
59 | }; | ||
60 | struct blkif_common_response { | ||
61 | char dummy; | ||
62 | }; | ||
63 | |||
64 | /* i386 protocol version */ | ||
65 | #pragma pack(push, 4) | ||
66 | struct 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 | }; | ||
74 | struct 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 | }; | ||
79 | typedef struct blkif_x86_32_request blkif_x86_32_request_t; | ||
80 | typedef struct blkif_x86_32_response blkif_x86_32_response_t; | ||
81 | #pragma pack(pop) | ||
82 | |||
83 | /* x86_64 protocol version */ | ||
84 | struct 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 | }; | ||
92 | struct 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 | }; | ||
97 | typedef struct blkif_x86_64_request blkif_x86_64_request_t; | ||
98 | typedef struct blkif_x86_64_response blkif_x86_64_response_t; | ||
99 | |||
100 | DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, | ||
101 | struct blkif_common_response); | ||
102 | DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, | ||
103 | struct blkif_x86_32_response); | ||
104 | DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, | ||
105 | struct blkif_x86_64_response); | ||
106 | |||
107 | union 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 | |||
114 | enum blkif_protocol { | ||
115 | BLKIF_PROTOCOL_NATIVE = 1, | ||
116 | BLKIF_PROTOCOL_X86_32 = 2, | ||
117 | BLKIF_PROTOCOL_X86_64 = 3, | ||
118 | }; | ||
119 | |||
50 | struct vbd { | 120 | struct 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; |
diff --git a/include/xen/blkif.h b/include/xen/blkif.h deleted file mode 100644 index 3c9ca7a93ba4..000000000000 --- a/include/xen/blkif.h +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | /* | ||
2 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
3 | * of this software and associated documentation files (the "Software"), to | ||
4 | * deal in the Software without restriction, including without limitation the | ||
5 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
6 | * sell copies of the Software, and to permit persons to whom the Software is | ||
7 | * furnished to do so, subject to the following conditions: | ||
8 | * | ||
9 | * The above copyright notice and this permission notice shall be included in | ||
10 | * all copies or substantial portions of the Software. | ||
11 | * | ||
12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
18 | * DEALINGS IN THE SOFTWARE. | ||
19 | */ | ||
20 | |||
21 | #ifndef __XEN_BLKIF_H__ | ||
22 | #define __XEN_BLKIF_H__ | ||
23 | |||
24 | #include <xen/interface/io/ring.h> | ||
25 | #include <xen/interface/io/blkif.h> | ||
26 | #include <xen/interface/io/protocols.h> | ||
27 | |||
28 | /* Not a real protocol. Used to generate ring structs which contain | ||
29 | * the elements common to all protocols only. This way we get a | ||
30 | * compiler-checkable way to use common struct elements, so we can | ||
31 | * avoid using switch(protocol) in a number of places. */ | ||
32 | struct blkif_common_request { | ||
33 | char dummy; | ||
34 | }; | ||
35 | struct blkif_common_response { | ||
36 | char dummy; | ||
37 | }; | ||
38 | |||
39 | /* i386 protocol version */ | ||
40 | #pragma pack(push, 4) | ||
41 | struct blkif_x86_32_request { | ||
42 | uint8_t operation; /* BLKIF_OP_??? */ | ||
43 | uint8_t nr_segments; /* number of segments */ | ||
44 | blkif_vdev_t handle; /* only for read/write requests */ | ||
45 | uint64_t id; /* private guest value, echoed in resp */ | ||
46 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ | ||
47 | struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | ||
48 | }; | ||
49 | struct blkif_x86_32_response { | ||
50 | uint64_t id; /* copied from request */ | ||
51 | uint8_t operation; /* copied from request */ | ||
52 | int16_t status; /* BLKIF_RSP_??? */ | ||
53 | }; | ||
54 | typedef struct blkif_x86_32_request blkif_x86_32_request_t; | ||
55 | typedef struct blkif_x86_32_response blkif_x86_32_response_t; | ||
56 | #pragma pack(pop) | ||
57 | |||
58 | /* x86_64 protocol version */ | ||
59 | struct blkif_x86_64_request { | ||
60 | uint8_t operation; /* BLKIF_OP_??? */ | ||
61 | uint8_t nr_segments; /* number of segments */ | ||
62 | blkif_vdev_t handle; /* only for read/write requests */ | ||
63 | uint64_t __attribute__((__aligned__(8))) id; | ||
64 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ | ||
65 | struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | ||
66 | }; | ||
67 | struct blkif_x86_64_response { | ||
68 | uint64_t __attribute__((__aligned__(8))) id; | ||
69 | uint8_t operation; /* copied from request */ | ||
70 | int16_t status; /* BLKIF_RSP_??? */ | ||
71 | }; | ||
72 | typedef struct blkif_x86_64_request blkif_x86_64_request_t; | ||
73 | typedef struct blkif_x86_64_response blkif_x86_64_response_t; | ||
74 | |||
75 | DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, | ||
76 | struct blkif_common_response); | ||
77 | DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, | ||
78 | struct blkif_x86_32_response); | ||
79 | DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, | ||
80 | struct blkif_x86_64_response); | ||
81 | |||
82 | union blkif_back_rings { | ||
83 | struct blkif_back_ring native; | ||
84 | struct blkif_common_back_ring common; | ||
85 | struct blkif_x86_32_back_ring x86_32; | ||
86 | struct blkif_x86_64_back_ring x86_64; | ||
87 | }; | ||
88 | |||
89 | enum blkif_protocol { | ||
90 | BLKIF_PROTOCOL_NATIVE = 1, | ||
91 | BLKIF_PROTOCOL_X86_32 = 2, | ||
92 | BLKIF_PROTOCOL_X86_64 = 3, | ||
93 | }; | ||
94 | |||
95 | #endif /* __XEN_BLKIF_H__ */ | ||