Mukul Sharma | d75a667 | 2017-06-22 15:40:53 +0530 | [diff] [blame] | 1 | /* |
Jeff Johnson | b4c2996 | 2017-10-07 19:35:14 -0700 | [diff] [blame^] | 2 | * Copyright (c) 2017 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 | */ |
Mukul Sharma | d75a667 | 2017-06-22 15:40:53 +0530 | [diff] [blame] | 18 | /** |
| 19 | * DOC: declare utility API related to the pmo component |
| 20 | * called by other components |
| 21 | */ |
| 22 | |
| 23 | #ifndef _WLAN_PMO_OBJ_MGMT_API_H_ |
| 24 | #define _WLAN_PMO_OBJ_MGMT_API_H_ |
| 25 | |
| 26 | #include "wlan_pmo_common_public_struct.h" |
| 27 | #include "wlan_pmo_obj_mgmt_public_struct.h" |
| 28 | |
| 29 | /** |
| 30 | * pmo_init() - initialize pmo_ctx context. |
| 31 | * |
| 32 | * This function initializes the power manager offloads (a.k.a pmo) context. |
| 33 | * |
| 34 | * Return: QDF_STATUS_SUCCESS - in case of success else return error |
| 35 | */ |
| 36 | QDF_STATUS pmo_init(void); |
| 37 | |
| 38 | /** |
| 39 | * pmo_deinit() - De initialize pmo_ctx context. |
| 40 | * |
| 41 | * This function De initializes power manager offloads (a.k.a pmo) contex. |
| 42 | * |
| 43 | * Return: QDF_STATUS_SUCCESS - in case of success else return error |
| 44 | */ |
| 45 | QDF_STATUS pmo_deinit(void); |
| 46 | |
| 47 | /** |
| 48 | * pmo_psoc_object_created_notification(): pmo psoc create handler |
| 49 | * @psoc: psoc which is going to created by objmgr |
| 50 | * @arg: argument for vdev create handler |
| 51 | * |
| 52 | * PMO, register this api with objmgr to detect psoc is created in fwr |
| 53 | * |
| 54 | * Return QDF_STATUS status in case of success else return error |
| 55 | */ |
| 56 | QDF_STATUS pmo_psoc_object_created_notification( |
| 57 | struct wlan_objmgr_psoc *psoc, void *arg); |
| 58 | |
| 59 | /** |
| 60 | * pmo_psoc_object_destroyed_notification(): pmo psoc delete handler |
| 61 | * @psco: psoc which is going to delete by objmgr |
| 62 | * @arg: argument for vdev delete handler |
| 63 | * |
| 64 | * PMO, register this api with objmgr to detect psoc is deleted in fwr |
| 65 | * |
| 66 | * Return QDF_STATUS status in case of success else return error |
| 67 | */ |
| 68 | QDF_STATUS pmo_psoc_object_destroyed_notification( |
| 69 | struct wlan_objmgr_psoc *psoc, void *arg); |
| 70 | |
| 71 | /** |
| 72 | * pmo_vdev_object_created_notification(): pmo vdev create handler |
| 73 | * @vdev: vdev which is going to created by objmgr |
| 74 | * @arg: argument for vdev create handler |
| 75 | * |
| 76 | * PMO, register this api with objmgr to detect vdev is created in fwr |
| 77 | * |
| 78 | * Return QDF_STATUS status in case of success else return error |
| 79 | */ |
| 80 | QDF_STATUS pmo_vdev_object_created_notification( |
| 81 | struct wlan_objmgr_vdev *vdev, void *arg); |
| 82 | |
| 83 | /** |
| 84 | * pmo_vdev_ready() - handles vdev ready in firmware event |
| 85 | * @vdev: vdev which is ready in firmware |
| 86 | * |
| 87 | * Objmgr vdev_create event does not guarantee vdev creation in firmware. |
| 88 | * Any logic that would normally go in the vdev_create event, but needs to |
| 89 | * communicate with firmware, needs to go here instead. |
| 90 | * |
| 91 | * Return QDF_STATUS |
| 92 | */ |
| 93 | QDF_STATUS pmo_vdev_ready(struct wlan_objmgr_vdev *vdev); |
| 94 | |
| 95 | /** |
| 96 | * pmo_vdev_object_destroyed_notification(): pmo vdev delete handler |
| 97 | * @vdev: vdev which is going to delete by objmgr |
| 98 | * @arg: argument for vdev delete handler |
| 99 | * |
| 100 | * PMO, register this api with objmgr to detect vdev is deleted in fwr |
| 101 | * |
| 102 | * Return QDF_STATUS status in case of success else return error |
| 103 | */ |
| 104 | QDF_STATUS pmo_vdev_object_destroyed_notification( |
| 105 | struct wlan_objmgr_vdev *vdev, void *arg); |
| 106 | |
| 107 | /** |
| 108 | * pmo_register_suspend_handler(): register suspend handler for components |
| 109 | * @id: component id |
| 110 | * @handler: resume handler for the mention component |
| 111 | * @arg: argument to pass while calling resume handler |
| 112 | * |
| 113 | * Return QDF_STATUS status -in case of success else return error |
| 114 | */ |
| 115 | QDF_STATUS pmo_register_suspend_handler( |
| 116 | enum wlan_umac_comp_id id, |
| 117 | pmo_psoc_suspend_handler handler, |
| 118 | void *arg); |
| 119 | |
| 120 | /** |
| 121 | * pmo_unregister_suspend_handler():unregister suspend handler for components |
| 122 | * @id: component id |
| 123 | * @handler: resume handler for the mention component |
| 124 | * |
| 125 | * Return QDF_STATUS status -in case of success else return error |
| 126 | */ |
| 127 | QDF_STATUS pmo_unregister_suspend_handler( |
| 128 | enum wlan_umac_comp_id id, |
| 129 | pmo_psoc_suspend_handler handler); |
| 130 | |
| 131 | /** |
| 132 | * pmo_register_resume_handler(): API to register resume handler for components |
| 133 | * @id: component id |
| 134 | * @handler: resume handler for the mention component |
| 135 | * @arg: argument to pass while calling resume handler |
| 136 | * |
| 137 | * Return QDF_STATUS status - in case of success else return error |
| 138 | */ |
| 139 | QDF_STATUS pmo_register_resume_handler( |
| 140 | enum wlan_umac_comp_id id, |
| 141 | pmo_psoc_resume_handler handler, |
| 142 | void *arg); |
| 143 | |
| 144 | /** |
| 145 | * pmo_unregister_resume_handler(): unregister resume handler for components |
| 146 | * @id: component id |
| 147 | * @handler: resume handler for the mention component |
| 148 | * |
| 149 | * Return QDF_STATUS status - in case of success else return error |
| 150 | */ |
| 151 | QDF_STATUS pmo_unregister_resume_handler( |
| 152 | enum wlan_umac_comp_id id, |
| 153 | pmo_psoc_resume_handler handler); |
| 154 | |
| 155 | /** |
| 156 | * pmo_suspend_all_components(): API to suspend all component |
| 157 | * @psoc:objmgr psoc |
| 158 | * @suspend_type: Tell suspend type (apps suspend / runtime suspend) |
| 159 | * |
| 160 | * Return QDF_STATUS status - in case of success else return error |
| 161 | */ |
| 162 | QDF_STATUS pmo_suspend_all_components(struct wlan_objmgr_psoc *psoc, |
| 163 | enum qdf_suspend_type suspend_type); |
| 164 | |
| 165 | /** |
| 166 | * pmo_resume_all_components(): API to resume all component |
| 167 | * @psoc:objmgr psoc |
| 168 | * @suspend_type: Tell suspend type from which resume is required |
| 169 | * |
| 170 | * Return QDF_STATUS status - in case of success else return error |
| 171 | */ |
| 172 | QDF_STATUS pmo_resume_all_components(struct wlan_objmgr_psoc *psoc, |
| 173 | enum qdf_suspend_type suspend_type); |
| 174 | |
| 175 | /** |
| 176 | * pmo_register_pause_bitmap_notifier(): API to register pause bitmap notifier |
| 177 | * @psoc: objmgr psoc handle |
| 178 | * @handler: pause bitmap updated notifier |
| 179 | * |
| 180 | * Return QDF_STATUS status - in case of success else return error |
| 181 | */ |
| 182 | QDF_STATUS pmo_register_pause_bitmap_notifier( |
| 183 | struct wlan_objmgr_psoc *psoc, |
| 184 | pmo_notify_pause_bitmap handler); |
| 185 | |
| 186 | /** |
| 187 | * pmo_unregister_pause_bitmap_notifier(): API to unregister pause bitmap notifier |
| 188 | * @psoc: objmgr psoc handle |
| 189 | * @handler: pause bitmap updated notifier |
| 190 | * |
| 191 | * Return QDF_STATUS status - in case of success else return error |
| 192 | */ |
| 193 | QDF_STATUS pmo_unregister_pause_bitmap_notifier( |
| 194 | struct wlan_objmgr_psoc *psoc, |
| 195 | pmo_notify_pause_bitmap handler); |
| 196 | |
| 197 | /** |
| 198 | * pmo_register_get_pause_bitmap(): API to get register pause bitmap notifier |
| 199 | * @psoc: objmgr psoc handle |
| 200 | * @handler: pause bitmap updated notifier |
| 201 | * |
| 202 | * Return QDF_STATUS status - in case of success else return error |
| 203 | */ |
| 204 | QDF_STATUS pmo_register_get_pause_bitmap(struct wlan_objmgr_psoc *psoc, |
| 205 | pmo_get_pause_bitmap handler); |
| 206 | |
| 207 | /** |
| 208 | * pmo_unregister_get_pause_bitmap(): API to unregister get pause bitmap callback |
| 209 | * @psoc: objmgr psoc handle |
| 210 | * @handler: pause bitmap updated notifier |
| 211 | * |
| 212 | * Return QDF_STATUS status - in case of success else return error |
| 213 | */ |
| 214 | QDF_STATUS pmo_unregister_get_pause_bitmap(struct wlan_objmgr_psoc *psoc, |
| 215 | pmo_get_pause_bitmap handler); |
| 216 | |
| 217 | |
| 218 | /** |
| 219 | * pmo_register_is_device_in_low_pwr_mode(): API to get register device power |
| 220 | * save check notifier. |
| 221 | * @psoc: objmgr psoc handle |
| 222 | * @handler: device power save check notifier |
| 223 | * |
| 224 | * Return QDF_STATUS status - in case of success else return error |
| 225 | */ |
| 226 | QDF_STATUS pmo_register_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc, |
| 227 | pmo_is_device_in_low_pwr_mode handler); |
| 228 | |
| 229 | /** |
| 230 | * pmo_unregister_is_device_in_low_pwr_mode(): API to unregister device power |
| 231 | * save check notifier. |
| 232 | * @psoc: objmgr psoc handle |
| 233 | * @handler: device power save check notifier |
| 234 | * |
| 235 | * Return QDF_STATUS status - in case of success else return error |
| 236 | */ |
| 237 | QDF_STATUS pmo_unregister_is_device_in_low_pwr_mode( |
| 238 | struct wlan_objmgr_psoc *psoc, |
| 239 | pmo_is_device_in_low_pwr_mode handler); |
| 240 | |
| 241 | #endif /* end of _WLAN_PMO_OBJ_MGMT_API_H_ */ |