Lines Matching refs: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()
253 tt = find_tt(qh->ps.udev); in reserve_release_intr_bandwidth()
255 list_add_tail(&qh->ps.ps_list, &tt->ps_list); in reserve_release_intr_bandwidth()
257 list_del(&qh->ps.ps_list); in reserve_release_intr_bandwidth()
260 i += qh->ps.bw_period) in reserve_release_intr_bandwidth()
270 struct ehci_per_sched *ps; in compute_tt_budget() local
279 list_for_each_entry(ps, &tt->ps_list, ps_list) { in compute_tt_budget()
280 for (uframe = ps->bw_phase << 3; uframe < EHCI_BANDWIDTH_SIZE; in compute_tt_budget()
281 uframe += ps->bw_uperiod) { in compute_tt_budget()
283 x = ps->tt_usecs; in compute_tt_budget()
286 for (uf = ps->phase_uf; uf < 8; ++uf) { in compute_tt_budget()
355 struct ehci_per_sched *ps, in tt_available() argument
361 unsigned period = ps->bw_period; in tt_available()
362 unsigned usecs = ps->tt_usecs; in tt_available()
443 if (same_tt(dev, here.qh->ps.udev)) { in tt_no_collision()
523 unsigned period = qh->ps.period; in qh_link_periodic()
525 dev_dbg(&qh->ps.udev->dev, in qh_link_periodic()
529 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_link_periodic()
535 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) { in qh_link_periodic()
555 if (qh->ps.period > here.qh->ps.period) in qh_link_periodic()
576 ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->ps.bw_period in qh_link_periodic()
577 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_link_periodic()
578 : (qh->ps.usecs * 8); in qh_link_periodic()
608 period = qh->ps.period ? : 1; in qh_unlink_periodic()
610 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) in qh_unlink_periodic()
614 ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->ps.bw_period in qh_unlink_periodic()
615 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_unlink_periodic()
616 : (qh->ps.usecs * 8); in qh_unlink_periodic()
618 dev_dbg(&qh->ps.udev->dev, in qh_unlink_periodic()
620 qh->ps.period, in qh_unlink_periodic()
622 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_unlink_periodic()
779 if (qh->ps.c_usecs && uframe >= 6) /* FSTN territory? */ in check_intr_schedule()
782 if (!check_period(ehci, frame, uframe, qh->ps.bw_uperiod, qh->ps.usecs)) in check_intr_schedule()
784 if (!qh->ps.c_usecs) { in check_intr_schedule()
791 if (tt_available(ehci, &qh->ps, tt, frame, uframe)) { in check_intr_schedule()
797 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
818 if (tt_no_collision(ehci, qh->ps.bw_period, qh->ps.udev, frame, mask)) { in check_intr_schedule()
820 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
823 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
846 if (qh->ps.phase != NO_FRAME) { in qh_schedule()
853 tt = find_tt(qh->ps.udev); in qh_schedule()
864 if (qh->ps.bw_period) { in qh_schedule()
868 for (i = qh->ps.bw_period; i > 0; --i) { in qh_schedule()
869 frame = ++ehci->random_frame & (qh->ps.bw_period - 1); in qh_schedule()
886 qh->ps.phase = (qh->ps.period ? ehci->random_frame & in qh_schedule()
887 (qh->ps.period - 1) : 0); in qh_schedule()
888 qh->ps.bw_phase = qh->ps.phase & (qh->ps.bw_period - 1); in qh_schedule()
889 qh->ps.phase_uf = uframe; in qh_schedule()
890 qh->ps.cs_mask = qh->ps.period ? in qh_schedule()
896 hw->hw_info2 |= cpu_to_hc32(ehci, qh->ps.cs_mask); in qh_schedule()
1010 stream->ps.phase = NO_FRAME; in iso_stream_alloc()
1055 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1062 stream->ps.bw_uperiod = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1065 stream->ps.period = urb->interval >> 3; in iso_stream_init()
1066 stream->bandwidth = stream->ps.usecs * 8 / in iso_stream_init()
1067 stream->ps.bw_uperiod; in iso_stream_init()
1081 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1083 stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time( in iso_stream_init()
1090 stream->ps.c_usecs = stream->ps.usecs; in iso_stream_init()
1091 stream->ps.usecs = HS_USECS_ISO(1); in iso_stream_init()
1092 stream->ps.cs_mask = 1; in iso_stream_init()
1096 stream->ps.cs_mask |= tmp << (8 + 2); in iso_stream_init()
1098 stream->ps.cs_mask = smask_out[hs_transfers - 1]; in iso_stream_init()
1105 stream->ps.bw_period = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1106 stream->ps.bw_uperiod = stream->ps.bw_period << 3; in iso_stream_init()
1108 stream->ps.period = urb->interval; in iso_stream_init()
1110 stream->bandwidth = (stream->ps.usecs + stream->ps.c_usecs) / in iso_stream_init()
1111 stream->ps.bw_period; in iso_stream_init()
1117 stream->ps.udev = dev; in iso_stream_init()
1118 stream->ps.ep = urb->ep; in iso_stream_init()
1306 int usecs = stream->ps.usecs; in reserve_release_iso_bandwidth()
1307 int c_usecs = stream->ps.c_usecs; in reserve_release_iso_bandwidth()
1308 int tt_usecs = stream->ps.tt_usecs; in reserve_release_iso_bandwidth()
1311 if (stream->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */ in reserve_release_iso_bandwidth()
1313 uframe = stream->ps.bw_phase << 3; in reserve_release_iso_bandwidth()
1315 bandwidth_dbg(ehci, sign, "iso", &stream->ps); in reserve_release_iso_bandwidth()
1324 for (i = uframe + stream->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE; in reserve_release_iso_bandwidth()
1325 i += stream->ps.bw_uperiod) in reserve_release_iso_bandwidth()
1329 s_mask = stream->ps.cs_mask; in reserve_release_iso_bandwidth()
1334 i += stream->ps.bw_uperiod) { in reserve_release_iso_bandwidth()
1335 for ((j = stream->ps.phase_uf, m = 1 << j); j < 8; in reserve_release_iso_bandwidth()
1350 tt = find_tt(stream->ps.udev); in reserve_release_iso_bandwidth()
1352 list_add_tail(&stream->ps.ps_list, &tt->ps_list); in reserve_release_iso_bandwidth()
1354 list_del(&stream->ps.ps_list); in reserve_release_iso_bandwidth()
1357 i += stream->ps.bw_period) in reserve_release_iso_bandwidth()
1372 usecs = ehci->uframe_periodic_max - stream->ps.usecs; in itd_slot_ok()
1374 for (uframe &= stream->ps.bw_uperiod - 1; uframe < EHCI_BANDWIDTH_SIZE; in itd_slot_ok()
1375 uframe += stream->ps.bw_uperiod) { in itd_slot_ok()
1394 mask = stream->ps.cs_mask << (uframe & 7); in sitd_slot_ok()
1397 if (((stream->ps.cs_mask & 0xff) << (uframe & 7)) >= (1 << 7)) in sitd_slot_ok()
1405 uframe &= stream->ps.bw_uperiod - 1; in sitd_slot_ok()
1413 if (!tt_available(ehci, &stream->ps, tt, frame, uf)) in sitd_slot_ok()
1419 if (!tt_no_collision(ehci, stream->ps.bw_period, in sitd_slot_ok()
1420 stream->ps.udev, frame, mask)) in sitd_slot_ok()
1430 max_used = ehci->uframe_periodic_max - stream->ps.usecs; in sitd_slot_ok()
1431 for (tmp = stream->ps.cs_mask & 0xff; tmp; tmp >>= 1, uf++) { in sitd_slot_ok()
1437 if (stream->ps.c_usecs) { in sitd_slot_ok()
1439 stream->ps.c_usecs; in sitd_slot_ok()
1443 if ((stream->ps.cs_mask & tmp) == 0) in sitd_slot_ok()
1450 uframe += stream->ps.bw_uperiod; in sitd_slot_ok()
1453 stream->ps.cs_mask <<= uframe & 7; in sitd_slot_ok()
1454 stream->splits = cpu_to_hc32(ehci, stream->ps.cs_mask); in sitd_slot_ok()
1494 if (stream->ps.phase == NO_FRAME) { in iso_stream_schedule()
1496 struct ehci_tt *tt = find_tt(stream->ps.udev); in iso_stream_schedule()
1534 stream->ps.phase = (start >> 3) & in iso_stream_schedule()
1535 (stream->ps.period - 1); in iso_stream_schedule()
1536 stream->ps.bw_phase = stream->ps.phase & in iso_stream_schedule()
1537 (stream->ps.bw_period - 1); in iso_stream_schedule()
1538 stream->ps.phase_uf = start & 7; in iso_stream_schedule()
1544 start = (stream->ps.phase << 3) + stream->ps.phase_uf; in iso_stream_schedule()
1993 iso_sched->span = urb->number_of_packets * stream->ps.period; in sitd_sched_init()
2305 if (urb->interval != stream->ps.period) { in sitd_submit()
2307 stream->ps.period, urb->interval); in sitd_submit()