2018-05-31 15:26:58 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
2023-07-06 15:14:36 +02:00
|
|
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
2018-05-31 15:26:58 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2018-09-17 02:06:26 +02:00
|
|
|
#ifndef ZEPHYR_INCLUDE_USB_BOS_H_
|
|
|
|
#define ZEPHYR_INCLUDE_USB_BOS_H_
|
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief USB Binary Device Object Store support
|
|
|
|
* @defgroup usb_bos USB BOS support
|
|
|
|
* @ingroup usb
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2024-04-30 10:08:26 +02:00
|
|
|
/** Root BOS Descriptor */
|
|
|
|
struct usb_bos_descriptor {
|
|
|
|
uint8_t bLength;
|
|
|
|
uint8_t bDescriptorType;
|
|
|
|
uint16_t wTotalLength;
|
|
|
|
uint8_t bNumDeviceCaps;
|
|
|
|
} __packed;
|
2018-05-31 15:26:58 +02:00
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/** Device capability type codes */
|
|
|
|
enum usb_bos_capability_types {
|
|
|
|
USB_BOS_CAPABILITY_EXTENSION = 0x02,
|
|
|
|
USB_BOS_CAPABILITY_PLATFORM = 0x05,
|
|
|
|
};
|
2018-05-31 15:26:58 +02:00
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/** BOS USB 2.0 extension capability descriptor */
|
|
|
|
struct usb_bos_capability_lpm {
|
2020-05-27 18:26:57 +02:00
|
|
|
uint8_t bLength;
|
|
|
|
uint8_t bDescriptorType;
|
|
|
|
uint8_t bDevCapabilityType;
|
2023-07-06 15:14:36 +02:00
|
|
|
uint32_t bmAttributes;
|
2018-05-31 15:26:58 +02:00
|
|
|
} __packed;
|
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/** BOS platform capability descriptor */
|
|
|
|
struct usb_bos_platform_descriptor {
|
2020-05-27 18:26:57 +02:00
|
|
|
uint8_t bLength;
|
|
|
|
uint8_t bDescriptorType;
|
2023-07-06 15:14:36 +02:00
|
|
|
uint8_t bDevCapabilityType;
|
|
|
|
uint8_t bReserved;
|
|
|
|
uint8_t PlatformCapabilityUUID[16];
|
2018-05-31 15:26:58 +02:00
|
|
|
} __packed;
|
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/** WebUSB specific part of platform capability descriptor */
|
2018-05-31 15:26:58 +02:00
|
|
|
struct usb_bos_capability_webusb {
|
2020-05-27 18:26:57 +02:00
|
|
|
uint16_t bcdVersion;
|
|
|
|
uint8_t bVendorCode;
|
|
|
|
uint8_t iLandingPage;
|
2018-05-31 15:26:58 +02:00
|
|
|
} __packed;
|
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/** Microsoft OS 2.0 descriptor specific part of platform capability descriptor */
|
2018-05-31 15:26:58 +02:00
|
|
|
struct usb_bos_capability_msos {
|
2020-05-27 18:26:57 +02:00
|
|
|
uint32_t dwWindowsVersion;
|
|
|
|
uint16_t wMSOSDescriptorSetTotalLength;
|
|
|
|
uint8_t bMS_VendorCode;
|
|
|
|
uint8_t bAltEnumCode;
|
2018-05-31 15:26:58 +02:00
|
|
|
} __packed;
|
|
|
|
|
2023-07-06 15:14:36 +02:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
2018-09-17 02:06:26 +02:00
|
|
|
|
|
|
|
#endif /* ZEPHYR_INCLUDE_USB_BOS_H_ */
|