/** @file
USB bus enumeration interface.
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _USB_ENUMERATION_H_
#define _USB_ENUMERATION_H_
//
// Advance the byte and bit to the next bit, adjust byte accordingly.
//
do { \
(Bit)++; \
if ((Bit) > 7) { \
(Byte)++; \
(Bit) = 0; \
} \
} while (0)
//
// Common interface used by usb bus enumeration process.
// This interface is defined to mask the difference between
// the root hub and normal hub. So, bus enumeration code
// can be shared by both root hub and normal hub
//
typedef
(*USB_HUB_INIT) (
);
//
// Get the port status. This function is required to
// ACK the port change bits although it will return
// the port changes in PortState. Bus enumeration code
// doesn't need to ACK the port change bits.
//
typedef
);
typedef
);
typedef
);
typedef
);
typedef
(*USB_HUB_RESET_PORT) (
);
typedef
(*USB_HUB_RELEASE) (
);
/**
Return the endpoint descriptor in this interface.
@param UsbIf The interface to search in.
@param EpAddr The address of the endpoint to return.
@return The endpoint descriptor or NULL.
**/
);
/**
Select an alternate setting for the interface.
Each interface can have several mutually exclusive
settings. Only one setting is active. It will
also reset its endpoints' toggle to zero.
@param IfDesc The interface descriptor to set.
@param Alternate The alternate setting number to locate.
@retval EFI_NOT_FOUND There is no setting with this alternate index.
@retval EFI_SUCCESS The interface is set to Alternate setting.
**/
);
/**
Select a new configuration for the device. Each
device may support several configurations.
@param Device The device to select configuration.
@param ConfigIndex The index of the configuration ( != 0).
@retval EFI_NOT_FOUND There is no configuration with the index.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
@retval EFI_SUCCESS The configuration is selected.
**/
);
/**
Remove the current device configuration.
@param Device The USB device to remove configuration from.
@return None.
**/
);
/**
Remove the device and all its children from the bus.
@param Device The device to remove.
@retval EFI_SUCCESS The device is removed.
**/
);
/**
Enumerate all the changed hub ports.
@param Event The event that is triggered.
@param Context The context to the event.
@return None.
**/
);
/**
Enumerate all the changed hub ports.
@param Event The event that is triggered.
@param Context The context to the event.
@return None.
**/
);
#endif