TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp4Driver.c File Reference
#include "Mtftp4Impl.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI Mtftp4DriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI Mtftp4DriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI Mtftp4ConfigNullUdp (IN UDP_IO *UdpIo, IN VOID *Context)
 
EFI_STATUS Mtftp4CreateService (IN EFI_HANDLE Controller, IN EFI_HANDLE Image, OUT MTFTP4_SERVICE **Service)
 
VOID Mtftp4CleanService (IN MTFTP4_SERVICE *MtftpSb)
 
EFI_STATUS EFIAPI Mtftp4DriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI Mtftp4DestroyChildEntryInHandleBuffer (IN LIST_ENTRY *Entry, IN VOID *Context)
 
EFI_STATUS EFIAPI Mtftp4DriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
VOID Mtftp4InitProtocol (IN MTFTP4_SERVICE *MtftpSb, OUT MTFTP4_PROTOCOL *Instance)
 
EFI_STATUS EFIAPI Mtftp4ServiceBindingCreateChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE *ChildHandle)
 
EFI_STATUS EFIAPI Mtftp4ServiceBindingDestroyChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gMtftp4DriverBinding
 
EFI_SERVICE_BINDING_PROTOCOL gMtftp4ServiceBindingTemplete
 

Detailed Description

Implementation of Mtftp drivers.

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

Definition in file Mtftp4Driver.c.

Function Documentation

◆ Mtftp4CleanService()

VOID Mtftp4CleanService ( IN MTFTP4_SERVICE MtftpSb)

Release all the resource used the MTFTP service binding instance.

Parameters
MtftpSbThe MTFTP service binding instance.

Definition at line 235 of file Mtftp4Driver.c.

◆ Mtftp4ConfigNullUdp()

EFI_STATUS EFIAPI Mtftp4ConfigNullUdp ( IN UDP_IO UdpIo,
IN VOID *  Context 
)

Config a NULL UDP that is used to keep the connection between UDP and MTFTP.

Just leave the Udp child unconfigured. When UDP is unloaded, MTFTP will be informed with DriverBinding Stop.

Parameters
UdpIoThe UDP_IO to configure
ContextThe opaque parameter to the callback
Return values
EFI_SUCCESSIt always return EFI_SUCCESS directly.

Definition at line 109 of file Mtftp4Driver.c.

◆ Mtftp4CreateService()

EFI_STATUS Mtftp4CreateService ( IN EFI_HANDLE  Controller,
IN EFI_HANDLE  Image,
OUT MTFTP4_SERVICE **  Service 
)

Create then initialize a MTFTP service binding instance.

Parameters
ControllerThe controller to install the MTFTP service binding on
ImageThe driver binding image of the MTFTP driver
ServiceThe variable to receive the created service binding instance.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resource to create the instance
EFI_DEVICE_ERRORFailed to create a NULL UDP port to keep connection with UDP.
EFI_SUCCESSThe service instance is created for the controller.

Definition at line 134 of file Mtftp4Driver.c.

◆ Mtftp4DestroyChildEntryInHandleBuffer()

EFI_STATUS EFIAPI Mtftp4DestroyChildEntryInHandleBuffer ( 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 343 of file Mtftp4Driver.c.

◆ Mtftp4DriverBindingStart()

EFI_STATUS EFIAPI Mtftp4DriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start the MTFTP driver on this controller.

MTFTP driver will install a MTFTP SERVICE BINDING protocol on the supported controller, which can be used to create/destroy MTFTP children.

Parameters
ThisThe MTFTP driver binding protocol.
ControllerThe controller to manage.
RemainingDevicePathRemaining device path.
Return values
EFI_ALREADY_STARTEDThe MTFTP service binding protocol has been started on the controller.
EFI_SUCCESSThe MTFTP service binding is installed on the controller.

Definition at line 263 of file Mtftp4Driver.c.

◆ Mtftp4DriverBindingStop()

EFI_STATUS EFIAPI Mtftp4DriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop the MTFTP driver on controller. The controller is a UDP child handle.

Parameters
ThisThe MTFTP driver binding protocol
ControllerThe controller to stop
NumberOfChildrenThe number of children
ChildHandleBufferThe array of the child handle.
Return values
EFI_SUCCESSThe driver is stopped on the controller.
EFI_DEVICE_ERRORFailed to stop the driver on the controller.

Definition at line 384 of file Mtftp4Driver.c.

◆ Mtftp4DriverBindingSupported()

EFI_STATUS EFIAPI Mtftp4DriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test whether MTFTP driver support this controller.

Parameters
ThisThe MTFTP driver binding instance
ControllerThe controller to test
RemainingDevicePathThe remaining device path
Return values
EFI_SUCCESSThe controller has UDP service binding protocol installed, MTFTP can support it.
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.
EFI_UNSUPPORTEDThe device specified by ControllerHandle and RemainingDevicePath is not supported by the driver specified by This.

Definition at line 75 of file Mtftp4Driver.c.

◆ Mtftp4DriverEntryPoint()

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

The driver entry point which installs multiple protocols to the ImageHandle.

Parameters
ImageHandleThe MTFTP's image handle.
SystemTableThe system table.
Return values
EFI_SUCCESSThe handles are successfully installed on the image.
otherssome EFI_ERROR occurred.

Definition at line 37 of file Mtftp4Driver.c.

◆ Mtftp4InitProtocol()

VOID Mtftp4InitProtocol ( IN MTFTP4_SERVICE MtftpSb,
OUT MTFTP4_PROTOCOL Instance 
)

Initialize a MTFTP protocol instance which is the child of MtftpSb.

Parameters
MtftpSbThe MTFTP service binding protocol.
InstanceThe MTFTP instance to initialize.

Definition at line 469 of file Mtftp4Driver.c.

◆ Mtftp4ServiceBindingCreateChild()

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

Create a MTFTP child for the service binding instance, then install the MTFTP protocol to the ChildHandle.

Parameters
ThisThe MTFTP service binding instance.
ChildHandleThe Child handle to install the MTFTP protocol.
Return values
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_OUT_OF_RESOURCESFailed to allocate resource for the new child.
EFI_SUCCESSThe child is successfully create.

Definition at line 499 of file Mtftp4Driver.c.

◆ Mtftp4ServiceBindingDestroyChild()

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

Destroy one of the service binding's child.

Parameters
ThisThe service binding instance
ChildHandleThe child handle to destroy
Return values
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDThe child may have already been destroyed.
EFI_SUCCESSThe child is destroyed and removed from the parent's child list.

Definition at line 636 of file Mtftp4Driver.c.

Variable Documentation

◆ gMtftp4DriverBinding

EFI_DRIVER_BINDING_PROTOCOL gMtftp4DriverBinding
Initial value:
= {
0xa,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI Mtftp4DriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Mtftp4Driver.c:75
EFI_STATUS EFIAPI Mtftp4DriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Mtftp4Driver.c:263
EFI_STATUS EFIAPI Mtftp4DriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: Mtftp4Driver.c:384

Definition at line 11 of file Mtftp4Driver.c.

◆ gMtftp4ServiceBindingTemplete

EFI_SERVICE_BINDING_PROTOCOL gMtftp4ServiceBindingTemplete
Initial value:
= {
}
EFI_STATUS EFIAPI Mtftp4ServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE *ChildHandle)
Definition: Mtftp4Driver.c:499
EFI_STATUS EFIAPI Mtftp4ServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
Definition: Mtftp4Driver.c:636

Definition at line 20 of file Mtftp4Driver.c.