RDFU  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
EfiScanner.c File Reference

Main() function of the driver. More...

#include "EfiScannerHeaders.h"
#include "EfiScanner.h"
Include dependency graph for EfiScanner.c:

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI EfiScannerEntryPoint (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI EfiScannerDriverUnload (EFI_HANDLE ImageHandle)
 

Detailed Description

Main() function of the driver.

Author
Piotr Bania
Date
Feb 2013 Main() function of the driver.

Definition in file EfiScanner.c.

Function Documentation

EFI_STATUS EFIAPI EfiScannerDriverUnload ( EFI_HANDLE  ImageHandle)

Definition at line 86 of file EfiScanner.c.

References gEfiScannerComponentName, gEfiScannerComponentName2, and gEfiScannerDriverBinding.

Referenced by EfiScannerEntryPoint().

87 {
88  // now uninstall the protocols
89  gBS->UninstallMultipleProtocolInterfaces(ImageHandle,
90  &gEfiDriverBindingProtocolGuid, &gEfiScannerDriverBinding,
91  &gEfiComponentNameProtocolGuid, &gEfiScannerComponentName,
92  &gEfiComponentName2ProtocolGuid, &gEfiScannerComponentName2,
93  NULL);
94 
95  return EFI_SUCCESS;
96 }

Here is the caller graph for this function:

EFI_STATUS EFIAPI EfiScannerEntryPoint ( EFI_HANDLE  ImageHandle,
EFI_SYSTEM_TABLE *  SystemTable 
)

Driver entrypoint

Definition at line 24 of file EfiScanner.c.

References CloseLogFile(), CONF_FILE_PATH, EFI_STATUS(), EfiScannerDriverUnload(), EfiScannerInitialize(), gEfiScannerComponentName, gEfiScannerComponentName2, gEfiScannerDriverBinding, LogFullAscii(), MainLoop(), and ReadConfiguration().

26 {
27 
28  EFI_STATUS Status;
29  EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
30  BOOLEAN WantsResidency;
31 
32 
33 
34  Status = EfiScannerInitialize(ImageHandle, TRUE, TRUE, TRUE);
35 
36  if (EFI_ERROR(Status))
37  return Status;
38 
39 
41 
42  Status = EfiLibInstallDriverBindingComponentName2
43  (ImageHandle, SystemTable,
44  &gEfiScannerDriverBinding, ImageHandle,
47 
48  if (EFI_ERROR(Status))
49  {
50  LogFullAscii("EfiScannerEntryPoint: unable to install DriverBindingComponentName2 \r\n");
51  return Status;
52  }
53 
54 
55  // register our unload handler
56  Status = gBS->OpenProtocol(ImageHandle,
57  &gEfiLoadedImageProtocolGuid,
58  &LoadedImage,
59  ImageHandle,
60  NULL,
61  EFI_OPEN_PROTOCOL_GET_PROTOCOL);
62 
63  if (EFI_ERROR(Status))
64  {
65  LogFullAscii("EfiScannerEntryPoint: unable to register unload handler \r\n");
66  return Status;
67  }
68 
69  LoadedImage->Unload = EfiScannerDriverUnload;
70 
71 
72  // execute the main loop
73  WantsResidency = MainLoop();
74 
75  // no residency so force exit
76  if (!WantsResidency)
77  {
78  CloseLogFile();
79  return EFI_NOT_FOUND;
80  }
81 
82  LogFullAscii("%a: Driver loaded!\n", __FUNCTION__);
83  return Status;
84 }

Here is the call graph for this function: