blob: f374c5de3f58852fa5a43860c5982d7fd7c050d1 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnson72acff62018-12-30 10:16:21 -08002 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * 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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef __HDD_TDLS_H
20#define __HDD_TDLS_H
21/**
22 * DOC: wlan_hdd_tdls.h
23 * WLAN Host Device Driver TDLS include file
24 */
25
Jeff Johnsonaf772ed2017-08-28 11:40:36 -070026struct hdd_context;
27
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080028#ifdef FEATURE_WLAN_TDLS
29
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080030/* Bit mask flag for tdls_option to FW */
31#define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */
32#define ENA_TDLS_BUFFER_STA (1 << 1) /* TDLS Buffer STA support */
33#define ENA_TDLS_SLEEP_STA (1 << 2) /* TDLS Sleep STA support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080034
Jeff Johnson6bff8942017-10-02 13:22:18 -070035int wlan_hdd_tdls_get_all_peers(struct hdd_adapter *adapter, char *buf,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036 int buflen);
37
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080038int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
39 struct wireless_dev *wdev,
40 const void *data,
41 int data_len);
42
43int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy,
44 struct wireless_dev *wdev,
45 const void *data,
46 int data_len);
47
48int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy,
49 struct wireless_dev *wdev,
50 const void *data,
51 int data_len);
52
53#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
54int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
55 struct net_device *dev,
56 const uint8_t *peer,
57 enum nl80211_tdls_operation oper);
58#else
59int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
60 struct net_device *dev,
61 uint8_t *peer,
62 enum nl80211_tdls_operation oper);
63#endif
64
65#ifdef TDLS_MGMT_VERSION2
66int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
67 struct net_device *dev, u8 *peer,
68 u8 action_code, u8 dialog_token,
69 u16 status_code, u32 peer_capability,
70 const u8 *buf, size_t len);
71#else
72#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
73int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
74 struct net_device *dev, const uint8_t *peer,
75 uint8_t action_code, uint8_t dialog_token,
76 uint16_t status_code, uint32_t peer_capability,
77 bool initiator, const uint8_t *buf,
78 size_t len);
79#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
80int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
81 struct net_device *dev, const uint8_t *peer,
82 uint8_t action_code, uint8_t dialog_token,
83 uint16_t status_code, uint32_t peer_capability,
84 const uint8_t *buf, size_t len);
85#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
86int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
87 struct net_device *dev, uint8_t *peer,
88 uint8_t action_code, uint8_t dialog_token,
89 uint16_t status_code, uint32_t peer_capability,
90 const uint8_t *buf, size_t len);
91#else
92int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
93 struct net_device *dev, uint8_t *peer,
94 uint8_t action_code, uint8_t dialog_token,
95 uint16_t status_code, const uint8_t *buf,
96 size_t len);
97#endif
98#endif
99
Bala Venkatesh113a9e62018-08-30 15:19:02 +0530100/**
101 * hdd_set_tdls_offchannel() - set tdls off-channel number
102 * @hdd_ctx: Pointer to the HDD context
103 * @adapter: Pointer to the HDD adapter
104 * @offchannel: tdls off-channel number
105 *
106 * This function sets tdls off-channel number
107 *
108 * Return: 0 on success; negative errno otherwise
109 */
110int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx,
111 struct hdd_adapter *adapter,
112 int offchannel);
113
114/**
115 * hdd_set_tdls_secoffchanneloffset() - set secondary tdls off-channel offset
116 * @hdd_ctx: Pointer to the HDD context
117 * @adapter: Pointer to the HDD adapter
118 * @offchanoffset: tdls off-channel offset
119 *
120 * This function sets secondary tdls off-channel offset
121 *
122 * Return: 0 on success; negative errno otherwise
123 */
Jeff Johnsonae9adc82017-10-03 11:22:31 -0700124int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx,
Bala Venkatesh113a9e62018-08-30 15:19:02 +0530125 struct hdd_adapter *adapter,
Jeff Johnsonae9adc82017-10-03 11:22:31 -0700126 int offchanoffset);
Bala Venkatesh113a9e62018-08-30 15:19:02 +0530127
128/**
129 * hdd_set_tdls_offchannelmode() - set tdls off-channel mode
130 * @hdd_ctx: Pointer to the HDD context
131 * @adapter: Pointer to the HDD adapter
132 * @offchanmode: tdls off-channel mode
133 * 1-Enable Channel Switch
134 * 2-Disable Channel Switch
135 *
136 * This function sets tdls off-channel mode
137 *
138 * Return: 0 on success; negative errno otherwise
139 */
140int hdd_set_tdls_offchannelmode(struct hdd_context *hdd_ctx,
141 struct hdd_adapter *adapter,
142 int offchanmode);
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700143int hdd_set_tdls_scan_type(struct hdd_context *hdd_ctx, int val);
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700144int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx,
Jeff Johnson327b9d42017-08-29 14:20:07 -0700145 struct hdd_adapter *adapter,
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700146 uint32_t mode);
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700147
Kabilan Kannand053aaf2016-10-26 02:06:14 -0700148/**
149 * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode
150 * @wiphy: pointer to wireless wiphy structure.
151 * @wdev: pointer to wireless_dev structure.
152 * @data: Pointer to the data to be passed via vendor interface
153 * @data_len:Length of the data to be passed
154 *
155 * Return: Return the Success or Failure code.
156 */
157int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy,
158 struct wireless_dev *wdev,
159 const void *data,
160 int data_len);
161
Jeff Johnson1d40f5b2018-03-02 08:35:53 -0800162QDF_STATUS hdd_tdls_register_peer(void *userdata, uint32_t vdev_id,
163 const uint8_t *mac, uint16_t sta_id,
164 uint8_t qos);
Frank Liud4b2fa02017-03-29 11:46:48 +0800165
Jeff Johnson1d40f5b2018-03-02 08:35:53 -0800166QDF_STATUS hdd_tdls_deregister_peer(void *userdata, uint32_t vdev_id,
167 uint8_t sta_id);
Frank Liud4b2fa02017-03-29 11:46:48 +0800168
jiad7b8a5e02018-11-26 16:37:57 +0800169/**
170 * hdd_init_tdls_config() - initialize tdls config
171 * @tdls_cfg: pointer to tdls_start_params structure
172 *
173 * Return: none
174 */
175void hdd_init_tdls_config(struct tdls_start_params *tdls_cfg);
176
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800177#else
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700178
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700179static inline int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx,
Jeff Johnson327b9d42017-08-29 14:20:07 -0700180 struct hdd_adapter *adapter,
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700181 uint32_t mode)
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700182{
183 return 0;
184}
Kabilan Kannand053aaf2016-10-26 02:06:14 -0700185
186static inline int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy,
187 struct wireless_dev *wdev,
188 const void *data,
189 int data_len)
190{
191 return 0;
192}
193
Jeff Johnson1d40f5b2018-03-02 08:35:53 -0800194static inline
195QDF_STATUS hdd_tdls_register_peer(void *userdata, uint32_t vdev_id,
196 const uint8_t *mac, uint16_t sta_id,
jiad7b8a5e02018-11-26 16:37:57 +0800197 uint8_t qos)
Frank Liud4b2fa02017-03-29 11:46:48 +0800198{
jiad7b8a5e02018-11-26 16:37:57 +0800199 return QDF_STATUS_SUCCESS;
Frank Liud4b2fa02017-03-29 11:46:48 +0800200}
201
Jeff Johnson1d40f5b2018-03-02 08:35:53 -0800202static inline
203QDF_STATUS hdd_tdls_deregister_peer(void *userdata, uint32_t vdev_id,
204 uint8_t sta_id)
Frank Liud4b2fa02017-03-29 11:46:48 +0800205{
jiad7b8a5e02018-11-26 16:37:57 +0800206 return QDF_STATUS_SUCCESS;
Frank Liud4b2fa02017-03-29 11:46:48 +0800207}
jiad7b8a5e02018-11-26 16:37:57 +0800208
209static inline void hdd_init_tdls_config(struct tdls_start_params *tdls_cfg)
210{
211}
212
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800213#endif /* End of FEATURE_WLAN_TDLS */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800214#endif /* __HDD_TDLS_H */