PxeBcBoot.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /** @file
  2. Boot functions declaration for UefiPxeBc Driver.
  3. Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_PXEBC_BOOT_H__
  7. #define __EFI_PXEBC_BOOT_H__
  8. #define PXEBC_DISPLAY_MAX_LINE 70
  9. #define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8
  10. #define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4
  11. #define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))
  12. /**
  13. Extract the discover information and boot server entry from the
  14. cached packets if unspecified.
  15. @param[in] Private Pointer to PxeBc private data.
  16. @param[in] Type The type of bootstrap to perform.
  17. @param[in, out] DiscoverInfo Pointer to EFI_PXE_BASE_CODE_DISCOVER_INFO.
  18. @param[out] BootEntry Pointer to PXEBC_BOOT_SVR_ENTRY.
  19. @param[out] SrvList Pointer to EFI_PXE_BASE_CODE_SRVLIST.
  20. @retval EFI_SUCCESS Successfully extracted the information.
  21. @retval EFI_DEVICE_ERROR Failed to extract the information.
  22. **/
  23. EFI_STATUS
  24. PxeBcExtractDiscoverInfo (
  25. IN PXEBC_PRIVATE_DATA *Private,
  26. IN UINT16 Type,
  27. IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo,
  28. OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
  29. OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
  30. );
  31. /**
  32. Build the discover packet and send out for boot.
  33. @param[in] Private Pointer to PxeBc private data.
  34. @param[in] Type PxeBc option boot item type.
  35. @param[in] Layer Pointer to option boot item layer.
  36. @param[in] UseBis Use BIS or not.
  37. @param[in] DestIp Pointer to the server address.
  38. @param[in] IpCount The total count of the server address.
  39. @param[in] SrvList Pointer to the server address list.
  40. @retval EFI_SUCCESS Successfully discovered boot file.
  41. @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
  42. @retval EFI_NOT_FOUND Can't get the PXE reply packet.
  43. @retval Others Failed to discover boot file.
  44. **/
  45. EFI_STATUS
  46. PxeBcDiscoverBootServer (
  47. IN PXEBC_PRIVATE_DATA *Private,
  48. IN UINT16 Type,
  49. IN UINT16 *Layer,
  50. IN BOOLEAN UseBis,
  51. IN EFI_IP_ADDRESS *DestIp,
  52. IN UINT16 IpCount,
  53. IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
  54. );
  55. /**
  56. Load boot file into user buffer.
  57. @param[in] Private Pointer to PxeBc private data.
  58. @param[in, out] BufferSize Size of user buffer for input;
  59. required buffer size for output.
  60. @param[in] Buffer Pointer to user buffer.
  61. @retval EFI_SUCCESS Successfully obtained all the boot information.
  62. @retval EFI_BUFFER_TOO_SMALL The buffer size is not enough for boot file.
  63. @retval EFI_ABORTED User cancelled the current operation.
  64. @retval Others Failed to parse out the boot information.
  65. **/
  66. EFI_STATUS
  67. PxeBcLoadBootFile (
  68. IN PXEBC_PRIVATE_DATA *Private,
  69. IN OUT UINTN *BufferSize,
  70. IN VOID *Buffer OPTIONAL
  71. );
  72. #endif