aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-11-26 15:33:58 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:37 -0600
commit37659e510483fd8758424356b76209124ccfd98c (patch)
tree087b227ecc8712498a12938259331570eb943853 /hw/scsi.h
parent97a064356704af1756270b1d56dea2690ae015de (diff)
scsi: move sense to SCSIDevice, create SCSISense struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index c5b30b82b2..f0aaed59a3 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -24,6 +24,10 @@ enum SCSIXferMode {
SCSI_XFER_TO_DEV, /* WRITE, MODE_SELECT, ... */
};
+typedef struct SCSISense {
+ uint8_t key;
+} SCSISense;
+
typedef struct SCSIRequest {
SCSIBus *bus;
SCSIDevice *dev;
@@ -48,6 +52,7 @@ struct SCSIDevice
QTAILQ_HEAD(, SCSIRequest) requests;
int blocksize;
int type;
+ struct SCSISense sense;
};
/* cdrom.c */
@@ -92,9 +97,13 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit);
void scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
+void scsi_dev_clear_sense(SCSIDevice *dev);
+void scsi_dev_set_sense(SCSIDevice *dev, uint8_t key);
+
SCSIRequest *scsi_req_alloc(size_t size, SCSIDevice *d, uint32_t tag, uint32_t lun);
SCSIRequest *scsi_req_find(SCSIDevice *d, uint32_t tag);
void scsi_req_free(SCSIRequest *req);
+
int scsi_req_parse(SCSIRequest *req, uint8_t *buf);
#endif