10#ifndef _PEI_HUB_PEIM_H_
11#define _PEI_HUB_PEIM_H_
16#define C_HUB_LOCAL_POWER 0
17#define C_HUB_OVER_CURRENT 1
22#define CLASS_CODE_HUB 0x09
23#define SUB_CLASS_CODE_HUB 0
28#define HUB_STATUS_LOCAL_POWER 0x0001
29#define HUB_STATUS_OVERCURRENT 0x0002
31#define HUB_CHANGE_LOCAL_POWER 0x0001
32#define HUB_CHANGE_OVERCURRENT 0x0002
37#define HUB_CHAR_LPSM 0x0003
38#define HUB_CHAR_COMPOUND 0x0004
39#define HUB_CHAR_OCPM 0x0018
45#define USB_HUB_CLEAR_FEATURE 0x01
46#define USB_HUB_CLEAR_FEATURE_REQ_TYPE 0x20
48#define USB_HUB_CLEAR_FEATURE_PORT 0x01
49#define USB_HUB_CLEAR_FEATURE_PORT_REQ_TYPE 0x23
51#define USB_HUB_GET_BUS_STATE 0x02
52#define USB_HUB_GET_BUS_STATE_REQ_TYPE 0xA3
54#define USB_HUB_GET_DESCRIPTOR 0x06
55#define USB_HUB_GET_DESCRIPTOR_REQ_TYPE 0xA0
57#define USB_HUB_GET_HUB_STATUS 0x00
58#define USB_HUB_GET_HUB_STATUS_REQ_TYPE 0xA0
60#define USB_HUB_GET_PORT_STATUS 0x00
61#define USB_HUB_GET_PORT_STATUS_REQ_TYPE 0xA3
63#define USB_HUB_SET_DESCRIPTOR 0x07
64#define USB_HUB_SET_DESCRIPTOR_REQ_TYPE 0x20
66#define USB_HUB_SET_HUB_FEATURE 0x03
67#define USB_HUB_SET_HUB_FEATURE_REQ_TYPE 0x20
69#define USB_HUB_SET_PORT_FEATURE 0x03
70#define USB_HUB_SET_PORT_FEATURE_REQ_TYPE 0x23
72#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
73#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
75#define USB_HUB_REQ_SET_DEPTH 12
86 UINT8 HubCharacteristics[2];
88 UINT8 HubContrCurrent;
89 UINT8 Filler[MAXBYTES];
94 UINT16 HubChangeStatus;
117 OUT UINT32 *PortStatus
157 OUT UINT32 *HubStatus
EFI_STATUS PeiGetHubDescriptor(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINTN DescriptorSize, OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor)
EFI_STATUS PeiHubClearPortFeature(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, IN UINT8 Value)
EFI_STATUS PeiDoHubConfig(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice)
VOID PeiResetHubPort(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 PortNum)
EFI_STATUS PeiHubGetHubStatus(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, OUT UINT32 *HubStatus)
EFI_STATUS PeiHubClearHubFeature(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Value)
EFI_STATUS PeiHubGetPortStatus(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, OUT UINT32 *PortStatus)
EFI_STATUS PeiHubSetPortFeature(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, IN UINT8 Value)