1 /*
2 * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2021-2024 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 * DOC: Contains p2p public data structure definitions
22 */
23
24 #ifndef _WLAN_P2P_API_H_
25 #define _WLAN_P2P_API_H_
26
27 #include <qdf_types.h>
28 #include <wlan_objmgr_vdev_obj.h>
29
30 /**
31 * wlan_p2p_check_oui_and_force_1x1() - Function to get P2P client device
32 * attributes from assoc request frames
33 * @assoc_ie: pointer to assoc request frame IEs
34 * @ie_len: length of the assoc request frame IE
35 *
36 * When assoc request is received from P2P STA device, this function checks
37 * for specific OUI present in the P2P device info attribute. The caller should
38 * take care of checking if this is called only in P2P GO mode.
39 *
40 * Return: True if OUI is present, else false.
41 */
42 bool wlan_p2p_check_oui_and_force_1x1(uint8_t *assoc_ie, uint32_t ie_len);
43
44 /**
45 * wlan_p2p_cleanup_roc_by_vdev() - Cleanup roc request by vdev
46 * @vdev: pointer to vdev object
47 * @sync: whether to wait for complete event
48 *
49 * This function call P2P API to cleanup roc request by vdev
50 *
51 * Return: QDF_STATUS_SUCCESS - in case of success
52 */
53 QDF_STATUS wlan_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev,
54 bool sync);
55
56 /**
57 * wlan_p2p_status_connect() - Update P2P connection status
58 * @vdev: vdev context
59 *
60 * Updates P2P connection status by up layer when connecting.
61 *
62 * Return: QDF_STATUS_SUCCESS - in case of success
63 */
64 QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
65
66 /**
67 * wlan_p2p_is_action_frame_of_p2p_type() - Given action frame is p2p type or
68 * not
69 * @data_buf: data buffer address
70 * @length: buffer length
71 *
72 * Return: bool
73 */
74 bool wlan_p2p_is_action_frame_of_p2p_type(uint8_t *data_buf, uint32_t length);
75
76 /**
77 * wlan_p2p_abort_scan() - Abort on going scan on p2p interfaces
78 * @pdev: pdev object
79 *
80 * This function triggers an abort scan request to scan component to abort the
81 * ongoing scan request on p2p vdevs.
82 *
83 * Return: QDF_STATUS_SUCCESS - in case of success
84 */
85 QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev);
86
87 #ifdef WLAN_FEATURE_P2P_P2P_STA
88 /**
89 * wlan_p2p_check_and_force_scc_go_plus_go() - Check and do force scc for
90 * go plus go
91 * @psoc: psoc object
92 * @vdev: vdev object
93 *
94 * This function checks whether force scc is enabled or not. If it
95 * is enabled then it will do force scc to remaining p2p go vdev if
96 * user has initiated CSA to current vdev.
97 *
98 * Return: status
99 */
100 QDF_STATUS
101 wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
102 struct wlan_objmgr_vdev *vdev);
103 #else
104 static inline QDF_STATUS
wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)105 wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
106 struct wlan_objmgr_vdev *vdev)
107 {
108 return QDF_STATUS_SUCCESS;
109 }
110 #endif
111 #endif
112