1 /* 2 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: Contains green ap north bound interface definitions 21 */ 22 23 #ifndef _WLAN_GREEN_AP_API_H_ 24 #define _WLAN_GREEN_AP_API_H_ 25 26 #include <wlan_objmgr_cmn.h> 27 #include <wlan_objmgr_pdev_obj.h> 28 #include <qdf_status.h> 29 30 /** 31 * struct wlan_green_ap_egap_params - enhance green ap params 32 * @fw_egap_support: fw enhance green ap support 33 * @host_enable_egap: HOST enhance green ap support 34 * @egap_inactivity_time: inactivity time 35 * @egap_wait_time: wait time 36 * @egap_feature_flags: feature flags 37 */ 38 struct wlan_green_ap_egap_params { 39 bool fw_egap_support; 40 bool host_enable_egap; 41 uint32_t egap_inactivity_time; 42 uint32_t egap_wait_time; 43 uint32_t egap_feature_flags; 44 }; 45 46 /** 47 * struct wlan_green_ap_egap_status_info - enhance green ap params 48 * @status: egap status 49 * @mac_id: mac id 50 * @tx_chainmask: tx chainmask 51 * @rx_chainmask: rx chainmask 52 */ 53 struct wlan_green_ap_egap_status_info { 54 uint32_t status; 55 uint32_t mac_id; 56 uint32_t tx_chainmask; 57 uint32_t rx_chainmask; 58 }; 59 60 /** 61 * wlan_green_ap_init() - initialize green ap component 62 * 63 * Return: Success or Failure 64 */ 65 QDF_STATUS wlan_green_ap_init(void); 66 67 /** 68 * wlan_green_ap_deinit() - De-initialize green ap component 69 * 70 * Return: Success or Failure 71 */ 72 QDF_STATUS wlan_green_ap_deinit(void); 73 74 /** 75 * wlan_green_ap_start() - Start green ap 76 * @pdev: pdev pointer 77 * 78 * Call this function when the first SAP comes up 79 * 80 * Return: Success or Failure 81 */ 82 QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev); 83 84 /** 85 * wlan_green_ap_stop() - Stop green ap 86 * @pdev: pdev pointer 87 * 88 * Call this function when the last SAP goes down 89 * 90 * Return: Success or Failure 91 */ 92 QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev); 93 94 /** 95 * wlan_green_ap_pdev_open() - open component and update config params 96 * @pdev: pdev pointer 97 * 98 * Return: Success or Failure 99 */ 100 QDF_STATUS wlan_green_ap_pdev_open(struct wlan_objmgr_pdev *pdev); 101 102 /** 103 * wlan_green_ap_add_sta() - On association 104 * @pdev: pdev pointer 105 * 106 * Call this function when new node is associated 107 * 108 * Return: Success or Failure 109 */ 110 QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev); 111 112 /** 113 * wlan_green_ap_del_sta() - On disassociation 114 * @pdev: pdev pointer 115 * 116 * Call this function when new node is disassociated 117 * 118 * Return: Success or Failure 119 */ 120 QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev); 121 122 /** 123 * wlan_green_ap_is_ps_enabled() - is power save enabled 124 * @pdev: pdev pointer 125 * 126 * Check if power save is enabled in FW 127 * 128 * Return: Success or Failure 129 */ 130 bool wlan_green_ap_is_ps_enabled(struct wlan_objmgr_pdev *pdev); 131 132 /** 133 * wlan_green_ap_suspend_handle() - handle driver suspend 134 * @pdev: pdev pointer 135 * 136 * Return: None 137 */ 138 void wlan_green_ap_suspend_handle(struct wlan_objmgr_pdev *pdev); 139 140 /** 141 * wlan_green_ap_get_capab() - get lmac capability 142 * @pdev: pdev pointer 143 * 144 * Return: Appropriate status 145 */ 146 QDF_STATUS wlan_green_ap_get_capab(struct wlan_objmgr_pdev *pdev); 147 #endif /* _WLAN_GREEN_AP_API_H_ */ 148