LCOV - code coverage report
Current view: top level - zephyr/usb - bos.h Hit Total Coverage
Test: new.info Lines: 5 27 18.5 %
Date: 2024-12-22 00:14:23

          Line data    Source code
       1           0 : /*
       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             : 
      13             : /**
      14             :  * @brief USB Binary Device Object Store support
      15             :  * @defgroup usb_bos USB BOS support
      16             :  * @ingroup usb
      17             :  * @since 1.13
      18             :  * @version 1.0.0
      19             :  * @{
      20             :  */
      21             : 
      22             : /** Root BOS Descriptor */
      23           1 : struct usb_bos_descriptor {
      24           0 :         uint8_t bLength;
      25           0 :         uint8_t bDescriptorType;
      26           0 :         uint16_t wTotalLength;
      27           0 :         uint8_t bNumDeviceCaps;
      28             : } __packed;
      29             : 
      30             : /** Device capability type codes */
      31           0 : enum usb_bos_capability_types {
      32             :         USB_BOS_CAPABILITY_EXTENSION = 0x02,
      33             :         USB_BOS_CAPABILITY_PLATFORM = 0x05,
      34             : };
      35             : 
      36             : /** BOS USB 2.0 extension capability descriptor */
      37           1 : struct usb_bos_capability_lpm {
      38           0 :         uint8_t bLength;
      39           0 :         uint8_t bDescriptorType;
      40           0 :         uint8_t bDevCapabilityType;
      41           0 :         uint32_t bmAttributes;
      42             : } __packed;
      43             : 
      44             : /** BOS platform capability descriptor */
      45           1 : struct usb_bos_platform_descriptor {
      46           0 :         uint8_t bLength;
      47           0 :         uint8_t bDescriptorType;
      48           0 :         uint8_t bDevCapabilityType;
      49           0 :         uint8_t bReserved;
      50           0 :         uint8_t PlatformCapabilityUUID[16];
      51             : } __packed;
      52             : 
      53             : /** WebUSB specific part of platform capability descriptor */
      54           1 : struct usb_bos_capability_webusb {
      55           0 :         uint16_t bcdVersion;
      56           0 :         uint8_t bVendorCode;
      57           0 :         uint8_t iLandingPage;
      58             : } __packed;
      59             : 
      60             : /** Microsoft OS 2.0 descriptor specific part of platform capability descriptor */
      61           1 : struct usb_bos_capability_msos {
      62           0 :         uint32_t dwWindowsVersion;
      63           0 :         uint16_t wMSOSDescriptorSetTotalLength;
      64           0 :         uint8_t bMS_VendorCode;
      65           0 :         uint8_t bAltEnumCode;
      66             : } __packed;
      67             : 
      68             : /**
      69             :  * @}
      70             :  */
      71             : 
      72             : #endif  /* ZEPHYR_INCLUDE_USB_BOS_H_ */

Generated by: LCOV version 1.14