Lines Matching refs:ep_state

668 	struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep);  in usb_dc_ep_set_callback()  local
672 if (!ep_state) { in usb_dc_ep_set_callback()
676 ep_state->cb = cb; in usb_dc_ep_set_callback()
767 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_configure() local
769 if (!ep_state) { in usb_dc_ep_configure()
774 ep_cfg->ep_addr, ep_state->ep_mps, ep_cfg->ep_mps, in usb_dc_ep_configure()
777 if (ep_cfg->ep_mps > ep_state->ep_pma_buf_len) { in usb_dc_ep_configure()
792 ep_state->ep_pma_buf_len = ep_cfg->ep_mps*2; in usb_dc_ep_configure()
797 ep_state->ep_pma_buf_len = ep_cfg->ep_mps; in usb_dc_ep_configure()
802 ep_state->ep_mps = ep_cfg->ep_mps*2; in usb_dc_ep_configure()
804 ep_state->ep_mps = ep_cfg->ep_mps; in usb_dc_ep_configure()
807 ep_state->ep_mps = ep_cfg->ep_mps; in usb_dc_ep_configure()
812 ep_state->ep_type = EP_TYPE_CTRL; in usb_dc_ep_configure()
815 ep_state->ep_type = EP_TYPE_ISOC; in usb_dc_ep_configure()
818 ep_state->ep_type = EP_TYPE_BULK; in usb_dc_ep_configure()
821 ep_state->ep_type = EP_TYPE_INTR; in usb_dc_ep_configure()
832 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_set_stall() local
837 if (!ep_state) { in usb_dc_ep_set_stall()
848 ep_state->ep_stalled = 1U; in usb_dc_ep_set_stall()
855 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_clear_stall() local
860 if (!ep_state) { in usb_dc_ep_clear_stall()
871 ep_state->ep_stalled = 0U; in usb_dc_ep_clear_stall()
872 ep_state->read_count = 0U; in usb_dc_ep_clear_stall()
879 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_is_stalled() local
883 if (!ep_state || !stalled) { in usb_dc_ep_is_stalled()
887 *stalled = ep_state->ep_stalled; in usb_dc_ep_is_stalled()
894 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_enable() local
899 if (!ep_state) { in usb_dc_ep_enable()
903 LOG_DBG("HAL_PCD_EP_Open(0x%02x, %u, %u)", ep, ep_state->ep_mps, in usb_dc_ep_enable()
904 ep_state->ep_type); in usb_dc_ep_enable()
907 ep_state->ep_mps, ep_state->ep_type); in usb_dc_ep_enable()
917 ep_state->ep_mps); in usb_dc_ep_enable()
925 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_disable() local
930 if (!ep_state) { in usb_dc_ep_disable()
947 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_write() local
954 if (!ep_state || !USB_EP_DIR_IS_IN(ep)) { in usb_dc_ep_write()
959 ret = k_sem_take(&ep_state->write_sem, K_NO_WAIT); in usb_dc_ep_write()
978 k_sem_give(&ep_state->write_sem); in usb_dc_ep_write()
1003 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_read_wait() local
1006 if (!ep_state) { in usb_dc_ep_read_wait()
1011 read_count = ep_state->read_count; in usb_dc_ep_read_wait()
1014 ep_state->read_offset, read_count, (void *)data); in usb_dc_ep_read_wait()
1028 ep_state->read_offset, read_count); in usb_dc_ep_read_wait()
1029 ep_state->read_count -= read_count; in usb_dc_ep_read_wait()
1030 ep_state->read_offset += read_count; in usb_dc_ep_read_wait()
1044 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_read_continue() local
1046 if (!ep_state || !USB_EP_DIR_IS_OUT(ep)) { /* Check if OUT ep */ in usb_dc_ep_read_continue()
1054 if (!ep_state->read_count) { in usb_dc_ep_read_continue()
1056 ep_state->ep_mps); in usb_dc_ep_read_continue()
1083 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_flush() local
1085 if (!ep_state) { in usb_dc_ep_flush()
1096 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in usb_dc_ep_mps() local
1098 if (!ep_state) { in usb_dc_ep_mps()
1102 return ep_state->ep_mps; in usb_dc_ep_mps()
1219 struct usb_dc_stm32_ep_state *ep_state; in HAL_PCD_SetupStageCallback() local
1223 ep_state = usb_dc_stm32_get_ep_state(EP0_OUT); /* can't fail for ep0 */ in HAL_PCD_SetupStageCallback()
1224 __ASSERT(ep_state, "No corresponding ep_state for EP0"); in HAL_PCD_SetupStageCallback()
1226 ep_state->read_count = SETUP_SIZE; in HAL_PCD_SetupStageCallback()
1227 ep_state->read_offset = 0U; in HAL_PCD_SetupStageCallback()
1229 usb_dc_stm32_state.pcd.Setup, ep_state->read_count); in HAL_PCD_SetupStageCallback()
1231 if (ep_state->cb) { in HAL_PCD_SetupStageCallback()
1232 ep_state->cb(EP0_OUT, USB_DC_EP_SETUP); in HAL_PCD_SetupStageCallback()
1247 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in HAL_PCD_DataOutStageCallback() local
1255 usb_dc_ep_get_read_count(ep, &ep_state->read_count); in HAL_PCD_DataOutStageCallback()
1256 ep_state->read_offset = 0U; in HAL_PCD_DataOutStageCallback()
1258 if (ep_state->cb) { in HAL_PCD_DataOutStageCallback()
1259 ep_state->cb(ep, USB_DC_EP_DATA_OUT); in HAL_PCD_DataOutStageCallback()
1267 struct usb_dc_stm32_ep_state *ep_state = usb_dc_stm32_get_ep_state(ep); in HAL_PCD_DataInStageCallback() local
1271 __ASSERT(ep_state, "No corresponding ep_state for ep"); in HAL_PCD_DataInStageCallback()
1273 k_sem_give(&ep_state->write_sem); in HAL_PCD_DataInStageCallback()
1275 if (ep_state->cb) { in HAL_PCD_DataInStageCallback()
1276 ep_state->cb(ep, USB_DC_EP_DATA_IN); in HAL_PCD_DataInStageCallback()