| * Copyright (c) 2018 Intel Corporation |
| * SPDX-License-Identifier: Apache-2.0 |
| #define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL |
| LOG_MODULE_REGISTER(usb_os_desc); |
| #include <usb/usb_device.h> |
| #include <usb/usb_common.h> |
| static struct usb_os_descriptor *os_desc; |
| int usb_handle_os_desc(struct usb_setup_packet *setup, |
| if (GET_DESC_TYPE(setup->wValue) == USB_STRING_DESC && |
| GET_DESC_INDEX(setup->wValue) == USB_OSDESC_STRING_DESC_INDEX) { |
| LOG_DBG("MS OS Descriptor string read"); |
| *len = os_desc->string_len; |
| int usb_handle_os_desc_feature(struct usb_setup_packet *setup, |
| LOG_DBG("bRequest 0x%x", setup->bRequest); |
| if (setup->bRequest == os_desc->vendor_code) { |
| case USB_OSDESC_EXTENDED_COMPAT_ID: |
| LOG_DBG("Handle Compat ID"); |
| *data = os_desc->compat_id; |
| *len = os_desc->compat_id_len; |
| /* Register MS OS Descriptors version 1 */ |
| void usb_register_os_desc(struct usb_os_descriptor *desc) |
| bool usb_os_desc_enabled(void) |