TianoCore EDK2 master
Loading...
Searching...
No Matches
ArpDriver.c File Reference
#include "ArpDriver.h"
#include "ArpImpl.h"

Go to the source code of this file.

Functions

EFI_STATUS ArpCreateService (IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle, IN OUT ARP_SERVICE_DATA *ArpService)
 
VOID ArpCleanService (IN OUT ARP_SERVICE_DATA *ArpService)
 
EFI_STATUS EFIAPI ArpDestroyChildEntryInHandleBuffer (IN LIST_ENTRY *Entry, IN VOID *Context)
 
EFI_STATUS EFIAPI ArpDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI ArpDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI ArpDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI ArpServiceBindingCreateChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE *ChildHandle)
 
EFI_STATUS EFIAPI ArpServiceBindingDestroyChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
 
EFI_STATUS EFIAPI ArpDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding
 

Detailed Description

ARP driver functions.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ArpDriver.c.

Function Documentation

◆ ArpCleanService()

VOID ArpCleanService ( IN OUT ARP_SERVICE_DATA ArpService)

Clean the arp service context data.

Parameters
[in,out]ArpServicePointer to the buffer containing the arp service context data.
Returns
None.

Definition at line 188 of file ArpDriver.c.

◆ ArpCreateService()

EFI_STATUS ArpCreateService ( IN EFI_HANDLE  ImageHandle,
IN EFI_HANDLE  ControllerHandle,
IN OUT ARP_SERVICE_DATA ArpService 
)

Create and initialize the arp service context data.

Parameters
[in]ImageHandleThe image handle representing the loaded driver image.
[in]ControllerHandleThe controller handle the driver binds to.
[in,out]ArpServicePointer to the buffer containing the arp service context data.
Return values
EFI_SUCCESSThe arp service context is initialized.
EFI_UNSUPPORTEDThe underlayer Snp mode type is not ethernet. Failed to initialize the service context.
otherFailed to initialize the arp service context.

Definition at line 38 of file ArpDriver.c.

◆ ArpDestroyChildEntryInHandleBuffer()

EFI_STATUS EFIAPI ArpDestroyChildEntryInHandleBuffer ( IN LIST_ENTRY Entry,
IN VOID *  Context 
)

Callback function which provided by user to remove one node in NetDestroyLinkList process.

Parameters
[in]EntryThe entry to be removed.
[in]ContextPointer to the callback context corresponds to the Context in NetDestroyLinkList.
Return values
EFI_SUCCESSThe entry has been removed successfully.
OthersFail to remove the entry.

Definition at line 248 of file ArpDriver.c.

◆ ArpDriverBindingStart()

EFI_STATUS EFIAPI ArpDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Start this driver on ControllerHandle.

The Start() function is designed to be invoked from the EFI boot service ConnectController(). As a result, much of the error checking on the parameters to Start() has been moved into this common boot service. It is legal to call Start() from other locations, but the following calling restrictions must be followed or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE.
  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned EFI_DEVICE_PATH_PROTOCOL.
  3. Prior to calling Start(), the Supported() function for the driver specified by This must have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to start. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers.
Return values
EFI_SUCCESSThe device was started.
EFI_DEVICE_ERRORThe device could not be started due to a device error. Currently not implemented.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
OthersThe driver failed to start the device.

Definition at line 368 of file ArpDriver.c.

◆ ArpDriverBindingStop()

EFI_STATUS EFIAPI ArpDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle.

Release the control of this controller and remove the IScsi functions. The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). As a result, much of the error checking on the parameters to Stop() has been moved into this common boot service. It is legal to call Stop() from other locations, but the following calling restrictions must be followed or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this same driver's Start() function.
  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid EFI_HANDLE. In addition, all of these handles must have been created in this driver's Start() function, and the Start() function must have called OpenProtocol() on ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleA handle to the device being stopped. The handle must support a bus specific I/O protocol for the driver to use to stop the device.
[in]NumberOfChildrenThe number of child device handles in ChildHandleBuffer. Not used.
[in]ChildHandleBufferAn array of child handles to be freed. May be NULL if NumberOfChildren is 0.Not used.
Return values
EFI_SUCCESSThe device was stopped.
EFI_DEVICE_ERRORThe device could not be stopped due to a device error.

Definition at line 458 of file ArpDriver.c.

◆ ArpDriverBindingSupported()

EFI_STATUS EFIAPI ArpDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Tests to see if this driver supports a given controller.

If a child device is provided, it further tests to see if this driver supports creating a handle for the specified child device.

Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers.
Return values
EFI_SUCCESSThe device specified by ControllerHandle and RemainingDevicePath is supported by the driver specified by This.
EFI_ALREADY_STARTEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by the driver specified by This.
EFI_ACCESS_DENIEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by a different driver or an application that requires exclusive access. Currently not implemented.
EFI_UNSUPPORTEDThe device specified by ControllerHandle and RemainingDevicePath is not supported by the driver specified by This.

Definition at line 297 of file ArpDriver.c.

◆ ArpDriverEntryPoint()

EFI_STATUS EFIAPI ArpDriverEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The entry point for Arp driver which installs the driver binding and component name protocol on its ImageHandle.

Parameters
[in]ImageHandleThe image handle of the driver.
[in]SystemTableThe system table.
Return values
EFI_SUCCESSif the driver binding and component name protocols are successfully
OthersFailed to install the protocols.

Definition at line 794 of file ArpDriver.c.

◆ ArpServiceBindingCreateChild()

EFI_STATUS EFIAPI ArpServiceBindingCreateChild ( IN EFI_SERVICE_BINDING_PROTOCOL This,
IN EFI_HANDLE ChildHandle 
)

Creates a child handle and installs a protocol.

The CreateChild() function installs a protocol on ChildHandle. If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.

Parameters
ThisPointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
ChildHandlePointer to the handle of the child to create. If it is NULL, then a new handle is created. If it is a pointer to an existing UEFI handle, then the protocol is added to the existing UEFI handle.
Return values
EFI_SUCCESSThe protocol was added to ChildHandle.
EFI_INVALID_PARAMETERChildHandle is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources available to create the child
otherThe child handle was not created

Definition at line 555 of file ArpDriver.c.

◆ ArpServiceBindingDestroyChild()

EFI_STATUS EFIAPI ArpServiceBindingDestroyChild ( IN EFI_SERVICE_BINDING_PROTOCOL This,
IN EFI_HANDLE  ChildHandle 
)

Destroys a child handle with a protocol installed on it.

The DestroyChild() function does the opposite of CreateChild(). It removes a protocol that was installed by CreateChild() from ChildHandle. If the removed protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.

Parameters
ThisPointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
ChildHandleHandle of the child to destroy
Return values
EFI_SUCCESSThe protocol was removed from ChildHandle.
EFI_UNSUPPORTEDChildHandle does not support the protocol that is being removed.
EFI_INVALID_PARAMETERChild handle is NULL.
EFI_ACCESS_DENIEDThe protocol could not be removed from the ChildHandle because its services are being used.
otherThe child handle was not destroyed

Definition at line 680 of file ArpDriver.c.

Variable Documentation

◆ gArpDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding
Initial value:
= {
0xa,
}
EFI_STATUS EFIAPI ArpDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: ArpDriver.c:297
EFI_STATUS EFIAPI ArpDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: ArpDriver.c:368
EFI_STATUS EFIAPI ArpDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: ArpDriver.c:458
#define NULL
Definition: Base.h:319

Definition at line 12 of file ArpDriver.c.