| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.hardware.usb.descriptor; |
| |
| // USB standard descriptor specifications. |
| enum UsbSpeed : uint32 { |
| UNDEFINED = 0; |
| FULL = 1; |
| LOW = 2; |
| HIGH = 3; |
| SUPER = 4; |
| }; |
| |
| [Packed] |
| struct UsbSetup { |
| uint8 bm_request_type; |
| uint8 b_request; |
| uint16 w_value; |
| uint16 w_index; |
| uint16 w_length; |
| }; |
| |
| [Packed] |
| struct UsbDeviceDescriptor { |
| uint8 b_length; |
| uint8 b_descriptor_type; |
| uint16 bcd_usb; |
| uint8 b_device_class; |
| uint8 b_device_sub_class; |
| uint8 b_device_protocol; |
| uint8 b_max_packet_size0; |
| uint16 id_vendor; |
| uint16 id_product; |
| uint16 bcd_device; |
| uint8 i_manufacturer; |
| uint8 i_product; |
| uint8 i_serial_number; |
| uint8 b_num_configurations; |
| }; |
| |
| [Packed] |
| struct UsbSsEpCompDescriptor { |
| uint8 b_length; |
| uint8 b_descriptor_type; |
| uint8 b_max_burst; |
| uint8 bm_attributes; |
| uint16 w_bytes_per_interval; |
| }; |
| |
| [Packed] |
| struct UsbEndpointDescriptor { |
| uint8 b_length; |
| uint8 b_descriptor_type; |
| uint8 b_endpoint_address; |
| uint8 bm_attributes; |
| uint16 w_max_packet_size; |
| uint8 b_interval; |
| }; |
| |
| [Packed] |
| struct UsbInterfaceDescriptor { |
| uint8 b_length; |
| uint8 b_descriptor_type; |
| uint8 b_interface_number; |
| uint8 b_alternate_setting; |
| uint8 b_num_endpoints; |
| uint8 b_interface_class; |
| uint8 b_interface_sub_class; |
| uint8 b_interface_protocol; |
| uint8 i_interface; |
| }; |