aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-03 10:49:08 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-12 08:27:36 -0500
commit8dbd4574882cade8261c2b6225df68a65345c75c (patch)
tree59101dbc9f0c5d838294da898122fe6e0c59881f /hw/scsi.h
parentb45ef674f4c403398e75c6be02e27a0bfa813a11 (diff)
scsi: introduce SCSIReqOps
This will let allow requests to be dispatched through different callbacks, either common or per-device. This patch adjusts the API, the next one will move members to SCSIReqOps. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index c1cb987cf6..ee76c64bc5 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -14,6 +14,7 @@ typedef struct SCSIBusOps SCSIBusOps;
typedef struct SCSIDevice SCSIDevice;
typedef struct SCSIDeviceInfo SCSIDeviceInfo;
typedef struct SCSIRequest SCSIRequest;
+typedef struct SCSIReqOps SCSIReqOps;
enum SCSIXferMode {
SCSI_XFER_NONE, /* TEST_UNIT_READY, ... */
@@ -32,6 +33,7 @@ typedef struct SCSISense {
struct SCSIRequest {
SCSIBus *bus;
SCSIDevice *dev;
+ SCSIReqOps *ops;
uint32_t refcount;
uint32_t tag;
uint32_t lun;
@@ -69,6 +71,10 @@ int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
/* scsi-bus.c */
+struct SCSIReqOps {
+ size_t size;
+};
+
typedef int (*scsi_qdev_initfn)(SCSIDevice *dev);
struct SCSIDeviceInfo {
DeviceInfo qdev;
@@ -144,7 +150,7 @@ extern const struct SCSISense sense_code_LUN_FAILURE;
int scsi_sense_valid(SCSISense sense);
-SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag,
+SCSIRequest *scsi_req_alloc(SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag,
uint32_t lun, void *hba_private);
SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
void *hba_private);