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()
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()
524 unsigned period = qh->ps.period; in qh_link_periodic()
526 dev_dbg(&qh->ps.udev->dev, in qh_link_periodic()
530 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_link_periodic()
536 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) { in qh_link_periodic()
556 if (qh->ps.period > here.qh->ps.period) in qh_link_periodic()
577 ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->ps.bw_period in qh_link_periodic()
578 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_link_periodic()
579 : (qh->ps.usecs * 8); in qh_link_periodic()
609 period = qh->ps.period ? : 1; in qh_unlink_periodic()
611 for (i = qh->ps.phase; i < ehci->periodic_size; i += period) in qh_unlink_periodic()
615 ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->ps.bw_period in qh_unlink_periodic()
616 ? ((qh->ps.usecs + qh->ps.c_usecs) / qh->ps.bw_period) in qh_unlink_periodic()
617 : (qh->ps.usecs * 8); in qh_unlink_periodic()
619 dev_dbg(&qh->ps.udev->dev, in qh_unlink_periodic()
621 qh->ps.period, in qh_unlink_periodic()
623 qh, qh->ps.phase, qh->ps.usecs, qh->ps.c_usecs); in qh_unlink_periodic()
780 if (qh->ps.c_usecs && uframe >= 6) /* FSTN territory? */ in check_intr_schedule()
783 if (!check_period(ehci, frame, uframe, qh->ps.bw_uperiod, qh->ps.usecs)) in check_intr_schedule()
785 if (!qh->ps.c_usecs) { in check_intr_schedule()
792 if (tt_available(ehci, &qh->ps, tt, frame, uframe)) { in check_intr_schedule()
798 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
819 if (tt_no_collision(ehci, qh->ps.bw_period, qh->ps.udev, frame, mask)) { in check_intr_schedule()
821 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
824 qh->ps.bw_uperiod, qh->ps.c_usecs)) in check_intr_schedule()
847 if (qh->ps.phase != NO_FRAME) { in qh_schedule()
854 tt = find_tt(qh->ps.udev); in qh_schedule()
865 if (qh->ps.bw_period) { in qh_schedule()
869 for (i = qh->ps.bw_period; i > 0; --i) { in qh_schedule()
870 frame = ++ehci->random_frame & (qh->ps.bw_period - 1); in qh_schedule()
879 /* qh->ps.bw_period == 0 means every uframe */ in qh_schedule()
887 qh->ps.phase = (qh->ps.period ? ehci->random_frame & in qh_schedule()
888 (qh->ps.period - 1) : 0); in qh_schedule()
889 qh->ps.bw_phase = qh->ps.phase & (qh->ps.bw_period - 1); in qh_schedule()
890 qh->ps.phase_uf = uframe; in qh_schedule()
891 qh->ps.cs_mask = qh->ps.period ? in qh_schedule()
897 hw->hw_info2 |= cpu_to_hc32(ehci, qh->ps.cs_mask); in qh_schedule()
1011 stream->ps.phase = NO_FRAME; in iso_stream_alloc()
1056 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1063 stream->ps.bw_uperiod = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1066 stream->ps.period = urb->interval >> 3; in iso_stream_init()
1067 stream->bandwidth = stream->ps.usecs * 8 / in iso_stream_init()
1068 stream->ps.bw_uperiod; in iso_stream_init()
1082 stream->ps.usecs = HS_USECS_ISO(maxp); in iso_stream_init()
1084 stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time( in iso_stream_init()
1091 stream->ps.c_usecs = stream->ps.usecs; in iso_stream_init()
1092 stream->ps.usecs = HS_USECS_ISO(1); in iso_stream_init()
1093 stream->ps.cs_mask = 1; in iso_stream_init()
1097 stream->ps.cs_mask |= tmp << (8 + 2); in iso_stream_init()
1099 stream->ps.cs_mask = smask_out[hs_transfers - 1]; in iso_stream_init()
1106 stream->ps.bw_period = min_t(unsigned, tmp, urb->interval); in iso_stream_init()
1107 stream->ps.bw_uperiod = stream->ps.bw_period << 3; in iso_stream_init()
1109 stream->ps.period = urb->interval; in iso_stream_init()
1111 stream->bandwidth = (stream->ps.usecs + stream->ps.c_usecs) / in iso_stream_init()
1112 stream->ps.bw_period; in iso_stream_init()
1118 stream->ps.udev = dev; in iso_stream_init()
1119 stream->ps.ep = urb->ep; in iso_stream_init()
1307 int usecs = stream->ps.usecs; in reserve_release_iso_bandwidth()
1308 int c_usecs = stream->ps.c_usecs; in reserve_release_iso_bandwidth()
1309 int tt_usecs = stream->ps.tt_usecs; in reserve_release_iso_bandwidth()
1312 if (stream->ps.phase == NO_FRAME) /* Bandwidth wasn't reserved */ in reserve_release_iso_bandwidth()
1314 uframe = stream->ps.bw_phase << 3; in reserve_release_iso_bandwidth()
1316 bandwidth_dbg(ehci, sign, "iso", &stream->ps); in reserve_release_iso_bandwidth()
1325 for (i = uframe + stream->ps.phase_uf; i < EHCI_BANDWIDTH_SIZE; in reserve_release_iso_bandwidth()
1326 i += stream->ps.bw_uperiod) in reserve_release_iso_bandwidth()
1330 s_mask = stream->ps.cs_mask; in reserve_release_iso_bandwidth()
1335 i += stream->ps.bw_uperiod) { in reserve_release_iso_bandwidth()
1336 for ((j = stream->ps.phase_uf, m = 1 << j); j < 8; in reserve_release_iso_bandwidth()
1351 tt = find_tt(stream->ps.udev); in reserve_release_iso_bandwidth()
1353 list_add_tail(&stream->ps.ps_list, &tt->ps_list); in reserve_release_iso_bandwidth()
1355 list_del(&stream->ps.ps_list); in reserve_release_iso_bandwidth()
1358 i += stream->ps.bw_period) in reserve_release_iso_bandwidth()
1373 usecs = ehci->uframe_periodic_max - stream->ps.usecs; in itd_slot_ok()
1375 for (uframe &= stream->ps.bw_uperiod - 1; uframe < EHCI_BANDWIDTH_SIZE; in itd_slot_ok()
1376 uframe += stream->ps.bw_uperiod) { in itd_slot_ok()
1395 mask = stream->ps.cs_mask << (uframe & 7); in sitd_slot_ok()
1398 if (((stream->ps.cs_mask & 0xff) << (uframe & 7)) >= (1 << 7)) in sitd_slot_ok()
1406 uframe &= stream->ps.bw_uperiod - 1; in sitd_slot_ok()
1414 if (!tt_available(ehci, &stream->ps, tt, frame, uf)) in sitd_slot_ok()
1420 if (!tt_no_collision(ehci, stream->ps.bw_period, in sitd_slot_ok()
1421 stream->ps.udev, frame, mask)) in sitd_slot_ok()
1431 max_used = ehci->uframe_periodic_max - stream->ps.usecs; in sitd_slot_ok()
1432 for (tmp = stream->ps.cs_mask & 0xff; tmp; tmp >>= 1, uf++) { in sitd_slot_ok()
1438 if (stream->ps.c_usecs) { in sitd_slot_ok()
1440 stream->ps.c_usecs; in sitd_slot_ok()
1444 if ((stream->ps.cs_mask & tmp) == 0) in sitd_slot_ok()
1451 uframe += stream->ps.bw_uperiod; in sitd_slot_ok()
1454 stream->ps.cs_mask <<= uframe & 7; in sitd_slot_ok()
1455 stream->splits = cpu_to_hc32(ehci, stream->ps.cs_mask); in sitd_slot_ok()
1495 if (stream->ps.phase == NO_FRAME) { in iso_stream_schedule()
1497 struct ehci_tt *tt = find_tt(stream->ps.udev); in iso_stream_schedule()
1535 stream->ps.phase = (start >> 3) & in iso_stream_schedule()
1536 (stream->ps.period - 1); in iso_stream_schedule()
1537 stream->ps.bw_phase = stream->ps.phase & in iso_stream_schedule()
1538 (stream->ps.bw_period - 1); in iso_stream_schedule()
1539 stream->ps.phase_uf = start & 7; in iso_stream_schedule()
1545 start = (stream->ps.phase << 3) + stream->ps.phase_uf; in iso_stream_schedule()
1994 iso_sched->span = urb->number_of_packets * stream->ps.period; in sitd_sched_init()
2306 if (urb->interval != stream->ps.period) { in sitd_submit()
2308 stream->ps.period, urb->interval); in sitd_submit()