summaryrefslogtreecommitdiffstats
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-11-26 15:33:55 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:36 -0600
commit2ec749cb8222c37400ef95b751bfee945dae0dbf (patch)
tree2f73e0749a96b06e8ffa2e4eaa68bf6f8e42de68 /hw/scsi.h
parent913766563fbd6faa17635fd802e83383e0224289 (diff)
downloadhqemu-2ec749cb8222c37400ef95b751bfee945dae0dbf.zip
hqemu-2ec749cb8222c37400ef95b751bfee945dae0dbf.tar.gz
scsi: add request parsing helpers to common code.
Add helper functions for scsi request parsing to common code. Getting command length, transfer size, and linear block address is handled. 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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index 95838a4..8c64067 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -26,6 +26,8 @@ typedef struct SCSIRequest {
struct {
uint8_t buf[SCSI_CMD_BUF_SIZE];
int len;
+ size_t xfer;
+ uint64_t lba;
} cmd;
BlockDriverAIOCB *aiocb;
QTAILQ_ENTRY(SCSIRequest) next;
@@ -86,5 +88,6 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
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
OpenPOWER on IntegriCloud