1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 /** 10 * @addtogroup WLAN 11 * @{ 12 * 13 * @brief Provides cross-OS migration, component adaptation, and modular assembly and compilation. 14 * 15 * Based on the unified APIs provided by the WLAN module, developers of the Hardware Driver Interface 16 * (HDI) are capable of creating, disabling, scanning for, and connecting to WLAN hotspots, managing WLAN chips, 17 * network devices, and power, and applying for, releasing, and moving network data buffers. 18 * 19 * @since 1.0 20 * @version 1.0 21 */ 22 23 /** 24 * @file hdf_wlan_power_manager.h 25 * 26 * @brief Declares data structures and functions of the WLAN power manager. 27 * 28 * @since 1.0 29 * @version 1.0 30 */ 31 32 #ifndef HDF_WLAN_POWER_MANAGE_H 33 #define HDF_WLAN_POWER_MANAGE_H 34 35 /** 36 * @brief Provides functions for powering on and off the device, releasing power, and creating a power manager. 37 * 38 * @since 1.0 39 * @version 1.0 40 */ 41 struct PowerManager { 42 /** 43 * @brief Powers on the device using a specified power manager. 44 * 45 * @param powerMgr Indicates the pointer to the power manager. 46 * @return Returns <b>0</b> if the device is powered on; returns a negative value otherwise. 47 * 48 * @since 1.0 49 * @version 1.0 50 */ 51 int32_t (*On)(struct PowerManager *powerMgr); 52 53 /** 54 * @brief Powers off the device using a specified power manager. 55 * 56 * @param powerMgr Indicates the pointer to the power manager. 57 * @return Returns <b>0</b> if the device is powered off; returns a negative value otherwise. 58 * 59 * @since 1.0 60 * @version 1.0 61 */ 62 int32_t (*Off)(struct PowerManager *powerMgr); 63 64 /** 65 * @brief Releases power using a specified power manager. 66 * 67 * @param powerMgr Indicates the pointer to the power manager. 68 * @return Returns <b>0</b> if power is released; returns a negative value otherwise. 69 * 70 * @since 1.0 71 * @version 1.0 72 */ 73 int32_t (*Release)(struct PowerManager *powerMgr); 74 }; 75 76 /** 77 * @brief Creates a WLAN power manager. 78 * 79 * @param configPowers Indicates the pointer to the power configuration. 80 * @return Returns a pointer to the created power manager. 81 * 82 * @since 1.0 83 * @version 1.0 84 */ 85 struct PowerManager *HdfWlanCreatePowerManager(const struct HdfConfWlanPowers *configPowers); 86 87 #endif 88 /** @} */ 89