Naveen Rawat | aeeb03b | 2016-12-15 12:44:14 -0800 | [diff] [blame] | 1 | /* |
Nachiket Kukade | 2fb1fdb | 2019-01-08 15:35:27 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. |
Naveen Rawat | aeeb03b | 2016-12-15 12:44:14 -0800 | [diff] [blame] | 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: declares nan component os interface APIs |
| 21 | */ |
| 22 | |
| 23 | #ifndef _OS_IF_NAN_H_ |
| 24 | #define _OS_IF_NAN_H_ |
| 25 | |
Naveen Rawat | 574d9b4 | 2017-04-02 18:25:54 -0700 | [diff] [blame] | 26 | #include "qdf_types.h" |
Nachiket Kukade | 2fb1fdb | 2019-01-08 15:35:27 +0530 | [diff] [blame] | 27 | #ifdef WLAN_FEATURE_NAN |
Naveen Rawat | 85f642e | 2017-04-02 19:39:25 -0700 | [diff] [blame] | 28 | #include "nan_public_structs.h" |
| 29 | #include "nan_ucfg_api.h" |
Naveen Rawat | 574d9b4 | 2017-04-02 18:25:54 -0700 | [diff] [blame] | 30 | |
Naveen Rawat | 74b2eb3 | 2017-03-21 15:12:22 -0700 | [diff] [blame] | 31 | /** |
Nachiket Kukade | 8de3c7b | 2019-01-21 16:16:46 +0530 | [diff] [blame] | 32 | * struct ndi_find_vdev_filter - find vdev filter object. this can be extended |
| 33 | * @ifname: interface name of vdev |
| 34 | * @found_vdev: found vdev object matching one or more of above params |
| 35 | */ |
| 36 | struct ndi_find_vdev_filter { |
| 37 | char *ifname; |
| 38 | struct wlan_objmgr_vdev *found_vdev; |
| 39 | }; |
| 40 | |
| 41 | /** |
Naveen Rawat | 574d9b4 | 2017-04-02 18:25:54 -0700 | [diff] [blame] | 42 | * os_if_nan_process_ndp_cmd: os_if api to handle nan request message |
| 43 | * @psoc: pointer to psoc object |
| 44 | * @data: request data. contains vendor cmd tlvs |
| 45 | * @data_len: length of data |
| 46 | * |
| 47 | * Return: status of operation |
| 48 | */ |
| 49 | int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc, |
| 50 | const void *data, int data_len); |
| 51 | |
| 52 | /** |
Naveen Rawat | 85f642e | 2017-04-02 19:39:25 -0700 | [diff] [blame] | 53 | * os_if_nan_register_hdd_callbacks: os_if api to register hdd callbacks |
| 54 | * @psoc: pointer to psoc object |
| 55 | * @cb_obj: struct pointer containing callbacks |
| 56 | * |
| 57 | * Return: status of operation |
| 58 | */ |
| 59 | int os_if_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc, |
| 60 | struct nan_callbacks *cb_obj); |
| 61 | |
| 62 | /** |
Naveen Rawat | 3200640 | 2017-04-05 17:26:18 -0700 | [diff] [blame] | 63 | * os_if_nan_register_lim_callbacks: os_if api to register lim callbacks |
| 64 | * @psoc: pointer to psoc object |
| 65 | * @cb_obj: struct pointer containing callbacks |
| 66 | * |
| 67 | * Return: status of operation |
| 68 | */ |
| 69 | int os_if_nan_register_lim_callbacks(struct wlan_objmgr_psoc *psoc, |
| 70 | struct nan_callbacks *cb_obj); |
| 71 | |
| 72 | /** |
Naveen Rawat | 85f642e | 2017-04-02 19:39:25 -0700 | [diff] [blame] | 73 | * os_if_nan_post_ndi_create_rsp: os_if api to pos ndi create rsp to umac nan |
| 74 | * component |
| 75 | * @psoc: pointer to psoc object |
| 76 | * @vdev_id: vdev id of ndi |
| 77 | * @success: if create was success or failure |
| 78 | * |
| 79 | * Return: None |
| 80 | */ |
| 81 | void os_if_nan_post_ndi_create_rsp(struct wlan_objmgr_psoc *psoc, |
| 82 | uint8_t vdev_id, bool success); |
| 83 | |
| 84 | /** |
| 85 | * os_if_nan_post_ndi_delete_rsp: os_if api to pos ndi delete rsp to umac nan |
| 86 | * component |
| 87 | * @psoc: pointer to psoc object |
| 88 | * @vdev_id: vdev id of ndi |
| 89 | * @success: if delete was success or failure |
| 90 | * |
| 91 | * Return: None |
| 92 | */ |
| 93 | void os_if_nan_post_ndi_delete_rsp(struct wlan_objmgr_psoc *psoc, |
| 94 | uint8_t vdev_id, bool success); |
| 95 | |
| 96 | /** |
| 97 | * os_if_nan_ndi_session_end: os_if api to process ndi session end |
| 98 | * component |
| 99 | * @vdev: pointer to vdev deleted |
| 100 | * |
| 101 | * Return: None |
| 102 | */ |
| 103 | void os_if_nan_ndi_session_end(struct wlan_objmgr_vdev *vdev); |
| 104 | |
| 105 | /** |
| 106 | * os_if_nan_set_ndi_state: os_if api set NDI state |
| 107 | * @vdev: pointer to vdev deleted |
| 108 | * @state: value to set |
| 109 | * |
| 110 | * Return: status of operation |
| 111 | */ |
| 112 | static inline QDF_STATUS os_if_nan_set_ndi_state(struct wlan_objmgr_vdev *vdev, |
| 113 | uint32_t state) |
| 114 | { |
| 115 | return ucfg_nan_set_ndi_state(vdev, state); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * os_if_nan_set_ndp_create_transaction_id: set ndp create transaction id |
| 120 | * @vdev: pointer to vdev object |
| 121 | * @val: value to set |
| 122 | * |
| 123 | * Return: status of operation |
| 124 | */ |
| 125 | static inline QDF_STATUS os_if_nan_set_ndp_create_transaction_id( |
| 126 | struct wlan_objmgr_vdev *vdev, |
| 127 | uint16_t val) |
| 128 | { |
| 129 | return ucfg_nan_set_ndp_create_transaction_id(vdev, val); |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * os_if_nan_set_ndp_delete_transaction_id: set ndp delete transaction id |
| 134 | * @vdev: pointer to vdev object |
| 135 | * @val: value to set |
| 136 | * |
| 137 | * Return: status of operation |
| 138 | */ |
| 139 | static inline QDF_STATUS os_if_nan_set_ndp_delete_transaction_id( |
| 140 | struct wlan_objmgr_vdev *vdev, |
| 141 | uint16_t val) |
| 142 | { |
| 143 | return ucfg_nan_set_ndp_delete_transaction_id(vdev, val); |
| 144 | } |
| 145 | |
Nachiket Kukade | a6a70a9 | 2018-10-09 20:07:21 +0530 | [diff] [blame] | 146 | /** |
Nachiket Kukade | 6003bd2 | 2018-11-08 18:30:08 +0530 | [diff] [blame] | 147 | * os_if_nan_legacy_req: os_if api to handle NAN requests attached to the vendor |
| 148 | * command QCA_NL80211_VENDOR_SUBCMD_NAN |
| 149 | * @psoc: pointer to psoc object |
| 150 | * @data: request data. contains vendor cmd tlvs |
| 151 | * @data_len: length of data |
| 152 | * |
| 153 | * Return: status of operation |
| 154 | */ |
| 155 | int os_if_nan_legacy_req(struct wlan_objmgr_psoc *psoc, const void *data, |
| 156 | int data_len); |
| 157 | |
| 158 | /** |
Nachiket Kukade | 4f89e9e | 2018-11-08 18:10:11 +0530 | [diff] [blame] | 159 | * os_if_process_nan_req: os_if api to handle NAN requests attached to the |
| 160 | * vendor command QCA_NL80211_VENDOR_SUBCMD_NAN_EXT |
Nachiket Kukade | a6a70a9 | 2018-10-09 20:07:21 +0530 | [diff] [blame] | 161 | * @psoc: pointer to psoc object |
| 162 | * @data: request data. contains vendor cmd tlvs |
| 163 | * @data_len: length of data |
| 164 | * |
| 165 | * Return: status of operation |
| 166 | */ |
| 167 | int os_if_process_nan_req(struct wlan_objmgr_psoc *psoc, |
| 168 | const void *data, int data_len); |
Naveen Rawat | 85f642e | 2017-04-02 19:39:25 -0700 | [diff] [blame] | 169 | #else |
| 170 | |
| 171 | static inline void os_if_nan_post_ndi_create_rsp(struct wlan_objmgr_psoc *psoc, |
| 172 | uint8_t vdev_id, bool success) |
| 173 | { |
| 174 | } |
| 175 | |
| 176 | static inline void os_if_nan_post_ndi_delete_rsp(struct wlan_objmgr_psoc *psoc, |
| 177 | uint8_t vdev_id, bool success) |
| 178 | { |
| 179 | } |
| 180 | |
Nachiket Kukade | 2fb1fdb | 2019-01-08 15:35:27 +0530 | [diff] [blame] | 181 | #endif /* WLAN_FEATURE_NAN */ |
Naveen Rawat | 85f642e | 2017-04-02 19:39:25 -0700 | [diff] [blame] | 182 | |
Naveen Rawat | aeeb03b | 2016-12-15 12:44:14 -0800 | [diff] [blame] | 183 | #endif |