mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
modify coding style to pass ecc tool
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5563 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4ad4145108
commit
bb80e3b213
@ -1,6 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2004 - 2007, Intel Corporation
|
UEFI Component Name(2) protocol implementation for Usb Mouse driver.
|
||||||
|
|
||||||
|
Copyright (c) 2004 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -9,13 +11,6 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
ComponentName.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "UsbMouse.h"
|
#include "UsbMouse.h"
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2004, Intel Corporation
|
Parse mouse hid descriptor.
|
||||||
|
|
||||||
|
Copyright (c) 2004 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -9,34 +11,21 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
Mousehid.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
Parse mouse hid descriptor
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "MouseHid.h"
|
#include "MouseHid.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Get an item from report descriptor
|
|
||||||
//
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get Next Item
|
Get next item from report descriptor.
|
||||||
|
|
||||||
@param StartPos Start Position
|
@param StartPos Start Position.
|
||||||
@param EndPos End Position
|
@param EndPos End Position.
|
||||||
@param HidItem HidItem to return
|
@param HidItem HidItem to return.
|
||||||
|
|
||||||
@return Position
|
@return Position.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
UINT8 *
|
UINT8 *
|
||||||
GetNextItem (
|
GetNextItem (
|
||||||
IN UINT8 *StartPos,
|
IN UINT8 *StartPos,
|
||||||
@ -129,14 +118,13 @@ GetNextItem (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get Item Data
|
Get item data from report descriptor.
|
||||||
|
|
||||||
@param HidItem HID_ITEM
|
@param HidItem The pointer to HID_ITEM.
|
||||||
|
|
||||||
@return HidItem Data
|
@return The Data of HidItem.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
UINT32
|
UINT32
|
||||||
GetItemData (
|
GetItemData (
|
||||||
IN HID_ITEM *HidItem
|
IN HID_ITEM *HidItem
|
||||||
@ -162,14 +150,12 @@ GetItemData (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parse Local Item
|
Parse local item from report descriptor.
|
||||||
|
|
||||||
@param UsbMouse USB_MOUSE_DEV
|
|
||||||
@param LocalItem Local Item
|
|
||||||
|
|
||||||
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
|
@param LocalItem The pointer to local hid item
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
ParseLocalItem (
|
ParseLocalItem (
|
||||||
IN USB_MOUSE_DEV *UsbMouse,
|
IN USB_MOUSE_DEV *UsbMouse,
|
||||||
@ -216,7 +202,14 @@ ParseLocalItem (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
|
||||||
|
/**
|
||||||
|
Parse global item from report descriptor.
|
||||||
|
|
||||||
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
|
@param GlobalItem The pointer to global hid item
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
ParseGlobalItem (
|
ParseGlobalItem (
|
||||||
IN USB_MOUSE_DEV *UsbMouse,
|
IN USB_MOUSE_DEV *UsbMouse,
|
||||||
@ -247,17 +240,13 @@ ParseGlobalItem (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parse Main Item
|
Parse main item from report descriptor.
|
||||||
|
|
||||||
@param UsbMouse TODO: add argument description
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
@param MainItem HID_ITEM to parse
|
@param MainItem Main hid item to parse
|
||||||
|
|
||||||
@return VOID
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
ParseMainItem (
|
ParseMainItem (
|
||||||
IN USB_MOUSE_DEV *UsbMouse,
|
IN USB_MOUSE_DEV *UsbMouse,
|
||||||
@ -272,15 +261,12 @@ ParseMainItem (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parse Hid Item
|
Parse hid item from report descriptor.
|
||||||
|
|
||||||
@param UsbMouse USB_MOUSE_DEV
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
@param HidItem HidItem to parse
|
@param HidItem The hid item to parse
|
||||||
|
|
||||||
@return VOID
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
ParseHidItem (
|
ParseHidItem (
|
||||||
IN USB_MOUSE_DEV *UsbMouse,
|
IN USB_MOUSE_DEV *UsbMouse,
|
||||||
@ -311,19 +297,17 @@ ParseHidItem (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// A simple parse just read some field we are interested in
|
|
||||||
//
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Parse Mouse Report Descriptor
|
Parse Mouse Report Descriptor.
|
||||||
|
|
||||||
@param UsbMouse USB_MOUSE_DEV
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
@param ReportDescriptor Report descriptor to parse
|
@param ReportDescriptor Report descriptor to parse
|
||||||
@param ReportSize Report descriptor size
|
@param ReportSize Report descriptor size
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR Report descriptor error
|
@retval EFI_DEVICE_ERROR Report descriptor error
|
||||||
@retval EFI_SUCCESS Success
|
@retval EFI_SUCCESS Parse descriptor success
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -334,14 +318,14 @@ ParseMouseReportDescriptor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT8 *DescriptorEnd;
|
UINT8 *DescriptorEnd;
|
||||||
UINT8 *ptr;
|
UINT8 *Ptr;
|
||||||
HID_ITEM HidItem;
|
HID_ITEM HidItem;
|
||||||
|
|
||||||
DescriptorEnd = ReportDescriptor + ReportSize;
|
DescriptorEnd = ReportDescriptor + ReportSize;
|
||||||
|
|
||||||
ptr = GetNextItem (ReportDescriptor, DescriptorEnd, &HidItem);
|
Ptr = GetNextItem (ReportDescriptor, DescriptorEnd, &HidItem);
|
||||||
|
|
||||||
while (ptr != NULL) {
|
while (Ptr != NULL) {
|
||||||
if (HidItem.Format != HID_ITEM_FORMAT_SHORT) {
|
if (HidItem.Format != HID_ITEM_FORMAT_SHORT) {
|
||||||
//
|
//
|
||||||
// Long Format Item is not supported at current HID revision
|
// Long Format Item is not supported at current HID revision
|
||||||
@ -351,7 +335,7 @@ ParseMouseReportDescriptor (
|
|||||||
|
|
||||||
ParseHidItem (UsbMouse, &HidItem);
|
ParseHidItem (UsbMouse, &HidItem);
|
||||||
|
|
||||||
ptr = GetNextItem (ptr, DescriptorEnd, &HidItem);
|
Ptr = GetNextItem (Ptr, DescriptorEnd, &HidItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
UsbMouse->NumberOfButtons = (UINT8) (UsbMouse->PrivateData.ButtonMaxIndex - UsbMouse->PrivateData.ButtonMinIndex + 1);
|
UsbMouse->NumberOfButtons = (UINT8) (UsbMouse->PrivateData.ButtonMaxIndex - UsbMouse->PrivateData.ButtonMinIndex + 1);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2004, Intel Corporation
|
The interface of HID data structure.
|
||||||
|
|
||||||
|
Copyright (c) 2004 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -9,17 +11,10 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
MouseHid.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef __MOUSE_HID_H
|
#ifndef _EFI_MOUSE_HID_H_
|
||||||
#define __MOUSE_HID_H
|
#define _EFI_MOUSE_HID_H_
|
||||||
|
|
||||||
#include "UsbMouse.h"
|
#include "UsbMouse.h"
|
||||||
|
|
||||||
@ -75,6 +70,17 @@ typedef struct {
|
|||||||
UINT32 CollectionStackPtr;
|
UINT32 CollectionStackPtr;
|
||||||
} HID_PARSER;
|
} HID_PARSER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Parse Mouse Report Descriptor.
|
||||||
|
|
||||||
|
@param UsbMouse The instance of USB_MOUSE_DEV
|
||||||
|
@param ReportDescriptor Report descriptor to parse
|
||||||
|
@param ReportSize Report descriptor size
|
||||||
|
|
||||||
|
@retval EFI_DEVICE_ERROR Report descriptor error
|
||||||
|
@retval EFI_SUCCESS Parse descriptor success
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
ParseMouseReportDescriptor (
|
ParseMouseReportDescriptor (
|
||||||
IN USB_MOUSE_DEV *UsbMouse,
|
IN USB_MOUSE_DEV *UsbMouse,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2004 - 2007, Intel Corporation
|
Usb Mouse Driver Binding and Implement SIMPLE_POINTER_PROTOCOL Protocol.
|
||||||
|
|
||||||
|
Copyright (c) 2004 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -9,13 +11,6 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
UsbMouse.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "UsbMouse.h"
|
#include "UsbMouse.h"
|
||||||
@ -27,10 +22,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include "UsbMouse.h"
|
#include "UsbMouse.h"
|
||||||
#include "MouseHid.h"
|
#include "MouseHid.h"
|
||||||
|
|
||||||
//
|
/**
|
||||||
// Prototypes
|
The USB Mouse driver entry pointer.
|
||||||
// Driver model protocol interface
|
|
||||||
//
|
@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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseDriverBindingEntryPoint (
|
USBMouseDriverBindingEntryPoint (
|
||||||
@ -38,6 +39,18 @@ USBMouseDriverBindingEntryPoint (
|
|||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseDriverBindingSupported (
|
USBMouseDriverBindingSupported (
|
||||||
@ -46,6 +59,20 @@ USBMouseDriverBindingSupported (
|
|||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseDriverBindingStart (
|
USBMouseDriverBindingStart (
|
||||||
@ -54,6 +81,19 @@ USBMouseDriverBindingStart (
|
|||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseDriverBindingStop (
|
USBMouseDriverBindingStop (
|
||||||
@ -76,22 +116,43 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
/**
|
||||||
// helper functions
|
Tell if a Usb Controller is a mouse.
|
||||||
//
|
|
||||||
STATIC
|
@param UsbIo Protocol instance pointer.
|
||||||
|
|
||||||
|
@retval TRUE It is a mouse.
|
||||||
|
@retval FALSE It is not a mouse.
|
||||||
|
|
||||||
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsUsbMouse (
|
IsUsbMouse (
|
||||||
IN EFI_USB_IO_PROTOCOL *UsbIo
|
IN EFI_USB_IO_PROTOCOL *UsbIo
|
||||||
);
|
);
|
||||||
|
|
||||||
STATIC
|
/**
|
||||||
|
Initialize the Usb Mouse Device.
|
||||||
|
|
||||||
|
@param UsbMouseDev Device instance to be initialized.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Success.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Can't allocate memory.
|
||||||
|
@retval Other Init error.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeUsbMouseDevice (
|
InitializeUsbMouseDevice (
|
||||||
IN USB_MOUSE_DEV *UsbMouseDev
|
IN USB_MOUSE_DEV *UsbMouseDev
|
||||||
);
|
);
|
||||||
|
|
||||||
STATIC
|
/**
|
||||||
|
Event notification function for SIMPLE_POINTER.WaitForInput event
|
||||||
|
Signal the event if there is input from mouse.
|
||||||
|
|
||||||
|
@param Event Wait Event.
|
||||||
|
@param Context Passed parameter to event handler.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
UsbMouseWaitForInput (
|
UsbMouseWaitForInput (
|
||||||
@ -99,10 +160,19 @@ UsbMouseWaitForInput (
|
|||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
/**
|
||||||
// Mouse interrupt handler
|
It is called whenever there is data received from async interrupt
|
||||||
//
|
transfer.
|
||||||
STATIC
|
|
||||||
|
@param Data Data received.
|
||||||
|
@param DataLength Length of Data.
|
||||||
|
@param Context Passed in context.
|
||||||
|
@param Result Async Interrupt Transfer result.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS Receive data successfully.
|
||||||
|
@return EFI_DEVICE_ERROR USB async interrupt transfer fails.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
OnMouseInterruptComplete (
|
OnMouseInterruptComplete (
|
||||||
@ -112,10 +182,17 @@ OnMouseInterruptComplete (
|
|||||||
IN UINT32 Result
|
IN UINT32 Result
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
/**
|
||||||
// Mouse Protocol
|
Get the mouse state, see SIMPLE POINTER PROTOCOL.
|
||||||
//
|
|
||||||
STATIC
|
@param This Protocol instance pointer.
|
||||||
|
@param MouseState Current mouse state.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS Get usb mouse status successfully.
|
||||||
|
@return EFI_DEVICE_ERROR The parameter is error.
|
||||||
|
@return EFI_NOT_READY Mouse status doesn't change.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
GetMouseState (
|
GetMouseState (
|
||||||
@ -123,7 +200,15 @@ GetMouseState (
|
|||||||
OUT EFI_SIMPLE_POINTER_STATE *MouseState
|
OUT EFI_SIMPLE_POINTER_STATE *MouseState
|
||||||
);
|
);
|
||||||
|
|
||||||
STATIC
|
/**
|
||||||
|
Reset the mouse device, see SIMPLE POINTER PROTOCOL.
|
||||||
|
|
||||||
|
@param This Protocol instance pointer.
|
||||||
|
@param ExtendedVerification Ignored here.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS Reset usb mouse successfully.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
UsbMouseReset (
|
UsbMouseReset (
|
||||||
@ -131,28 +216,23 @@ UsbMouseReset (
|
|||||||
IN BOOLEAN ExtendedVerification
|
IN BOOLEAN ExtendedVerification
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
// Driver start here
|
/**
|
||||||
//
|
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseDriverBindingEntryPoint (
|
USBMouseDriverBindingEntryPoint (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
Entry point for EFI drivers.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
ImageHandle - EFI_HANDLE
|
|
||||||
SystemTable - EFI_SYSTEM_TABLE
|
|
||||||
Returns:
|
|
||||||
EFI_SUCCESS
|
|
||||||
others
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
return EfiLibInstallDriverBindingComponentName2 (
|
return EfiLibInstallDriverBindingComponentName2 (
|
||||||
ImageHandle,
|
ImageHandle,
|
||||||
@ -167,11 +247,11 @@ USBMouseDriverBindingEntryPoint (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Test to see if this driver supports ControllerHandle. Any ControllerHandle
|
Test to see if this driver supports ControllerHandle. Any ControllerHandle
|
||||||
that has UsbHcProtocol installed will be supported.
|
that has UsbIoProtocol installed will be supported.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param Controller Handle of device to test
|
@param Controller Handle of device to test
|
||||||
@param RemainingDevicePath Not used
|
@param RemainingDevicePath Not used.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver supports this device.
|
@retval EFI_SUCCESS This driver supports this device.
|
||||||
@retval EFI_UNSUPPORTED This driver does not support this device.
|
@retval EFI_UNSUPPORTED This driver does not support this device.
|
||||||
@ -225,18 +305,17 @@ USBMouseDriverBindingSupported (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Starting the Usb Bus Driver
|
Starting the Usb Mouse Driver.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param Controller Handle of device to test
|
@param Controller Handle of device to test.
|
||||||
@param RemainingDevicePath Not used
|
@param RemainingDevicePath Not used.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver supports this device.
|
@retval EFI_SUCCESS This driver supports this device.
|
||||||
@retval EFI_UNSUPPORTED This driver does not support 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_DEVICE_ERROR This driver cannot be started due to device Error.
|
||||||
EFI_OUT_OF_RESOURCES- Can't allocate memory
|
@retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.
|
||||||
resources
|
@retval EFI_ALREADY_STARTED Thios driver has been started.
|
||||||
@retval EFI_ALREADY_STARTED Thios driver has been started
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -477,13 +556,12 @@ ErrorExit:
|
|||||||
created by this driver.
|
created by this driver.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param Controller Handle of device to stop driver on
|
@param Controller Handle of device to stop driver on.
|
||||||
@param NumberOfChildren Number of Children in the ChildHandleBuffer
|
@param NumberOfChildren Number of Children in the ChildHandleBuffer.
|
||||||
@param ChildHandleBuffer List of handles for the children we need to stop.
|
@param ChildHandleBuffer List of handles for the children we need to stop.
|
||||||
|
|
||||||
@return EFI_SUCCESS
|
@retval EFI_SUCCESS The controller or children are stopped.
|
||||||
@return EFI_DEVICE_ERROR
|
@retval Other Failed to stop the driver.
|
||||||
@return others
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -552,7 +630,7 @@ USBMouseDriverBindingStop (
|
|||||||
|
|
||||||
gBS->CloseEvent (UsbMouseDevice->SimplePointerProtocol.WaitForInput);
|
gBS->CloseEvent (UsbMouseDevice->SimplePointerProtocol.WaitForInput);
|
||||||
|
|
||||||
if (UsbMouseDevice->DelayedRecoveryEvent) {
|
if (UsbMouseDevice->DelayedRecoveryEvent != NULL) {
|
||||||
gBS->CloseEvent (UsbMouseDevice->DelayedRecoveryEvent);
|
gBS->CloseEvent (UsbMouseDevice->DelayedRecoveryEvent);
|
||||||
UsbMouseDevice->DelayedRecoveryEvent = 0;
|
UsbMouseDevice->DelayedRecoveryEvent = 0;
|
||||||
}
|
}
|
||||||
@ -576,7 +654,7 @@ USBMouseDriverBindingStop (
|
|||||||
gBS->FreePool (UsbMouseDevice->InterfaceDescriptor);
|
gBS->FreePool (UsbMouseDevice->InterfaceDescriptor);
|
||||||
gBS->FreePool (UsbMouseDevice->IntEndpointDescriptor);
|
gBS->FreePool (UsbMouseDevice->IntEndpointDescriptor);
|
||||||
|
|
||||||
if (UsbMouseDevice->ControllerNameTable) {
|
if (UsbMouseDevice->ControllerNameTable != NULL) {
|
||||||
FreeUnicodeStringTable (UsbMouseDevice->ControllerNameTable);
|
FreeUnicodeStringTable (UsbMouseDevice->ControllerNameTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,12 +666,12 @@ USBMouseDriverBindingStop (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Tell if a Usb Controller is a mouse
|
Tell if a Usb Controller is a mouse.
|
||||||
|
|
||||||
@param UsbIo Protocol instance pointer.
|
@param UsbIo Protocol instance pointer.
|
||||||
|
|
||||||
@retval TRUE It is a mouse
|
@retval TRUE It is a mouse.
|
||||||
@retval FALSE It is not a mouse
|
@retval FALSE It is not a mouse.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
@ -631,14 +709,13 @@ IsUsbMouse (
|
|||||||
/**
|
/**
|
||||||
Initialize the Usb Mouse Device.
|
Initialize the Usb Mouse Device.
|
||||||
|
|
||||||
@param UsbMouseDev Device instance to be initialized
|
@param UsbMouseDev Device instance to be initialized.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Success
|
@retval EFI_SUCCESS Success.
|
||||||
@retval EFI_DEVICE_ERROR Init error. EFI_OUT_OF_RESOURCES- Can't allocate
|
@retval EFI_OUT_OF_RESOURCES Can't allocate memory.
|
||||||
memory
|
@retval Other Init error.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeUsbMouseDevice (
|
InitializeUsbMouseDevice (
|
||||||
IN USB_MOUSE_DEV *UsbMouseDev
|
IN USB_MOUSE_DEV *UsbMouseDev
|
||||||
@ -748,7 +825,7 @@ InitializeUsbMouseDevice (
|
|||||||
|
|
||||||
gBS->FreePool (ReportDesc);
|
gBS->FreePool (ReportDesc);
|
||||||
|
|
||||||
if (UsbMouseDev->DelayedRecoveryEvent) {
|
if (UsbMouseDev->DelayedRecoveryEvent != NULL) {
|
||||||
gBS->CloseEvent (UsbMouseDev->DelayedRecoveryEvent);
|
gBS->CloseEvent (UsbMouseDev->DelayedRecoveryEvent);
|
||||||
UsbMouseDev->DelayedRecoveryEvent = 0;
|
UsbMouseDev->DelayedRecoveryEvent = 0;
|
||||||
}
|
}
|
||||||
@ -770,15 +847,14 @@ InitializeUsbMouseDevice (
|
|||||||
transfer.
|
transfer.
|
||||||
|
|
||||||
@param Data Data received.
|
@param Data Data received.
|
||||||
@param DataLength Length of Data
|
@param DataLength Length of Data.
|
||||||
@param Context Passed in context
|
@param Context Passed in context.
|
||||||
@param Result Async Interrupt Transfer result
|
@param Result Async Interrupt Transfer result.
|
||||||
|
|
||||||
@return EFI_SUCCESS
|
@return EFI_SUCCESS Receive data successfully.
|
||||||
@return EFI_DEVICE_ERROR
|
@return EFI_DEVICE_ERROR USB async interrupt transfer fails.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
OnMouseInterruptComplete (
|
OnMouseInterruptComplete (
|
||||||
@ -855,32 +931,18 @@ OnMouseInterruptComplete (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
STATIC VOID
|
|
||||||
PrintMouseState(
|
|
||||||
IN EFI_MOUSE_STATE *MouseState
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Aprint("(%x: %x, %x)\n",
|
|
||||||
MouseState->ButtonStates,
|
|
||||||
MouseState->dx,
|
|
||||||
MouseState->dy
|
|
||||||
);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the mouse state, see SIMPLE POINTER PROTOCOL.
|
Get the mouse state, see SIMPLE POINTER PROTOCOL.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param MouseState Current mouse state
|
@param MouseState Current mouse state.
|
||||||
|
|
||||||
@return EFI_SUCCESS
|
@return EFI_SUCCESS Get usb mouse status successfully.
|
||||||
@return EFI_DEVICE_ERROR
|
@return EFI_DEVICE_ERROR The parameter is error.
|
||||||
@return EFI_NOT_READY
|
@return EFI_NOT_READY Mouse status doesn't change.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
GetMouseState (
|
GetMouseState (
|
||||||
@ -923,12 +985,11 @@ GetMouseState (
|
|||||||
Reset the mouse device, see SIMPLE POINTER PROTOCOL.
|
Reset the mouse device, see SIMPLE POINTER PROTOCOL.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param ExtendedVerification Ignored here/
|
@param ExtendedVerification Ignored here.
|
||||||
|
|
||||||
@return EFI_SUCCESS
|
@return EFI_SUCCESS Reset usb mouse successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
UsbMouseReset (
|
UsbMouseReset (
|
||||||
@ -959,14 +1020,12 @@ UsbMouseReset (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Event notification function for SIMPLE_POINTER.WaitForInput event
|
Event notification function for SIMPLE_POINTER.WaitForInput event
|
||||||
Signal the event if there is input from mouse
|
Signal the event if there is input from mouse.
|
||||||
|
|
||||||
@param Event Wait Event
|
@param Event Wait Event
|
||||||
@param Context Passed parameter to event handler
|
@param Context Passed parameter to event handler
|
||||||
VOID
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
UsbMouseWaitForInput (
|
UsbMouseWaitForInput (
|
||||||
@ -1023,7 +1082,7 @@ USBMouseRecoveryHandler (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Report Status Code in Usb Bot Driver
|
Report Status Code in Usb Bot Driver.
|
||||||
|
|
||||||
@param DevicePath Use this to get Device Path
|
@param DevicePath Use this to get Device Path
|
||||||
@param CodeType Status Code Type
|
@param CodeType Status Code Type
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2004 - 2007, Intel Corporation
|
Helper routine and corrsponding data struct used by USB Mouse Driver.
|
||||||
|
|
||||||
|
Copyright (c) 2004 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -9,17 +11,10 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
UsbMouse.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _USB_MOUSE_H
|
#ifndef _EFI_USB_MOUSE_H_
|
||||||
#define _USB_MOUSE_H
|
#define _EFI_USB_MOUSE_H_
|
||||||
|
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
@ -78,6 +73,15 @@ typedef struct {
|
|||||||
#define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \
|
#define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \
|
||||||
CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)
|
CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Timer handler for Delayed Recovery timer.
|
||||||
|
|
||||||
|
@param Event The Delayed Recovery event.
|
||||||
|
@param Context Points to the USB_KB_DEV instance.
|
||||||
|
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
USBMouseRecoveryHandler (
|
USBMouseRecoveryHandler (
|
||||||
@ -93,6 +97,17 @@ extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName;
|
|||||||
extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseComponentName2;
|
extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseComponentName2;
|
||||||
extern EFI_GUID gEfiUsbMouseDriverGuid;
|
extern EFI_GUID gEfiUsbMouseDriverGuid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Report Status Code in Usb Bot Driver.
|
||||||
|
|
||||||
|
@param DevicePath Use this to get Device Path
|
||||||
|
@param CodeType Status Code Type
|
||||||
|
@param CodeValue Status Code Value
|
||||||
|
|
||||||
|
@return None
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
MouseReportStatusCode (
|
MouseReportStatusCode (
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user