diff options
author | Todd Broch <tbroch@chromium.org> | 2014-10-03 17:22:42 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-11 02:22:23 +0000 |
commit | 44e4f7cfe7953198091cfd5e39bf339a770138dc (patch) | |
tree | bce95eac678d68d40be59276b4aaf94a488cea25 /include/usb_bb.h | |
parent | 4d81320ed8b5f8231759d1608183a0daf233ea45 (diff) | |
download | chrome-ec-44e4f7cfe7953198091cfd5e39bf339a770138dc.tar.gz |
usb: Groundwork for USB BOS & Billboard class descriptors.
The BOS (Binary Device Object Store) descriptor was added to the USB
specification (3.0) to allow a richer set of device capability
specific descriptors.
The Billboard class is meant to expose (read-only) the status of USB
devices capable of alternate mode functions. It's required to use the
BOS descriptor type and at a high level looks like:
- BOS Device Descriptor (5bytes)
- Container ID Device Capability Descriptor (20bytes)
- Billboard Device Capability Descriptor (44byte + 4 * numSVIDs)
This CL adds:
1. Ability for Get Descriptor on BOS descriptors. Note hidden behind
CONFIG_USB_BOS as these descriptors change USB device requirements
to:
- bcdUSB >= 0201
- no interface descriptors
2. structures for all BOS, Container & Billboard descriptor elements
complete w/ CamelCase.
BRANCH=none
BUG=chrome-os-partner:32652
TEST=compiles with CONFIG_USB & CONFIG_USB_BOS enabled.
Change-Id: I1b24bc728f2ebba7d91840801d2ebe576e240e7c
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221570
Diffstat (limited to 'include/usb_bb.h')
-rw-r--r-- | include/usb_bb.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/usb_bb.h b/include/usb_bb.h new file mode 100644 index 0000000000..56864a6a1d --- /dev/null +++ b/include/usb_bb.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * USB billboard definitions. + */ + +#ifndef USB_BB_H +#define USB_BB_H + +/* per Billboard Device Class Spec Revision 1.0 */ + +/* device descriptor fields */ +#define USB_BB_BCDUSB_MIN 0x0201 /* v2.01 minimum */ +#define USB_BB_SUBCLASS 0x00 +#define USB_BB_PROTOCOL 0x00 +#define USB_BB_EP0_PACKET_SIZE 8 +#define USB_BB_CAP_DESC_TYPE 0x0d + + +#define USB_BB_CAPS_SVID_SIZE 4 +struct usb_bb_caps_svid_descriptor { + uint16_t wSVID; + uint8_t bAlternateMode; + uint8_t iAlternateModeString; +} __packed; + +#define USB_BB_CAPS_BASE_SIZE 44 +struct usb_bb_caps_base_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t iAdditionalInfoURL; + uint8_t bNumberOfAlternateModes; + uint8_t bPreferredAlternateMode; + uint16_t VconnPower; + uint8_t bmConfigured[32]; /* 2b per SVID w/ 128 SVIDs allowed. */ + uint32_t bReserved; /* SBZ */ +} __packed; + + +#define USB_BB_VCONN_PWRON(x) (x << 15) +#define USB_BB_VCONN_PWR_1W 0 +#define USB_BB_VCONN_PWR_1p5W 1 +#define USB_BB_VCONN_PWR_2W 2 +#define USB_BB_VCONN_PWR_3W 3 +#define USB_BB_VCONN_PWR_4W 4 +#define USB_BB_VCONN_PWR_5W 5 +#define USB_BB_VCONN_PWR_6W 6 +/* Note, 7W (111b) is reserved */ + + +#endif /* USB_BB_H */ + |