Statistics
| Branch: | Revision:

root / hw / scsi-disk.h @ 37873241

History | View | Annotate | Download (1.2 kB)

1 87ecb68b pbrook
#ifndef SCSI_DISK_H
2 87ecb68b pbrook
#define SCSI_DISK_H
3 87ecb68b pbrook
4 87ecb68b pbrook
/* scsi-disk.c */
5 87ecb68b pbrook
enum scsi_reason {
6 87ecb68b pbrook
    SCSI_REASON_DONE, /* Command complete.  */
7 87ecb68b pbrook
    SCSI_REASON_DATA  /* Transfer complete, more data required.  */
8 87ecb68b pbrook
};
9 87ecb68b pbrook
10 8ccc2ace ths
typedef struct SCSIDeviceState SCSIDeviceState;
11 87ecb68b pbrook
typedef struct SCSIDevice SCSIDevice;
12 87ecb68b pbrook
typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag,
13 87ecb68b pbrook
                                  uint32_t arg);
14 87ecb68b pbrook
15 8ccc2ace ths
struct SCSIDevice
16 8ccc2ace ths
{
17 8ccc2ace ths
    SCSIDeviceState *state;
18 8ccc2ace ths
    void (*destroy)(SCSIDevice *s);
19 8ccc2ace ths
    int32_t (*send_command)(SCSIDevice *s, uint32_t tag, uint8_t *buf,
20 8ccc2ace ths
                            int lun);
21 8ccc2ace ths
    void (*read_data)(SCSIDevice *s, uint32_t tag);
22 8ccc2ace ths
    int (*write_data)(SCSIDevice *s, uint32_t tag);
23 8ccc2ace ths
    void (*cancel_io)(SCSIDevice *s, uint32_t tag);
24 8ccc2ace ths
    uint8_t *(*get_buf)(SCSIDevice *s, uint32_t tag);
25 8ccc2ace ths
};
26 87ecb68b pbrook
27 8ccc2ace ths
SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
28 8ccc2ace ths
                           scsi_completionfn completion, void *opaque);
29 985a03b0 ths
SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
30 985a03b0 ths
                           scsi_completionfn completion, void *opaque);
31 87ecb68b pbrook
32 87ecb68b pbrook
/* cdrom.c */
33 87ecb68b pbrook
int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
34 87ecb68b pbrook
int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
35 87ecb68b pbrook
36 87ecb68b pbrook
#endif