hcd-ehci.c (b55160c3d9b38c5d481ceccc30e397430f26fe92) hcd-ehci.c (8550a02d1239415342959f6a32d178bc05c557cc)
1/*
2 * QEMU USB EHCI Emulation
3 *
4 * Copyright(c) 2008 Emutex Ltd. (address@hidden)
5 * Copyright(c) 2011-2012 Red Hat, Inc.
6 *
7 * Red Hat Authors:
8 * Gerd Hoffmann <kraxel@redhat.com>

--- 860 unchanged lines hidden (view full) ---

869 }
870
871 s->companion_count++;
872 s->caps[0x05] = (s->companion_count << 4) | portcount;
873
874 return 0;
875}
876
1/*
2 * QEMU USB EHCI Emulation
3 *
4 * Copyright(c) 2008 Emutex Ltd. (address@hidden)
5 * Copyright(c) 2011-2012 Red Hat, Inc.
6 *
7 * Red Hat Authors:
8 * Gerd Hoffmann <kraxel@redhat.com>

--- 860 unchanged lines hidden (view full) ---

869 }
870
871 s->companion_count++;
872 s->caps[0x05] = (s->companion_count << 4) | portcount;
873
874 return 0;
875}
876
877static void ehci_wakeup_endpoint(USBBus *bus, USBEndpoint *ep)
877static void ehci_wakeup_endpoint(USBBus *bus, USBEndpoint *ep,
878 unsigned int stream)
878{
879 EHCIState *s = container_of(bus, EHCIState, bus);
880 uint32_t portsc = s->portsc[ep->dev->port->index];
881
882 if (portsc & PORTSC_POWNER) {
883 return;
884 }
885

--- 529 unchanged lines hidden (view full) ---

1415 ep = usb_ep_get(p->queue->dev, p->pid, endp);
1416
1417 if (p->async == EHCI_ASYNC_NONE) {
1418 if (ehci_init_transfer(p) != 0) {
1419 return -1;
1420 }
1421
1422 spd = (p->pid == USB_TOKEN_IN && NLPTR_TBIT(p->qtd.altnext) == 0);
879{
880 EHCIState *s = container_of(bus, EHCIState, bus);
881 uint32_t portsc = s->portsc[ep->dev->port->index];
882
883 if (portsc & PORTSC_POWNER) {
884 return;
885 }
886

--- 529 unchanged lines hidden (view full) ---

1416 ep = usb_ep_get(p->queue->dev, p->pid, endp);
1417
1418 if (p->async == EHCI_ASYNC_NONE) {
1419 if (ehci_init_transfer(p) != 0) {
1420 return -1;
1421 }
1422
1423 spd = (p->pid == USB_TOKEN_IN && NLPTR_TBIT(p->qtd.altnext) == 0);
1423 usb_packet_setup(&p->packet, p->pid, ep, p->qtdaddr, spd,
1424 usb_packet_setup(&p->packet, p->pid, ep, 0, p->qtdaddr, spd,
1424 (p->qtd.token & QTD_TOKEN_IOC) != 0);
1425 usb_packet_map(&p->packet, &p->sgl);
1426 p->async = EHCI_ASYNC_INITIALIZED;
1427 }
1428
1429 trace_usb_ehci_packet_action(p->queue, p, action);
1430 usb_handle_packet(p->queue->dev, &p->packet);
1431 DPRINTF("submit: qh 0x%x next 0x%x qtd 0x%x pid 0x%x len %zd endp 0x%x "

--- 56 unchanged lines hidden (view full) ---

1488 qemu_sglist_add(&ehci->isgl, ptr1 + off, len);
1489 }
1490
1491 pid = dir ? USB_TOKEN_IN : USB_TOKEN_OUT;
1492
1493 dev = ehci_find_device(ehci, devaddr);
1494 ep = usb_ep_get(dev, pid, endp);
1495 if (ep && ep->type == USB_ENDPOINT_XFER_ISOC) {
1425 (p->qtd.token & QTD_TOKEN_IOC) != 0);
1426 usb_packet_map(&p->packet, &p->sgl);
1427 p->async = EHCI_ASYNC_INITIALIZED;
1428 }
1429
1430 trace_usb_ehci_packet_action(p->queue, p, action);
1431 usb_handle_packet(p->queue->dev, &p->packet);
1432 DPRINTF("submit: qh 0x%x next 0x%x qtd 0x%x pid 0x%x len %zd endp 0x%x "

--- 56 unchanged lines hidden (view full) ---

1489 qemu_sglist_add(&ehci->isgl, ptr1 + off, len);
1490 }
1491
1492 pid = dir ? USB_TOKEN_IN : USB_TOKEN_OUT;
1493
1494 dev = ehci_find_device(ehci, devaddr);
1495 ep = usb_ep_get(dev, pid, endp);
1496 if (ep && ep->type == USB_ENDPOINT_XFER_ISOC) {
1496 usb_packet_setup(&ehci->ipacket, pid, ep, addr, false,
1497 usb_packet_setup(&ehci->ipacket, pid, ep, 0, addr, false,
1497 (itd->transact[i] & ITD_XACT_IOC) != 0);
1498 usb_packet_map(&ehci->ipacket, &ehci->isgl);
1499 usb_handle_packet(dev, &ehci->ipacket);
1500 usb_packet_unmap(&ehci->ipacket, &ehci->isgl);
1501 } else {
1502 DPRINTF("ISOCH: attempt to addess non-iso endpoint\n");
1503 ehci->ipacket.status = USB_RET_NAK;
1504 ehci->ipacket.actual_length = 0;

--- 1049 unchanged lines hidden ---
1498 (itd->transact[i] & ITD_XACT_IOC) != 0);
1499 usb_packet_map(&ehci->ipacket, &ehci->isgl);
1500 usb_handle_packet(dev, &ehci->ipacket);
1501 usb_packet_unmap(&ehci->ipacket, &ehci->isgl);
1502 } else {
1503 DPRINTF("ISOCH: attempt to addess non-iso endpoint\n");
1504 ehci->ipacket.status = USB_RET_NAK;
1505 ehci->ipacket.actual_length = 0;

--- 1049 unchanged lines hidden ---