blob: 193916ffde9de48e69fd2afcd146ecd2420cece1 [file] [log] [blame]
Gopichand Nakkalabd9fa2d2013-01-08 13:16:22 -08001/*
Bala Venkatesh5c06a252018-07-12 16:08:04 +05302 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
Gopichand Nakkalabd9fa2d2013-01-08 13:16:22 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Kiran V1ccee932012-12-12 14:49:46 -080028#ifndef __HDD_TDSL_H
29#define __HDD_TDSL_H
30/**===========================================================================
31
32\file wlan_hdd_tdls.h
33
34\brief Linux HDD TDLS include file
Kiran V1ccee932012-12-12 14:49:46 -080035==========================================================================*/
36
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +053037#ifdef FEATURE_WLAN_TDLS
38
Chilam NG571c65a2013-01-19 12:27:36 +053039#define MAX_NUM_TDLS_PEER 3
Kiran V1ccee932012-12-12 14:49:46 -080040
Gopichand Nakkalac3694582013-02-13 20:51:22 -080041#define TDLS_SUB_DISCOVERY_PERIOD 100
42
43#define TDLS_MAX_DISCOVER_REQS_PER_TIMER 1
Kiran V1ccee932012-12-12 14:49:46 -080044
Chilam NG571c65a2013-01-19 12:27:36 +053045#define TDLS_DISCOVERY_PERIOD 3600000
Kiran V1ccee932012-12-12 14:49:46 -080046
Chilam NG571c65a2013-01-19 12:27:36 +053047#define TDLS_TX_STATS_PERIOD 3600000
48
49#define TDLS_IMPLICIT_TRIGGER_PKT_THRESHOLD 100
50
51#define TDLS_RX_IDLE_TIMEOUT 5000
52
53#define TDLS_RSSI_TRIGGER_HYSTERESIS 50
54
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -070055/* before UpdateTimer expires, we want to timeout discovery response.
56should not be more than 2000 */
57#define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE 1000
Gopichand Nakkala75e7b282013-03-15 18:37:13 -070058
Hoonki Lee93e67ff2013-03-19 15:49:25 -070059#define TDLS_CTX_MAGIC 0x54444c53 // "TDLS"
60
61#define TDLS_MAX_SCAN_SCHEDULE 10
Hoonki Leefb8df672013-04-10 18:20:34 -070062#define TDLS_MAX_SCAN_REJECT 5
Hoonki Lee93e67ff2013-03-19 15:49:25 -070063#define TDLS_DELAY_SCAN_PER_CONNECTION 100
64
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -070065#define TDLS_IS_CONNECTED(peer) \
66 ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \
67 (eTDLS_LINK_TEARING == (peer)->link_status))
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +053068
69/* TDLS Off Channel Bandwidth Offset */
70#define TDLS_OFF_CHANNEL_BW_OFFSET 0
71
72/* TDLS Channel Switch Request */
73#define TDLS_CHANNEL_SWITCH_ENABLE 1
74#define TDLS_CHANNEL_SWITCH_DISABLE 2
75
Masti, Narayanraddi20494af2015-12-17 20:56:42 +053076enum tdls_disable_source {
77 HDD_SET_TDLS_MODE_SOURCE_USER = 1,
78 HDD_SET_TDLS_MODE_SOURCE_SCAN = 2,
79 HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL = 4,
80 HDD_SET_TDLS_MODE_SOURCE_BTC = 8,
Bala Venkatesh5c06a252018-07-12 16:08:04 +053081 HDD_SET_TDLS_MODE_SOURCE_CONCURRENCY = 16
Masti, Narayanraddi20494af2015-12-17 20:56:42 +053082};
83
Chilam NG571c65a2013-01-19 12:27:36 +053084typedef struct
85{
Chilam Ng01120412013-02-19 18:32:21 -080086 tANI_U32 tdls;
Chilam NG571c65a2013-01-19 12:27:36 +053087 tANI_U32 tx_period_t;
88 tANI_U32 tx_packet_n;
89 tANI_U32 discovery_period_t;
90 tANI_U32 discovery_tries_n;
Chilam Ng01120412013-02-19 18:32:21 -080091 tANI_U32 idle_timeout_t;
92 tANI_U32 idle_packet_n;
Chilam NG571c65a2013-01-19 12:27:36 +053093 tANI_U32 rssi_hysteresis;
Chilam Ng01120412013-02-19 18:32:21 -080094 tANI_S32 rssi_trigger_threshold;
95 tANI_S32 rssi_teardown_threshold;
Chilam NG571c65a2013-01-19 12:27:36 +053096} tdls_config_params_t;
97
98typedef enum {
Hoonki Lee27511902013-03-14 18:19:06 -070099 eTDLS_SUPPORT_NOT_ENABLED = 0,
100 eTDLS_SUPPORT_DISABLED, /* suppress implicit trigger and not respond to the peer */
101 eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY, /* suppress implicit trigger, but respond to the peer */
102 eTDLS_SUPPORT_ENABLED, /* implicit trigger */
Chilam Ng01120412013-02-19 18:32:21 -0800103} eTDLSSupportMode;
104
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800105typedef enum eTDLSCapType{
Chilam NG571c65a2013-01-19 12:27:36 +0530106 eTDLS_CAP_NOT_SUPPORTED = -1,
107 eTDLS_CAP_UNKNOWN = 0,
108 eTDLS_CAP_SUPPORTED = 1,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800109} tTDLSCapType;
Chilam NG571c65a2013-01-19 12:27:36 +0530110
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800111typedef enum eTDLSLinkStatus {
112 eTDLS_LINK_IDLE = 0,
113 eTDLS_LINK_DISCOVERING,
Gopichand Nakkala05922802013-03-14 12:23:19 -0700114 eTDLS_LINK_DISCOVERED,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800115 eTDLS_LINK_CONNECTING,
116 eTDLS_LINK_CONNECTED,
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700117 eTDLS_LINK_TEARING,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800118} tTDLSLinkStatus;
Chilam NG571c65a2013-01-19 12:27:36 +0530119
Abhishek Singh96568922016-01-05 15:28:12 +0530120/**
121 * enum tdls_teardown_reason - Reason for TDLS teardown
122 * @eTDLS_TEARDOWN_EXT_CTRL: Reason ext ctrl.
123 * @eTDLS_TEARDOWN_CONCURRENCY: Reason concurrency.
124 * @eTDLS_TEARDOWN_RSSI_THRESHOLD: Reason rssi threashold.
125 * @eTDLS_TEARDOWN_TXRX_THRESHOLD: Reason txrx threashold.
126 * @eTDLS_TEARDOWN_BTCOEX: Reason BTCOEX.
127 * @eTDLS_TEARDOWN_SCAN: Reason scan.
128 * @eTDLS_TEARDOWN_BSS_DISCONNECT: Reason bss disconnected.
129 *
130 * Reason to indicate in diag event of tdls teardown.
131 */
132
133enum tdls_teardown_reason {
134 eTDLS_TEARDOWN_EXT_CTRL,
135 eTDLS_TEARDOWN_CONCURRENCY,
136 eTDLS_TEARDOWN_RSSI_THRESHOLD,
137 eTDLS_TEARDOWN_TXRX_THRESHOLD,
138 eTDLS_TEARDOWN_BTCOEX,
139 eTDLS_TEARDOWN_SCAN,
140 eTDLS_TEARDOWN_BSS_DISCONNECT,
141};
Atul Mittal115287b2014-07-08 13:26:33 +0530142
143typedef enum {
144 eTDLS_LINK_SUCCESS, /* Success */
145 eTDLS_LINK_UNSPECIFIED = -1, /* Unspecified reason */
146 eTDLS_LINK_NOT_SUPPORTED = -2, /* Remote side doesn't support TDLS */
147 eTDLS_LINK_UNSUPPORTED_BAND = -3, /* Remote side doesn't support this band */
148 eTDLS_LINK_NOT_BENEFICIAL = -4, /* Going to AP is better than going direct */
149 eTDLS_LINK_DROPPED_BY_REMOTE = -5 /* Remote side doesn't want it anymore */
150} tTDLSLinkReason;
151
152typedef struct {
153 int channel; /* channel hint, in channel number (NOT frequency ) */
154 int global_operating_class; /* operating class to use */
155 int max_latency_ms; /* max latency that can be tolerated by apps */
156 int min_bandwidth_kbps; /* bandwidth required by apps, in kilo bits per second */
157} tdls_req_params_t;
158
159typedef enum {
160 WIFI_TDLS_DISABLED, /* TDLS is not enabled, or is disabled now */
161 WIFI_TDLS_ENABLED, /* TDLS is enabled, but not yet tried */
162 WIFI_TDLS_TRYING, /* Direct link is being attempted (optional) */
163 WIFI_TDLS_ESTABLISHED, /* Direct link is established */
164 WIFI_TDLS_ESTABLISHED_OFF_CHANNEL, /* Direct link is established using MCC */
165 WIFI_TDLS_DROPPED, /* Direct link was established, but is now dropped */
166 WIFI_TDLS_FAILED /* Direct link failed */
167} tdls_state_t;
168
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530169typedef int (*cfg80211_exttdls_callback)(
170#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
171 const tANI_U8* mac,
172#else
173 tANI_U8* mac,
174#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530175 tANI_S32 state,
176 tANI_S32 reason,
177 void *ctx);
Chilam NG571c65a2013-01-19 12:27:36 +0530178typedef struct {
179 tANI_U16 period;
180 tANI_U16 bytes;
181} tdls_tx_tput_config_t;
182
183typedef struct {
184 tANI_U16 period;
185 tANI_U16 tries;
186} tdls_discovery_config_t;
187
188typedef struct {
189 tANI_U16 timeout;
190} tdls_rx_idle_config_t;
191
192typedef struct {
193 tANI_U16 rssi_thres;
194} tdls_rssi_config_t;
195
Hoonki Leed37cbb32013-04-20 00:31:14 -0700196struct _hddTdlsPeer_t;
Sunil Dutt41de4e22013-11-14 18:09:02 +0530197
198typedef struct {
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800199 struct list_head peer_list[256];
200 hdd_adapter_t *pAdapter;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700201#ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800202 vos_timer_t peerDiscoverTimer;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700203#endif
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800204 vos_timer_t peerUpdateTimer;
Gopichand Nakkala75e7b282013-03-15 18:37:13 -0700205 vos_timer_t peerDiscoveryTimeoutTimer;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800206 tdls_config_params_t threshold_config;
207 tANI_S32 discovery_peer_cnt;
Gopichand Nakkala75e7b282013-03-15 18:37:13 -0700208 tANI_U32 discovery_sent_cnt;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800209 tANI_S8 ap_rssi;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700210 struct _hddTdlsPeer_t *curr_candidate;
211 struct work_struct implicit_setup;
Ganesh Kondabattini17e60662017-05-25 12:36:07 +0530212 bool is_tdls_disabled_bmps;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700213 v_U32_t magic;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800214} tdlsCtx_t;
215
Hoonki Leed37cbb32013-04-20 00:31:14 -0700216typedef struct _hddTdlsPeer_t {
Hoonki Lee387663d2013-02-05 18:08:43 -0800217 struct list_head node;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800218 tdlsCtx_t *pHddTdlsCtx;
Hoonki Lee387663d2013-02-05 18:08:43 -0800219 tSirMacAddr peerMac;
220 tANI_U16 staId ;
221 tANI_S8 rssi;
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800222 tTDLSCapType tdls_support;
223 tTDLSLinkStatus link_status;
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800224 tANI_U8 signature;
Hoonki Leea34dd892013-02-05 22:56:02 -0800225 tANI_U8 is_responder;
Gopichand Nakkalac3694582013-02-13 20:51:22 -0800226 tANI_U8 discovery_processed;
Hoonki Lee387663d2013-02-05 18:08:43 -0800227 tANI_U16 discovery_attempt;
228 tANI_U16 tx_pkt;
229 tANI_U16 rx_pkt;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530230 tANI_U8 uapsdQueues;
Agarwal Ashish16020c42014-12-29 22:01:11 +0530231 tANI_U8 qos;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530232 tANI_U8 maxSp;
233 tANI_U8 isBufSta;
Naresh Jayaram3180aa42014-02-12 21:47:26 +0530234 tANI_U8 isOffChannelSupported;
235 tANI_U8 supported_channels_len;
236 tANI_U8 supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
237 tANI_U8 supported_oper_classes_len;
238 tANI_U8 supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
Hoonki Lee387663d2013-02-05 18:08:43 -0800239 vos_timer_t peerIdleTimer;
Hoonki Lee14621352013-04-16 17:51:19 -0700240 vos_timer_t initiatorWaitTimeoutTimer;
Naresh Jayaram937abdf2013-11-26 19:50:25 +0530241 tANI_BOOLEAN isForcedPeer;
Atul Mittal115287b2014-07-08 13:26:33 +0530242 /*EXT TDLS*/
243 tTDLSLinkReason reason;
244 cfg80211_exttdls_callback state_change_notification;
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530245 tANI_BOOLEAN isOffChannelConfigured;
Pradeep Reddy POTTETI16d83332015-03-26 18:28:13 +0530246 tANI_BOOLEAN isOffChannelEstablished;
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530247 tdls_req_params_t peerParams;
Hoonki Lee387663d2013-02-05 18:08:43 -0800248} hddTdlsPeer_t;
249
Hoonki Lee387663d2013-02-05 18:08:43 -0800250typedef struct {
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800251 /* Session ID */
252 tANI_U8 sessionId;
253 /*TDLS peer station id */
254 v_U8_t staId;
255 /* TDLS peer mac Address */
256 v_MACADDR_t peerMac;
257} tdlsConnInfo_t;
Chilam NG571c65a2013-01-19 12:27:36 +0530258
Agarwal Ashish4b87f922014-06-18 03:03:21 +0530259int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter);
260
261void wlan_hdd_tdls_init(hdd_context_t * pHddCtx);
Chilam NG571c65a2013-01-19 12:27:36 +0530262
Pradeep Reddy POTTETI2d4d5c42015-03-03 14:34:19 +0530263void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter, tANI_BOOLEAN mutexLock);
Chilam NG571c65a2013-01-19 12:27:36 +0530264
Hoonki Lee387663d2013-02-05 18:08:43 -0800265void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac);
Chilam NG571c65a2013-01-19 12:27:36 +0530266
Hoonki Lee387663d2013-02-05 18:08:43 -0800267void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac);
Chilam Ng1279e232013-01-25 15:06:52 -0800268
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530269int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter,
270#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
271 const u8 *mac,
272#else
273 u8 *mac,
274#endif
275 u8 staId);
Chilam NG571c65a2013-01-19 12:27:36 +0530276
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530277hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530278 const u8 *mac,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530279 tANI_BOOLEAN mutexLock);
Chilam NG571c65a2013-01-19 12:27:36 +0530280
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530281hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx,
282#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
283 const u8 *mac
284#else
285 u8 *mac
286#endif
287);
Hoonki Leea6d49be2013-04-05 09:43:25 -0700288
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530289int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter,
290#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
291 const u8 *mac,
292#else
293 u8 *mac,
294#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530295 tCsrTdlsLinkEstablishParams* tdlsLinkEstablishParams);
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530296hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter,
297#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
298 const u8 *mac
299#else
300 u8 *mac
301#endif
302 );
Hoonki Lee387663d2013-02-05 18:08:43 -0800303
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530304int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter,
305#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
306 const u8* mac,
307#else
308 u8* mac,
309#endif
310 tTDLSCapType cap);
Hoonki Lee27511902013-03-14 18:19:06 -0700311
Atul Mittal115287b2014-07-08 13:26:33 +0530312void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
313 tTDLSLinkStatus status,
314 tTDLSLinkReason reason);
315void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530316#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
317 const u8 *mac,
318#else
319 u8 *mac,
320#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530321 tTDLSLinkStatus linkStatus,
322 tTDLSLinkReason reason);
Chilam NG571c65a2013-01-19 12:27:36 +0530323
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800324int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac);
Chilam NG571c65a2013-01-19 12:27:36 +0530325
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530326int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530327#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
328 const u8 *mac,
329#else
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530330 u8 *mac,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530331#endif
Naresh Jayaram3180aa42014-02-12 21:47:26 +0530332 tCsrStaParams *StaParams,
333 tANI_BOOLEAN isBufSta,
Masti, Narayanraddic754cdc2015-12-24 18:22:36 +0530334 tANI_BOOLEAN isOffChannelSupported,
335 tANI_BOOLEAN isQosWmmSta);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530336
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530337int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter,
338#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
339 const u8 *mac,
340#else
341 u8 *mac,
342#endif
343 tANI_S8 rxRssi);
Chilam NG571c65a2013-01-19 12:27:36 +0530344
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530345int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter,
346#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
347 const u8 *mac,
348#else
349 u8 *mac,
350#endif
351 tANI_U8 responder);
Hoonki Leea34dd892013-02-05 22:56:02 -0800352
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530353int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter,
354#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
355 const u8 *mac,
356#else
357 u8 *mac,
358#endif
359 tANI_U8 uSignature);
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800360
Chilam Ng01120412013-02-19 18:32:21 -0800361int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *config);
Chilam NG571c65a2013-01-19 12:27:36 +0530362
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530363int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter,
364#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
365 const u8 *mac
366#else
367 u8 *mac
368#endif
369 );
Hoonki Lee387663d2013-02-05 18:08:43 -0800370
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800371tANI_U16 wlan_hdd_tdlsConnectedPeers(hdd_adapter_t *pAdapter);
Lee Hoonkic1262f22013-01-24 21:59:00 -0800372
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800373int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen);
Chilam Ng16a2a1c2013-01-29 01:27:29 -0800374
Gopichand Nakkalac3694582013-02-13 20:51:22 -0800375void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter);
376
377void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter);
378
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800379void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, tANI_U32 statusCode);
380
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800381void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800382
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800383void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800384
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800385void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800386
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530387hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx,
388#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
389 const u8 *mac,
390#else
391 u8 *mac,
392#endif
Pradeep Reddy POTTETI9db32f02015-01-29 15:22:54 +0530393 u8 skip_self, tANI_BOOLEAN mutexLock);
Hoonki Lee387663d2013-02-05 18:08:43 -0800394
Gopichand Nakkaladcbcf4e2013-03-23 14:32:39 -0700395void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx,
396 eTDLSSupportMode tdls_mode,
Masti, Narayanraddi20494af2015-12-17 20:56:42 +0530397 v_BOOL_t bUpdateLast,
398 enum tdls_disable_source source);
Hoonki Lee27511902013-03-14 18:19:06 -0700399
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -0700400tANI_U32 wlan_hdd_tdls_discovery_sent_cnt(hdd_context_t *pHddCtx);
401
Gopichand Nakkala34d1b062013-03-19 15:28:33 -0700402void wlan_hdd_tdls_check_power_save_prohibited(hdd_adapter_t *pAdapter);
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -0700403
Hoonki Lee93e67ff2013-03-19 15:49:25 -0700404int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter,
405 struct wiphy *wiphy,
406#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
407 struct net_device *dev,
408#endif
409 struct cfg80211_scan_request *request);
410
411void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
412
Gopichand Nakkala3046fc92013-03-23 13:56:43 -0700413void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter,
414 vos_timer_t *timer,
415 v_U32_t expirationTime);
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700416void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter,
Atul Mittal115287b2014-07-08 13:26:33 +0530417 hddTdlsPeer_t *curr_peer,
418 tANI_U16 reason);
Abhishek Singh96568922016-01-05 15:28:12 +0530419#ifdef FEATURE_WLAN_DIAG_SUPPORT
420void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
421 uint8_t *peer_mac);
Abhishek Singh5f544022016-01-05 15:57:19 +0530422void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac,
423 uint8_t is_off_chan_supported,
424 uint8_t is_off_chan_configured,
425 uint8_t is_off_chan_established);
Abhishek Singh48e043d2016-01-05 18:27:29 +0530426void hdd_wlan_block_scan_by_tdls(void);
427
Abhishek Singh96568922016-01-05 15:28:12 +0530428#else
429static inline
430void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
431 uint8_t *peer_mac)
432{
433 return;
434}
Abhishek Singh5f544022016-01-05 15:57:19 +0530435static inline
436void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac,
437 uint8_t is_off_chan_supported,
438 uint8_t is_off_chan_configured,
439 uint8_t is_off_chan_established)
440{
441 return;
442}
Abhishek Singh48e043d2016-01-05 18:27:29 +0530443static inline
444void hdd_wlan_block_scan_by_tdls(void)
445{
446 return;
447}
Abhishek Singh96568922016-01-05 15:28:12 +0530448#endif /* FEATURE_WLAN_DIAG_SUPPORT */
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700449
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530450int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter,
451#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
452 const u8 *mac,
453#else
454 u8 *mac,
455#endif
Naresh Jayaram937abdf2013-11-26 19:50:25 +0530456 tANI_BOOLEAN forcePeer);
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530457int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
458#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
459 const u8 *peer
460#else
461 u8 *peer
462#endif
463);
Atul Mittal115287b2014-07-08 13:26:33 +0530464int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530465#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
466 const u8 *peer,
467#else
Atul Mittal115287b2014-07-08 13:26:33 +0530468 u8 *peer,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530469#endif
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530470 tdls_req_params_t *tdls_peer_params,
Atul Mittal115287b2014-07-08 13:26:33 +0530471 cfg80211_exttdls_callback callback);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530472void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter,
473 hdd_context_t *pHddCtx);
474void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx);
Atul Mittal115287b2014-07-08 13:26:33 +0530475/*EXT TDLS*/
476int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530477#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
478 const tANI_U8* mac,
479#else
Atul Mittal115287b2014-07-08 13:26:33 +0530480 tANI_U8* mac,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530481#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530482 tANI_S32 *state,
483 tANI_S32 *reason);
484void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer,
485 tANI_S32 *state,
486 tANI_S32 *reason);
487int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
488 cfg80211_exttdls_callback callback);
Agarwal Ashishef54a182014-12-16 15:07:31 +0530489int hdd_set_tdls_scan_type(hdd_adapter_t *pAdapter,
490 tANI_U8 *ptr);
Gopichand Nakkala3046fc92013-03-23 13:56:43 -0700491
Atul Mittalc0f739f2014-07-31 13:47:47 +0530492// tdlsoffchan
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530493hddTdlsPeer_t *wlan_hdd_tdls_get_connected_peer(hdd_adapter_t *pAdapter);
Mahesh A Saptasagar170b5082015-02-16 18:50:54 +0530494
495int wlan_hdd_validate_tdls_context(hdd_context_t *pHddCtx, tdlsCtx_t *pTdlsCtx);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530496
Masti, Narayanraddi575ccc72015-08-17 18:04:57 +0530497void wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx);
Masti, Narayanraddi44b0db02015-12-22 11:54:35 +0530498
Masti, Narayanraddi63d62352015-10-01 12:52:50 +0530499void wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb);
Masti, Narayanraddi44b0db02015-12-22 11:54:35 +0530500
501void wlan_hdd_change_tdls_mode(void *hdd_ctx);
502
503void wlan_hdd_start_stop_tdls_source_timer(hdd_context_t *pHddCtx,
504 eTDLSSupportMode tdls_mode);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530505#else
506static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter,
507 hdd_context_t *pHddCtx)
508{
509}
510static inline void
511wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx)
512{
513}
Masti, Narayanraddi575ccc72015-08-17 18:04:57 +0530514static inline void
515wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx)
516{
517}
Masti, Narayanraddi63d62352015-10-01 12:52:50 +0530518static inline void
519wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb)
520{
521}
Masti, Narayanraddi44b0db02015-12-22 11:54:35 +0530522static inline void
523wlan_hdd_change_tdls_mode(void *hdd_ctx)
524{
525}
526
527static inline void
528wlan_hdd_start_stop_tdls_source_timer(hdd_context_t *pHddCtx,
529 eTDLSSupportMode tdls_mode)
530{
531}
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530532#endif
Ganesh Kondabattinif3ba0972015-08-07 15:58:04 +0530533void wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(hdd_adapter_t *pAdapter,
534 u8 *mac, v_S7_t rssiAvg);
Ganesh Kondabattinicbfdc392015-09-11 19:12:59 +0530535
536
537tdlsConnInfo_t *wlan_hdd_get_conn_info(hdd_context_t *pHddCtx,
538 tANI_U8 idx);
539
540v_VOID_t wlan_hdd_tdls_initiator_wait_cb(v_PVOID_t userData);
541
Deepthi Gowri03a979f2016-11-03 15:20:19 +0530542void wlan_hdd_get_tdls_stats(hdd_adapter_t *pAdapter);
543
Kiran V1ccee932012-12-12 14:49:46 -0800544#endif // __HDD_TDSL_H