xref: /wlan-driver/qca-wifi-host-cmn/os_if/linux/wlan_osif_priv.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2017,2020-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 
21 #ifndef _WLAN_OSIF_PRIV_H_
22 #define _WLAN_OSIF_PRIV_H_
23 
24 #include "qdf_net_if.h"
25 #include "wlan_cm_public_struct.h"
26 #include <qca_vendor.h>
27 
28 struct osif_scan_pdev;
29 struct osif_tdls_vdev;
30 
31 /**
32  * struct pdev_osif_priv - OS private structure
33  * @wiphy:            wiphy handle
34  * @legacy_osif_priv: legacy osif private handle
35  * @osif_scan:        Scan related data used by cfg80211 scan
36  * @nif:              pdev net device
37  * @osif_check_netdev_state: check driver internal netdev state
38  */
39 struct pdev_osif_priv {
40 	struct wiphy *wiphy;
41 	void *legacy_osif_priv;
42 	struct osif_scan_pdev *osif_scan;
43 	struct qdf_net_if *nif;
44 	int (*osif_check_netdev_state)(struct net_device *netdev);
45 };
46 
47 /**
48  * struct osif_cm_info - osif connection manager info
49  * @last_source: Last command request source
50  * @last_id: Last command from connection manager
51  * @cmd_id_lock: lock to update and read last command source
52  * @ext_priv: legacy data pointer.
53  */
54 struct osif_cm_info {
55 	enum wlan_cm_source last_source;
56 	wlan_cm_id last_id;
57 	struct qdf_spinlock cmd_id_lock;
58 	void *ext_priv;
59 };
60 
61 /**
62  * struct vdev_osif_priv - OS private structure of vdev
63  * @wdev:             wireless device handle
64  * @legacy_osif_priv: legacy osif private handle
65  * @osif_tdls: osif tdls info
66  * @cm_info:  osif connection manager info
67  */
68 struct vdev_osif_priv {
69 	struct wireless_dev *wdev;
70 	void *legacy_osif_priv;
71 	struct osif_tdls_vdev *osif_tdls;
72 	struct osif_cm_info cm_info;
73 };
74 
75 #endif
76