]> git.proxmox.com Git - qemu.git/blob - hw/scsi-disk.h
Break up vl.h.
[qemu.git] / hw / scsi-disk.h
1 #ifndef SCSI_DISK_H
2 #define SCSI_DISK_H
3
4 /* scsi-disk.c */
5 enum scsi_reason {
6 SCSI_REASON_DONE, /* Command complete. */
7 SCSI_REASON_DATA /* Transfer complete, more data required. */
8 };
9
10 typedef struct SCSIDevice SCSIDevice;
11 typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag,
12 uint32_t arg);
13
14 SCSIDevice *scsi_disk_init(BlockDriverState *bdrv,
15 int tcq,
16 scsi_completionfn completion,
17 void *opaque);
18 void scsi_disk_destroy(SCSIDevice *s);
19
20 int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf, int lun);
21 /* SCSI data transfers are asynchrnonous. However, unlike the block IO
22 layer the completion routine may be called directly by
23 scsi_{read,write}_data. */
24 void scsi_read_data(SCSIDevice *s, uint32_t tag);
25 int scsi_write_data(SCSIDevice *s, uint32_t tag);
26 void scsi_cancel_io(SCSIDevice *s, uint32_t tag);
27 uint8_t *scsi_get_buf(SCSIDevice *s, uint32_t tag);
28
29 /* cdrom.c */
30 int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
31 int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
32
33 #endif