Paul Zhang | 3718567 | 2019-05-14 11:20:14 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019 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: wlan_interop_issues_ap_api.h |
| 21 | * |
| 22 | * This header file provide API declarations required for interop issues |
| 23 | * ap global context specific to offload |
| 24 | */ |
| 25 | |
| 26 | #ifndef __WLAN_INTEROP_ISSUES_AP_API_H__ |
| 27 | #define __WLAN_INTEROP_ISSUES_AP_API_H__ |
| 28 | |
| 29 | #ifdef WLAN_FEATURE_INTEROP_ISSUES_AP |
| 30 | #include <qdf_types.h> |
| 31 | #include <wlan_objmgr_cmn.h> |
| 32 | #include <wlan_objmgr_global_obj.h> |
| 33 | #include <wlan_objmgr_psoc_obj.h> |
| 34 | #include <wlan_interop_issues_ap_public_structs.h> |
| 35 | |
| 36 | #define interop_issues_ap_debug(args ...) \ |
| 37 | QDF_TRACE_DEBUG(QDF_MODULE_ID_INTEROP_ISSUES_AP, ## args) |
| 38 | #define interop_issues_ap_err(args ...) \ |
| 39 | QDF_TRACE_ERROR(QDF_MODULE_ID_INTEROP_ISSUES_AP, ## args) |
| 40 | |
| 41 | /** |
| 42 | * struct interop_issues_ap_psoc_priv_obj - psoc private object |
| 43 | * @lock: qdf spin lock |
| 44 | * @soc: pointer to psoc object |
| 45 | * @cbs: interop issues ap ps event callbacks |
| 46 | * @tx_ops: interop issues ap ps tx ops |
| 47 | */ |
| 48 | struct interop_issues_ap_psoc_priv_obj { |
| 49 | qdf_spinlock_t lock; |
| 50 | struct wlan_objmgr_psoc *soc; |
| 51 | struct wlan_interop_issues_ap_callbacks cbs; |
| 52 | struct wlan_interop_issues_ap_tx_ops tx_ops; |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * wlan_interop_issues_ap_psoc_enable() - interop issues ap psoc enable |
| 57 | * @psoc: the pointer to psoc object |
| 58 | * |
| 59 | * Return: QDF_STATUS |
| 60 | */ |
| 61 | QDF_STATUS wlan_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *soc); |
| 62 | |
| 63 | /** |
| 64 | * wlan_interop_issues_ap_psoc_disable() - interop issues ap psoc disable |
| 65 | * @psoc: the pointer to psoc object |
| 66 | * |
| 67 | * Return: QDF_STATUS |
| 68 | */ |
| 69 | QDF_STATUS wlan_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *soc); |
| 70 | |
| 71 | /** |
| 72 | * wlan_interop_issues_ap_init() - API to init component |
| 73 | * |
| 74 | * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error |
| 75 | */ |
| 76 | QDF_STATUS wlan_interop_issues_ap_init(void); |
| 77 | |
| 78 | /** |
| 79 | * wlan_interop_issues_ap_deinit() - API to deinit component |
| 80 | * |
| 81 | * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error |
| 82 | */ |
| 83 | QDF_STATUS wlan_interop_issues_ap_deinit(void); |
| 84 | |
| 85 | /** |
| 86 | * interop_issues_ap_get_psoc_priv_obj() - get priv object from psoc object |
| 87 | * @psoc: pointer to psoc object |
| 88 | * |
| 89 | * Return: pointer to interop issues ap psoc private object |
| 90 | */ |
| 91 | static inline |
| 92 | struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_get_psoc_priv_obj( |
| 93 | struct wlan_objmgr_psoc *psoc) |
| 94 | { |
| 95 | struct interop_issues_ap_psoc_priv_obj *obj; |
| 96 | |
| 97 | if (!psoc) |
| 98 | return NULL; |
| 99 | |
| 100 | obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, |
| 101 | WLAN_UMAC_COMP_INTEROP_ISSUES_AP); |
| 102 | |
| 103 | return obj; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * interop_issues_ap_psoc_get_tx_ops() - get TX ops from the private object |
| 108 | * @psoc: pointer to psoc object |
| 109 | * |
| 110 | * Return: pointer to TX op callback |
| 111 | */ |
| 112 | static inline |
| 113 | struct wlan_interop_issues_ap_tx_ops *interop_issues_ap_psoc_get_tx_ops( |
| 114 | struct wlan_objmgr_psoc *psoc) |
| 115 | { |
| 116 | struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_priv; |
| 117 | |
| 118 | if (!psoc) |
| 119 | return NULL; |
| 120 | |
| 121 | interop_issues_ap_priv = interop_issues_ap_get_psoc_priv_obj(psoc); |
| 122 | if (!interop_issues_ap_priv) { |
| 123 | interop_issues_ap_err("psoc private object is null"); |
| 124 | return NULL; |
| 125 | } |
| 126 | |
| 127 | return &interop_issues_ap_priv->tx_ops; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * interop_issues_ap_psoc_get_cbs() - get RX ops from private object |
| 132 | * @psoc: pointer to psoc object |
| 133 | * |
| 134 | * Return: pointer to RX op callback |
| 135 | */ |
| 136 | static inline |
| 137 | struct wlan_interop_issues_ap_callbacks *interop_issues_ap_psoc_get_cbs( |
| 138 | struct wlan_objmgr_psoc *psoc) |
| 139 | { |
| 140 | struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_priv; |
| 141 | |
| 142 | if (!psoc) |
| 143 | return NULL; |
| 144 | |
| 145 | interop_issues_ap_priv = interop_issues_ap_get_psoc_priv_obj(psoc); |
| 146 | if (!interop_issues_ap_priv) { |
| 147 | interop_issues_ap_err("psoc private object is null"); |
| 148 | return NULL; |
| 149 | } |
| 150 | |
| 151 | return &interop_issues_ap_priv->cbs; |
| 152 | } |
| 153 | #endif |
| 154 | #endif |