Revision 079d0b7f hw/usb-musb.c

b/hw/usb-musb.c
606 606
                int epnum, int pid, int len, USBCallback cb, int dir)
607 607
{
608 608
    USBDevice *dev;
609
    USBEndpoint *uep;
609 610
    int ret;
610 611
    int idx = epnum && dir;
611 612
    int ttype;
......
623 624
    ep->delayed_cb[dir] = cb;
624 625

  
625 626
    /* A wild guess on the FADDR semantics... */
626
    usb_packet_setup(&ep->packey[dir].p, pid, ep->faddr[idx],
627
                     ep->type[idx] & 0xf);
627
    dev = usb_find_device(&s->port, ep->faddr[idx]);
628
    uep = usb_ep_get(dev, pid, ep->type[idx] & 0xf);
629
    usb_packet_setup(&ep->packey[dir].p, pid, uep);
628 630
    usb_packet_addbuf(&ep->packey[dir].p, ep->buf[idx], len);
629 631
    ep->packey[dir].ep = ep;
630 632
    ep->packey[dir].dir = dir;
631 633

  
632
    dev = usb_find_device(&s->port, ep->packey[dir].p.devaddr);
633 634
    ret = usb_handle_packet(dev, &ep->packey[dir].p);
634 635

  
635 636
    if (ret == USB_RET_ASYNC) {

Also available in: Unified diff