diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-04-18 14:59:13 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-05-26 12:14:14 +0200 |
commit | ab9adc88c80186cfef29bda076363e20aa675241 (patch) | |
tree | 75899831e47ea90207dbbcbb291bd896ed420506 /hw/scsi-bus.c | |
parent | 40f16dd1279e7f26357b3c4b3838a89ffc6153da (diff) |
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churn
in the following patches.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r-- | hw/scsi-bus.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 0fd85fc56d..191cbabc44 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -495,6 +495,17 @@ static const char *scsi_command_name(uint8_t cmd) return names[cmd]; } +/* Called by the devices when data is ready for the HBA. The HBA should + start a DMA operation to read or fill the device's data buffer. + Once it completes, calling one of req->dev->info->read_data or + req->dev->info->write_data (depending on the direction of the + transfer) will restart I/O. */ +void scsi_req_data(SCSIRequest *req, int len) +{ + trace_scsi_req_data(req->dev->id, req->lun, req->tag, len); + req->bus->complete(req->bus, SCSI_REASON_DATA, req->tag, len); +} + void scsi_req_print(SCSIRequest *req) { FILE *fp = stderr; |