/** @file
Driver Binding functions and Service Binding functions
implementationfor for Dhcp6 Driver.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Dhcp6Impl.h"
0xa,
NULL,
};
};
/**
Configure the default Udp6Io to receive all the DHCP6 traffic
on this network interface.
@param[in] UdpIo The pointer to Udp6Io to be configured.
@param[in] Context The pointer to the context.
@retval EFI_SUCCESS The Udp6Io is successfully configured.
@retval Others Failed to configure the Udp6Io.
**/
)
{
//
// Set Udp6 configure data for the Dhcp6 instance.
//
Config->TrafficClass = 0;
Config->ReceiveTimeout = 0;
Config->TransmitTimeout = 0;
//
// Configure an endpoint of client(0, 546), server(0, 0), the addresses
// will be overridden later. Note that we MUST not limit RemotePort.
// More details, refer to RFC 3315 section 5.2.
//
Config->RemotePort = 0;
}
/**
Destory the Dhcp6 service. The Dhcp6 service may be partly initialized,
or partly destroyed. If a resource is destroyed, it is marked as such in
case the destroy failed and being called again later.
@param[in, out] Service The pointer to Dhcp6 service to be destroyed.
**/
)
{
//
// All children instances should have been already destoryed here.
//
}
}
}
/**
Create a new Dhcp6 service for the Nic controller.
@param[in] Controller The controller to be installed DHCP6 service
binding protocol.
@param[in] ImageHandle The image handle of the Dhcp6 driver.
@param[out] Service The return pointer of the new Dhcp6 service.
@retval EFI_SUCCESS The Dhcp6 service is created successfully.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource.
**/
)
{
return EFI_OUT_OF_RESOURCES;
}
//
// Open the SNP protocol to get mode data later.
//
return EFI_DEVICE_ERROR;
}
//
// Initialize the fields of the new Dhcp6 service.
//
CopyMem (
sizeof (EFI_SERVICE_BINDING_PROTOCOL)
);
//
// Generate client Duid: If SMBIOS system UUID is located, generate DUID in DUID-UUID format.
// Otherwise, in DUID-LLT format.
//
return EFI_DEVICE_ERROR;
}
//
//
);
return EFI_DEVICE_ERROR;
}
return EFI_SUCCESS;
}
/**
Destroy the Dhcp6 instance and recycle the resources.
@param[in, out] Instance The pointer to the Dhcp6 instance.
**/
)
{
//
// Clean up the retry list first.
//
//
// Clean up the current configure data.
//
}
//
// Clean up the current Ia.
//
}
}
}
}
}
/**
Create the Dhcp6 instance and initialize it.
@param[in] Service The pointer to the Dhcp6 service.
@param[out] Instance The pointer to the Dhcp6 instance.
@retval EFI_SUCCESS The Dhcp6 instance is created.
@retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
**/
)
{
return EFI_OUT_OF_RESOURCES;
}
//
// Initialize the fields of the new Dhcp6 instance.
//
CopyMem (
sizeof (EFI_DHCP6_PROTOCOL)
);
//
// There is a timer for each Dhcp6 instance, which is used to track the
// lease time of Ia and the retransmisson time of all sent packets.
//
);
return Status;
}
return EFI_SUCCESS;
}
/**
Entry point of the DHCP6 driver to install various protocols.
@param[in] ImageHandle The handle of the UEFI image file.
@param[in] SystemTable The pointer to the EFI System Table.
@retval EFI_SUCCESS The operation completed successfully.
@retval Others Unexpected error occurs.
**/
)
{
);
}
/**
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.
@param[in] This The pointer to the driver binding protocol.
@param[in] ControllerHandle The handle of device to be tested.
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to be started.
@retval EFI_SUCCESS This driver supports this device.
@retval Others This driver does not support this device.
**/
)
{
return gBS->OpenProtocol (
NULL,
);
}
/**
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.
@param[in] This The pointer to the driver binding protocol.
@param[in] ControllerHandle The handle of device to be started.
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to be started.
@retval EFI_SUCCESS This driver is installed to ControllerHandle.
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
@retval other This driver does not support this device.
**/
)
{
//
// Check the Dhcp6 serivce whether already started.
//
NULL,
);
return EFI_ALREADY_STARTED;
}
//
// Create and initialize the Dhcp6 service.
//
);
return Status;
}
);
return Status;
}
return EFI_SUCCESS;
}
/**
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.
@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.
@retval EFI_SUCCESS This driver is removed ControllerHandle
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval other This driver was not removed from this device
**/
)
{
//
// Find and check the Nic handle by the controller handle.
//
return EFI_DEVICE_ERROR;
}
(VOID **) &ServiceBinding,
);
return Status;
}
return EFI_SUCCESS;
}
if (NumberOfChildren == 0) {
//
// Destory the service itself if no child instance left.
//
);
goto ON_EXIT;
}
} else {
//
// Destory all the children instances before destory the service.
//
}
//
// Any of child failed to be destroyed.
//
if (Service->NumOfChild != 0) {
}
}
return Status;
}
/**
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.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[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.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval other The child handle was not created.
**/
)
{
return EFI_INVALID_PARAMETER;
}
return Status;
}
//
// Start the timer when the instance is ready to use.
//
);
goto ON_ERROR;
}
//
// Install the DHCP6 protocol onto ChildHandle.
//
);
goto ON_ERROR;
}
//
// Open the UDP6 protocol BY_CHILD.
//
);
);
goto ON_ERROR;
}
//
// Add into the children list of its parent service.
//
Service->NumOfChild++;
return EFI_SUCCESS;
return Status;
}
/**
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.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Handle of the child to destroy
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
@retval EFI_INVALID_PARAMETER Child handle is NULL.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
because its services are being used.
@retval other The child handle was not destroyed
**/
)
{
return EFI_INVALID_PARAMETER;
}
//
// Retrieve the private context data structures
//
);
return EFI_UNSUPPORTED;
}
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
);
return Status;
}
//
// Uninstall the MTFTP6 protocol first to enable a top down destruction.
//
);
return Status;
}
//
// Remove it from the children list of its parent service.
//
Service->NumOfChild--;
return EFI_SUCCESS;
}