Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bos.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 * Copyright (c) 2023 Nordic Semiconductor ASA
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_INCLUDE_USB_BOS_H_
9#define ZEPHYR_INCLUDE_USB_BOS_H_
10
11#include <stdint.h>
12
24#define USB_DEVICE_BOS_DESC_DEFINE_CAP \
25 static __in_section(usb, bos_desc_area, 1) __aligned(1) __used
26
31};
32
39} __packed;
40
48} __packed;
49
55} __packed;
56
63} __packed;
64
74
80/* BOS Descriptor (root descriptor) */
81struct usb_bos_descriptor {
82 uint8_t bLength;
83 uint8_t bDescriptorType;
84 uint16_t wTotalLength;
85 uint8_t bNumDeviceCaps;
86} __packed;
87
88#define USB_DEVICE_BOS_DESC_DEFINE_HDR \
89 static __in_section(usb, bos_desc_area, 0) __aligned(1) __used
90
91size_t usb_bos_get_length(void);
92
93void usb_bos_fix_total_length(void);
94
95const void *usb_bos_get_header(void);
96
97#if defined(CONFIG_USB_DEVICE_BOS)
98int usb_handle_bos(struct usb_setup_packet *setup, int32_t *len, uint8_t **data);
99#else
100#define usb_handle_bos(x, y, z) -ENOTSUP
101#endif
108#endif /* ZEPHYR_INCLUDE_USB_BOS_H_ */
usb_bos_capability_types
Device capability type codes.
Definition: bos.h:28
void usb_bos_register_cap(struct usb_bos_platform_descriptor *hdr)
Register BOS capability descriptor.
@ USB_BOS_CAPABILITY_EXTENSION
Definition: bos.h:29
@ USB_BOS_CAPABILITY_PLATFORM
Definition: bos.h:30
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__INT32_TYPE__ int32_t
Definition: stdint.h:74
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
BOS USB 2.0 extension capability descriptor.
Definition: bos.h:34
uint8_t bLength
Definition: bos.h:35
uint8_t bDevCapabilityType
Definition: bos.h:37
uint8_t bDescriptorType
Definition: bos.h:36
uint32_t bmAttributes
Definition: bos.h:38
Microsoft OS 2.0 descriptor specific part of platform capability descriptor.
Definition: bos.h:58
uint8_t bAltEnumCode
Definition: bos.h:62
uint8_t bMS_VendorCode
Definition: bos.h:61
uint32_t dwWindowsVersion
Definition: bos.h:59
uint16_t wMSOSDescriptorSetTotalLength
Definition: bos.h:60
WebUSB specific part of platform capability descriptor.
Definition: bos.h:51
uint8_t iLandingPage
Definition: bos.h:54
uint16_t bcdVersion
Definition: bos.h:52
uint8_t bVendorCode
Definition: bos.h:53
BOS platform capability descriptor.
Definition: bos.h:42
uint8_t PlatformCapabilityUUID[16]
Definition: bos.h:47
uint8_t bDescriptorType
Definition: bos.h:44
uint8_t bReserved
Definition: bos.h:46
uint8_t bLength
Definition: bos.h:43
uint8_t bDevCapabilityType
Definition: bos.h:45
USB Setup Data packet defined in spec.
Definition: usb_ch9.h:39