Lines Matching defs:stream

997 	struct ehci_iso_stream *stream;
999 stream = kzalloc(sizeof(*stream), mem_flags);
1000 if (likely(stream != NULL)) {
1001 INIT_LIST_HEAD(&stream->td_list);
1002 INIT_LIST_HEAD(&stream->free_list);
1003 stream->next_uframe = NO_FRAME;
1004 stream->ps.phase = NO_FRAME;
1006 return stream;
1012 struct ehci_iso_stream *stream,
1037 stream->highspeed = 1;
1042 stream->buf0 = cpu_to_hc32(ehci, (epnum << 8) | dev->devnum);
1043 stream->buf1 = cpu_to_hc32(ehci, buf1);
1044 stream->buf2 = cpu_to_hc32(ehci, multi);
1049 stream->ps.usecs = HS_USECS_ISO(maxp);
1056 stream->ps.bw_uperiod = min_t(unsigned, tmp, urb->interval);
1058 stream->uperiod = urb->interval;
1059 stream->ps.period = urb->interval >> 3;
1060 stream->bandwidth = stream->ps.usecs * 8 /
1061 stream->ps.bw_uperiod;
1075 stream->ps.usecs = HS_USECS_ISO(maxp);
1077 stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time(
1084 stream->ps.c_usecs = stream->ps.usecs;
1085 stream->ps.usecs = HS_USECS_ISO(1);
1086 stream->ps.cs_mask = 1;
1090 stream->ps.cs_mask |= tmp << (8 + 2);
1092 stream->ps.cs_mask = smask_out[hs_transfers - 1];
1099 stream->ps.bw_period = min_t(unsigned, tmp, urb->interval);
1100 stream->ps.bw_uperiod = stream->ps.bw_period << 3;
1102 stream->ps.period = urb->interval;
1103 stream->uperiod = urb->interval << 3;
1104 stream->bandwidth = (stream->ps.usecs + stream->ps.c_usecs) /
1105 stream->ps.bw_period;
1107 /* stream->splits gets created from cs_mask later */
1108 stream->address = cpu_to_hc32(ehci, addr);
1111 stream->ps.udev = dev;
1112 stream->ps.ep = urb->ep;
1114 stream->bEndpointAddress = is_input | epnum;
1115 stream->maxp = maxp;
1122 struct ehci_iso_stream *stream;
1133 stream = ep->hcpriv;
1135 if (unlikely(stream == NULL)) {
1136 stream = iso_stream_alloc(GFP_ATOMIC);
1137 if (likely(stream != NULL)) {
1138 ep->hcpriv = stream;
1139 iso_stream_init(ehci, stream, urb);
1143 } else if (unlikely(stream->hw != NULL)) {
1147 stream = NULL;
1151 return stream;
1176 struct ehci_iso_stream *stream,
1184 iso_sched->span = urb->number_of_packets * stream->uperiod;
1216 struct ehci_iso_stream *stream,
1223 list_splice(&iso_sched->td_list, &stream->free_list);
1229 struct ehci_iso_stream *stream,
1246 itd_sched_init(ehci, sched, stream, urb);
1261 if (likely(!list_empty(&stream->free_list))) {
1262 itd = list_first_entry(&stream->free_list,
1275 iso_sched_free(stream, sched);
1297 struct ehci_iso_stream *stream, int sign)
1302 int usecs = stream->ps.usecs;
1303 int c_usecs = stream->ps.c_usecs;
1304 int tt_usecs = stream->ps.tt_usecs;
1307 if (stream->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */
1309 uframe = stream->ps.bw_phase << 3;
1311 bandwidth_dbg(ehci, sign, "iso", &stream->ps);
1319 if (!stream->splits) { /* High speed */
1320 for (i = uframe + stream->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE;
1321 i += stream->ps.bw_uperiod)
1325 s_mask = stream->ps.cs_mask;
1330 i += stream->ps.bw_uperiod) {
1331 for ((j = stream->ps.phase_uf, m = 1 << j); j < 8;
1340 tt = find_tt(stream->ps.udev);
1342 list_add_tail(&stream->ps.ps_list, &tt->ps_list);
1344 list_del(&stream->ps.ps_list);
1347 i += stream->ps.bw_period)
1355 struct ehci_iso_stream *stream,
1362 usecs = ehci->uframe_periodic_max - stream->ps.usecs;
1364 for (uframe &= stream->ps.bw_uperiod - 1; uframe < EHCI_BANDWIDTH_SIZE;
1365 uframe += stream->ps.bw_uperiod) {
1375 struct ehci_iso_stream *stream,
1384 mask = stream->ps.cs_mask << (uframe & 7);
1387 if (((stream->ps.cs_mask & 0xff) << (uframe & 7)) >= (1 << 7))
1395 uframe &= stream->ps.bw_uperiod - 1;
1403 if (!tt_available(ehci, &stream->ps, tt, frame, uf))
1409 if (!tt_no_collision(ehci, stream->ps.bw_period,
1410 stream->ps.udev, frame, mask))
1420 max_used = ehci->uframe_periodic_max - stream->ps.usecs;
1421 for (tmp = stream->ps.cs_mask & 0xff; tmp; tmp >>= 1, uf++) {
1427 if (stream->ps.c_usecs) {
1429 stream->ps.c_usecs;
1433 if ((stream->ps.cs_mask & tmp) == 0)
1440 uframe += stream->ps.bw_uperiod;
1443 stream->ps.cs_mask <<= uframe & 7;
1444 stream->splits = cpu_to_hc32(ehci, stream->ps.cs_mask);
1452 * transfers you can stream reliably; avoid more than 64 msec per urb.
1463 struct ehci_iso_stream *stream
1471 bool empty = list_empty(&stream->td_list);
1474 period = stream->uperiod;
1476 if (!stream->highspeed)
1479 /* Start a new isochronous stream? */
1484 if (stream->ps.phase == NO_FRAME) {
1486 struct ehci_tt *tt = find_tt(stream->ps.udev);
1506 if (stream->highspeed) {
1507 if (itd_slot_ok(ehci, stream, start))
1512 if (sitd_slot_ok(ehci, stream, start,
1524 stream->ps.phase = (start >> 3) &
1525 (stream->ps.period - 1);
1526 stream->ps.bw_phase = stream->ps.phase &
1527 (stream->ps.bw_period - 1);
1528 stream->ps.phase_uf = start & 7;
1529 reserve_release_iso_bandwidth(ehci, stream, 1);
1532 /* New stream is already scheduled; use the upcoming slot */
1534 start = (stream->ps.phase << 3) + stream->ps.phase_uf;
1537 stream->next_uframe = start;
1559 start = (stream->next_uframe - base) & (mod - 1);
1565 * Typical case: reuse current schedule, stream may still be active.
1575 urb, stream->next_uframe, base, period, mod);
1614 iso_sched_free(stream, sched);
1637 stream->next_uframe = (start + skip) & (mod - 1);
1641 if (!stream->highspeed)
1646 iso_sched_free(stream, sched);
1654 itd_init(struct ehci_hcd *ehci, struct ehci_iso_stream *stream,
1661 itd->hw_bufp[0] = stream->buf0;
1662 itd->hw_bufp[1] = stream->buf1;
1663 itd->hw_bufp[2] = stream->buf2;
1734 struct ehci_iso_stream *stream
1742 next_uframe = stream->next_uframe & (mod - 1);
1744 if (unlikely(list_empty(&stream->td_list)))
1746 += stream->bandwidth;
1766 list_move_tail(&itd->itd_list, &stream->td_list);
1767 itd->stream = stream;
1769 itd_init(ehci, stream, itd);
1777 next_uframe += stream->uperiod;
1788 stream->next_uframe = next_uframe;
1791 iso_sched_free(stream, iso_sched);
1792 urb->hcpriv = stream;
1817 struct ehci_iso_stream *stream = itd->stream;
1863 * list_for_each_entry (itd, &stream->td_list, itd_list)
1881 if (unlikely(list_is_singular(&stream->td_list)))
1883 -= stream->bandwidth;
1889 list_move_tail(&itd->itd_list, &stream->free_list);
1892 if (list_empty(&stream->td_list)) {
1893 list_splice_tail_init(&stream->free_list,
1908 struct ehci_iso_stream *stream;
1911 stream = iso_stream_find(ehci, urb);
1912 if (unlikely(stream == NULL)) {
1913 ehci_dbg(ehci, "can't get iso stream\n");
1916 if (unlikely(urb->interval != stream->uperiod)) {
1918 stream->uperiod, urb->interval);
1930 stream);
1934 status = itd_urb_transaction(stream, ehci, urb, mem_flags);
1949 status = iso_stream_schedule(ehci, urb, stream);
1951 itd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);
1975 struct ehci_iso_stream *stream,
1983 iso_sched->span = urb->number_of_packets * stream->ps.period;
2011 if (stream->bEndpointAddress & USB_DIR_IN)
2022 struct ehci_iso_stream *stream,
2038 sitd_sched_init(ehci, iso_sched, stream, urb);
2053 if (likely(!list_empty(&stream->free_list))) {
2054 sitd = list_first_entry(&stream->free_list,
2067 iso_sched_free(stream, iso_sched);
2092 struct ehci_iso_stream *stream,
2102 sitd->hw_fullspeed_ep = stream->address;
2103 sitd->hw_uframe = stream->splits;
2135 struct ehci_iso_stream *stream
2143 next_uframe = stream->next_uframe;
2145 if (list_empty(&stream->td_list))
2148 += stream->bandwidth;
2169 list_move_tail(&sitd->sitd_list, &stream->td_list);
2170 sitd->stream = stream;
2173 sitd_patch(ehci, stream, sitd, sched, packet);
2177 next_uframe += stream->uperiod;
2179 stream->next_uframe = next_uframe & (mod - 1);
2182 iso_sched_free(stream, sched);
2183 urb->hcpriv = stream;
2210 struct ehci_iso_stream *stream = sitd->stream;
2243 * list_for_each_entry (sitd, &stream->td_list, sitd_list)
2261 if (list_is_singular(&stream->td_list))
2263 -= stream->bandwidth;
2269 list_move_tail(&sitd->sitd_list, &stream->free_list);
2272 if (list_empty(&stream->td_list)) {
2273 list_splice_tail_init(&stream->free_list,
2287 struct ehci_iso_stream *stream;
2290 stream = iso_stream_find(ehci, urb);
2291 if (stream == NULL) {
2292 ehci_dbg(ehci, "can't get iso stream\n");
2295 if (urb->interval != stream->ps.period) {
2297 stream->ps.period, urb->interval);
2311 status = sitd_urb_transaction(stream, ehci, urb, mem_flags);
2326 status = iso_stream_schedule(ehci, urb, stream);
2328 sitd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);