Global variables have been moved backward ahead of functions.

Only a few cases were left due to its module structure.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6816 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jji4
2008-12-03 08:52:39 +00:00
parent 4058e906c1
commit aa79b0b379
34 changed files with 1386 additions and 797 deletions

View File

@@ -20,6 +20,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
EFI_GUID mUsbBusProtocolGuid = EFI_USB_BUS_PROTOCOL_GUID;
EFI_USB_IO_PROTOCOL mUsbIoProtocol = {
UsbIoControlTransfer,
UsbIoBulkTransfer,
UsbIoAsyncInterruptTransfer,
UsbIoSyncInterruptTransfer,
UsbIoIsochronousTransfer,
UsbIoAsyncIsochronousTransfer,
UsbIoGetDeviceDescriptor,
UsbIoGetActiveConfigDescriptor,
UsbIoGetInterfaceDescriptor,
UsbIoGetEndpointDescriptor,
UsbIoGetStringDescriptor,
UsbIoGetSupportedLanguages,
UsbIoPortReset
};
EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {
UsbBusControllerDriverSupported,
UsbBusControllerDriverStart,
UsbBusControllerDriverStop,
0xa,
NULL,
NULL
};
/**
USB_IO function to execute a control transfer. This
@@ -1037,22 +1062,6 @@ CLOSE_HC:
return Status;
}
EFI_USB_IO_PROTOCOL mUsbIoProtocol = {
UsbIoControlTransfer,
UsbIoBulkTransfer,
UsbIoAsyncInterruptTransfer,
UsbIoSyncInterruptTransfer,
UsbIoIsochronousTransfer,
UsbIoAsyncIsochronousTransfer,
UsbIoGetDeviceDescriptor,
UsbIoGetActiveConfigDescriptor,
UsbIoGetInterfaceDescriptor,
UsbIoGetEndpointDescriptor,
UsbIoGetStringDescriptor,
UsbIoGetSupportedLanguages,
UsbIoPortReset
};
/**
The USB bus driver entry pointer.
@@ -1435,12 +1444,3 @@ UsbBusControllerDriverStop (
return Status;
}
EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {
UsbBusControllerDriverSupported,
UsbBusControllerDriverStart,
UsbBusControllerDriverStop,
0xa,
NULL,
NULL
};

View File

@@ -350,6 +350,396 @@ UsbBusRecursivelyConnectWantedUsbIo (
IN EFI_USB_BUS_PROTOCOL *UsbBusId
);
/**
USB_IO function to execute a control transfer. This
function will execute the USB transfer. If transfer
successes, it will sync the internal state of USB bus
with device state.
@param This The USB_IO instance
@param Request The control transfer request
@param Direction Direction for data stage
@param Timeout The time to wait before timeout
@param Data The buffer holding the data
@param DataLength Then length of the data
@param UsbStatus USB result
@retval EFI_INVALID_PARAMETER The parameters are invalid
@retval EFI_SUCCESS The control transfer succeded.
@retval Others Failed to execute the transfer
**/
EFI_STATUS
EFIAPI
UsbIoControlTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN EFI_USB_DEVICE_REQUEST *Request,
IN EFI_USB_DATA_DIRECTION Direction,
IN UINT32 Timeout,
IN OUT VOID *Data, OPTIONAL
IN UINTN DataLength, OPTIONAL
OUT UINT32 *UsbStatus
);
/**
Execute a bulk transfer to the device endpoint.
@param This The USB IO instance.
@param Endpoint The device endpoint.
@param Data The data to transfer.
@param DataLength The length of the data to transfer.
@param Timeout Time to wait before timeout.
@param UsbStatus The result of USB transfer.
@retval EFI_SUCCESS The bulk transfer is OK.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval Others Failed to execute transfer, reason returned in
UsbStatus.
**/
EFI_STATUS
EFIAPI
UsbIoBulkTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 Endpoint,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN UINTN Timeout,
OUT UINT32 *UsbStatus
);
/**
Execute a synchronous interrupt transfer.
@param This The USB IO instance.
@param Endpoint The device endpoint.
@param Data The data to transfer.
@param DataLength The length of the data to transfer.
@param Timeout Time to wait before timeout.
@param UsbStatus The result of USB transfer.
@retval EFI_SUCCESS The synchronous interrupt transfer is OK.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval Others Failed to execute transfer, reason returned in
UsbStatus.
**/
EFI_STATUS
EFIAPI
UsbIoSyncInterruptTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 Endpoint,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN UINTN Timeout,
OUT UINT32 *UsbStatus
);
/**
Queue a new asynchronous interrupt transfer, or remove the old
request if (IsNewTransfer == FALSE).
@param This The USB_IO instance.
@param Endpoint The device endpoint.
@param IsNewTransfer Whether this is a new request, if it's old, remove
the request.
@param PollInterval The interval to poll the transfer result, (in ms).
@param DataLength The length of perodic data transfer.
@param Callback The function to call periodicaly when transfer is
ready.
@param Context The context to the callback.
@retval EFI_SUCCESS New transfer is queued or old request is removed.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval Others Failed to queue the new request or remove the old
request.
**/
EFI_STATUS
EFIAPI
UsbIoAsyncInterruptTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 Endpoint,
IN BOOLEAN IsNewTransfer,
IN UINTN PollInterval, OPTIONAL
IN UINTN DataLength, OPTIONAL
IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, OPTIONAL
IN VOID *Context OPTIONAL
);
/**
Execute a synchronous isochronous transfer.
@param This The USB IO instance.
@param DeviceEndpoint The device endpoint.
@param Data The data to transfer.
@param DataLength The length of the data to transfer.
@param UsbStatus The result of USB transfer.
@retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.
**/
EFI_STATUS
EFIAPI
UsbIoIsochronousTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN UINTN DataLength,
OUT UINT32 *Status
);
/**
Queue an asynchronous isochronous transfer.
@param This The USB_IO instance.
@param DeviceEndpoint The device endpoint.
@param Data The data to transfer.
@param DataLength The length of perodic data transfer.
@param IsochronousCallBack The function to call periodicaly when transfer is
ready.
@param Context The context to the callback.
@retval EFI_UNSUPPORTED Currently isochronous transfer isn't supported.
**/
EFI_STATUS
EFIAPI
UsbIoAsyncIsochronousTransfer (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN UINTN DataLength,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
IN VOID *Context OPTIONAL
);
/**
Retrieve the device descriptor of the device.
@param This The USB IO instance.
@param Descriptor The variable to receive the device descriptor.
@retval EFI_SUCCESS The device descriptor is returned.
@retval EFI_INVALID_PARAMETER The parameter is invalid.
**/
EFI_STATUS
EFIAPI
UsbIoGetDeviceDescriptor (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor
);
/**
Return the configuration descriptor of the current active configuration.
@param This The USB IO instance.
@param Descriptor The USB configuration descriptor.
@retval EFI_SUCCESS The active configuration descriptor is returned.
@retval EFI_INVALID_PARAMETER Some parameter is invalid.
@retval EFI_NOT_FOUND Currently no active configuration is selected.
**/
EFI_STATUS
EFIAPI
UsbIoGetActiveConfigDescriptor (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor
);
/**
Retrieve the active interface setting descriptor for this USB IO instance.
@param This The USB IO instance.
@param Descriptor The variable to receive active interface setting.
@retval EFI_SUCCESS The active interface setting is returned.
@retval EFI_INVALID_PARAMETER Some parameter is invalid.
**/
EFI_STATUS
EFIAPI
UsbIoGetInterfaceDescriptor (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor
);
/**
Retrieve the endpoint descriptor from this interface setting.
@param This The USB IO instance.
@param Index The index (start from zero) of the endpoint to
retrieve.
@param Descriptor The variable to receive the descriptor.
@retval EFI_SUCCESS The endpoint descriptor is returned.
@retval EFI_INVALID_PARAMETER Some parameter is invalid.
**/
EFI_STATUS
EFIAPI
UsbIoGetEndpointDescriptor (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 Index,
OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor
);
/**
Retrieve the supported language ID table from the device.
@param This The USB IO instance.
@param LangIDTable The table to return the language IDs.
@param TableSize The number of supported languanges.
@retval EFI_SUCCESS The language ID is return.
**/
EFI_STATUS
EFIAPI
UsbIoGetSupportedLanguages (
IN EFI_USB_IO_PROTOCOL *This,
OUT UINT16 **LangIDTable,
OUT UINT16 *TableSize
);
/**
Retrieve an indexed string in the language of LangID.
@param This The USB IO instance.
@param LangID The language ID of the string to retrieve.
@param StringIndex The index of the string.
@param String The variable to receive the string.
@retval EFI_SUCCESS The string is returned.
@retval EFI_NOT_FOUND No such string existed.
**/
EFI_STATUS
EFIAPI
UsbIoGetStringDescriptor (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT16 LangID,
IN UINT8 StringIndex,
OUT CHAR16 **String
);
/**
Reset the device, then if that succeeds, reconfigure the
device with its address and current active configuration.
@param This The USB IO instance.
@retval EFI_SUCCESS The device is reset and configured.
@retval Others Failed to reset the device.
**/
EFI_STATUS
EFIAPI
UsbIoPortReset (
IN EFI_USB_IO_PROTOCOL *This
);
/**
Install Usb Bus Protocol on host controller, and start the Usb bus.
@param This The USB bus driver binding instance.
@param Controller The controller to check.
@param RemainingDevicePath The remaining device patch.
@retval EFI_SUCCESS The controller is controlled by the usb bus.
@retval EFI_ALREADY_STARTED The controller is already controlled by the usb bus.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
**/
EFI_STATUS
EFIAPI
UsbBusBuildProtocol (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
The USB bus driver entry pointer.
@param ImageHandle The driver image handle.
@param SystemTable The system table.
@return EFI_SUCCESS The component name protocol is installed.
@return Others Failed to init the usb driver.
**/
EFI_STATUS
EFIAPI
UsbBusDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Check whether USB bus driver support this device.
@param This The USB bus driver binding protocol.
@param Controller The controller handle to check.
@param RemainingDevicePath The remaining device path.
@retval EFI_SUCCESS The bus supports this controller.
@retval EFI_UNSUPPORTED This device isn't supported.
**/
EFI_STATUS
EFIAPI
UsbBusControllerDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Start to process the controller.
@param This The USB bus driver binding instance.
@param Controller The controller to check.
@param RemainingDevicePath The remaining device patch.
@retval EFI_SUCCESS The controller is controlled by the usb bus.
@retval EFI_ALREADY_STARTED The controller is already controlled by the usb
bus.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
**/
EFI_STATUS
EFIAPI
UsbBusControllerDriverStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Stop handle the controller by this USB bus driver.
@param This The USB bus driver binding protocol.
@param Controller The controller to release.
@param NumberOfChildren The child of USB bus that opened controller
BY_CHILD.
@param ChildHandleBuffer The array of child handle.
@retval EFI_SUCCESS The controller or children are stopped.
@retval EFI_DEVICE_ERROR Failed to stop the driver.
**/
EFI_STATUS
EFIAPI
UsbBusControllerDriverStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
extern EFI_USB_IO_PROTOCOL mUsbIoProtocol;
extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName;

View File

@@ -15,6 +15,33 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UsbBus.h"
//
// Array that maps the change bit to feature value which is
// used to clear these change bit. USB HUB API will clear
// these change bit automatically. For non-root hub, these
// bits determine whether hub will report the port in changed
// bit maps.
//
#define USB_HUB_MAP_SIZE 5
USB_CHANGE_FEATURE_MAP mHubFeatureMap[USB_HUB_MAP_SIZE] = {
{USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},
{USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},
{USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},
{USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},
{USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},
};
#define USB_ROOT_HUB_MAP_SIZE 5
USB_CHANGE_FEATURE_MAP mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {
{USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},
{USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},
{USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},
{USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},
{USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},
};
//
// USB hub class specific requests. Although USB hub
// is related to an interface, these requests are sent
@@ -576,32 +603,6 @@ UsbOnHubInterrupt (
return EFI_SUCCESS;
}
//
// Array that maps the change bit to feature value which is
// used to clear these change bit. USB HUB API will clear
// these change bit automatically. For non-root hub, these
// bits determine whether hub will report the port in changed
// bit maps.
//
#define USB_HUB_MAP_SIZE 5
USB_CHANGE_FEATURE_MAP mHubFeatureMap[USB_HUB_MAP_SIZE] = {
{USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},
{USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},
{USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},
{USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},
{USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},
};
#define USB_ROOT_HUB_MAP_SIZE 5
USB_CHANGE_FEATURE_MAP mRootHubFeatureMap[USB_ROOT_HUB_MAP_SIZE] = {
{USB_PORT_STAT_C_CONNECTION, EfiUsbPortConnectChange},
{USB_PORT_STAT_C_ENABLE, EfiUsbPortEnableChange},
{USB_PORT_STAT_C_SUSPEND, EfiUsbPortSuspendChange},
{USB_PORT_STAT_C_OVERCURRENT, EfiUsbPortOverCurrentChange},
{USB_PORT_STAT_C_RESET, EfiUsbPortResetChange},
};

View File

@@ -130,40 +130,6 @@ UINT8 KeyboardLayoutTable[USB_KEYCODE_MAX_MAKE + 8][5] = {
{EfiKeyA3, 0, 0, EFI_RIGHT_LOGO_MODIFIER, 0}, // 0xe7
};
/**
Initialize KeyConvertionTable by using default keyboard layout.
@param UsbKeyboardDevice The USB_KB_DEV instance.
@retval None.
**/
VOID
EFIAPI
LoadDefaultKeyboardLayout (
IN USB_KB_DEV *UsbKeyboardDevice
)
{
UINTN Index;
EFI_KEY_DESCRIPTOR *KeyDescriptor;
//
// Construct KeyConvertionTable by default keyboard layout
//
KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];
for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {
KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];
KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];
KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];
KeyDescriptor->AltGrUnicode = 0;
KeyDescriptor->ShiftedAltGrUnicode = 0;
KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];
KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];
KeyDescriptor++;
}
}
//
// EFI_KEY to USB Scan Code convertion table
//
@@ -330,6 +296,40 @@ KB_MODIFIER KB_Mod[8] = {
};
/**
Initialize KeyConvertionTable by using default keyboard layout.
@param UsbKeyboardDevice The USB_KB_DEV instance.
@retval None.
**/
VOID
EFIAPI
LoadDefaultKeyboardLayout (
IN USB_KB_DEV *UsbKeyboardDevice
)
{
UINTN Index;
EFI_KEY_DESCRIPTOR *KeyDescriptor;
//
// Construct KeyConvertionTable by default keyboard layout
//
KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];
for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {
KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];
KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];
KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];
KeyDescriptor->AltGrUnicode = 0;
KeyDescriptor->ShiftedAltGrUnicode = 0;
KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];
KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];
KeyDescriptor++;
}
}
/**
Uses USB I/O to check whether the device is a USB Keyboard device.

View File

@@ -25,41 +25,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "mousehid.h"
//
// Prototypes
// Driver model protocol interface
//
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
EFI_GUID gEfiUsbMouseAbsolutePointerDriverGuid = {
0xa579f729, 0xa71d, 0x4b45, { 0xbe, 0xd7, 0xd, 0xb0, 0xa8, 0x7c, 0x3e, 0x8d }

View File

@@ -103,4 +103,41 @@ MouseAbsolutePointerReportStatusCode (
IN EFI_STATUS_CODE_VALUE Value
);
//
// Prototypes
// Driver model protocol interface
//
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
EFI_STATUS
EFIAPI
USBMouseAbsolutePointerDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
#endif

View File

@@ -22,86 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UsbMouse.h"
#include "MouseHid.h"
/**
The USB Mouse driver entry pointer.
@param ImageHandle The driver image handle.
@param SystemTable The system table.
@return EFI_SUCCESS The component name protocol is installed.
@return Others Failed to init the usb driver.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Test to see if this driver supports ControllerHandle. Any ControllerHandle
that has UsbIoProtocol installed will be supported.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@param RemainingDevicePath Not used.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Starting the Usb Mouse Driver.
@param This Protocol instance pointer.
@param Controller Handle of device to test
@param RemainingDevicePath Not used
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
@retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.
@retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.
@retval EFI_ALREADY_STARTED Thios driver has been started.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Stop this driver on ControllerHandle. Support stoping any child handles
created by this driver.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on.
@param NumberOfChildren Number of Children in the ChildHandleBuffer.
@param ChildHandleBuffer List of handles for the children we need to stop.
@retval EFI_SUCCESS The controller or children are stopped.
@retval Other Failed to stop the driver.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
EFI_GUID gEfiUsbMouseDriverGuid = {
0x290156b5, 0x6a05, 0x4ac0, {0xb8, 0x0, 0x51, 0x27, 0x55, 0xad, 0x14, 0x29}

View File

@@ -115,4 +115,85 @@ MouseReportStatusCode (
IN EFI_STATUS_CODE_VALUE Value
);
/**
The USB Mouse driver entry pointer.
@param ImageHandle The driver image handle.
@param SystemTable The system table.
@return EFI_SUCCESS The component name protocol is installed.
@return Others Failed to init the usb driver.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Test to see if this driver supports ControllerHandle. Any ControllerHandle
that has UsbIoProtocol installed will be supported.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@param RemainingDevicePath Not used.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Starting the Usb Mouse Driver.
@param This Protocol instance pointer.
@param Controller Handle of device to test
@param RemainingDevicePath Not used
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
@retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.
@retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.
@retval EFI_ALREADY_STARTED Thios driver has been started.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Stop this driver on ControllerHandle. Support stoping any child handles
created by this driver.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on.
@param NumberOfChildren Number of Children in the ChildHandleBuffer.
@param ChildHandleBuffer List of handles for the children we need to stop.
@retval EFI_SUCCESS The controller or children are stopped.
@retval Other Failed to stop the driver.
**/
EFI_STATUS
EFIAPI
USBMouseDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
#endif