/** @file\r
+ Implements EFI Driver Binding Protocol and VGA Mini Port Protocol for VGA Mini Port Driver.\r
\r
-Copyright (c) 2006 Intel Corporation. All rights reserved\r
+Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved\r
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
};\r
\r
/**\r
- Driver entry point for VgaMiniPort driver.\r
- \r
- @param ImageHandle Driver image handle.\r
- @param SystemTable Point to EFI_SYSTEM_TABLE.\r
- \r
- @retval Status of install driver binding protocol.\r
+ Entrypoint of VGA Mini Port Driver.\r
+\r
+ This function is the entrypoint of UVGA Mini Port Driver. It installs Driver Binding\r
+ Protocols together with Component Name Protocols.\r
+\r
+ @param ImageHandle The firmware allocated handle for the EFI image.\r
+ @param SystemTable A pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The entry point is executed successfully.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- return EfiLibInstallDriverBindingComponentName2 (\r
- ImageHandle,\r
- SystemTable,\r
- &gPciVgaMiniPortDriverBinding,\r
- ImageHandle,\r
- &gPciVgaMiniPortComponentName,\r
- &gPciVgaMiniPortComponentName2\r
- );\r
+ EFI_STATUS Status;\r
+\r
+ Status = EfiLibInstallDriverBindingComponentName2 (\r
+ ImageHandle,\r
+ SystemTable,\r
+ &gPciVgaMiniPortDriverBinding,\r
+ ImageHandle,\r
+ &gPciVgaMiniPortComponentName,\r
+ &gPciVgaMiniPortComponentName2\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return EFI_SUCCESS;\r
}\r
\r
\r
/**\r
- Supported.\r
-\r
- (Standard DriverBinding Protocol Supported() function)\r
+ Check whether VGA Mini Port driver supports this device.\r
\r
@param This The driver binding protocol.\r
@param Controller The controller handle to check.\r
\r
Done:\r
gBS->CloseProtocol (\r
- Controller,\r
- &gEfiPciIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
+ Controller,\r
+ &gEfiPciIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
\r
return Status;\r
}\r
\r
\r
/**\r
- Install VGA Mini Port Protocol onto VGA device handles\r
+ Starts the VGA device with this driver.\r
\r
- (Standard DriverBinding Protocol Start() function)\r
+ This function consumes PCI I/O Protocol, and installs VGA Mini Port Protocol\r
+ onto the VGA device handle.\r
\r
@param This The driver binding instance.\r
@param Controller The controller to check.\r
//\r
// Allocate the private device structure\r
//\r
- Status = gBS->AllocatePool (\r
- EfiBootServicesData,\r
- sizeof (PCI_VGA_MINI_PORT_DEV),\r
- (VOID **) &PciVgaMiniPortPrivate\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto Done;\r
- }\r
-\r
- ZeroMem (PciVgaMiniPortPrivate, sizeof (PCI_VGA_MINI_PORT_DEV));\r
+ PciVgaMiniPortPrivate = AllocateZeroPool (sizeof (PCI_VGA_MINI_PORT_DEV));\r
+ ASSERT (PciVgaMiniPortPrivate != NULL);\r
\r
//\r
// Initialize the private device structure\r
PciVgaMiniPortPrivate->VgaMiniPort.MaxMode = 1;\r
\r
//\r
- // Install Vga Mini Port Protocol\r
+ // Install VGA Mini Port Protocol\r
//\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&Controller,\r
Done:\r
if (EFI_ERROR (Status)) {\r
gBS->CloseProtocol (\r
- Controller,\r
- &gEfiPciIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
+ Controller,\r
+ &gEfiPciIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
if (PciVgaMiniPortPrivate != NULL) {\r
- gBS->FreePool (PciVgaMiniPortPrivate);\r
+ FreePool (PciVgaMiniPortPrivate);\r
}\r
}\r
\r
\r
\r
/**\r
- Stop.\r
+ Stop the VGA device with this driver.\r
\r
- (Standard DriverBinding Protocol Stop() function)\r
+ This function uninstalls VGA Mini Port Protocol from the VGA device handle,\r
+ and closes PCI I/O Protocol.\r
\r
@param This The driver binding protocol.\r
@param Controller The controller to release.\r
}\r
\r
gBS->CloseProtocol (\r
- Controller,\r
- &gEfiPciIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
+ Controller,\r
+ &gEfiPciIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
\r
- gBS->FreePool (PciVgaMiniPortPrivate);\r
+ FreePool (PciVgaMiniPortPrivate);\r
\r
return EFI_SUCCESS;\r
}\r
//\r
\r
/**\r
- Thunk function of EFI_VGA_MINI_PORT_SET_MODE.\r
-\r
- @param This Point to instance of EFI_VGA_MINI_PORT_PROTOCOL.\r
- @param ModeNumber Mode number.\r
+ Sets the text display mode of a VGA controller.\r
\r
- @retval EFI_UNSUPPORTED Invalid mode number.\r
- @retval EFI_SUCCESS Success.\r
+ This function implements EFI_VGA_MINI_PORT_PROTOCOL.SetMode().\r
+ If ModeNumber exceeds the valid range, then EFI_UNSUPPORTED is returned.\r
+ Otherwise, EFI_SUCCESS is directly returned without real operation.\r
+ \r
+ @param This Protocol instance pointer.\r
+ @param ModeNumber Mode number. 0 - 80x25 1-80x50\r
\r
+ @retval EFI_SUCCESS The mode was set\r
+ @retval EFI_UNSUPPORTED ModeNumber is not supported.\r
+ @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
+ \r
**/\r
EFI_STATUS\r
EFIAPI\r