WifiConnectionMgrFileUtil.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /** @file
  2. The file operation functions for WiFi Connection Manager.
  3. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_WIFI_MGR_FILE_UTIL__
  7. #define __EFI_WIFI_MGR_FILE_UTIL__
  8. #include "WifiConnectionMgrDxe.h"
  9. /**
  10. Read file content into BufferPtr, the size of the allocate buffer
  11. is *FileSize plus AddtionAllocateSize.
  12. @param[in] FileHandle The file to be read.
  13. @param[in, out] BufferPtr Pointers to the pointer of allocated buffer.
  14. @param[out] FileSize Size of input file
  15. @param[in] AddtionAllocateSize Addtion size the buffer need to be allocated.
  16. In case the buffer need to contain others besides the file content.
  17. @retval EFI_SUCCESS The file was read into the buffer.
  18. @retval EFI_INVALID_PARAMETER A parameter was invalid.
  19. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  20. @retval others Unexpected error.
  21. **/
  22. EFI_STATUS
  23. ReadFileContent (
  24. IN EFI_FILE_HANDLE FileHandle,
  25. IN OUT VOID **BufferPtr,
  26. OUT UINTN *FileSize,
  27. IN UINTN AddtionAllocateSize
  28. );
  29. /**
  30. Update the CA cert base on the input file path info.
  31. @param[in] Private The pointer to the global private data structure.
  32. @param[in] FilePath Point to the file path.
  33. @retval TRUE Exit caller function.
  34. @retval FALSE Not exit caller function.
  35. **/
  36. BOOLEAN
  37. UpdateCAFromFile (
  38. IN WIFI_MGR_PRIVATE_DATA *Private,
  39. IN EFI_DEVICE_PATH_PROTOCOL *FilePath
  40. );
  41. /**
  42. Update the Private Key base on the input file path info.
  43. @param[in] Private The pointer to the global private data structure.
  44. @param[in] FilePath Point to the file path.
  45. @retval TRUE Exit caller function.
  46. @retval FALSE Not exit caller function.
  47. **/
  48. BOOLEAN
  49. UpdatePrivateKeyFromFile (
  50. IN WIFI_MGR_PRIVATE_DATA *Private,
  51. IN EFI_DEVICE_PATH_PROTOCOL *FilePath
  52. );
  53. #endif