Lines Matching refs:qh

81 					 struct dwc2_qh *qh)  in dwc2_check_periodic_bandwidth()  argument
88 if (qh->dev_speed == USB_SPEED_HIGH || qh->do_split) { in dwc2_check_periodic_bandwidth()
93 max_claimed_usecs = 100 - qh->host_us; in dwc2_check_periodic_bandwidth()
99 max_claimed_usecs = 900 - qh->host_us; in dwc2_check_periodic_bandwidth()
105 __func__, hsotg->periodic_usecs, qh->host_us); in dwc2_check_periodic_bandwidth()
346 struct dwc2_qh *qh) in dwc2_get_ls_map() argument
351 if (WARN_ON(!qh->dwc_tt)) in dwc2_get_ls_map()
355 map = qh->dwc_tt->periodic_bitmaps; in dwc2_get_ls_map()
356 if (qh->dwc_tt->usb_tt->multi) in dwc2_get_ls_map()
357 map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1); in dwc2_get_ls_map()
427 struct dwc2_qh *qh; member
440 dwc2_sch_dbg(print_data->hsotg, "QH=%p ...%s\n", print_data->qh, str); in dwc2_qh_print()
450 struct dwc2_qh *qh) in dwc2_qh_schedule_print() argument
452 struct dwc2_qh_print_data print_data = { hsotg, qh }; in dwc2_qh_schedule_print()
461 if (qh->schedule_low_speed) { in dwc2_qh_schedule_print()
462 unsigned long *map = dwc2_get_ls_map(hsotg, qh); in dwc2_qh_schedule_print()
465 qh, qh->device_us, in dwc2_qh_schedule_print()
466 DWC2_ROUND_US_TO_SLICE(qh->device_us), in dwc2_qh_schedule_print()
467 DWC2_US_PER_SLICE * qh->ls_start_schedule_slice); in dwc2_qh_schedule_print()
472 qh, map); in dwc2_qh_schedule_print()
479 for (i = 0; i < qh->num_hs_transfers; i++) { in dwc2_qh_schedule_print()
480 struct dwc2_hs_transfer_time *trans_time = qh->hs_transfers + i; in dwc2_qh_schedule_print()
488 qh, i, trans_time->duration_us, uframe, rel_us); in dwc2_qh_schedule_print()
490 if (qh->num_hs_transfers) { in dwc2_qh_schedule_print()
491 dwc2_sch_dbg(hsotg, "QH=%p Whole high speed map now:\n", qh); in dwc2_qh_schedule_print()
500 struct dwc2_qh *qh) {}; in dwc2_qh_schedule_print() argument
518 static int dwc2_ls_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, in dwc2_ls_pmap_schedule() argument
521 int slices = DIV_ROUND_UP(qh->device_us, DWC2_US_PER_SLICE); in dwc2_ls_pmap_schedule()
522 unsigned long *map = dwc2_get_ls_map(hsotg, qh); in dwc2_ls_pmap_schedule()
542 qh->device_interval, search_slice, false); in dwc2_ls_pmap_schedule()
547 qh->ls_start_schedule_slice = slice; in dwc2_ls_pmap_schedule()
558 struct dwc2_qh *qh) in dwc2_ls_pmap_unschedule() argument
560 int slices = DIV_ROUND_UP(qh->device_us, DWC2_US_PER_SLICE); in dwc2_ls_pmap_unschedule()
561 unsigned long *map = dwc2_get_ls_map(hsotg, qh); in dwc2_ls_pmap_unschedule()
568 DWC2_LS_SCHEDULE_FRAMES, slices, qh->device_interval, in dwc2_ls_pmap_unschedule()
569 qh->ls_start_schedule_slice); in dwc2_ls_pmap_unschedule()
592 static int dwc2_hs_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, in dwc2_hs_pmap_schedule() argument
595 struct dwc2_hs_transfer_time *trans_time = qh->hs_transfers + index; in dwc2_hs_pmap_schedule()
601 qh->host_interval, trans_time->start_schedule_us, in dwc2_hs_pmap_schedule()
619 struct dwc2_qh *qh, int index) in dwc2_hs_pmap_unschedule() argument
621 struct dwc2_hs_transfer_time *trans_time = qh->hs_transfers + index; in dwc2_hs_pmap_unschedule()
626 qh->host_interval, trans_time->start_schedule_us); in dwc2_hs_pmap_unschedule()
643 struct dwc2_qh *qh) in dwc2_uframe_schedule_split() argument
645 int bytecount = qh->maxp_mult * qh->maxp; in dwc2_uframe_schedule_split()
654 host_interval_in_sched = gcd(qh->host_interval, in dwc2_uframe_schedule_split()
682 if (qh->schedule_low_speed) { in dwc2_uframe_schedule_split()
683 err = dwc2_ls_pmap_schedule(hsotg, qh, ls_search_slice); in dwc2_uframe_schedule_split()
702 start_s_uframe = qh->ls_start_schedule_slice / in dwc2_uframe_schedule_split()
717 if (qh->schedule_low_speed) in dwc2_uframe_schedule_split()
718 dwc2_ls_pmap_unschedule(hsotg, qh); in dwc2_uframe_schedule_split()
720 (qh->ls_start_schedule_slice / in dwc2_uframe_schedule_split()
760 if (qh->ep_type == USB_ENDPOINT_XFER_ISOC && !qh->ep_is_in) in dwc2_uframe_schedule_split()
767 DIV_ROUND_UP(188 * (qh->ls_start_schedule_slice % in dwc2_uframe_schedule_split()
789 if (!qh->ep_is_in && in dwc2_uframe_schedule_split()
793 qh, first_data_bytes, bytecount); in dwc2_uframe_schedule_split()
794 if (qh->schedule_low_speed) in dwc2_uframe_schedule_split()
795 dwc2_ls_pmap_unschedule(hsotg, qh); in dwc2_uframe_schedule_split()
802 qh->num_hs_transfers = 1 + DIV_ROUND_UP(other_data_bytes, 188); in dwc2_uframe_schedule_split()
809 if (qh->ep_type == USB_ENDPOINT_XFER_INT) { in dwc2_uframe_schedule_split()
811 qh->num_hs_transfers += 2; in dwc2_uframe_schedule_split()
813 qh->num_hs_transfers += 3; in dwc2_uframe_schedule_split()
815 if (qh->ep_is_in) { in dwc2_uframe_schedule_split()
834 if (qh->ep_is_in) { in dwc2_uframe_schedule_split()
838 qh->num_hs_transfers++; in dwc2_uframe_schedule_split()
841 last = rel_uframe + qh->num_hs_transfers + 1; in dwc2_uframe_schedule_split()
845 qh->num_hs_transfers += 2; in dwc2_uframe_schedule_split()
847 qh->num_hs_transfers += 1; in dwc2_uframe_schedule_split()
851 qh->num_hs_transfers--; in dwc2_uframe_schedule_split()
867 qh->hs_transfers[0].duration_us = HS_USECS_ISO(first_count); in dwc2_uframe_schedule_split()
868 for (i = 1; i < qh->num_hs_transfers - 1; i++) in dwc2_uframe_schedule_split()
869 qh->hs_transfers[i].duration_us = in dwc2_uframe_schedule_split()
871 if (qh->num_hs_transfers > 1) in dwc2_uframe_schedule_split()
872 qh->hs_transfers[qh->num_hs_transfers - 1].duration_us = in dwc2_uframe_schedule_split()
880 qh->hs_transfers[0].start_schedule_us = in dwc2_uframe_schedule_split()
882 for (i = 1; i < qh->num_hs_transfers; i++) in dwc2_uframe_schedule_split()
883 qh->hs_transfers[i].start_schedule_us = in dwc2_uframe_schedule_split()
889 for (i = 0; i < qh->num_hs_transfers; i++) { in dwc2_uframe_schedule_split()
890 err = dwc2_hs_pmap_schedule(hsotg, qh, true, i); in dwc2_uframe_schedule_split()
896 if (i == qh->num_hs_transfers) in dwc2_uframe_schedule_split()
900 dwc2_hs_pmap_unschedule(hsotg, qh, i); in dwc2_uframe_schedule_split()
902 if (qh->schedule_low_speed) in dwc2_uframe_schedule_split()
903 dwc2_ls_pmap_unschedule(hsotg, qh); in dwc2_uframe_schedule_split()
924 static int dwc2_uframe_schedule_hs(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_uframe_schedule_hs() argument
927 WARN_ON(qh->host_us != qh->device_us); in dwc2_uframe_schedule_hs()
928 WARN_ON(qh->host_interval != qh->device_interval); in dwc2_uframe_schedule_hs()
929 WARN_ON(qh->num_hs_transfers != 1); in dwc2_uframe_schedule_hs()
932 qh->hs_transfers[0].start_schedule_us = 0; in dwc2_uframe_schedule_hs()
933 qh->hs_transfers[0].duration_us = qh->host_us; in dwc2_uframe_schedule_hs()
935 return dwc2_hs_pmap_schedule(hsotg, qh, false, 0); in dwc2_uframe_schedule_hs()
947 static int dwc2_uframe_schedule_ls(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_uframe_schedule_ls() argument
950 WARN_ON(qh->host_us != qh->device_us); in dwc2_uframe_schedule_ls()
951 WARN_ON(qh->host_interval != qh->device_interval); in dwc2_uframe_schedule_ls()
952 WARN_ON(!qh->schedule_low_speed); in dwc2_uframe_schedule_ls()
955 return dwc2_ls_pmap_schedule(hsotg, qh, 0); in dwc2_uframe_schedule_ls()
967 static int dwc2_uframe_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_uframe_schedule() argument
971 if (qh->dev_speed == USB_SPEED_HIGH) in dwc2_uframe_schedule()
972 ret = dwc2_uframe_schedule_hs(hsotg, qh); in dwc2_uframe_schedule()
973 else if (!qh->do_split) in dwc2_uframe_schedule()
974 ret = dwc2_uframe_schedule_ls(hsotg, qh); in dwc2_uframe_schedule()
976 ret = dwc2_uframe_schedule_split(hsotg, qh); in dwc2_uframe_schedule()
979 dwc2_sch_dbg(hsotg, "QH=%p Failed to schedule %d\n", qh, ret); in dwc2_uframe_schedule()
981 dwc2_qh_schedule_print(hsotg, qh); in dwc2_uframe_schedule()
992 static void dwc2_uframe_unschedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_uframe_unschedule() argument
996 for (i = 0; i < qh->num_hs_transfers; i++) in dwc2_uframe_unschedule()
997 dwc2_hs_pmap_unschedule(hsotg, qh, i); in dwc2_uframe_unschedule()
999 if (qh->schedule_low_speed) in dwc2_uframe_unschedule()
1000 dwc2_ls_pmap_unschedule(hsotg, qh); in dwc2_uframe_unschedule()
1002 dwc2_sch_dbg(hsotg, "QH=%p Unscheduled\n", qh); in dwc2_uframe_unschedule()
1020 static void dwc2_pick_first_frame(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_pick_first_frame() argument
1047 if (qh->do_split) in dwc2_pick_first_frame()
1053 if (qh->dev_speed == USB_SPEED_HIGH || qh->do_split) { in dwc2_pick_first_frame()
1060 WARN_ON(qh->num_hs_transfers < 1); in dwc2_pick_first_frame()
1062 relative_frame = qh->hs_transfers[0].start_schedule_us / in dwc2_pick_first_frame()
1066 interval = gcd(qh->host_interval, DWC2_HS_SCHEDULE_UFRAMES); in dwc2_pick_first_frame()
1076 relative_frame = qh->ls_start_schedule_slice / in dwc2_pick_first_frame()
1078 interval = gcd(qh->host_interval, DWC2_LS_SCHEDULE_FRAMES); in dwc2_pick_first_frame()
1117 qh->next_active_frame = next_active_frame; in dwc2_pick_first_frame()
1118 qh->start_active_frame = next_active_frame; in dwc2_pick_first_frame()
1121 qh, frame_number, qh->next_active_frame); in dwc2_pick_first_frame()
1135 static int dwc2_do_reserve(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_do_reserve() argument
1140 status = dwc2_uframe_schedule(hsotg, qh); in dwc2_do_reserve()
1150 status = dwc2_check_periodic_bandwidth(hsotg, qh); in dwc2_do_reserve()
1165 hsotg->periodic_usecs += qh->host_us; in dwc2_do_reserve()
1167 dwc2_pick_first_frame(hsotg, qh); in dwc2_do_reserve()
1181 static void dwc2_do_unreserve(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_do_unreserve() argument
1185 WARN_ON(!qh->unreserve_pending); in dwc2_do_unreserve()
1188 qh->unreserve_pending = false; in dwc2_do_unreserve()
1190 if (WARN_ON(!list_empty(&qh->qh_list_entry))) in dwc2_do_unreserve()
1191 list_del_init(&qh->qh_list_entry); in dwc2_do_unreserve()
1194 hsotg->periodic_usecs -= qh->host_us; in dwc2_do_unreserve()
1197 dwc2_uframe_unschedule(hsotg, qh); in dwc2_do_unreserve()
1218 struct dwc2_qh *qh = from_timer(qh, t, unreserve_timer); in dwc2_unreserve_timer_fn() local
1219 struct dwc2_hsotg *hsotg = qh->hsotg; in dwc2_unreserve_timer_fn()
1232 if (timer_pending(&qh->unreserve_timer)) in dwc2_unreserve_timer_fn()
1246 if (qh->unreserve_pending) in dwc2_unreserve_timer_fn()
1247 dwc2_do_unreserve(hsotg, qh); in dwc2_unreserve_timer_fn()
1263 struct dwc2_qh *qh) in dwc2_check_max_xfer_size() argument
1269 max_xfer_size = qh->maxp * qh->maxp_mult; in dwc2_check_max_xfer_size()
1292 static int dwc2_schedule_periodic(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_schedule_periodic() argument
1296 status = dwc2_check_max_xfer_size(hsotg, qh); in dwc2_schedule_periodic()
1305 if (del_timer(&qh->unreserve_timer)) in dwc2_schedule_periodic()
1306 WARN_ON(!qh->unreserve_pending); in dwc2_schedule_periodic()
1315 if (!qh->unreserve_pending) { in dwc2_schedule_periodic()
1316 status = dwc2_do_reserve(hsotg, qh); in dwc2_schedule_periodic()
1326 if (dwc2_frame_num_le(qh->next_active_frame, in dwc2_schedule_periodic()
1328 dwc2_pick_first_frame(hsotg, qh); in dwc2_schedule_periodic()
1331 qh->unreserve_pending = 0; in dwc2_schedule_periodic()
1335 list_add_tail(&qh->qh_list_entry, &hsotg->periodic_sched_ready); in dwc2_schedule_periodic()
1338 list_add_tail(&qh->qh_list_entry, in dwc2_schedule_periodic()
1352 struct dwc2_qh *qh) in dwc2_deschedule_periodic() argument
1373 did_modify = mod_timer(&qh->unreserve_timer, in dwc2_deschedule_periodic()
1376 qh->unreserve_pending = 1; in dwc2_deschedule_periodic()
1378 list_del_init(&qh->qh_list_entry); in dwc2_deschedule_periodic()
1406 struct dwc2_qh *qh = container_of(t, struct dwc2_qh, wait_timer); in dwc2_wait_timer_fn() local
1407 struct dwc2_hsotg *hsotg = qh->hsotg; in dwc2_wait_timer_fn()
1416 if (!qh->wait_timer_cancel) { in dwc2_wait_timer_fn()
1419 qh->want_wait = false; in dwc2_wait_timer_fn()
1421 list_move(&qh->qh_list_entry, in dwc2_wait_timer_fn()
1442 static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, in dwc2_qh_init() argument
1460 qh->hsotg = hsotg; in dwc2_qh_init()
1461 timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0); in dwc2_qh_init()
1462 hrtimer_init(&qh->wait_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); in dwc2_qh_init()
1463 qh->wait_timer.function = &dwc2_wait_timer_fn; in dwc2_qh_init()
1464 qh->ep_type = ep_type; in dwc2_qh_init()
1465 qh->ep_is_in = ep_is_in; in dwc2_qh_init()
1467 qh->data_toggle = DWC2_HC_PID_DATA0; in dwc2_qh_init()
1468 qh->maxp = maxp; in dwc2_qh_init()
1469 qh->maxp_mult = maxp_mult; in dwc2_qh_init()
1470 INIT_LIST_HEAD(&qh->qtd_list); in dwc2_qh_init()
1471 INIT_LIST_HEAD(&qh->qh_list_entry); in dwc2_qh_init()
1473 qh->do_split = do_split; in dwc2_qh_init()
1474 qh->dev_speed = dev_speed; in dwc2_qh_init()
1481 &qh->ttport); in dwc2_qh_init()
1484 qh->dwc_tt = dwc_tt; in dwc2_qh_init()
1486 qh->host_us = NS_TO_US(usb_calc_bus_time(host_speed, ep_is_in, in dwc2_qh_init()
1493 qh->device_us = NS_TO_US(device_ns); in dwc2_qh_init()
1495 qh->device_interval = urb->interval; in dwc2_qh_init()
1496 qh->host_interval = urb->interval * (do_split ? 8 : 1); in dwc2_qh_init()
1503 qh->schedule_low_speed = prtspd != HPRT0_SPD_HIGH_SPEED || in dwc2_qh_init()
1508 qh->num_hs_transfers = -1; in dwc2_qh_init()
1510 qh->num_hs_transfers = 1; in dwc2_qh_init()
1512 qh->num_hs_transfers = 0; in dwc2_qh_init()
1533 switch (qh->ep_type) { in dwc2_qh_init()
1551 dwc2_sch_dbg(hsotg, "QH=%p Init %s, %s speed, %d bytes:\n", qh, type, in dwc2_qh_init()
1553 dwc2_sch_dbg(hsotg, "QH=%p ...addr=%d, ep=%d, %s\n", qh, in dwc2_qh_init()
1560 qh, qh->host_us, qh->device_us); in dwc2_qh_init()
1562 qh, qh->host_interval, qh->device_interval); in dwc2_qh_init()
1563 if (qh->schedule_low_speed) in dwc2_qh_init()
1565 qh, dwc2_get_ls_map(hsotg, qh)); in dwc2_qh_init()
1583 struct dwc2_qh *qh; in dwc2_hcd_qh_create() local
1589 qh = kzalloc(sizeof(*qh), mem_flags); in dwc2_hcd_qh_create()
1590 if (!qh) in dwc2_hcd_qh_create()
1593 dwc2_qh_init(hsotg, qh, urb, mem_flags); in dwc2_hcd_qh_create()
1596 dwc2_hcd_qh_init_ddma(hsotg, qh, mem_flags) < 0) { in dwc2_hcd_qh_create()
1597 dwc2_hcd_qh_free(hsotg, qh); in dwc2_hcd_qh_create()
1601 return qh; in dwc2_hcd_qh_create()
1615 void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_hcd_qh_free() argument
1618 if (del_timer_sync(&qh->unreserve_timer)) { in dwc2_hcd_qh_free()
1622 dwc2_do_unreserve(hsotg, qh); in dwc2_hcd_qh_free()
1633 hrtimer_cancel(&qh->wait_timer); in dwc2_hcd_qh_free()
1635 dwc2_host_put_tt_info(hsotg, qh->dwc_tt); in dwc2_hcd_qh_free()
1637 if (qh->desc_list) in dwc2_hcd_qh_free()
1638 dwc2_hcd_qh_free_ddma(hsotg, qh); in dwc2_hcd_qh_free()
1639 else if (hsotg->unaligned_cache && qh->dw_align_buf) in dwc2_hcd_qh_free()
1640 kmem_cache_free(hsotg->unaligned_cache, qh->dw_align_buf); in dwc2_hcd_qh_free()
1642 kfree(qh); in dwc2_hcd_qh_free()
1655 int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_hcd_qh_add() argument
1661 if (dbg_qh(qh)) in dwc2_hcd_qh_add()
1664 if (!list_empty(&qh->qh_list_entry)) in dwc2_hcd_qh_add()
1669 if (dwc2_qh_is_non_per(qh)) { in dwc2_hcd_qh_add()
1671 qh->start_active_frame = hsotg->frame_number; in dwc2_hcd_qh_add()
1672 qh->next_active_frame = qh->start_active_frame; in dwc2_hcd_qh_add()
1674 if (qh->want_wait) { in dwc2_hcd_qh_add()
1675 list_add_tail(&qh->qh_list_entry, in dwc2_hcd_qh_add()
1677 qh->wait_timer_cancel = false; in dwc2_hcd_qh_add()
1679 hrtimer_start(&qh->wait_timer, delay, HRTIMER_MODE_REL); in dwc2_hcd_qh_add()
1681 list_add_tail(&qh->qh_list_entry, in dwc2_hcd_qh_add()
1687 status = dwc2_schedule_periodic(hsotg, qh); in dwc2_hcd_qh_add()
1707 void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) in dwc2_hcd_qh_unlink() argument
1714 qh->wait_timer_cancel = true; in dwc2_hcd_qh_unlink()
1716 if (list_empty(&qh->qh_list_entry)) in dwc2_hcd_qh_unlink()
1720 if (dwc2_qh_is_non_per(qh)) { in dwc2_hcd_qh_unlink()
1721 if (hsotg->non_periodic_qh_ptr == &qh->qh_list_entry) in dwc2_hcd_qh_unlink()
1724 list_del_init(&qh->qh_list_entry); in dwc2_hcd_qh_unlink()
1728 dwc2_deschedule_periodic(hsotg, qh); in dwc2_hcd_qh_unlink()
1758 struct dwc2_qh *qh, u16 frame_number) in dwc2_next_for_periodic_split() argument
1760 u16 old_frame = qh->next_active_frame; in dwc2_next_for_periodic_split()
1771 if (old_frame == qh->start_active_frame && in dwc2_next_for_periodic_split()
1772 !(qh->ep_type == USB_ENDPOINT_XFER_ISOC && !qh->ep_is_in)) in dwc2_next_for_periodic_split()
1777 qh->next_active_frame = dwc2_frame_num_inc(old_frame, incr); in dwc2_next_for_periodic_split()
1787 if (dwc2_frame_num_gt(prev_frame_number, qh->next_active_frame)) { in dwc2_next_for_periodic_split()
1793 qh->next_active_frame); in dwc2_next_for_periodic_split()
1794 qh->next_active_frame = frame_number; in dwc2_next_for_periodic_split()
1821 struct dwc2_qh *qh, u16 frame_number) in dwc2_next_periodic_start() argument
1824 u16 interval = qh->host_interval; in dwc2_next_periodic_start()
1827 qh->start_active_frame = dwc2_frame_num_inc(qh->start_active_frame, in dwc2_next_periodic_start()
1867 if (qh->start_active_frame == qh->next_active_frame || in dwc2_next_periodic_start()
1868 dwc2_frame_num_gt(prev_frame_number, qh->start_active_frame)) { in dwc2_next_periodic_start()
1869 u16 ideal_start = qh->start_active_frame; in dwc2_next_periodic_start()
1876 if (qh->do_split || qh->dev_speed == USB_SPEED_HIGH) in dwc2_next_periodic_start()
1883 qh->start_active_frame = dwc2_frame_num_inc( in dwc2_next_periodic_start()
1884 qh->start_active_frame, interval); in dwc2_next_periodic_start()
1886 qh->start_active_frame)); in dwc2_next_periodic_start()
1888 missed = dwc2_frame_num_dec(qh->start_active_frame, in dwc2_next_periodic_start()
1893 qh->next_active_frame = qh->start_active_frame; in dwc2_next_periodic_start()
1911 void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, in dwc2_hcd_qh_deactivate() argument
1914 u16 old_frame = qh->next_active_frame; in dwc2_hcd_qh_deactivate()
1918 if (dbg_qh(qh)) in dwc2_hcd_qh_deactivate()
1921 if (dwc2_qh_is_non_per(qh)) { in dwc2_hcd_qh_deactivate()
1922 dwc2_hcd_qh_unlink(hsotg, qh); in dwc2_hcd_qh_deactivate()
1923 if (!list_empty(&qh->qtd_list)) in dwc2_hcd_qh_deactivate()
1925 dwc2_hcd_qh_add(hsotg, qh); in dwc2_hcd_qh_deactivate()
1938 missed = dwc2_next_for_periodic_split(hsotg, qh, frame_number); in dwc2_hcd_qh_deactivate()
1940 missed = dwc2_next_periodic_start(hsotg, qh, frame_number); in dwc2_hcd_qh_deactivate()
1944 qh, sched_next_periodic_split, frame_number, old_frame, in dwc2_hcd_qh_deactivate()
1945 qh->next_active_frame, in dwc2_hcd_qh_deactivate()
1946 dwc2_frame_num_dec(qh->next_active_frame, old_frame), in dwc2_hcd_qh_deactivate()
1949 if (list_empty(&qh->qtd_list)) { in dwc2_hcd_qh_deactivate()
1950 dwc2_hcd_qh_unlink(hsotg, qh); in dwc2_hcd_qh_deactivate()
1961 if (dwc2_frame_num_le(qh->next_active_frame, hsotg->frame_number)) in dwc2_hcd_qh_deactivate()
1962 list_move_tail(&qh->qh_list_entry, in dwc2_hcd_qh_deactivate()
1965 list_move_tail(&qh->qh_list_entry, in dwc2_hcd_qh_deactivate()
2013 struct dwc2_qh *qh) in dwc2_hcd_qtd_add() argument
2017 if (unlikely(!qh)) { in dwc2_hcd_qtd_add()
2023 retval = dwc2_hcd_qh_add(hsotg, qh); in dwc2_hcd_qtd_add()
2027 qtd->qh = qh; in dwc2_hcd_qtd_add()
2028 list_add_tail(&qtd->qtd_list_entry, &qh->qtd_list); in dwc2_hcd_qtd_add()