Revision ad3376cc hw/usb-msd.c

b/hw/usb-msd.c
190 190
    s->scsi_buf += len;
191 191
    s->data_len -= len;
192 192
    if (s->scsi_len == 0 || s->data_len == 0) {
193
        if (s->mode == USB_MSDM_DATAIN) {
194
            s->scsi_dev->info->read_data(s->req);
195
        } else if (s->mode == USB_MSDM_DATAOUT) {
196
            s->scsi_dev->info->write_data(s->req);
197
        }
193
        scsi_req_continue(s->req);
198 194
    }
199 195
}
200 196

  
......
249 245
        s->req = NULL;
250 246
        return;
251 247
    }
248
    assert((s->mode == USB_MSDM_DATAOUT) == (req->cmd.mode == SCSI_XFER_TO_DEV));
252 249
    s->scsi_len = arg;
253 250
    s->scsi_buf = s->scsi_dev->info->get_buf(req);
254 251
    if (p) {
......
381 378
            scsi_req_enqueue(s->req, cbw.cmd);
382 379
            /* ??? Should check that USB and SCSI data transfer
383 380
               directions match.  */
384
            if (s->residue == 0) {
385
                if (s->mode == USB_MSDM_DATAIN) {
386
                    s->scsi_dev->info->read_data(s->req);
387
                } else if (s->mode == USB_MSDM_DATAOUT) {
388
                    s->scsi_dev->info->write_data(s->req);
389
                }
381
            if (s->mode != USB_MSDM_CSW && s->residue == 0) {
382
                scsi_req_continue(s->req);
390 383
            }
391 384
            ret = len;
392 385
            break;

Also available in: Unified diff