Revision 079d0b7f hw/usb-ehci.c

b/hw/usb-ehci.c
1357 1357
static int ehci_execute(EHCIQueue *q)
1358 1358
{
1359 1359
    USBDevice *dev;
1360
    USBEndpoint *ep;
1360 1361
    int ret;
1361 1362
    int endp;
1362 1363
    int devadr;
......
1387 1388
    endp = get_field(q->qh.epchar, QH_EPCHAR_EP);
1388 1389
    devadr = get_field(q->qh.epchar, QH_EPCHAR_DEVADDR);
1389 1390

  
1390
    ret = USB_RET_NODEV;
1391
    /* TODO: associating device with ehci port */
1392
    dev = ehci_find_device(q->ehci, devadr);
1393
    ep = usb_ep_get(dev, q->pid, endp);
1391 1394

  
1392
    usb_packet_setup(&q->packet, q->pid, devadr, endp);
1395
    usb_packet_setup(&q->packet, q->pid, ep);
1393 1396
    usb_packet_map(&q->packet, &q->sgl);
1394 1397

  
1395
    // TO-DO: associating device with ehci port
1396
    dev = ehci_find_device(q->ehci, q->packet.devaddr);
1397 1398
    ret = usb_handle_packet(dev, &q->packet);
1398 1399
    DPRINTF("submit: qh %x next %x qtd %x pid %x len %zd "
1399 1400
            "(total %d) endp %x ret %d\n",
......
1415 1416
                            EHCIitd *itd)
1416 1417
{
1417 1418
    USBDevice *dev;
1419
    USBEndpoint *ep;
1418 1420
    int ret;
1419 1421
    uint32_t i, len, pid, dir, devaddr, endp;
1420 1422
    uint32_t pg, off, ptr1, ptr2, max, mult;
......
1454 1456

  
1455 1457
            pid = dir ? USB_TOKEN_IN : USB_TOKEN_OUT;
1456 1458

  
1457
            usb_packet_setup(&ehci->ipacket, pid, devaddr, endp);
1459
            dev = ehci_find_device(ehci, devaddr);
1460
            ep = usb_ep_get(dev, pid, endp);
1461
            usb_packet_setup(&ehci->ipacket, pid, ep);
1458 1462
            usb_packet_map(&ehci->ipacket, &ehci->isgl);
1459 1463

  
1460
            dev = ehci_find_device(ehci, ehci->ipacket.devaddr);
1461 1464
            ret = usb_handle_packet(dev, &ehci->ipacket);
1462 1465

  
1463 1466
            usb_packet_unmap(&ehci->ipacket);

Also available in: Unified diff