Lines Matching refs:virt_dev
1339 struct xhci_virt_device *virt_dev; in xhci_check_args() local
1358 virt_dev = xhci->devs[udev->slot_id]; in xhci_check_args()
1359 if (virt_dev->udev != udev) { in xhci_check_args()
1824 struct xhci_virt_device *virt_dev; in xhci_add_endpoint() local
1848 virt_dev = xhci->devs[udev->slot_id]; in xhci_add_endpoint()
1849 in_ctx = virt_dev->in_ctx; in xhci_add_endpoint()
1861 if (virt_dev->eps[ep_index].ring && in xhci_add_endpoint()
1883 if (xhci_endpoint_init(xhci, virt_dev, udev, ep, GFP_NOIO) < 0) { in xhci_add_endpoint()
1892 xhci_ring_free(xhci, virt_dev->eps[ep_index].new_ring); in xhci_add_endpoint()
1893 virt_dev->eps[ep_index].new_ring = NULL; in xhci_add_endpoint()
1912 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); in xhci_add_endpoint()
1915 xhci_debugfs_create_endpoint(xhci, virt_dev, ep_index); in xhci_add_endpoint()
1925 static void xhci_zero_in_ctx(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev) in xhci_zero_in_ctx() argument
1932 ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); in xhci_zero_in_ctx()
1946 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); in xhci_zero_in_ctx()
1951 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, i); in xhci_zero_in_ctx()
2200 struct xhci_virt_device *virt_dev, in xhci_check_tt_bw_table() argument
2207 bw_table = &xhci->rh_bw[virt_dev->real_port - 1].bw_table; in xhci_check_tt_bw_table()
2208 tt_info = virt_dev->tt_info; in xhci_check_tt_bw_table()
2230 struct xhci_virt_device *virt_dev) in xhci_check_ss_bw() argument
2235 if (virt_dev->bw_table->ss_bw_in > (SS_BW_LIMIT_IN - bw_reserved)) in xhci_check_ss_bw()
2239 if (virt_dev->bw_table->ss_bw_out > (SS_BW_LIMIT_OUT - bw_reserved)) in xhci_check_ss_bw()
2287 struct xhci_virt_device *virt_dev, in xhci_check_bw_table() argument
2301 if (virt_dev->udev->speed >= USB_SPEED_SUPER) in xhci_check_bw_table()
2302 return xhci_check_ss_bw(xhci, virt_dev); in xhci_check_bw_table()
2304 if (virt_dev->udev->speed == USB_SPEED_HIGH) { in xhci_check_bw_table()
2313 bw_table = virt_dev->bw_table; in xhci_check_bw_table()
2317 block_size = xhci_get_block_size(virt_dev->udev); in xhci_check_bw_table()
2322 if (virt_dev->tt_info) { in xhci_check_bw_table()
2325 virt_dev->real_port); in xhci_check_bw_table()
2326 if (xhci_check_tt_bw_table(xhci, virt_dev, old_active_eps)) { in xhci_check_bw_table()
2333 virt_dev->tt_info->slot_id, in xhci_check_bw_table()
2334 virt_dev->tt_info->ttport); in xhci_check_bw_table()
2338 virt_dev->real_port); in xhci_check_bw_table()
2434 if (!virt_dev->tt_info && virt_dev->udev->speed == USB_SPEED_HIGH) { in xhci_check_bw_table()
2435 unsigned int port_index = virt_dev->real_port - 1; in xhci_check_bw_table()
2628 struct xhci_virt_device *virt_dev, in xhci_update_tt_active_eps() argument
2632 if (!virt_dev->tt_info) in xhci_update_tt_active_eps()
2635 rh_bw_info = &xhci->rh_bw[virt_dev->real_port - 1]; in xhci_update_tt_active_eps()
2637 virt_dev->tt_info->active_eps != 0) { in xhci_update_tt_active_eps()
2641 virt_dev->tt_info->active_eps == 0) { in xhci_update_tt_active_eps()
2648 struct xhci_virt_device *virt_dev, in xhci_reserve_bandwidth() argument
2656 if (virt_dev->tt_info) in xhci_reserve_bandwidth()
2657 old_active_eps = virt_dev->tt_info->active_eps; in xhci_reserve_bandwidth()
2671 memcpy(&ep_bw_info[i], &virt_dev->eps[i].bw_info, in xhci_reserve_bandwidth()
2678 &virt_dev->eps[i].bw_info, in xhci_reserve_bandwidth()
2679 virt_dev->bw_table, in xhci_reserve_bandwidth()
2680 virt_dev->udev, in xhci_reserve_bandwidth()
2681 &virt_dev->eps[i], in xhci_reserve_bandwidth()
2682 virt_dev->tt_info); in xhci_reserve_bandwidth()
2685 xhci_update_bw_info(xhci, virt_dev->in_ctx, ctrl_ctx, virt_dev); in xhci_reserve_bandwidth()
2690 &virt_dev->eps[i].bw_info, in xhci_reserve_bandwidth()
2691 virt_dev->bw_table, in xhci_reserve_bandwidth()
2692 virt_dev->udev, in xhci_reserve_bandwidth()
2693 &virt_dev->eps[i], in xhci_reserve_bandwidth()
2694 virt_dev->tt_info); in xhci_reserve_bandwidth()
2697 if (!xhci_check_bw_table(xhci, virt_dev, old_active_eps)) { in xhci_reserve_bandwidth()
2701 xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); in xhci_reserve_bandwidth()
2715 &virt_dev->eps[i].bw_info, in xhci_reserve_bandwidth()
2716 virt_dev->bw_table, in xhci_reserve_bandwidth()
2717 virt_dev->udev, in xhci_reserve_bandwidth()
2718 &virt_dev->eps[i], in xhci_reserve_bandwidth()
2719 virt_dev->tt_info); in xhci_reserve_bandwidth()
2722 memcpy(&virt_dev->eps[i].bw_info, &ep_bw_info[i], in xhci_reserve_bandwidth()
2727 &virt_dev->eps[i].bw_info, in xhci_reserve_bandwidth()
2728 virt_dev->bw_table, in xhci_reserve_bandwidth()
2729 virt_dev->udev, in xhci_reserve_bandwidth()
2730 &virt_dev->eps[i], in xhci_reserve_bandwidth()
2731 virt_dev->tt_info); in xhci_reserve_bandwidth()
2748 struct xhci_virt_device *virt_dev; in xhci_configure_endpoint() local
2761 virt_dev = xhci->devs[udev->slot_id]; in xhci_configure_endpoint()
2780 xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) { in xhci_configure_endpoint()
2865 struct xhci_virt_device *virt_dev; in xhci_check_bandwidth() local
2879 virt_dev = xhci->devs[udev->slot_id]; in xhci_check_bandwidth()
2885 command->in_ctx = virt_dev->in_ctx; in xhci_check_bandwidth()
2906 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); in xhci_check_bandwidth()
2910 if ((virt_dev->eps[i-1].ring && !(ctrl_ctx->drop_flags & le32)) in xhci_check_bandwidth()
2928 xhci_free_endpoint_ring(xhci, virt_dev, i); in xhci_check_bandwidth()
2929 xhci_check_bw_drop_ep_streams(xhci, virt_dev, i); in xhci_check_bandwidth()
2932 xhci_zero_in_ctx(xhci, virt_dev); in xhci_check_bandwidth()
2938 if (!virt_dev->eps[i].new_ring) in xhci_check_bandwidth()
2943 if (virt_dev->eps[i].ring) { in xhci_check_bandwidth()
2944 xhci_free_endpoint_ring(xhci, virt_dev, i); in xhci_check_bandwidth()
2946 xhci_check_bw_drop_ep_streams(xhci, virt_dev, i); in xhci_check_bandwidth()
2947 virt_dev->eps[i].ring = virt_dev->eps[i].new_ring; in xhci_check_bandwidth()
2948 virt_dev->eps[i].new_ring = NULL; in xhci_check_bandwidth()
2960 struct xhci_virt_device *virt_dev; in xhci_reset_bandwidth() local
2969 virt_dev = xhci->devs[udev->slot_id]; in xhci_reset_bandwidth()
2972 if (virt_dev->eps[i].new_ring) { in xhci_reset_bandwidth()
2973 xhci_debugfs_remove_endpoint(xhci, virt_dev, i); in xhci_reset_bandwidth()
2974 xhci_ring_free(xhci, virt_dev->eps[i].new_ring); in xhci_reset_bandwidth()
2975 virt_dev->eps[i].new_ring = NULL; in xhci_reset_bandwidth()
2978 xhci_zero_in_ctx(xhci, virt_dev); in xhci_reset_bandwidth()
3653 struct xhci_virt_device *virt_dev, bool drop_control_ep) in xhci_free_device_endpoint_resources() argument
3660 if (virt_dev->eps[i].ring) { in xhci_free_device_endpoint_resources()
3699 struct xhci_virt_device *virt_dev; in xhci_discover_or_reset_device() local
3709 virt_dev = xhci->devs[slot_id]; in xhci_discover_or_reset_device()
3710 if (!virt_dev) { in xhci_discover_or_reset_device()
3720 if (virt_dev->tt_info) in xhci_discover_or_reset_device()
3721 old_active_eps = virt_dev->tt_info->active_eps; in xhci_discover_or_reset_device()
3723 if (virt_dev->udev != udev) { in xhci_discover_or_reset_device()
3739 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); in xhci_discover_or_reset_device()
3789 xhci_get_slot_state(xhci, virt_dev->out_ctx)); in xhci_discover_or_reset_device()
3810 xhci_free_device_endpoint_resources(xhci, virt_dev, false); in xhci_discover_or_reset_device()
3816 struct xhci_virt_ep *ep = &virt_dev->eps[i]; in xhci_discover_or_reset_device()
3827 xhci_debugfs_remove_endpoint(xhci, virt_dev, i); in xhci_discover_or_reset_device()
3828 xhci_free_endpoint_ring(xhci, virt_dev, i); in xhci_discover_or_reset_device()
3830 if (!list_empty(&virt_dev->eps[i].bw_endpoint_list)) in xhci_discover_or_reset_device()
3832 &virt_dev->eps[i].bw_info, in xhci_discover_or_reset_device()
3833 virt_dev->bw_table, in xhci_discover_or_reset_device()
3835 &virt_dev->eps[i], in xhci_discover_or_reset_device()
3836 virt_dev->tt_info); in xhci_discover_or_reset_device()
3837 xhci_clear_endpoint_bw_info(&virt_dev->eps[i].bw_info); in xhci_discover_or_reset_device()
3840 xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); in xhci_discover_or_reset_device()
3841 virt_dev->flags = 0; in xhci_discover_or_reset_device()
3857 struct xhci_virt_device *virt_dev; in xhci_free_dev() local
3878 virt_dev = xhci->devs[udev->slot_id]; in xhci_free_dev()
3879 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); in xhci_free_dev()
3884 virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; in xhci_free_dev()
3885 del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); in xhci_free_dev()
3887 virt_dev->udev = NULL; in xhci_free_dev()
4051 struct xhci_virt_device *virt_dev; in xhci_setup_device() local
4073 virt_dev = xhci->devs[udev->slot_id]; in xhci_setup_device()
4075 if (WARN_ON(!virt_dev)) { in xhci_setup_device()
4086 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); in xhci_setup_device()
4103 command->in_ctx = virt_dev->in_ctx; in xhci_setup_device()
4105 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); in xhci_setup_device()
4106 ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); in xhci_setup_device()
4126 trace_xhci_address_ctx(xhci, virt_dev->in_ctx, in xhci_setup_device()
4131 trace_xhci_setup_device(virt_dev); in xhci_setup_device()
4132 ret = xhci_queue_address_device(xhci, command, virt_dev->in_ctx->dma, in xhci_setup_device()
4185 trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1); in xhci_setup_device()
4202 (unsigned long long)virt_dev->out_ctx->dma); in xhci_setup_device()
4203 trace_xhci_address_ctx(xhci, virt_dev->in_ctx, in xhci_setup_device()
4209 trace_xhci_address_ctx(xhci, virt_dev->out_ctx, in xhci_setup_device()
4214 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); in xhci_setup_device()
4260 struct xhci_virt_device *virt_dev; in xhci_change_max_exit_latency() local
4269 virt_dev = xhci->devs[udev->slot_id]; in xhci_change_max_exit_latency()
4277 if (!virt_dev || max_exit_latency == virt_dev->current_mel) { in xhci_change_max_exit_latency()
4292 xhci_slot_copy(xhci, command->in_ctx, virt_dev->out_ctx); in xhci_change_max_exit_latency()
4310 virt_dev->current_mel = max_exit_latency; in xhci_change_max_exit_latency()