1 /*
2 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 /**
19 * DOC: Define PDEV MLME structure and APIs
20 */
21 #ifndef _WLAN_PDEV_MLME_H_
22 #define _WLAN_PDEV_MLME_H_
23
24 #include <qdf_timer.h>
25 #include <include/wlan_vdev_mlme.h>
26 #include <wlan_ext_mlme_obj_types.h>
27
28 /**
29 * struct pdev_restart_attr - Pdev restart attributes
30 * @vdev: vdev on which the pdev restart cmd was enqueued
31 * @restart_bmap: Bitmap for vdev requesting multivdev restart
32 */
33 struct pdev_restart_attr {
34 struct wlan_objmgr_vdev *vdev;
35 qdf_bitmap(restart_bmap, WLAN_UMAC_PSOC_MAX_VDEVS);
36 };
37
38 /**
39 * struct pdev_mlme_obj - PDEV MLME component object
40 * @pdev: PDEV object
41 * @ext_pdev_ptr: PDEV MLME legacy pointer
42 * @mlme_register_ops: Call back to register MLME legacy APIs
43 * @vdev_restart_lock: Lock for VDEVs restart
44 * @restart_req_timer: Timer handle for VDEVs restart
45 * @restart_pend_vdev_bmap: Bitmap for VDEV RESTART command pending
46 * @restart_send_vdev_bmap: Bitmap for VDEV RESTART command sending
47 * @start_send_vdev_arr: Bitmap for VDEV START command sending
48 * @pdev_restart: Pdev restart attributes structure
49 * @multivdev_restart_wait_cnt: multi vdev restart wait counter
50 */
51 struct pdev_mlme_obj {
52 struct wlan_objmgr_pdev *pdev;
53 mlme_pdev_ext_t *ext_pdev_ptr;
54 QDF_STATUS (*mlme_register_ops)(struct vdev_mlme_obj *vdev_mlme);
55 qdf_spinlock_t vdev_restart_lock;
56 qdf_timer_t restart_req_timer;
57 qdf_bitmap(restart_pend_vdev_bmap, WLAN_UMAC_PSOC_MAX_VDEVS);
58 qdf_bitmap(restart_send_vdev_bmap, WLAN_UMAC_PSOC_MAX_VDEVS);
59 qdf_bitmap(start_send_vdev_arr, WLAN_UMAC_PSOC_MAX_VDEVS);
60 struct pdev_restart_attr pdev_restart;
61 qdf_atomic_t multivdev_restart_wait_cnt;
62 };
63
64 #ifdef MOBILE_DFS_SUPPORT
65 static inline
wlan_rptr_check_rpt_max_phy(struct wlan_objmgr_pdev * pdev)66 bool wlan_rptr_check_rpt_max_phy(struct wlan_objmgr_pdev *pdev)
67 {
68 return false;
69 }
70 #else
71 bool wlan_rptr_check_rpt_max_phy(struct wlan_objmgr_pdev *pdev);
72 #endif /* MOBILE_DFS_SUPPORT */
73 #endif
74