NetworkPkg/TcpDxe/TcpDriver.c File Reference


Functions

EFI_STATUS TcpCreateTimer (VOID)
VOID TcpDestroyTimer (VOID)
EFI_STATUS EFIAPI TcpDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS TcpCreateService (IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN UINT8 IpVersion)
EFI_STATUS EFIAPI TcpDestroyChildEntryInHandleBuffer (IN LIST_ENTRY *Entry, IN VOID *Context)
EFI_STATUS TcpDestroyService (IN EFI_HANDLE Controller, IN EFI_HANDLE ImageHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer, IN UINT8 IpVersion)
EFI_STATUS EFIAPI Tcp4DriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI Tcp4DriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI Tcp4DriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI Tcp6DriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI Tcp6DriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI Tcp6DriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS TcpCreateSocketCallback (IN SOCKET *This, IN VOID *Context)
VOID TcpDestroySocketCallback (IN SOCKET *This, IN VOID *Context)
EFI_STATUS EFIAPI TcpServiceBindingCreateChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI TcpServiceBindingDestroyChild (IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)

Variables

UINT16 mTcp4RandomPort
UINT16 mTcp6RandomPort
TCP_HEARTBEAT_TIMER mTcpTimer
EFI_TCP4_PROTOCOL gTcp4ProtocolTemplate
EFI_TCP6_PROTOCOL gTcp6ProtocolTemplate
SOCK_INIT_DATA mTcpDefaultSockData
EFI_DRIVER_BINDING_PROTOCOL gTcp4DriverBinding
EFI_DRIVER_BINDING_PROTOCOL gTcp6DriverBinding
EFI_SERVICE_BINDING_PROTOCOL gTcpServiceBinding

Detailed Description

The driver binding and service binding protocol for the TCP driver.

Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

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

Start this driver on ControllerHandle.

Parameters:
[in] This Protocol instance pointer.
[in] ControllerHandle Handle of device to bind driver to.
[in] RemainingDevicePath Optional parameter use to pick a specific child device to start.
Return values:
EFI_SUCCESS The driver is added to ControllerHandle.
EFI_OUT_OF_RESOURCES There are not enough resources to start the driver.
other The driver cannot be added to ControllerHandle.

References TcpCreateService().

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

Stop this driver on ControllerHandle.

Parameters:
[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in] ControllerHandle A 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] NumberOfChildren The number of child device handles in ChildHandleBuffer.
[in] ChildHandleBuffer An array of child handles to be freed. May be NULL if NumberOfChildren is 0.
Return values:
EFI_SUCCESS The device was stopped.
EFI_DEVICE_ERROR The device could not be stopped due to a device error.

References TcpDestroyService().

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

Test to see if this driver supports ControllerHandle.

Parameters:
[in] This Protocol instance pointer.
[in] ControllerHandle Handle of device to test.
[in] RemainingDevicePath Optional parameter use to pick a specific child device to start.
Return values:
EFI_SUCCESS This driver supports this device.
EFI_ALREADY_STARTED This driver is already running on this device.
other This driver does not support this device.

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

Start this driver on ControllerHandle.

Parameters:
[in] This Protocol instance pointer.
[in] ControllerHandle Handle of device to bind driver to.
[in] RemainingDevicePath Optional parameter use to pick a specific child device to start.
Return values:
EFI_SUCCESS The driver is added to ControllerHandle.
EFI_OUT_OF_RESOURCES There are not enough resources to start the driver.
other The driver cannot be added to ControllerHandle.

References TcpCreateService().

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

Stop this driver on ControllerHandle.

Parameters:
[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in] ControllerHandle A 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] NumberOfChildren The number of child device handles in ChildHandleBuffer.
[in] ChildHandleBuffer An array of child handles to be freed. May be NULL if NumberOfChildren is 0.
Return values:
EFI_SUCCESS The device was stopped.
EFI_DEVICE_ERROR The device could not be stopped due to a device error.

References TcpDestroyService().

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

Test to see if this driver supports ControllerHandle.

Parameters:
[in] This Protocol instance pointer.
[in] ControllerHandle Handle of device to test.
[in] RemainingDevicePath Optional parameter use to pick a specific child device to start.
Return values:
EFI_SUCCESS This driver supports this device.
EFI_ALREADY_STARTED This driver is already running on this device.
other This driver does not support this device.

EFI_STATUS TcpCreateService ( IN EFI_HANDLE  Controller,
IN EFI_HANDLE  Image,
IN UINT8  IpVersion 
)

Create a new TCP4 or TCP6 driver service binding protocol

Parameters:
[in] Controller Controller handle of device to bind driver to.
[in] Image The TCP driver's image handle.
[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
Return values:
EFI_OUT_OF_RESOURCES Failed to allocate some resources.
EFI_SUCCESS A new IP6 service binding private was created.

References _TCP_SERVICE_DATA::ControllerHandle, _TCP_SERVICE_DATA::DriverBindingHandle, gTcpServiceBinding, _TCP_SERVICE_DATA::IpIo, _TCP_SERVICE_DATA::IpVersion, _TCP_SERVICE_DATA::ServiceBinding, _TCP_SERVICE_DATA::Signature, _TCP_SERVICE_DATA::SocketList, TCP_DRIVER_SIGNATURE, TcpCreateTimer(), TcpDestroyTimer(), and TcpRxCallback().

Referenced by Tcp4DriverBindingStart(), and Tcp6DriverBindingStart().

EFI_STATUS TcpCreateSocketCallback ( IN SOCKET This,
IN VOID *  Context 
)

The Callback funtion called after the TCP socket was created.

Parameters:
[in] This Pointer to the socket just created
[in] Context Context of the socket
Return values:
EFI_SUCCESS This protocol installed successfully.
other An error occured.

References _TCP_SERVICE_DATA::ControllerHandle, _TCP_SERVICE_DATA::DriverBindingHandle, _TCP_SERVICE_DATA::IpIo, and _TCP_SERVICE_DATA::SocketList.

EFI_STATUS TcpCreateTimer ( VOID   ) 

Create and start the heartbeat timer for the TCP driver.

Return values:
EFI_SUCCESS The timer was successfully created and started.
other The timer was not created.

References _TCP_HEARTBEAT_TIMER::RefCnt, TCP_TICK_HZ, TcpTicking(), and _TCP_HEARTBEAT_TIMER::TimerEvent.

Referenced by TcpCreateService().

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

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

Parameters:
[in] Entry The entry to be removed.
[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
Return values:
EFI_SUCCESS The entry has been removed successfully.
Others Fail to remove the entry.

References SOCK_SIGNATURE, and _TCP_SOCKET::SockHandle.

Referenced by TcpDestroyService().

EFI_STATUS TcpDestroyService ( IN EFI_HANDLE  Controller,
IN EFI_HANDLE  ImageHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE *  ChildHandleBuffer,
IN UINT8  IpVersion 
)

Destroy a TCP6 or TCP4 service binding instance. It will release all the resources allocated by the instance.

Parameters:
[in] Controller Controller handle of device to bind driver to.
[in] ImageHandle The TCP driver's image handle.
[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
[in] ChildHandleBuffer An array of child handles to be freed. May be NULL if NumberOfChildren is 0.
[in] IpVersion IP_VERSION_4 or IP_VERSION_6
Return values:
EFI_SUCCESS The resources used by the instance were cleaned up.
Others Failed to clean up some of the resources.

References TCP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT::ChildHandleBuffer, _TCP_SERVICE_DATA::IpIo, TCP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT::NumberOfChildren, TCP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT::ServiceBinding, _TCP_SERVICE_DATA::SocketList, TCP_SERVICE_FROM_THIS, TcpDestroyChildEntryInHandleBuffer(), and TcpDestroyTimer().

Referenced by Tcp4DriverBindingStop(), and Tcp6DriverBindingStop().

VOID TcpDestroySocketCallback ( IN SOCKET This,
IN VOID *  Context 
)

The callback function called before the TCP socket was to be destroyed.

Parameters:
[in] This The TCP socket to be destroyed.
[in] Context The context of the socket.

References _TCP_SERVICE_DATA::DriverBindingHandle, and _TCP_SERVICE_DATA::IpIo.

VOID TcpDestroyTimer ( VOID   ) 

Stop and destroy the heartbeat timer for TCP driver.

References _TCP_HEARTBEAT_TIMER::RefCnt, and _TCP_HEARTBEAT_TIMER::TimerEvent.

Referenced by TcpCreateService(), and TcpDestroyService().

EFI_STATUS EFIAPI TcpDriverEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE *  SystemTable 
)

The entry point for Tcp driver, which is used to install Tcp driver on the ImageHandle.

Parameters:
[in] ImageHandle The firmware allocated handle for this driver image.
[in] SystemTable Pointer to the EFI system table.
Return values:
EFI_SUCCESS The driver loaded.
other The driver did not load.

References gTcp4DriverBinding, gTcp6DriverBinding, gTcpComponentName, gTcpComponentName2, mTcp4RandomPort, mTcp6RandomPort, mTcpGlobalIss, and TCP_PORT_KNOWN.

EFI_STATUS EFIAPI TcpServiceBindingCreateChild ( IN EFI_SERVICE_BINDING_PROTOCOL *  This,
IN OUT EFI_HANDLE *  ChildHandle 
)

Creates a child handle with a set of TCP services.

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:
[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
[in,out] ChildHandle Pointer 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_SUCCES The protocol was added to ChildHandle.
EFI_INVALID_PARAMETER ChildHandle is NULL.
EFI_OUT_OF_RESOURCES There are not enough resources availabe to create the child.
other The child handle was not created.

References _SOCK_INIT_DATA::DataSize, _SOCK_INIT_DATA::DriverBinding, _TCP_SERVICE_DATA::DriverBindingHandle, gTcp4ProtocolTemplate, gTcp6ProtocolTemplate, _TCP_SERVICE_DATA::IpVersion, _SOCK_INIT_DATA::IpVersion, _SOCK_INIT_DATA::Protocol, _SOCK_INIT_DATA::ProtoData, SockCreateChild(), _TCP_SOCKET::SockHandle, TCP_SERVICE_FROM_THIS, _TCP_PROTO_DATA::TcpPcb, and _TCP_PROTO_DATA::TcpService.

EFI_STATUS EFIAPI TcpServiceBindingDestroyChild ( IN EFI_SERVICE_BINDING_PROTOCOL *  This,
IN EFI_HANDLE  ChildHandle 
)

Destroys a child handle with a set of TCP services.

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:
This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
ChildHandle Handle of the child to be destroyed.
Return values:
EFI_SUCCES The protocol was removed from ChildHandle.
EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
EFI_INVALID_PARAMETER Child handle is NULL.
EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle because its services are being used.
other The child handle was not destroyed.

References gTcp4DriverBinding, gTcp6DriverBinding, SOCK_FROM_THIS, and SockDestroyChild().


Variable Documentation

EFI_DRIVER_BINDING_PROTOCOL gTcp4DriverBinding

EFI_TCP4_PROTOCOL gTcp4ProtocolTemplate

EFI_DRIVER_BINDING_PROTOCOL gTcp6DriverBinding

EFI_TCP6_PROTOCOL gTcp6ProtocolTemplate

EFI_SERVICE_BINDING_PROTOCOL gTcpServiceBinding

Referenced by TcpBind(), and TcpDriverEntryPoint().

Referenced by TcpBind(), and TcpDriverEntryPoint().

Initial value:

Initial value:

 {
  NULL,
  0
}


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1