xref: /wlan-driver/qcacld-3.0/core/hdd/inc/wlan_hdd_bcn_recv.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2020 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: feature_bcn_recv
21  * Feature for receiving beacons of connected AP and sending select
22  * params to upper layer via vendor event
23  */
24 
25 #ifdef WLAN_BCN_RECV_FEATURE
26 
27 struct wireless_dev;
28 struct wiphy;
29 
30 /**
31  * wlan_hdd_cfg80211_bcn_rcv_op() - Process beacon report operations
32  * @wiphy: Pointer to wireless phy
33  * @wdev: Pointer to wireless device
34  * @data: Pointer to data
35  * @data_len: Length of @data
36  *
37  * Wrapper function of __wlan_hdd_cfg80211_bcn_rcv_op()
38  *
39  * Return: 0 on success, negative errno on failure
40  */
41 int wlan_hdd_cfg80211_bcn_rcv_op(struct wiphy *wiphy,
42 				 struct wireless_dev *wdev,
43 				 const void *data, int data_len);
44 
45 /**
46  * hdd_beacon_recv_pause_indication()- Send vendor event to user space
47  * to inform SCAN started indication
48  * @hdd_handle: hdd handler
49  * @vdev_id: vdev id
50  * @type: scan event type
51  * @is_disconnected: Connection state of driver
52  *
53  * Return: None
54  */
55 void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle,
56 				      uint8_t vdev_id,
57 				      enum scan_event_type type,
58 				      bool is_disconnected);
59 
60 extern const struct nla_policy
61 	beacon_reporting_params_policy
62 	[QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX + 1];
63 
64 #define BCN_RECV_FEATURE_VENDOR_COMMANDS				\
65 {									\
66 	.info.vendor_id = QCA_NL80211_VENDOR_ID,			\
67 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING,	\
68 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |				\
69 		 WIPHY_VENDOR_CMD_NEED_NETDEV |				\
70 		 WIPHY_VENDOR_CMD_NEED_RUNNING,				\
71 	.doit = wlan_hdd_cfg80211_bcn_rcv_op,				\
72 	vendor_command_policy(beacon_reporting_params_policy,		\
73 			      QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX)\
74 },
75 
76 #define BCN_RECV_FEATURE_VENDOR_EVENTS			\
77 [QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING_INDEX] = {		\
78 	.vendor_id = QCA_NL80211_VENDOR_ID,			\
79 	.subcmd = QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING	\
80 },
81 #else
82 #define BCN_RECV_FEATURE_VENDOR_COMMANDS
83 #define BCN_RECV_FEATURE_VENDOR_EVENTS
84 
85 static inline
hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle,uint8_t vdev_id,enum scan_event_type type,bool is_disconnected)86 void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle,
87 				      uint8_t vdev_id,
88 				      enum scan_event_type type,
89 				      bool is_disconnected)
90 {
91 }
92 #endif
93 
94