Lines Matching defs:stream
3366 usecs += q->itd->stream->usecs;
3904 struct fotg210_iso_stream *stream;
3906 stream = kzalloc(sizeof(*stream), mem_flags);
3907 if (likely(stream != NULL)) {
3908 INIT_LIST_HEAD(&stream->td_list);
3909 INIT_LIST_HEAD(&stream->free_list);
3910 stream->next_uframe = -1;
3912 return stream;
3916 struct fotg210_iso_stream *stream, struct usb_device *dev,
3943 stream->buf0 = cpu_to_hc32(fotg210, (epnum << 8) | dev->devnum);
3944 stream->buf1 = cpu_to_hc32(fotg210, buf1);
3945 stream->buf2 = cpu_to_hc32(fotg210, multi);
3952 stream->usecs = NS_TO_US(usb_calc_bus_time(dev->speed,
3954 stream->usecs /= 8;
3956 stream->highspeed = 1;
3957 stream->usecs = HS_USECS_ISO(maxp);
3959 bandwidth = stream->usecs * 8;
3962 stream->bandwidth = bandwidth;
3963 stream->udev = dev;
3964 stream->bEndpointAddress = is_input | epnum;
3965 stream->interval = interval;
3966 stream->maxp = maxp;
3973 struct fotg210_iso_stream *stream;
3984 stream = ep->hcpriv;
3986 if (unlikely(stream == NULL)) {
3987 stream = iso_stream_alloc(GFP_ATOMIC);
3988 if (likely(stream != NULL)) {
3989 ep->hcpriv = stream;
3990 stream->ep = ep;
3991 iso_stream_init(fotg210, stream, urb->dev, urb->pipe,
3996 } else if (unlikely(stream->hw != NULL)) {
4000 stream = NULL;
4004 return stream;
4023 struct fotg210_iso_stream *stream, struct urb *urb)
4029 iso_sched->span = urb->number_of_packets * stream->interval;
4059 static void iso_sched_free(struct fotg210_iso_stream *stream,
4065 list_splice(&iso_sched->td_list, &stream->free_list);
4069 static int itd_urb_transaction(struct fotg210_iso_stream *stream,
4083 itd_sched_init(fotg210, sched, stream, urb);
4098 if (likely(!list_empty(&stream->free_list))) {
4099 itd = list_first_entry(&stream->free_list,
4112 iso_sched_free(stream, sched);
4149 * transfers you can stream reliably; avoid more than 64 msec per urb.
4159 struct fotg210_iso_stream *stream)
4177 /* Typical case: reuse current schedule, stream is still active.
4182 if (likely(!list_empty(&stream->td_list))) {
4190 if (!stream->highspeed && fotg210->fs_i_thresh)
4199 excess = (stream->next_uframe - period - next) & (mod - 1);
4238 stream->usecs, period))
4261 stream->next_uframe = start & (mod - 1);
4264 urb->start_frame = stream->next_uframe;
4265 if (!stream->highspeed)
4274 iso_sched_free(stream, sched);
4280 struct fotg210_iso_stream *stream, struct fotg210_itd *itd)
4286 itd->hw_bufp[0] = stream->buf0;
4287 itd->hw_bufp[1] = stream->buf1;
4288 itd->hw_bufp[2] = stream->buf2;
4349 unsigned mod, struct fotg210_iso_stream *stream)
4356 next_uframe = stream->next_uframe & (mod - 1);
4358 if (unlikely(list_empty(&stream->td_list))) {
4360 += stream->bandwidth;
4363 urb->dev->devpath, stream->bEndpointAddress & 0x0f,
4364 (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
4378 list_move_tail(&itd->itd_list, &stream->td_list);
4379 itd->stream = stream;
4381 itd_init(fotg210, stream, itd);
4389 next_uframe += stream->interval;
4401 stream->next_uframe = next_uframe;
4404 iso_sched_free(stream, iso_sched);
4431 struct fotg210_iso_stream *stream = itd->stream;
4477 * list_for_each_entry (itd, &stream->td_list, itd_list)
4490 if (unlikely(list_is_singular(&stream->td_list))) {
4492 -= stream->bandwidth;
4495 dev->devpath, stream->bEndpointAddress & 0x0f,
4496 (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
4503 list_move_tail(&itd->itd_list, &stream->free_list);
4506 if (list_empty(&stream->td_list)) {
4507 list_splice_tail_init(&stream->free_list,
4520 struct fotg210_iso_stream *stream;
4523 stream = iso_stream_find(fotg210, urb);
4524 if (unlikely(stream == NULL)) {
4525 fotg210_dbg(fotg210, "can't get iso stream\n");
4528 if (unlikely(urb->interval != stream->interval &&
4532 stream->interval, urb->interval);
4544 stream);
4548 status = itd_urb_transaction(stream, fotg210, urb, mem_flags);
4563 status = iso_stream_schedule(fotg210, urb, stream);
4565 itd_link_urb(fotg210, urb, fotg210->periodic_size << 3, stream);
5381 struct fotg210_iso_stream *stream = ep->hcpriv;
5383 if (!list_empty(&stream->td_list))
5386 /* BUG_ON(!list_empty(&stream->free_list)); */
5387 kfree(stream);