mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the command from the driver. So we should make that explicit by replacing 'tag' with a driver-defined pointer 'hba_private'. This saves the lookup for driver handling several commands in parallel. 'tag' is still being kept for tracing purposes. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
348e7b8dcd
commit
c5bf71a9a3
8 changed files with 37 additions and 52 deletions
|
@ -216,10 +216,6 @@ static void usb_msd_transfer_data(SCSIRequest *req, uint32_t len)
|
|||
MSDState *s = DO_UPCAST(MSDState, dev.qdev, req->bus->qbus.parent);
|
||||
USBPacket *p = s->packet;
|
||||
|
||||
if (req->tag != s->tag) {
|
||||
fprintf(stderr, "usb-msd: Unexpected SCSI Tag 0x%x\n", req->tag);
|
||||
}
|
||||
|
||||
assert((s->mode == USB_MSDM_DATAOUT) == (req->cmd.mode == SCSI_XFER_TO_DEV));
|
||||
s->scsi_len = len;
|
||||
s->scsi_buf = scsi_req_get_buf(req);
|
||||
|
@ -241,9 +237,6 @@ static void usb_msd_command_complete(SCSIRequest *req, uint32_t status)
|
|||
MSDState *s = DO_UPCAST(MSDState, dev.qdev, req->bus->qbus.parent);
|
||||
USBPacket *p = s->packet;
|
||||
|
||||
if (req->tag != s->tag) {
|
||||
fprintf(stderr, "usb-msd: Unexpected SCSI Tag 0x%x\n", req->tag);
|
||||
}
|
||||
DPRINTF("Command complete %d\n", status);
|
||||
s->residue = s->data_len;
|
||||
s->result = status != 0;
|
||||
|
@ -387,7 +380,7 @@ static int usb_msd_handle_data(USBDevice *dev, USBPacket *p)
|
|||
s->tag, cbw.flags, cbw.cmd_len, s->data_len);
|
||||
s->residue = 0;
|
||||
s->scsi_len = 0;
|
||||
s->req = scsi_req_new(s->scsi_dev, s->tag, 0);
|
||||
s->req = scsi_req_new(s->scsi_dev, s->tag, 0, NULL);
|
||||
scsi_req_enqueue(s->req, cbw.cmd);
|
||||
/* ??? Should check that USB and SCSI data transfer
|
||||
directions match. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue