Lines Matching full:ps

195 		struct ehci_per_sched *ps)  in bandwidth_dbg()  argument
197 dev_dbg(&ps->udev->dev, in bandwidth_dbg()
199 ps->ep->desc.bEndpointAddress, in bandwidth_dbg()
201 (ps->bw_phase << 3) + ps->phase_uf, ps->bw_uperiod, in bandwidth_dbg()
202 ps->phase, ps->phase_uf, ps->period, in bandwidth_dbg()
203 ps->usecs, ps->c_usecs, ps->cs_mask); in bandwidth_dbg()
211 int usecs = qh->ps.usecs; in reserve_release_intr_bandwidth()
212 int c_usecs = qh->ps.c_usecs; in reserve_release_intr_bandwidth()
213 int tt_usecs = qh->ps.tt_usecs; in reserve_release_intr_bandwidth()
216 if (qh->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */ in reserve_release_intr_bandwidth()
218 start_uf = qh->ps.bw_phase << 3; in reserve_release_intr_bandwidth()
220 bandwidth_dbg(ehci, sign, "intr", &qh->ps); in reserve_release_intr_bandwidth()
229 for (i = start_uf + qh->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE; in reserve_release_intr_bandwidth()
230 i += qh->ps.bw_uperiod) in reserve_release_intr_bandwidth()
234 if (qh->ps.c_usecs) { in reserve_release_intr_bandwidth()
237 i += qh->ps.bw_uperiod) { in reserve_release_intr_bandwidth()
239 if (qh->ps.cs_mask & m) in reserve_release_intr_bandwidth()
247 tt = find_tt(qh->ps.udev); in reserve_release_intr_bandwidth()
249 list_add_tail(&qh->ps.ps_list, &tt->ps_list); in reserve_release_intr_bandwidth()
251 list_del(&qh->ps.ps_list); in reserve_release_intr_bandwidth()
254 i += qh->ps.bw_period) in reserve_release_intr_bandwidth()
264 struct ehci_per_sched *ps; in compute_tt_budget() local
273 list_for_each_entry(ps, &tt->ps_list, ps_list) { in compute_tt_budget()
274 for (uframe = ps->bw_phase << 3; uframe < EHCI_BANDWIDTH_SIZE; in compute_tt_budget()
275 uframe += ps->bw_uperiod) { in compute_tt_budget()
277 x = ps->tt_usecs; in compute_tt_budget()
280 for (uf = ps->phase_uf; uf < 8; ++uf) { in compute_tt_budget()
349 struct ehci_per_sched *ps, in tt_available() argument
355 unsigned period = ps->bw_period; in tt_available()
356 unsigned usecs = ps->tt_usecs; in tt_available()
437 if (same_tt(dev, here.qh->ps.udev)) { in tt_no_collision()
517 unsigned period = qh->ps.period; in qh_link_periodic()
519 dev_dbg(&qh->ps.udev->dev, in qh_link_periodic()
523 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_link_periodic()
529 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) { in qh_link_periodic()
549 if (qh->ps.period > here.qh->ps.period) in qh_link_periodic()
570 ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->ps.bw_period in qh_link_periodic()
571 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_link_periodic()
572 : (qh->ps.usecs * 8); in qh_link_periodic()
602 period = qh->ps.period ? : 1; in qh_unlink_periodic()
604 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) in qh_unlink_periodic()
608 ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->ps.bw_period in qh_unlink_periodic()
609 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_unlink_periodic()
610 : (qh->ps.usecs * 8); in qh_unlink_periodic()
612 dev_dbg(&qh->ps.udev->dev, in qh_unlink_periodic()
614 qh->ps.period, in qh_unlink_periodic()
616 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_unlink_periodic()
773 if (qh->ps.c_usecs && uframe >= 6) /* FSTN territory? */ in check_intr_schedule()
776 if (!check_period(ehci, frame, uframe, qh->ps.bw_uperiod, qh->ps.usecs)) in check_intr_schedule()
778 if (!qh->ps.c_usecs) { in check_intr_schedule()
785 if (tt_available(ehci, &qh->ps, tt, frame, uframe)) { in check_intr_schedule()
791 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
812 if (tt_no_collision(ehci, qh->ps.bw_period, qh->ps.udev, frame, mask)) { in check_intr_schedule()
814 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
817 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
840 if (qh->ps.phase != NO_FRAME) { in qh_schedule()
847 tt = find_tt(qh->ps.udev); in qh_schedule()
858 if (qh->ps.bw_period) { in qh_schedule()
862 for (i = qh->ps.bw_period; i > 0; --i) { in qh_schedule()
863 frame = ++ehci->random_frame & (qh->ps.bw_period - 1); in qh_schedule()
872 /* qh->ps.bw_period == 0 means every uframe */ in qh_schedule()
880 qh->ps.phase = (qh->ps.period ? ehci->random_frame & in qh_schedule()
881 (qh->ps.period - 1) : 0); in qh_schedule()
882 qh->ps.bw_phase = qh->ps.phase & (qh->ps.bw_period - 1); in qh_schedule()
883 qh->ps.phase_uf = uframe; in qh_schedule()
884 qh->ps.cs_mask = qh->ps.period ? in qh_schedule()
890 hw->hw_info2 |= cpu_to_hc32(ehci, qh->ps.cs_mask); in qh_schedule()
1004 stream->ps.phase = NO_FRAME; in iso_stream_alloc()
1049 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1056 stream->ps.bw_uperiod = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1059 stream->ps.period = urb->interval >> 3; in iso_stream_init()
1060 stream->bandwidth = stream->ps.usecs * 8 / in iso_stream_init()
1061 stream->ps.bw_uperiod; in iso_stream_init()
1075 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1077 stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time( in iso_stream_init()
1084 stream->ps.c_usecs = stream->ps.usecs; in iso_stream_init()
1085 stream->ps.usecs = HS_USECS_ISO(1); in iso_stream_init()
1086 stream->ps.cs_mask = 1; in iso_stream_init()
1090 stream->ps.cs_mask |= tmp << (8 + 2); in iso_stream_init()
1092 stream->ps.cs_mask = smask_out[hs_transfers - 1]; in iso_stream_init()
1099 stream->ps.bw_period = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1100 stream->ps.bw_uperiod = stream->ps.bw_period << 3; in iso_stream_init()
1102 stream->ps.period = urb->interval; in iso_stream_init()
1104 stream->bandwidth = (stream->ps.usecs + stream->ps.c_usecs) / in iso_stream_init()
1105 stream->ps.bw_period; in iso_stream_init()
1111 stream->ps.udev = dev; in iso_stream_init()
1112 stream->ps.ep = urb->ep; in iso_stream_init()
1302 int usecs = stream->ps.usecs; in reserve_release_iso_bandwidth()
1303 int c_usecs = stream->ps.c_usecs; in reserve_release_iso_bandwidth()
1304 int tt_usecs = stream->ps.tt_usecs; in reserve_release_iso_bandwidth()
1307 if (stream->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */ in reserve_release_iso_bandwidth()
1309 uframe = stream->ps.bw_phase << 3; in reserve_release_iso_bandwidth()
1311 bandwidth_dbg(ehci, sign, "iso", &stream->ps); in reserve_release_iso_bandwidth()
1320 for (i = uframe + stream->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE; in reserve_release_iso_bandwidth()
1321 i += stream->ps.bw_uperiod) in reserve_release_iso_bandwidth()
1325 s_mask = stream->ps.cs_mask; in reserve_release_iso_bandwidth()
1330 i += stream->ps.bw_uperiod) { in reserve_release_iso_bandwidth()
1331 for ((j = stream->ps.phase_uf, m = 1 << j); j < 8; in reserve_release_iso_bandwidth()
1340 tt = find_tt(stream->ps.udev); in reserve_release_iso_bandwidth()
1342 list_add_tail(&stream->ps.ps_list, &tt->ps_list); in reserve_release_iso_bandwidth()
1344 list_del(&stream->ps.ps_list); in reserve_release_iso_bandwidth()
1347 i += stream->ps.bw_period) in reserve_release_iso_bandwidth()
1362 usecs = ehci->uframe_periodic_max - stream->ps.usecs; in itd_slot_ok()
1364 for (uframe &= stream->ps.bw_uperiod - 1; uframe < EHCI_BANDWIDTH_SIZE; in itd_slot_ok()
1365 uframe += stream->ps.bw_uperiod) { in itd_slot_ok()
1384 mask = stream->ps.cs_mask << (uframe & 7); in sitd_slot_ok()
1387 if (((stream->ps.cs_mask & 0xff) << (uframe & 7)) >= (1 << 7)) in sitd_slot_ok()
1395 uframe &= stream->ps.bw_uperiod - 1; in sitd_slot_ok()
1403 if (!tt_available(ehci, &stream->ps, tt, frame, uf)) in sitd_slot_ok()
1409 if (!tt_no_collision(ehci, stream->ps.bw_period, in sitd_slot_ok()
1410 stream->ps.udev, frame, mask)) in sitd_slot_ok()
1420 max_used = ehci->uframe_periodic_max - stream->ps.usecs; in sitd_slot_ok()
1421 for (tmp = stream->ps.cs_mask & 0xff; tmp; tmp >>= 1, uf++) { in sitd_slot_ok()
1427 if (stream->ps.c_usecs) { in sitd_slot_ok()
1429 stream->ps.c_usecs; in sitd_slot_ok()
1433 if ((stream->ps.cs_mask & tmp) == 0) in sitd_slot_ok()
1440 uframe += stream->ps.bw_uperiod; in sitd_slot_ok()
1443 stream->ps.cs_mask <<= uframe & 7; in sitd_slot_ok()
1444 stream->splits = cpu_to_hc32(ehci, stream->ps.cs_mask); in sitd_slot_ok()
1484 if (stream->ps.phase == NO_FRAME) { in iso_stream_schedule()
1486 struct ehci_tt *tt = find_tt(stream->ps.udev); in iso_stream_schedule()
1524 stream->ps.phase = (start >> 3) & in iso_stream_schedule()
1525 (stream->ps.period - 1); in iso_stream_schedule()
1526 stream->ps.bw_phase = stream->ps.phase & in iso_stream_schedule()
1527 (stream->ps.bw_period - 1); in iso_stream_schedule()
1528 stream->ps.phase_uf = start & 7; in iso_stream_schedule()
1534 start = (stream->ps.phase << 3) + stream->ps.phase_uf; in iso_stream_schedule()
1983 iso_sched->span = urb->number_of_packets * stream->ps.period; in sitd_sched_init()
2295 if (urb->interval != stream->ps.period) { in sitd_submit()
2297 stream->ps.period, urb->interval); in sitd_submit()