Lines Matching defs:stream

1004 	struct ehci_iso_stream *stream;
1006 stream = kzalloc(sizeof(*stream), mem_flags);
1007 if (likely(stream != NULL)) {
1008 INIT_LIST_HEAD(&stream->td_list);
1009 INIT_LIST_HEAD(&stream->free_list);
1010 stream->next_uframe = NO_FRAME;
1011 stream->ps.phase = NO_FRAME;
1013 return stream;
1019 struct ehci_iso_stream *stream,
1044 stream->highspeed = 1;
1049 stream->buf0 = cpu_to_hc32(ehci, (epnum << 8) | dev->devnum);
1050 stream->buf1 = cpu_to_hc32(ehci, buf1);
1051 stream->buf2 = cpu_to_hc32(ehci, multi);
1056 stream->ps.usecs = HS_USECS_ISO(maxp);
1063 stream->ps.bw_uperiod = min_t(unsigned, tmp, urb->interval);
1065 stream->uperiod = urb->interval;
1066 stream->ps.period = urb->interval >> 3;
1067 stream->bandwidth = stream->ps.usecs * 8 /
1068 stream->ps.bw_uperiod;
1082 stream->ps.usecs = HS_USECS_ISO(maxp);
1084 stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time(
1091 stream->ps.c_usecs = stream->ps.usecs;
1092 stream->ps.usecs = HS_USECS_ISO(1);
1093 stream->ps.cs_mask = 1;
1097 stream->ps.cs_mask |= tmp << (8 + 2);
1099 stream->ps.cs_mask = smask_out[hs_transfers - 1];
1106 stream->ps.bw_period = min_t(unsigned, tmp, urb->interval);
1107 stream->ps.bw_uperiod = stream->ps.bw_period << 3;
1109 stream->ps.period = urb->interval;
1110 stream->uperiod = urb->interval << 3;
1111 stream->bandwidth = (stream->ps.usecs + stream->ps.c_usecs) /
1112 stream->ps.bw_period;
1114 /* stream->splits gets created from cs_mask later */
1115 stream->address = cpu_to_hc32(ehci, addr);
1118 stream->ps.udev = dev;
1119 stream->ps.ep = urb->ep;
1121 stream->bEndpointAddress = is_input | epnum;
1122 stream->maxp = maxp;
1129 struct ehci_iso_stream *stream;
1140 stream = ep->hcpriv;
1142 if (unlikely(stream == NULL)) {
1143 stream = iso_stream_alloc(GFP_ATOMIC);
1144 if (likely(stream != NULL)) {
1145 ep->hcpriv = stream;
1146 iso_stream_init(ehci, stream, urb);
1150 } else if (unlikely(stream->hw != NULL)) {
1154 stream = NULL;
1158 return stream;
1181 struct ehci_iso_stream *stream,
1189 iso_sched->span = urb->number_of_packets * stream->uperiod;
1221 struct ehci_iso_stream *stream,
1228 list_splice(&iso_sched->td_list, &stream->free_list);
1234 struct ehci_iso_stream *stream,
1251 itd_sched_init(ehci, sched, stream, urb);
1266 if (likely(!list_empty(&stream->free_list))) {
1267 itd = list_first_entry(&stream->free_list,
1280 iso_sched_free(stream, sched);
1302 struct ehci_iso_stream *stream, int sign)
1307 int usecs = stream->ps.usecs;
1308 int c_usecs = stream->ps.c_usecs;
1309 int tt_usecs = stream->ps.tt_usecs;
1312 if (stream->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */
1314 uframe = stream->ps.bw_phase << 3;
1316 bandwidth_dbg(ehci, sign, "iso", &stream->ps);
1324 if (!stream->splits) { /* High speed */
1325 for (i = uframe + stream->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE;
1326 i += stream->ps.bw_uperiod)
1330 s_mask = stream->ps.cs_mask;
1335 i += stream->ps.bw_uperiod) {
1336 for ((j = stream->ps.phase_uf, m = 1 << j); j < 8;
1351 tt = find_tt(stream->ps.udev);
1353 list_add_tail(&stream->ps.ps_list, &tt->ps_list);
1355 list_del(&stream->ps.ps_list);
1358 i += stream->ps.bw_period)
1366 struct ehci_iso_stream *stream,
1373 usecs = ehci->uframe_periodic_max - stream->ps.usecs;
1375 for (uframe &= stream->ps.bw_uperiod - 1; uframe < EHCI_BANDWIDTH_SIZE;
1376 uframe += stream->ps.bw_uperiod) {
1386 struct ehci_iso_stream *stream,
1395 mask = stream->ps.cs_mask << (uframe & 7);
1398 if (((stream->ps.cs_mask & 0xff) << (uframe & 7)) >= (1 << 7))
1406 uframe &= stream->ps.bw_uperiod - 1;
1414 if (!tt_available(ehci, &stream->ps, tt, frame, uf))
1420 if (!tt_no_collision(ehci, stream->ps.bw_period,
1421 stream->ps.udev, frame, mask))
1431 max_used = ehci->uframe_periodic_max - stream->ps.usecs;
1432 for (tmp = stream->ps.cs_mask & 0xff; tmp; tmp >>= 1, uf++) {
1438 if (stream->ps.c_usecs) {
1440 stream->ps.c_usecs;
1444 if ((stream->ps.cs_mask & tmp) == 0)
1451 uframe += stream->ps.bw_uperiod;
1454 stream->ps.cs_mask <<= uframe & 7;
1455 stream->splits = cpu_to_hc32(ehci, stream->ps.cs_mask);
1463 * transfers you can stream reliably; avoid more than 64 msec per urb.
1474 struct ehci_iso_stream *stream
1482 bool empty = list_empty(&stream->td_list);
1485 period = stream->uperiod;
1487 if (!stream->highspeed)
1490 /* Start a new isochronous stream? */
1495 if (stream->ps.phase == NO_FRAME) {
1497 struct ehci_tt *tt = find_tt(stream->ps.udev);
1517 if (stream->highspeed) {
1518 if (itd_slot_ok(ehci, stream, start))
1523 if (sitd_slot_ok(ehci, stream, start,
1535 stream->ps.phase = (start >> 3) &
1536 (stream->ps.period - 1);
1537 stream->ps.bw_phase = stream->ps.phase &
1538 (stream->ps.bw_period - 1);
1539 stream->ps.phase_uf = start & 7;
1540 reserve_release_iso_bandwidth(ehci, stream, 1);
1543 /* New stream is already scheduled; use the upcoming slot */
1545 start = (stream->ps.phase << 3) + stream->ps.phase_uf;
1548 stream->next_uframe = start;
1570 start = (stream->next_uframe - base) & (mod - 1);
1576 * Typical case: reuse current schedule, stream may still be active.
1586 urb, stream->next_uframe, base, period, mod);
1625 iso_sched_free(stream, sched);
1648 stream->next_uframe = (start + skip) & (mod - 1);
1652 if (!stream->highspeed)
1657 iso_sched_free(stream, sched);
1665 itd_init(struct ehci_hcd *ehci, struct ehci_iso_stream *stream,
1672 itd->hw_bufp[0] = stream->buf0;
1673 itd->hw_bufp[1] = stream->buf1;
1674 itd->hw_bufp[2] = stream->buf2;
1745 struct ehci_iso_stream *stream
1753 next_uframe = stream->next_uframe & (mod - 1);
1755 if (unlikely(list_empty(&stream->td_list)))
1757 += stream->bandwidth;
1777 list_move_tail(&itd->itd_list, &stream->td_list);
1778 itd->stream = stream;
1780 itd_init(ehci, stream, itd);
1788 next_uframe += stream->uperiod;
1799 stream->next_uframe = next_uframe;
1802 iso_sched_free(stream, iso_sched);
1803 urb->hcpriv = stream;
1828 struct ehci_iso_stream *stream = itd->stream;
1874 * list_for_each_entry (itd, &stream->td_list, itd_list)
1892 if (unlikely(list_is_singular(&stream->td_list)))
1894 -= stream->bandwidth;
1900 list_move_tail(&itd->itd_list, &stream->free_list);
1903 if (list_empty(&stream->td_list)) {
1904 list_splice_tail_init(&stream->free_list,
1919 struct ehci_iso_stream *stream;
1922 stream = iso_stream_find(ehci, urb);
1923 if (unlikely(stream == NULL)) {
1924 ehci_dbg(ehci, "can't get iso stream\n");
1927 if (unlikely(urb->interval != stream->uperiod)) {
1929 stream->uperiod, urb->interval);
1941 stream);
1945 status = itd_urb_transaction(stream, ehci, urb, mem_flags);
1960 status = iso_stream_schedule(ehci, urb, stream);
1962 itd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);
1986 struct ehci_iso_stream *stream,
1994 iso_sched->span = urb->number_of_packets * stream->ps.period;
2022 if (stream->bEndpointAddress & USB_DIR_IN)
2033 struct ehci_iso_stream *stream,
2049 sitd_sched_init(ehci, iso_sched, stream, urb);
2064 if (likely(!list_empty(&stream->free_list))) {
2065 sitd = list_first_entry(&stream->free_list,
2078 iso_sched_free(stream, iso_sched);
2103 struct ehci_iso_stream *stream,
2113 sitd->hw_fullspeed_ep = stream->address;
2114 sitd->hw_uframe = stream->splits;
2146 struct ehci_iso_stream *stream
2154 next_uframe = stream->next_uframe;
2156 if (list_empty(&stream->td_list))
2159 += stream->bandwidth;
2180 list_move_tail(&sitd->sitd_list, &stream->td_list);
2181 sitd->stream = stream;
2184 sitd_patch(ehci, stream, sitd, sched, packet);
2188 next_uframe += stream->uperiod;
2190 stream->next_uframe = next_uframe & (mod - 1);
2193 iso_sched_free(stream, sched);
2194 urb->hcpriv = stream;
2221 struct ehci_iso_stream *stream = sitd->stream;
2254 * list_for_each_entry (sitd, &stream->td_list, sitd_list)
2272 if (list_is_singular(&stream->td_list))
2274 -= stream->bandwidth;
2280 list_move_tail(&sitd->sitd_list, &stream->free_list);
2283 if (list_empty(&stream->td_list)) {
2284 list_splice_tail_init(&stream->free_list,
2298 struct ehci_iso_stream *stream;
2301 stream = iso_stream_find(ehci, urb);
2302 if (stream == NULL) {
2303 ehci_dbg(ehci, "can't get iso stream\n");
2306 if (urb->interval != stream->ps.period) {
2308 stream->ps.period, urb->interval);
2322 status = sitd_urb_transaction(stream, ehci, urb, mem_flags);
2337 status = iso_stream_schedule(ehci, urb, stream);
2339 sitd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);