00001 #ifndef SCSI_DISK_H
00002 #define SCSI_DISK_H
00003
00004
00005 enum scsi_reason {
00006 SCSI_REASON_DONE,
00007 SCSI_REASON_DATA
00008 };
00009
00010 typedef struct SCSIDeviceState SCSIDeviceState;
00011 typedef struct SCSIDevice SCSIDevice;
00012 typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag,
00013 uint32_t arg);
00014
00015 struct SCSIDevice
00016 {
00017 SCSIDeviceState *state;
00018 void (*destroy)(SCSIDevice *s);
00019 int32_t (*send_command)(SCSIDevice *s, uint32_t tag, uint8_t *buf,
00020 int lun);
00021 void (*read_data)(SCSIDevice *s, uint32_t tag);
00022 int (*write_data)(SCSIDevice *s, uint32_t tag);
00023 void (*cancel_io)(SCSIDevice *s, uint32_t tag);
00024 uint8_t *(*get_buf)(SCSIDevice *s, uint32_t tag);
00025 };
00026
00027 SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
00028 scsi_completionfn completion, void *opaque);
00029 SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
00030 scsi_completionfn completion, void *opaque);
00031
00032
00033 int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
00034 int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
00035
00036 #endif