Revision 079d0b7f hw/usb-uhci.c

b/hw/usb-uhci.c
761 761
    int len = 0, max_len;
762 762
    uint8_t pid, isoc;
763 763
    uint32_t token;
764
    USBDevice *dev;
765
    USBEndpoint *ep;
764 766

  
765 767
    /* Is active ? */
766 768
    if (!(td->ctrl & TD_CTRL_ACTIVE))
......
805 807
    max_len = ((td->token >> 21) + 1) & 0x7ff;
806 808
    pid = td->token & 0xff;
807 809

  
808
    usb_packet_setup(&async->packet, pid, (td->token >> 8) & 0x7f,
809
                     (td->token >> 15) & 0xf);
810
    dev = uhci_find_device(s, (td->token >> 8) & 0x7f);
811
    ep = usb_ep_get(dev, pid, (td->token >> 15) & 0xf);
812
    usb_packet_setup(&async->packet, pid, ep);
810 813
    qemu_sglist_add(&async->sgl, td->buffer, max_len);
811 814
    usb_packet_map(&async->packet, &async->sgl);
812 815

  
813 816
    switch(pid) {
814 817
    case USB_TOKEN_OUT:
815 818
    case USB_TOKEN_SETUP:
816
        len = usb_handle_packet(uhci_find_device(s, async->packet.devaddr),
817
                                &async->packet);
819
        len = usb_handle_packet(dev, &async->packet);
818 820
        if (len >= 0)
819 821
            len = max_len;
820 822
        break;
821 823

  
822 824
    case USB_TOKEN_IN:
823
        len = usb_handle_packet(uhci_find_device(s, async->packet.devaddr),
824
                                &async->packet);
825
        len = usb_handle_packet(dev, &async->packet);
825 826
        break;
826 827

  
827 828
    default:

Also available in: Unified diff