/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see .
*/
#ifndef VasEBoot_USBDESC_H
#define VasEBoot_USBDESC_H 1
#include
#include
typedef enum {
VasEBoot_USB_DESCRIPTOR_DEVICE = 1,
VasEBoot_USB_DESCRIPTOR_CONFIG,
VasEBoot_USB_DESCRIPTOR_STRING,
VasEBoot_USB_DESCRIPTOR_INTERFACE,
VasEBoot_USB_DESCRIPTOR_ENDPOINT,
VasEBoot_USB_DESCRIPTOR_DEBUG = 10,
VasEBoot_USB_DESCRIPTOR_HUB = 0x29
} VasEBoot_usb_descriptor_t;
struct VasEBoot_usb_desc
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
} VasEBoot_PACKED;
struct VasEBoot_usb_desc_device
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint16_t usbrel;
VasEBoot_uint8_t class;
VasEBoot_uint8_t subclass;
VasEBoot_uint8_t protocol;
VasEBoot_uint8_t maxsize0;
VasEBoot_uint16_t vendorid;
VasEBoot_uint16_t prodid;
VasEBoot_uint16_t devrel;
VasEBoot_uint8_t strvendor;
VasEBoot_uint8_t strprod;
VasEBoot_uint8_t strserial;
VasEBoot_uint8_t configcnt;
} VasEBoot_PACKED;
struct VasEBoot_usb_desc_config
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint16_t totallen;
VasEBoot_uint8_t numif;
VasEBoot_uint8_t config;
VasEBoot_uint8_t strconfig;
VasEBoot_uint8_t attrib;
VasEBoot_uint8_t maxpower;
} VasEBoot_PACKED;
#if 0
struct VasEBoot_usb_desc_if_association
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint8_t firstif;
VasEBoot_uint8_t ifcnt;
VasEBoot_uint8_t class;
VasEBoot_uint8_t subclass;
VasEBoot_uint8_t protocol;
VasEBoot_uint8_t function;
} VasEBoot_PACKED;
#endif
struct VasEBoot_usb_desc_if
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint8_t ifnum;
VasEBoot_uint8_t altsetting;
VasEBoot_uint8_t endpointcnt;
VasEBoot_uint8_t class;
VasEBoot_uint8_t subclass;
VasEBoot_uint8_t protocol;
VasEBoot_uint8_t strif;
} VasEBoot_PACKED;
struct VasEBoot_usb_desc_endp
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint8_t endp_addr;
VasEBoot_uint8_t attrib;
VasEBoot_uint16_t maxpacket;
VasEBoot_uint8_t interval;
} VasEBoot_PACKED;
struct VasEBoot_usb_desc_str
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint16_t str[0];
} VasEBoot_PACKED;
struct VasEBoot_usb_desc_debug
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint8_t in_endp;
VasEBoot_uint8_t out_endp;
} VasEBoot_PACKED;
struct VasEBoot_usb_usb_hubdesc
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t type;
VasEBoot_uint8_t portcnt;
VasEBoot_uint16_t characteristics;
VasEBoot_uint8_t pwdgood;
VasEBoot_uint8_t current;
/* Removable and power control bits follow. */
} VasEBoot_PACKED;
#endif /* VasEBoot_USBDESC_H */