/Zephyr-latest/subsys/usb/device_next/ |
D | usbd_device.c | 23 enum usbd_speed usbd_bus_speed(const struct usbd_context *const uds_ctx) in usbd_bus_speed() argument 25 return uds_ctx->status.speed; in usbd_bus_speed() 28 enum usbd_speed usbd_caps_speed(const struct usbd_context *const uds_ctx) in usbd_caps_speed() argument 30 struct udc_device_caps caps = udc_caps(uds_ctx->dev); in usbd_caps_speed() 41 get_device_descriptor(struct usbd_context *const uds_ctx, in get_device_descriptor() argument 46 return uds_ctx->fs_desc; in get_device_descriptor() 48 return uds_ctx->hs_desc; in get_device_descriptor() 55 int usbd_device_set_bcd_usb(struct usbd_context *const uds_ctx, in usbd_device_set_bcd_usb() argument 61 usbd_device_lock(uds_ctx); in usbd_device_set_bcd_usb() 63 if (usbd_is_enabled(uds_ctx)) { in usbd_device_set_bcd_usb() [all …]
|
D | usbd_core.c | 40 static int event_handler_ep_request(struct usbd_context *const uds_ctx, in event_handler_ep_request() argument 49 ret = usbd_handle_ctrl_xfer(uds_ctx, event->buf, bi->err); in event_handler_ep_request() 51 ret = usbd_class_handle_xfer(uds_ctx, event->buf, bi->err); in event_handler_ep_request() 62 static void usbd_class_bcast_event(struct usbd_context *const uds_ctx, in usbd_class_bcast_event() argument 68 if (!usbd_state_is_configured(uds_ctx)) { in usbd_class_bcast_event() 72 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_bcast_event() 95 static int event_handler_bus_reset(struct usbd_context *const uds_ctx) in event_handler_bus_reset() argument 100 usbd_status_suspended(uds_ctx, false); in event_handler_bus_reset() 101 ret = udc_set_address(uds_ctx->dev, 0); in event_handler_bus_reset() 107 ret = usbd_config_set(uds_ctx, 0); in event_handler_bus_reset() [all …]
|
D | usbd_device.h | 23 struct usbd_vreq_node *usbd_device_get_vreq(struct usbd_context *const uds_ctx, 31 void usbd_device_unregister_all_vreq(struct usbd_context *const uds_ctx); 41 static inline uint8_t usbd_get_num_configs(const struct usbd_context *const uds_ctx, in usbd_get_num_configs() argument 47 desc = uds_ctx->fs_desc; in usbd_get_num_configs() 49 desc = uds_ctx->hs_desc; in usbd_get_num_configs() 65 static inline void usbd_set_num_configs(struct usbd_context *const uds_ctx, in usbd_set_num_configs() argument 72 desc = uds_ctx->fs_desc; in usbd_set_num_configs() 74 desc = uds_ctx->hs_desc; in usbd_set_num_configs() 89 static inline bool usbd_is_enabled(const struct usbd_context *const uds_ctx) in usbd_is_enabled() argument 91 return uds_ctx->status.enabled; in usbd_is_enabled() [all …]
|
D | usbd_config.c | 19 static sys_slist_t *usbd_configs(struct usbd_context *uds_ctx, in usbd_configs() argument 24 return &uds_ctx->fs_configs; in usbd_configs() 26 return &uds_ctx->hs_configs; in usbd_configs() 32 struct usbd_config_node *usbd_config_get(struct usbd_context *const uds_ctx, in usbd_config_get() argument 38 SYS_SLIST_FOR_EACH_CONTAINER(usbd_configs(uds_ctx, speed), cfg_nd, node) { in usbd_config_get() 48 usbd_config_get_current(struct usbd_context *const uds_ctx) in usbd_config_get_current() argument 50 if (!usbd_state_is_configured(uds_ctx)) { in usbd_config_get_current() 55 return usbd_config_get(uds_ctx, usbd_bus_speed(uds_ctx), in usbd_config_get_current() 56 usbd_get_config_value(uds_ctx)); in usbd_config_get_current() 74 static int usbd_config_reset(struct usbd_context *const uds_ctx) in usbd_config_reset() argument [all …]
|
D | usbd_ch9.h | 19 static inline bool usbd_state_is_default(const struct usbd_context *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_context *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_context *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_context *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_context *const uds_ctx, in usbd_set_config_value() argument 69 uds_ctx->ch9_data.configuration = value; in usbd_set_config_value() [all …]
|
D | usbd_ch9.c | 33 static int nonstd_request(struct usbd_context *const uds_ctx, 46 static void ch9_set_ctrl_type(struct usbd_context *const uds_ctx, in ch9_set_ctrl_type() argument 49 uds_ctx->ch9_data.ctrl_type = type; in ch9_set_ctrl_type() 52 static int ch9_get_ctrl_type(struct usbd_context *const uds_ctx) in ch9_get_ctrl_type() argument 54 return uds_ctx->ch9_data.ctrl_type; in ch9_get_ctrl_type() 57 static int post_status_stage(struct usbd_context *const uds_ctx) in post_status_stage() argument 59 struct usb_setup_packet *setup = usbd_get_setup_pkt(uds_ctx); in post_status_stage() 63 ret = udc_set_address(uds_ctx->dev, setup->wValue); in post_status_stage() 73 ret = udc_test_mode(uds_ctx->dev, mode, false); in post_status_stage() 79 uds_ctx->ch9_data.post_status = false; in post_status_stage() [all …]
|
D | usbd_endpoint.c | 58 static void usbd_ep_ctrl_set_zlp(struct usbd_context *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() 62 struct usb_device_descriptor *desc = uds_ctx->fs_desc; in usbd_ep_ctrl_set_zlp() 66 switch (usbd_bus_speed(uds_ctx)) { in usbd_ep_ctrl_set_zlp() 102 int usbd_ep_ctrl_enqueue(struct usbd_context *const uds_ctx, in usbd_ep_ctrl_enqueue() argument 114 if (usbd_is_suspended(uds_ctx)) { in usbd_ep_ctrl_enqueue() 119 usbd_ep_ctrl_set_zlp(uds_ctx, buf); in usbd_ep_ctrl_enqueue() 122 return udc_ep_enqueue(uds_ctx->dev, buf); in usbd_ep_ctrl_enqueue() 128 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in usbd_ep_buf_alloc() local 130 return udc_ep_buf_alloc(uds_ctx->dev, ep, size); in usbd_ep_buf_alloc() [all …]
|
D | usbd_class.c | 47 usbd_class_get_by_config(struct usbd_context *const uds_ctx, in usbd_class_get_by_config() argument 55 cfg_nd = usbd_config_get(uds_ctx, speed, cnum); in usbd_class_get_by_config() 70 usbd_class_get_by_iface(struct usbd_context *const uds_ctx, in usbd_class_get_by_iface() argument 76 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_get_by_iface() 90 static bool xfer_owner_exist(struct usbd_context *const uds_ctx, in xfer_owner_exist() argument 117 int usbd_class_handle_xfer(struct usbd_context *const uds_ctx, in usbd_class_handle_xfer() argument 126 if (usbd_state_is_configured(uds_ctx)) { in usbd_class_handle_xfer() 127 cfg_nd = usbd_config_get_current(uds_ctx); in usbd_class_handle_xfer() 128 if (!xfer_owner_exist(uds_ctx, cfg_nd, buf)) { in usbd_class_handle_xfer() 140 usbd_class_get_by_ep(struct usbd_context *const uds_ctx, in usbd_class_get_by_ep() argument [all …]
|
D | usbd_desc.c | 31 static int desc_add_and_update_idx(struct usbd_context *const uds_ctx, in desc_add_and_update_idx() argument 36 SYS_DLIST_FOR_EACH_CONTAINER(&uds_ctx->descriptors, tmp_nd, node) { in desc_add_and_update_idx() 43 next_nd = SYS_DLIST_PEEK_NEXT_CONTAINER(&uds_ctx->descriptors, in desc_add_and_update_idx() 50 sys_dlist_append(&uds_ctx->descriptors, &new_nd->node); in desc_add_and_update_idx() 77 sys_dlist_append(&uds_ctx->descriptors, &new_nd->node); in desc_add_and_update_idx() 83 struct usbd_desc_node *usbd_get_descriptor(struct usbd_context *const uds_ctx, in usbd_get_descriptor() argument 88 SYS_DLIST_FOR_EACH_CONTAINER(&uds_ctx->descriptors, desc_nd, node) { in usbd_get_descriptor() 105 int usbd_desc_remove_all(struct usbd_context *const uds_ctx) in usbd_desc_remove_all() argument 110 while ((node = sys_dlist_get(&uds_ctx->descriptors))) { in usbd_desc_remove_all() 119 int usbd_add_descriptor(struct usbd_context *const uds_ctx, in usbd_add_descriptor() argument [all …]
|
D | usbd_interface.c | 25 static int handle_ep_op(struct usbd_context *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_context *const uds_ctx, in usbd_interface_modify() argument 63 dhp = usbd_class_get_desc(c_nd->c_data, usbd_bus_speed(uds_ctx)); in usbd_interface_modify() 92 ret = handle_ep_op(uds_ctx, op, ed, &c_nd->ep_active); in usbd_interface_modify() 110 int usbd_interface_shutdown(struct usbd_context *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_context *const uds_ctx, in usbd_interface_default() argument [all …]
|
D | usbd_class.h | 21 int usbd_class_handle_xfer(struct usbd_context *const uds_ctx, 50 struct usbd_class_node *usbd_class_get_by_iface(struct usbd_context *uds_ctx, 63 struct usbd_class_node *usbd_class_get_by_config(struct usbd_context *uds_ctx, 78 struct usbd_class_node *usbd_class_get_by_ep(struct usbd_context *uds_ctx, 95 struct usbd_class_node *usbd_class_get_by_req(struct usbd_context *uds_ctx, 107 int usbd_class_remove_all(struct usbd_context *const uds_ctx,
|
D | usbd_init.c | 65 static int unassign_eps(struct usbd_context *const uds_ctx, in unassign_eps() argument 111 static int init_configuration_inst(struct usbd_context *const uds_ctx, in init_configuration_inst() argument 162 unassign_eps(uds_ctx, config_ep_bm, &class_ep_bm); in init_configuration_inst() 172 ret = assign_ep_addr(uds_ctx->dev, ed, in init_configuration_inst() 205 static int init_configuration(struct usbd_context *const uds_ctx, in init_configuration() argument 218 ret = init_configuration_inst(uds_ctx, speed, c_nd, in init_configuration() 248 ret = unassign_eps(uds_ctx, &config_ep_bm, &c_nd->ep_active); in init_configuration() 257 static void usbd_init_update_fs_mps0(struct usbd_context *const uds_ctx) in usbd_init_update_fs_mps0() argument 259 struct udc_device_caps caps = udc_caps(uds_ctx->dev); in usbd_init_update_fs_mps0() 260 struct usb_device_descriptor *desc = uds_ctx->fs_desc; in usbd_init_update_fs_mps0() [all …]
|
D | usbd_config.h | 50 struct usbd_config_node *usbd_config_get(struct usbd_context *uds_ctx, 63 struct usbd_config_node *usbd_config_get_current(struct usbd_context *uds_ctx); 74 bool usbd_config_exist(struct usbd_context *const uds_ctx, 90 int usbd_config_set(struct usbd_context *uds_ctx, uint8_t new_cfg);
|
D | usbd_interface.h | 20 int usbd_interface_shutdown(struct usbd_context *const uds_ctx, 34 int usbd_interface_default(struct usbd_context *const uds_ctx, 49 int usbd_interface_set(struct usbd_context *uds_ctx,
|
D | usbd_desc.h | 23 struct usbd_desc_node *usbd_get_descriptor(struct usbd_context *const uds_ctx, 37 int usbd_desc_remove_all(struct usbd_context *const uds_ctx);
|
D | usbd_msg.c | 90 int usbd_msg_register_cb(struct usbd_context *const uds_ctx, in usbd_msg_register_cb() argument 95 usbd_device_lock(uds_ctx); in usbd_msg_register_cb() 97 if (uds_ctx->msg_cb != NULL) { in usbd_msg_register_cb() 102 uds_ctx->msg_cb = cb; in usbd_msg_register_cb() 105 usbd_device_unlock(uds_ctx); in usbd_msg_register_cb()
|
D | usbd_init.h | 23 int usbd_init_configurations(struct usbd_context *const uds_ctx);
|
/Zephyr-latest/include/zephyr/usb/ |
D | usbd.h | 382 struct usbd_context *uds_ctx; member 432 return c_data->uds_ctx; in usbd_class_get_ctx() 775 int usbd_add_descriptor(struct usbd_context *uds_ctx, 805 int usbd_add_configuration(struct usbd_context *uds_ctx, 830 int usbd_register_class(struct usbd_context *uds_ctx, 850 int usbd_register_all_classes(struct usbd_context *uds_ctx, 867 int usbd_unregister_class(struct usbd_context *uds_ctx, 883 int usbd_unregister_all_classes(struct usbd_context *uds_ctx, 894 int usbd_msg_register_cb(struct usbd_context *const uds_ctx, 910 int usbd_init(struct usbd_context *uds_ctx); [all …]
|
/Zephyr-latest/samples/subsys/usb/webusb-next/src/ |
D | sfunc.c | 45 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in sfunc_get_bulk_out() local 48 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in sfunc_get_bulk_out() 58 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in sfunc_get_bulk_in() local 61 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in sfunc_get_bulk_in() 71 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in sfunc_request_handler() local 93 usbd_ep_buf_free(uds_ctx, buf); in sfunc_request_handler() 97 usbd_ep_buf_free(uds_ctx, buf); in sfunc_request_handler() 118 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in sfunc_buf_alloc() local 123 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in sfunc_buf_alloc() 144 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in sfunc_enable() local [all …]
|
/Zephyr-latest/samples/subsys/usb/common/ |
D | sample_usbd_init.c | 69 static void sample_fix_code_triple(struct usbd_context *uds_ctx, in sample_fix_code_triple() argument 82 usbd_device_set_code_triple(uds_ctx, speed, in sample_fix_code_triple() 85 usbd_device_set_code_triple(uds_ctx, speed, 0, 0, 0); in sample_fix_code_triple()
|
/Zephyr-latest/subsys/usb/device_next/class/ |
D | usbd_cdc_ecm.c | 104 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ecm_get_int_in() local 109 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ecm_get_int_in() 118 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ecm_get_bulk_in() local 123 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ecm_get_bulk_in() 132 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ecm_get_bulk_in_mps() local 134 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ecm_get_bulk_in_mps() 143 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ecm_get_bulk_out() local 148 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ecm_get_bulk_out() 288 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in usbd_cdc_ecm_request() local 309 return usbd_ep_buf_free(uds_ctx, buf); in usbd_cdc_ecm_request() [all …]
|
D | usbd_cdc_acm.c | 158 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_acm_get_int_in() local 163 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_acm_get_int_in() 172 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_acm_get_bulk_in() local 177 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_acm_get_bulk_in() 186 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_acm_get_bulk_out() local 191 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_acm_get_bulk_out() 200 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_acm_get_bulk_mps() local 202 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_acm_get_bulk_mps() 212 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in usbd_cdc_acm_request() local 272 return usbd_ep_buf_free(uds_ctx, buf); in usbd_cdc_acm_request() [all …]
|
D | usbd_cdc_ncm.c | 247 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ncm_get_int_in() local 252 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ncm_get_int_in() 261 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ncm_get_bulk_in() local 266 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ncm_get_bulk_in() 275 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ncm_get_bulk_in_mps() local 277 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ncm_get_bulk_in_mps() 286 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in cdc_ncm_get_bulk_out() local 291 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in cdc_ncm_get_bulk_out() 640 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in usbd_cdc_ncm_request() local 663 return usbd_ep_buf_free(uds_ctx, buf); in usbd_cdc_ncm_request() [all …]
|
D | bt_hci.c | 137 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in bt_hci_get_bulk_in() local 141 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in bt_hci_get_bulk_in() 150 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in bt_hci_get_bulk_out() local 154 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { in bt_hci_get_bulk_out() 372 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in bt_hci_request() local 389 return usbd_ep_buf_free(uds_ctx, buf); in bt_hci_request()
|
D | usbd_uac2.c | 130 if (usbd_bus_speed(c_data->uds_ctx) == USBD_SPEED_FS) { in get_as_data_ep() 152 if (usbd_bus_speed(c_data->uds_ctx) == USBD_SPEED_FS) { in get_as_feedback_ep() 363 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in write_explicit_feedback() local 384 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_FS) { in write_explicit_feedback() 403 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in uac2_update() local 417 if (usbd_bus_speed(uds_ctx) == USBD_SPEED_FS) { in uac2_update() 742 struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); in uac2_request() local 779 usbd_ep_buf_free(uds_ctx, buf); in uac2_request()
|