3 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
6 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
15 #ifndef __XEN_DRIVERS_BLOCK_H__
16 #define __XEN_DRIVERS_BLOCK_H__
17 #include <xen/interface/io/blkif.h>
27 struct xlbd_major_info
32 struct xlbd_type_info *type;
37 unsigned long request;
38 unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST];
41 #define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
46 struct disk *xb_disk; /* disk params */
47 struct bio_queue_head xb_bioq; /* sort queue */
50 struct blkfront_info *xb_info;
51 LIST_ENTRY(xb_softc) entry;
52 #define XB_OPEN (1<<0) /* drive is open (can't shut down) */
57 * We have one of these per vbd, whether ide, scsi or 'other'. They
58 * hang in private_data off the gendisk structure. We may end up
59 * putting all kinds of interesting stuff here :-)
70 blkif_front_ring_t ring;
72 struct xlbd_major_info *mi;
75 struct work_struct work;
77 struct gnttab_free_callback callback;
78 struct blk_shadow shadow[BLK_RING_SIZE];
79 unsigned long shadow_free;
84 * The number of people holding this device open. We won't allow a
85 * hot-unplug unless this is 0.
89 /* Note that xlvbd_add doesn't call add_disk for you: you're expected
90 to call add_disk on info->gd once the disk is properly connected
92 int xlvbd_add(device_t, blkif_sector_t capacity, int device,
93 uint16_t vdisk_info, uint16_t sector_size, struct blkfront_info *info);
94 void xlvbd_del(struct blkfront_info *info);
96 #endif /* __XEN_DRIVERS_BLOCK_H__ */