Lines Matching refs:udev
116 struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev) in xhci_get_ctrl() argument
122 for (dev = udev->dev; in xhci_get_ctrl()
128 return udev->controller; in xhci_get_ctrl()
280 static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, in xhci_parse_microframe_interval() argument
289 static unsigned int xhci_parse_frame_interval(struct usb_device *udev, in xhci_parse_frame_interval() argument
299 static unsigned int xhci_parse_exponent_interval(struct usb_device *udev, in xhci_parse_exponent_interval() argument
308 udev->speed == USB_SPEED_FULL ? "" : "micro"); in xhci_parse_exponent_interval()
310 if (udev->speed == USB_SPEED_FULL) { in xhci_parse_exponent_interval()
331 static unsigned int xhci_get_endpoint_interval(struct usb_device *udev, in xhci_get_endpoint_interval() argument
336 switch (udev->speed) { in xhci_get_endpoint_interval()
341 interval = xhci_parse_microframe_interval(udev, in xhci_get_endpoint_interval()
350 interval = xhci_parse_exponent_interval(udev, in xhci_get_endpoint_interval()
357 interval = xhci_parse_exponent_interval(udev, in xhci_get_endpoint_interval()
370 interval = xhci_parse_frame_interval(udev, endpt_desc); in xhci_get_endpoint_interval()
387 static u32 xhci_get_endpoint_mult(struct usb_device *udev, in xhci_get_endpoint_mult() argument
391 if (udev->speed < USB_SPEED_SUPER || in xhci_get_endpoint_mult()
398 static u32 xhci_get_endpoint_max_burst(struct usb_device *udev, in xhci_get_endpoint_max_burst() argument
403 if (udev->speed >= USB_SPEED_SUPER) in xhci_get_endpoint_max_burst()
406 if (udev->speed == USB_SPEED_HIGH && in xhci_get_endpoint_max_burst()
419 static u32 xhci_get_max_esit_payload(struct usb_device *udev, in xhci_get_max_esit_payload() argument
432 if (udev->speed >= USB_SPEED_SUPER) in xhci_get_max_esit_payload()
450 static int xhci_configure_endpoints(struct usb_device *udev, bool ctx_change) in xhci_configure_endpoints() argument
454 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_configure_endpoints()
457 virt_dev = ctrl->devs[udev->slot_id]; in xhci_configure_endpoints()
461 xhci_queue_command(ctrl, in_ctx->bytes, udev->slot_id, 0, in xhci_configure_endpoints()
465 != udev->slot_id); in xhci_configure_endpoints()
490 static int xhci_set_configuration(struct usb_device *udev) in xhci_set_configuration() argument
502 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_set_configuration()
506 int slot_id = udev->slot_id; in xhci_set_configuration()
519 num_of_ep = udev->config.if_desc[0].no_of_ep; in xhci_set_configuration()
520 ifdesc = &udev->config.if_desc[0]; in xhci_set_configuration()
561 max_esit_payload = xhci_get_max_esit_payload(udev, endpt_desc, in xhci_set_configuration()
563 interval = xhci_get_endpoint_interval(udev, endpt_desc); in xhci_set_configuration()
564 mult = xhci_get_endpoint_mult(udev, endpt_desc, in xhci_set_configuration()
566 max_burst = xhci_get_endpoint_max_burst(udev, endpt_desc, in xhci_set_configuration()
615 return xhci_configure_endpoints(udev, false); in xhci_set_configuration()
625 static int xhci_address_device(struct usb_device *udev, int root_portnr) in xhci_address_device() argument
628 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_address_device()
632 int slot_id = udev->slot_id; in xhci_address_device()
642 xhci_setup_addressable_virt_dev(ctrl, udev, root_portnr); in xhci_address_device()
670 udev->status = 0; in xhci_address_device()
707 static int _xhci_alloc_device(struct usb_device *udev) in _xhci_alloc_device() argument
709 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in _xhci_alloc_device()
719 udev->speed = USB_SPEED_SUPER; in _xhci_alloc_device()
728 udev->slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->event_cmd.flags)); in _xhci_alloc_device()
732 ret = xhci_alloc_virt_device(ctrl, udev->slot_id); in _xhci_alloc_device()
746 int usb_alloc_device(struct usb_device *udev) in usb_alloc_device() argument
748 return _xhci_alloc_device(udev); in usb_alloc_device()
761 int xhci_check_maxpacket(struct usb_device *udev) in xhci_check_maxpacket() argument
763 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_check_maxpacket()
764 unsigned int slot_id = udev->slot_id; in xhci_check_maxpacket()
779 max_packet_size = udev->epmaxpacketin[0]; in xhci_check_maxpacket()
804 ret = xhci_configure_endpoints(udev, true); in xhci_check_maxpacket()
882 static int xhci_submit_root(struct usb_device *udev, unsigned long pipe, in xhci_submit_root() argument
891 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_submit_root()
1090 udev->act_len = len; in xhci_submit_root()
1091 udev->status = 0; in xhci_submit_root()
1096 udev->act_len = 0; in xhci_submit_root()
1097 udev->status = USB_ST_STALLED; in xhci_submit_root()
1112 static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_int_msg() argument
1127 return xhci_bulk_tx(udev, pipe, length, buffer); in _xhci_submit_int_msg()
1139 static int _xhci_submit_bulk_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_bulk_msg() argument
1147 return xhci_bulk_tx(udev, pipe, length, buffer); in _xhci_submit_bulk_msg()
1161 static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_control_msg() argument
1165 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in _xhci_submit_control_msg()
1174 return xhci_submit_root(udev, pipe, buffer, setup); in _xhci_submit_control_msg()
1178 return xhci_address_device(udev, root_portnr); in _xhci_submit_control_msg()
1182 ret = xhci_set_configuration(udev); in _xhci_submit_control_msg()
1189 return xhci_ctrl_tx(udev, pipe, setup, length, buffer); in _xhci_submit_control_msg()
1264 int submit_control_msg(struct usb_device *udev, unsigned long pipe, in submit_control_msg() argument
1267 struct usb_device *hop = udev; in submit_control_msg()
1273 return _xhci_submit_control_msg(udev, pipe, buffer, length, setup, in submit_control_msg()
1277 int submit_bulk_msg(struct usb_device *udev, unsigned long pipe, void *buffer, in submit_bulk_msg() argument
1280 return _xhci_submit_bulk_msg(udev, pipe, buffer, length); in submit_bulk_msg()
1283 int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer, in submit_int_msg() argument
1286 return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, in submit_int_msg()
1352 static int xhci_submit_control_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_control_msg() argument
1361 dev->name, udev, udev->dev->name, udev->portnr); in xhci_submit_control_msg()
1362 hub = udev->dev; in xhci_submit_control_msg()
1366 root_portnr = udev->portnr; in xhci_submit_control_msg()
1381 return _xhci_submit_control_msg(udev, pipe, buffer, length, setup, in xhci_submit_control_msg()
1385 static int xhci_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_bulk_msg() argument
1388 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_submit_bulk_msg()
1389 return _xhci_submit_bulk_msg(udev, pipe, buffer, length); in xhci_submit_bulk_msg()
1392 static int xhci_submit_int_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_int_msg() argument
1396 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_submit_int_msg()
1397 return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, in xhci_submit_int_msg()
1401 static int xhci_alloc_device(struct udevice *dev, struct usb_device *udev) in xhci_alloc_device() argument
1403 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_alloc_device()
1404 return _xhci_alloc_device(udev); in xhci_alloc_device()
1407 static int xhci_update_hub_device(struct udevice *dev, struct usb_device *udev) in xhci_update_hub_device() argument
1410 struct usb_hub_device *hub = dev_get_uclass_priv(udev->dev); in xhci_update_hub_device()
1416 int slot_id = udev->slot_id; in xhci_update_hub_device()
1419 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_update_hub_device()
1422 if (usb_hub_is_root_hub(udev->dev)) in xhci_update_hub_device()
1451 else if (udev->speed == USB_SPEED_FULL) in xhci_update_hub_device()
1453 slot_ctx->dev_info2 |= cpu_to_le32(XHCI_MAX_PORTS(udev->maxchild)); in xhci_update_hub_device()
1466 if (udev->speed == USB_SPEED_HIGH) in xhci_update_hub_device()
1470 return xhci_configure_endpoints(udev, false); in xhci_update_hub_device()