/*++\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
\r
Handle(1) - WinNtIo - DevicePath(1)\r
\r
- If a serial port is added to the system this driver creates a new handle. \r
+ If a serial port is added to the system this driver creates a new handle.\r
The new handle is required, since the serial device must add an UART device\r
pathnode.\r
\r
\r
Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort\r
\r
- If the driver is unloaded Handle(2) is removed from the system and \r
+ If the driver is unloaded Handle(2) is removed from the system and\r
gEfiWinNtSerialPortGuid is removed from Handle(1).\r
\r
Note: Handle(1) is any handle created by the Win NT Bus driver that is passed\r
into the DriverBinding member functions of this driver. This driver requires\r
- a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and \r
- the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid. \r
- \r
- If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is \r
+ a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and\r
+ the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid.\r
+\r
+ If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is\r
loaded on the device.\r
\r
--*/\r
Status = EFI_UNSUPPORTED;\r
goto Error;\r
}\r
- \r
+\r
//\r
// Check the GUID to see if this is a handle type the driver supports\r
//\r
}\r
}\r
\r
- gBS->FreePool (OpenInfoBuffer);\r
+ FreePool (OpenInfoBuffer);\r
return Status;\r
}\r
\r
//\r
// Construct Private data\r
//\r
- Status = gBS->AllocatePool (\r
- EfiBootServicesData,\r
- sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA),\r
- &Private\r
- );\r
- if (EFI_ERROR (Status)) {\r
+ Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));\r
+ if (Private == NULL) {\r
goto Error;\r
}\r
\r
}\r
\r
if (Private->DevicePath != NULL) {\r
- gBS->FreePool (Private->DevicePath);\r
+ FreePool (Private->DevicePath);\r
}\r
\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
}\r
\r
} else {\r
Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
\r
- gBS->FreePool (Private->DevicePath);\r
+ FreePool (Private->DevicePath);\r
\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
}\r
\r
\r
Arguments:\r
\r
- This - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue. \r
+ This - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.\r
BaudRate - The Baud rate of the serial device.\r
ReceiveFifoDepth - The request depth of fifo on receive side.\r
Timeout - the request timeout for a single charact.\r
}\r
\r
if (Private->DevicePath != NULL) {\r
- gBS->FreePool (Private->DevicePath);\r
+ FreePool (Private->DevicePath);\r
}\r
\r
Private->DevicePath = NewDevicePath;\r
if (ModemStatus & MS_RLSD_ON) {\r
Bits |= EFI_SERIAL_CARRIER_DETECT;\r
}\r
- \r
+\r
//\r
// Get ctrl status\r
//\r
if (Private->HardwareLoopbackEnable) {\r
Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
}\r
- \r
+\r
//\r
// Get input buffer status\r
//\r
Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
}\r
- \r
+\r
//\r
// Do the write\r
//\r
\r
Routine Description:\r
Detect whether specific FIFO is full or not\r
- \r
+\r
Arguments:\r
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
- \r
+\r
Returns:\r
TRUE: the FIFO is full\r
FALSE: the FIFO is not full\r
\r
Routine Description:\r
Detect whether specific FIFO is empty or not\r
- \r
+\r
Arguments:\r
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
- \r
+\r
Returns:\r
TRUE: the FIFO is empty\r
FALSE: the FIFO is not empty\r
\r
Routine Description:\r
Add data to specific FIFO\r
- \r
+\r
Arguments:\r
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
- Data UINT8: the data added to FIFO \r
- \r
+ Data UINT8: the data added to FIFO\r
+\r
Returns:\r
EFI_SUCCESS: Add data to specific FIFO successfully\r
- EFI_OUT_RESOURCE: Failed to add data because FIFO is already full \r
+ EFI_OUT_RESOURCE: Failed to add data because FIFO is already full\r
\r
--*/\r
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment\r
if (IsaSerialFifoFull (Fifo)) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// FIFO is not full can add data\r
//\r
\r
Routine Description:\r
Remove data from specific FIFO\r
- \r
+\r
Arguments:\r
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
- Data UINT8*: the data removed from FIFO \r
- \r
+ Data UINT8*: the data removed from FIFO\r
+\r
Returns:\r
EFI_SUCCESS: Remove data from specific FIFO successfully\r
EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty\r
if (IsaSerialFifoEmpty (Fifo)) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// FIFO is not empty, can remove data\r
//\r