Lines Matching defs:ohcip

43 				ohci_state_t		*ohcip,
47 static void ohci_handle_port_power(ohci_state_t *ohcip,
50 static void ohci_handle_port_enable(ohci_state_t *ohcip,
54 ohci_state_t *ohcip,
56 static void ohci_handle_port_suspend(ohci_state_t *ohcip,
60 ohci_state_t *ohcip,
62 static void ohci_handle_port_reset(ohci_state_t *ohcip,
65 ohci_state_t *ohcip,
68 ohci_state_t *ohcip,
71 ohci_state_t *ohcip,
74 ohci_state_t *ohcip,
77 ohci_state_t *ohcip,
81 ohci_state_t *ohcip);
83 ohci_state_t *ohcip);
85 ohci_state_t *ohcip);
87 ohci_state_t *ohcip);
89 ohci_state_t *ohcip,
92 ohci_state_t *ohcip,
105 ohci_init_root_hub(ohci_state_t *ohcip)
108 &ohcip->ohci_root_hub.rh_descr;
112 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
116 des_A = ohcip->ohci_root_hub.rh_des_A = Get_OpReg(hcr_rh_descriptorA);
117 des_B = ohcip->ohci_root_hub.rh_des_B = Get_OpReg(hcr_rh_descriptorB);
119 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
120 "root hub descriptor A 0x%x", ohcip->ohci_root_hub.rh_des_A);
122 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
123 "root hub descriptor B 0x%x", ohcip->ohci_root_hub.rh_des_B);
126 ohcip->ohci_root_hub.rh_status = Get_OpReg(hcr_rh_status);
135 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
189 ohcip->ohci_log_hdl, "OCPM =%d, PSM=%d",
204 USB_DPRINTF_L3(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
219 ohcip->ohci_root_hub.rh_port_state[i] = port_state;
232 ohcip->ohci_root_hub.rh_port_status[i] = 0;
293 ohci_load_root_hub_driver(ohci_state_t *ohcip)
295 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
298 return (usba_hubdi_bind_root_hub(ohcip->ohci_dip,
309 ohci_unload_root_hub_driver(ohci_state_t *ohcip)
311 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
314 return (usba_hubdi_unbind_root_hub(ohcip->ohci_dip));
329 ohci_state_t *ohcip = ohci_obtain_state(
333 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
336 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
341 ohcip->ohci_root_hub.rh_ctrl_pipe_handle = ph;
344 ohcip->ohci_root_hub.rh_ctrl_pipe_state = OHCI_PIPE_STATE_IDLE;
346 ohcip->ohci_root_hub.rh_curr_ctrl_reqp = NULL;
348 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
355 ohcip->ohci_root_hub.rh_intr_pipe_handle = ph;
358 ohcip->ohci_root_hub.rh_intr_pipe_state = OHCI_PIPE_STATE_IDLE;
360 ohcip->ohci_root_hub.rh_client_intr_reqp = NULL;
362 ohcip->ohci_root_hub.rh_curr_intr_reqp = NULL;
364 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
370 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
377 ohcip->ohci_open_pipe_count++;
392 ohci_state_t *ohcip = ohci_obtain_state(
396 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
399 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
403 ASSERT(ohcip->ohci_root_hub.
407 ohcip->ohci_root_hub.rh_ctrl_pipe_state = OHCI_PIPE_STATE_CLOSE;
410 ohcip->ohci_root_hub.rh_ctrl_pipe_handle = NULL;
412 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
419 ASSERT(ohcip->ohci_root_hub.
423 ohcip->ohci_root_hub.rh_intr_pipe_state = OHCI_PIPE_STATE_CLOSE;
426 ohci_root_hub_intr_pipe_cleanup(ohcip, USB_CR_PIPE_CLOSING);
429 ohcip->ohci_root_hub.rh_intr_pipe_handle = NULL;
431 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
437 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
444 ohcip->ohci_open_pipe_count--;
461 ohci_state_t *ohcip = ohci_obtain_state(
466 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
469 mutex_enter(&ohcip->ohci_int_mutex);
473 ohcip->ohci_root_hub.rh_ctrl_pipe_state = OHCI_PIPE_STATE_IDLE;
475 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
483 if ((ohcip->ohci_root_hub.rh_client_intr_reqp) &&
484 (ohcip->ohci_root_hub.rh_intr_pipe_state !=
487 ohcip->ohci_root_hub.
492 ohcip, USB_CR_PIPE_RESET);
495 ASSERT(ohcip->ohci_root_hub.
498 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
504 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
512 mutex_exit(&ohcip->ohci_int_mutex);
527 ohci_state_t *ohcip,
541 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
545 mutex_enter(&ohcip->ohci_int_mutex);
547 if (ohcip->ohci_root_hub.rh_ctrl_pipe_state != OHCI_PIPE_STATE_IDLE) {
549 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
552 mutex_exit(&ohcip->ohci_int_mutex);
558 ohcip->ohci_root_hub.rh_curr_ctrl_reqp = ctrl_reqp;
561 ohcip->ohci_root_hub.rh_ctrl_pipe_state = OHCI_PIPE_STATE_ACTIVE;
563 mutex_exit(&ohcip->ohci_int_mutex);
567 ohci_handle_get_device_status(ohcip);
570 error = ohci_handle_set_clear_port_feature(ohcip,
574 ohci_handle_get_port_status(ohcip, port);
579 ohci_handle_get_hub_status(ohcip);
582 ohci_handle_get_hub_descriptor(ohcip);
585 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
594 error = ohci_handle_set_clear_hub_feature(ohcip,
598 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
608 mutex_enter(&ohcip->ohci_int_mutex);
610 mutex_exit(&ohcip->ohci_int_mutex);
612 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
624 ohci_state_t *ohcip,
631 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
639 ohci_handle_port_enable(ohcip, port, 1);
642 ohci_handle_port_suspend(ohcip, port, 1);
645 ohci_handle_port_reset(ohcip, port);
648 ohci_handle_port_power(ohcip, port, 1);
651 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
662 ohci_handle_port_enable(ohcip, port, 0);
665 ohci_handle_clrchng_port_enable(ohcip, port);
668 ohci_handle_port_suspend(ohcip, port, 0);
671 ohci_handle_clrchng_port_suspend(ohcip, port);
674 ohci_handle_complete_port_reset(ohcip, port);
677 ohci_handle_port_power(ohcip, port, 0);
680 ohci_handle_clear_port_connection(ohcip, port);
683 ohci_handle_clrchng_port_over_current(ohcip, port);
686 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
695 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
714 ohci_state_t *ohcip,
723 mutex_enter(&ohcip->ohci_int_mutex);
726 rh = &ohcip->ohci_root_hub;
727 hub_descr = &ohcip->ohci_root_hub.rh_descr;
729 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
787 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
792 mutex_exit(&ohcip->ohci_int_mutex);
803 ohci_state_t *ohcip,
809 mutex_enter(&ohcip->ohci_int_mutex);
813 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
831 mutex_exit(&ohcip->ohci_int_mutex);
842 ohci_state_t *ohcip,
847 mutex_enter(&ohcip->ohci_int_mutex);
851 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
858 mutex_exit(&ohcip->ohci_int_mutex);
869 ohci_state_t *ohcip,
875 mutex_enter(&ohcip->ohci_int_mutex);
879 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
891 mutex_exit(&ohcip->ohci_int_mutex);
902 ohci_state_t *ohcip,
907 mutex_enter(&ohcip->ohci_int_mutex);
911 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
917 mutex_exit(&ohcip->ohci_int_mutex);
928 ohci_state_t *ohcip,
933 mutex_enter(&ohcip->ohci_int_mutex);
937 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
942 USB_DPRINTF_L3(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
949 mutex_exit(&ohcip->ohci_int_mutex);
960 ohci_state_t *ohcip,
965 mutex_enter(&ohcip->ohci_int_mutex);
969 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
974 USB_DPRINTF_L3(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
981 mutex_exit(&ohcip->ohci_int_mutex);
992 ohci_state_t *ohcip,
997 mutex_enter(&ohcip->ohci_int_mutex);
1001 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1008 mutex_exit(&ohcip->ohci_int_mutex);
1019 ohci_state_t *ohcip,
1024 mutex_enter(&ohcip->ohci_int_mutex);
1028 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1034 mutex_exit(&ohcip->ohci_int_mutex);
1045 ohci_state_t *ohcip,
1053 mutex_enter(&ohcip->ohci_int_mutex);
1055 ctrl_reqp = ohcip->ohci_root_hub.rh_curr_ctrl_reqp;
1059 ohcip->ohci_root_hub.rh_port_status[port] = new_port_status;
1063 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1079 mutex_exit(&ohcip->ohci_int_mutex);
1092 ohci_state_t *ohcip,
1098 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1105 ohci_handle_clrchng_hub_over_current(ohcip);
1107 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1117 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1136 ohci_state_t *ohcip)
1140 mutex_enter(&ohcip->ohci_int_mutex);
1144 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1150 mutex_exit(&ohcip->ohci_int_mutex);
1159 ohci_state_t *ohcip)
1167 mutex_enter(&ohcip->ohci_int_mutex);
1169 ctrl_reqp = ohcip->ohci_root_hub.rh_curr_ctrl_reqp;
1170 root_hub_descr = &ohcip->ohci_root_hub.rh_descr;
1173 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1199 mutex_exit(&ohcip->ohci_int_mutex);
1210 ohci_state_t *ohcip)
1216 mutex_enter(&ohcip->ohci_int_mutex);
1218 ctrl_reqp = ohcip->ohci_root_hub.rh_curr_ctrl_reqp;
1221 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1237 mutex_exit(&ohcip->ohci_int_mutex);
1248 ohci_state_t *ohcip)
1254 mutex_enter(&ohcip->ohci_int_mutex);
1256 ctrl_reqp = ohcip->ohci_root_hub.rh_curr_ctrl_reqp;
1264 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1278 mutex_exit(&ohcip->ohci_int_mutex);
1294 ohci_state_t *ohcip = ohci_obtain_state(
1300 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1304 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
1312 pipe_state = ohcip->ohci_root_hub.rh_intr_pipe_state;
1316 ASSERT(ohcip->ohci_root_hub.rh_intr_pipe_timer_id == 0);
1322 ASSERT(ohcip->ohci_root_hub.rh_client_intr_reqp == NULL);
1324 ohcip->ohci_root_hub.rh_client_intr_reqp = client_intr_reqp;
1326 error = ohci_root_hub_allocate_intr_pipe_resource(ohcip, flags);
1330 ohcip->ohci_root_hub.rh_client_intr_reqp = NULL;
1332 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1339 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1345 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1351 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1375 ohci_state_t *ohcip = ohci_obtain_state(
1379 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
1381 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1387 if (ohcip->ohci_root_hub.rh_intr_pipe_state == OHCI_PIPE_STATE_ACTIVE) {
1389 ohcip->ohci_root_hub.rh_intr_pipe_state =
1393 ohci_root_hub_intr_pipe_cleanup(ohcip, USB_CR_STOPPED_POLLING);
1395 ASSERT(ohcip->ohci_root_hub.
1398 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1402 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1416 ohci_state_t *ohcip,
1423 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1426 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
1429 ph = ohcip->ohci_root_hub.rh_intr_pipe_handle;
1432 curr_intr_reqp = ohcip->ohci_root_hub.rh_curr_intr_reqp;
1439 ASSERT(ohcip->ohci_root_hub.rh_client_intr_reqp);
1442 length = ohcip->ohci_root_hub.
1446 ohcip->ohci_root_hub.rh_client_intr_reqp,
1451 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1458 ohcip->ohci_root_hub.rh_curr_intr_reqp = curr_intr_reqp;
1466 if (ohcip->ohci_root_hub.rh_intr_pipe_timer_id == 0) {
1467 ohcip->ohci_root_hub.rh_intr_pipe_timer_id =
1469 (void *)ohcip, drv_usectohz(OHCI_RH_POLL_TIME));
1471 ohcip->ohci_root_hub.
1487 ohci_state_t *ohcip,
1495 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1498 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
1501 ph = ohcip->ohci_root_hub.rh_intr_pipe_handle;
1504 timer_id = ohcip->ohci_root_hub.rh_intr_pipe_timer_id;
1509 ohcip->ohci_root_hub.rh_intr_pipe_timer_id = 0;
1511 mutex_exit(&ohcip->ohci_int_mutex);
1513 mutex_enter(&ohcip->ohci_int_mutex);
1517 curr_intr_reqp = ohcip->ohci_root_hub.rh_curr_intr_reqp;
1521 ohcip->ohci_root_hub.rh_curr_intr_reqp = NULL;
1530 ohcip->ohci_root_hub.rh_client_intr_reqp;
1548 ohci_state_t *ohcip = (ohci_state_t *)arg;
1561 mutex_enter(&ohcip->ohci_int_mutex);
1563 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1565 ohcip->ohci_root_hub.rh_intr_pipe_state);
1568 hub_descr = &ohcip->ohci_root_hub.rh_descr;
1571 curr_intr_reqp = ohcip->ohci_root_hub.rh_curr_intr_reqp;
1573 ph = ohcip->ohci_root_hub.rh_intr_pipe_handle;
1576 if (ohcip->ohci_root_hub.rh_intr_pipe_timer_id) {
1578 if ((ohci_state_is_operational(ohcip)) != USB_SUCCESS) {
1581 ohcip->ohci_root_hub.rh_intr_pipe_timer_id = 0;
1585 ohcip, USB_CR_HC_HARDWARE_ERR);
1587 mutex_exit(&ohcip->ohci_int_mutex);
1592 mutex_exit(&ohcip->ohci_int_mutex);
1597 eptd = &ohcip->ohci_root_hub.rh_intr_pipe_handle->p_ep;
1604 USB_DPRINTF_L3(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1611 ohcip->ohci_root_hub.rh_status = new_root_hub_status;
1634 ohcip->ohci_root_hub.
1638 ohcip->ohci_log_hdl,
1641 ohcip->ohci_root_hub.
1645 ohcip->ohci_log_hdl,
1657 ohcip->ohci_root_hub.
1661 ohcip->ohci_log_hdl,
1664 ohcip->ohci_root_hub.
1668 ohcip->ohci_log_hdl,
1676 ohcip->ohci_root_hub.
1700 ohcip->ohci_log_hdl,
1715 ohcip->ohci_root_hub.rh_intr_pipe_timer_id = 0;
1717 if (ohcip->ohci_root_hub.rh_intr_pipe_state == OHCI_PIPE_STATE_ACTIVE) {
1723 ohcip, 0)) != USB_SUCCESS) {
1725 USB_DPRINTF_L2(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1730 ohcip, USB_CR_NO_RESOURCES);
1734 mutex_exit(&ohcip->ohci_int_mutex);
1748 ohci_state_t *ohcip = ohci_obtain_state(
1755 USB_DPRINTF_L4(PRINT_MASK_ROOT_HUB, ohcip->ohci_log_hdl,
1759 ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
1769 pipe_state = ohcip->ohci_root_hub.rh_intr_pipe_state;
1792 ohcip->ohci_root_hub.rh_curr_ctrl_reqp;
1794 ohcip->ohci_root_hub.rh_curr_ctrl_reqp = NULL;
1795 ohcip->ohci_root_hub.rh_ctrl_pipe_state = pipe_state;
1799 if (ohcip->ohci_root_hub.rh_curr_intr_reqp) {
1801 ohcip->ohci_root_hub.rh_curr_intr_reqp;
1803 ohcip->ohci_root_hub.rh_curr_intr_reqp = NULL;
1807 ohcip->ohci_root_hub.rh_client_intr_reqp;
1809 ohcip->ohci_root_hub.rh_client_intr_reqp = NULL;
1812 ohcip->ohci_root_hub.rh_intr_pipe_state = pipe_state;
1818 mutex_exit(&ohcip->ohci_int_mutex);
1820 mutex_enter(&ohcip->ohci_int_mutex);