Lines Matching refs:dev_state

172 static struct usb_dc_state dev_state;  variable
324 return (ep_idx < EP_MAX) ? &dev_state.ep_state[ep_dir][ep_idx] : NULL; in usb_dc_get_ep_state()
332 &dev_state.ep_state[0][ep_idx] : NULL; in usb_dc_get_ep_out_state()
340 &dev_state.ep_state[1][ep_idx] : NULL; in usb_dc_get_ep_in_state()
345 return dev_state.attached; in dev_attached()
350 return dev_state.vbus_present; in dev_ready()
355 dev_state.nfsr = val; in set_nfsr()
414 if (atomic_ptr_cas(&dev_state.dma_ep[dir_ix], NULL, ep_state)) { in try_allocate_dma()
584 dev_state.ep_out_data |= 1; in handle_ep0_rx()
645 if (dev_state.dma_ep[0] == ep_state) { in handle_epx_rx_ev()
656 if (dev_state.dma_ep[0] == ep_state) { in handle_epx_rx_ev()
678 dev_state.dma_ep[0] = NULL; in handle_epx_rx_ev()
702 dev_state.ep_out_data |= BIT(ep_idx); in handle_epx_rx_ev()
731 if (dev_state.dma_ep[1] == ep_state) { in handle_epx_tx_ev()
742 dev_state.dma_ep[1] = NULL; in handle_epx_tx_ev()
788 if (dev_state.nfsr == NFSR_NODE_RESET) { in check_reset_end()
806 if (dev_state.ep_state[0][0].buffer != NULL) { in check_reset_end()
812 dev_state.status_cb(USB_DC_CONNECTED, NULL); in check_reset_end()
831 dev_state.ep_state[1][i].buffer = NULL; in handle_bus_reset()
832 dev_state.ep_state[1][i].transferred = 0; in handle_bus_reset()
833 dev_state.ep_state[1][i].total_len = 0; in handle_bus_reset()
834 atomic_clear(&dev_state.ep_state[1][i].busy); in handle_bus_reset()
838 dev_state.status_cb(USB_DC_RESET, NULL); in handle_bus_reset()
854 if (atomic_cas(&dev_state.clk_requested, 0, 1)) { in usb_clock_on()
862 if (atomic_cas(&dev_state.clk_requested, 1, 0)) { in usb_clock_off()
878 dev_state.nfsr != NFSR_NODE_RESET) { in handle_alt_ev()
883 if (dev_state.ep_state[0][0].buffer != NULL) { in handle_alt_ev()
896 dev_state.status_cb(USB_DC_RESUME, NULL); in handle_alt_ev()
904 dev_state.status_cb(USB_DC_SUSPEND, NULL); in handle_alt_ev()
1004 if (dev_state.nfsr == NFSR_NODE_RESET) { in usb_dc_smartbond_isr()
1012 } else if (dev_state.nfsr == NFSR_NODE_WAKING) { in usb_dc_smartbond_isr()
1014 dev_state.nfsr = NFSR_NODE_WAKING2; in usb_dc_smartbond_isr()
1015 } else if (dev_state.nfsr == NFSR_NODE_WAKING2) { in usb_dc_smartbond_isr()
1017 dev_state.nfsr = NFSR_NODE_RESUME; in usb_dc_smartbond_isr()
1020 } else if (dev_state.nfsr == NFSR_NODE_RESUME) { in usb_dc_smartbond_isr()
1022 if (dev_state.ep_state[0][0].buffer != NULL) { in usb_dc_smartbond_isr()
1039 for (int i = 0; dev_state.ep_out_data && i < 4; ++i) { in usb_dc_smartbond_isr()
1042 if (dev_state.ep_out_data & mask) { in usb_dc_smartbond_isr()
1043 dev_state.ep_out_data ^= mask; in usb_dc_smartbond_isr()
1044 dev_state.ep_state[0][i].cb(dev_state.ep_state[0][i].ep_addr, in usb_dc_smartbond_isr()
1060 if (dev_state.attached == attached && dev_state.vbus_present == vbus_present) { in usb_change_state()
1065 dev_state.attached = true; in usb_change_state()
1066 dev_state.vbus_present = true; in usb_change_state()
1074 dev_state.status_cb(USB_DC_CONNECTED, NULL); in usb_change_state()
1089 } else if (dev_state.attached && dev_state.vbus_present) { in usb_change_state()
1094 dev_state.attached = attached; in usb_change_state()
1095 dev_state.vbus_present = vbus_present; in usb_change_state()
1108 dev_state.status_cb(USB_DC_DISCONNECTED, NULL); in usb_change_state()
1114 dev_state.attached = attached; in usb_change_state()
1115 dev_state.vbus_present = vbus_present; in usb_change_state()
1124 usb_change_state(dev_state.attached, in usb_dc_smartbond_vbus_isr()
1142 dev_state.ep_state[0][i].regs = reg_sets[i]; in usb_init()
1143 dev_state.ep_state[0][i].ep_addr = i | USB_EP_DIR_OUT; in usb_init()
1144 dev_state.ep_state[0][i].buffer = ep_out_bufs[i]; in usb_init()
1145 dev_state.ep_state[1][i].regs = reg_sets[i]; in usb_init()
1146 dev_state.ep_state[1][i].ep_addr = i | USB_EP_DIR_IN; in usb_init()
1150 dev_state.ep_state[0][0].mps = EP0_FIFO_SIZE; in usb_init()
1151 dev_state.ep_state[1][0].mps = EP0_FIFO_SIZE; in usb_init()
1317 dev_state.status_cb = cb; in usb_dc_set_status_callback()
1476 usb_change_state(false, dev_state.vbus_present); in usb_dc_detach()
1485 usb_change_state(true, dev_state.vbus_present); in usb_dc_attach()