Revision 94d3f98a hw/lsi53c895a.c

b/hw/lsi53c895a.c
664 664
    return NULL;
665 665
}
666 666

  
667
static void lsi_request_cancelled(SCSIRequest *req)
668
{
669
    LSIState *s = DO_UPCAST(LSIState, dev.qdev, req->bus->qbus.parent);
670
    lsi_request *p;
671

  
672
    if (s->current && req == s->current->req) {
673
        scsi_req_unref(req);
674
        qemu_free(s->current);
675
        s->current = NULL;
676
        return;
677
    }
678

  
679
    p = lsi_find_by_tag(s, req->tag);
680
    if (p) {
681
        QTAILQ_REMOVE(&s->queue, p, next);
682
        scsi_req_unref(req);
683
        qemu_free(p);
684
    }
685
}
686

  
667 687
/* Record that data is available for a queued command.  Returns zero if
668 688
   the device was reselected, nonzero if the IO is deferred.  */
669 689
static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg)
......
931 951
            /* The ABORT TAG message clears the current I/O process only. */
932 952
            DPRINTF("MSG: ABORT TAG tag=0x%x\n", current_tag);
933 953
            if (current_req) {
934
                current_dev->info->cancel_io(current_req->req);
954
                scsi_req_cancel(current_req->req);
935 955
            }
936 956
            lsi_disconnect(s);
937 957
            break;
......
956 976

  
957 977
            /* clear the current I/O process */
958 978
            if (s->current) {
959
                current_dev->info->cancel_io(s->current->req);
979
                scsi_req_cancel(s->current->req);
960 980
            }
961 981

  
962 982
            /* As the current implemented devices scsi_disk and scsi_generic
......
969 989
            id = current_tag & 0x0000ff00;
970 990
            QTAILQ_FOREACH_SAFE(p, &s->queue, next, p_next) {
971 991
                if ((p->tag & 0x0000ff00) == id) {
972
                    current_dev->info->cancel_io(p->req);
973
                    QTAILQ_REMOVE(&s->queue, p, next);
992
                    scsi_req_cancel(p->req);
974 993
                }
975 994
            }
976 995

  
......
2227 2246
}
2228 2247

  
2229 2248
static const struct SCSIBusOps lsi_scsi_ops = {
2230
    .complete = lsi_command_complete
2249
    .complete = lsi_command_complete,
2250
    .cancel = lsi_request_cancelled
2231 2251
};
2232 2252

  
2233 2253
static int lsi_scsi_init(PCIDevice *dev)

Also available in: Unified diff