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()
468 != udev->slot_id); in xhci_configure_endpoints()
493 static int xhci_set_configuration(struct usb_device *udev) in xhci_set_configuration() argument
505 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_set_configuration()
509 int slot_id = udev->slot_id; in xhci_set_configuration()
522 num_of_ep = udev->config.if_desc[0].no_of_ep; in xhci_set_configuration()
523 ifdesc = &udev->config.if_desc[0]; in xhci_set_configuration()
564 max_esit_payload = xhci_get_max_esit_payload(udev, endpt_desc, in xhci_set_configuration()
566 interval = xhci_get_endpoint_interval(udev, endpt_desc); in xhci_set_configuration()
567 mult = xhci_get_endpoint_mult(udev, endpt_desc, in xhci_set_configuration()
569 max_burst = xhci_get_endpoint_max_burst(udev, endpt_desc, in xhci_set_configuration()
618 return xhci_configure_endpoints(udev, false); in xhci_set_configuration()
628 static int xhci_address_device(struct usb_device *udev, int root_portnr) in xhci_address_device() argument
631 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_address_device()
635 int slot_id = udev->slot_id; in xhci_address_device()
645 xhci_setup_addressable_virt_dev(ctrl, udev, root_portnr); in xhci_address_device()
676 udev->status = 0; in xhci_address_device()
713 static int _xhci_alloc_device(struct usb_device *udev) in _xhci_alloc_device() argument
715 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in _xhci_alloc_device()
725 udev->speed = USB_SPEED_SUPER; in _xhci_alloc_device()
737 udev->slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->event_cmd.flags)); in _xhci_alloc_device()
741 ret = xhci_alloc_virt_device(ctrl, udev->slot_id); in _xhci_alloc_device()
755 int usb_alloc_device(struct usb_device *udev) in usb_alloc_device() argument
757 return _xhci_alloc_device(udev); in usb_alloc_device()
770 int xhci_check_maxpacket(struct usb_device *udev) in xhci_check_maxpacket() argument
772 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_check_maxpacket()
773 unsigned int slot_id = udev->slot_id; in xhci_check_maxpacket()
788 max_packet_size = udev->epmaxpacketin[0]; in xhci_check_maxpacket()
813 ret = xhci_configure_endpoints(udev, true); in xhci_check_maxpacket()
891 static int xhci_submit_root(struct usb_device *udev, unsigned long pipe, in xhci_submit_root() argument
900 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in xhci_submit_root()
1099 udev->act_len = len; in xhci_submit_root()
1100 udev->status = 0; in xhci_submit_root()
1105 udev->act_len = 0; in xhci_submit_root()
1106 udev->status = USB_ST_STALLED; in xhci_submit_root()
1121 static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_int_msg() argument
1136 return xhci_bulk_tx(udev, pipe, length, buffer); in _xhci_submit_int_msg()
1148 static int _xhci_submit_bulk_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_bulk_msg() argument
1156 return xhci_bulk_tx(udev, pipe, length, buffer); in _xhci_submit_bulk_msg()
1170 static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, in _xhci_submit_control_msg() argument
1174 struct xhci_ctrl *ctrl = xhci_get_ctrl(udev); in _xhci_submit_control_msg()
1183 return xhci_submit_root(udev, pipe, buffer, setup); in _xhci_submit_control_msg()
1187 return xhci_address_device(udev, root_portnr); in _xhci_submit_control_msg()
1191 ret = xhci_set_configuration(udev); in _xhci_submit_control_msg()
1198 return xhci_ctrl_tx(udev, pipe, setup, length, buffer); in _xhci_submit_control_msg()
1273 int submit_control_msg(struct usb_device *udev, unsigned long pipe, in submit_control_msg() argument
1276 struct usb_device *hop = udev; in submit_control_msg()
1282 return _xhci_submit_control_msg(udev, pipe, buffer, length, setup, in submit_control_msg()
1286 int submit_bulk_msg(struct usb_device *udev, unsigned long pipe, void *buffer, in submit_bulk_msg() argument
1289 return _xhci_submit_bulk_msg(udev, pipe, buffer, length); in submit_bulk_msg()
1292 int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer, in submit_int_msg() argument
1295 return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, in submit_int_msg()
1361 static int xhci_submit_control_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_control_msg() argument
1370 dev->name, udev, udev->dev->name, udev->portnr); in xhci_submit_control_msg()
1371 hub = udev->dev; in xhci_submit_control_msg()
1375 root_portnr = udev->portnr; in xhci_submit_control_msg()
1390 return _xhci_submit_control_msg(udev, pipe, buffer, length, setup, in xhci_submit_control_msg()
1394 static int xhci_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_bulk_msg() argument
1397 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_submit_bulk_msg()
1398 return _xhci_submit_bulk_msg(udev, pipe, buffer, length); in xhci_submit_bulk_msg()
1401 static int xhci_submit_int_msg(struct udevice *dev, struct usb_device *udev, in xhci_submit_int_msg() argument
1405 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_submit_int_msg()
1406 return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, in xhci_submit_int_msg()
1410 static int xhci_alloc_device(struct udevice *dev, struct usb_device *udev) in xhci_alloc_device() argument
1412 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_alloc_device()
1413 return _xhci_alloc_device(udev); in xhci_alloc_device()
1416 static int xhci_update_hub_device(struct udevice *dev, struct usb_device *udev) in xhci_update_hub_device() argument
1419 struct usb_hub_device *hub = dev_get_uclass_priv(udev->dev); in xhci_update_hub_device()
1425 int slot_id = udev->slot_id; in xhci_update_hub_device()
1428 debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); in xhci_update_hub_device()
1431 if (usb_hub_is_root_hub(udev->dev)) in xhci_update_hub_device()
1460 else if (udev->speed == USB_SPEED_FULL) in xhci_update_hub_device()
1462 slot_ctx->dev_info2 |= cpu_to_le32(XHCI_MAX_PORTS(udev->maxchild)); in xhci_update_hub_device()
1475 if (udev->speed == USB_SPEED_HIGH) in xhci_update_hub_device()
1479 return xhci_configure_endpoints(udev, false); in xhci_update_hub_device()