Home
last modified time | relevance | path

Searched refs:uds_ctx (Results 1 – 22 of 22) sorted by relevance

/Zephyr-Core-3.5.0/subsys/usb/device_next/
Dusbd_device.c23 int usbd_device_set_bcd(struct usbd_contex *const uds_ctx, in usbd_device_set_bcd() argument
26 struct usb_device_descriptor *desc = uds_ctx->desc; in usbd_device_set_bcd()
29 usbd_device_lock(uds_ctx); in usbd_device_set_bcd()
31 if (usbd_is_enabled(uds_ctx)) { in usbd_device_set_bcd()
39 usbd_device_unlock(uds_ctx); in usbd_device_set_bcd()
43 int usbd_device_set_vid(struct usbd_contex *const uds_ctx, in usbd_device_set_vid() argument
46 struct usb_device_descriptor *desc = uds_ctx->desc; in usbd_device_set_vid()
49 usbd_device_lock(uds_ctx); in usbd_device_set_vid()
51 if (usbd_is_enabled(uds_ctx)) { in usbd_device_set_vid()
59 usbd_device_unlock(uds_ctx); in usbd_device_set_vid()
[all …]
Dusbd_config.c19 struct usbd_config_node *usbd_config_get(struct usbd_contex *const uds_ctx, in usbd_config_get() argument
24 SYS_SLIST_FOR_EACH_CONTAINER(&uds_ctx->configs, cfg_nd, node) { in usbd_config_get()
34 usbd_config_get_current(struct usbd_contex *const uds_ctx) in usbd_config_get_current() argument
36 if (!usbd_state_is_configured(uds_ctx)) { in usbd_config_get_current()
41 return usbd_config_get(uds_ctx, usbd_get_config_value(uds_ctx)); in usbd_config_get_current()
59 static int usbd_config_reset(struct usbd_contex *const uds_ctx) in usbd_config_reset() argument
64 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_config_reset()
69 ret = usbd_interface_shutdown(uds_ctx, cfg_nd); in usbd_config_reset()
71 memset(&uds_ctx->ch9_data.alternate, 0, in usbd_config_reset()
74 usbd_set_config_value(uds_ctx, 0); in usbd_config_reset()
[all …]
Dusbd_device.h19 static inline uint8_t usbd_get_num_configs(const struct usbd_contex *const uds_ctx) in usbd_get_num_configs() argument
21 struct usb_device_descriptor *desc = uds_ctx->desc; in usbd_get_num_configs()
33 static inline void usbd_set_num_configs(struct usbd_contex *const uds_ctx, in usbd_set_num_configs() argument
36 struct usb_device_descriptor *desc = uds_ctx->desc; in usbd_set_num_configs()
48 static inline bool usbd_is_enabled(const struct usbd_contex *const uds_ctx) in usbd_is_enabled() argument
50 return uds_ctx->status.enabled; in usbd_is_enabled()
60 static inline bool usbd_is_initialized(const struct usbd_contex *const uds_ctx) in usbd_is_initialized() argument
62 return uds_ctx->status.initialized; in usbd_is_initialized()
71 static inline void usbd_status_suspended(struct usbd_contex *const uds_ctx, in usbd_status_suspended() argument
74 uds_ctx->status.suspended = value; in usbd_status_suspended()
[all …]
Dusbd_ch9.h19 static inline bool usbd_state_is_default(const struct usbd_contex *const uds_ctx) in usbd_state_is_default() argument
21 return (uds_ctx->ch9_data.state == USBD_STATE_DEFAULT) ? true : false; in usbd_state_is_default()
31 static inline bool usbd_state_is_address(const struct usbd_contex *const uds_ctx) in usbd_state_is_address() argument
33 return (uds_ctx->ch9_data.state == USBD_STATE_ADDRESS) ? true : false; in usbd_state_is_address()
43 static inline bool usbd_state_is_configured(const struct usbd_contex *const uds_ctx) in usbd_state_is_configured() argument
45 return (uds_ctx->ch9_data.state == USBD_STATE_CONFIGURED) ? true : false; in usbd_state_is_configured()
55 static inline uint8_t usbd_get_config_value(const struct usbd_contex *const uds_ctx) in usbd_get_config_value() argument
57 return uds_ctx->ch9_data.configuration; in usbd_get_config_value()
66 static inline void usbd_set_config_value(struct usbd_contex *const uds_ctx, in usbd_set_config_value() argument
69 uds_ctx->ch9_data.configuration = value; in usbd_set_config_value()
[all …]
Dusbd_ch9.c38 static void ch9_set_ctrl_type(struct usbd_contex *const uds_ctx, in ch9_set_ctrl_type() argument
41 uds_ctx->ch9_data.ctrl_type = type; in ch9_set_ctrl_type()
44 static int ch9_get_ctrl_type(struct usbd_contex *const uds_ctx) in ch9_get_ctrl_type() argument
46 return uds_ctx->ch9_data.ctrl_type; in ch9_get_ctrl_type()
49 static int set_address_after_status_stage(struct usbd_contex *const uds_ctx) in set_address_after_status_stage() argument
51 struct usb_setup_packet *setup = usbd_get_setup_pkt(uds_ctx); in set_address_after_status_stage()
54 ret = udc_set_address(uds_ctx->dev, setup->wValue); in set_address_after_status_stage()
60 uds_ctx->ch9_data.new_address = false; in set_address_after_status_stage()
65 static int sreq_set_address(struct usbd_contex *const uds_ctx) in sreq_set_address() argument
67 struct usb_setup_packet *setup = usbd_get_setup_pkt(uds_ctx); in sreq_set_address()
[all …]
Dusbd_core.c39 static int event_handler_ep_request(struct usbd_contex *const uds_ctx, in event_handler_ep_request() argument
48 ret = usbd_handle_ctrl_xfer(uds_ctx, event->buf, bi->err); in event_handler_ep_request()
50 ret = usbd_class_handle_xfer(uds_ctx, event->buf, bi->err); in event_handler_ep_request()
63 static void usbd_class_bcast_event(struct usbd_contex *const uds_ctx, in usbd_class_bcast_event() argument
69 if (!usbd_state_is_configured(uds_ctx)) { in usbd_class_bcast_event()
73 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_bcast_event()
93 static int event_handler_bus_reset(struct usbd_contex *const uds_ctx) in event_handler_bus_reset() argument
99 usbd_status_suspended(uds_ctx, false); in event_handler_bus_reset()
100 ret = udc_set_address(uds_ctx->dev, 0); in event_handler_bus_reset()
106 ret = usbd_config_set(uds_ctx, 0); in event_handler_bus_reset()
[all …]
Dusbd_endpoint.c58 static void usbd_ep_ctrl_set_zlp(struct usbd_contex *const uds_ctx, in usbd_ep_ctrl_set_zlp() argument
61 struct usb_setup_packet *setup = usbd_get_setup_pkt(uds_ctx); in usbd_ep_ctrl_set_zlp()
89 struct net_buf *usbd_ep_ctrl_buf_alloc(struct usbd_contex *const uds_ctx, in usbd_ep_ctrl_buf_alloc() argument
97 return udc_ep_buf_alloc(uds_ctx->dev, ep, size); in usbd_ep_ctrl_buf_alloc()
100 int usbd_ep_ctrl_enqueue(struct usbd_contex *const uds_ctx, in usbd_ep_ctrl_enqueue() argument
112 if (usbd_is_suspended(uds_ctx)) { in usbd_ep_ctrl_enqueue()
117 usbd_ep_ctrl_set_zlp(uds_ctx, buf); in usbd_ep_ctrl_enqueue()
120 return udc_ep_enqueue(uds_ctx->dev, buf); in usbd_ep_ctrl_enqueue()
126 struct usbd_contex *uds_ctx = c_nd->data->uds_ctx; in usbd_ep_buf_alloc() local
128 return udc_ep_buf_alloc(uds_ctx->dev, ep, size); in usbd_ep_buf_alloc()
[all …]
Dusbd_class.c49 usbd_class_get_by_config(struct usbd_contex *const uds_ctx, in usbd_class_get_by_config() argument
56 cfg_nd = usbd_config_get(uds_ctx, cnum); in usbd_class_get_by_config()
71 usbd_class_get_by_iface(struct usbd_contex *const uds_ctx, in usbd_class_get_by_iface() argument
77 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_get_by_iface()
91 static bool xfer_owner_exist(struct usbd_contex *const uds_ctx, in xfer_owner_exist() argument
118 int usbd_class_handle_xfer(struct usbd_contex *const uds_ctx, in usbd_class_handle_xfer() argument
127 if (usbd_state_is_configured(uds_ctx)) { in usbd_class_handle_xfer()
128 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_handle_xfer()
129 if (xfer_owner_exist(uds_ctx, cfg_nd, buf)) { in usbd_class_handle_xfer()
134 SYS_SLIST_FOR_EACH_CONTAINER(&uds_ctx->configs, cfg_nd, node) { in usbd_class_handle_xfer()
[all …]
Dusbd_interface.c25 static int handle_ep_op(struct usbd_contex *const uds_ctx, in handle_ep_op() argument
38 ret = usbd_ep_enable(uds_ctx->dev, ed, ep_bm); in handle_ep_op()
41 ret = usbd_ep_disable(uds_ctx->dev, ep, ep_bm); in handle_ep_op()
53 static int usbd_interface_modify(struct usbd_contex *const uds_ctx, in usbd_interface_modify() argument
91 ret = handle_ep_op(uds_ctx, op, ed, &node->data->ep_active); in usbd_interface_modify()
110 int usbd_interface_shutdown(struct usbd_contex *const uds_ctx, in usbd_interface_shutdown() argument
124 ret = usbd_ep_disable(uds_ctx->dev, ep_in, ep_bm); in usbd_interface_shutdown()
131 ret = usbd_ep_disable(uds_ctx->dev, ep_out, ep_bm); in usbd_interface_shutdown()
142 int usbd_interface_default(struct usbd_contex *const uds_ctx, in usbd_interface_default() argument
153 class = usbd_class_get_by_config(uds_ctx, new_cfg, i); in usbd_interface_default()
[all …]
Dusbd_class.h21 int usbd_class_handle_xfer(struct usbd_contex *const uds_ctx,
50 struct usbd_class_node *usbd_class_get_by_iface(struct usbd_contex *uds_ctx,
62 struct usbd_class_node *usbd_class_get_by_config(struct usbd_contex *uds_ctx,
76 struct usbd_class_node *usbd_class_get_by_ep(struct usbd_contex *uds_ctx,
93 struct usbd_class_node *usbd_class_get_by_req(struct usbd_contex *uds_ctx,
104 int usbd_class_remove_all(struct usbd_contex *const uds_ctx,
Dusbd_desc.c122 static int desc_add_and_update_idx(struct usbd_contex *const uds_ctx, in desc_add_and_update_idx() argument
127 SYS_DLIST_FOR_EACH_CONTAINER(&uds_ctx->descriptors, tmp_nd, node) { in desc_add_and_update_idx()
134 next_nd = SYS_DLIST_PEEK_NEXT_CONTAINER(&uds_ctx->descriptors, in desc_add_and_update_idx()
141 sys_dlist_append(&uds_ctx->descriptors, &new_nd->node); in desc_add_and_update_idx()
168 sys_dlist_append(&uds_ctx->descriptors, &new_nd->node); in desc_add_and_update_idx()
174 void *usbd_get_descriptor(struct usbd_contex *const uds_ctx, in usbd_get_descriptor() argument
180 SYS_DLIST_FOR_EACH_CONTAINER(&uds_ctx->descriptors, tmp, node) { in usbd_get_descriptor()
190 int usbd_desc_remove_all(struct usbd_contex *const uds_ctx) in usbd_desc_remove_all() argument
195 while ((node = sys_dlist_get(&uds_ctx->descriptors))) { in usbd_desc_remove_all()
203 int usbd_add_descriptor(struct usbd_contex *const uds_ctx, in usbd_add_descriptor() argument
[all …]
Dusbd_init.c65 static int unassign_eps(struct usbd_contex *const uds_ctx, in unassign_eps() argument
111 static int init_configuration_inst(struct usbd_contex *const uds_ctx, in init_configuration_inst() argument
147 unassign_eps(uds_ctx, config_ep_bm, &class_ep_bm); in init_configuration_inst()
157 ret = assign_ep_addr(uds_ctx->dev, ed, in init_configuration_inst()
189 static int init_configuration(struct usbd_contex *const uds_ctx, in init_configuration() argument
201 ret = init_configuration_inst(uds_ctx, c_nd->data, in init_configuration()
231 ret = unassign_eps(uds_ctx, &config_ep_bm, &c_nd->data->ep_active); in init_configuration()
240 static void usbd_init_update_mps0(struct usbd_contex *const uds_ctx) in usbd_init_update_mps0() argument
242 struct udc_device_caps caps = udc_caps(uds_ctx->dev); in usbd_init_update_mps0()
243 struct usb_device_descriptor *desc = uds_ctx->desc; in usbd_init_update_mps0()
[all …]
Dusbd_config.h49 struct usbd_config_node *usbd_config_get(struct usbd_contex *uds_ctx,
61 struct usbd_config_node *usbd_config_get_current(struct usbd_contex *uds_ctx);
71 bool usbd_config_exist(struct usbd_contex *const uds_ctx,
86 int usbd_config_set(struct usbd_contex *uds_ctx, uint8_t new_cfg);
Dusbd_interface.h20 int usbd_interface_shutdown(struct usbd_contex *const uds_ctx,
33 int usbd_interface_default(struct usbd_contex *const uds_ctx,
47 int usbd_interface_set(struct usbd_contex *uds_ctx,
Dusbd_desc.h23 void *usbd_get_descriptor(struct usbd_contex *uds_ctx,
37 int usbd_desc_remove_all(struct usbd_contex *const uds_ctx);
Dusbd_init.h23 int usbd_init_configurations(struct usbd_contex *const uds_ctx);
/Zephyr-Core-3.5.0/include/zephyr/usb/
Dusbd.h247 struct usbd_contex *uds_ctx; member
445 int usbd_add_descriptor(struct usbd_contex *uds_ctx,
456 int usbd_add_configuration(struct usbd_contex *uds_ctx,
479 int usbd_register_class(struct usbd_contex *uds_ctx,
496 int usbd_unregister_class(struct usbd_contex *uds_ctx,
513 int usbd_init(struct usbd_contex *uds_ctx);
524 int usbd_enable(struct usbd_contex *uds_ctx);
535 int usbd_disable(struct usbd_contex *uds_ctx);
546 int usbd_shutdown(struct usbd_contex *const uds_ctx);
556 int usbd_ep_set_halt(struct usbd_contex *uds_ctx, uint8_t ep);
[all …]
/Zephyr-Core-3.5.0/subsys/usb/device_next/class/
Dusbd_msc.c197 usbd_ep_set_halt(node->data->uds_ctx, ep); in msc_stall_bulk_out_ep()
205 usbd_ep_set_halt(node->data->uds_ctx, ep); in msc_stall_bulk_in_ep()
560 struct usbd_contex *uds_ctx = node->data->uds_ctx; in usbd_msc_handle_request() local
589 usbd_ep_buf_free(uds_ctx, buf); in usbd_msc_handle_request()
664 usbd_ep_set_halt(node->data->uds_ctx, ep); in msc_bot_feature_halt()
668 usbd_ep_set_halt(node->data->uds_ctx, ep); in msc_bot_feature_halt()
Dusbd_cdc_ecm.c242 struct usbd_contex *uds_ctx = c_nd->data->uds_ctx; in usbd_cdc_ecm_request() local
265 return usbd_ep_buf_free(uds_ctx, buf); in usbd_cdc_ecm_request()
412 if (usbd_add_descriptor(c_nd->data->uds_ctx, data->mac_desc_nd)) { in usbd_cdc_ecm_init()
469 if (udc_device_speed(c_nd->data->uds_ctx->dev) == UDC_BUS_SPEED_FS) { in cdc_ecm_send()
Dbt_hci.c361 struct usbd_contex *uds_ctx = c_nd->data->uds_ctx; in bt_hci_request() local
378 return usbd_ep_buf_free(uds_ctx, buf); in bt_hci_request()
Dloopback.c269 usbd_ep_buf_free(c_nd->data->uds_ctx, buf); in lb_request_handler()
Dusbd_cdc_acm.c158 struct usbd_contex *uds_ctx = c_nd->data->uds_ctx; in usbd_cdc_acm_request() local
206 return usbd_ep_buf_free(uds_ctx, buf); in usbd_cdc_acm_request()