mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
scsi: move host_status handling into SCSI drivers
Some SCSI drivers like virtio have an internal mapping for the host_status. This patch moves the host_status translation into the SCSI drivers to allow those drivers to set up the correct values. Signed-off-by: Hannes Reinecke <hare@suse.de>. [Added default handling to avoid touching all drivers. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a108557bbf
commit
f3126d65b3
6 changed files with 128 additions and 13 deletions
|
@ -27,7 +27,8 @@ struct SCSIRequest {
|
|||
uint32_t refcount;
|
||||
uint32_t tag;
|
||||
uint32_t lun;
|
||||
uint32_t status;
|
||||
int16_t status;
|
||||
int16_t host_status;
|
||||
void *hba_private;
|
||||
size_t resid;
|
||||
SCSICommand cmd;
|
||||
|
@ -123,6 +124,7 @@ struct SCSIBusInfo {
|
|||
int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,
|
||||
void *hba_private);
|
||||
void (*transfer_data)(SCSIRequest *req, uint32_t arg);
|
||||
void (*fail)(SCSIRequest *req);
|
||||
void (*complete)(SCSIRequest *req, size_t resid);
|
||||
void (*cancel)(SCSIRequest *req);
|
||||
void (*change)(SCSIBus *bus, SCSIDevice *dev, SCSISense sense);
|
||||
|
@ -177,6 +179,7 @@ void scsi_req_print(SCSIRequest *req);
|
|||
void scsi_req_continue(SCSIRequest *req);
|
||||
void scsi_req_data(SCSIRequest *req, int len);
|
||||
void scsi_req_complete(SCSIRequest *req, int status);
|
||||
void scsi_req_complete_failed(SCSIRequest *req, int host_status);
|
||||
uint8_t *scsi_req_get_buf(SCSIRequest *req);
|
||||
int scsi_req_get_sense(SCSIRequest *req, uint8_t *buf, int len);
|
||||
void scsi_req_cancel_complete(SCSIRequest *req);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue