Lines Matching refs:port_id

45 static void xhci_initialize_ep(const int id, const uint64_t slot_vaddr, const int port_id, const in…
49 …xhci_control_in(const int id, struct usb_request_packet_t *packet, void *target, const int port_id,
59 static inline int xhci_get_desc(const int id, const int port_id, void *target, const uint16_t desc_…
61 static int xhci_get_config_desc(const int id, const int port_id, struct usb_config_desc *conf_desc);
62 static inline int xhci_get_config_desc_full(const int id, const int port_id, const struct usb_confi…
67 static int xhci_get_descriptor(const int id, const int port_id, struct usb_device_desc *dev_desc);
68 static int xhci_configure_port(const int id, const int port_id);
69 static int xhci_configure_endpoint(const int id, const int port_id, const uint8_t ep_num, const uin…
71 static int xhci_get_hid_report(int id, int port_id, int interface_number, void *ret_hid_report,
73 static int xhci_get_hid_descriptor(int id, int port_id, const void *full_conf, int interface_number,
223 static __always_inline uint64_t xhci_get_device_context_vaddr(const int id, const int port_id) in xhci_get_device_context_vaddr() argument
226 … __read8b(xhci_hc[id].dcbaap_vaddr + (xhci_hc[id].ports[port_id].slot_id * sizeof(uint64_t)))); in xhci_get_device_context_vaddr()
931 static void xhci_initialize_ep(const int id, const uint64_t slot_vaddr, const int port_id, const in… in xhci_initialize_ep() argument
941 xhci_hc[id].ports[port_id].ep_info[ep_num].ep_ring_vbase = xhci_create_ring(XHCI_TRBS_PER_RING); in xhci_initialize_ep()
943 ep_ctx.tr_dequeue_ptr = virt_2_phys(xhci_hc[id].ports[port_id].ep_info[ep_num].ep_ring_vbase); in xhci_initialize_ep()
946 xhci_hc[id].ports[port_id].ep_info[ep_num].current_ep_ring_vaddr = in xhci_initialize_ep()
947 xhci_hc[id].ports[port_id].ep_info[ep_num].ep_ring_vbase; in xhci_initialize_ep()
948 …xhci_hc[id].ports[port_id].ep_info[ep_num].current_ep_ring_cycle = xhci_ep_get_dequeue_cycle_state… in xhci_initialize_ep()
1237 …xhci_control_in(const int id, struct usb_request_packet_t *packet, void *target, const int port_id, in xhci_control_in() argument
1247 xhci_setup_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], packet, XHCI_DIR_IN); in xhci_control_in()
1251 …xhci_data_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], data_buf_vaddr, TRB_TYPE_DAT… in xhci_control_in()
1269 __xhci_write_doorbell(id, xhci_hc[id].ports[port_id].slot_id, XHCI_EP_CONTROL); in xhci_control_in()
1275 …xhci_status_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], XHCI_DIR_OUT_BIT, status_b… in xhci_control_in()
1277 __xhci_write_doorbell(id, xhci_hc[id].ports[port_id].slot_id, XHCI_EP_CONTROL); in xhci_control_in()
1311 …hci_control_out(const int id, struct usb_request_packet_t *packet, void *target, const int port_id, in xhci_control_out() argument
1319 xhci_setup_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], packet, XHCI_DIR_OUT); in xhci_control_out()
1324 …xhci_data_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], data_buf_vaddr, TRB_TYPE_DAT… in xhci_control_out()
1330 __xhci_write_doorbell(id, xhci_hc[id].ports[port_id].slot_id, XHCI_EP_CONTROL); in xhci_control_out()
1337 …xhci_status_stage(&xhci_hc[id].ports[port_id].ep_info[XHCI_EP_CONTROL], XHCI_DIR_IN_BIT, status_bu… in xhci_control_out()
1339 __xhci_write_doorbell(id, xhci_hc[id].ports[port_id].slot_id, XHCI_EP_CONTROL); in xhci_control_out()
1376 static inline int xhci_get_desc(const int id, const int port_id, void *target, const uint16_t desc_… in xhci_get_desc() argument
1379 struct usb_device_desc *dev_desc = xhci_hc[id].ports[port_id].dev_desc; in xhci_get_desc()
1393 count = xhci_control_in(id, &ctrl_in_packet, target, port_id, dev_desc->max_packet_size); in xhci_get_desc()
1399 static inline int xhci_set_configuration(const int id, const int port_id, const uint8_t conf_value) in xhci_set_configuration() argument
1401 struct usb_device_desc *dev_desc = xhci_hc[id].ports[port_id].dev_desc; in xhci_set_configuration()
1410 count = xhci_control_out(id, &ctrl_out_packet, NULL, port_id, dev_desc->max_packet_size); in xhci_set_configuration()
1423 static int xhci_get_config_desc(const int id, const int port_id, struct usb_config_desc *conf_desc) in xhci_get_config_desc() argument
1428 kdebug("to get conf for port %d", port_id); in xhci_get_config_desc()
1429 int retval = xhci_get_desc(id, port_id, conf_desc, USB_DT_CONFIG, 0, 0, 9); in xhci_get_config_desc()
1432 …g("port %d got conf ok. type=%d, len=%d, total_len=%d, num_interfaces=%d, max_power=%dmA", port_id, in xhci_get_config_desc()
1434 (xhci_get_port_speed(id, port_id) == XHCI_PORT_SPEED_SUPER) ? (conf_desc->max_power * 8) in xhci_get_config_desc()
1448 static inline int xhci_get_config_desc_full(const int id, const int port_id, const struct usb_confi… in xhci_get_config_desc_full() argument
1454 return xhci_get_desc(id, port_id, target, USB_DT_CONFIG, 0, 0, conf_desc->total_len); in xhci_get_config_desc_full()
1525 static int xhci_get_descriptor(const int id, const int port_id, struct usb_device_desc *dev_desc) in xhci_get_descriptor() argument
1532 uint32_t speed = xhci_get_port_speed(id, port_id); in xhci_get_descriptor()
1544 kerror("portid:%d: send enable slot failed", port_id); in xhci_get_descriptor()
1571 xhci_hc[id].ports[port_id].slot_id = slot_id; in xhci_get_descriptor()
1574 uint64_t slot_vaddr = xhci_initialize_slot(id, port_id, speed, max_packet); in xhci_get_descriptor()
1586 count = xhci_control_in(id, &ctrl_in_packet, dev_desc, port_id, max_packet); in xhci_get_descriptor()
1595 xhci_hc[id].ports[port_id].dev_desc = dev_desc; in xhci_get_descriptor()
1614port_id, dev_desc->len, dev_desc->type, dev_desc->usb_version >> 8, dev_desc->usb_version & 0xFF, in xhci_get_descriptor()
1695 static int xhci_hid_set_idle(const int id, const int port_id, struct usb_interface_desc *if_desc) in xhci_hid_set_idle() argument
1697 struct usb_device_desc *dev_desc = xhci_hc[id].ports[port_id].dev_desc; in xhci_hid_set_idle()
1705 xhci_control_out(id, &ctrl_out_packet, NULL, port_id, dev_desc->max_packet_size); in xhci_hid_set_idle()
1720 static int xhci_configure_endpoint(const int id, const int port_id, const uint8_t ep_num, const uin… in xhci_configure_endpoint() argument
1725 uint64_t slot_context_vaddr = xhci_get_device_context_vaddr(id, port_id); in xhci_configure_endpoint()
1727 …xhci_initialize_ep(id, slot_context_vaddr, port_id, ep_num, xhci_hc[id].ports[port_id].dev_desc->m… in xhci_configure_endpoint()
1729 xhci_get_port_speed(id, port_id), ep_desc->interval); in xhci_configure_endpoint()
1759 trb.Reserved |= (((uint16_t)xhci_hc[id].ports[port_id].slot_id) << 8) & 0xffff; in xhci_configure_endpoint()
1768 kerror("port_id:%d, configure endpoint %d failed", port_id, ep_num); in xhci_configure_endpoint()
1776 ksuccess("port_id:%d, ep:%d successfully configured.", port_id, ep_num); in xhci_configure_endpoint()
1795 static int xhci_configure_port(const int id, const int port_id) in xhci_configure_port() argument
1806 retval = xhci_get_config_desc(id, port_id, &conf_desc); in xhci_configure_port()
1814 retval = xhci_get_config_desc_full(id, port_id, &conf_desc, full_conf); in xhci_configure_port()
1832 retval = xhci_set_configuration(id, port_id, ((struct usb_config_desc *)full_conf)->value); in xhci_configure_port()
1838 … retval = xhci_configure_endpoint(id, port_id, ep_desc->endpoint_addr, USB_EP_INTERRUPT, ep_desc); in xhci_configure_port()
1842 retval = xhci_hid_set_idle(id, port_id, if_desc); in xhci_configure_port()
1849 … retval = xhci_get_hid_descriptor(id, port_id, full_conf, if_desc->interface_number, &hid_desc); in xhci_configure_port()
1858 …xhci_get_hid_report(id, port_id, if_desc->interface_number, hid_report_data, hid_desc->report_desc… in xhci_configure_port()
2027 static int xhci_get_hid_descriptor(int id, int port_id, const void *full_conf, int interface_number, in xhci_get_hid_descriptor() argument
2048 … kdebug("Found hid descriptor for port:%d, if:%d, report_desc_len=%d", port_id, interface_number, in xhci_get_hid_descriptor()
2066 static int xhci_get_hid_report(int id, int port_id, int interface_number, void *ret_hid_report, uin… in xhci_get_hid_report() argument
2068 …int retval = xhci_get_desc(id, port_id, ret_hid_report, USB_DT_HID_REPORT, 0, interface_number, hi… in xhci_get_hid_report()
2070 …kerror("xhci_get_hid_report failed: host_controller:%d, port:%d, interface %d", id, port_id, inter… in xhci_get_hid_report()