1*5113495bSYour Name /* 2*5113495bSYour Name * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. 3*5113495bSYour Name * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 4*5113495bSYour Name * 5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for 6*5113495bSYour Name * any purpose with or without fee is hereby granted, provided that the 7*5113495bSYour Name * above copyright notice and this permission notice appear in all 8*5113495bSYour Name * copies. 9*5113495bSYour Name * 10*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11*5113495bSYour Name * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12*5113495bSYour Name * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13*5113495bSYour Name * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14*5113495bSYour Name * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15*5113495bSYour Name * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16*5113495bSYour Name * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17*5113495bSYour Name * PERFORMANCE OF THIS SOFTWARE. 18*5113495bSYour Name */ 19*5113495bSYour Name 20*5113495bSYour Name /** 21*5113495bSYour Name * DOC: Contains green ap north bound interface definitions 22*5113495bSYour Name */ 23*5113495bSYour Name 24*5113495bSYour Name #ifndef _WLAN_GREEN_AP_API_H_ 25*5113495bSYour Name #define _WLAN_GREEN_AP_API_H_ 26*5113495bSYour Name 27*5113495bSYour Name #include <wlan_objmgr_cmn.h> 28*5113495bSYour Name #include <wlan_objmgr_pdev_obj.h> 29*5113495bSYour Name #include <qdf_status.h> 30*5113495bSYour Name #include "../../../global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h" 31*5113495bSYour Name 32*5113495bSYour Name /* Green ap mode of operation */ 33*5113495bSYour Name #define WLAN_GREEN_AP_MODE_NO_STA 1 /* PS if no sta connected */ 34*5113495bSYour Name #define WLAN_GREEN_AP_MODE_NUM_STREAM 2 /* PS if 1x1 clients only connected */ 35*5113495bSYour Name 36*5113495bSYour Name /** 37*5113495bSYour Name * struct wlan_green_ap_egap_params - enhance green ap params 38*5113495bSYour Name * @fw_egap_support: fw enhance green ap support 39*5113495bSYour Name * @host_enable_egap: HOST enhance green ap support 40*5113495bSYour Name * @egap_inactivity_time: inactivity time 41*5113495bSYour Name * @egap_wait_time: wait time 42*5113495bSYour Name * @egap_feature_flags: feature flags 43*5113495bSYour Name */ 44*5113495bSYour Name struct wlan_green_ap_egap_params { 45*5113495bSYour Name bool fw_egap_support; 46*5113495bSYour Name bool host_enable_egap; 47*5113495bSYour Name uint32_t egap_inactivity_time; 48*5113495bSYour Name uint32_t egap_wait_time; 49*5113495bSYour Name uint32_t egap_feature_flags; 50*5113495bSYour Name }; 51*5113495bSYour Name 52*5113495bSYour Name /** 53*5113495bSYour Name * struct wlan_green_ap_egap_status_info - enhance green ap params 54*5113495bSYour Name * @status: egap status 55*5113495bSYour Name * @mac_id: mac id 56*5113495bSYour Name * @tx_chainmask: tx chainmask 57*5113495bSYour Name * @rx_chainmask: rx chainmask 58*5113495bSYour Name */ 59*5113495bSYour Name struct wlan_green_ap_egap_status_info { 60*5113495bSYour Name uint32_t status; 61*5113495bSYour Name uint32_t mac_id; 62*5113495bSYour Name uint32_t tx_chainmask; 63*5113495bSYour Name uint32_t rx_chainmask; 64*5113495bSYour Name }; 65*5113495bSYour Name 66*5113495bSYour Name #ifdef WLAN_SUPPORT_GAP_LL_PS_MODE 67*5113495bSYour Name /** 68*5113495bSYour Name * struct green_ap_hdd_callback: Green AP HDD callback structure 69*5113495bSYour Name * @send_event: function to send the event parameter to userspace via hdd 70*5113495bSYour Name */ 71*5113495bSYour Name 72*5113495bSYour Name struct green_ap_hdd_callback { 73*5113495bSYour Name QDF_STATUS (*send_event)(struct wlan_objmgr_vdev *vdev, 74*5113495bSYour Name struct wlan_green_ap_ll_ps_event_param *ll_event_param); 75*5113495bSYour Name 76*5113495bSYour Name }; 77*5113495bSYour Name #endif 78*5113495bSYour Name 79*5113495bSYour Name /** 80*5113495bSYour Name * wlan_green_ap_init() - initialize green ap component 81*5113495bSYour Name * 82*5113495bSYour Name * Return: Success or Failure 83*5113495bSYour Name */ 84*5113495bSYour Name QDF_STATUS wlan_green_ap_init(void); 85*5113495bSYour Name 86*5113495bSYour Name /** 87*5113495bSYour Name * wlan_green_ap_deinit() - De-initialize green ap component 88*5113495bSYour Name * 89*5113495bSYour Name * Return: Success or Failure 90*5113495bSYour Name */ 91*5113495bSYour Name QDF_STATUS wlan_green_ap_deinit(void); 92*5113495bSYour Name 93*5113495bSYour Name /** 94*5113495bSYour Name * wlan_green_ap_start() - Start green ap 95*5113495bSYour Name * @pdev: pdev pointer 96*5113495bSYour Name * 97*5113495bSYour Name * Call this function when the first SAP comes up 98*5113495bSYour Name * 99*5113495bSYour Name * Return: Success or Failure 100*5113495bSYour Name */ 101*5113495bSYour Name QDF_STATUS wlan_green_ap_start(struct wlan_objmgr_pdev *pdev); 102*5113495bSYour Name 103*5113495bSYour Name /** 104*5113495bSYour Name * wlan_green_ap_stop() - Stop green ap 105*5113495bSYour Name * @pdev: pdev pointer 106*5113495bSYour Name * 107*5113495bSYour Name * Call this function when the last SAP goes down 108*5113495bSYour Name * 109*5113495bSYour Name * Return: Success or Failure 110*5113495bSYour Name */ 111*5113495bSYour Name QDF_STATUS wlan_green_ap_stop(struct wlan_objmgr_pdev *pdev); 112*5113495bSYour Name 113*5113495bSYour Name /** 114*5113495bSYour Name * wlan_green_ap_pdev_open() - open component and update config params 115*5113495bSYour Name * @pdev: pdev pointer 116*5113495bSYour Name * 117*5113495bSYour Name * Return: Success or Failure 118*5113495bSYour Name */ 119*5113495bSYour Name QDF_STATUS wlan_green_ap_pdev_open(struct wlan_objmgr_pdev *pdev); 120*5113495bSYour Name 121*5113495bSYour Name /** 122*5113495bSYour Name * wlan_green_ap_add_sta() - On association 123*5113495bSYour Name * @pdev: pdev pointer 124*5113495bSYour Name * 125*5113495bSYour Name * Call this function when new node is associated 126*5113495bSYour Name * 127*5113495bSYour Name * Return: Success or Failure 128*5113495bSYour Name */ 129*5113495bSYour Name QDF_STATUS wlan_green_ap_add_sta(struct wlan_objmgr_pdev *pdev); 130*5113495bSYour Name 131*5113495bSYour Name /** 132*5113495bSYour Name * wlan_green_ap_add_multistream_sta() - On association 133*5113495bSYour Name * @pdev: pdev pointer 134*5113495bSYour Name * 135*5113495bSYour Name * Call this function when new multistream node is associated 136*5113495bSYour Name * 137*5113495bSYour Name * Return: Success or Failure 138*5113495bSYour Name */ 139*5113495bSYour Name QDF_STATUS wlan_green_ap_add_multistream_sta(struct wlan_objmgr_pdev *pdev); 140*5113495bSYour Name 141*5113495bSYour Name /** 142*5113495bSYour Name * wlan_green_ap_del_sta() - On disassociation 143*5113495bSYour Name * @pdev: pdev pointer 144*5113495bSYour Name * 145*5113495bSYour Name * Call this function when new node is disassociated 146*5113495bSYour Name * 147*5113495bSYour Name * Return: Success or Failure 148*5113495bSYour Name */ 149*5113495bSYour Name QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev); 150*5113495bSYour Name 151*5113495bSYour Name /** 152*5113495bSYour Name * wlan_green_ap_del_multistream_sta() - On disassociation 153*5113495bSYour Name * @pdev: pdev pointer 154*5113495bSYour Name * 155*5113495bSYour Name * Call this function when new multistream node is disassociated 156*5113495bSYour Name * 157*5113495bSYour Name * Return: Success or Failure 158*5113495bSYour Name */ 159*5113495bSYour Name QDF_STATUS wlan_green_ap_del_multistream_sta(struct wlan_objmgr_pdev *pdev); 160*5113495bSYour Name 161*5113495bSYour Name /** 162*5113495bSYour Name * wlan_green_ap_is_ps_enabled() - is power save enabled 163*5113495bSYour Name * @pdev: pdev pointer 164*5113495bSYour Name * 165*5113495bSYour Name * Check if power save is enabled in FW 166*5113495bSYour Name * 167*5113495bSYour Name * Return: Success or Failure 168*5113495bSYour Name */ 169*5113495bSYour Name bool wlan_green_ap_is_ps_enabled(struct wlan_objmgr_pdev *pdev); 170*5113495bSYour Name 171*5113495bSYour Name /** 172*5113495bSYour Name * wlan_green_ap_suspend_handle() - handle driver suspend 173*5113495bSYour Name * @pdev: pdev pointer 174*5113495bSYour Name * 175*5113495bSYour Name * Return: None 176*5113495bSYour Name */ 177*5113495bSYour Name void wlan_green_ap_suspend_handle(struct wlan_objmgr_pdev *pdev); 178*5113495bSYour Name 179*5113495bSYour Name /** 180*5113495bSYour Name * wlan_green_ap_get_capab() - get lmac capability 181*5113495bSYour Name * @pdev: pdev pointer 182*5113495bSYour Name * 183*5113495bSYour Name * Return: Appropriate status 184*5113495bSYour Name */ 185*5113495bSYour Name QDF_STATUS wlan_green_ap_get_capab(struct wlan_objmgr_pdev *pdev); 186*5113495bSYour Name 187*5113495bSYour Name /** 188*5113495bSYour Name * wlan_green_ap_is_ps_waiting() - is power save in wait state 189*5113495bSYour Name * @pdev: pdev pointer 190*5113495bSYour Name * 191*5113495bSYour Name * Check if power save is in wait state 192*5113495bSYour Name * 193*5113495bSYour Name * Return: Success or Failure 194*5113495bSYour Name */ 195*5113495bSYour Name bool wlan_green_ap_is_ps_waiting(struct wlan_objmgr_pdev *pdev); 196*5113495bSYour Name #endif /* _WLAN_GREEN_AP_API_H_ */ 197