Revision aba1f023 hw/lsi53c895a.c

b/hw/lsi53c895a.c
680 680

  
681 681
/* Record that data is available for a queued command.  Returns zero if
682 682
   the device was reselected, nonzero if the IO is deferred.  */
683
static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t arg)
683
static int lsi_queue_tag(LSIState *s, uint32_t tag, uint32_t len)
684 684
{
685 685
    lsi_request *p;
686 686

  
......
693 693
    if (p->pending) {
694 694
        BADF("Multiple IO pending for tag %d\n", tag);
695 695
    }
696
    p->pending = arg;
696
    p->pending = len;
697 697
    /* Reselect if waiting for it, or if reselection triggers an IRQ
698 698
       and the bus is free.
699 699
       Since no interrupt stacking is implemented in the emulation, it
......
707 707
        return 0;
708 708
    } else {
709 709
        DPRINTF("Queueing IO tag=0x%x\n", tag);
710
        p->pending = arg;
710
        p->pending = len;
711 711
        return 1;
712 712
    }
713 713
}
714 714

  
715 715
 /* Callback to indicate that the SCSI layer has completed a command.  */
716
static void lsi_command_complete(SCSIRequest *req, uint32_t arg)
716
static void lsi_command_complete(SCSIRequest *req, uint32_t status)
717 717
{
718 718
    LSIState *s = DO_UPCAST(LSIState, dev.qdev, req->bus->qbus.parent);
719 719
    int out;
720 720

  
721 721
    out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
722
    DPRINTF("Command complete status=%d\n", (int)arg);
723
    s->status = arg;
722
    DPRINTF("Command complete status=%d\n", (int)status);
723
    s->status = status;
724 724
    s->command_complete = 2;
725 725
    if (s->waiting && s->dbc != 0) {
726 726
        /* Raise phase mismatch for short transfers.  */
......
738 738
}
739 739

  
740 740
 /* Callback to indicate that the SCSI layer has completed a transfer.  */
741
static void lsi_transfer_data(SCSIRequest *req, uint32_t arg)
741
static void lsi_transfer_data(SCSIRequest *req, uint32_t len)
742 742
{
743 743
    LSIState *s = DO_UPCAST(LSIState, dev.qdev, req->bus->qbus.parent);
744 744
    int out;
745 745

  
746 746
    if (s->waiting == 1 || !s->current || req->tag != s->current->tag ||
747 747
        (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {
748
        if (lsi_queue_tag(s, req->tag, arg)) {
748
        if (lsi_queue_tag(s, req->tag, len)) {
749 749
            return;
750 750
        }
751 751
    }
......
753 753
    out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
754 754

  
755 755
    /* host adapter (re)connected */
756
    DPRINTF("Data ready tag=0x%x len=%d\n", req->tag, arg);
757
    s->current->dma_len = arg;
756
    DPRINTF("Data ready tag=0x%x len=%d\n", req->tag, len);
757
    s->current->dma_len = len;
758 758
    s->command_complete = 1;
759 759
    if (s->waiting) {
760 760
        if (s->waiting == 1 || s->dbc == 0) {

Also available in: Unified diff