37 static int ehci_get_frame (
struct usb_hcd *hcd);
41 static unsigned ehci_read_frame_index(
struct ehci_hcd *ehci)
52 uf = ehci_readl(ehci, &ehci->
regs->frame_index);
54 uf = ehci_readl(ehci, &ehci->
regs->frame_index);
73 return &periodic->
qh->qh_next;
75 return &periodic->
fstn->fstn_next;
77 return &periodic->
itd->itd_next;
80 return &periodic->
sitd->sitd_next;
91 return &periodic->
qh->hw->hw_next;
99 static void periodic_unlink (
struct ehci_hcd *ehci,
unsigned frame,
void *
ptr)
106 while (here.
ptr && here.
ptr != ptr) {
107 prev_p = periodic_next_shadow(ehci, prev_p,
109 hw_p = shadow_next_periodic(ehci, &here,
120 *prev_p = *periodic_next_shadow(ehci, &here,
124 *shadow_next_periodic(ehci, &here,
Q_NEXT_TYPE(ehci, *hw_p))
126 *hw_p = *shadow_next_periodic(ehci, &here,
129 *hw_p = ehci->
dummy->qh_dma;
133 static unsigned short
134 periodic_usecs (
struct ehci_hcd *ehci,
unsigned frame,
unsigned uframe)
147 usecs += q->
qh->usecs;
151 usecs += q->
qh->c_usecs;
161 ehci_dbg (ehci,
"ignoring FSTN cost ...\n");
163 hw_p = &q->
fstn->hw_next;
164 q = &q->
fstn->fstn_next;
167 if (q->
itd->hw_transaction[uframe])
168 usecs += q->
itd->stream->usecs;
169 hw_p = &q->
itd->hw_next;
170 q = &q->
itd->itd_next;
176 if (q->
sitd->hw_fullspeed_ep &
178 usecs += q->
sitd->stream->usecs;
180 usecs += HS_USECS_ISO (188);
184 if (q->
sitd->hw_uframe &
187 usecs += q->
sitd->stream->c_usecs;
190 hw_p = &q->
sitd->hw_next;
191 q = &q->
sitd->sitd_next;
197 ehci_err (ehci,
"uframe %d sched overrun: %d usecs\n",
198 frame * 8 + uframe, usecs);
205 static int same_tt (
struct usb_device *dev1,
struct usb_device *dev2)
207 if (!dev1->tt || !dev2->tt)
209 if (dev1->tt != dev2->tt)
212 return dev1->ttport == dev2->ttport;
217 #ifdef CONFIG_USB_EHCI_TT_NEWSCHED
231 ehci_err(ehci,
"invalid empty smask!\n");
235 return ffs(smask) - 1;
238 static const unsigned char
239 max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 };
242 static inline void carryover_tt_bandwidth(
unsigned short tt_usecs[8])
245 for (i=0; i<7; i++) {
246 if (max_tt_usecs[i] < tt_usecs[i]) {
247 tt_usecs[i+1] += tt_usecs[
i] - max_tt_usecs[
i];
248 tt_usecs[
i] = max_tt_usecs[
i];
266 struct usb_device *
dev,
268 unsigned short tt_usecs[8]
280 hw_p = &q->
itd->hw_next;
281 q = &q->
itd->itd_next;
284 if (same_tt(dev, q->
qh->dev)) {
285 uf = tt_start_uframe(ehci, q->
qh->hw->hw_info2);
286 tt_usecs[uf] += q->
qh->tt_usecs;
288 hw_p = &q->
qh->hw->hw_next;
292 if (same_tt(dev, q->
sitd->urb->dev)) {
293 uf = tt_start_uframe(ehci, q->
sitd->hw_uframe);
294 tt_usecs[uf] += q->
sitd->stream->tt_usecs;
296 hw_p = &q->
sitd->hw_next;
297 q = &q->
sitd->sitd_next;
301 ehci_dbg(ehci,
"ignoring periodic frame %d FSTN\n",
303 hw_p = &q->
fstn->hw_next;
304 q = &q->
fstn->fstn_next;
308 carryover_tt_bandwidth(tt_usecs);
310 if (max_tt_usecs[7] < tt_usecs[7])
311 ehci_err(ehci,
"frame %d tt sched overrun: %d usecs\n",
312 frame, tt_usecs[7] - max_tt_usecs[7]);
336 static int tt_available (
339 struct usb_device *dev,
345 if ((period == 0) || (uframe >= 7))
349 unsigned short tt_usecs[8];
351 periodic_tt_usecs (ehci, dev, frame, tt_usecs);
353 ehci_vdbg(ehci,
"tt frame %d check %d usecs start uframe %d in"
354 " schedule %d/%d/%d/%d/%d/%d/%d/%d\n",
355 frame, usecs, uframe,
356 tt_usecs[0], tt_usecs[1], tt_usecs[2], tt_usecs[3],
357 tt_usecs[4], tt_usecs[5], tt_usecs[6], tt_usecs[7]);
359 if (max_tt_usecs[uframe] <= tt_usecs[uframe]) {
360 ehci_vdbg(ehci,
"frame %d uframe %d fully scheduled\n",
371 int ufs = (usecs / 125);
373 for (i = uframe; i < (uframe + ufs) && i < 8; i++)
374 if (0 < tt_usecs[i]) {
376 "multi-uframe xfer can't fit "
377 "in frame %d uframe %d\n",
383 tt_usecs[uframe] +=
usecs;
385 carryover_tt_bandwidth(tt_usecs);
388 if (max_tt_usecs[7] < tt_usecs[7]) {
390 "tt unavailable usecs %d frame %d uframe %d\n",
391 usecs, frame, uframe);
405 static int tt_no_collision (
408 struct usb_device *dev,
431 here = here.
itd->itd_next;
435 if (same_tt (dev, here.
qh->dev)) {
446 here = here.
qh->qh_next;
449 if (same_tt (dev, here.
sitd->urb->dev)) {
460 here = here.
sitd->sitd_next;
465 "periodic frame %d bogus type %d\n",
482 static void enable_periodic(
struct ehci_hcd *ehci)
492 turn_on_io_watchdog(ehci);
495 static void disable_periodic(
struct ehci_hcd *ehci)
512 static void qh_link_periodic(
struct ehci_hcd *ehci,
struct ehci_qh *qh)
515 unsigned period = qh->
period;
518 "link qh%d-%04x/%p start %d [%d/%d us]\n",
519 period, hc32_to_cpup(ehci, &qh->
hw->hw_info2)
527 for (i = qh->
start; i < ehci->periodic_size; i += period) {
538 prev = periodic_next_shadow(ehci, prev, type);
539 hw_p = shadow_next_periodic(ehci, &here, type);
546 while (here.
ptr && qh != here.
qh) {
549 prev = &here.
qh->qh_next;
550 hw_p = &here.
qh->hw->hw_next;
557 qh->
hw->hw_next = *hw_p;
567 ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->
period
575 enable_periodic(ehci);
578 static void qh_unlink_periodic(
struct ehci_hcd *ehci,
struct ehci_qh *qh)
599 if ((period = qh->
period) == 0)
602 for (i = qh->
start; i < ehci->periodic_size; i += period)
603 periodic_unlink (ehci, i, qh);
606 ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->
period
611 "unlink qh%d-%04x/%p start %d [%d/%d us]\n",
626 static void start_unlink_intr(
struct ehci_hcd *ehci,
struct ehci_qh *qh)
638 qh_unlink_periodic (ehci, qh);
660 ehci_handle_intr_unlinks(ehci);
675 qh_completions(ehci, qh);
679 rc = qh_schedule(ehci, qh);
688 ehci_err(ehci,
"can't reschedule qh %p, err %d\n",
694 disable_periodic(ehci);
699 static int check_period (
722 for (uframe = 0; uframe < 7; uframe++) {
723 claimed = periodic_usecs (ehci, frame, uframe);
732 claimed = periodic_usecs (ehci, frame, uframe);
742 static int check_intr_schedule (
753 if (qh->
c_usecs && uframe >= 6)
756 if (!check_period (ehci, frame, uframe, qh->
period, qh->
usecs))
764 #ifdef CONFIG_USB_EHCI_TT_NEWSCHED
765 if (tt_available (ehci, qh->
period, qh->
dev, frame, uframe,
770 for (i=uframe+1; i<8 && i<uframe+4; i++)
771 if (!check_period (ehci, frame, i,
789 mask = 0x03 << (uframe + qh->
gap_uf);
793 if (tt_no_collision (ehci, qh->
period, qh->
dev, frame, mask)) {
794 if (!check_period (ehci, frame, uframe + qh->
gap_uf + 1,
797 if (!check_period (ehci, frame, uframe + qh->
gap_uf,
818 qh_refresh(ehci, qh);
825 status = check_intr_schedule (ehci, frame, --uframe,
841 for (i = qh->
period; status && i > 0; --i) {
843 for (uframe = 0; uframe < 8; uframe++) {
844 status = check_intr_schedule (ehci,
855 status = check_intr_schedule (ehci, 0, 0, qh, &c_mask);
868 ehci_dbg (ehci,
"reused qh %p schedule\n", qh);
871 qh_link_periodic(ehci, qh);
876 static int intr_submit (
889 epnum = urb->ep->desc.bEndpointAddress;
893 if (
unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
895 goto done_not_linked;
899 goto done_not_linked;
902 INIT_LIST_HEAD (&
empty);
903 qh = qh_append_tds(ehci, urb, &
empty, epnum, &urb->ep->hcpriv);
909 if ((status = qh_schedule (ehci, qh)) != 0)
914 qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
918 ehci_to_hcd(ehci)->self.bandwidth_int_reqs++;
924 spin_unlock_irqrestore (&ehci->
lock, flags);
926 qtd_list_free (ehci, urb, qtd_list);
931 static void scan_intr(
struct ehci_hcd *ehci)
949 temp = qh_completions(ehci, qh);
953 start_unlink_intr(ehci, qh);
965 iso_stream_alloc (
gfp_t mem_flags)
969 stream = kzalloc(
sizeof *stream, mem_flags);
971 INIT_LIST_HEAD(&stream->
td_list);
982 struct usb_device *dev,
987 static const u8 smask_out [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f };
990 unsigned epnum,
maxp;
998 epnum = usb_pipeendpoint (pipe);
999 is_input = usb_pipein (pipe) ?
USB_DIR_IN : 0;
1000 maxp = usb_maxpacket(dev, pipe, !is_input);
1024 stream->
usecs = HS_USECS_ISO (maxp);
1025 bandwidth = stream->
usecs * 8;
1033 addr = dev->ttport << 24;
1036 ehci_to_hcd(ehci)->
self.root_hub))
1037 addr |= dev->tt->hub->devnum << 16;
1039 addr |= dev->devnum;
1040 stream->
usecs = HS_USECS_ISO (maxp);
1041 think_time = dev->tt ? dev->tt->think_time : 0;
1043 dev->speed, is_input, 1, maxp));
1044 hs_transfers =
max (1
u, (maxp + 187) / 188);
1050 stream->
usecs = HS_USECS_ISO (1);
1054 tmp = (1 << (hs_transfers + 2)) - 1;
1055 stream->
raw_mask |= tmp << (8 + 2);
1057 stream->
raw_mask = smask_out [hs_transfers - 1];
1059 bandwidth /= interval << 3;
1074 iso_stream_find (
struct ehci_hcd *ehci,
struct urb *urb)
1078 struct usb_host_endpoint *ep;
1079 unsigned long flags;
1081 epnum = usb_pipeendpoint (urb->pipe);
1082 if (usb_pipein(urb->pipe))
1083 ep = urb->dev->ep_in[epnum];
1085 ep = urb->dev->ep_out[epnum];
1088 stream = ep->hcpriv;
1093 ep->hcpriv = stream;
1095 iso_stream_init(ehci, stream, urb->dev, urb->pipe,
1101 ehci_dbg (ehci,
"dev %s ep%d%s, not iso??\n",
1102 urb->dev->devpath, epnum,
1103 usb_pipein(urb->pipe) ?
"in" :
"out");
1107 spin_unlock_irqrestore (&ehci->
lock, flags);
1119 int size =
sizeof *iso_sched;
1122 iso_sched = kzalloc(size, mem_flags);
1124 INIT_LIST_HEAD (&iso_sched->
td_list);
1141 iso_sched->
span = urb->number_of_packets * stream->
interval;
1146 for (i = 0; i < urb->number_of_packets; i++) {
1152 length = urb->iso_frame_desc [
i].length;
1153 buf = dma + urb->iso_frame_desc [
i].offset;
1156 trans |= buf & 0x0fff;
1157 if (
unlikely (((i + 1) == urb->number_of_packets))
1158 && !(urb->transfer_flags & URB_NO_INTERRUPT))
1160 trans |= length << 16;
1164 uframe->
bufp = (buf & ~(
u64)0x0fff);
1185 itd_urb_transaction (
1197 unsigned long flags;
1199 sched = iso_sched_alloc (urb->number_of_packets, mem_flags);
1203 itd_sched_init(ehci, sched, stream, urb);
1205 if (urb->interval < 8)
1206 num_itds = 1 + (sched->
span + 7) / 8;
1208 num_itds = urb->number_of_packets;
1212 for (i = 0; i < num_itds; i++) {
1227 spin_unlock_irqrestore (&ehci->
lock, flags);
1232 iso_sched_free(stream, sched);
1233 spin_unlock_irqrestore(&ehci->
lock, flags);
1238 memset (itd, 0,
sizeof *itd);
1242 spin_unlock_irqrestore (&ehci->
lock, flags);
1245 urb->hcpriv = sched;
1246 urb->error_count = 0;
1264 if (periodic_usecs (ehci, uframe >> 3, uframe & 0x7)
1270 }
while (uframe < mod);
1287 mask = stream->
raw_mask << (uframe & 7);
1294 uframe %= period_uframes;
1295 frame = uframe >> 3;
1297 #ifdef CONFIG_USB_EHCI_TT_NEWSCHED
1302 if (!tt_available(ehci, period_uframes >> 3,
1309 if (!tt_no_collision(ehci, period_uframes >> 3,
1310 stream->
udev, frame, mask))
1320 frame = uframe >> 3;
1325 for (tmp = stream->
raw_mask & 0xff; tmp; tmp >>= 1, uf++) {
1326 if (periodic_usecs (ehci, frame, uf) > max_used)
1339 if (periodic_usecs (ehci, frame, uf)
1346 uframe += period_uframes;
1347 }
while (uframe < mod);
1364 #define SCHEDULE_SLOP 80
1367 iso_stream_schedule (
1378 period = urb->interval;
1386 ehci_dbg (ehci,
"iso request %p too long\n", urb);
1391 now = ehci_read_frame_index(ehci) & (mod - 1);
1417 start = next + excess - mod + period *
1420 start = next + excess +
period;
1421 if (start - now >= mod) {
1422 ehci_dbg(ehci,
"request %p would overflow (%d+%d >= %d)\n",
1423 urb, start - now - period, period,
1453 if (itd_slot_ok(ehci, mod, start,
1454 stream->
usecs, period))
1457 if ((start % 8) >= 6)
1459 if (sitd_slot_ok(ehci, mod, stream,
1460 start, sched, period))
1463 }
while (start > next && !done);
1467 ehci_dbg(ehci,
"iso resched full %p (now %d max %d)\n",
1468 urb, now, now + mod);
1475 if (
unlikely(start - now + span - period
1477 ehci_dbg(ehci,
"request %p would overflow (%d+%d >= %d)\n",
1478 urb, start - now, span - period,
1489 urb->start_frame >>= 3;
1497 iso_sched_free(stream, sched);
1516 for (i = 0; i < 8; i++)
1532 unsigned pg = itd->
pg;
1567 prev = periodic_next_shadow(ehci, prev, type);
1568 hw_p = shadow_next_periodic(ehci, &here, type);
1581 static void itd_link_urb(
1589 unsigned next_uframe, uframe,
frame;
1596 ehci_to_hcd(ehci)->self.bandwidth_allocated
1599 "schedule devp %s ep%d%s-iso period %d start %d.%d\n",
1603 next_uframe >> 3, next_uframe & 0x7);
1606 if (ehci_to_hcd(ehci)->
self.bandwidth_isoc_reqs == 0) {
1611 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
1614 for (packet = 0, itd =
NULL; packet < urb->number_of_packets; ) {
1626 itd_init (ehci, stream, itd);
1629 uframe = next_uframe & 0x07;
1630 frame = next_uframe >> 3;
1632 itd_patch(ehci, itd, iso_sched, packet, uframe);
1635 next_uframe &= mod - 1;
1639 if (((next_uframe >> 3) != frame)
1640 || packet == urb->number_of_packets) {
1648 iso_sched_free (stream, iso_sched);
1652 enable_periodic(ehci);
1655 #define ISO_ERRS (EHCI_ISOC_BUF_ERR | EHCI_ISOC_BABBLE | EHCI_ISOC_XACTERR)
1669 struct urb *urb = itd->
urb;
1670 struct usb_iso_packet_descriptor *
desc;
1675 struct usb_device *
dev;
1676 bool retval =
false;
1679 for (uframe = 0; uframe < 8; uframe++) {
1682 urb_index = itd->
index[uframe];
1683 desc = &urb->iso_frame_desc [urb_index];
1692 desc->status = usb_pipein (urb->pipe)
1701 if (!(t & EHCI_ISOC_BABBLE)) {
1703 urb->actual_length += desc->actual_length;
1708 urb->actual_length += desc->actual_length;
1711 desc->status = -
EXDEV;
1716 if (
likely ((urb_index + 1) != urb->number_of_packets))
1726 ehci_urb_done(ehci, urb, 0);
1731 disable_periodic(ehci);
1733 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1734 if (ehci_to_hcd(ehci)->
self.bandwidth_isoc_reqs == 0) {
1740 ehci_to_hcd(ehci)->self.bandwidth_allocated
1743 "deschedule devp %s ep%d%s-iso\n",
1755 if (list_empty(&stream->
td_list)) {
1756 list_splice_tail_init(&stream->
free_list,
1758 start_free_itds(ehci);
1766 static int itd_submit (
struct ehci_hcd *ehci,
struct urb *urb,
1770 unsigned long flags;
1774 stream = iso_stream_find (ehci, urb);
1776 ehci_dbg (ehci,
"can't get iso stream\n");
1780 ehci_dbg (ehci,
"can't change iso interval %d --> %d\n",
1785 #ifdef EHCI_URB_TRACE
1787 "%s %s urb %p ep%d%s len %d, %d pkts %d uframes [%p]\n",
1788 __func__, urb->dev->devpath, urb,
1789 usb_pipeendpoint (urb->pipe),
1790 usb_pipein (urb->pipe) ?
"in" :
"out",
1791 urb->transfer_buffer_length,
1792 urb->number_of_packets, urb->interval,
1797 status = itd_urb_transaction (stream, ehci, urb, mem_flags);
1799 ehci_dbg (ehci,
"can't init itds\n");
1805 if (
unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
1807 goto done_not_linked;
1811 goto done_not_linked;
1812 status = iso_stream_schedule(ehci, urb, stream);
1813 if (
likely (status == 0))
1818 spin_unlock_irqrestore (&ehci->
lock, flags);
1842 iso_sched->
span = urb->number_of_packets * stream->
interval;
1847 for (i = 0; i < urb->number_of_packets; i++) {
1853 length = urb->iso_frame_desc [
i].length & 0x03ff;
1854 buf = dma + urb->iso_frame_desc [
i].offset;
1857 if (((i + 1) == urb->number_of_packets)
1858 && !(urb->transfer_flags & URB_NO_INTERRUPT))
1860 trans |= length << 16;
1866 if (packet->
buf1 != (buf & ~(
u64)0x0fff))
1872 length = (length + 187) / 188;
1880 sitd_urb_transaction (
1891 unsigned long flags;
1893 iso_sched = iso_sched_alloc (urb->number_of_packets, mem_flags);
1894 if (iso_sched ==
NULL)
1897 sitd_sched_init(ehci, iso_sched, stream, urb);
1901 for (i = 0; i < urb->number_of_packets; i++) {
1921 spin_unlock_irqrestore (&ehci->
lock, flags);
1926 iso_sched_free(stream, iso_sched);
1927 spin_unlock_irqrestore(&ehci->
lock, flags);
1932 memset (sitd, 0,
sizeof *sitd);
1938 urb->hcpriv = iso_sched;
1939 urb->error_count = 0;
1941 spin_unlock_irqrestore (&ehci->
lock, flags);
1989 static void sitd_link_urb(
1997 unsigned next_uframe;
2003 if (list_empty(&stream->
td_list)) {
2005 ehci_to_hcd(ehci)->self.bandwidth_allocated
2008 "sched devp %s ep%d%s-iso [%d] %dms/%04x\n",
2015 if (ehci_to_hcd(ehci)->
self.bandwidth_isoc_reqs == 0) {
2020 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
2023 for (packet = 0, sitd =
NULL;
2024 packet < urb->number_of_packets;
2038 sitd_patch(ehci, stream, sitd, sched, packet);
2039 sitd_link(ehci, (next_uframe >> 3) & (ehci->
periodic_size - 1),
2042 next_uframe += stream->
interval << 3;
2047 iso_sched_free (stream, sched);
2051 enable_periodic(ehci);
2056 #define SITD_ERRS (SITD_STS_ERR | SITD_STS_DBE | SITD_STS_BABBLE \
2057 | SITD_STS_XACT | SITD_STS_MMF)
2071 struct urb *urb = sitd->
urb;
2072 struct usb_iso_packet_descriptor *
desc;
2076 struct usb_device *
dev;
2077 bool retval =
false;
2079 urb_index = sitd->
index;
2080 desc = &urb->iso_frame_desc [urb_index];
2087 desc->status = usb_pipein (urb->pipe)
2096 desc->actual_length = desc->length -
SITD_LENGTH(t);
2097 urb->actual_length += desc->actual_length;
2101 if ((urb_index + 1) != urb->number_of_packets)
2111 ehci_urb_done(ehci, urb, 0);
2116 disable_periodic(ehci);
2118 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
2119 if (ehci_to_hcd(ehci)->
self.bandwidth_isoc_reqs == 0) {
2124 if (list_is_singular(&stream->
td_list)) {
2125 ehci_to_hcd(ehci)->self.bandwidth_allocated
2128 "deschedule devp %s ep%d%s-iso\n",
2140 if (list_empty(&stream->
td_list)) {
2141 list_splice_tail_init(&stream->
free_list,
2143 start_free_itds(ehci);
2150 static int sitd_submit (
struct ehci_hcd *ehci,
struct urb *urb,
2154 unsigned long flags;
2158 stream = iso_stream_find (ehci, urb);
2159 if (stream ==
NULL) {
2160 ehci_dbg (ehci,
"can't get iso stream\n");
2163 if (urb->interval != stream->
interval) {
2164 ehci_dbg (ehci,
"can't change iso interval %d --> %d\n",
2169 #ifdef EHCI_URB_TRACE
2171 "submit %p dev%s ep%d%s-iso len %d\n",
2172 urb, urb->dev->devpath,
2173 usb_pipeendpoint (urb->pipe),
2174 usb_pipein (urb->pipe) ?
"in" :
"out",
2175 urb->transfer_buffer_length);
2179 status = sitd_urb_transaction (stream, ehci, urb, mem_flags);
2181 ehci_dbg (ehci,
"can't init sitds\n");
2187 if (
unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
2189 goto done_not_linked;
2193 goto done_not_linked;
2194 status = iso_stream_schedule(ehci, urb, stream);
2196 sitd_link_urb (ehci, urb, ehci->
periodic_size << 3, stream);
2200 spin_unlock_irqrestore (&ehci->
lock, flags);
2207 static void scan_isoc(
struct ehci_hcd *ehci)
2209 unsigned uf, now_frame,
frame;
2211 bool modified, live;
2219 uf = ehci_read_frame_index(ehci);
2220 now_frame = (uf >> 3) & fmask;
2249 if (frame == now_frame && live) {
2251 for (uf = 0; uf < 8; uf++) {
2252 if (q.
itd->hw_transaction[uf] &
2257 q_p = &q.
itd->itd_next;
2258 hw_p = &q.
itd->hw_next;
2271 *q_p = q.
itd->itd_next;
2274 *hw_p = q.
itd->hw_next;
2276 *hw_p = ehci->
dummy->qh_dma;
2279 modified = itd_complete (ehci, q.
itd);
2288 if (((frame == now_frame) ||
2289 (((frame + 1) & fmask) == now_frame))
2291 && (q.
sitd->hw_results &
2294 q_p = &q.
sitd->sitd_next;
2295 hw_p = &q.
sitd->hw_next;
2306 *q_p = q.
sitd->sitd_next;
2309 *hw_p = q.
sitd->hw_next;
2311 *hw_p = ehci->
dummy->qh_dma;
2314 modified = sitd_complete (ehci, q.
sitd);
2318 ehci_dbg(ehci,
"corrupt type %d frame %d shadow %p\n",
2319 type, frame, q.
ptr);
2335 if (frame == now_frame)
2337 frame = (frame + 1) & fmask;