mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 03:18:09 +00:00
b20336e82d
This reverts the following range of commits: 68168393b9ea61328f4bb43bc3059ab32c4be2e9..ab76828e16b552c82f468e5d89f1af0645258995 Revert "update usb descriptors" This reverts commitab76828e16
. Revert "trezorhal: reply with winusb guid just for the main interface (0)" This reverts commit6acfc5d1b3
. Revert "winusb: fix WINUSB_EXTRA_STRING" This reverts commit966d8cb4ce
. Revert "winusb: cleanup DeviceInterfaceGUIDs usage" This reverts commit56c5a46095
. Revert "make winusb_string_descriptor const" This reverts commit132cc4b474
. Revert "webusb: remove unused constants" This reverts commit38b4d507bc
. Revert "bootloader: remove debug" This reverts commit56d3cbe2e9
. Revert "Bootloader - Switch from HID to WebUSB" This reverts commita22abfe90b
. Revert "Switch from HID to WebUSB" This reverts commitcb067bd14c
. Revert "Add WinUSB, WebUSB, USB2.1 to build" This reverts commit05e218bcb8
. Revert "Add WebUSB descriptors" This reverts commita062127cef
. Revert "Add WinUSB (WebUSB preparation)" This reverts commite6981e85cd
.
64 lines
2.1 KiB
C
64 lines
2.1 KiB
C
/*
|
|
* Copyright (c) 2016, Devan Lai
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software
|
|
* for any purpose with or without fee is hereby granted, provided
|
|
* that the above copyright notice and this permission notice
|
|
* appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
#ifndef USB21_STANDARD_H_INCLUDED
|
|
#define USB21_STANDARD_H_INCLUDED
|
|
|
|
#include <libopencm3/usb/usbd.h>
|
|
|
|
/* USB 3.1 Descriptor Types - Table 9-6 */
|
|
#define USB_DT_BOS 15
|
|
#define USB_DT_DEVICE_CAPABILITY 16
|
|
#define USB_DT_SUPERSPEED_USB_ENDPOINT_COMPANION 48
|
|
#define USB_DT_SUPERSPEEDPLUS_ISOCHRONOUS_ENDPOINT_COMPANION 49
|
|
|
|
struct usb_device_capability_descriptor {
|
|
uint8_t bLength;
|
|
uint8_t bDescriptorType;
|
|
uint8_t bDevCapabilityType;
|
|
} __attribute__((packed));
|
|
|
|
struct usb_bos_descriptor {
|
|
uint8_t bLength;
|
|
uint8_t bDescriptorType;
|
|
uint16_t wTotalLength;
|
|
uint8_t bNumDeviceCaps;
|
|
/* Descriptor ends here. The following are used internally: */
|
|
const struct usb_device_capability_descriptor **capabilities;
|
|
} __attribute__((packed));
|
|
|
|
#define USB_DT_BOS_SIZE 5
|
|
|
|
/* USB Device Capability Types - USB 3.1 Table 9-14 */
|
|
#define USB_DC_WIRELESS_USB 1
|
|
#define USB_DC_USB_2_0_EXTENSION 2
|
|
#define USB_DC_SUPERSPEED_USB 3
|
|
#define USB_DC_CONTAINER_ID 4
|
|
#define USB_DC_PLATFORM 5
|
|
#define USB_DC_POWER_DELIVERY_CAPABILITY 6
|
|
#define USB_DC_BATTERY_INFO_CAPABILITY 7
|
|
#define USB_DC_PD_CONSUMER_PORT_CAPABILITY 8
|
|
#define USB_DC_PD_PROVIDER_PORT_CAPABILITY 9
|
|
#define USB_DC_SUPERSPEED_PLUS 10
|
|
#define USB_DC_PRECISION_TIME_MEASUREMENT 11
|
|
#define USB_DC_WIRELESS_USB_EXT 12
|
|
|
|
extern void usb21_setup(usbd_device* usbd_dev, const struct usb_bos_descriptor* binary_object_store);
|
|
|
|
#endif
|