blob: 878a2d4dc2d47e385ef46e94974722a0039eae89 [file] [log] [blame]
Srinivas Pitlafa5290f2016-10-17 16:40:37 +05301/*
Srinivas Pitla39a92222018-10-05 10:52:48 +05302 * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
Srinivas Pitlafa5290f2016-10-17 16:40:37 +05303 *
Srinivas Pitla39a92222018-10-05 10:52:48 +05304 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
Srinivas Pitlafa5290f2016-10-17 16:40:37 +05307 *
Srinivas Pitla39a92222018-10-05 10:52:48 +05308 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053015 */
Dustin Brown3c777ef2017-05-12 14:01:44 -070016
17/**
18 * DOC: Define the pdev data structure of UMAC
19 * Public APIs to perform operations on Global objects
20 */
21
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053022#ifndef _WLAN_OBJMGR_PDEV_OBJ_H_
23#define _WLAN_OBJMGR_PDEV_OBJ_H_
Dustin Brown3c777ef2017-05-12 14:01:44 -070024
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053025#include <wlan_objmgr_cmn.h>
Dustin Brown3c777ef2017-05-12 14:01:44 -070026#include "wlan_objmgr_psoc_obj.h"
Himanshu Batra556930b2019-06-07 13:18:43 +053027#include <target_if_pub.h>
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053028
29/* STATUS: scanning */
30#define WLAN_PDEV_F_SCAN 0x00000001
31/* STATUS: use short slot time*/
32#define WLAN_PDEV_F_SHSLOT 0x00000002
33 /* STATUS: channel switch event pending after DFS RADAR */
34#define WLAN_PDEV_F_DFS_CHANSWITCH_PENDING 0x00000004
35 /* TX Power: fixed rate */
36#define WLAN_PDEV_F_TXPOW_FIXED 0x00000008
37 /* STATUS: use short preamble */
38#define WLAN_PDEV_F_SHPREAMBLE 0x00000010
39 /* CONF: do alignment pad */
40#define WLAN_PDEV_F_DATAPAD 0x00000020
41 /* STATUS: protection enabled */
42#define WLAN_PDEV_F_USEPROT 0x00000040
43 /* STATUS: use barker preamble*/
44#define WLAN_PDEV_F_USEBARKER 0x00000080
Jeff Johnsonba927232018-05-06 16:02:25 -070045 /* CONF: DISABLE 2040 coexistence */
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053046#define WLAN_PDEV_F_COEXT_DISABLE 0x00000100
47 /* STATE: scan pending */
48#define WLAN_PDEV_F_SCAN_PENDING 0x00000200
49 /* CONF: send regclassids in country ie */
50#define WLAN_PDEV_F_REGCLASS 0x00000400
51 /* CONF: block the use of DFS channels */
52#define WLAN_PDEV_F_BLKDFSCHAN 0x00000800
53 /* STATUS: 11D in used */
54#define WLAN_PDEV_F_DOT11D 0x00001000
55 /* STATUS: 11D channel-switch detected */
56#define WLAN_PDEV_F_RADAR 0x00002000
57 /* CONF: A-MPDU supported */
58#define WLAN_PDEV_F_AMPDU 0x00004000
59 /* CONF: A-MSDU supported */
60#define WLAN_PDEV_F_AMSDU 0x00008000
61 /* CONF: HT traffic protected */
62#define WLAN_PDEV_F_HTPROT 0x00010000
63 /* CONF: Reset once */
64#define WLAN_PDEV_F_RESET 0x00020000
65 /* CONF: ignore 11d beacon */
66#define WLAN_PDEV_F_IGNORE_11D_BEACON 0x00040000
67 /* HT CAP IE present */
68#define WLAN_PDEV_F_HTVIE 0x00080000
69 /* radio in middle of CSA */
70#define WLAN_PDEV_F_CSA_WAIT 0x00100000
71 /* wnm support flag */
72#define WLAN_PDEV_F_WNM 0x00200000
73#define WLAN_PDEV_F_2G_CSA 0x00400000
74 /* enhanced independent repeater */
75#define WLAN_PDEV_F_ENH_REP_IND 0x00800000
76 /* Disable Tx AMSDU for station vap */
77#define WLAN_PDEV_F_STA_AMPDU_DIS 0x01000000
78/* do not send probe request in passive channel */
79#define WLAN_PDEV_F_STRICT_PSCAN_EN 0x02000000
80 /* dupie (ANA,pre ANA ) */
81/*#define WLAN_PDEV_F_DUPIE 0x00200000*/
Amir Patel72d455a2018-03-29 20:28:58 +053082 /* QWRAP enable flag */
83#define WLAN_PDEV_F_WRAP_EN 0x04000000
Srinivas Pitla39a92222018-10-05 10:52:48 +053084/* Chan concurrency enabled */
85#define WLAN_PDEV_F_CHAN_CONCURRENCY 0x08000000
86/* Multivdev restart enabled */
87#define WLAN_PDEV_F_MULTIVDEV_RESTART 0x10000000
Manoj Ekbote6db1dda2019-03-04 10:19:22 -080088/* MBSS IE enable */
89#define WLAN_PDEV_F_MBSS_IE_ENABLE 0x20000000
Naga8e517222019-06-24 17:05:45 +053090/* VDEV Peer delete all */
91#define WLAN_PDEV_F_DELETE_ALL_PEER 0x40000000
Srinivas Pitlafa5290f2016-10-17 16:40:37 +053092
93/* PDEV op flags */
94 /* Enable htrate for wep and tkip */
95#define WLAN_PDEV_OP_WEP_TKIP_HTRATE 0x00000001
96 /* non HT AP found flag */
97#define WLAN_PDEV_OP_NON_HT_AP 0x00000002
98 /* block the use of DFS channels flag */
99#define WLAN_PDEV_OP_BLK_DFS_CHAN 0x00000004
100 /* 11.h flag */
101#define WLAN_PDEV_OP_DOTH 0x00000008
102 /* Off-channel support enabled */
103#define WLAN_PDEV_OP_OFFCHAN 0x00000010
104#define WLAN_PDEV_OP_HT20ADHOC 0x00000020
105#define WLAN_PDEV_OP_HT40ADHOC 0x00000040
106#define WLAN_PDEV_OP_HTADHOC_AGGR 0x00000080
107 /* disallow CC change when assoc completes */
108#define WLAN_PDEV_OP_DISALLOW_AUTO_CC 0x00000100
109 /* Is P2P Enabled? */
110#define WLAN_PDEV_OP_P2P 0x00000200
111 /* disallowed */
112#define WLAN_PDEV_OP_IGNORE_DYNHALT 0x00000400
113 /* overwrite probe response IE with beacon IE */
114#define WLAN_PDEV_OP_OVERRIDE_PROBERESP 0x00000800
115#define WLAN_PDEV_OP_DROPSTA_QUERY 0x00001000
116#define WLAN_PDEV_OP_BLK_REPORT_FLOOD 0x00002000
117 /* Offchan scan */
118#define WLAN_PDEV_OP_OFFCHAN_SCAN 0x00004000
119 /*Consider OBSS non-erp to change to long slot*/
120#define WLAN_PDEV_OP_OBSS_LONGSLOT 0x00008000
121 /* enable/disable min rssi cli block */
122#define WLAN_PDEV_OP_MIN_RSSI_ENABLE 0x00010000
Srinivas Pitla39a92222018-10-05 10:52:48 +0530123 /* PDEV VDEV restart is in progress */
124#define WLAN_PDEV_OP_RESTART_INPROGRESS 0x00020000
Srinivas Pitla6d0331d2019-02-12 16:41:28 +0530125 /* PDEV MBSSID VDEV restart trigger */
126#define WLAN_PDEV_OP_MBSSID_RESTART 0x00040000
Srinivas Pitlad9ad48d2019-02-26 11:08:23 +0530127 /* RADAR DETECT Defer */
128#define WLAN_PDEV_OP_RADAR_DETECT_DEFER 0x00080000
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530129
Vivek3e5a3ba2017-02-20 18:13:57 +0530130
131struct osif_pdev_priv;
132
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530133/**
134 * struct wlan_objmgr_pdev_nif - pdev object nif structure
135 * @pdev_fw_caps: radio specific FW capabilities
136 * @pdev_feature_caps: radio specific feature capabilities
137 * @pdev_ospriv: OS specific pointer
Srinivas Pitlac7f4e032018-01-08 16:59:16 +0530138 * @macaddr[]: MAC address
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530139 * @notified_ap_vdev: ap vdev
140 */
141struct wlan_objmgr_pdev_nif {
142 uint32_t pdev_fw_caps;
143 uint32_t pdev_feature_caps;
Vivek3e5a3ba2017-02-20 18:13:57 +0530144 struct pdev_osif_priv *pdev_ospriv;
Dustin Brownfb652762018-01-26 17:21:57 -0800145 uint8_t macaddr[QDF_MAC_ADDR_SIZE];
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530146 uint8_t notified_ap_vdev;
147};
148
149/**
150 * struct wlan_objmgr_pdev_mlme - pdev object mlme structure
151 * @pdev_op_flags: PDEV operation flags, can be used to know the
152 * operation status (deletion progress, etc)
153 */
154struct wlan_objmgr_pdev_mlme {
155 uint32_t pdev_op_flags;
156};
157
158/**
159 * struct wlan_objmgr_pdev_objmgr - pdev object object manager structure
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530160 * @wlan_pdev_id: PDEV id
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530161 * @wlan_vdev_count: VDEVs count
162 * @max_vdev_count: Max no. of VDEVs supported by this PDEV
Akshay Kosigi888823e2018-01-30 14:48:41 +0530163 * @print_cnt: Count to throttle Logical delete prints
164 * @wlan_vdev_list: List maintains the VDEVs created on this PDEV
Srinivas Pitla4a3f4862017-07-19 14:18:48 +0530165 * @wlan_peer_count: Peer count
166 * @max_peer_count: Max Peer count
Vivekadbfaa72018-05-11 13:02:00 +0530167 * @temp_peer_count: Temporary peer count
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530168 * @wlan_psoc: back pointer to PSOC, its attached to
169 * @ref_cnt: Ref count
Srinivas Pitla2f8f8b52017-02-08 12:55:36 +0530170 * @ref_id_dbg: Array to track Ref count
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530171 */
172struct wlan_objmgr_pdev_objmgr {
173 uint8_t wlan_pdev_id;
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530174 uint8_t wlan_vdev_count;
175 uint8_t max_vdev_count;
Akshay Kosigi888823e2018-01-30 14:48:41 +0530176 uint8_t print_cnt;
177 qdf_list_t wlan_vdev_list;
Srinivas Pitla4a3f4862017-07-19 14:18:48 +0530178 uint16_t wlan_peer_count;
179 uint16_t max_peer_count;
Vivekadbfaa72018-05-11 13:02:00 +0530180 uint16_t temp_peer_count;
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530181 struct wlan_objmgr_psoc *wlan_psoc;
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530182 qdf_atomic_t ref_cnt;
Srinivas Pitla2f8f8b52017-02-08 12:55:36 +0530183 qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX];
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530184};
185
186/**
187 * struct wlan_objmgr_pdev - PDEV common object
188 * @current_chan_list: Active/current Channel list of the radio
189 * @pdev_nif: pdev nif structure
190 * @pdev_objmgr: pdev object manager structure
191 * @pdev_mlme: pdev MLME structure
Soumya Bhatdd734872016-12-29 16:21:43 +0530192 * @pdev_comp_priv_obj[]: component's private object array
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530193 * @obj_status[]: object status of each component object
194 * @obj_state: object state
Srinivas Pitla6a5c6a42017-10-12 12:19:57 +0530195 * @tgt_if_handle: Target interface handle
196 * @dp_handle: DP module handle
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530197 * @pdev_lock: lock to protect object
198*/
199struct wlan_objmgr_pdev {
200 struct wlan_chan_list *current_chan_list;
201 struct wlan_objmgr_pdev_nif pdev_nif;
202 struct wlan_objmgr_pdev_objmgr pdev_objmgr;
203 struct wlan_objmgr_pdev_mlme pdev_mlme;
Soumya Bhatdd734872016-12-29 16:21:43 +0530204 void *pdev_comp_priv_obj[WLAN_UMAC_MAX_COMPONENTS];
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530205 QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS];
206 WLAN_OBJ_STATE obj_state;
Himanshu Batra556930b2019-06-07 13:18:43 +0530207 target_pdev_info_t *tgt_if_handle;
Srinivas Pitla6a5c6a42017-10-12 12:19:57 +0530208 void *dp_handle;
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530209 qdf_spinlock_t pdev_lock;
210};
211
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530212/**
213 ** APIs to Create/Delete Global object APIs
214 */
215/**
216 * wlan_objmgr_pdev_obj_create() - pdev create
217 * @psoc: PSOC object
218 * @scn: os private object
219 *
220 * Creates PDEV object, intializes with default values
221 * Invokes the registered notifiers to create component object
222 *
223 * Return: Handle to struct wlan_objmgr_psoc on successful creation,
224 * NULL on Failure (on Mem alloc failure and Component objects
225 * Failure)
226 */
227struct wlan_objmgr_pdev *wlan_objmgr_pdev_obj_create(
Srinivas Pitla5bdb69b2017-05-24 18:10:07 +0530228 struct wlan_objmgr_psoc *psoc, struct pdev_osif_priv *osif_priv);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530229
230/**
231 * wlan_objmgr_pdev_obj_delete() - pdev delete
232 * @psoc: PDEV object
233 *
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530234 * Logically deletes PDEV object,
235 * Once all the references are released, object manager invokes the registered
236 * notifiers to destroy component objects
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530237 *
238 * Return: SUCCESS/FAILURE
239 */
240QDF_STATUS wlan_objmgr_pdev_obj_delete(struct wlan_objmgr_pdev *pdev);
241
242/**
243 ** APIs to attach/detach component objects
244 */
245/**
246 * wlan_objmgr_pdev_component_obj_attach() - pdev comp object attach
247 * @psoc: PDEV object
248 * @id: Component id
Soumya Bhatdd734872016-12-29 16:21:43 +0530249 * @comp_priv_obj: component's private object pointer
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530250 * @status: Component's private object creation status
251 *
252 * API to be used for attaching component object with PDEV common object
253 *
254 * Return: SUCCESS on successful storing of component's object in common object
255 * On FAILURE (appropriate failure codes are returned)
256 */
257QDF_STATUS wlan_objmgr_pdev_component_obj_attach(
258 struct wlan_objmgr_pdev *pdev,
259 enum wlan_umac_comp_id id,
Soumya Bhatdd734872016-12-29 16:21:43 +0530260 void *comp_priv_obj,
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530261 QDF_STATUS status);
262
263/**
264 * wlan_objmgr_pdev_component_obj_detach() - pdev comp object detach
265 * @psoc: PDEV object
266 * @id: Component id
Soumya Bhatdd734872016-12-29 16:21:43 +0530267 * @comp_priv_obj: component's private object pointer
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530268 *
269 * API to be used for detaching component object with PDEV common object
270 *
271 * Return: SUCCESS on successful removal of component's object from common
272 * object
273 * On FAILURE (appropriate failure codes are returned)
274 */
275QDF_STATUS wlan_objmgr_pdev_component_obj_detach(
276 struct wlan_objmgr_pdev *pdev,
277 enum wlan_umac_comp_id id,
Soumya Bhatdd734872016-12-29 16:21:43 +0530278 void *comp_priv_obj);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530279
280/**
281 ** APIs to operations on pdev objects
282 */
283
Srinivas Pitla2f8f8b52017-02-08 12:55:36 +0530284typedef void (*wlan_objmgr_pdev_op_handler)(struct wlan_objmgr_pdev *pdev,
285 void *object,
286 void *arg);
287
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530288/**
289 * wlan_objmgr_pdev_iterate_obj_list() - operate on all objects of pdev
290 * @pdev: PDEV object
291 * @obj_type: VDEV_OP/PEER_OP
292 * @handler: the handler will be called for each object of requested type
293 * the handler should be implemented to perform required operation
294 * @arg: agruments passed by caller
Srinivas Pitla77e17912018-04-11 21:59:08 +0530295 * @lock_free_op: its obsolete
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530296 * @dbg_id: id of the caller
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530297 *
298 * API to be used for performing the operations on all VDEV/PEER objects
299 * of pdev
300 *
301 * Return: SUCCESS/FAILURE
302 */
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530303QDF_STATUS wlan_objmgr_pdev_iterate_obj_list(
304 struct wlan_objmgr_pdev *pdev,
305 enum wlan_objmgr_obj_type obj_type,
306 wlan_objmgr_pdev_op_handler handler,
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530307 void *arg, uint8_t lock_free_op,
308 wlan_objmgr_ref_dbgid dbg_id);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530309
310/**
Soumya Bhatdd734872016-12-29 16:21:43 +0530311 * wlan_objmgr_trigger_pdev_comp_priv_object_creation() - create
312 * comp object of pdev
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530313 * @pdev: PDEV object
314 * @id: Component id
315 *
Soumya Bhatdd734872016-12-29 16:21:43 +0530316 * API to create component private object in run time, this would be
317 * used for features which gets enabled in run time
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530318 *
319 * Return: SUCCESS on successful creation
320 * On FAILURE (appropriate failure codes are returned)
321 */
Soumya Bhatdd734872016-12-29 16:21:43 +0530322QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_creation(
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530323 struct wlan_objmgr_pdev *pdev,
324 enum wlan_umac_comp_id id);
325
326/**
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530327 * wlan_objmgr_trigger_pdev_comp_priv_object_deletion() - destroy
Soumya Bhatdd734872016-12-29 16:21:43 +0530328 * comp object of pdev
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530329 * @pdev: PDEV object
330 * @id: Component id
331 *
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530332 * API to destroy component private object in run time, this would
Soumya Bhatdd734872016-12-29 16:21:43 +0530333 * be used for features which gets disabled in run time
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530334 *
335 * Return: SUCCESS on successful deletion
336 * On FAILURE (appropriate failure codes are returned)
337 */
Soumya Bhatdd734872016-12-29 16:21:43 +0530338QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_deletion(
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530339 struct wlan_objmgr_pdev *pdev,
340 enum wlan_umac_comp_id id);
341
342/**
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530343 * wlan_objmgr_get_vdev_by_id_from_pdev() - find vdev using id from pdev
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530344 * @pdev: PDEV object
345 * @vdev_id: vdev id
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530346 * @dbg_id: id of the caller
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530347 *
348 * API to find vdev object pointer by vdev id from pdev's vdev list
349 *
Srinivas Pitlaf4c41862017-06-19 17:17:27 +0530350 * This API increments the ref count of the vdev object internally, the
351 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
352 * ref count
353 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530354 * Return: vdev pointer
355 * NULL on FAILURE
356 */
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530357struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_pdev(
358 struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
359 wlan_objmgr_ref_dbgid dbg_id);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530360
361/**
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530362 * wlan_objmgr_get_vdev_by_id_from_pdev_no_state() - find vdev using id from
363 * pdev
364 * @pdev: PDEV object
365 * @vdev_id: vdev id
366 * @dbg_id: id of the caller
367 *
368 * API to find vdev object pointer by vdev id from pdev's vdev list
369 *
Srinivas Pitlaf4c41862017-06-19 17:17:27 +0530370 * This API increments the ref count of the vdev object internally, the
371 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
372 * ref count
373 *
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530374 * Return: vdev pointer
375 * NULL on FAILURE
376 */
377struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_pdev_no_state(
378 struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
379 wlan_objmgr_ref_dbgid dbg_id);
380
381/**
382 * wlan_objmgr_get_vdev_by_macaddr_from_pdev() - find vdev using macaddr
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530383 * @pdev: PDEV object
384 * @macaddr: MAC address
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530385 * @dbg_id: id of the caller
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530386 *
387 * API to find vdev object pointer by vdev mac addr from pdev's vdev list
388 *
Srinivas Pitlaf4c41862017-06-19 17:17:27 +0530389 * This API increments the ref count of the vdev object internally, the
390 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
391 * ref count
392 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530393 * Return: vdev pointer
394 * NULL on FAILURE
395 */
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530396struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_pdev(
397 struct wlan_objmgr_pdev *pdev, uint8_t *macaddr,
398 wlan_objmgr_ref_dbgid dbg_id);
399
400/**
401 * wlan_objmgr_get_vdev_by_macaddr_from_pdev_no_state() - find vdev using
402 * macaddr
403 * @pdev: PDEV object
404 * @macaddr: MAC address
405 * @dbg_id: id of the caller
406 *
407 * API to find vdev object pointer by vdev mac addr from pdev's vdev list
408 *
Srinivas Pitlaf4c41862017-06-19 17:17:27 +0530409 * This API increments the ref count of the vdev object internally, the
410 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
411 * ref count
412 *
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530413 * Return: vdev pointer
414 * NULL on FAILURE
415 */
416struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_pdev_no_state(
417 struct wlan_objmgr_pdev *pdev, uint8_t *macaddr,
418 wlan_objmgr_ref_dbgid dbg_id);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530419
420/**
Srinivas Pitla1a2ef8c2017-01-04 16:48:00 +0530421 * wlan_objmgr_pdev_get_comp_private_obj() - get pdev component private object
422 * @pdev: PDEV object
423 * @id: Component id
424 *
425 * API to get component private object
426 *
Srinivas Pitla1a2ef8c2017-01-04 16:48:00 +0530427 * Return: void *ptr on SUCCESS
428 * NULL on Failure
429 */
430void *wlan_objmgr_pdev_get_comp_private_obj(
431 struct wlan_objmgr_pdev *pdev,
432 enum wlan_umac_comp_id id);
433
434/**
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530435 * wlan_pdev_obj_lock() - Acquire PDEV spinlock
436 * @pdev: PDEV object
437 *
438 * API to acquire PDEV lock
Srinivas Pitla5bdb69b2017-05-24 18:10:07 +0530439 * Parent lock should not be taken in child lock context
440 * but child lock can be taken in parent lock context
441 * (for ex: psoc lock can't be invoked in pdev/vdev/peer lock context)
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530442 *
443 * Return: void
444 */
445static inline void wlan_pdev_obj_lock(struct wlan_objmgr_pdev *pdev)
446{
447 qdf_spin_lock_bh(&pdev->pdev_lock);
448}
449
450/**
451 * wlan_pdev_obj_unlock() - Release PDEV spinlock
452 * @pdev: PDEV object
453 *
454 * API to Release PDEV lock
455 *
456 * Return: void
457 */
458static inline void wlan_pdev_obj_unlock(struct wlan_objmgr_pdev *pdev)
459{
460 qdf_spin_unlock_bh(&pdev->pdev_lock);
461}
462
463/**
464 * wlan_pdev_get_psoc() - get psoc
465 * @pdev: PDEV object
466 *
467 * API to get the psoc object from PDEV
468 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530469 * Return:
470 * @psoc: PSOC object
471 */
472static inline struct wlan_objmgr_psoc *wlan_pdev_get_psoc(
473 struct wlan_objmgr_pdev *pdev)
474{
475 return pdev->pdev_objmgr.wlan_psoc;
476}
477
478/**
479 * wlan_pdev_set_psoc() - set psoc
480 * @pdev: PDEV object
481 * @psoc: PSOC object
482 *
483 * API to set the psoc object from PDEV
484 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530485 * Return: void
486 */
487static inline void wlan_pdev_set_psoc(struct wlan_objmgr_pdev *pdev,
488 struct wlan_objmgr_psoc *psoc)
489{
490 pdev->pdev_objmgr.wlan_psoc = psoc;
491}
492
493/**
494 * wlan_pdev_nif_fw_cap_set() - set fw caps
495 * @pdev: PDEV object
496 * @cap: capability flag to be set
497 *
498 * API to set fw caps in pdev
499 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530500 * Return: void
501 */
502static inline void wlan_pdev_nif_fw_cap_set(struct wlan_objmgr_pdev *pdev,
503 uint32_t cap)
504{
505 pdev->pdev_nif.pdev_fw_caps |= cap;
506}
507
508/**
509 * wlan_pdev_nif_fw_cap_clear() - clear fw cap
510 * @pdev: PDEV object
511 * @cap: capability flag to be cleared
512 *
513 * API to clear fw caps in pdev
514 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530515 * Return: void
516 */
517static inline void wlan_pdev_nif_fw_cap_clear(struct wlan_objmgr_pdev *pdev,
518 uint32_t cap)
519{
520 pdev->pdev_nif.pdev_fw_caps &= ~cap;
521}
522
523/**
524 * wlan_pdev_nif_fw_cap_get() - get fw caps
525 * @pdev: PDEV object
526 * @cap: capability flag to be checked
527 *
528 * API to know, whether particular fw caps flag is set in pdev
529 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530530 * Return: 1 (for set) or 0 (for not set)
531 */
532static inline uint8_t wlan_pdev_nif_fw_cap_get(struct wlan_objmgr_pdev *pdev,
533 uint32_t cap)
534{
535 return (pdev->pdev_nif.pdev_fw_caps & cap) ? 1 : 0;
536}
537
538/**
539 * wlan_pdev_nif_feat_cap_set() - set feature caps
540 * @pdev: PDEV object
541 * @cap: capability flag to be set
542 *
543 * API to set feat caps in pdev
544 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530545 * Return: void
546 */
547static inline void wlan_pdev_nif_feat_cap_set(struct wlan_objmgr_pdev *pdev,
548 uint32_t cap)
549{
550 pdev->pdev_nif.pdev_feature_caps |= cap;
551}
552
553/**
554 * wlan_pdev_nif_feat_cap_clear() - clear feature caps
555 * @pdev: PDEV object
556 * @cap: capability flag to be cleared
557 *
558 * API to clear feat caps in pdev
559 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530560 * Return: void
561 */
562static inline void wlan_pdev_nif_feat_cap_clear(struct wlan_objmgr_pdev *pdev,
563 uint32_t cap)
564{
565 pdev->pdev_nif.pdev_feature_caps &= ~cap;
566}
567
568/**
569 * wlan_pdev_nif_feat_cap_get() - get feature caps
570 * @pdev: PDEV object
571 * @cap: capability flag to be checked
572 *
573 * API to know, whether particular feat caps flag is set in pdev
574 *
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530575 * Return: 1 (for set) or 0 (for not set)
576 */
577static inline uint8_t wlan_pdev_nif_feat_cap_get(struct wlan_objmgr_pdev *pdev,
578 uint32_t cap)
579{
580 return (pdev->pdev_nif.pdev_feature_caps & cap) ? 1 : 0;
581}
582
583/**
Srinivas Pitla39a92222018-10-05 10:52:48 +0530584 * wlan_pdev_mlme_op_set() - set operation flags
585 * @pdev: PDEV object
586 * @op: Operation flag to be set
587 *
588 * API to set operation flag in pdev
589 *
590 * Return: void
591 */
592static inline void wlan_pdev_mlme_op_set(struct wlan_objmgr_pdev *pdev,
593 uint32_t op)
594{
595 pdev->pdev_mlme.pdev_op_flags |= op;
596}
597
598/**
599 * wlan_pdev_mlme_op_clear() - clear op flags
600 * @pdev: PDEV object
601 * @op: Operation flag to be cleared
602 *
603 * API to clear op flag in pdev
604 *
605 * Return: void
606 */
607static inline void wlan_pdev_mlme_op_clear(struct wlan_objmgr_pdev *pdev,
608 uint32_t op)
609{
610 pdev->pdev_mlme.pdev_op_flags &= ~op;
611}
612
613/**
614 * wlan_pdev_mlme_op_get() - get op flag
615 * @pdev: PDEV object
616 * @op: Operation flag to be checked
617 *
618 * API to know, whether particular operation flag is set in pdev
619 *
620 * Return: 1 (for set) or 0 (for not set)
621 */
622static inline uint8_t wlan_pdev_mlme_op_get(struct wlan_objmgr_pdev *pdev,
623 uint32_t op)
624{
625 return (pdev->pdev_mlme.pdev_op_flags & op) ? 1 : 0;
626}
627
628/**
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530629 * wlan_pdev_get_hw_macaddr() - get hw macaddr
630 * @pdev: PDEV object
631 *
632 * API to get HW MAC address form PDEV
633 *
634 * Caller need to acquire lock with wlan_pdev_obj_lock()
635 *
636 * Return: @macaddr -MAC address
637 */
638static inline uint8_t *wlan_pdev_get_hw_macaddr(struct wlan_objmgr_pdev *pdev)
639{
Srinivas Pitlac7f4e032018-01-08 16:59:16 +0530640 if (!pdev)
641 return NULL;
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530642
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530643 /* This API is invoked with lock acquired, do not add log prints */
Srinivas Pitlac7f4e032018-01-08 16:59:16 +0530644 return pdev->pdev_nif.macaddr;
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530645}
646
647/**
648 * wlan_pdev_set_hw_macaddr() - set hw macaddr
649 * @pdev: PDEV object
650 * @macaddr: MAC address
651 *
652 * API to set HW MAC address form PDEV
653 *
654 * Caller need to acquire lock with wlan_pdev_obj_lock()
655 *
656 * Return: void
657 */
658static inline void wlan_pdev_set_hw_macaddr(struct wlan_objmgr_pdev *pdev,
659 uint8_t *macaddr)
660{
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530661 /* This API is invoked with lock acquired, do not add log prints */
Srinivas Pitlac7f4e032018-01-08 16:59:16 +0530662 WLAN_ADDR_COPY(pdev->pdev_nif.macaddr, macaddr);
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530663}
664
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530665/**
666 * wlan_pdev_get_ospriv() - get os priv pointer
667 * @pdev: PDEV object
668 *
669 * API to get OS private pointer from PDEV
670 *
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530671 * Return: ospriv - private pointer
672 */
Srinivas Pitla5bdb69b2017-05-24 18:10:07 +0530673static inline struct pdev_osif_priv *wlan_pdev_get_ospriv(
674 struct wlan_objmgr_pdev *pdev)
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530675{
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530676 return pdev->pdev_nif.pdev_ospriv;
677}
Srinivas Pitlafa5290f2016-10-17 16:40:37 +0530678
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530679/**
Jeff Johnson7b7ea4d2017-03-23 13:28:49 -0700680 * wlan_pdev_reset_ospriv() - reset os priv pointer
681 * @pdev: PDEV object
682 *
683 * API to reset OS private pointer in PDEV
684 *
Jeff Johnson7b7ea4d2017-03-23 13:28:49 -0700685 * Return: void
686 */
687static inline void wlan_pdev_reset_ospriv(struct wlan_objmgr_pdev *pdev)
688{
Jeff Johnson7b7ea4d2017-03-23 13:28:49 -0700689 pdev->pdev_nif.pdev_ospriv = NULL;
690}
691
692/**
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530693 * wlan_pdev_set_max_vdev_count() - set pdev max vdev count
694 * @pdev: PDEV object
695 * @vdev count: Max vdev count
696 *
697 * API to set Max vdev count
698 *
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530699 * Return: void
700 */
701static inline void wlan_pdev_set_max_vdev_count(struct wlan_objmgr_pdev *pdev,
702 uint8_t max_vdev_count)
703{
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530704 pdev->pdev_objmgr.max_vdev_count = max_vdev_count;
705}
706
707/**
708 * wlan_pdev_get_max_vdev_count() - get pdev max vdev count
709 * @pdev: PDEV object
710 *
711 * API to set Max vdev count
712 *
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530713 * Return: @vdev count: Max vdev count
714 */
715static inline uint8_t wlan_pdev_get_max_vdev_count(
716 struct wlan_objmgr_pdev *pdev)
717{
Srinivas Pitla7c2f9752017-01-05 13:11:40 +0530718 return pdev->pdev_objmgr.max_vdev_count;
719}
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530720
721/**
722 * DOC: Examples to use PDEV ref count APIs
723 *
724 * In all the scenarios, the pair of API should be followed
725 * otherwise it lead to memory leak
726 *
727 * scenario 1:
728 *
729 * wlan_objmgr_pdev_obj_create()
730 * ----
731 * wlan_objmgr_pdev_obj_delete()
732 *
733 * scenario 2:
734 *
735 * wlan_objmgr_pdev_get_ref()
736 * ----
737 * the operations which are done on
738 * pdev object
739 * ----
740 * wlan_objmgr_pdev_release_ref()
741 *
742 * scenario 3:
743 *
744 * wlan_objmgr_get_pdev_by_id[_no_state]()
745 * ----
746 * the operations which are done on
747 * pdev object
748 * ----
749 * wlan_objmgr_pdev_release_ref()
750 *
751 * scenario 4:
752 *
753 * wlan_objmgr_get_pdev_by_macaddr[_no_state]()
754 * ----
755 * the operations which are done on
756 * pdev object
757 * ----
758 * wlan_objmgr_pdev_release_ref()
759 */
760
761/**
762 * wlan_objmgr_pdev_get_ref() - increment ref count
763 * @pdev: PDEV object
764 * @id: Object Manager ref debug id
765 *
766 * API to increment ref count of pdev
767 *
768 * Return: void
769 */
Vivek8ed2fe92017-09-15 18:34:49 +0530770void wlan_objmgr_pdev_get_ref(struct wlan_objmgr_pdev *pdev,
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530771 wlan_objmgr_ref_dbgid id);
772
773/**
774 * wlan_objmgr_pdev_try_get_ref() - increment ref count, if allowed
775 * @pdev: PDEV object
776 * @id: Object Manager ref debug id
777 *
778 * API to increment ref count of pdev after checking valid object state
779 *
780 * Return: void
781 */
782QDF_STATUS wlan_objmgr_pdev_try_get_ref(struct wlan_objmgr_pdev *pdev,
783 wlan_objmgr_ref_dbgid id);
784
785/**
786 * wlan_objmgr_pdev_release_ref() - decrement ref count
787 * @pdev: PDEV object
788 * @id: Object Manager ref debug id
789 *
790 * API to decrement ref count of pdev, if ref count is 1, it initiates the
791 * PDEV deletion
792 *
793 * Return: void
794 */
Vivek8ed2fe92017-09-15 18:34:49 +0530795void wlan_objmgr_pdev_release_ref(struct wlan_objmgr_pdev *pdev,
Srinivas Pitla10aa60c2017-02-08 12:55:16 +0530796 wlan_objmgr_ref_dbgid id);
797
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530798/**
Edayilliam Jayadev8e9eb4f2018-05-02 16:14:14 +0530799 * wlan_objmgr_pdev_get_first_vdev() - Get first vdev of pdev
800 * @pdev: PDEV object
801 * @dbg_id: Object Manager ref debug id
802 *
803 * API to get reference to first vdev of pdev.
804 *
805 * Return: reference to first vdev
806 */
807struct wlan_objmgr_vdev *wlan_objmgr_pdev_get_first_vdev(
808 struct wlan_objmgr_pdev *pdev,
809 wlan_objmgr_ref_dbgid dbg_id);
810
811/**
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530812 * wlan_objmgr_pdev_get_pdev_id() - get pdev id
813 * @pdev: PDEV object
814 *
815 * API to get pdev id from pdev object
816 *
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530817 * Return: @pdev id
818 */
819static inline
820uint8_t wlan_objmgr_pdev_get_pdev_id(struct wlan_objmgr_pdev *pdev)
821{
Om Prakash Tripathi7e3f45d2016-12-28 16:58:54 +0530822 return pdev->pdev_objmgr.wlan_pdev_id;
823}
Soumya Bhat99399b42017-03-15 11:48:22 +0530824
825/**
826 * wlan_pdev_set_tgt_if_handle(): API to set target if handle in pdev object
827 * @pdev: Pdev pointer
828 * @tgt_if_handle: target interface handle
829 *
830 * API to set target interface handle in pdev object
831 *
832 * Caller needs to acquire lock with wlan_pdev_obj_lock()
833 *
834 * Return: None
835 */
Himanshu Batra556930b2019-06-07 13:18:43 +0530836static inline
837void wlan_pdev_set_tgt_if_handle(struct wlan_objmgr_pdev *pdev,
838 target_pdev_info_t *tgt_if_handle)
Soumya Bhat99399b42017-03-15 11:48:22 +0530839{
840 /* This API is invoked with lock acquired, do not add log prints */
Jeff Johnsondcb27692019-03-20 12:11:48 -0700841 if (!pdev)
Soumya Bhat99399b42017-03-15 11:48:22 +0530842 return;
843
844 pdev->tgt_if_handle = tgt_if_handle;
845}
846
847/**
848 * wlan_pdev_get_tgt_if_handle(): API to get target interface handle
849 * @pdev: Pdev pointer
850 *
851 * API to get target interface handle from pdev object
852 *
Soumya Bhat99399b42017-03-15 11:48:22 +0530853 * Return: target interface handle
854 */
Himanshu Batra556930b2019-06-07 13:18:43 +0530855static inline
856target_pdev_info_t *wlan_pdev_get_tgt_if_handle(struct wlan_objmgr_pdev *pdev)
Soumya Bhat99399b42017-03-15 11:48:22 +0530857{
Jeff Johnsondcb27692019-03-20 12:11:48 -0700858 if (!pdev)
Soumya Bhat99399b42017-03-15 11:48:22 +0530859 return NULL;
860
861 return pdev->tgt_if_handle;
862}
Srinivas Pitla4a3f4862017-07-19 14:18:48 +0530863
864/**
865 * wlan_pdev_set_max_peer_count() - set max peer count
866 * @vdev: PDEV object
867 * @count: Max peer count
868 *
869 * API to set max peer count of PDEV
870 *
871 * Return: void
872 */
873static inline void wlan_pdev_set_max_peer_count(struct wlan_objmgr_pdev *pdev,
874 uint16_t count)
875{
876 pdev->pdev_objmgr.max_peer_count = count;
877}
878
879/**
880 * wlan_pdev_get_max_peer_count() - get max peer count
881 * @pdev: PDEV object
882 *
883 * API to get max peer count of PDEV
884 *
885 * Return: max peer count
886 */
887static inline uint16_t wlan_pdev_get_max_peer_count(
888 struct wlan_objmgr_pdev *pdev)
889{
890 return pdev->pdev_objmgr.max_peer_count;
891}
892
893/**
894 * wlan_pdev_get_peer_count() - get pdev peer count
895 * @pdev: PDEV object
896 *
897 * API to get peer count from PDEV
898 *
899 * Return: peer_count - pdev's peer count
900 */
901static inline uint16_t wlan_pdev_get_peer_count(struct wlan_objmgr_pdev *pdev)
902{
903 return pdev->pdev_objmgr.wlan_peer_count;
904}
905
906/**
Vivekadbfaa72018-05-11 13:02:00 +0530907 * wlan_pdev_get_temp_peer_count() - get pdev temporary peer count
908 * @pdev: PDEV object
909 *
910 * API to get temporary peer count from PDEV
911 *
912 * Return: temp_peer_count - pdev's temporary peer count
913 */
914static inline uint16_t wlan_pdev_get_temp_peer_count(struct wlan_objmgr_pdev *pdev)
915{
916 return pdev->pdev_objmgr.temp_peer_count;
917}
918
919
920/**
Srinivas Pitla4a3f4862017-07-19 14:18:48 +0530921 * wlan_pdev_incr_peer_count() - increment pdev peer count
922 * @pdev: PDEV object
923 *
924 * API to increment peer count of PDEV by 1
925 *
926 * Return: void
927 */
928static inline void wlan_pdev_incr_peer_count(struct wlan_objmgr_pdev *pdev)
929{
930 pdev->pdev_objmgr.wlan_peer_count++;
931}
932
933/**
934 * wlan_pdev_decr_peer_count() - decrement pdev peer count
935 * @pdev: PDEV object
936 *
937 * API to decrement peer count of PDEV by 1
938 *
939 * Return: void
940 */
941static inline void wlan_pdev_decr_peer_count(struct wlan_objmgr_pdev *pdev)
942{
943 pdev->pdev_objmgr.wlan_peer_count--;
944}
Subrat Mishrac15357f2017-08-30 10:28:31 +0530945
946/**
Vivekadbfaa72018-05-11 13:02:00 +0530947 * wlan_pdev_incr_temp_peer_count() - increment temporary pdev peer count
948 * @pdev: PDEV object
949 *
950 * API to increment temporary peer count of PDEV by 1
951 *
952 * Return: void
953 */
954static inline void wlan_pdev_incr_temp_peer_count(struct wlan_objmgr_pdev *pdev)
955{
956 pdev->pdev_objmgr.temp_peer_count++;
957}
958
959/**
960 * wlan_pdev_decr_temp_peer_count() - decrement pdev temporary peer count
961 * @pdev: PDEV object
962 *
963 * API to decrement temporary peer count of PDEV by 1
964 *
965 * Return: void
966 */
967static inline void wlan_pdev_decr_temp_peer_count(struct wlan_objmgr_pdev *pdev)
968{
969 pdev->pdev_objmgr.temp_peer_count--;
970}
971
972/**
Subrat Mishrac15357f2017-08-30 10:28:31 +0530973 * wlan_pdev_get_vdev_count() - get PDEV vdev count
974 * @pdev: PDEV object
975 *
976 * API to get vdev count from PDEV
977 *
978 * Return: vdev_count - pdev's vdev count
979 */
980static inline uint8_t wlan_pdev_get_vdev_count(struct wlan_objmgr_pdev *pdev)
981{
982 return pdev->pdev_objmgr.wlan_vdev_count;
983}
Srinivas Pitla6a5c6a42017-10-12 12:19:57 +0530984
985/**
986 * wlan_pdev_set_dp_handle() - set dp handle
987 * @pdev: pdev object pointer
988 * @dp_handle: Data path module handle
989 *
990 * Return: void
991 */
992static inline void wlan_pdev_set_dp_handle(struct wlan_objmgr_pdev *pdev,
993 void *dp_handle)
994{
995 if (qdf_unlikely(!pdev)) {
996 QDF_BUG(0);
997 return;
998 }
999
1000 pdev->dp_handle = dp_handle;
1001}
1002
1003/**
1004 * wlan_pdev_get_dp_handle() - get dp handle
1005 * @pdev: pdev object pointer
1006 *
1007 * Return: dp handle
1008 */
1009static inline void *wlan_pdev_get_dp_handle(struct wlan_objmgr_pdev *pdev)
1010{
1011 if (qdf_unlikely(!pdev)) {
1012 QDF_BUG(0);
1013 return NULL;
1014 }
1015
1016 return pdev->dp_handle;
1017}
1018
Vivek4ad877f2019-09-18 16:49:10 +05301019/**
1020 * wlan_print_pdev_info() - print pdev members
1021 * @pdev: pdev object pointer
1022 *
1023 * Return: void
1024 */
1025#ifdef WLAN_OBJMGR_DEBUG
1026void wlan_print_pdev_info(struct wlan_objmgr_pdev *pdev);
1027#else
1028static inline void wlan_print_pdev_info(struct wlan_objmgr_pdev *pdev) {}
1029#endif
1030
Srinivas Pitlafa5290f2016-10-17 16:40:37 +05301031#endif /* _WLAN_OBJMGR_PDEV_H_*/