TianoCore EDK2 master
|
#include "TcpMain.h"
Go to the source code of this file.
The driver binding and service binding protocol for the TCP driver.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file TcpDriver.c.
EFI_STATUS EFIAPI Tcp4DriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Start this driver on ControllerHandle.
[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. |
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. |
Definition at line 646 of file TcpDriver.c.
EFI_STATUS EFIAPI Tcp4DriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL | ||
) |
Stop this driver on ControllerHandle.
[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. |
EFI_SUCCESS | The device was stopped. |
EFI_DEVICE_ERROR | The device could not be stopped due to a device error. |
Definition at line 679 of file TcpDriver.c.
EFI_STATUS EFIAPI Tcp4DriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Test to see if this driver supports ControllerHandle.
[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. |
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. |
Definition at line 593 of file TcpDriver.c.
EFI_STATUS EFIAPI Tcp6DriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Start this driver on ControllerHandle.
[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. |
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. |
Definition at line 763 of file TcpDriver.c.
EFI_STATUS EFIAPI Tcp6DriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL | ||
) |
Stop this driver on ControllerHandle.
[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. |
EFI_SUCCESS | The device was stopped. |
EFI_DEVICE_ERROR | The device could not be stopped due to a device error. |
Definition at line 796 of file TcpDriver.c.
EFI_STATUS EFIAPI Tcp6DriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Test to see if this driver supports ControllerHandle.
[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. |
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. |
Definition at line 710 of file TcpDriver.c.
EFI_STATUS TcpCreateService | ( | IN EFI_HANDLE | Controller, |
IN EFI_HANDLE | Image, | ||
IN UINT8 | IpVersion | ||
) |
Create a new TCP4 or TCP6 driver service binding protocol
[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. |
EFI_OUT_OF_RESOURCES | Failed to allocate some resources. |
EFI_UNSUPPORTED | Service Binding Protocols are unavailable. |
EFI_ALREADY_STARTED | The TCP driver is already started on the controller. |
EFI_SUCCESS | A new IP6 service binding private was created. |
Definition at line 255 of file TcpDriver.c.
EFI_STATUS TcpCreateSocketCallback | ( | IN SOCKET * | This, |
IN VOID * | Context | ||
) |
The Callback function called after the TCP socket was created.
[in] | This | Pointer to the socket just created |
[in] | Context | Context of the socket |
EFI_SUCCESS | This protocol installed successfully. |
other | An error occurred. |
Definition at line 823 of file TcpDriver.c.
EFI_STATUS TcpCreateTimer | ( | VOID | ) |
Create and start the heartbeat timer for the TCP driver.
EFI_SUCCESS | The timer was successfully created and started. |
other | The timer was not created. |
Definition at line 100 of file TcpDriver.c.
EFI_STATUS EFIAPI TcpDestroyChildEntryInHandleBuffer | ( | IN LIST_ENTRY * | Entry, |
IN VOID * | Context | ||
) |
Callback function which provided by user to remove one node in NetDestroyLinkList process.
[in] | Entry | The entry to be removed. |
[in] | Context | Pointer to the callback context corresponds to the Context in NetDestroyLinkList. |
EFI_SUCCESS | The entry has been removed successfully. |
Others | Fail to remove the entry. |
Definition at line 420 of file TcpDriver.c.
EFI_STATUS TcpDestroyService | ( | IN EFI_HANDLE | Controller, |
IN EFI_HANDLE | ImageHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL, | ||
IN UINT8 | IpVersion | ||
) |
Destroy a TCP6 or TCP4 service binding instance. It will release all the resources allocated by the instance.
[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 |
EFI_SUCCESS | The resources used by the instance were cleaned up. |
Others | Failed to clean up some of the resources. |
Definition at line 463 of file TcpDriver.c.
The callback function called before the TCP socket was to be destroyed.
[in] | This | The TCP socket to be destroyed. |
[in] | Context | The context of the socket. |
Definition at line 892 of file TcpDriver.c.
VOID TcpDestroyTimer | ( | VOID | ) |
Stop and destroy the heartbeat timer for TCP driver.
Definition at line 137 of file TcpDriver.c.
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.
[in] | ImageHandle | The firmware allocated handle for this driver image. |
[in] | SystemTable | Pointer to the EFI system table. |
EFI_SUCCESS | The driver loaded. |
other | The driver did not load. |
Definition at line 166 of file TcpDriver.c.
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.
[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. |
EFI_SUCCESS | The protocol was added to ChildHandle. |
EFI_INVALID_PARAMETER | ChildHandle is NULL. |
EFI_OUT_OF_RESOURCES | There are not enough resources available to create the child. |
other | The child handle was not created. |
Definition at line 946 of file TcpDriver.c.
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.
This | Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance. |
ChildHandle | Handle of the child to be destroyed. |
EFI_SUCCESS | 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. |
Definition at line 1021 of file TcpDriver.c.
EFI_DRIVER_BINDING_PROTOCOL gTcp4DriverBinding |
Definition at line 63 of file TcpDriver.c.
EFI_TCP4_PROTOCOL gTcp4ProtocolTemplate |
Definition at line 20 of file TcpDriver.c.
EFI_DRIVER_BINDING_PROTOCOL gTcp6DriverBinding |
Definition at line 72 of file TcpDriver.c.
EFI_TCP6_PROTOCOL gTcp6ProtocolTemplate |
Definition at line 33 of file TcpDriver.c.
EFI_SERVICE_BINDING_PROTOCOL gTcpServiceBinding |
Definition at line 81 of file TcpDriver.c.
EFI_HANDLE mHash2ServiceHandle = NULL |
Definition at line 90 of file TcpDriver.c.
UINT16 mTcp4RandomPort |
Definition at line 12 of file TcpDriver.c.
UINT16 mTcp6RandomPort |
Definition at line 13 of file TcpDriver.c.
SOCK_INIT_DATA mTcpDefaultSockData |
Definition at line 45 of file TcpDriver.c.
TCP_HEARTBEAT_TIMER mTcpTimer |
Definition at line 15 of file TcpDriver.c.