WifiConnectionMgrImpl.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /** @file
  2. The Mac Connection2 Protocol adapter 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_IMPL__
  7. #define __EFI_WIFI_IMPL__
  8. /**
  9. Start scan operation, and send out a token to collect available networks.
  10. @param[in] Nic Pointer to the device data of the selected NIC.
  11. @retval EFI_SUCCESS The operation is completed.
  12. @retval EFI_ALREADY_STARTED A former scan operation is already ongoing.
  13. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
  14. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  15. @retval Other Errors Return errors when getting networks from low layer.
  16. **/
  17. EFI_STATUS
  18. WifiMgrStartScan (
  19. IN WIFI_MGR_DEVICE_DATA *Nic
  20. );
  21. /**
  22. Get current link state from low layer.
  23. @param[in] Nic Pointer to the device data of the selected NIC.
  24. @param[out] LinkState The pointer to buffer to retrieve link state.
  25. @retval EFI_SUCCESS The operation is completed.
  26. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
  27. @retval EFI_UNSUPPORTED Adapter information protocol is not supported.
  28. @retval Other Errors Returned errors when retrieving link state from low layer.
  29. **/
  30. EFI_STATUS
  31. WifiMgrGetLinkState (
  32. IN WIFI_MGR_DEVICE_DATA *Nic,
  33. OUT EFI_ADAPTER_INFO_MEDIA_STATE *LinkState
  34. );
  35. /**
  36. Start connect operation, and send out a token to connect to a target network.
  37. @param[in] Nic Pointer to the device data of the selected NIC.
  38. @param[in] Profile The target network to be connected.
  39. @retval EFI_SUCCESS The operation is completed.
  40. @retval EFI_ALREADY_STARTED Already in "connected" state, need to perform a disconnect
  41. operation first.
  42. @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
  43. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  44. @retval Other Errors Return errors when connecting network on low layer.
  45. **/
  46. EFI_STATUS
  47. WifiMgrConnectToNetwork (
  48. IN WIFI_MGR_DEVICE_DATA *Nic,
  49. IN WIFI_MGR_NETWORK_PROFILE *Profile
  50. );
  51. /**
  52. Start disconnect operation, and send out a token to disconnect from current connected
  53. network.
  54. @param[in] Nic Pointer to the device data of the selected NIC.
  55. @retval EFI_SUCCESS The operation is completed.
  56. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  57. @retval Other Errors Return errors when disconnecting a network on low layer.
  58. **/
  59. EFI_STATUS
  60. WifiMgrDisconnectToNetwork (
  61. IN WIFI_MGR_DEVICE_DATA *Nic
  62. );
  63. /**
  64. The state machine of the connection manager, periodically check the state and
  65. perform a corresponding operation.
  66. @param[in] Event The timer event to be triggered.
  67. @param[in] Context The context of the Nic device data.
  68. **/
  69. VOID
  70. EFIAPI
  71. WifiMgrOnTimerTick (
  72. IN EFI_EVENT Event,
  73. IN VOID *Context
  74. );
  75. #endif