1 /* 2 * Copyright (c) 2017-2020 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 /* Green ap mode of operation */ 31 #define WLAN_GREEN_AP_MODE_NO_STA 1 /* PS if no sta connected */ 32 #define WLAN_GREEN_AP_MODE_NUM_STREAM 2 /* PS if 1x1 clients only connected */ 33 34 /** 35 * struct wlan_green_ap_egap_params - enhance green ap params 36 * @fw_egap_support: fw enhance green ap support 37 * @host_enable_egap: HOST enhance green ap support 38 * @egap_inactivity_time: inactivity time 39 * @egap_wait_time: wait time 40 * @egap_feature_flags: feature flags 41 */ 42 struct wlan_green_ap_egap_params { 43 bool fw_egap_support; 44 bool host_enable_egap; 45 uint32_t egap_inactivity_time; 46 uint32_t egap_wait_time; 47 uint32_t egap_feature_flags; 48 }; 49 50 /** 51 * struct wlan_green_ap_egap_status_info - enhance green ap params 52 * @status: egap status 53 * @mac_id: mac id 54 * @tx_chainmask: tx chainmask 55 * @rx_chainmask: rx chainmask 56 */ 57 struct wlan_green_ap_egap_status_info { 58 uint32_t status; 59 uint32_t mac_id; 60 uint32_t tx_chainmask; 61 uint32_t rx_chainmask; 62 }; 63 64 /** 65 * wlan_green_ap_init() - initialize green ap component 66 * 67 * Return: Success or Failure 68 */ 69 QDF_STATUS wlan_green_ap_init(void); 70 71 /** 72 * wlan_green_ap_deinit() - De-initialize green ap component 73 * 74 * Return: Success or Failure 75 */ 76 QDF_STATUS wlan_green_ap_deinit(void); 77 78 /** 79 * wlan_green_ap_start() - Start green ap 80 * @pdev: pdev pointer 81 * 82 * Call this function when the first SAP comes up 83 * 84 * Return: Success or Failure 85 */ 86 QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev); 87 88 /** 89 * wlan_green_ap_stop() - Stop green ap 90 * @pdev: pdev pointer 91 * 92 * Call this function when the last SAP goes down 93 * 94 * Return: Success or Failure 95 */ 96 QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev); 97 98 /** 99 * wlan_green_ap_pdev_open() - open component and update config params 100 * @pdev: pdev pointer 101 * 102 * Return: Success or Failure 103 */ 104 QDF_STATUS wlan_green_ap_pdev_open(struct wlan_objmgr_pdev *pdev); 105 106 /** 107 * wlan_green_ap_add_sta() - On association 108 * @pdev: pdev pointer 109 * 110 * Call this function when new node is associated 111 * 112 * Return: Success or Failure 113 */ 114 QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev); 115 116 /** 117 * wlan_green_ap_add_multistream_sta() - On association 118 * @pdev: pdev pointer 119 * 120 * Call this function when new multistream node is associated 121 * 122 * Return: Success or Failure 123 */ 124 QDF_STATUS wlan_green_ap_add_multistream_sta(struct wlan_objmgr_pdev *pdev); 125 126 /** 127 * wlan_green_ap_del_sta() - On disassociation 128 * @pdev: pdev pointer 129 * 130 * Call this function when new node is disassociated 131 * 132 * Return: Success or Failure 133 */ 134 QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev); 135 136 /** 137 * wlan_green_ap_del_multistream_sta() - On disassociation 138 * @pdev: pdev pointer 139 * 140 * Call this function when new multistream node is disassociated 141 * 142 * Return: Success or Failure 143 */ 144 QDF_STATUS wlan_green_ap_del_multistream_sta(struct wlan_objmgr_pdev *pdev); 145 146 /** 147 * wlan_green_ap_is_ps_enabled() - is power save enabled 148 * @pdev: pdev pointer 149 * 150 * Check if power save is enabled in FW 151 * 152 * Return: Success or Failure 153 */ 154 bool wlan_green_ap_is_ps_enabled(struct wlan_objmgr_pdev *pdev); 155 156 /** 157 * wlan_green_ap_suspend_handle() - handle driver suspend 158 * @pdev: pdev pointer 159 * 160 * Return: None 161 */ 162 void wlan_green_ap_suspend_handle(struct wlan_objmgr_pdev *pdev); 163 164 /** 165 * wlan_green_ap_get_capab() - get lmac capability 166 * @pdev: pdev pointer 167 * 168 * Return: Appropriate status 169 */ 170 QDF_STATUS wlan_green_ap_get_capab(struct wlan_objmgr_pdev *pdev); 171 172 /** 173 * wlan_green_ap_is_ps_waiting() - is power save in wait state 174 * @pdev: pdev pointer 175 * 176 * Check if power save is in wait state 177 * 178 * Return: Success or Failure 179 */ 180 bool wlan_green_ap_is_ps_waiting(struct wlan_objmgr_pdev *pdev); 181 #endif /* _WLAN_GREEN_AP_API_H_ */ 182