Coding style modification.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5058 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -173,7 +173,7 @@ IsaBusControllerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -194,7 +194,7 @@ IsaBusControllerDriverSupported (
|
||||
EFI_SUCCESS - The device is supported by this driver.
|
||||
EFI_UNSUPPORTED - The device is not supported by this driver.
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -204,7 +204,7 @@ IsaBusControllerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -227,7 +227,7 @@ IsaBusControllerDriverStart (
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
|
||||
resources.
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -238,7 +238,7 @@ IsaBusControllerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE * ChildHandleBuffer OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -262,7 +262,7 @@ IsaBusControllerDriverStop (
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
|
||||
resources.
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
//
|
||||
@@ -278,7 +278,7 @@ IsaCreateDevice (
|
||||
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList,
|
||||
OUT EFI_DEVICE_PATH_PROTOCOL **ChildDevicePath
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -300,7 +300,7 @@ IsaCreateDevice (
|
||||
resources.
|
||||
EFI_DEVICE_ERROR - Can not create child device.
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -308,7 +308,7 @@ InitializeIsaIoInstance (
|
||||
IN ISA_IO_DEVICE *IsaIoDevice,
|
||||
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDevice
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -323,7 +323,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - Initial success.
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
@@ -77,7 +77,7 @@ IsaBusControllerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -98,7 +98,7 @@ IsaBusControllerDriverSupported (
|
||||
EFI_SUCCESS - The device is supported by this driver.
|
||||
EFI_UNSUPPORTED - The device is not supported by this driver.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ISA_ACPI_PROTOCOL *IsaAcpi;
|
||||
@@ -172,7 +172,7 @@ IsaBusControllerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -195,7 +195,7 @@ IsaBusControllerDriverStart (
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
|
||||
resources.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
@@ -414,7 +414,7 @@ IsaBusControllerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE * ChildHandleBuffer OPTIONAL
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -438,7 +438,7 @@ IsaBusControllerDriverStop (
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
|
||||
resources.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
@@ -555,7 +555,7 @@ IsaCreateDevice (
|
||||
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList,
|
||||
OUT EFI_DEVICE_PATH_PROTOCOL **ChildDevicePath
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -577,7 +577,7 @@ IsaCreateDevice (
|
||||
resources.
|
||||
EFI_DEVICE_ERROR - Can not create child device.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
|
@@ -80,26 +80,18 @@ static EFI_ISA_DMA_REGISTERS DmaRegisters[8] = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
report a error Status code of PCI bus driver controller
|
||||
|
||||
@param Code - The error status code.
|
||||
|
||||
@Return EFI_SUCCESS - Success to report status code.
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReportErrorStatusCode (
|
||||
EFI_STATUS_CODE_VALUE Code
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
report a error Status code of PCI bus driver controller
|
||||
|
||||
Arguments:
|
||||
|
||||
Code - The error status code.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Success to report status code.
|
||||
|
||||
|
||||
--*/
|
||||
{
|
||||
return REPORT_STATUS_CODE (
|
||||
EFI_ERROR_CODE | EFI_ERROR_MINOR,
|
||||
@@ -110,28 +102,21 @@ Returns:
|
||||
//
|
||||
// Driver Support Functions
|
||||
//
|
||||
/**
|
||||
|
||||
Initializes an ISA I/O Instance
|
||||
|
||||
@param IsaIoDevice - The iso device to be initialized.
|
||||
@param IsaDeviceResourceList - The resource list.
|
||||
|
||||
@retval EFI_SUCCESS - Initial success.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitializeIsaIoInstance (
|
||||
IN ISA_IO_DEVICE *IsaIoDevice,
|
||||
IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Initializes an ISA I/O Instance
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIoDevice - The iso device to be initialized.
|
||||
IsaDeviceResourceList - The resource list.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Initial success.
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Initializes an ISA I/O Instance
|
||||
@@ -147,6 +132,21 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs an ISA I/O Read Cycle
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Width - Signifies the width of the I/O operation.
|
||||
@param Offset - The offset in ISA I/O space to start the I/O operation.
|
||||
@param Count - The number of I/O operations to perform.
|
||||
@param Buffer - The destination buffer to store the results
|
||||
|
||||
@retval EFI_SUCCESS - The data was read from the device sucessfully.
|
||||
@retval EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
@retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoIoRead (
|
||||
@@ -156,28 +156,7 @@ IsaIoIoRead (
|
||||
IN UINTN Count,
|
||||
IN OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an ISA I/O Read Cycle
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Width - Signifies the width of the I/O operation.
|
||||
Offset - The offset in ISA I/O space to start the I/O operation.
|
||||
Count - The number of I/O operations to perform.
|
||||
Buffer - The destination buffer to store the results
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data was read from the device sucessfully.
|
||||
EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -216,6 +195,21 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs an ISA I/O Write Cycle
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Width - Signifies the width of the I/O operation.
|
||||
@param Offset - The offset in ISA I/O space to start the I/O operation.
|
||||
@param Count - The number of I/O operations to perform.
|
||||
@param Buffer - The source buffer to write data from
|
||||
|
||||
@Retval EFI_SUCCESS - The data was writen to the device sucessfully.
|
||||
@Retval EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
@Retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
@Retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoIoWrite (
|
||||
@@ -225,28 +219,6 @@ IsaIoIoWrite (
|
||||
IN UINTN Count,
|
||||
IN OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an ISA I/O Write Cycle
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Width - Signifies the width of the I/O operation.
|
||||
Offset - The offset in ISA I/O space to start the I/O operation.
|
||||
Count - The number of I/O operations to perform.
|
||||
Buffer - The source buffer to write data from
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data was writen to the device sucessfully.
|
||||
EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -285,32 +257,26 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Writes an 8 bit I/O Port
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Offset - The offset in ISA IO space to start the IO operation.
|
||||
@param Value - The data to write port.
|
||||
|
||||
@retval EFI_SUCCESS - Success.
|
||||
@retval EFI_INVALID_PARAMETER - Parameter is invalid.
|
||||
@retval EFI_UNSUPPORTED - The address range specified by Offset is not valid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
WritePort (
|
||||
IN EFI_ISA_IO_PROTOCOL *This,
|
||||
IN UINT32 Offset,
|
||||
IN UINT8 Value
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Writes an 8 bit I/O Port
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Offset - The offset in ISA IO space to start the IO operation.
|
||||
Value - The data to write port.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Success.
|
||||
EFI_INVALID_PARAMETER - Parameter is invalid.
|
||||
EFI_UNSUPPORTED - The address range specified by Offset is not valid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -338,6 +304,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Writes I/O operation base address and count number to a 8 bit I/O Port.
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param AddrOffset - The address' offset.
|
||||
@param PageOffset - The page's offest.
|
||||
@param CountOffset - The count's offset.
|
||||
@param BaseAddress - The base address.
|
||||
@param Count - The number of I/O operations to perform.
|
||||
|
||||
@retval EFI_SUCCESS - Success.
|
||||
@retval EFI_INVALID_PARAMETER - Parameter is invalid.
|
||||
@retval EFI_UNSUPPORTED - The address range specified by these Offsets and Count is not valid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
WriteDmaPort (
|
||||
IN EFI_ISA_IO_PROTOCOL *This,
|
||||
@@ -347,29 +329,7 @@ WriteDmaPort (
|
||||
IN UINT32 BaseAddress,
|
||||
IN UINT16 Count
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Writes I/O operation base address and count number to a 8 bit I/O Port.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
AddrOffset - The address' offset.
|
||||
PageOffset - The page's offest.
|
||||
CountOffset - The count's offset.
|
||||
BaseAddress - The base address.
|
||||
Count - The number of I/O operations to perform.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Success.
|
||||
EFI_INVALID_PARAMETER - Parameter is invalid.
|
||||
EFI_UNSUPPORTED - The address range specified by these Offsets and Count is not valid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -401,29 +361,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Unmaps a memory region for DMA
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Mapping - The mapping value returned from EFI_ISA_IO.Map().
|
||||
|
||||
@retval EFI_SUCCESS - The range was unmapped.
|
||||
@retval EFI_DEVICE_ERROR - The data was not committed to the target system memory.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoUnmap (
|
||||
IN EFI_ISA_IO_PROTOCOL *This,
|
||||
IN VOID *Mapping
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Unmaps a memory region for DMA
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Mapping - The mapping value returned from EFI_ISA_IO.Map().
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The range was unmapped.
|
||||
EFI_DEVICE_ERROR - The data was not committed to the target system memory.
|
||||
|
||||
--*/
|
||||
{
|
||||
ISA_MAP_INFO *IsaMapInfo;
|
||||
|
||||
@@ -467,27 +420,21 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Flushes a DMA buffer
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
|
||||
@retval EFI_SUCCESS - The buffers were flushed.
|
||||
@retval EFI_DEVICE_ERROR - The buffers were not flushed due to a hardware error.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoFlush (
|
||||
IN EFI_ISA_IO_PROTOCOL *This
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Flushes a DMA buffer
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The buffers were flushed.
|
||||
EFI_DEVICE_ERROR - The buffers were not flushed due to a hardware error.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -506,6 +453,20 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Verifies access to an ISA device
|
||||
|
||||
@param IsaIoDevice - The ISA device to be verified.
|
||||
@param Type - The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.
|
||||
@param Width - Signifies the width of the memory operation.
|
||||
@param Count - The number of memory operations to perform.
|
||||
@param Offset - The offset in ISA memory space to start the memory operation.
|
||||
|
||||
@retval EFI_SUCCESS - Verify success.
|
||||
@retval EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
|
||||
@retval EFI_UNSUPPORTED - The device ont support the access type.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsaIoVerifyAccess (
|
||||
IN ISA_IO_DEVICE *IsaIoDevice,
|
||||
@@ -514,27 +475,7 @@ IsaIoVerifyAccess (
|
||||
IN UINTN Count,
|
||||
IN OUT UINT32 *Offset
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Verifies access to an ISA device
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIoDevice - The ISA device to be verified.
|
||||
Type - The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.
|
||||
Width - Signifies the width of the memory operation.
|
||||
Count - The number of memory operations to perform.
|
||||
Offset - The offset in ISA memory space to start the memory operation.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Verify success.
|
||||
EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
|
||||
EFI_UNSUPPORTED - The device ont support the access type.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_ISA_ACPI_RESOURCE *Item;
|
||||
EFI_STATUS Status;
|
||||
@@ -579,6 +520,22 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Performs an ISA Memory Read Cycle
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Width - Signifies the width of the memory operation.
|
||||
@param Offset - The offset in ISA memory space to start the memory operation.
|
||||
@param Count - The number of memory operations to perform.
|
||||
@param Buffer - The destination buffer to store the results
|
||||
|
||||
@retval EFI_SUCCESS - The data was read from the device successfully.
|
||||
@retval EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
@retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoMemRead (
|
||||
@@ -588,28 +545,7 @@ IsaIoMemRead (
|
||||
IN UINTN Count,
|
||||
IN OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an ISA Memory Read Cycle
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Width - Signifies the width of the memory operation.
|
||||
Offset - The offset in ISA memory space to start the memory operation.
|
||||
Count - The number of memory operations to perform.
|
||||
Buffer - The destination buffer to store the results
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data was read from the device successfully.
|
||||
EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -658,6 +594,21 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs an ISA Memory Write Cycle
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Width - Signifies the width of the memory operation.
|
||||
@param Offset - The offset in ISA memory space to start the memory operation.
|
||||
@param Count - The number of memory operations to perform.
|
||||
@param Buffer - The source buffer to write data from
|
||||
|
||||
@retval EFI_SUCCESS - The data was written to the device sucessfully.
|
||||
@retval EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
@retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoMemWrite (
|
||||
@@ -667,28 +618,6 @@ IsaIoMemWrite (
|
||||
IN UINTN Count,
|
||||
IN OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an ISA Memory Write Cycle
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Width - Signifies the width of the memory operation.
|
||||
Offset - The offset in ISA memory space to start the memory operation.
|
||||
Count - The number of memory operations to perform.
|
||||
Buffer - The source buffer to write data from
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data was written to the device sucessfully.
|
||||
EFI_UNSUPPORTED - The Offset is not valid for this device.
|
||||
EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -737,6 +666,21 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs an ISA I/O Copy Memory
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Width - Signifies the width of the memory copy operation.
|
||||
@param DestOffset - The offset of the destination
|
||||
@param SrcOffset - The offset of the source
|
||||
@param Count - The number of memory copy operations to perform
|
||||
|
||||
@retval EFI_SUCCESS - The data was copied sucessfully.
|
||||
@retval EFI_UNSUPPORTED - The DestOffset or SrcOffset is not valid for this device.
|
||||
@retval EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
@retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoCopyMem (
|
||||
@@ -746,28 +690,7 @@ IsaIoCopyMem (
|
||||
IN UINT32 SrcOffset,
|
||||
IN UINTN Count
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an ISA I/O Copy Memory
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Width - Signifies the width of the memory copy operation.
|
||||
DestOffset - The offset of the destination
|
||||
SrcOffset - The offset of the source
|
||||
Count - The number of memory copy operations to perform
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data was copied sucessfully.
|
||||
EFI_UNSUPPORTED - The DestOffset or SrcOffset is not valid for this device.
|
||||
EFI_INVALID_PARAMETER - Width or Count, or both, were invalid.
|
||||
EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
ISA_IO_DEVICE *IsaIoDevice;
|
||||
@@ -828,6 +751,32 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Maps a memory region for DMA, note this implementation
|
||||
only supports slave read/write operation to save code size.
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
@param ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
@param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
@param HostAddress - The system memory address to map to the device.
|
||||
@param NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
@param DeviceAddress - The resulting map address for the bus master device to use
|
||||
to access the hosts HostAddress.
|
||||
@param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
@retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
@retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
@retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
@retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
@retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
IsaIoMap_OnlySupportSlaveReadWrite (
|
||||
@@ -840,39 +789,7 @@ IsaIoMap_OnlySupportSlaveReadWrite (
|
||||
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
|
||||
OUT VOID **Mapping
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Maps a memory region for DMA, note this implementation
|
||||
only supports slave read/write operation to save code size.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
HostAddress - The system memory address to map to the device.
|
||||
NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
DeviceAddress - The resulting map address for the bus master device to use
|
||||
to access the hosts HostAddress.
|
||||
Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalAddress;
|
||||
@@ -1075,6 +992,32 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Maps a memory region for DMA. This implementation implement the
|
||||
the full mapping support.
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
@param ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
@param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
@param HostAddress - The system memory address to map to the device.
|
||||
@param NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
@param DeviceAddress - The resulting map address for the bus master device to use
|
||||
- to access the hosts HostAddress.
|
||||
@param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
@retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
@retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
@retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
@retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
@retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
IsaIoMap_FullSupport (
|
||||
@@ -1087,39 +1030,7 @@ IsaIoMap_FullSupport (
|
||||
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
|
||||
OUT VOID **Mapping
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Maps a memory region for DMA. This implementation implement the
|
||||
the full mapping support.
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
HostAddress - The system memory address to map to the device.
|
||||
NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
DeviceAddress - The resulting map address for the bus master device to use
|
||||
- to access the hosts HostAddress.
|
||||
Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN Master;
|
||||
@@ -1411,6 +1322,32 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Maps a memory region for DMA
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
@param ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
@param ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
@param HostAddress - The system memory address to map to the device.
|
||||
@param NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
@param DeviceAddress - The resulting map address for the bus master device to use
|
||||
- to access the hosts HostAddress.
|
||||
@param Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
@retval EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
@retval EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
@retval EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
@retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoMap (
|
||||
@@ -1423,38 +1360,7 @@ IsaIoMap (
|
||||
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
|
||||
OUT VOID **Mapping
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Maps a memory region for DMA
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Operation - Indicates the type of DMA (slave or bus master), and if
|
||||
the DMA operation is going to read or write to system memory.
|
||||
ChannelNumber - The slave channel number to use for this DMA operation.
|
||||
If Operation and ChannelAttributes shows that this device
|
||||
performs bus mastering DMA, then this field is ignored.
|
||||
The legal range for this field is 0..7.
|
||||
ChannelAttributes - The attributes of the DMA channel to use for this DMA operation
|
||||
HostAddress - The system memory address to map to the device.
|
||||
NumberOfBytes - On input the number of bytes to map. On output the number
|
||||
of bytes that were mapped.
|
||||
DeviceAddress - The resulting map address for the bus master device to use
|
||||
- to access the hosts HostAddress.
|
||||
Mapping - A resulting value to pass to EFI_ISA_IO.Unmap().
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The range was mapped for the returned NumberOfBytes.
|
||||
EFI_INVALID_PARAMETER - The Operation or HostAddress is undefined.
|
||||
EFI_UNSUPPORTED - The HostAddress can not be mapped as a common buffer.
|
||||
EFI_DEVICE_ERROR - The system hardware could not map the requested address.
|
||||
EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.
|
||||
@@ -1493,6 +1399,24 @@ Returns:
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Allocates a common buffer for DMA
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Type - The type allocation to perform.
|
||||
@param MemoryType - The type of memory to allocate.
|
||||
@param Pages - The number of pages to allocate.
|
||||
@param HostAddress - A pointer to store the base address of the allocated range.
|
||||
@param Attributes - The requested bit mask of attributes for the allocated range.
|
||||
|
||||
@retval EFI_SUCCESS - The requested memory pages were allocated.
|
||||
@retval EFI_INVALID_PARAMETER - Type is invalid or MemoryType is invalid or HostAddress is NULL
|
||||
@retval EFI_UNSUPPORTED - Attributes is unsupported or the memory range specified
|
||||
by HostAddress, Pages, and Type is not available for common buffer use.
|
||||
@retval EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoAllocateBuffer (
|
||||
@@ -1503,30 +1427,6 @@ IsaIoAllocateBuffer (
|
||||
OUT VOID **HostAddress,
|
||||
IN UINT64 Attributes
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Allocates a common buffer for DMA
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Type - The type allocation to perform.
|
||||
MemoryType - The type of memory to allocate.
|
||||
Pages - The number of pages to allocate.
|
||||
HostAddress - A pointer to store the base address of the allocated range.
|
||||
Attributes - The requested bit mask of attributes for the allocated range.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The requested memory pages were allocated.
|
||||
EFI_INVALID_PARAMETER - Type is invalid or MemoryType is invalid or HostAddress is NULL
|
||||
EFI_UNSUPPORTED - Attributes is unsupported or the memory range specified
|
||||
by HostAddress, Pages, and Type is not available for common buffer use.
|
||||
EFI_OUT_OF_RESOURCES - The memory pages could not be allocated.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalAddress;
|
||||
@@ -1581,6 +1481,20 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Frees a common buffer
|
||||
|
||||
@param This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
@param Pages - The number of pages to free.
|
||||
@param HostAddress - The base address of the allocated range.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The requested memory pages were freed.
|
||||
@retval EFI_INVALID_PARAMETER - The memory was not allocated with EFI_ISA_IO.AllocateBufer().
|
||||
|
||||
**/
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaIoFreeBuffer (
|
||||
@@ -1588,24 +1502,6 @@ IsaIoFreeBuffer (
|
||||
IN UINTN Pages,
|
||||
IN VOID *HostAddress
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Frees a common buffer
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_ISA_IO_PROTOCOL instance.
|
||||
Pages - The number of pages to free.
|
||||
HostAddress - The base address of the allocated range.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The requested memory pages were freed.
|
||||
EFI_INVALID_PARAMETER - The memory was not allocated with EFI_ISA_IO.AllocateBufer().
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalAddress;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/**@file
|
||||
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -242,25 +241,17 @@ IsaFloppyComponentNameGetControllerName (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Add the component name for the floppy device
|
||||
|
||||
@param FdcDev - A pointer to the FDC_BLK_IO_DEV instance.
|
||||
|
||||
**/
|
||||
VOID
|
||||
AddName (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Add the component name for the floppy device
|
||||
|
||||
Arguments:
|
||||
|
||||
FdcDev - A pointer to the FDC_BLK_IO_DEV instance.
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
CHAR16 FloppyDriveName[FLOPPY_DRIVE_NAME_ASCII_LEN + 1];
|
||||
|
||||
@@ -282,3 +273,4 @@ AddName (
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/**@file
|
||||
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -156,7 +155,7 @@ VOID
|
||||
AddName (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -170,7 +169,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
@@ -73,7 +73,16 @@ InitializeIsaFloppy(
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Test controller is a Floppy Disk Controller
|
||||
|
||||
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param Controller driver's controller
|
||||
@param RemainingDevicePath children device path
|
||||
|
||||
@retval EFI_UNSUPPORTED controller is not floppy disk
|
||||
@retval EFI_SUCCESS controller is floppy disk
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FdcControllerDriverSupported (
|
||||
@@ -81,20 +90,6 @@ FdcControllerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
ControllerDriver Protocol Method
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
@@ -133,6 +128,15 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Create floppy control instance on controller.
|
||||
|
||||
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param Controller driver controller handle
|
||||
@param RemainingDevicePath Children's device path
|
||||
|
||||
@retval whether success to create floppy control instance.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FdcControllerDriverStart (
|
||||
@@ -140,18 +144,6 @@ FdcControllerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FDC_BLK_IO_DEV *FdcDev;
|
||||
@@ -364,6 +356,20 @@ Done:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. Support stoping any child handles
|
||||
created by this driver.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to stop driver on
|
||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
|
||||
children is zero stop the entire bus driver.
|
||||
@param ChildHandleBuffer List of Child Handles to Stop.
|
||||
|
||||
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
||||
@retval other This driver was not removed from this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FdcControllerDriverStop (
|
||||
@@ -372,20 +378,6 @@ FdcControllerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: NumberOfChildren - add argument and description to function comment
|
||||
// GC_TODO: ChildHandleBuffer - add argument and description to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_BLOCK_IO_PROTOCOL *BlkIo;
|
||||
@@ -478,3 +470,4 @@ FdcControllerDriverStop (
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -23,29 +23,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "IsaFloppy.h"
|
||||
|
||||
/**
|
||||
Reset the Floppy Logic Drive, call the FddReset function
|
||||
|
||||
@param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
@param ExtendedVerification BOOLEAN: Indicate that the driver may perform a more
|
||||
exhaustive verification operation of the device during
|
||||
reset, now this par is ignored in this driver
|
||||
@retval EFI_SUCCESS: The Floppy Logic Drive is reset
|
||||
@retval EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly
|
||||
and can not be reset
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FdcReset (
|
||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Reset the Floppy Logic Drive, call the FddReset function
|
||||
Parameters:
|
||||
This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
ExtendedVerification BOOLEAN: Indicate that the driver may perform a more
|
||||
exhaustive verification operation of the device during
|
||||
reset, now this par is ignored in this driver
|
||||
Returns:
|
||||
EFI_SUCCESS: The Floppy Logic Drive is reset
|
||||
EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly
|
||||
and can not be reset
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: ExtendedVerification - add argument and description to function comment
|
||||
{
|
||||
FDC_BLK_IO_DEV *FdcDev;
|
||||
|
||||
@@ -63,22 +58,18 @@ FdcReset (
|
||||
return FddReset (FdcDev);
|
||||
}
|
||||
|
||||
/**
|
||||
Flush block via fdd controller
|
||||
|
||||
@param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
@return EFI_SUCCESS
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FddFlushBlocks (
|
||||
IN EFI_BLOCK_IO_PROTOCOL *This
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Parameters:
|
||||
This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
Returns:
|
||||
EFI_SUCCESS:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
{
|
||||
//
|
||||
// Not supported yet
|
||||
@@ -86,28 +77,18 @@ FddFlushBlocks (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Common report status code interface
|
||||
|
||||
@param This Pointer of FDC_BLK_IO_DEV instance
|
||||
@param Read Error type: read or write?
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
FddReportStatus (
|
||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||
IN BOOLEAN Read
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
Read - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
FDC_BLK_IO_DEV *FdcDev;
|
||||
|
||||
@@ -120,6 +101,26 @@ Returns:
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Read the requested number of blocks from the device
|
||||
|
||||
@param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
@param MediaId UINT32: The media id that the read request is for
|
||||
@param LBA EFI_LBA: The starting logic block address to read from on the device
|
||||
@param BufferSize UINTN: The size of the Buffer in bytes
|
||||
@param Buffer VOID *: A pointer to the destination buffer for the data
|
||||
|
||||
@retval EFI_SUCCESS: The data was read correctly from the device
|
||||
@retval EFI_DEVICE_ERROR:The device reported an error while attempting to perform
|
||||
the read operation
|
||||
@retval EFI_NO_MEDIA: There is no media in the device
|
||||
@retval EFI_MEDIA_CHANGED: The MediaId is not for the current media
|
||||
@retval EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the
|
||||
intrinsic block size of the device
|
||||
@retval EFI_INVALID_PARAMETER:The read request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FddReadBlocks (
|
||||
@@ -129,33 +130,6 @@ FddReadBlocks (
|
||||
IN UINTN BufferSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Read the requested number of blocks from the device
|
||||
Parameters:
|
||||
This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
MediaId UINT32: The media id that the read request is for
|
||||
LBA EFI_LBA: The starting logic block address to read from on the device
|
||||
BufferSize UINTN: The size of the Buffer in bytes
|
||||
Buffer VOID *: A pointer to the destination buffer for the data
|
||||
Returns:
|
||||
EFI_SUCCESS: The data was read correctly from the device
|
||||
EFI_DEVICE_ERROR:The device reported an error while attempting to perform
|
||||
the read operation
|
||||
EFI_NO_MEDIA: There is no media in the device
|
||||
EFI_MEDIA_CHANGED: The MediaId is not for the current media
|
||||
EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the
|
||||
intrinsic block size of the device
|
||||
EFI_INVALID_PARAMETER:The read request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: MediaId - add argument and description to function comment
|
||||
// GC_TODO: LBA - add argument and description to function comment
|
||||
// GC_TODO: BufferSize - add argument and description to function comment
|
||||
// GC_TODO: Buffer - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -168,6 +142,26 @@ FddReadBlocks (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Write a specified number of blocks to the device
|
||||
|
||||
@param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
@param MediaId UINT32: The media id that the write request is for
|
||||
@param LBA EFI_LBA: The starting logic block address to be written
|
||||
@param BufferSize UINTN: The size in bytes in Buffer
|
||||
@param Buffer VOID *: A pointer to the source buffer for the data
|
||||
|
||||
@retval EFI_SUCCESS: The data were written correctly to the device
|
||||
@retval EFI_WRITE_PROTECTED: The device can not be written to
|
||||
@retval EFI_NO_MEDIA: There is no media in the device
|
||||
@retval EFI_MEDIA_CHANGED: The MediaId is not for the current media
|
||||
@retval EFI_DEVICE_ERROR: The device reported an error while attempting to perform
|
||||
the write operation
|
||||
@retval EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the
|
||||
intrinsic block size of the device
|
||||
@retval EFI_INVALID_PARAMETER:The write request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FddWriteBlocks (
|
||||
@@ -177,35 +171,6 @@ FddWriteBlocks (
|
||||
IN UINTN BufferSize,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Write a specified number of blocks to the device
|
||||
Parameters:
|
||||
This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface
|
||||
MediaId UINT32: The media id that the write request is for
|
||||
LBA EFI_LBA: The starting logic block address to be written
|
||||
BufferSize UINTN: The size in bytes in Buffer
|
||||
Buffer VOID *: A pointer to the source buffer for the data
|
||||
Returns :
|
||||
EFI_SUCCESS: The data were written correctly to the device
|
||||
EFI_WRITE_PROTECTED: The device can not be written to
|
||||
EFI_NO_MEDIA: There is no media in the device
|
||||
EFI_MEDIA_CHANGED: The MediaId is not for the current media
|
||||
EFI_DEVICE_ERROR: The device reported an error while attempting to perform
|
||||
the write operation
|
||||
EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the
|
||||
intrinsic block size of the device
|
||||
EFI_INVALID_PARAMETER:The write request contains LBAs that are not valid,
|
||||
or the buffer is not on proper alignment
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: function comment is missing 'Returns:'
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: MediaId - add argument and description to function comment
|
||||
// GC_TODO: LBA - add argument and description to function comment
|
||||
// GC_TODO: BufferSize - add argument and description to function comment
|
||||
// GC_TODO: Buffer - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -218,6 +183,32 @@ FddWriteBlocks (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Read or Write a number of blocks to floppy device
|
||||
|
||||
@param This Pointer to instance of EFI_BLOCK_IO_PROTOCOL
|
||||
@param MediaId The media id of read/write request
|
||||
@param LBA The starting logic block address to read from on the device
|
||||
@param BufferSize The size of the Buffer in bytes
|
||||
@param Operation - GC_TODO: add argument description
|
||||
Buffer - GC_TODO: add argument description
|
||||
|
||||
@retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
@retval EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
@retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@retval EFI_NO_MEDIA - GC_TODO: Add description for return value
|
||||
@retval EFI_MEDIA_CHANGED - GC_TODO: Add description for return value
|
||||
@retval EFI_WRITE_PROTECTED - GC_TODO: Add description for return value
|
||||
@retval EFI_BAD_BUFFER_SIZE - GC_TODO: Add description for return value
|
||||
@retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
@retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
@retval EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
@retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@retval EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FddReadWriteBlocks (
|
||||
IN EFI_BLOCK_IO_PROTOCOL *This,
|
||||
@@ -227,39 +218,6 @@ FddReadWriteBlocks (
|
||||
IN BOOLEAN Operation,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
MediaId - GC_TODO: add argument description
|
||||
LBA - GC_TODO: add argument description
|
||||
BufferSize - GC_TODO: add argument description
|
||||
Operation - GC_TODO: add argument description
|
||||
Buffer - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_NO_MEDIA - GC_TODO: Add description for return value
|
||||
EFI_MEDIA_CHANGED - GC_TODO: Add description for return value
|
||||
EFI_WRITE_PROTECTED - GC_TODO: Add description for return value
|
||||
EFI_BAD_BUFFER_SIZE - GC_TODO: Add description for return value
|
||||
EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_BLOCK_IO_MEDIA *Media;
|
||||
FDC_BLK_IO_DEV *FdcDev;
|
||||
@@ -423,25 +381,16 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Common interface for free cache
|
||||
|
||||
@param FdcDec Pointer of FDC_BLK_IO_DEV instance
|
||||
|
||||
**/
|
||||
VOID
|
||||
FdcFreeCache (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
FdcDev - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
if (FdcDev->Cache) {
|
||||
gBS->FreePool (FdcDev->Cache);
|
||||
|
@@ -22,22 +22,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "IsaFloppy.h"
|
||||
|
||||
/**
|
||||
|
||||
Detect the floppy drive is presented or not
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
@retval EFI_SUCCESS Drive is presented
|
||||
@retval EFI_NOT_FOUND Drive is not presented
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DiscoverFddDevice (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Detect the floppy drive is presented or not
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS Drive is presented
|
||||
EFI_NOT_FOUND Drive is not presented
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -61,23 +58,19 @@ DiscoverFddDevice (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Do recalibrate and see the drive is presented or not
|
||||
Set the media parameters
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
@return the drive is presented or not
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FddIdentify (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Do recalibrate and see the drive is presented or not
|
||||
Set the media parameters
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS:
|
||||
EFI_DEVICE_ERROR:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -143,23 +136,21 @@ FddIdentify (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reset the Floppy Logic Drive
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: The Floppy Logic Drive is reset
|
||||
@retval EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly and
|
||||
can not be reset
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FddReset (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Reset the Floppy Logic Drive
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: The Floppy Logic Drive is reset
|
||||
EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly and
|
||||
can not be reset
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
UINT8 data;
|
||||
UINT8 StatusRegister0;
|
||||
@@ -244,24 +235,22 @@ FddReset (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Turn the drive's motor on
|
||||
The drive's motor must be on before any command can be executed
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: Turn the drive's motor on successfully
|
||||
@retval EFI_DEVICE_ERROR: The drive is busy, so can not turn motor on
|
||||
@retval EFI_INVALID_PARAMETER: Fail to Set timer(Cancel timer)
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MotorOn (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Turn the drive's motor on
|
||||
The drive's motor must be on before any command can be executed
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: Turn the drive's motor on successfully
|
||||
EFI_DEVICE_ERROR: The drive is busy, so can not turn motor on
|
||||
EFI_INVALID_PARAMETER: Fail to Set timer(Cancel timer)
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 data;
|
||||
@@ -328,22 +317,21 @@ MotorOn (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Set a Timer and when Timer goes off, turn the motor off
|
||||
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: Set the Timer successfully
|
||||
@retval EFI_INVALID_PARAMETER: Fail to Set the timer
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MotorOff (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Set a Timer and when Timer goes off, turn the motor off
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: Set the Timer successfully
|
||||
EFI_INVALID_PARAMETER: Fail to Set the timer
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
//
|
||||
// Set the timer : 2s
|
||||
@@ -351,24 +339,21 @@ MotorOff (
|
||||
return gBS->SetTimer (FdcDev->Event, TimerRelative, 20000000);
|
||||
}
|
||||
|
||||
/**
|
||||
Detect the disk in the drive is changed or not
|
||||
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: No disk media change
|
||||
@retval EFI_DEVICE_ERROR: Fail to do the recalibrate or seek operation
|
||||
@retval EFI_NO_MEDIA: No disk in the drive
|
||||
@retval EFI_MEDIA_CHANGED: There is a new disk in the drive
|
||||
**/
|
||||
EFI_STATUS
|
||||
DisketChanged (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Detect the disk in the drive is changed or not
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: No disk media change
|
||||
EFI_DEVICE_ERROR: Fail to do the recalibrate or seek operation
|
||||
EFI_NO_MEDIA: No disk in the drive
|
||||
EFI_MEDIA_CHANGED: There is a new disk in the drive
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 data;
|
||||
@@ -418,24 +403,21 @@ DisketChanged (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Do the Specify command, this command sets DMA operation
|
||||
and the initial values for each of the three internal
|
||||
times: HUT, SRT and HLT
|
||||
|
||||
@param This Pointer to instance of FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: Execute the Specify command successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to execute the command
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Specify (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Do the Specify command, this command sets DMA operation
|
||||
and the initial values for each of the three internal
|
||||
times: HUT, SRT and HLT
|
||||
Parameters:
|
||||
None
|
||||
Returns:
|
||||
EFI_SUCCESS: Execute the Specify command successfully
|
||||
EFI_DEVICE_ERROR: Fail to execute the command
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
FDD_SPECIFY_CMD Command;
|
||||
UINTN Index;
|
||||
@@ -464,22 +446,18 @@ Specify (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set the head of floppy drive to track 0
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@retval EFI_SUCCESS: Execute the Recalibrate operation successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to execute the Recalibrate operation
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Recalibrate (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Set the head of floppy drive to track 0
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: Execute the Recalibrate operation successfully
|
||||
EFI_DEVICE_ERROR: Fail to execute the Recalibrate operation
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
FDD_COMMAND_PACKET2 Command;
|
||||
UINTN Index;
|
||||
@@ -542,25 +520,21 @@ Recalibrate (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set the head of floppy drive to the new cylinder
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param Lba EFI_LBA : The logic block address want to seek
|
||||
|
||||
@retval EFI_SUCCESS: Execute the Seek operation successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to execute the Seek operation
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Seek (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN EFI_LBA Lba
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Set the head of floppy drive to the new cylinder
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Lba EFI_LBA : The logic block address want to seek
|
||||
Returns:
|
||||
EFI_SUCCESS: Execute the Seek operation successfully
|
||||
EFI_DEVICE_ERROR: Fail to execute the Seek operation
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Lba - add argument and description to function comment
|
||||
{
|
||||
FDD_SEEK_CMD Command;
|
||||
UINT8 EndOfTrack;
|
||||
@@ -649,29 +623,25 @@ Seek (
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Do the Sense Interrupt Status command, this command
|
||||
resets the interrupt signal
|
||||
|
||||
|
||||
@param StatusRegister0 UINT8 *: Be used to save Status Register 0 read from FDC
|
||||
@param PresentCylinderNumber UINT8 *: Be used to save present cylinder number
|
||||
read from FDC
|
||||
|
||||
@retval EFI_SUCCESS: Execute the Sense Interrupt Status command successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to execute the command
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
SenseIntStatus (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN OUT UINT8 *StatusRegister0,
|
||||
IN OUT UINT8 *PresentCylinderNumber
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Do the Sense Interrupt Status command, this command
|
||||
resets the interrupt signal
|
||||
Parameters:
|
||||
StatusRegister0 UINT8 *: Be used to save Status Register 0 read from FDC
|
||||
PresentCylinderNumber UINT8 *: Be used to save present cylinder number
|
||||
read from FDC
|
||||
Returns:
|
||||
EFI_SUCCESS: Execute the Sense Interrupt Status command successfully
|
||||
EFI_DEVICE_ERROR: Fail to execute the command
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: StatusRegister0 - add argument and description to function comment
|
||||
// GC_TODO: PresentCylinderNumber - add argument and description to function comment
|
||||
{
|
||||
UINT8 command;
|
||||
|
||||
@@ -691,26 +661,22 @@ SenseIntStatus (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Do the Sense Drive Status command
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param Lba EFI_LBA : Logic block address
|
||||
|
||||
@retval EFI_SUCCESS: Execute the Sense Drive Status command successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to execute the command
|
||||
@retval EFI_WRITE_PROTECTED:The disk is write protected
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
SenseDrvStatus (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN EFI_LBA Lba
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Do the Sense Drive Status command
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Lba EFI_LBA : Logic block address
|
||||
Returns:
|
||||
EFI_SUCCESS: Execute the Sense Drive Status command successfully
|
||||
EFI_DEVICE_ERROR: Fail to execute the command
|
||||
EFI_WRITE_PROTECTED:The disk is write protected
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Lba - add argument and description to function comment
|
||||
{
|
||||
FDD_COMMAND_PACKET2 Command;
|
||||
UINT8 Head;
|
||||
@@ -758,23 +724,20 @@ SenseDrvStatus (
|
||||
return CheckStatus3 (StatusRegister3);
|
||||
}
|
||||
|
||||
/**
|
||||
Update the disk media properties and if necessary
|
||||
reinstall Block I/O interface
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS: Do the operation successfully
|
||||
@retval EFI_DEVICE_ERROR: Fail to the operation
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DetectMedia (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Update the disk media properties and if necessary
|
||||
reinstall Block I/O interface
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Returns:
|
||||
EFI_SUCCESS: Do the operation successfully
|
||||
EFI_DEVICE_ERROR: Fail to the operation
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN bReset;
|
||||
@@ -840,22 +803,17 @@ DetectMedia (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set the data rate and so on
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
|
||||
@retval EFI_SUCCESS success to set the data rate
|
||||
**/
|
||||
EFI_STATUS
|
||||
Setup (
|
||||
IN FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Set the data rate and so on
|
||||
Parameters:
|
||||
None
|
||||
Returns:
|
||||
EFI_SUCCESS:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -878,6 +836,18 @@ Setup (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Read or Write a number of blocks in the same cylinder
|
||||
|
||||
@param FdcDev A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param HostAddress device address
|
||||
@param Lba The starting logic block address to read from on the device
|
||||
@param NumberOfBlocks The number of block wanted to be read or write
|
||||
@param Read Operation type: read or write
|
||||
|
||||
@retval EFI_SUCCESS Success operate
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadWriteDataSector (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
@@ -886,30 +856,6 @@ ReadWriteDataSector (
|
||||
IN UINTN NumberOfBlocks,
|
||||
IN BOOLEAN Read
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Read or Write a number of blocks in the same cylinder
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV * : A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
Buffer VOID *:
|
||||
Lba EFI_LBA:
|
||||
NumberOfBlocks UINTN:
|
||||
Read BOOLEAN:
|
||||
Returns:
|
||||
EFI_SUCCESS:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: HostAddress - add argument and description to function comment
|
||||
// GC_TODO: Lba - add argument and description to function comment
|
||||
// GC_TODO: NumberOfBlocks - add argument and description to function comment
|
||||
// GC_TODO: Read - add argument and description to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_TIMEOUT - add return value to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FDD_COMMAND_PACKET1 Command;
|
||||
@@ -1040,23 +986,20 @@ ReadWriteDataSector (
|
||||
return CheckResult (&Result, FdcDev);
|
||||
}
|
||||
|
||||
/**
|
||||
Fill in FDD command's parameter
|
||||
|
||||
@param FdcDev Pointer to instance of FDC_BLK_IO_DEV
|
||||
@param Lba The starting logic block address to read from on the device
|
||||
@param Command FDD command
|
||||
|
||||
**/
|
||||
VOID
|
||||
FillPara (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN EFI_LBA Lba,
|
||||
IN FDD_COMMAND_PACKET1 *Command
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Fill in Parameter
|
||||
Parameters:
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Lba - add argument and description to function comment
|
||||
// GC_TODO: Command - add argument and description to function comment
|
||||
{
|
||||
UINT8 EndOfTrack;
|
||||
|
||||
@@ -1084,24 +1027,22 @@ FillPara (
|
||||
Command->DataLength = DISK_1440K_DTL;
|
||||
}
|
||||
|
||||
/**
|
||||
Read result byte from Data Register of FDC
|
||||
|
||||
@param FdcDev Pointer to instance of FDC_BLK_IO_DEV
|
||||
@param Pointer UINT8 *: Be used to save result byte read from FDC
|
||||
|
||||
|
||||
@retval EFI_SUCCESS: Read result byte from FDC successfully
|
||||
@retval EFI_DEVICE_ERROR: The FDC is not ready to be read
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DataInByte (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN OUT UINT8 *Pointer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Read result byte from Data Register of FDC
|
||||
Parameters:
|
||||
Pointer UINT8 *: Be used to save result byte read from FDC
|
||||
Returns:
|
||||
EFI_SUCCESS: Read result byte from FDC successfully
|
||||
EFI_DEVICE_ERROR: The FDC is not ready to be read
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Pointer - add argument and description to function comment
|
||||
{
|
||||
UINT8 data;
|
||||
|
||||
@@ -1126,24 +1067,21 @@ DataInByte (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Write command byte to Data Register of FDC
|
||||
|
||||
@param FdcDev Pointer to instance of FDC_BLK_IO_DEV
|
||||
@param Pointer Be used to save command byte written to FDC
|
||||
|
||||
@retval EFI_SUCCESS: Write command byte to FDC successfully
|
||||
@retval EFI_DEVICE_ERROR: The FDC is not ready to be written
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DataOutByte (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN UINT8 *Pointer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Write command byte to Data Register of FDC
|
||||
Parameters:
|
||||
Pointer UINT8 *: Be used to save command byte written to FDC
|
||||
Returns:
|
||||
EFI_SUCCESS: Write command byte to FDC successfully
|
||||
EFI_DEVICE_ERROR: The FDC is not ready to be written
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Pointer - add argument and description to function comment
|
||||
{
|
||||
UINT8 data;
|
||||
|
||||
@@ -1169,27 +1107,23 @@ DataOutByte (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Detect the specified floppy logic drive is busy or
|
||||
not within a period of time
|
||||
|
||||
@param Disk Indicate it is drive A or drive B
|
||||
@param TimeoutInSeconds the time period for waiting
|
||||
|
||||
@retval EFI_SUCCESS: The drive and command are not busy
|
||||
@retval EFI_TIMEOUT: The drive or command is still busy after a period time that
|
||||
set by TimeoutInSeconds
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FddWaitForBSYClear (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN UINTN TimeoutInSeconds
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Detect the specified floppy logic drive is busy or
|
||||
not within a period of time
|
||||
Parameters:
|
||||
Disk EFI_FDC_DISK: Indicate it is drive A or drive B
|
||||
TimeoutInSeconds UINTN: the time period for waiting
|
||||
Returns:
|
||||
EFI_SUCCESS: The drive and command are not busy
|
||||
EFI_TIMEOUT: The drive or command is still busy after a period time that
|
||||
set by TimeoutInSeconds
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: TimeoutInSeconds - add argument and description to function comment
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 StatusRegister;
|
||||
@@ -1228,27 +1162,24 @@ FddWaitForBSYClear (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Routine Description: Determine whether FDC is ready to write or read
|
||||
|
||||
@param FdcDev Pointer to instance of FDC_BLK_IO_DEV
|
||||
@param Dio BOOLEAN: Indicate the FDC is waiting to write or read
|
||||
@param TimeoutInSeconds UINTN: The time period for waiting
|
||||
|
||||
@retval EFI_SUCCESS: FDC is ready to write or read
|
||||
@retval EFI_NOT_READY: FDC is not ready within the specified time period
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FddDRQReady (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN BOOLEAN Dio,
|
||||
IN UINTN TimeoutInSeconds
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Determine whether FDC is ready to write or read
|
||||
Parameters:
|
||||
Dio BOOLEAN: Indicate the FDC is waiting to write or read
|
||||
TimeoutInSeconds UINTN: The time period for waiting
|
||||
Returns:
|
||||
EFI_SUCCESS: FDC is ready to write or read
|
||||
EFI_NOT_READY: FDC is not ready within the specified time period
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Dio - add argument and description to function comment
|
||||
// GC_TODO: TimeoutInSeconds - add argument and description to function comment
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 StatusRegister;
|
||||
@@ -1294,30 +1225,24 @@ FddDRQReady (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set FDC control structure's attribute according to
|
||||
result
|
||||
|
||||
@param Result Point to result structure
|
||||
@param FdcDev FDC control structure
|
||||
|
||||
@param EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@param EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@param EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
@param EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckResult (
|
||||
IN FDD_RESULT_PACKET *Result,
|
||||
IN OUT FDC_BLK_IO_DEV *FdcDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Result - GC_TODO: add argument description
|
||||
FdcDev - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Check Status Register0
|
||||
@@ -1351,22 +1276,19 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Check the drive status information
|
||||
|
||||
@param StatusRegister3 the value of Status Register 3
|
||||
|
||||
@retval EFI_SUCCESS The disk is not write protected
|
||||
@retval EFI_WRITE_PROTECTED: The disk is write protected
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckStatus3 (
|
||||
IN UINT8 StatusRegister3
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Check the drive status information
|
||||
Parameters:
|
||||
StatusRegister3 UINT8: the value of Status Register 3
|
||||
Returns:
|
||||
EFI_SUCCESS:
|
||||
EFI_WRITE_PROTECTED: The disk is write protected
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: StatusRegister3 - add argument and description to function comment
|
||||
{
|
||||
if (StatusRegister3 & STS3_WP) {
|
||||
return EFI_WRITE_PROTECTED;
|
||||
@@ -1375,29 +1297,24 @@ CheckStatus3 (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Calculate the number of block in the same cylinder
|
||||
according to LBA
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param LBA EFI_LBA: The starting logic block address
|
||||
@param NumberOfBlocks UINTN: The number of blocks
|
||||
|
||||
@return The number of blocks in the same cylinder which the starting
|
||||
logic block address is LBA
|
||||
|
||||
**/
|
||||
UINTN
|
||||
GetTransferBlockCount (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN EFI_LBA LBA,
|
||||
IN UINTN NumberOfBlocks
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Calculate the number of block in the same cylinder
|
||||
according to LBA
|
||||
Parameters:
|
||||
FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
LBA EFI_LBA: The starting logic block address
|
||||
NumberOfBlocks UINTN: The number of blocks
|
||||
Returns:
|
||||
UINTN : The number of blocks in the same cylinder which the starting
|
||||
logic block address is LBA
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: LBA - add argument and description to function comment
|
||||
// GC_TODO: NumberOfBlocks - add argument and description to function comment
|
||||
{
|
||||
UINT8 EndOfTrack;
|
||||
UINT8 Head;
|
||||
@@ -1417,26 +1334,20 @@ GetTransferBlockCount (
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
When the Timer(2s) off, turn the drive's motor off
|
||||
|
||||
@param Event EFI_EVENT: Event(the timer) whose notification function is being
|
||||
invoked
|
||||
@param Context VOID *: Pointer to the notification function's context
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
FddTimerProc (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: When the Timer(2s) off, turn the drive's motor off
|
||||
Parameters:
|
||||
Event EFI_EVENT: Event(the timer) whose notification function is being
|
||||
invoked
|
||||
Context VOID *: Pointer to the notification function's context
|
||||
Returns:
|
||||
VOID
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: Event - add argument and description to function comment
|
||||
// GC_TODO: Context - add argument and description to function comment
|
||||
{
|
||||
FDC_BLK_IO_DEV *FdcDev;
|
||||
UINT8 data;
|
||||
@@ -1462,21 +1373,18 @@ FddTimerProc (
|
||||
MicroSecondDelay (500);
|
||||
}
|
||||
|
||||
/**
|
||||
Read I/O port for FDC
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param Offset The offset address of port
|
||||
|
||||
**/
|
||||
UINT8
|
||||
FdcReadPort (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN UINT32 Offset
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Read I/O port for FDC
|
||||
Parameters:
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Offset - add argument and description to function comment
|
||||
{
|
||||
UINT8 Data;
|
||||
|
||||
@@ -1494,23 +1402,19 @@ FdcReadPort (
|
||||
return Data;
|
||||
}
|
||||
|
||||
/**
|
||||
Write I/O port for FDC
|
||||
|
||||
@param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV
|
||||
@param Offset The offset address of port
|
||||
|
||||
**/
|
||||
VOID
|
||||
FdcWritePort (
|
||||
IN FDC_BLK_IO_DEV *FdcDev,
|
||||
IN UINT32 Offset,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description: Write I/O port for FDC
|
||||
Parameters:
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: function comment is missing 'Arguments:'
|
||||
// GC_TODO: FdcDev - add argument and description to function comment
|
||||
// GC_TODO: Offset - add argument and description to function comment
|
||||
// GC_TODO: Data - add argument and description to function comment
|
||||
{
|
||||
|
||||
//
|
||||
@@ -1524,3 +1428,4 @@ FdcWritePort (
|
||||
&Data
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -232,7 +232,7 @@ AddName (
|
||||
IN SERIAL_DEV *SerialDevice,
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -247,7 +247,7 @@ AddName (
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
CHAR16 SerialPortName[sizeof (SERIAL_PORT_NAME)];
|
||||
|
||||
|
@@ -156,7 +156,7 @@ AddName (
|
||||
IN SERIAL_DEV *SerialDevice,
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -171,7 +171,7 @@ AddName (
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**@file
|
||||
Serial driver for standard UARTS on an ISA bus.
|
||||
Serial driver for standard UARTS on an ISA bus.
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -122,7 +122,16 @@ InitializeIsaSerial (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Check to see if this driver supports the given controller
|
||||
|
||||
@param This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
@param Controller - The handle of the controller to test.
|
||||
@param RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
@return EFI_SUCCESS - This driver can support the given controller
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SerialControllerDriverSupported (
|
||||
@@ -130,23 +139,7 @@ SerialControllerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Check to see if this driver supports the given controller
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
Controller - The handle of the controller to test.
|
||||
RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - This driver can support the given controller
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
||||
@@ -265,6 +258,16 @@ Error:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Start to management the controller passed in
|
||||
|
||||
@param This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
@param Controller - The handle of the controller to test.
|
||||
@param RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
@return EFI_SUCCESS - Driver is started successfully
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SerialControllerDriverStart (
|
||||
@@ -272,23 +275,7 @@ SerialControllerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Start to management the controller passed in
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
Controller - The handle of the controller to test.
|
||||
RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Driver is started successfully
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
@@ -527,6 +514,18 @@ Error:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Disconnect this driver with the controller, uninstall related protocol instance
|
||||
|
||||
@param This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
@param Controller - The handle of the controller to test.
|
||||
@param NumberOfChildren - Number of child device.
|
||||
@param RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
@retval EFI_SUCCESS - Operation successfully
|
||||
@retval EFI_DEVICE_ERROR - Cannot stop the driver successfully
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SerialControllerDriverStop (
|
||||
@@ -535,25 +534,7 @@ SerialControllerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Disconnect this driver with the controller, uninstall related protocol instance
|
||||
|
||||
Arguments:
|
||||
|
||||
This - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||
Controller - The handle of the controller to test.
|
||||
NumberOfChildren - Number of child device.
|
||||
RemainingDevicePath - A pointer to the remaining portion of a device path.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Operation successfully
|
||||
EFI_DEVICE_ERROR - Cannot stop the driver successfully
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
@@ -664,26 +645,19 @@ SerialControllerDriverStop (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Detect whether specific FIFO is full or not
|
||||
|
||||
@param Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
|
||||
@return whether specific FIFO is full or not
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsaSerialFifoFull (
|
||||
IN SERIAL_DEV_FIFO *Fifo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Detect whether specific FIFO is full or not
|
||||
|
||||
Arguments:
|
||||
|
||||
Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - the FIFO is full
|
||||
FALSE - the FIFO is not full
|
||||
|
||||
--*/
|
||||
{
|
||||
if (Fifo->Surplus == 0) {
|
||||
return TRUE;
|
||||
@@ -692,26 +666,20 @@ IsaSerialFifoFull (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Detect whether specific FIFO is empty or not
|
||||
|
||||
|
||||
@param Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
|
||||
@return whether specific FIFO is empty or not
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsaSerialFifoEmpty (
|
||||
IN SERIAL_DEV_FIFO *Fifo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Detect whether specific FIFO is empty or not
|
||||
|
||||
Arguments:
|
||||
|
||||
Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - the FIFO is empty
|
||||
FALSE - the FIFO is not empty
|
||||
|
||||
--*/
|
||||
{
|
||||
if (Fifo->Surplus == SERIAL_MAX_BUFFER_SIZE) {
|
||||
return TRUE;
|
||||
@@ -720,28 +688,22 @@ IsaSerialFifoEmpty (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Add data to specific FIFO
|
||||
|
||||
@param Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
@param Data - the data added to FIFO
|
||||
|
||||
@retval EFI_SUCCESS - Add data to specific FIFO successfully
|
||||
@retval EFI_OUT_OF_RESOURCE - Failed to add data because FIFO is already full
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsaSerialFifoAdd (
|
||||
IN SERIAL_DEV_FIFO *Fifo,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Add data to specific FIFO
|
||||
|
||||
Arguments:
|
||||
|
||||
Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
Data - the data added to FIFO
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Add data to specific FIFO successfully
|
||||
EFI_OUT_OF_RESOURCE - Failed to add data because FIFO is already full
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// if FIFO full can not add data
|
||||
@@ -762,27 +724,22 @@ IsaSerialFifoAdd (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove data from specific FIFO
|
||||
|
||||
@param Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
@param Data - the data removed from FIFO
|
||||
|
||||
@retval EFI_SUCCESS - Remove data from specific FIFO successfully
|
||||
@retval EFI_OUT_OF_RESOURCE - Failed to remove data because FIFO is empty
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsaSerialFifoRemove (
|
||||
IN SERIAL_DEV_FIFO *Fifo,
|
||||
OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Remove data from specific FIFO
|
||||
|
||||
Arguments:
|
||||
|
||||
Fifo - A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||
Data - the data removed from FIFO
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Remove data from specific FIFO successfully
|
||||
EFI_OUT_OF_RESOURCE - Failed to remove data because FIFO is empty
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// if FIFO is empty, no data can remove
|
||||
@@ -803,27 +760,21 @@ IsaSerialFifoRemove (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Reads and writes all avaliable data.
|
||||
|
||||
@param SerialDevice - The device to flush
|
||||
|
||||
@retval EFI_SUCCESS - Data was read/written successfully.
|
||||
@retval EFI_OUT_OF_RESOURCE - Failed because software receive FIFO is full. Note, when
|
||||
this happens, pending writes are not done.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
IsaSerialReceiveTransmit (
|
||||
IN SERIAL_DEV *SerialDevice
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Reads and writes all avaliable data.
|
||||
|
||||
Arguments:
|
||||
|
||||
SerialDevice - The device to flush
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Data was read/written successfully.
|
||||
EFI_OUT_OF_RESOURCE - Failed because software receive FIFO is full. Note, when
|
||||
this happens, pending writes are not done.
|
||||
|
||||
--*/
|
||||
{
|
||||
SERIAL_PORT_LSR Lsr;
|
||||
UINT8 Data;
|
||||
@@ -968,30 +919,24 @@ IsaSerialReceiveTransmit (
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Interface Functions
|
||||
//
|
||||
/**
|
||||
Reset serial device
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS - Reset successfully
|
||||
@retval EFI_DEVICE_ERROR - Failed to reset
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialReset (
|
||||
IN EFI_SERIAL_IO_PROTOCOL *This
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Reset serial device
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Reset successfully
|
||||
EFI_DEVICE_ERROR - Failed to reset
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
SERIAL_DEV *SerialDevice;
|
||||
@@ -1106,6 +1051,23 @@ IsaSerialReset (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set new attributes to a serial device
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
@param BaudRate - The baudrate of the serial device
|
||||
@param ReceiveFifoDepth - The depth of receive FIFO buffer
|
||||
@param Timeout - The request timeout for a single char
|
||||
@param Parity - The type of parity used in serial device
|
||||
@param DataBits - Number of databits used in serial device
|
||||
@param StopBits - Number of stopbits used in serial device
|
||||
|
||||
@retval EFI_SUCCESS - The new attributes were set
|
||||
@retval EFI_INVALID_PARAMETERS - One or more attributes have an unsupported value
|
||||
@retval EFI_UNSUPPORTED - Data Bits can not set to 5 or 6
|
||||
@retval EFI_DEVICE_ERROR - The serial device is not functioning correctly (no return)
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialSetAttributes (
|
||||
@@ -1117,30 +1079,6 @@ IsaSerialSetAttributes (
|
||||
IN UINT8 DataBits,
|
||||
IN EFI_STOP_BITS_TYPE StopBits
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Set new attributes to a serial device
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
BaudRate - The baudrate of the serial device
|
||||
ReceiveFifoDepth - The depth of receive FIFO buffer
|
||||
Timeout - The request timeout for a single char
|
||||
Parity - The type of parity used in serial device
|
||||
DataBits - Number of databits used in serial device
|
||||
StopBits - Number of stopbits used in serial device
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The new attributes were set
|
||||
EFI_INVALID_PARAMETERS - One or more attributes have an unsupported value
|
||||
EFI_UNSUPPORTED - Data Bits can not set to 5 or 6
|
||||
EFI_DEVICE_ERROR - The serial device is not functioning correctly (no return)
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
SERIAL_DEV *SerialDevice;
|
||||
@@ -1424,29 +1362,22 @@ IsaSerialSetAttributes (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set Control Bits
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
@param Control - Control bits that can be settable
|
||||
|
||||
@retval EFI_SUCCESS - New Control bits were set successfully
|
||||
@retval EFI_UNSUPPORTED - The Control bits wanted to set are not supported
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialSetControl (
|
||||
IN EFI_SERIAL_IO_PROTOCOL *This,
|
||||
IN UINT32 Control
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Set Control Bits
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
Control - Control bits that can be settable
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - New Control bits were set successfully
|
||||
EFI_UNSUPPORTED - The Control bits wanted to set are not supported
|
||||
|
||||
--*/
|
||||
{
|
||||
SERIAL_DEV *SerialDevice;
|
||||
SERIAL_PORT_MCR Mcr;
|
||||
@@ -1504,28 +1435,21 @@ IsaSerialSetControl (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Get ControlBits
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
@param Control - Control signals of the serial device
|
||||
|
||||
@retval EFI_SUCCESS - Get Control signals successfully
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialGetControl (
|
||||
IN EFI_SERIAL_IO_PROTOCOL *This,
|
||||
OUT UINT32 *Control
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Get ControlBits
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
Control - Control signals of the serial device
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Get Control signals successfully
|
||||
|
||||
--*/
|
||||
{
|
||||
SERIAL_DEV *SerialDevice;
|
||||
SERIAL_PORT_MSR Msr;
|
||||
@@ -1604,6 +1528,19 @@ IsaSerialGetControl (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Write the specified number of bytes to serial device
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
@param BufferSize - On input the size of Buffer, on output the amount of
|
||||
data actually written
|
||||
@param Buffer - The buffer of data to write
|
||||
|
||||
@retval EFI_SUCCESS - The data were written successfully
|
||||
@retval EFI_DEVICE_ERROR - The device reported an error
|
||||
@retval EFI_TIMEOUT - The write operation was stopped due to timeout
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialWrite (
|
||||
@@ -1611,26 +1548,6 @@ IsaSerialWrite (
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Write the specified number of bytes to serial device
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
BufferSize - On input the size of Buffer, on output the amount of
|
||||
data actually written
|
||||
Buffer - The buffer of data to write
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data were written successfully
|
||||
EFI_DEVICE_ERROR - The device reported an error
|
||||
EFI_TIMEOUT - The write operation was stopped due to timeout
|
||||
|
||||
--*/
|
||||
{
|
||||
SERIAL_DEV *SerialDevice;
|
||||
UINT8 *CharBuffer;
|
||||
@@ -1692,6 +1609,19 @@ IsaSerialWrite (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Read the specified number of bytes from serial device
|
||||
|
||||
@param This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
@param BufferSize - On input the size of Buffer, on output the amount of
|
||||
data returned in buffer
|
||||
@param Buffer - The buffer to return the data into
|
||||
|
||||
@retval EFI_SUCCESS - The data were read successfully
|
||||
@retval EFI_DEVICE_ERROR - The device reported an error
|
||||
@retval EFI_TIMEOUT - The read operation was stopped due to timeout
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IsaSerialRead (
|
||||
@@ -1699,26 +1629,6 @@ IsaSerialRead (
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Read the specified number of bytes from serial device
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer to EFI_SERIAL_IO_PROTOCOL
|
||||
BufferSize - On input the size of Buffer, on output the amount of
|
||||
data returned in buffer
|
||||
Buffer - The buffer to return the data into
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The data were read successfully
|
||||
EFI_DEVICE_ERROR - The device reported an error
|
||||
EFI_TIMEOUT - The read operation was stopped due to timeout
|
||||
|
||||
--*/
|
||||
{
|
||||
SERIAL_DEV *SerialDevice;
|
||||
UINT32 Index;
|
||||
@@ -1793,26 +1703,18 @@ IsaSerialRead (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Use scratchpad register to test if this serial port is present
|
||||
|
||||
@param SerialDevice - Pointer to serial device structure
|
||||
|
||||
@return if this serial port is present
|
||||
**/
|
||||
BOOLEAN
|
||||
IsaSerialPortPresent (
|
||||
IN SERIAL_DEV *SerialDevice
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Use scratchpad register to test if this serial port is present
|
||||
|
||||
Arguments:
|
||||
|
||||
SerialDevice - Pointer to serial device structure
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - The serial port is present
|
||||
FALSE - The serial port is NOT present
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 Temp;
|
||||
BOOLEAN Status;
|
||||
@@ -1845,29 +1747,22 @@ IsaSerialPortPresent (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Use IsaIo protocol to read serial port
|
||||
|
||||
@param IsaIo - Pointer to EFI_ISA_IO_PROTOCOL instance
|
||||
@param BaseAddress - Serial port register group base address
|
||||
@param Offset - Offset in register group
|
||||
|
||||
@return Data read from serial port
|
||||
|
||||
**/
|
||||
UINT8
|
||||
IsaSerialReadPort (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT16 BaseAddress,
|
||||
IN UINT32 Offset
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Use IsaIo protocol to read serial port
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - Pointer to EFI_ISA_IO_PROTOCOL instance
|
||||
BaseAddress - Serial port register group base address
|
||||
Offset - Offset in register group
|
||||
|
||||
Returns:
|
||||
|
||||
Data read from serial port
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 Data;
|
||||
|
||||
@@ -1884,6 +1779,15 @@ IsaSerialReadPort (
|
||||
return Data;
|
||||
}
|
||||
|
||||
/**
|
||||
Use IsaIo protocol to write serial port
|
||||
|
||||
@param IsaIo - Pointer to EFI_ISA_IO_PROTOCOL instance
|
||||
@param BaseAddress - Serial port register group base address
|
||||
@param Offset - Offset in register group
|
||||
@param Data - data which is to be written to some serial port register
|
||||
|
||||
**/
|
||||
VOID
|
||||
IsaSerialWritePort (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
@@ -1891,24 +1795,6 @@ IsaSerialWritePort (
|
||||
IN UINT32 Offset,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Use IsaIo protocol to write serial port
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - Pointer to EFI_ISA_IO_PROTOCOL instance
|
||||
BaseAddress - Serial port register group base address
|
||||
Offset - Offset in register group
|
||||
Data - data which is to be written to some serial port register
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Use IsaIo to access IO
|
||||
|
@@ -635,26 +635,20 @@ ConvertKeyboardScanCodeToEfiKey[] = {
|
||||
//
|
||||
STATIC UINTN mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
|
||||
|
||||
/**
|
||||
Read data register
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
|
||||
@return return the value
|
||||
|
||||
**/
|
||||
STATIC
|
||||
UINT8
|
||||
KeyReadDataRegister (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
UINT8 Data;
|
||||
@@ -675,28 +669,20 @@ Returns:
|
||||
return Data;
|
||||
}
|
||||
|
||||
/**
|
||||
Write data register
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data value wanted to be written
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
KeyWriteDataRegister (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
|
||||
@@ -718,25 +704,18 @@ Returns:
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
Read status register
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
|
||||
@return value in status register
|
||||
|
||||
**/
|
||||
UINT8
|
||||
KeyReadStatusRegister (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
UINT8 Data;
|
||||
@@ -758,28 +737,20 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Write command register
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data The value wanted to be written
|
||||
|
||||
**/
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
KeyWriteCommandRegister (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
|
||||
@@ -798,25 +769,19 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Display error message
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param ErrMsg Unicode string of error message
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
KeyboardError (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN CHAR16 *ErrMsg
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Display error message
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: ConsoleIn - add argument and description to function comment
|
||||
// GC_TODO: ErrMsg - add argument and description to function comment
|
||||
{
|
||||
ConsoleIn->KeyboardErr = TRUE;
|
||||
|
||||
@@ -826,30 +791,24 @@ Returns:
|
||||
//
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardTimerHandler (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
/**
|
||||
Timer event handler: read a series of scancodes from 8042
|
||||
and put them into memory scancode buffer.
|
||||
it read as much scancodes to either fill
|
||||
the memory buffer or empty the keyboard buffer.
|
||||
It is registered as running under TPL_NOTIFY
|
||||
|
||||
Arguments:
|
||||
@param Event - The timer event
|
||||
@param Context - A KEYBOARD_CONSOLE_IN_DEV pointer
|
||||
|
||||
Event - The timer event
|
||||
Context - A KEYBOARD_CONSOLE_IN_DEV pointer
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardTimerHandler (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 Data;
|
||||
EFI_TPL OldTpl;
|
||||
@@ -942,6 +901,17 @@ Returns:
|
||||
return ;
|
||||
}
|
||||
|
||||
/**
|
||||
Read several bytes from the scancode buffer without removing them.
|
||||
This function is called to see if there are enough bytes of scancode
|
||||
representing a single key.
|
||||
|
||||
@param Count - Number of bytes to be read
|
||||
@param Buf - Store the results
|
||||
|
||||
@retval EFI_SUCCESS success to scan the keyboard code
|
||||
@retval EFI_NOT_READY invalid parameter
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
GetScancodeBufHead (
|
||||
@@ -949,27 +919,6 @@ GetScancodeBufHead (
|
||||
IN UINT32 Count,
|
||||
OUT UINT8 *Buf
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Read several bytes from the scancode buffer without removing them.
|
||||
This function is called to see if there are enough bytes of scancode
|
||||
representing a single key.
|
||||
|
||||
Arguments:
|
||||
|
||||
Count - Number of bytes to be read
|
||||
Buf - Store the results
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
--*/
|
||||
// GC_TODO: ConsoleIn - add argument and description to function comment
|
||||
// GC_TODO: EFI_NOT_READY - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 Pos;
|
||||
@@ -1005,6 +954,17 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Read & remove several bytes from the scancode buffer.
|
||||
This function is usually called after GetScancodeBufHead()
|
||||
|
||||
@param Count - Number of bytes to be read
|
||||
@param Buf - Store the results
|
||||
|
||||
@retval EFI_SUCCESS success to scan the keyboard code
|
||||
@retval EFI_NOT_READY invalid parameter
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
PopScancodeBufHead (
|
||||
@@ -1012,26 +972,6 @@ PopScancodeBufHead (
|
||||
IN UINT32 Count,
|
||||
OUT UINT8 *Buf
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Read & remove several bytes from the scancode buffer.
|
||||
This function is usually called after GetScancodeBufHead()
|
||||
|
||||
Arguments:
|
||||
|
||||
Count - Number of bytes to be read
|
||||
Buf - Store the results
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
--*/
|
||||
// GC_TODO: ConsoleIn - add argument and description to function comment
|
||||
// GC_TODO: EFI_NOT_READY - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
UINT32 Index;
|
||||
|
||||
@@ -1068,28 +1008,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Read key value
|
||||
|
||||
@param ConsoleIn - Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data - Pointer to outof buffer for keeping key value
|
||||
|
||||
@retval EFI_TIMEOUT Status resigter time out
|
||||
@retval EFI_SUCCESS Success to read keyboard
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
KeyboardRead (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 TimeOut;
|
||||
UINT32 RegFilled;
|
||||
@@ -1117,29 +1051,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
write key to keyboard
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data value wanted to be written
|
||||
|
||||
@retval EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
@retval EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
KeyboardWrite (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 TimeOut;
|
||||
UINT32 RegEmptied;
|
||||
@@ -1170,30 +1097,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue keyboard command
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data The buff holding the command
|
||||
|
||||
@retval EFI_TIMEOUT Keyboard is not ready to issuing
|
||||
@retval EFI_SUCCESS Success to issue keyboard command
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
KeyboardCommand (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 TimeOut;
|
||||
UINT32 RegEmptied;
|
||||
@@ -1241,32 +1160,24 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
wait for a specific value to be presented on
|
||||
8042 Data register by keyboard and then read it,
|
||||
used in keyboard commands ack
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Value the value wanted to be waited.
|
||||
|
||||
@retval EFI_TIMEOUT Fail to get specific value in given time
|
||||
@retval EFI_SUCCESS Success to get specific value in given time.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
KeyboardWaitForValue (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN UINT8 Value
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
wait for a specific value to be presented on
|
||||
8042 Data register by keyboard and then read it,
|
||||
used in keyboard commands ack
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - The KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
Value - The value to be waited for
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
--*/
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
// GC_TODO: EFI_TIMEOUT - add return value to function comment
|
||||
{
|
||||
UINT8 Data;
|
||||
UINT32 TimeOut;
|
||||
@@ -1324,23 +1235,19 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Show keyboard status lights according to
|
||||
indicators in ConsoleIn.
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
|
||||
@return status
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateStatusLights (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Show keyboard status lights according to
|
||||
indicators in ConsoleIn.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: ConsoleIn - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Command;
|
||||
@@ -1381,28 +1288,21 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
KeyGetchar (
|
||||
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
/**
|
||||
Get scancode from scancode buffer
|
||||
and translate into EFI-scancode and unicode defined by EFI spec
|
||||
The function is always called in TPL_NOTIFY
|
||||
|
||||
Arguments:
|
||||
@param ConsoleIn KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
|
||||
ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
@retval EFI_NOT_READY - Input from console not ready yet.
|
||||
@retval EFI_SUCCESS - Function executed successfully.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_NOT_READY - Input from console not ready yet.
|
||||
EFI_SUCCESS - Function executed successfully.
|
||||
|
||||
--*/
|
||||
**/
|
||||
EFI_STATUS
|
||||
KeyGetchar (
|
||||
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 ScanCode;
|
||||
@@ -1740,32 +1640,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Perform 8042 controller and keyboard Initialization
|
||||
If ExtendedVerification is TRUE, do additional test for
|
||||
the keyboard interface
|
||||
|
||||
@param ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
@param ExtendedVerification - indicates a thorough initialization
|
||||
|
||||
@retval EFI_DEVICE_ERROR Fail to init keyboard
|
||||
@retval EFI_SUCCESS Success to init keyboard
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitKeyboard (
|
||||
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Perform 8042 controller and keyboard Initialization
|
||||
If ExtendedVerification is TRUE, do additional test for
|
||||
the keyboard interface
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
ExtendedVerification - indicates a thorough initialization
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
--*/
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status1;
|
||||
@@ -2086,26 +1976,18 @@ Done:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Disable the keyboard interface of the 8042 controller
|
||||
|
||||
@param ConsoleIn - the device instance
|
||||
|
||||
@return status of issuing disable command
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DisableKeyboard (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Disable the keyboard interface of the 8042 controller
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - the device instance
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
--*/
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -2170,3 +2052,4 @@ CheckKeyboardConnect (
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -45,54 +45,48 @@ KeyboardCheckForKey (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This
|
||||
);
|
||||
|
||||
/**
|
||||
@param RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was registered.
|
||||
@param InputData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
@retval TRUE - Key be pressed matches a registered key.
|
||||
@retval FALSE - Match failed.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsKeyRegistered (
|
||||
IN EFI_KEY_DATA *RegsiteredData,
|
||||
IN EFI_KEY_DATA *InputData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was registered.
|
||||
InputData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
Returns:
|
||||
TRUE - Key be pressed matches a registered key.
|
||||
FLASE - Match failed.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
|
||||
@param ConsoleInDev - Ps2 Keyboard private structure
|
||||
@param KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The keystroke information was returned.
|
||||
@retval EFI_NOT_READY - There was no keystroke data availiable.
|
||||
@retval EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
@retval EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
KeyboardReadKeyStrokeWorker (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
Arguments:
|
||||
ConsoleInDev - Ps2 Keyboard private structure
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The keystroke information was returned.
|
||||
EFI_NOT_READY - There was no keystroke data availiable.
|
||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
@@ -161,29 +155,23 @@ KeyboardReadKeyStrokeWorker (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
logic reset keyboard
|
||||
Implement SIMPLE_TEXT_IN.Reset()
|
||||
Perform 8042 controller and keyboard initialization
|
||||
|
||||
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
|
||||
@param ExtendedVerification Indicate that the driver may perform a more
|
||||
exhaustive verification operation of the device during
|
||||
reset, now this par is ignored in this driver
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardEfiReset (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Implement SIMPLE_TEXT_IN.Reset()
|
||||
Perform 8042 controller and keyboard initialization
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: ExtendedVerification - add argument and description to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;
|
||||
@@ -251,29 +239,21 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Implement SIMPLE_TEXT_IN.ReadKeyStroke().
|
||||
Retrieve key values for driver user.
|
||||
|
||||
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
|
||||
@param Key The output buffer for key value
|
||||
|
||||
@retval EFI_SUCCESS success to read key stroke
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardReadKeyStroke (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Implement SIMPLE_TEXT_IN.ReadKeyStroke().
|
||||
Retrieve key values for driver user.
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Key - add argument and description to function comment
|
||||
// GC_TODO: EFI_DEVICE_ERROR - add return value to function comment
|
||||
// GC_TODO: EFI_NOT_READY - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;
|
||||
@@ -290,26 +270,20 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Event notification function for SIMPLE_TEXT_IN.WaitForKey event
|
||||
Signal the event if there is key available
|
||||
|
||||
@param Event the event object
|
||||
@param Context waitting context
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardWaitForKey (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Event notification function for SIMPLE_TEXT_IN.WaitForKey event
|
||||
Signal the event if there is key available
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: Event - add argument and description to function comment
|
||||
// GC_TODO: Context - add argument and description to function comment
|
||||
{
|
||||
EFI_TPL OldTpl;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;
|
||||
@@ -343,25 +317,17 @@ Returns:
|
||||
return ;
|
||||
}
|
||||
|
||||
/**
|
||||
Check keyboard for given key value
|
||||
|
||||
@param This Point to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS success check keyboard value
|
||||
**/
|
||||
EFI_STATUS
|
||||
KeyboardCheckForKey (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleIn;
|
||||
|
||||
@@ -377,28 +343,25 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Judge whether is a registed key
|
||||
|
||||
@param RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was registered.
|
||||
@param InputData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
@retval TRUE - Key be pressed matches a registered key.
|
||||
@retval FLASE - Match failed.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsKeyRegistered (
|
||||
IN EFI_KEY_DATA *RegsiteredData,
|
||||
IN EFI_KEY_DATA *InputData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was registered.
|
||||
InputData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
Returns:
|
||||
TRUE - Key be pressed matches a registered key.
|
||||
FLASE - Match failed.
|
||||
|
||||
--*/
|
||||
{
|
||||
ASSERT (RegsiteredData != NULL && InputData != NULL);
|
||||
|
||||
@@ -423,24 +386,21 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
||||
Signal the event if there is key available
|
||||
|
||||
@param Event event object
|
||||
@param Context waiting context
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardWaitForKeyEx (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
||||
Signal the event if there is key available
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
|
||||
@@ -449,27 +409,24 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Reset the input device and optionaly run diagnostics
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param ExtendedVerification - Driver may perform diagnostics on reset.
|
||||
|
||||
@retval EFI_SUCCESS - The device was reset.
|
||||
@retval EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardEfiResetEx (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reset the input device and optionaly run diagnostics
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
ExtendedVerification - Driver may perform diagnostics on reset.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device was reset.
|
||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
@@ -498,31 +455,29 @@ KeyboardEfiResetEx (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
@retval EFI_SUCCESS - The keystroke information was returned.
|
||||
@retval EFI_NOT_READY - There was no keystroke data availiable.
|
||||
@retval EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
@retval EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardReadKeyStrokeEx (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The keystroke information was returned.
|
||||
EFI_NOT_READY - There was no keystroke data availiable.
|
||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
|
||||
@@ -535,30 +490,27 @@ KeyboardReadKeyStrokeEx (
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Set certain state for the input device.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||
state for the input device.
|
||||
|
||||
@retval EFI_SUCCESS - The device state was set successfully.
|
||||
@retval EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||
not have the setting adjusted.
|
||||
@retval EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||
@retval EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardSetState (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_TOGGLE_STATE *KeyToggleState
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Set certain state for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||
state for the input device.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device state was set successfully.
|
||||
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||
not have the setting adjusted.
|
||||
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
@@ -619,6 +571,22 @@ Exit:
|
||||
return Status;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Register a notification function for a particular keystroke for the input device.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
information data for the key that was pressed.
|
||||
@param KeyNotificationFunction - Points to the function to be called when the key
|
||||
sequence is typed specified by KeyData.
|
||||
@param NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||
|
||||
@retval EFI_SUCCESS - The notification function was registered successfully.
|
||||
@retval EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||
@retval EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardRegisterKeyNotify (
|
||||
@@ -627,25 +595,6 @@ KeyboardRegisterKeyNotify (
|
||||
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
|
||||
OUT EFI_HANDLE *NotifyHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Register a notification function for a particular keystroke for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
information data for the key that was pressed.
|
||||
KeyNotificationFunction - Points to the function to be called when the key
|
||||
sequence is typed specified by KeyData.
|
||||
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The notification function was registered successfully.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
@@ -720,27 +669,24 @@ Exit:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Remove a registered notification function from a particular keystroke.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param NotificationHandle - The handle of the notification function being unregistered.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The notification function was unregistered successfully.
|
||||
@retval EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||
@retval EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardUnregisterKeyNotify (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_HANDLE NotificationHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Remove a registered notification function from a particular keystroke.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
NotificationHandle - The handle of the notification function being unregistered.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The notification function was unregistered successfully.
|
||||
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||
EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev;
|
||||
|
@@ -62,6 +62,16 @@ EFI_DRIVER_BINDING_PROTOCOL gKeyboardControllerDriver = {
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
Test controller is a keyboard Controller
|
||||
|
||||
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param Controller driver's controller
|
||||
@param RemainingDevicePath children device path
|
||||
|
||||
@retval EFI_UNSUPPORTED controller is not floppy disk
|
||||
@retval EFI_SUCCESS controller is floppy disk
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KbdControllerDriverSupported (
|
||||
@@ -69,20 +79,6 @@ KbdControllerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
ControllerDriver Protocol Method
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
@@ -120,6 +116,15 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Create KEYBOARD_CONSOLE_IN_DEV instance on controller.
|
||||
|
||||
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
|
||||
@param Controller driver controller handle
|
||||
@param RemainingDevicePath Children's device path
|
||||
|
||||
@retval whether success to create floppy control instance.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KbdControllerDriverStart (
|
||||
@@ -127,19 +132,6 @@ KbdControllerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
// GC_TODO: EFI_INVALID_PARAMETER - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status1;
|
||||
@@ -388,6 +380,20 @@ ErrorExit:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. Support stoping any child handles
|
||||
created by this driver.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to stop driver on
|
||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
|
||||
children is zero stop the entire bus driver.
|
||||
@param ChildHandleBuffer List of Child Handles to Stop.
|
||||
|
||||
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
||||
@retval other This driver was not removed from this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KbdControllerDriverStop (
|
||||
@@ -396,20 +402,6 @@ KbdControllerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: NumberOfChildren - add argument and description to function comment
|
||||
// GC_TODO: ChildHandleBuffer - add argument and description to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
|
||||
@@ -517,25 +509,16 @@ KbdControllerDriverStop (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Free the waiting key notify list.
|
||||
|
||||
@param ListHead Pointer to list head
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
KbdFreeNotifyList (
|
||||
IN OUT LIST_ENTRY *ListHead
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
ListHead - The list head
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Free the notify list successfully
|
||||
EFI_INVALID_PARAMETER - ListHead is invalid.
|
||||
|
||||
--*/
|
||||
{
|
||||
KEYBOARD_CONSOLE_IN_EX_NOTIFY *NotifyNode;
|
||||
|
||||
@@ -591,3 +574,4 @@ InitializePs2Keyboard(
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@@ -131,28 +131,22 @@ extern EFI_GUID gSimpleTextInExNotifyGuid;
|
||||
//
|
||||
// Driver entry point
|
||||
//
|
||||
/**
|
||||
The user Entry Point for module Ps2Keyboard. The user code starts with this function.
|
||||
|
||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param[in] SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||
@retval other Some error occurs when executing this entry point.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InstallPs2KeyboardDriver (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ImageHandle - GC_TODO: add argument description
|
||||
SystemTable - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#define KEYBOARD_8042_DATA_REGISTER 0x60
|
||||
@@ -191,233 +185,170 @@ Returns:
|
||||
//
|
||||
// Other functions that are used among .c files
|
||||
//
|
||||
/**
|
||||
Show keyboard status lights according to
|
||||
indicators in ConsoleIn.
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
|
||||
@return status
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateStatusLights (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Show keyboard status light for ScrollLock, NumLock and CapsLock
|
||||
according to indicators in ConsoleIn.
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - driver private structure
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - Show the status light successfully.
|
||||
EFI_TIMEOUT - Timeout when operating read/write on registers.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
write key to keyboard
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
@param Data value wanted to be written
|
||||
|
||||
@retval EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
@retval EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
KeyboardRead (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Get scancode from scancode buffer
|
||||
and translate into EFI-scancode and unicode defined by EFI spec
|
||||
The function is always called in TPL_NOTIFY
|
||||
|
||||
@param ConsoleIn KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
|
||||
@retval EFI_NOT_READY - Input from console not ready yet.
|
||||
@retval EFI_SUCCESS - Function executed successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
KeyGetchar (
|
||||
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Perform 8042 controller and keyboard Initialization
|
||||
If ExtendedVerification is TRUE, do additional test for
|
||||
the keyboard interface
|
||||
|
||||
@param ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer
|
||||
@param ExtendedVerification - indicates a thorough initialization
|
||||
|
||||
@retval EFI_DEVICE_ERROR Fail to init keyboard
|
||||
@retval EFI_SUCCESS Success to init keyboard
|
||||
**/
|
||||
EFI_STATUS
|
||||
InitKeyboard (
|
||||
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
ExtendedVerification - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Disable the keyboard interface of the 8042 controller
|
||||
|
||||
@param ConsoleIn - the device instance
|
||||
|
||||
@return status of issuing disable command
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DisableKeyboard (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Timer event handler: read a series of scancodes from 8042
|
||||
and put them into memory scancode buffer.
|
||||
it read as much scancodes to either fill
|
||||
the memory buffer or empty the keyboard buffer.
|
||||
It is registered as running under TPL_NOTIFY
|
||||
|
||||
@param Event - The timer event
|
||||
@param Context - A KEYBOARD_CONSOLE_IN_DEV pointer
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardTimerHandler (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Event - GC_TODO: add argument description
|
||||
Context - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
logic reset keyboard
|
||||
Implement SIMPLE_TEXT_IN.Reset()
|
||||
Perform 8042 controller and keyboard initialization
|
||||
|
||||
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
|
||||
@param ExtendedVerification Indicate that the driver may perform a more
|
||||
exhaustive verification operation of the device during
|
||||
reset, now this par is ignored in this driver
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardEfiReset (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
ExtendedVerification - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Implement SIMPLE_TEXT_IN.ReadKeyStroke().
|
||||
Retrieve key values for driver user.
|
||||
|
||||
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
|
||||
@param Key The output buffer for key value
|
||||
|
||||
@retval EFI_SUCCESS success to read key stroke
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardReadKeyStroke (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
Key - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Event notification function for SIMPLE_TEXT_IN.WaitForKey event
|
||||
Signal the event if there is key available
|
||||
|
||||
@param Event the event object
|
||||
@param Context waitting context
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardWaitForKey (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
Event - GC_TODO: add argument description
|
||||
Context - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Read status register
|
||||
|
||||
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
|
||||
|
||||
@return value in status register
|
||||
|
||||
**/
|
||||
UINT8
|
||||
KeyReadStatusRegister (
|
||||
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
ConsoleIn - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -437,106 +368,106 @@ CheckKeyboardConnect (
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
||||
Signal the event if there is key available
|
||||
|
||||
@param Event event object
|
||||
@param Context waiting context
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyboardWaitForKeyEx (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
||||
Signal the event if there is key available
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
//
|
||||
// Simple Text Input Ex protocol function prototypes
|
||||
//
|
||||
|
||||
/**
|
||||
Reset the input device and optionaly run diagnostics
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param ExtendedVerification - Driver may perform diagnostics on reset.
|
||||
|
||||
@retval EFI_SUCCESS - The device was reset.
|
||||
@retval EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardEfiResetEx (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reset the input device and optionaly run diagnostics
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
ExtendedVerification - Driver may perform diagnostics on reset.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device was reset.
|
||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
@retval EFI_SUCCESS - The keystroke information was returned.
|
||||
@retval EFI_NOT_READY - There was no keystroke data availiable.
|
||||
@retval EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
@retval EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardReadKeyStrokeEx (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
state data for the key that was pressed.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The keystroke information was returned.
|
||||
EFI_NOT_READY - There was no keystroke data availiable.
|
||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||
hardware errors.
|
||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Set certain state for the input device.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||
state for the input device.
|
||||
|
||||
@retval EFI_SUCCESS - The device state was set successfully.
|
||||
@retval EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||
not have the setting adjusted.
|
||||
@retval EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||
@retval EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardSetState (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_TOGGLE_STATE *KeyToggleState
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Set certain state for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||
state for the input device.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device state was set successfully.
|
||||
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||
not have the setting adjusted.
|
||||
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Register a notification function for a particular keystroke for the input device.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
information data for the key that was pressed.
|
||||
@param KeyNotificationFunction - Points to the function to be called when the key
|
||||
sequence is typed specified by KeyData.
|
||||
@param NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||
|
||||
@retval EFI_SUCCESS - The notification function was registered successfully.
|
||||
@retval EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||
@retval EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardRegisterKeyNotify (
|
||||
@@ -545,48 +476,26 @@ KeyboardRegisterKeyNotify (
|
||||
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
|
||||
OUT EFI_HANDLE *NotifyHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Register a notification function for a particular keystroke for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
information data for the key that was pressed.
|
||||
KeyNotificationFunction - Points to the function to be called when the key
|
||||
sequence is typed specified by KeyData.
|
||||
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The notification function was registered successfully.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Remove a registered notification function from a particular keystroke.
|
||||
|
||||
@param This - Protocol instance pointer.
|
||||
@param NotificationHandle - The handle of the notification function being unregistered.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The notification function was unregistered successfully.
|
||||
@retval EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||
@retval EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
KeyboardUnregisterKeyNotify (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_HANDLE NotificationHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Remove a registered notification function from a particular keystroke.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
NotificationHandle - The handle of the notification function being unregistered.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The notification function was unregistered successfully.
|
||||
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||
EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
@@ -19,26 +19,18 @@ UINT8 SampleRateTbl[MAX_SR] = { 0xa, 0x14, 0x28, 0x3c, 0x50, 0x64, 0xc8 };
|
||||
|
||||
UINT8 ResolutionTbl[MAX_CMR] = { 0, 1, 2, 3 };
|
||||
|
||||
/**
|
||||
Issue self test command via IsaIo interface.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return EFI_SUCCESS Success to do keyboard self testing.
|
||||
@return others Fail to do keyboard self testing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcSelfTest (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -88,25 +80,17 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to enable keyboard AUX functionality.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcEnableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Send 8042 enable mouse command
|
||||
@@ -114,25 +98,17 @@ Returns:
|
||||
return Out8042Command (IsaIo, ENABLE_AUX);
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to disable keyboard AUX functionality.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcDisableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Send 8042 disable mouse command
|
||||
@@ -140,25 +116,17 @@ Returns:
|
||||
return Out8042Command (IsaIo, DISABLE_AUX);
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to enable keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcEnableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Send 8042 enable keyboard command
|
||||
@@ -166,25 +134,17 @@ Returns:
|
||||
return Out8042Command (IsaIo, ENABLE_KB);
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to disable keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcDisableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Send 8042 disable keyboard command
|
||||
@@ -192,27 +152,19 @@ Returns:
|
||||
return Out8042Command (IsaIo, DISABLE_KB);
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to check keyboard status.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param KeyboardEnable return whether keyboard is enable.
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckKbStatus (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
OUT BOOLEAN *KeyboardEnable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
KeyboardEnable - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -241,27 +193,17 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to reset keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseReset (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -296,27 +238,19 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to set mouse's sample rate
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param SampleRate value of sample rate
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetSampleRate (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SR SampleRate
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
SampleRate - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -333,27 +267,19 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to set mouse's resolution.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Resolution value of resolution
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetResolution (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_RE Resolution
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Resolution - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -370,27 +296,19 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to set mouse's scaling.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Scaling value of scaling
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetScaling (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SF Scaling
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Scaling - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 Command;
|
||||
|
||||
@@ -402,25 +320,17 @@ Returns:
|
||||
return Out8042AuxCommand (IsaIo, Command, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
Issue command to enable Ps2 mouse.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseEnable (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// Send auxiliary command to enable mouse
|
||||
@@ -428,26 +338,20 @@ Returns:
|
||||
return Out8042AuxCommand (IsaIo, ENABLE_CMD, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
Get mouse packet . Only care first 3 bytes
|
||||
|
||||
@param MouseDev Pointer of PS2 Mouse Private Data Structure
|
||||
|
||||
@retval EFI_NOT_READY Mouse Device not ready to input data packet, or some error happened during getting the packet
|
||||
@retval EFI_SUCCESS The data packet is gotten successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseGetPacket (
|
||||
PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Get mouse packet . Only care first 3 bytes
|
||||
|
||||
Arguments:
|
||||
|
||||
MouseDev - Pointer of PS2 Mouse Private Data Structure
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_NOT_READY - Mouse Device not ready to input data packet, or some error happened during getting the packet
|
||||
EFI_SUCCESS - The data packet is gotten successfully.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN KeyboardEnable;
|
||||
@@ -569,6 +473,16 @@ Returns:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Read data via IsaIo protocol with given number.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Buffer Buffer receive data of mouse
|
||||
@param BufSize The size of buffer
|
||||
@param State Check input or read data
|
||||
|
||||
@return status of reading mouse data.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseRead (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
@@ -576,24 +490,6 @@ PS2MouseRead (
|
||||
IN OUT UINTN *BufSize,
|
||||
IN UINTN State
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Buffer - GC_TODO: add argument description
|
||||
BufSize - GC_TODO: add argument description
|
||||
State - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BytesRead;
|
||||
@@ -634,30 +530,24 @@ Returns:
|
||||
*BufSize = BytesRead;
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// 8042 I/O function
|
||||
//
|
||||
/**
|
||||
I/O work flow of outing 8042 command.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command I/O command.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042Command (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Command
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Command - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -683,27 +573,20 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Data value
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 temp;
|
||||
@@ -726,28 +609,20 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow of in 8042 data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Data value
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
In8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 temp;
|
||||
@@ -777,32 +652,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 Aux command.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command Aux I/O command
|
||||
@param Resend Whether need resend the Aux command.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042AuxCommand (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Command,
|
||||
IN BOOLEAN Resend
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Command - GC_TODO: add argument description
|
||||
Resend - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -869,27 +734,20 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 Aux data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command Aux I/O command
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Temp;
|
||||
@@ -922,27 +780,20 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow of in 8042 Aux data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Buffer holding return value.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
In8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Data - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -959,26 +810,19 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check keyboard controller status, if it is output buffer full and for auxiliary device
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS Keyboard controller is ready
|
||||
@retval EFI_NOT_READY Keyboard controller is not ready
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckForInput (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_NOT_READY - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT8 Data;
|
||||
|
||||
@@ -994,28 +838,20 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow to wait input buffer empty in given time.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Timeout Wating time.
|
||||
|
||||
@retval EFI_TIMEOUT if input is still not empty in given time.
|
||||
@retval EFI_SUCCESS input is empty.
|
||||
**/
|
||||
EFI_STATUS
|
||||
WaitInputEmpty (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINTN Timeout
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Timeout - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 Data;
|
||||
@@ -1043,12 +879,21 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
I/O work flow to wait output buffer full in given time.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Timeout given time
|
||||
|
||||
@retval EFI_TIMEOUT output is not full in given time
|
||||
@retval EFI_SUCCESS output is full in given time.
|
||||
**/
|
||||
EFI_STATUS
|
||||
WaitOutputFull (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINTN Timeout
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -1064,7 +909,7 @@ Returns:
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 Data;
|
||||
@@ -1092,3 +937,4 @@ Returns:
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/**@file
|
||||
PS2 Mouse Communication Interface
|
||||
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -102,266 +101,184 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
// 0 - output buffer empty
|
||||
// 1 - keyboard controller data in output buffer
|
||||
//
|
||||
|
||||
/**
|
||||
Issue self test command via IsaIo interface.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return EFI_SUCCESS Success to do keyboard self testing.
|
||||
@return others Fail to do keyboard self testing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcSelfTest (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to enable keyboard AUX functionality.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcEnableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to disable keyboard AUX functionality.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcDisableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to enable keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcEnableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to disable keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
KbcDisableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to check keyboard status.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param KeyboardEnable return whether keyboard is enable.
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckKbStatus (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
OUT BOOLEAN *KeyboardEnable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
KeyboardEnable - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to reset keyboard.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseReset (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to set mouse's sample rate
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param SampleRate value of sample rate
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetSampleRate (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SR SampleRate
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
SampleRate - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to set mouse's resolution.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Resolution value of resolution
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetResolution (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_RE Resolution
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Resolution - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to set mouse's scaling.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Scaling value of scaling
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseSetScaling (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SF Scaling
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
Scaling - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Issue command to enable Ps2 mouse.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@return Status of command issuing.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseEnable (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
IsaIo - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Get mouse packet . Only care first 3 bytes
|
||||
|
||||
@param MouseDev Pointer of PS2 Mouse Private Data Structure
|
||||
|
||||
@retval EFI_NOT_READY Mouse Device not ready to input data packet, or some error happened during getting the packet
|
||||
@retval EFI_SUCCESS The data packet is gotten successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseGetPacket (
|
||||
PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
MouseDev - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
/**
|
||||
Read data via IsaIo protocol with given number.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Buffer Buffer receive data of mouse
|
||||
@param BufSize The size of buffer
|
||||
@param State Check input or read data
|
||||
|
||||
@return status of reading mouse data.
|
||||
**/
|
||||
EFI_STATUS
|
||||
PS2MouseRead (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
@@ -373,24 +290,61 @@ PS2MouseRead (
|
||||
//
|
||||
// 8042 I/O function
|
||||
//
|
||||
/**
|
||||
I/O work flow of outing 8042 command.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command I/O command.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042Command (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Command
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow of in 8042 data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Data value
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
In8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Data value
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 Aux command.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command Aux I/O command
|
||||
@param Resend Whether need resend the Aux command.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042AuxCommand (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
@@ -398,29 +352,73 @@ Out8042AuxCommand (
|
||||
IN BOOLEAN Resend
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow of in 8042 Aux data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Data Buffer holding return value.
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
In8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow of outing 8042 Aux data.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Command Aux I/O command
|
||||
|
||||
@retval EFI_SUCCESS Success to excute I/O work flow
|
||||
@retval EFI_TIMEOUT Keyboard controller time out.
|
||||
**/
|
||||
EFI_STATUS
|
||||
Out8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
);
|
||||
|
||||
/**
|
||||
Check keyboard controller status, if it is output buffer full and for auxiliary device
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
|
||||
@retval EFI_SUCCESS Keyboard controller is ready
|
||||
@retval EFI_NOT_READY Keyboard controller is not ready
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckForInput (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow to wait input buffer empty in given time.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Timeout Wating time.
|
||||
|
||||
@retval EFI_TIMEOUT if input is still not empty in given time.
|
||||
@retval EFI_SUCCESS input is empty.
|
||||
**/
|
||||
EFI_STATUS
|
||||
WaitInputEmpty (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINTN Timeout
|
||||
);
|
||||
|
||||
/**
|
||||
I/O work flow to wait output buffer full in given time.
|
||||
|
||||
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
|
||||
@param Timeout given time
|
||||
|
||||
@retval EFI_TIMEOUT output is not full in given time
|
||||
@retval EFI_SUCCESS output is full in given time.
|
||||
**/
|
||||
EFI_STATUS
|
||||
WaitOutputFull (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
|
@@ -28,6 +28,20 @@ EFI_DRIVER_BINDING_PROTOCOL gPS2MouseAbsolutePointerDriver = {
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
Test to see if this driver supports ControllerHandle. Any ControllerHandle
|
||||
than contains a IsaIo protocol can be supported.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to test
|
||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||
device to start.
|
||||
|
||||
@retval EFI_SUCCESS This driver supports this device
|
||||
@retval EFI_ALREADY_STARTED This driver is already running on this device
|
||||
@retval other This driver does not support this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PS2MouseAbsolutePointerDriverSupported (
|
||||
@@ -35,20 +49,6 @@ PS2MouseAbsolutePointerDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
ControllerDriver Protocol Method
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ISA_IO_PROTOCOL *IsaIo;
|
||||
@@ -108,6 +108,21 @@ Returns:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Start this driver on ControllerHandle by opening a IsaIo
|
||||
protocol, creating PS2_MOUSE_ABSOLUTE_POINTER_DEV device and install gEfiAbsolutePointerProtocolGuid
|
||||
finnally.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to bind driver to
|
||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||
device to start.
|
||||
|
||||
@retval EFI_SUCCESS This driver is added to ControllerHandle
|
||||
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
|
||||
@retval other This driver does not support this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PS2MouseAbsolutePointerDriverStart (
|
||||
@@ -115,21 +130,6 @@ PS2MouseAbsolutePointerDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Start protocol interfaces for the mouse device handles.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
Controller - Handle of device to bind driver to.
|
||||
RemainingDevicePath - Not used.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - This driver is added to DeviceHandle.
|
||||
other - Errors occurred.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS EmptyStatus;
|
||||
@@ -385,6 +385,20 @@ ErrorExit:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. Support stoping any child handles
|
||||
created by this driver.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to stop driver on
|
||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
|
||||
children is zero stop the entire bus driver.
|
||||
@param ChildHandleBuffer List of Child Handles to Stop.
|
||||
|
||||
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
||||
@retval other This driver was not removed from this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PS2MouseAbsolutePointerDriverStop (
|
||||
@@ -393,21 +407,6 @@ PS2MouseAbsolutePointerDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: NumberOfChildren - add argument and description to function comment
|
||||
// GC_TODO: ChildHandleBuffer - add argument and description to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
// GC_TODO: EFI_SUCCESS - add return value to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol;
|
||||
@@ -486,29 +485,23 @@ PS2MouseAbsolutePointerDriverStop (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Reset the Mouse and do BAT test for it, if ExtendedVerification isTRUE and there is a mouse device connectted to system
|
||||
|
||||
@param This - Pointer of simple pointer Protocol.
|
||||
@param ExtendedVerification - Whether configure mouse parameters. True: do; FALSE: skip.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS - The command byte is written successfully.
|
||||
@retval EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MouseAbsolutePointerReset (
|
||||
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Reset the Mouse and do BAT test for it, if ExtendedVerification isTRUE and there is a mouse device connectted to system
|
||||
|
||||
Arguments:
|
||||
|
||||
This - Pointer of simple pointer Protocol.
|
||||
ExtendedVerification - Whether configure mouse parameters. True: do; FALSE: skip.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The command byte is written successfully.
|
||||
EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;
|
||||
@@ -608,26 +601,20 @@ Exit:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether there is Ps/2 mouse device in system
|
||||
|
||||
@param PS2_MOUSE_DEV - Mouse Private Data Structure
|
||||
|
||||
@retval TRUE - Keyboard in System.
|
||||
@retval FALSE - Keyboard not in System.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
CheckMouseAbsolutePointerConnect (
|
||||
IN PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Check whether there is Ps/2 mouse device in system
|
||||
|
||||
Arguments:
|
||||
|
||||
PS2_MOUSE_DEV - Mouse Private Data Structure
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - Keyboard in System.
|
||||
FALSE - Keyboard not in System.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -639,30 +626,22 @@ Returns:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Get and Clear mouse status.
|
||||
|
||||
@param This - Pointer of simple pointer Protocol.
|
||||
@param State - Output buffer holding status.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Output buffer is invalid.
|
||||
@retval EFI_NOT_READY Mouse is not changed status yet.
|
||||
@retval EFI_SUCCESS Mouse status is changed and get successful.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MouseAbsolutePointerGetState (
|
||||
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
|
||||
IN OUT EFI_ABSOLUTE_POINTER_STATE *State
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
GC_TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
This - GC_TODO: add argument description
|
||||
State - GC_TODO: add argument description
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
|
||||
EFI_NOT_READY - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
{
|
||||
PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;
|
||||
EFI_TPL OldTpl;
|
||||
@@ -693,24 +672,22 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Event notification function for SIMPLE_POINTER.WaitForInput event
|
||||
Signal the event if there is input from mouse
|
||||
|
||||
@param Event event object
|
||||
@param Context event context
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
MouseAbsolutePointerWaitForInput (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Event notification function for SIMPLE_POINTER.WaitForInput event
|
||||
Signal the event if there is input from mouse
|
||||
|
||||
Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
// GC_TODO: Event - add argument and description to function comment
|
||||
// GC_TODO: Context - add argument and description to function comment
|
||||
{
|
||||
@@ -728,29 +705,21 @@ Returns:
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Event notification function for TimerEvent event
|
||||
If mouse device is connected to system, try to get the mouse packet data
|
||||
|
||||
@param Event - TimerEvent in PS2_MOUSE_DEV
|
||||
@param Context - Pointer to PS2_MOUSE_DEV structure
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PollMouseAbsolutePointer(
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Event notification function for TimerEvent event
|
||||
If mouse device is connected to system, try to get the mouse packet data
|
||||
|
||||
Arguments:
|
||||
|
||||
Event - TimerEvent in PS2_MOUSE_DEV
|
||||
Context - Pointer to PS2_MOUSE_DEV structure
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;
|
||||
|
||||
@@ -797,3 +766,4 @@ InitializePs2MouseAbsolutePointer(
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ EFI_STATUS
|
||||
KbcSelfTest (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -38,7 +38,7 @@ Returns:
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -92,7 +92,7 @@ EFI_STATUS
|
||||
KbcEnableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -106,7 +106,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
//
|
||||
// Send 8042 enable mouse command
|
||||
@@ -118,7 +118,7 @@ EFI_STATUS
|
||||
KbcDisableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -132,7 +132,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
//
|
||||
// Send 8042 disable mouse command
|
||||
@@ -144,7 +144,7 @@ EFI_STATUS
|
||||
KbcEnableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -158,7 +158,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
//
|
||||
// Send 8042 enable keyboard command
|
||||
@@ -170,7 +170,7 @@ EFI_STATUS
|
||||
KbcDisableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -184,7 +184,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
//
|
||||
// Send 8042 disable keyboard command
|
||||
@@ -197,7 +197,7 @@ CheckKbStatus (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
OUT BOOLEAN *KeyboardEnable
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -212,7 +212,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -245,7 +245,7 @@ EFI_STATUS
|
||||
PS2MouseReset (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -261,7 +261,7 @@ Returns:
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -301,7 +301,7 @@ PS2MouseSetSampleRate (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SR SampleRate
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -316,7 +316,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -338,7 +338,7 @@ PS2MouseSetResolution (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_RE Resolution
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -353,7 +353,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -375,7 +375,7 @@ PS2MouseSetScaling (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SF Scaling
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -390,7 +390,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINT8 Command;
|
||||
|
||||
@@ -406,7 +406,7 @@ EFI_STATUS
|
||||
PS2MouseEnable (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -420,7 +420,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
//
|
||||
// Send auxiliary command to enable mouse
|
||||
@@ -432,7 +432,7 @@ EFI_STATUS
|
||||
PS2MouseGetPacket (
|
||||
PS2_MOUSE_DEV *MouseDev
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -447,7 +447,7 @@ Returns:
|
||||
EFI_NOT_READY - Mouse Device not ready to input data packet, or some error happened during getting the packet
|
||||
EFI_SUCCESS - The data packet is gotten successfully.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN KeyboardEnable;
|
||||
@@ -576,7 +576,7 @@ PS2MouseRead (
|
||||
IN OUT UINTN *BufSize,
|
||||
IN UINTN State
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -593,7 +593,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BytesRead;
|
||||
@@ -642,7 +642,7 @@ Out8042Command (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Command
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -657,7 +657,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -688,7 +688,7 @@ Out8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -703,7 +703,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 temp;
|
||||
@@ -731,7 +731,7 @@ In8042Data (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -747,7 +747,7 @@ Returns:
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 temp;
|
||||
@@ -783,7 +783,7 @@ Out8042AuxCommand (
|
||||
IN UINT8 Command,
|
||||
IN BOOLEAN Resend
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -802,7 +802,7 @@ Returns:
|
||||
EFI_DEVICE_ERROR - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Data;
|
||||
@@ -874,7 +874,7 @@ Out8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINT8 Data
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -889,7 +889,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Temp;
|
||||
@@ -927,7 +927,7 @@ In8042AuxData (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN OUT UINT8 *Data
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -942,7 +942,7 @@ Returns:
|
||||
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -963,7 +963,7 @@ EFI_STATUS
|
||||
CheckForInput (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -978,7 +978,7 @@ Returns:
|
||||
EFI_NOT_READY - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINT8 Data;
|
||||
|
||||
@@ -999,7 +999,7 @@ WaitInputEmpty (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINTN Timeout
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -1015,7 +1015,7 @@ Returns:
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 Data;
|
||||
@@ -1048,7 +1048,7 @@ WaitOutputFull (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN UINTN Timeout
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -1064,7 +1064,7 @@ Returns:
|
||||
EFI_TIMEOUT - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
UINTN Delay;
|
||||
UINT8 Data;
|
||||
|
@@ -106,7 +106,7 @@ EFI_STATUS
|
||||
KbcSelfTest (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -120,14 +120,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
KbcEnableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -141,14 +141,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
KbcDisableAux (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -162,14 +162,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
KbcEnableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -183,14 +183,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
KbcDisableKb (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -204,7 +204,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -212,7 +212,7 @@ CheckKbStatus (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
OUT BOOLEAN *KeyboardEnable
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -227,14 +227,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PS2MouseReset (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -248,7 +248,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -256,7 +256,7 @@ PS2MouseSetSampleRate (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SR SampleRate
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -271,7 +271,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -279,7 +279,7 @@ PS2MouseSetResolution (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_RE Resolution
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -294,7 +294,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
@@ -302,7 +302,7 @@ PS2MouseSetScaling (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo,
|
||||
IN MOUSE_SF Scaling
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -317,14 +317,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PS2MouseEnable (
|
||||
IN EFI_ISA_IO_PROTOCOL *IsaIo
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -338,14 +338,14 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
PS2MouseGetPacket (
|
||||
PS2_MOUSE_DEV *MouseDev
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -359,7 +359,7 @@ Returns:
|
||||
|
||||
GC_TODO: add return values
|
||||
|
||||
--*/
|
||||
**/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
|
@@ -35,7 +35,7 @@ PS2MouseDriverSupported (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -45,7 +45,7 @@ Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
**/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: RemainingDevicePath - add argument and description to function comment
|
||||
@@ -115,7 +115,7 @@ PS2MouseDriverStart (
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
Start protocol interfaces for the mouse device handles.
|
||||
@@ -129,7 +129,7 @@ Returns:
|
||||
EFI_SUCCESS - This driver is added to DeviceHandle.
|
||||
other - Errors occurred.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS EmptyStatus;
|
||||
@@ -390,7 +390,7 @@ PS2MouseDriverStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -398,7 +398,7 @@ PS2MouseDriverStop (
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
**/
|
||||
// GC_TODO: This - add argument and description to function comment
|
||||
// GC_TODO: Controller - add argument and description to function comment
|
||||
// GC_TODO: NumberOfChildren - add argument and description to function comment
|
||||
@@ -489,7 +489,7 @@ MouseReset (
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -505,7 +505,7 @@ Returns:
|
||||
EFI_SUCCESS - The command byte is written successfully.
|
||||
EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PS2_MOUSE_DEV *MouseDev;
|
||||
@@ -609,7 +609,7 @@ BOOLEAN
|
||||
CheckMouseConnect (
|
||||
IN PS2_MOUSE_DEV *MouseDev
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -624,7 +624,7 @@ Returns:
|
||||
TRUE - Keyboard in System.
|
||||
FALSE - Keyboard not in System.
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -642,7 +642,7 @@ MouseGetState (
|
||||
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
|
||||
IN OUT EFI_SIMPLE_POINTER_STATE *State
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -659,7 +659,7 @@ Returns:
|
||||
EFI_NOT_READY - GC_TODO: Add description for return value
|
||||
EFI_SUCCESS - GC_TODO: Add description for return value
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
PS2_MOUSE_DEV *MouseDev;
|
||||
EFI_TPL OldTpl;
|
||||
@@ -695,7 +695,7 @@ MouseWaitForInput (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -706,7 +706,7 @@ Arguments:
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
**/
|
||||
// GC_TODO: Event - add argument and description to function comment
|
||||
// GC_TODO: Context - add argument and description to function comment
|
||||
{
|
||||
@@ -730,7 +730,7 @@ PollMouse (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
/*++
|
||||
/**
|
||||
|
||||
Routine Description:
|
||||
|
||||
@@ -746,7 +746,7 @@ Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
**/
|
||||
{
|
||||
PS2_MOUSE_DEV *MouseDev;
|
||||
|
||||
|
Reference in New Issue
Block a user