2007-09-30 05:08:02 +02:00
|
|
|
/** @file
|
|
|
|
|
2018-06-27 15:08:52 +02:00
|
|
|
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:05:13 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_IP4_DRIVER_H__
|
|
|
|
#define __EFI_IP4_DRIVER_H__
|
|
|
|
|
|
|
|
#include <Protocol/ServiceBinding.h>
|
|
|
|
|
|
|
|
extern EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding;
|
|
|
|
extern EFI_COMPONENT_NAME_PROTOCOL gIp4ComponentName;
|
|
|
|
extern EFI_COMPONENT_NAME2_PROTOCOL gIp4ComponentName2;
|
2012-12-13 07:47:06 +01:00
|
|
|
extern EFI_UNICODE_STRING_TABLE *gIp4ControllerNameTable;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
|
|
|
|
UINTN NumberOfChildren;
|
|
|
|
EFI_HANDLE *ChildHandleBuffer;
|
|
|
|
} IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
|
2007-09-30 05:08:02 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Function prototype for the driver's entry point
|
|
|
|
//
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
This is the declaration of an EFI image entry point. This entry point is
|
|
|
|
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
|
|
|
|
both device drivers and bus drivers.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
The entry point for IP4 driver which install the driver
|
|
|
|
binding and component name protocol on its image.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] ImageHandle The firmware allocated handle for the UEFI image.
|
|
|
|
@param[in] SystemTable A pointer to the EFI System Table.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation completed successfully.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4DriverEntryPoint (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
2020-02-07 02:07:52 +01:00
|
|
|
// Function prototypes for the Driver Binding Protocol
|
2007-09-30 05:08:02 +02:00
|
|
|
//
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Test to see if this driver supports ControllerHandle. This service
|
|
|
|
is called by the EFI boot service ConnectController(). In
|
|
|
|
order to make drivers as small as possible, there are a few calling
|
|
|
|
restrictions for this service. ConnectController() must
|
|
|
|
follow these calling restrictions. If any other agent wishes to call
|
|
|
|
Supported() it must also follow these calling restrictions.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] This Protocol instance pointer.
|
|
|
|
@param[in] ControllerHandle Handle of device to test
|
|
|
|
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
|
|
|
|
device to start.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4DriverBindingSupported (
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_DRIVER_BINDING_PROTOCOL * This,
|
2007-09-30 05:08:02 +02:00
|
|
|
IN EFI_HANDLE ControllerHandle,
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Start this driver on ControllerHandle. This service is called by the
|
|
|
|
EFI boot service ConnectController(). In order to make
|
|
|
|
drivers as small as possible, there are a few calling restrictions for
|
|
|
|
this service. ConnectController() must follow these
|
|
|
|
calling restrictions. If any other agent wishes to call Start() it
|
|
|
|
must also follow these calling restrictions.
|
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] This Protocol instance pointer.
|
|
|
|
@param[in] ControllerHandle Handle of device to bind driver to
|
|
|
|
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
|
|
|
|
device to start.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4DriverBindingStart (
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_DRIVER_BINDING_PROTOCOL * This,
|
2007-09-30 05:08:02 +02:00
|
|
|
IN EFI_HANDLE ControllerHandle,
|
2008-11-18 10:29:44 +01:00
|
|
|
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
|
|
|
Stop this driver on ControllerHandle. This service is called by the
|
|
|
|
EFI boot service DisconnectController(). In order to
|
|
|
|
make drivers as small as possible, there are a few calling
|
|
|
|
restrictions for this service. DisconnectController()
|
|
|
|
must follow these calling restrictions. If any other agent wishes
|
|
|
|
to call Stop() it must also follow these calling restrictions.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param[in] This Protocol instance pointer.
|
|
|
|
@param[in] ControllerHandle Handle of device to stop driver on
|
|
|
|
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
|
|
|
|
of children is zero stop the entire bus driver.
|
|
|
|
@param[in] ChildHandleBuffer List of Child Handles to Stop.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
|
|
|
@retval other This driver was not removed from this device
|
2008-11-18 10:29:44 +01:00
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4DriverBindingStop (
|
|
|
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
|
|
|
IN EFI_HANDLE ControllerHandle,
|
|
|
|
IN UINTN NumberOfChildren,
|
|
|
|
IN EFI_HANDLE *ChildHandleBuffer
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
2016-07-08 08:21:04 +02:00
|
|
|
// Function prototypes for the ServiceBinding Protocol
|
2007-09-30 05:08:02 +02:00
|
|
|
//
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
2009-01-16 01:09:52 +01:00
|
|
|
Creates a child handle and installs a protocol.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
|
|
|
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.
|
2009-01-16 01:09:52 +01:00
|
|
|
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
|
|
|
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
2018-06-27 15:08:52 +02:00
|
|
|
then a new handle is created. If it is a pointer to an existing UEFI handle,
|
2009-01-16 01:09:52 +01:00
|
|
|
then the protocol is added to the existing UEFI handle.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2020-02-07 02:07:52 +01:00
|
|
|
@retval EFI_SUCCESS The protocol was added to ChildHandle.
|
2008-11-18 10:29:44 +01:00
|
|
|
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
|
2016-07-08 08:21:04 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
|
2008-11-18 10:29:44 +01:00
|
|
|
the child
|
|
|
|
@retval other The child handle was not created
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4ServiceBindingCreateChild (
|
|
|
|
IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
2008-11-18 10:29:44 +01:00
|
|
|
IN OUT EFI_HANDLE *ChildHandle
|
2007-09-30 05:08:02 +02:00
|
|
|
);
|
|
|
|
|
2008-11-18 10:29:44 +01:00
|
|
|
/**
|
2009-01-16 01:09:52 +01:00
|
|
|
Destroys a child handle with a protocol installed on it.
|
2018-06-27 15:08:52 +02:00
|
|
|
|
|
|
|
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
|
2009-01-16 01:09:52 +01:00
|
|
|
last protocol on ChildHandle, then ChildHandle is destroyed.
|
2008-11-18 10:29:44 +01:00
|
|
|
|
2009-01-16 01:09:52 +01:00
|
|
|
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
2008-11-18 10:29:44 +01:00
|
|
|
@param ChildHandle Handle of the child to destroy
|
|
|
|
|
2020-02-07 02:07:52 +01:00
|
|
|
@retval EFI_SUCCESS The protocol was removed from ChildHandle.
|
2009-01-16 01:09:52 +01:00
|
|
|
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
|
2011-07-06 05:55:36 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER Child handle is NULL.
|
2009-01-16 01:09:52 +01:00
|
|
|
@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
|
|
|
|
because its services are being used.
|
2008-11-18 10:29:44 +01:00
|
|
|
@retval other The child handle was not destroyed
|
|
|
|
|
|
|
|
**/
|
2007-09-30 05:08:02 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Ip4ServiceBindingDestroyChild (
|
|
|
|
IN EFI_SERVICE_BINDING_PROTOCOL *This,
|
|
|
|
IN EFI_HANDLE ChildHandle
|
|
|
|
);
|
|
|
|
#endif
|