Lines Matching refs:desc
50 static status_t append_desc_data(usb_descriptor *desc, const void *dat, size_t len) { in append_desc_data() argument
51 uint8_t *ptr = malloc(desc->len + len); in append_desc_data()
56 memcpy(ptr, desc->desc, desc->len); in append_desc_data()
57 memcpy(ptr + desc->len, dat, len); in append_desc_data()
60 if ((desc->flags & USB_DESC_FLAG_STATIC) == 0) in append_desc_data()
61 free(desc->desc); in append_desc_data()
62 desc->flags &= ~USB_DESC_FLAG_STATIC; in append_desc_data()
64 desc->desc = ptr; in append_desc_data()
65 desc->len += len; in append_desc_data()
70 static uint8_t usb_get_current_iface_num(const usb_descriptor *desc) { in usb_get_current_iface_num() argument
71 DEBUG_ASSERT(desc); in usb_get_current_iface_num()
73 return ((uint8_t *)desc->desc)[4]; in usb_get_current_iface_num()
85 static int usb_append_interface(usb_descriptor *desc, const uint8_t *int_descr, size_t len) { in usb_append_interface() argument
95 int interface_num = usb_get_current_iface_num(desc); // current interface in usb_append_interface()
101 append_desc_data(desc, ptr, len); in usb_append_interface()
105 ((uint16_t *)desc->desc)[1] += len; in usb_append_interface()
107 ((uint8_t *)desc->desc)[4] = interface_num; in usb_append_interface()
123 ((uint16_t *)usb.config->lowspeed.device.desc)[4] = vendor; in set_usb_id()
124 ((uint16_t *)usb.config->lowspeed.device.desc)[5] = product; in set_usb_id()
126 ((uint16_t *)usb.config->highspeed.device.desc)[4] = vendor; in set_usb_id()
127 ((uint16_t *)usb.config->highspeed.device.desc)[5] = product; in set_usb_id()
148 usb.strings[i].string.desc = strbuf; in usb_add_string()
240 usbc_ep0_send(speed->device.desc, speed->device.len, in usbc_callback()
245 usbc_ep0_send(speed->config.desc, speed->config.len, in usbc_callback()
250 usbc_ep0_send(usb.config->langid.desc, in usbc_callback()
260 usbc_ep0_send(usb.strings[i].string.desc, in usbc_callback()
275 usbc_ep0_send(speed->device_qual.desc, in usbc_callback()