mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
scsi: introduce scsi_req_continue
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
43a2b33957
commit
ad3376cc55
7 changed files with 47 additions and 60 deletions
|
@ -580,13 +580,7 @@ static void lsi_do_dma(LSIState *s, int out)
|
|||
s->current->dma_len -= count;
|
||||
if (s->current->dma_len == 0) {
|
||||
s->current->dma_buf = NULL;
|
||||
if (out) {
|
||||
/* Write the data. */
|
||||
dev->info->write_data(s->current->req);
|
||||
} else {
|
||||
/* Request any remaining data. */
|
||||
dev->info->read_data(s->current->req);
|
||||
}
|
||||
scsi_req_continue(s->current->req);
|
||||
} else {
|
||||
s->current->dma_buf += count;
|
||||
lsi_resume_script(s);
|
||||
|
@ -791,14 +785,14 @@ static void lsi_do_command(LSIState *s)
|
|||
s->current->req = scsi_req_new(dev, s->current->tag, s->current_lun);
|
||||
|
||||
n = scsi_req_enqueue(s->current->req, buf);
|
||||
if (n > 0) {
|
||||
lsi_set_phase(s, PHASE_DI);
|
||||
dev->info->read_data(s->current->req);
|
||||
} else if (n < 0) {
|
||||
lsi_set_phase(s, PHASE_DO);
|
||||
dev->info->write_data(s->current->req);
|
||||
if (n) {
|
||||
if (n > 0) {
|
||||
lsi_set_phase(s, PHASE_DI);
|
||||
} else if (n < 0) {
|
||||
lsi_set_phase(s, PHASE_DO);
|
||||
}
|
||||
scsi_req_continue(s->current->req);
|
||||
}
|
||||
|
||||
if (!s->command_complete) {
|
||||
if (n) {
|
||||
/* Command did not complete immediately so disconnect. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue