pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 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 | |
ths | 8ccc2ac | 2007-12-10 02:58:34 +0000 | [diff] [blame] | 10 | typedef struct SCSIDeviceState SCSIDeviceState; |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 11 | typedef struct SCSIDevice SCSIDevice; |
| 12 | typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag, |
| 13 | uint32_t arg); |
| 14 | |
ths | 8ccc2ac | 2007-12-10 02:58:34 +0000 | [diff] [blame] | 15 | struct SCSIDevice |
| 16 | { |
| 17 | SCSIDeviceState *state; |
| 18 | void (*destroy)(SCSIDevice *s); |
| 19 | int32_t (*send_command)(SCSIDevice *s, uint32_t tag, uint8_t *buf, |
| 20 | int lun); |
| 21 | void (*read_data)(SCSIDevice *s, uint32_t tag); |
| 22 | int (*write_data)(SCSIDevice *s, uint32_t tag); |
| 23 | void (*cancel_io)(SCSIDevice *s, uint32_t tag); |
| 24 | uint8_t *(*get_buf)(SCSIDevice *s, uint32_t tag); |
| 25 | }; |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 26 | |
ths | 8ccc2ac | 2007-12-10 02:58:34 +0000 | [diff] [blame] | 27 | SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq, |
| 28 | scsi_completionfn completion, void *opaque); |
ths | 985a03b | 2007-12-24 16:10:43 +0000 | [diff] [blame] | 29 | SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq, |
| 30 | scsi_completionfn completion, void *opaque); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 31 | |
| 32 | /* cdrom.c */ |
| 33 | int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track); |
| 34 | int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num); |
| 35 | |
| 36 | #endif |