3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Constants definitions for Usb Hub
28 // Hub feature numbers
30 #define C_HUB_LOCAL_POWER 0
31 #define C_HUB_OVER_CURRENT 1
34 // Hub class code & sub class code
36 #define CLASS_CODE_HUB 0x09
37 #define SUB_CLASS_CODE_HUB 0
40 // Hub Status & Hub Change bit masks
42 #define HUB_STATUS_LOCAL_POWER 0x0001
43 #define HUB_STATUS_OVERCURRENT 0x0002
45 #define HUB_CHANGE_LOCAL_POWER 0x0001
46 #define HUB_CHANGE_OVERCURRENT 0x0002
49 // Hub Characteristics
51 #define HUB_CHAR_LPSM 0x0003
52 #define HUB_CHAR_COMPOUND 0x0004
53 #define HUB_CHAR_OCPM 0x0018
56 // Hub specific request
58 #define HUB_CLEAR_FEATURE 0x01
59 #define HUB_CLEAR_FEATURE_REQ_TYPE 0x20
61 #define HUB_CLEAR_FEATURE_PORT 0x01
62 #define HUB_CLEAR_FEATURE_PORT_REQ_TYPE 0x23
64 #define HUB_GET_BUS_STATE 0x02
65 #define HUB_GET_BUS_STATE_REQ_TYPE 0xA3
67 #define HUB_GET_DESCRIPTOR 0x06
68 #define HUB_GET_DESCRIPTOR_REQ_TYPE 0xA0
70 #define HUB_GET_HUB_STATUS 0x00
71 #define HUB_GET_HUB_STATUS_REQ_TYPE 0xA0
73 #define HUB_GET_PORT_STATUS 0x00
74 #define HUB_GET_PORT_STATUS_REQ_TYPE 0xA3
76 #define HUB_SET_DESCRIPTOR 0x07
77 #define HUB_SET_DESCRIPTOR_REQ_TYPE 0x20
79 #define HUB_SET_HUB_FEATURE 0x03
80 #define HUB_SET_HUB_FEATURE_REQ_TYPE 0x20
82 #define HUB_SET_PORT_FEATURE 0x03
83 #define HUB_SET_PORT_FEATURE_REQ_TYPE 0x23
86 typedef struct usb_hub_status
{
94 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
96 OUT UINT32
*PortStatus
101 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
108 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
114 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
115 OUT UINT32
*HubStatus
119 HubClearPortFeature (
120 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
127 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
133 IN EFI_USB_IO_PROTOCOL
*UsbIo
,
134 IN UINTN DescriptorSize
,
135 OUT EFI_USB_HUB_DESCRIPTOR
*HubDescriptor