blob: 4c014353056f777ec7d25dbe6c2040541a919f15 [file] [log] [blame]
Gopichand Nakkalabd9fa2d2013-01-08 13:16:22 -08001/*
Pradeep Reddy POTTETI9db32f02015-01-29 15:22:54 +05302 * Copyright (c) 2012-2015 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,
81 HDD_SET_TDLS_MODE_SOURCE_P2P = 16
82};
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
Hoonki Lee93e67ff2013-03-19 15:49:25 -070098typedef struct
99{
100 struct wiphy *wiphy;
101#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
102 struct net_device *dev;
103#endif
104 struct cfg80211_scan_request *scan_request;
105 int magic;
106 int attempt;
Hoonki Leefb8df672013-04-10 18:20:34 -0700107 int reject;
Hoonki Lee93e67ff2013-03-19 15:49:25 -0700108 struct delayed_work tdls_scan_work;
109} tdls_scan_context_t;
110
Chilam NG571c65a2013-01-19 12:27:36 +0530111typedef enum {
Hoonki Lee27511902013-03-14 18:19:06 -0700112 eTDLS_SUPPORT_NOT_ENABLED = 0,
113 eTDLS_SUPPORT_DISABLED, /* suppress implicit trigger and not respond to the peer */
114 eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY, /* suppress implicit trigger, but respond to the peer */
115 eTDLS_SUPPORT_ENABLED, /* implicit trigger */
Chilam Ng01120412013-02-19 18:32:21 -0800116} eTDLSSupportMode;
117
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800118typedef enum eTDLSCapType{
Chilam NG571c65a2013-01-19 12:27:36 +0530119 eTDLS_CAP_NOT_SUPPORTED = -1,
120 eTDLS_CAP_UNKNOWN = 0,
121 eTDLS_CAP_SUPPORTED = 1,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800122} tTDLSCapType;
Chilam NG571c65a2013-01-19 12:27:36 +0530123
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800124typedef enum eTDLSLinkStatus {
125 eTDLS_LINK_IDLE = 0,
126 eTDLS_LINK_DISCOVERING,
Gopichand Nakkala05922802013-03-14 12:23:19 -0700127 eTDLS_LINK_DISCOVERED,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800128 eTDLS_LINK_CONNECTING,
129 eTDLS_LINK_CONNECTED,
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700130 eTDLS_LINK_TEARING,
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800131} tTDLSLinkStatus;
Chilam NG571c65a2013-01-19 12:27:36 +0530132
Atul Mittal115287b2014-07-08 13:26:33 +0530133
134typedef enum {
135 eTDLS_LINK_SUCCESS, /* Success */
136 eTDLS_LINK_UNSPECIFIED = -1, /* Unspecified reason */
137 eTDLS_LINK_NOT_SUPPORTED = -2, /* Remote side doesn't support TDLS */
138 eTDLS_LINK_UNSUPPORTED_BAND = -3, /* Remote side doesn't support this band */
139 eTDLS_LINK_NOT_BENEFICIAL = -4, /* Going to AP is better than going direct */
140 eTDLS_LINK_DROPPED_BY_REMOTE = -5 /* Remote side doesn't want it anymore */
141} tTDLSLinkReason;
142
143typedef struct {
144 int channel; /* channel hint, in channel number (NOT frequency ) */
145 int global_operating_class; /* operating class to use */
146 int max_latency_ms; /* max latency that can be tolerated by apps */
147 int min_bandwidth_kbps; /* bandwidth required by apps, in kilo bits per second */
148} tdls_req_params_t;
149
150typedef enum {
151 WIFI_TDLS_DISABLED, /* TDLS is not enabled, or is disabled now */
152 WIFI_TDLS_ENABLED, /* TDLS is enabled, but not yet tried */
153 WIFI_TDLS_TRYING, /* Direct link is being attempted (optional) */
154 WIFI_TDLS_ESTABLISHED, /* Direct link is established */
155 WIFI_TDLS_ESTABLISHED_OFF_CHANNEL, /* Direct link is established using MCC */
156 WIFI_TDLS_DROPPED, /* Direct link was established, but is now dropped */
157 WIFI_TDLS_FAILED /* Direct link failed */
158} tdls_state_t;
159
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530160typedef int (*cfg80211_exttdls_callback)(
161#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
162 const tANI_U8* mac,
163#else
164 tANI_U8* mac,
165#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530166 tANI_S32 state,
167 tANI_S32 reason,
168 void *ctx);
Chilam NG571c65a2013-01-19 12:27:36 +0530169typedef struct {
170 tANI_U16 period;
171 tANI_U16 bytes;
172} tdls_tx_tput_config_t;
173
174typedef struct {
175 tANI_U16 period;
176 tANI_U16 tries;
177} tdls_discovery_config_t;
178
179typedef struct {
180 tANI_U16 timeout;
181} tdls_rx_idle_config_t;
182
183typedef struct {
184 tANI_U16 rssi_thres;
185} tdls_rssi_config_t;
186
Hoonki Leed37cbb32013-04-20 00:31:14 -0700187struct _hddTdlsPeer_t;
Sunil Dutt41de4e22013-11-14 18:09:02 +0530188
189typedef struct {
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800190 struct list_head peer_list[256];
191 hdd_adapter_t *pAdapter;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700192#ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800193 vos_timer_t peerDiscoverTimer;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700194#endif
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800195 vos_timer_t peerUpdateTimer;
Gopichand Nakkala75e7b282013-03-15 18:37:13 -0700196 vos_timer_t peerDiscoveryTimeoutTimer;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800197 tdls_config_params_t threshold_config;
198 tANI_S32 discovery_peer_cnt;
Gopichand Nakkala75e7b282013-03-15 18:37:13 -0700199 tANI_U32 discovery_sent_cnt;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800200 tANI_S8 ap_rssi;
Hoonki Leed37cbb32013-04-20 00:31:14 -0700201 struct _hddTdlsPeer_t *curr_candidate;
202 struct work_struct implicit_setup;
203 v_U32_t magic;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800204} tdlsCtx_t;
205
Hoonki Leed37cbb32013-04-20 00:31:14 -0700206typedef struct _hddTdlsPeer_t {
Hoonki Lee387663d2013-02-05 18:08:43 -0800207 struct list_head node;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800208 tdlsCtx_t *pHddTdlsCtx;
Hoonki Lee387663d2013-02-05 18:08:43 -0800209 tSirMacAddr peerMac;
210 tANI_U16 staId ;
211 tANI_S8 rssi;
Gopichand Nakkala901e8922013-03-04 23:45:58 -0800212 tTDLSCapType tdls_support;
213 tTDLSLinkStatus link_status;
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800214 tANI_U8 signature;
Hoonki Leea34dd892013-02-05 22:56:02 -0800215 tANI_U8 is_responder;
Gopichand Nakkalac3694582013-02-13 20:51:22 -0800216 tANI_U8 discovery_processed;
Hoonki Lee387663d2013-02-05 18:08:43 -0800217 tANI_U16 discovery_attempt;
218 tANI_U16 tx_pkt;
219 tANI_U16 rx_pkt;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530220 tANI_U8 uapsdQueues;
Agarwal Ashish16020c42014-12-29 22:01:11 +0530221 tANI_U8 qos;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530222 tANI_U8 maxSp;
223 tANI_U8 isBufSta;
Naresh Jayaram3180aa42014-02-12 21:47:26 +0530224 tANI_U8 isOffChannelSupported;
225 tANI_U8 supported_channels_len;
226 tANI_U8 supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
227 tANI_U8 supported_oper_classes_len;
228 tANI_U8 supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
Hoonki Lee387663d2013-02-05 18:08:43 -0800229 vos_timer_t peerIdleTimer;
Hoonki Lee14621352013-04-16 17:51:19 -0700230 vos_timer_t initiatorWaitTimeoutTimer;
Naresh Jayaram937abdf2013-11-26 19:50:25 +0530231 tANI_BOOLEAN isForcedPeer;
Atul Mittal115287b2014-07-08 13:26:33 +0530232 /*EXT TDLS*/
233 tTDLSLinkReason reason;
234 cfg80211_exttdls_callback state_change_notification;
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530235 tANI_BOOLEAN isOffChannelConfigured;
Pradeep Reddy POTTETI16d83332015-03-26 18:28:13 +0530236 tANI_BOOLEAN isOffChannelEstablished;
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530237 tdls_req_params_t peerParams;
Hoonki Lee387663d2013-02-05 18:08:43 -0800238} hddTdlsPeer_t;
239
Hoonki Lee387663d2013-02-05 18:08:43 -0800240typedef struct {
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800241 /* Session ID */
242 tANI_U8 sessionId;
243 /*TDLS peer station id */
244 v_U8_t staId;
245 /* TDLS peer mac Address */
246 v_MACADDR_t peerMac;
247} tdlsConnInfo_t;
Chilam NG571c65a2013-01-19 12:27:36 +0530248
Agarwal Ashish4b87f922014-06-18 03:03:21 +0530249int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter);
250
251void wlan_hdd_tdls_init(hdd_context_t * pHddCtx);
Chilam NG571c65a2013-01-19 12:27:36 +0530252
Pradeep Reddy POTTETI2d4d5c42015-03-03 14:34:19 +0530253void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter, tANI_BOOLEAN mutexLock);
Chilam NG571c65a2013-01-19 12:27:36 +0530254
Hoonki Lee387663d2013-02-05 18:08:43 -0800255void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac);
Chilam NG571c65a2013-01-19 12:27:36 +0530256
Hoonki Lee387663d2013-02-05 18:08:43 -0800257void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac);
Chilam Ng1279e232013-01-25 15:06:52 -0800258
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530259int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter,
260#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
261 const u8 *mac,
262#else
263 u8 *mac,
264#endif
265 u8 staId);
Chilam NG571c65a2013-01-19 12:27:36 +0530266
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530267hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530268 const u8 *mac,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530269 tANI_BOOLEAN mutexLock);
Chilam NG571c65a2013-01-19 12:27:36 +0530270
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530271hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx,
272#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
273 const u8 *mac
274#else
275 u8 *mac
276#endif
277);
Hoonki Leea6d49be2013-04-05 09:43:25 -0700278
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530279int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter,
280#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
281 const u8 *mac,
282#else
283 u8 *mac,
284#endif
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530285 tCsrTdlsLinkEstablishParams* tdlsLinkEstablishParams);
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530286hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter,
287#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
288 const u8 *mac
289#else
290 u8 *mac
291#endif
292 );
Hoonki Lee387663d2013-02-05 18:08:43 -0800293
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530294int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter,
295#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
296 const u8* mac,
297#else
298 u8* mac,
299#endif
300 tTDLSCapType cap);
Hoonki Lee27511902013-03-14 18:19:06 -0700301
Atul Mittal115287b2014-07-08 13:26:33 +0530302void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
303 tTDLSLinkStatus status,
304 tTDLSLinkReason reason);
305void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530306#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
307 const u8 *mac,
308#else
309 u8 *mac,
310#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530311 tTDLSLinkStatus linkStatus,
312 tTDLSLinkReason reason);
Chilam NG571c65a2013-01-19 12:27:36 +0530313
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800314int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac);
Chilam NG571c65a2013-01-19 12:27:36 +0530315
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530316int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530317#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
318 const u8 *mac,
319#else
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530320 u8 *mac,
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530321#endif
Naresh Jayaram3180aa42014-02-12 21:47:26 +0530322 tCsrStaParams *StaParams,
323 tANI_BOOLEAN isBufSta,
Masti, Narayanraddic754cdc2015-12-24 18:22:36 +0530324 tANI_BOOLEAN isOffChannelSupported,
325 tANI_BOOLEAN isQosWmmSta);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530326
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530327int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter,
328#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
329 const u8 *mac,
330#else
331 u8 *mac,
332#endif
333 tANI_S8 rxRssi);
Chilam NG571c65a2013-01-19 12:27:36 +0530334
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530335int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter,
336#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
337 const u8 *mac,
338#else
339 u8 *mac,
340#endif
341 tANI_U8 responder);
Hoonki Leea34dd892013-02-05 22:56:02 -0800342
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530343int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter,
344#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
345 const u8 *mac,
346#else
347 u8 *mac,
348#endif
349 tANI_U8 uSignature);
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800350
Chilam Ng01120412013-02-19 18:32:21 -0800351int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *config);
Chilam NG571c65a2013-01-19 12:27:36 +0530352
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530353int wlan_hdd_tdls_reset_peer(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 );
Hoonki Lee387663d2013-02-05 18:08:43 -0800360
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800361tANI_U16 wlan_hdd_tdlsConnectedPeers(hdd_adapter_t *pAdapter);
Lee Hoonkic1262f22013-01-24 21:59:00 -0800362
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800363int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen);
Chilam Ng16a2a1c2013-01-29 01:27:29 -0800364
Gopichand Nakkalac3694582013-02-13 20:51:22 -0800365void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter);
366
367void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter);
368
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800369void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, tANI_U32 statusCode);
370
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800371void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800372
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800373void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800374
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800375void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter);
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800376
Anand N Sunkadb3ab97d2015-07-29 09:58:13 +0530377hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx,
378#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
379 const u8 *mac,
380#else
381 u8 *mac,
382#endif
Pradeep Reddy POTTETI9db32f02015-01-29 15:22:54 +0530383 u8 skip_self, tANI_BOOLEAN mutexLock);
Hoonki Lee387663d2013-02-05 18:08:43 -0800384
Gopichand Nakkaladcbcf4e2013-03-23 14:32:39 -0700385void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx,
386 eTDLSSupportMode tdls_mode,
Masti, Narayanraddi20494af2015-12-17 20:56:42 +0530387 v_BOOL_t bUpdateLast,
388 enum tdls_disable_source source);
Hoonki Lee27511902013-03-14 18:19:06 -0700389
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -0700390tANI_U32 wlan_hdd_tdls_discovery_sent_cnt(hdd_context_t *pHddCtx);
391
Gopichand Nakkala34d1b062013-03-19 15:28:33 -0700392void wlan_hdd_tdls_check_power_save_prohibited(hdd_adapter_t *pAdapter);
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -0700393
Hoonki Lee93e67ff2013-03-19 15:49:25 -0700394void wlan_hdd_tdls_free_scan_request (tdls_scan_context_t *tdls_scan_ctx);
395
396int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
397 struct wiphy *wiphy,
398#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
399 struct net_device *dev,
400#endif
401 struct cfg80211_scan_request *request);
402
403int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter,
404 struct wiphy *wiphy,
405#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
406 struct net_device *dev,
407#endif
408 struct cfg80211_scan_request *request);
409
410void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
411
Gopichand Nakkala3046fc92013-03-23 13:56:43 -0700412void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter,
413 vos_timer_t *timer,
414 v_U32_t expirationTime);
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700415void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter,
Atul Mittal115287b2014-07-08 13:26:33 +0530416 hddTdlsPeer_t *curr_peer,
417 tANI_U16 reason);
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700418
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530419int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter,
420#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
421 const u8 *mac,
422#else
423 u8 *mac,
424#endif
Naresh Jayaram937abdf2013-11-26 19:50:25 +0530425 tANI_BOOLEAN forcePeer);
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530426int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
427#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
428 const u8 *peer
429#else
430 u8 *peer
431#endif
432);
Atul Mittal115287b2014-07-08 13:26:33 +0530433int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530434#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
435 const u8 *peer,
436#else
Atul Mittal115287b2014-07-08 13:26:33 +0530437 u8 *peer,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530438#endif
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530439 tdls_req_params_t *tdls_peer_params,
Atul Mittal115287b2014-07-08 13:26:33 +0530440 cfg80211_exttdls_callback callback);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530441void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter,
442 hdd_context_t *pHddCtx);
443void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx);
Atul Mittal115287b2014-07-08 13:26:33 +0530444/*EXT TDLS*/
445int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530446#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
447 const tANI_U8* mac,
448#else
Atul Mittal115287b2014-07-08 13:26:33 +0530449 tANI_U8* mac,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530450#endif
Atul Mittal115287b2014-07-08 13:26:33 +0530451 tANI_S32 *state,
452 tANI_S32 *reason);
453void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer,
454 tANI_S32 *state,
455 tANI_S32 *reason);
456int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
457 cfg80211_exttdls_callback callback);
Agarwal Ashishef54a182014-12-16 15:07:31 +0530458int hdd_set_tdls_scan_type(hdd_adapter_t *pAdapter,
459 tANI_U8 *ptr);
Gopichand Nakkala3046fc92013-03-23 13:56:43 -0700460
Atul Mittalc0f739f2014-07-31 13:47:47 +0530461// tdlsoffchan
Pradeep Reddy POTTETIe309c152015-02-06 13:21:07 +0530462hddTdlsPeer_t *wlan_hdd_tdls_get_connected_peer(hdd_adapter_t *pAdapter);
Mahesh A Saptasagar170b5082015-02-16 18:50:54 +0530463
464int wlan_hdd_validate_tdls_context(hdd_context_t *pHddCtx, tdlsCtx_t *pTdlsCtx);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530465
Masti, Narayanraddi575ccc72015-08-17 18:04:57 +0530466void wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx);
Masti, Narayanraddi63d62352015-10-01 12:52:50 +0530467void wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb);
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530468#else
469static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter,
470 hdd_context_t *pHddCtx)
471{
472}
473static inline void
474wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx)
475{
476}
Masti, Narayanraddi575ccc72015-08-17 18:04:57 +0530477static inline void
478wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx)
479{
480}
Masti, Narayanraddi63d62352015-10-01 12:52:50 +0530481static inline void
482wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb)
483{
484}
Masti, Narayanraddifdde4d02015-04-16 14:41:51 +0530485#endif
Ganesh Kondabattinif3ba0972015-08-07 15:58:04 +0530486void wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(hdd_adapter_t *pAdapter,
487 u8 *mac, v_S7_t rssiAvg);
Ganesh Kondabattinicbfdc392015-09-11 19:12:59 +0530488
489
490tdlsConnInfo_t *wlan_hdd_get_conn_info(hdd_context_t *pHddCtx,
491 tANI_U8 idx);
492
493v_VOID_t wlan_hdd_tdls_initiator_wait_cb(v_PVOID_t userData);
494
Kiran V1ccee932012-12-12 14:49:46 -0800495#endif // __HDD_TDSL_H