Lines Matching refs:uds_ctx

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
125 usbd_device_lock(uds_ctx); in usbd_add_descriptor()
127 hs_desc = uds_ctx->hs_desc; in usbd_add_descriptor()
128 fs_desc = uds_ctx->fs_desc; in usbd_add_descriptor()
129 if (!fs_desc || !hs_desc || usbd_is_initialized(uds_ctx)) { in usbd_add_descriptor()
135 if (!sys_dnode_is_linked(&uds_ctx->descriptors)) { in usbd_add_descriptor()
137 sys_dlist_init(&uds_ctx->descriptors); in usbd_add_descriptor()
147 ret = usbd_device_register_vreq(uds_ctx, desc_nd->bos.vreq_nd); in usbd_add_descriptor()
153 sys_dlist_append(&uds_ctx->descriptors, &desc_nd->node); in usbd_add_descriptor()
157 ret = desc_add_and_update_idx(uds_ctx, desc_nd); in usbd_add_descriptor()
184 usbd_device_unlock(uds_ctx); in usbd_add_descriptor()