1 /* 2 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 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: declares P2P functions interfacing with linux kernel 22 */ 23 24 #ifndef _WLAN_CFG80211_P2P_H_ 25 #define _WLAN_CFG80211_P2P_H_ 26 27 #include <qdf_types.h> 28 29 struct wlan_objmgr_psoc; 30 struct wlan_objmgr_vdev; 31 struct ieee80211_channel; 32 33 /** 34 * p2p_psoc_enable() - psoc API to enable p2p component 35 * @psoc: soc object 36 * 37 * This function used to enable P2P component and register events. 38 * 39 * Return: QDF_STATUS_SUCCESS - in case of success 40 */ 41 QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc); 42 43 /** 44 * p2p_psoc_disable() - psoc API to disable p2p component 45 * @psoc: soc object 46 * 47 * This function used to disable P2P component and unregister events. 48 * 49 * Return: QDF_STATUS_SUCCESS - in case of success 50 */ 51 QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc); 52 53 /** 54 * wlan_cfg80211_roc() - API to process cfg80211 roc request 55 * @vdev: Pointer to vdev object 56 * @chan: Pointer to channel 57 * @duration: Duration for this roc request 58 * @cookie: Pointer to return cookie to up layer 59 * 60 * API to trigger remain on channel request. It returns cookie 61 * as the identifier of roc. 62 * 63 * Return: 0 for success, non zero for failure 64 */ 65 int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev, 66 struct ieee80211_channel *chan, uint32_t duration, 67 uint64_t *cookie); 68 69 /** 70 * wlan_cfg80211_cancel_roc() - API to process cfg80211 cancel remain 71 * on channel request 72 * @vdev: Pointer to vdev object 73 * @cookie: Find out the roc request by cookie 74 * 75 * API to trigger cancel remain on channel request. 76 * 77 * Return: 0 for success, non zero for failure 78 */ 79 int wlan_cfg80211_cancel_roc(struct wlan_objmgr_vdev *vdev, 80 uint64_t cookie); 81 82 /** 83 * wlan_cfg80211_mgmt_tx() - API to process cfg80211 mgmt tx request 84 * @vdev: Pointer to vdev object 85 * @chan: Pointer to channel 86 * @offchan: true if this is an off-channel frame 87 * @wait: wait time for this mgmt tx request 88 * @buf: TX buffer 89 * @len: Length of tx buffer 90 * @no_cck: Required cck or not 91 * @dont_wait_for_ack: Wait for ack or not 92 * @cookie: Return the cookie to caller 93 * 94 * API to trigger mgmt frame tx request. It returns cookie as the 95 * identifier of this tx. 96 * 97 * Return: 0 for success, non zero for failure 98 */ 99 int wlan_cfg80211_mgmt_tx(struct wlan_objmgr_vdev *vdev, 100 struct ieee80211_channel *chan, bool offchan, uint32_t wait, 101 const uint8_t *buf, uint32_t len, bool no_cck, 102 bool dont_wait_for_ack, uint64_t *cookie); 103 104 /** 105 * wlan_cfg80211_mgmt_tx_cancel() - API to process cfg80211 cancel to 106 * wait mgmt tx 107 * @vdev: Pointer to vdev object 108 * @cookie: Find out the mgmt tx request by cookie 109 * 110 * API to trigger cancel mgmt frame tx request. 111 * 112 * Return: 0 for success, non zero for failure 113 */ 114 int wlan_cfg80211_mgmt_tx_cancel(struct wlan_objmgr_vdev *vdev, 115 uint64_t cookie); 116 117 #endif /* _WLAN_CFG80211_P2P_H_ */ 118