xref: /wlan-driver/qcacld-3.0/components/p2p/dispatcher/inc/wlan_p2p_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: Contains p2p public data structure definitions
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #ifndef _WLAN_P2P_API_H_
25*5113495bSYour Name #define _WLAN_P2P_API_H_
26*5113495bSYour Name 
27*5113495bSYour Name #include <qdf_types.h>
28*5113495bSYour Name #include <wlan_objmgr_vdev_obj.h>
29*5113495bSYour Name 
30*5113495bSYour Name /**
31*5113495bSYour Name  * wlan_p2p_check_oui_and_force_1x1() - Function to get P2P client device
32*5113495bSYour Name  * attributes from assoc request frames
33*5113495bSYour Name  * @assoc_ie: pointer to assoc request frame IEs
34*5113495bSYour Name  * @ie_len: length of the assoc request frame IE
35*5113495bSYour Name  *
36*5113495bSYour Name  * When assoc request is received from P2P STA device, this function checks
37*5113495bSYour Name  * for specific OUI present in the P2P device info attribute. The caller should
38*5113495bSYour Name  * take care of checking if this is called only in P2P GO mode.
39*5113495bSYour Name  *
40*5113495bSYour Name  * Return: True if OUI is present, else false.
41*5113495bSYour Name  */
42*5113495bSYour Name bool wlan_p2p_check_oui_and_force_1x1(uint8_t *assoc_ie, uint32_t ie_len);
43*5113495bSYour Name 
44*5113495bSYour Name /**
45*5113495bSYour Name  * wlan_p2p_cleanup_roc_by_vdev() - Cleanup roc request by vdev
46*5113495bSYour Name  * @vdev: pointer to vdev object
47*5113495bSYour Name  * @sync: whether to wait for complete event
48*5113495bSYour Name  *
49*5113495bSYour Name  * This function call P2P API to cleanup roc request by vdev
50*5113495bSYour Name  *
51*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS - in case of success
52*5113495bSYour Name  */
53*5113495bSYour Name QDF_STATUS wlan_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev,
54*5113495bSYour Name 					bool sync);
55*5113495bSYour Name 
56*5113495bSYour Name /**
57*5113495bSYour Name  * wlan_p2p_status_connect() - Update P2P connection status
58*5113495bSYour Name  * @vdev: vdev context
59*5113495bSYour Name  *
60*5113495bSYour Name  * Updates P2P connection status by up layer when connecting.
61*5113495bSYour Name  *
62*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS - in case of success
63*5113495bSYour Name  */
64*5113495bSYour Name QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
65*5113495bSYour Name 
66*5113495bSYour Name /**
67*5113495bSYour Name  * wlan_p2p_is_action_frame_of_p2p_type() - Given action frame is p2p type or
68*5113495bSYour Name  * not
69*5113495bSYour Name  * @data_buf: data buffer address
70*5113495bSYour Name  * @length: buffer length
71*5113495bSYour Name  *
72*5113495bSYour Name  * Return: bool
73*5113495bSYour Name  */
74*5113495bSYour Name bool wlan_p2p_is_action_frame_of_p2p_type(uint8_t *data_buf, uint32_t length);
75*5113495bSYour Name 
76*5113495bSYour Name /**
77*5113495bSYour Name  * wlan_p2p_abort_scan() - Abort on going scan on p2p interfaces
78*5113495bSYour Name  * @pdev: pdev object
79*5113495bSYour Name  *
80*5113495bSYour Name  * This function triggers an abort scan request to scan component to abort the
81*5113495bSYour Name  * ongoing scan request on p2p vdevs.
82*5113495bSYour Name  *
83*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS - in case of success
84*5113495bSYour Name  */
85*5113495bSYour Name QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev);
86*5113495bSYour Name 
87*5113495bSYour Name #ifdef WLAN_FEATURE_P2P_P2P_STA
88*5113495bSYour Name /**
89*5113495bSYour Name  * wlan_p2p_check_and_force_scc_go_plus_go() - Check and do force scc for
90*5113495bSYour Name  * go plus go
91*5113495bSYour Name  * @psoc: psoc object
92*5113495bSYour Name  * @vdev: vdev object
93*5113495bSYour Name  *
94*5113495bSYour Name  * This function checks whether force scc is enabled or not. If it
95*5113495bSYour Name  * is enabled then it will do force scc to remaining p2p go vdev if
96*5113495bSYour Name  * user has initiated CSA to current vdev.
97*5113495bSYour Name  *
98*5113495bSYour Name  * Return: status
99*5113495bSYour Name  */
100*5113495bSYour Name QDF_STATUS
101*5113495bSYour Name wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
102*5113495bSYour Name 					struct wlan_objmgr_vdev *vdev);
103*5113495bSYour Name #else
104*5113495bSYour Name static inline QDF_STATUS
wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc * psoc,struct wlan_objmgr_vdev * vdev)105*5113495bSYour Name wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
106*5113495bSYour Name 					struct wlan_objmgr_vdev *vdev)
107*5113495bSYour Name {
108*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
109*5113495bSYour Name }
110*5113495bSYour Name #endif
111*5113495bSYour Name #endif
112