Improve coding style in MdeModulePkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9793 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Usb Bus Driver Binding and Bus IO Protocol.
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation
|
||||
Copyright (c) 2004 - 2010, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -47,81 +47,83 @@ typedef struct _USB_HUB_API USB_HUB_API;
|
||||
#include "UsbHub.h"
|
||||
#include "UsbEnumer.h"
|
||||
|
||||
typedef enum {
|
||||
USB_MAX_LANG_ID = 16,
|
||||
USB_MAX_INTERFACE = 16,
|
||||
USB_MAX_DEVICES = 128,
|
||||
//
|
||||
// USB bus timeout experience values
|
||||
//
|
||||
|
||||
USB_BUS_1_MILLISECOND = 1000,
|
||||
#define USB_MAX_LANG_ID 16
|
||||
#define USB_MAX_INTERFACE 16
|
||||
#define USB_MAX_DEVICES 128
|
||||
|
||||
//
|
||||
// Roothub and hub's polling interval, set by experience,
|
||||
// The unit of roothub is 100us, means 1s as interval, and
|
||||
// the unit of hub is 1ms, means 64ms as interval.
|
||||
//
|
||||
USB_ROOTHUB_POLL_INTERVAL = 1000 * 10000U,
|
||||
USB_HUB_POLL_INTERVAL = 64,
|
||||
#define USB_BUS_1_MILLISECOND 1000
|
||||
|
||||
//
|
||||
// Wait for port stable to work, refers to specification
|
||||
// [USB20-9.1.2]
|
||||
//
|
||||
USB_WAIT_PORT_STABLE_STALL = 100 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Roothub and hub's polling interval, set by experience,
|
||||
// The unit of roothub is 100us, means 1s as interval, and
|
||||
// the unit of hub is 1ms, means 64ms as interval.
|
||||
//
|
||||
#define USB_ROOTHUB_POLL_INTERVAL (1000 * 10000U)
|
||||
#define USB_HUB_POLL_INTERVAL 64
|
||||
|
||||
//
|
||||
// Wait for port statue reg change, set by experience
|
||||
//
|
||||
USB_WAIT_PORT_STS_CHANGE_STALL = 5 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for port stable to work, refers to specification
|
||||
// [USB20-9.1.2]
|
||||
//
|
||||
#define USB_WAIT_PORT_STABLE_STALL (100 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for set device address, refers to specification
|
||||
// [USB20-9.2.6.3, it says 2ms]
|
||||
//
|
||||
USB_SET_DEVICE_ADDRESS_STALL = 20 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for port statue reg change, set by experience
|
||||
//
|
||||
#define USB_WAIT_PORT_STS_CHANGE_STALL (5 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for retry max packet size, set by experience
|
||||
//
|
||||
USB_RETRY_MAX_PACK_SIZE_STALL = 100 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for set device address, refers to specification
|
||||
// [USB20-9.2.6.3, it says 2ms]
|
||||
//
|
||||
#define USB_SET_DEVICE_ADDRESS_STALL (20 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for hub port power-on, refers to specification
|
||||
// [USB20-11.23.2]
|
||||
//
|
||||
USB_SET_PORT_POWER_STALL = 2 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for retry max packet size, set by experience
|
||||
//
|
||||
#define USB_RETRY_MAX_PACK_SIZE_STALL (100 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for port reset, refers to specification
|
||||
// [USB20-7.1.7.5, it says 10ms for hub and 50ms for
|
||||
// root hub]
|
||||
//
|
||||
USB_SET_PORT_RESET_STALL = 20 * USB_BUS_1_MILLISECOND,
|
||||
USB_SET_ROOT_PORT_RESET_STALL = 50 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for hub port power-on, refers to specification
|
||||
// [USB20-11.23.2]
|
||||
//
|
||||
#define USB_SET_PORT_POWER_STALL (2 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for clear roothub port reset, set by experience
|
||||
//
|
||||
USB_CLR_ROOT_PORT_RESET_STALL = 20 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for port reset, refers to specification
|
||||
// [USB20-7.1.7.5, it says 10ms for hub and 50ms for
|
||||
// root hub]
|
||||
//
|
||||
#define USB_SET_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
|
||||
#define USB_SET_ROOT_PORT_RESET_STALL (50 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Wait for set roothub port enable, set by experience
|
||||
//
|
||||
USB_SET_ROOT_PORT_ENABLE_STALL = 20 * USB_BUS_1_MILLISECOND,
|
||||
//
|
||||
// Wait for clear roothub port reset, set by experience
|
||||
//
|
||||
#define USB_CLR_ROOT_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Send general device request timeout.
|
||||
//
|
||||
// The USB Specification 2.0, section 11.24.1 recommends a value of
|
||||
// 50 milliseconds. We use a value of 100 milliseconds to work
|
||||
// around slower hubs and devices.
|
||||
//
|
||||
USB_GENERAL_DEVICE_REQUEST_TIMEOUT = 100,
|
||||
//
|
||||
// Wait for set roothub port enable, set by experience
|
||||
//
|
||||
#define USB_SET_ROOT_PORT_ENABLE_STALL (20 * USB_BUS_1_MILLISECOND)
|
||||
|
||||
//
|
||||
// Send clear feature request timeout, set by experience
|
||||
//
|
||||
USB_CLEAR_FEATURE_REQUEST_TIMEOUT = 10
|
||||
}USB_BUS_TIMEOUT_EXPERIENCE_VALUE;
|
||||
//
|
||||
// Send general device request timeout.
|
||||
//
|
||||
// The USB Specification 2.0, section 11.24.1 recommends a value of
|
||||
// 50 milliseconds. We use a value of 100 milliseconds to work
|
||||
// around slower hubs and devices.
|
||||
//
|
||||
#define USB_GENERAL_DEVICE_REQUEST_TIMEOUT 100
|
||||
|
||||
//
|
||||
// Send clear feature request timeout, set by experience
|
||||
//
|
||||
#define USB_CLEAR_FEATURE_REQUEST_TIMEOUT 10
|
||||
|
||||
//
|
||||
// Bus raises TPL to TPL_NOTIFY to serialize all its operations
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Manage Usb Descriptor List
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
Copyright (c) 2007 - 2010, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -16,9 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef _USB_DESCRIPTOR_H_
|
||||
#define _USB_DESCRIPTOR_H_
|
||||
|
||||
typedef enum {
|
||||
USB_MAX_INTERFACE_SETTING = 8
|
||||
}USB_INTERFACE_SETTING_MAX;
|
||||
#define USB_MAX_INTERFACE_SETTING 8
|
||||
|
||||
//
|
||||
// The RequestType in EFI_USB_DEVICE_REQUEST is composed of
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The definition for USB hub.
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
Copyright (c) 2007 - 2010, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -21,72 +21,65 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define USB_ENDPOINT_ADDR(EpAddr) ((EpAddr) & 0x7F)
|
||||
#define USB_ENDPOINT_TYPE(Desc) ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)
|
||||
|
||||
typedef enum {
|
||||
USB_DESC_TYPE_HUB = 0x29,
|
||||
|
||||
//
|
||||
// Hub class control transfer target
|
||||
//
|
||||
USB_HUB_TARGET_HUB = 0,
|
||||
USB_HUB_TARGET_PORT = 3,
|
||||
#define USB_DESC_TYPE_HUB 0x29
|
||||
//
|
||||
// Hub class control transfer target
|
||||
//
|
||||
#define USB_HUB_TARGET_HUB 0
|
||||
#define USB_HUB_TARGET_PORT 3
|
||||
//
|
||||
// HUB class specific contrl transfer request type
|
||||
//
|
||||
#define USB_HUB_REQ_GET_STATUS 0
|
||||
#define USB_HUB_REQ_CLEAR_FEATURE 1
|
||||
#define USB_HUB_REQ_SET_FEATURE 3
|
||||
#define USB_HUB_REQ_GET_DESC 6
|
||||
#define USB_HUB_REQ_SET_DESC 7
|
||||
#define USB_HUB_REQ_CLEAR_TT 8
|
||||
#define USB_HUB_REQ_RESET_TT 9
|
||||
#define USB_HUB_REQ_GET_TT_STATE 10
|
||||
#define USB_HUB_REQ_STOP_TT 11
|
||||
//
|
||||
// USB hub class feature selector
|
||||
//
|
||||
#define USB_HUB_C_HUB_LOCAL_POWER 0
|
||||
#define USB_HUB_C_HUB_OVER_CURRENT 1
|
||||
#define USB_HUB_PORT_CONNECTION 0
|
||||
#define USB_HUB_PORT_ENABLE 1
|
||||
#define USB_HUB_PORT_SUSPEND 2
|
||||
#define USB_HUB_PORT_OVER_CURRENT 3
|
||||
#define USB_HUB_PORT_RESET 4
|
||||
#define USB_HUB_PORT_POWER 8
|
||||
#define USB_HUB_PORT_LOW_SPEED 9
|
||||
#define USB_HUB_C_PORT_CONNECT 16
|
||||
#define USB_HUB_C_PORT_ENABLE 17
|
||||
#define USB_HUB_C_PORT_SUSPEND 18
|
||||
#define USB_HUB_C_PORT_OVER_CURRENT 19
|
||||
#define USB_HUB_C_PORT_RESET 20
|
||||
#define USB_HUB_PORT_TEST 21
|
||||
#define USB_HUB_PORT_INDICATOR 22
|
||||
//
|
||||
// USB hub power control method. In gang power control
|
||||
//
|
||||
#define USB_HUB_GANG_POWER_CTRL 0
|
||||
#define USB_HUB_PORT_POWER_CTRL 0x01
|
||||
//
|
||||
// USB hub status bits
|
||||
//
|
||||
#define USB_HUB_STAT_LOCAL_POWER 0x01
|
||||
#define USB_HUB_STAT_OVER_CURRENT 0x02
|
||||
#define USB_HUB_STAT_C_LOCAL_POWER 0x01
|
||||
#define USB_HUB_STAT_C_OVER_CURRENT 0x02
|
||||
|
||||
//
|
||||
// HUB class specific contrl transfer request type
|
||||
//
|
||||
USB_HUB_REQ_GET_STATUS = 0,
|
||||
USB_HUB_REQ_CLEAR_FEATURE = 1,
|
||||
USB_HUB_REQ_SET_FEATURE = 3,
|
||||
USB_HUB_REQ_GET_DESC = 6,
|
||||
USB_HUB_REQ_SET_DESC = 7,
|
||||
USB_HUB_REQ_CLEAR_TT = 8,
|
||||
USB_HUB_REQ_RESET_TT = 9,
|
||||
USB_HUB_REQ_GET_TT_STATE = 10,
|
||||
USB_HUB_REQ_STOP_TT = 11,
|
||||
#define USB_HUB_CLASS_CODE 0x09
|
||||
#define USB_HUB_SUBCLASS_CODE 0x00
|
||||
|
||||
|
||||
//
|
||||
// USB hub class feature selector
|
||||
//
|
||||
USB_HUB_C_HUB_LOCAL_POWER = 0,
|
||||
USB_HUB_C_HUB_OVER_CURRENT = 1,
|
||||
USB_HUB_PORT_CONNECTION = 0,
|
||||
USB_HUB_PORT_ENABLE = 1,
|
||||
USB_HUB_PORT_SUSPEND = 2,
|
||||
USB_HUB_PORT_OVER_CURRENT = 3,
|
||||
USB_HUB_PORT_RESET = 4,
|
||||
USB_HUB_PORT_POWER = 8,
|
||||
USB_HUB_PORT_LOW_SPEED = 9,
|
||||
USB_HUB_C_PORT_CONNECT = 16,
|
||||
USB_HUB_C_PORT_ENABLE = 17,
|
||||
USB_HUB_C_PORT_SUSPEND = 18,
|
||||
USB_HUB_C_PORT_OVER_CURRENT = 19,
|
||||
USB_HUB_C_PORT_RESET = 20,
|
||||
USB_HUB_PORT_TEST = 21,
|
||||
USB_HUB_PORT_INDICATOR = 22,
|
||||
|
||||
//
|
||||
// USB hub power control method. In gang power control
|
||||
//
|
||||
USB_HUB_GANG_POWER_CTRL = 0,
|
||||
USB_HUB_PORT_POWER_CTRL = 0x01,
|
||||
|
||||
//
|
||||
// USB hub status bits
|
||||
//
|
||||
USB_HUB_STAT_LOCAL_POWER = 0x01,
|
||||
USB_HUB_STAT_OVER_CURRENT = 0x02,
|
||||
USB_HUB_STAT_C_LOCAL_POWER = 0x01,
|
||||
USB_HUB_STAT_C_OVER_CURRENT = 0x02,
|
||||
|
||||
USB_HUB_CLASS_CODE = 0x09,
|
||||
USB_HUB_SUBCLASS_CODE = 0x00,
|
||||
|
||||
//
|
||||
// Host software return timeout if port status doesn't change
|
||||
// after 500ms(LOOP * STALL = 100 * 5ms), set by experience
|
||||
//
|
||||
USB_WAIT_PORT_STS_CHANGE_LOOP = 100
|
||||
}USB_HUB_FLAGS_VALUE;
|
||||
//
|
||||
// Host software return timeout if port status doesn't change
|
||||
// after 500ms(LOOP * STALL = 100 * 5ms), set by experience
|
||||
//
|
||||
#define USB_WAIT_PORT_STS_CHANGE_LOOP 100
|
||||
|
||||
#pragma pack(1)
|
||||
//
|
||||
|
Reference in New Issue
Block a user