/* 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. */
EFI_STATUS EFIAPI Udp6DriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
/* 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. */
EFI_STATUS EFIAPI Udp6DriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
{
  EFI_STATUS         Status;
  UDP6_SERVICE_DATA  *Udp6Service;
  Udp6Service = AllocateZeroPool (sizeof (UDP6_SERVICE_DATA));
  if (Udp6Service == NULL) {
    Status = EFI_OUT_OF_RESOURCES;
    goto EXIT;
  }
  Status = Udp6CreateService (Udp6Service, This->DriverBindingHandle, ControllerHandle);
  if (EFI_ERROR (Status)) {
    goto EXIT;
  }
  Status = gBS->InstallMultipleProtocolInterfaces (
                  &ControllerHandle,
                  &gEfiUdp6ServiceBindingProtocolGuid,
                  &Udp6Service->ServiceBinding,
                  NULL
                  );
  if (EFI_ERROR (Status)) {
    Udp6CleanService (Udp6Service);
  }
EXIT:
  if (EFI_ERROR (Status)) {
    if (Udp6Service != NULL) {
      FreePool (Udp6Service);
    }
  }
  return Status;
}