Lines Matching refs:p_hub_driver_obj

190 static hub_driver_t *p_hub_driver_obj = NULL;  variable
263 if (hcd_port_get_speed(p_hub_driver_obj->constant.root_port_hdl, &speed) != ESP_OK) { in enum_stage_start()
271 …if (usbh_hub_add_dev(p_hub_driver_obj->constant.root_port_hdl, speed, &enum_dev_hdl, &enum_dflt_pi… in enum_stage_start()
284 if (hcd_port_command(p_hub_driver_obj->constant.root_port_hdl, HCD_PORT_CMD_RESET) != ESP_OK) { in enum_stage_second_reset()
584 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_ACTIVE; in enum_stage_cleanup()
586 p_hub_driver_obj->single_thread.root_dev_hdl = enum_ctrl->dev_hdl; in enum_stage_cleanup()
611 if (p_hub_driver_obj->dynamic.driver_state == HUB_DRIVER_STATE_ROOT_RECOVERY) { in enum_stage_cleanup_failed()
612 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_PORT_RECOVER; in enum_stage_cleanup_failed()
615 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_ENUM_FAILED; in enum_stage_cleanup_failed()
691 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_ENUM_EVENT; in enum_set_next_stage()
703 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_ROOT_EVENT; in root_port_callback()
706 …return p_hub_driver_obj->constant.notif_cb(USB_NOTIF_SOURCE_HUB, in_isr, p_hub_driver_obj->constan… in root_port_callback()
713 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_ENUM_EVENT; in enum_dflt_pipe_callback()
715 …return p_hub_driver_obj->constant.notif_cb(USB_NOTIF_SOURCE_HUB, in_isr, p_hub_driver_obj->constan… in enum_dflt_pipe_callback()
721 assert(port_hdl == p_hub_driver_obj->constant.root_port_hdl); in usbh_hub_req_callback()
726 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_PORT_DISABLE; in usbh_hub_req_callback()
729 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_PORT_RECOVER; in usbh_hub_req_callback()
738p_hub_driver_obj->constant.notif_cb(USB_NOTIF_SOURCE_HUB, false, p_hub_driver_obj->constant.notif_… in usbh_hub_req_callback()
755 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_ENUM_EVENT; in root_port_handle_events()
756 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_ENUM; in root_port_handle_events()
758 p_hub_driver_obj->single_thread.enum_ctrl.stage = ENUM_STAGE_START; in root_port_handle_events()
769 switch (p_hub_driver_obj->dynamic.driver_state) { in root_port_handle_events()
773 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_PORT_RECOVER; in root_port_handle_events()
777 p_hub_driver_obj->dynamic.flags.actions |= HUB_DRIVER_FLAG_ACTION_ENUM_EVENT; in root_port_handle_events()
778 p_hub_driver_obj->single_thread.enum_ctrl.stage = ENUM_STAGE_CLEANUP_FAILED; in root_port_handle_events()
788 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_RECOVERY; in root_port_handle_events()
791 assert(p_hub_driver_obj->single_thread.root_dev_hdl); in root_port_handle_events()
792 …ESP_ERROR_CHECK(usbh_hub_pass_event(p_hub_driver_obj->single_thread.root_dev_hdl, USBH_HUB_EVENT_P… in root_port_handle_events()
805 enum_ctrl_t *enum_ctrl = &p_hub_driver_obj->single_thread.enum_ctrl; in enum_handle_events()
873 HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj == NULL, ESP_ERR_INVALID_STATE); in hub_install()
902 if (p_hub_driver_obj != NULL) { in hub_install()
907 p_hub_driver_obj = hub_driver_obj; in hub_install()
925 HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE); in hub_uninstall()
926 …HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj->dynamic.driver_state == HUB_DRIVER_STATE_INSTALLED, E… in hub_uninstall()
927 hub_driver_t *hub_driver_obj = p_hub_driver_obj; in hub_uninstall()
928 p_hub_driver_obj = NULL; in hub_uninstall()
941 HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE); in hub_root_start()
942 …HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj->dynamic.driver_state == HUB_DRIVER_STATE_INSTALLED, E… in hub_root_start()
946 ret = hcd_port_command(p_hub_driver_obj->constant.root_port_hdl, HCD_PORT_CMD_POWER_ON); in hub_root_start()
949 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_POWERED; in hub_root_start()
958 HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE); in hub_root_stop()
959 …HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj->dynamic.driver_state != HUB_DRIVER_STATE_INSTALLED, E… in hub_root_stop()
962 ret = hcd_port_command(p_hub_driver_obj->constant.root_port_hdl, HCD_PORT_CMD_POWER_OFF); in hub_root_stop()
965 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_INSTALLED; in hub_root_stop()
974 uint32_t action_flags = p_hub_driver_obj->dynamic.flags.actions; in hub_process()
975 p_hub_driver_obj->dynamic.flags.actions = 0; in hub_process()
986 root_port_handle_events(p_hub_driver_obj->constant.root_port_hdl); in hub_process()
989 hcd_port_command(p_hub_driver_obj->constant.root_port_hdl, HCD_PORT_CMD_DISABLE); in hub_process()
990 …ESP_ERROR_CHECK(usbh_hub_pass_event(p_hub_driver_obj->single_thread.root_dev_hdl, USBH_HUB_EVENT_P… in hub_process()
992 p_hub_driver_obj->single_thread.root_dev_hdl = NULL; in hub_process()
997 ESP_ERROR_CHECK(hcd_port_recover(p_hub_driver_obj->constant.root_port_hdl)); in hub_process()
998 …ESP_ERROR_CHECK(hcd_port_command(p_hub_driver_obj->constant.root_port_hdl, HCD_PORT_CMD_POWER_ON)); in hub_process()
1000 p_hub_driver_obj->dynamic.driver_state = HUB_DRIVER_STATE_ROOT_POWERED; in hub_process()
1003 p_hub_driver_obj->single_thread.root_dev_hdl = NULL; in hub_process()
1011 action_flags = p_hub_driver_obj->dynamic.flags.actions; in hub_process()
1012 p_hub_driver_obj->dynamic.flags.actions = 0; in hub_process()