OemNicConfig2P.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /** @file
  2. *
  3. * Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved.
  4. * Copyright (c) 2016-2018, Linaro Limited. All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause-Patent
  7. *
  8. **/
  9. #include <OemNicConfig.h>
  10. EFI_STATUS
  11. EFIAPI OemGetMac2P (
  12. IN OUT EFI_MAC_ADDRESS *Mac,
  13. IN UINTN Port
  14. )
  15. {
  16. OemGetMac (Mac, Port);
  17. return EFI_SUCCESS;
  18. }
  19. EFI_STATUS
  20. EFIAPI OemSetMac2P (
  21. IN EFI_MAC_ADDRESS *Mac,
  22. IN UINTN Port
  23. )
  24. {
  25. OemSetMac (Mac, Port);
  26. return EFI_SUCCESS;
  27. }
  28. HISI_BOARD_NIC_PROTOCOL mHisiBoardNicProtocol2P = {
  29. .GetMac = OemGetMac2P,
  30. .SetMac = OemSetMac2P,
  31. };
  32. EFI_STATUS
  33. EFIAPI
  34. OemNicConfigEntry (
  35. IN EFI_HANDLE ImageHandle,
  36. IN EFI_SYSTEM_TABLE *SystemTable
  37. )
  38. {
  39. EFI_STATUS Status;
  40. Status = gBS->InstallProtocolInterface (
  41. &ImageHandle,
  42. &gHisiBoardNicProtocolGuid,
  43. EFI_NATIVE_INTERFACE,
  44. &mHisiBoardNicProtocol2P
  45. );
  46. if (EFI_ERROR (Status)) {
  47. DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Install Protocol failed %r\n",
  48. __FUNCTION__, __LINE__, Status));
  49. return Status;
  50. }
  51. return EFI_SUCCESS;
  52. }