blob: 2f966dd16c8757f9102a6a8723ec4f67ee8ad5dd [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Nitesh Shahb9d3dbb2017-01-16 16:37:20 +05302 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -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.
20 */
21
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
28#ifndef __HDD_TDLS_H
29#define __HDD_TDLS_H
30/**
31 * DOC: wlan_hdd_tdls.h
32 * WLAN Host Device Driver TDLS include file
33 */
34
Jeff Johnsonaf772ed2017-08-28 11:40:36 -070035struct hdd_context;
36
Nitesh Shah61c10d92016-10-19 19:29:15 +053037/*
Srinivas Girigowda17d35172017-03-25 15:56:25 -070038 * enum tdls_support_mode - TDLS support modes
Nitesh Shah61c10d92016-10-19 19:29:15 +053039 * @eTDLS_SUPPORT_NOT_ENABLED: TDLS support not enabled
40 * @eTDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond
41 * to the peer
42 * @eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
43 * but respond to the peer
44 * @eTDLS_SUPPORT_ENABLED: implicit trigger
45 * @eTDLS_SUPPORT_EXTERNAL_CONTROL: implicit trigger but only to a
46 * peer mac configured by user space.
47 */
Srinivas Girigowda17d35172017-03-25 15:56:25 -070048enum tdls_support_mode {
Nitesh Shah61c10d92016-10-19 19:29:15 +053049 eTDLS_SUPPORT_NOT_ENABLED = 0,
50 eTDLS_SUPPORT_DISABLED,
51 eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
52 eTDLS_SUPPORT_ENABLED,
53 eTDLS_SUPPORT_EXTERNAL_CONTROL,
Srinivas Girigowda17d35172017-03-25 15:56:25 -070054};
Nitesh Shah61c10d92016-10-19 19:29:15 +053055
Kabilan Kannan6ca98482017-02-14 13:26:15 -080056/**
57 * enum tdls_concerned_external_events - External events that affect TDLS
58 * @P2P_ROC_START: P2P remain on channel starts
59 * @P2P_ROC_END: P2P remain on channel ends
60 */
61enum tdls_concerned_external_events {
62 P2P_ROC_START,
63 P2P_ROC_END,
64};
65
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080066#ifdef FEATURE_WLAN_TDLS
67
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080068/*
69 * Before UpdateTimer expires, we want to timeout discovery response
70 * should not be more than 2000.
71 */
72#define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE 1000
73
74#define TDLS_CTX_MAGIC 0x54444c53 /* "TDLS" */
75
76#define TDLS_MAX_SCAN_SCHEDULE 10
77#define TDLS_MAX_SCAN_REJECT 5
78#define TDLS_DELAY_SCAN_PER_CONNECTION 100
79#define TDLS_MAX_CONNECTED_PEERS_TO_ALLOW_SCAN 1
80
81#define TDLS_IS_CONNECTED(peer) \
82 ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \
83 (eTDLS_LINK_TEARING == (peer)->link_status))
84
85/* Bit mask flag for tdls_option to FW */
86#define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */
87#define ENA_TDLS_BUFFER_STA (1 << 1) /* TDLS Buffer STA support */
88#define ENA_TDLS_SLEEP_STA (1 << 2) /* TDLS Sleep STA support */
89#define TDLS_SEC_OFFCHAN_OFFSET_0 0
90#define TDLS_SEC_OFFCHAN_OFFSET_40PLUS 40
91#define TDLS_SEC_OFFCHAN_OFFSET_40MINUS (-40)
92#define TDLS_SEC_OFFCHAN_OFFSET_80 80
93#define TDLS_SEC_OFFCHAN_OFFSET_160 160
94
95#define TDLS_PEER_LIST_SIZE 256
96
Kabilan Kannan36090ce2016-05-03 19:28:44 -070097#define TDLS_CT_MAC_AGE_OUT_TIME (30*60*1000) /* Age out time is 30 mins */
98
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099#define EXTTDLS_EVENT_BUF_SIZE (4096)
100
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700101#define TDLS_CT_MAC_MAX_TABLE_SIZE 8
102
Nitesh Shah98097b92016-12-28 17:16:58 +0530103/* Define the interval for 5 minutes */
104#define TDLS_ENABLE_CDS_FLUSH_INTERVAL 300000000
105
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800106/**
Nitesh Shah2b946fa2016-10-19 17:05:09 +0530107 * enum tdls_disable_source - TDLS disable sources
108 * @HDD_SET_TDLS_MODE_SOURCE_USER: disable from user
109 * @HDD_SET_TDLS_MODE_SOURCE_SCAN: disable during scan
110 * @HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL: disable during offchannel
111 * @HDD_SET_TDLS_MODE_SOURCE_BTC: disable during bluetooth
112 * @HDD_SET_TDLS_MODE_SOURCE_P2P: disable during p2p
113 */
114enum tdls_disable_source {
115 HDD_SET_TDLS_MODE_SOURCE_USER = 0,
116 HDD_SET_TDLS_MODE_SOURCE_SCAN,
117 HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL,
118 HDD_SET_TDLS_MODE_SOURCE_BTC,
119 HDD_SET_TDLS_MODE_SOURCE_P2P,
120};
121
122/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800123 * struct tdls_config_params_t - tdls config params
124 *
125 * @tdls: tdls
126 * @tx_period_t: tx period
127 * @tx_packet_n: tx packets number
128 * @discovery_tries_n: discovery tries
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700129 * @idle_timeout_t: idle traffic time out value
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800130 * @idle_packet_n: idle packet number
131 * @rssi_trigger_threshold: rssi trigger threshold
132 * @rssi_teardown_threshold: rssi tear down threshold
133 * @rssi_delta: rssi delta
134 */
135typedef struct {
136 uint32_t tdls;
137 uint32_t tx_period_t;
138 uint32_t tx_packet_n;
139 uint32_t discovery_tries_n;
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700140 uint32_t idle_timeout_t;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141 uint32_t idle_packet_n;
142 int32_t rssi_trigger_threshold;
143 int32_t rssi_teardown_threshold;
144 int32_t rssi_delta;
145} tdls_config_params_t;
146
147/**
148 * struct tdls_scan_context_t - tdls scan context
149 *
150 * @wiphy: pointer to wiphy structure
151 * @dev: pointer to netdev
152 * @scan_request: scan request
153 * @magic: magic
154 * @attempt: attempt
155 * @reject: reject
Nitesh Shah9ed1a9f2017-01-05 18:55:05 +0530156 * @source: scan request source(NL/Vendor scan)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800157 * @tdls_scan_work: delayed tdls scan work
158 */
159typedef struct {
160 struct wiphy *wiphy;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800161 struct cfg80211_scan_request *scan_request;
Nitesh Shah9ed1a9f2017-01-05 18:55:05 +0530162 uint32_t magic;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800163 int attempt;
164 int reject;
Nitesh Shah9ed1a9f2017-01-05 18:55:05 +0530165 uint8_t source;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800166 struct delayed_work tdls_scan_work;
167} tdls_scan_context_t;
168
169/**
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700170 * enum tdls_spatial_streams - TDLS spatial streams
171 * @TDLS_NSS_1x1_MODE: TDLS tx/rx spatial streams = 1
172 * @TDLS_NSS_2x2_MODE: TDLS tx/rx spatial streams = 2
173 */
174enum tdls_spatial_streams {
175 TDLS_NSS_1x1_MODE = 0,
176 TDLS_NSS_2x2_MODE = 0xff,
177};
178
179/**
Kabilan Kannanff89f742016-08-15 18:14:10 -0700180 * enum tdls_nss_transition_type - TDLS NSS transition states
181 * @TDLS_NSS_TRANSITION_UNKNOWN: default state
182 * @TDLS_NSS_TRANSITION_2x2_to_1x1: transition from 2x2 to 1x1 stream
183 * @TDLS_NSS_TRANSITION_1x1_to_2x2: transition from 1x1 to 2x2 stream
184 */
185enum tdls_nss_transition_type {
186 TDLS_NSS_TRANSITION_UNKNOWN = 0,
187 TDLS_NSS_TRANSITION_2x2_to_1x1,
188 TDLS_NSS_TRANSITION_1x1_to_2x2,
189};
190
191/**
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700192 * enum tdls_cap_type - tdls capability type
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800193 *
194 * @eTDLS_CAP_NOT_SUPPORTED: tdls not supported
195 * @eTDLS_CAP_UNKNOWN: unknown capability
196 * @eTDLS_CAP_SUPPORTED: tdls capability supported
197 */
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700198enum tdls_cap_type {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199 eTDLS_CAP_NOT_SUPPORTED = -1,
200 eTDLS_CAP_UNKNOWN = 0,
201 eTDLS_CAP_SUPPORTED = 1,
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700202};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800203
204/**
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700205 * enum tdls_link_status - tdls link status
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800206 *
207 * @eTDLS_LINK_IDLE: tdls link idle
208 * @eTDLS_LINK_DISCOVERING: tdls link discovering
209 * @eTDLS_LINK_DISCOVERED: tdls link discovered
210 * @eTDLS_LINK_CONNECTING: tdls link connecting
211 * @eTDLS_LINK_CONNECTED: tdls link connected
212 * @eTDLS_LINK_TEARING: tdls link tearing
213 */
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700214enum tdls_link_status {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800215 eTDLS_LINK_IDLE = 0,
216 eTDLS_LINK_DISCOVERING,
217 eTDLS_LINK_DISCOVERED,
218 eTDLS_LINK_CONNECTING,
219 eTDLS_LINK_CONNECTED,
220 eTDLS_LINK_TEARING,
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700221};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800222
223/**
Abhishek Singh4ef5fe02016-04-27 12:21:24 +0530224 * enum tdls_teardown_reason - Reason for TDLS teardown
225 * @eTDLS_TEARDOWN_EXT_CTRL: Reason ext ctrl.
226 * @eTDLS_TEARDOWN_CONCURRENCY: Reason concurrency.
227 * @eTDLS_TEARDOWN_RSSI_THRESHOLD: Reason rssi threshold.
228 * @eTDLS_TEARDOWN_TXRX_THRESHOLD: Reason txrx threshold.
229 * @eTDLS_TEARDOWN_BTCOEX: Reason BTCOEX.
230 * @eTDLS_TEARDOWN_SCAN: Reason scan.
231 * @eTDLS_TEARDOWN_BSS_DISCONNECT: Reason bss disconnected.
232 * @eTDLS_TEARDOWN_ANTENNA_SWITCH: Disconnected due to antenna switch
233 *
234 * Reason to indicate in diag event of tdls teardown.
235 */
236enum tdls_teardown_reason {
237 eTDLS_TEARDOWN_EXT_CTRL,
238 eTDLS_TEARDOWN_CONCURRENCY,
239 eTDLS_TEARDOWN_RSSI_THRESHOLD,
240 eTDLS_TEARDOWN_TXRX_THRESHOLD,
241 eTDLS_TEARDOWN_BTCOEX,
242 eTDLS_TEARDOWN_SCAN,
243 eTDLS_TEARDOWN_BSS_DISCONNECT,
244 eTDLS_TEARDOWN_ANTENNA_SWITCH,
245};
246
247/**
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700248 * enum tdls_link_reason - tdls link reason
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800249 *
250 * @eTDLS_LINK_SUCCESS: Success
251 * @eTDLS_LINK_UNSPECIFIED: Unspecified reason
252 * @eTDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS
253 * @eTDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band
254 * @eTDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct
255 * @eTDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore
256 */
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700257enum tdls_link_reason {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800258 eTDLS_LINK_SUCCESS,
259 eTDLS_LINK_UNSPECIFIED = -1,
260 eTDLS_LINK_NOT_SUPPORTED = -2,
261 eTDLS_LINK_UNSUPPORTED_BAND = -3,
262 eTDLS_LINK_NOT_BENEFICIAL = -4,
263 eTDLS_LINK_DROPPED_BY_REMOTE = -5
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700264};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265
266/**
267 * struct tdls_req_params_t - tdls request parameters
268 *
269 * @channel: channel hint, in channel number (NOT frequency)
270 * @global_operating_class: operating class to use
271 * @max_latency_ms: max latency that can be tolerated by apps
272 * @min_bandwidth_kbps: bandwidth required by apps, in kilo bits per second
273 */
274typedef struct {
275 int channel;
276 int global_operating_class;
277 int max_latency_ms;
278 int min_bandwidth_kbps;
279} tdls_req_params_t;
280
281/**
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700282 * enum tdls_state - tdls state
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800283 *
284 * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now
285 * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried
286 * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established
287 * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC
288 * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped
289 * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed
290 */
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700291enum tdls_state {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800292 QCA_WIFI_HAL_TDLS_DISABLED = 1,
293 QCA_WIFI_HAL_TDLS_ENABLED,
294 QCA_WIFI_HAL_TDLS_ESTABLISHED,
295 QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL,
296 QCA_WIFI_HAL_TDLS_DROPPED,
297 QCA_WIFI_HAL_TDLS_FAILED
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700298};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800299
300typedef int (*cfg80211_exttdls_callback)(const uint8_t *mac,
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +0530301 uint32_t opclass,
302 uint32_t channel,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303 uint32_t state,
304 int32_t reason, void *ctx);
305
306/**
307 * struct tdls_tx_tput_config_t - tdls tx throughput config
308 *
309 * @period: period
310 * @bytes: bytes
311 */
312typedef struct {
313 uint16_t period;
314 uint16_t bytes;
315} tdls_tx_tput_config_t;
316
317/**
318 * struct tdls_discovery_config_t - tdls discovery config
319 *
320 * @period: period
321 * @tries: number of tries
322 */
323typedef struct {
324 uint16_t period;
325 uint16_t tries;
326} tdls_discovery_config_t;
327
328/**
329 * struct tdls_rx_idle_config_t - tdls rx idle config
330 *
331 * @timeout: timeout
332 */
333typedef struct {
334 uint16_t timeout;
335} tdls_rx_idle_config_t;
336
337/**
338 * struct tdls_rssi_config_t - tdls rssi config
339 *
340 * @rssi_thres: rssi_thres
341 */
342typedef struct {
343 uint16_t rssi_thres;
344} tdls_rssi_config_t;
345
346struct _hddTdlsPeer_t;
347
348/**
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700349 * struct tdls_ct_mac_table - connection tracker peer mac address table
350 * @mac_address: peer mac address
351 * @tx_packet_cnt: number of tx pkts
352 * @rx_packet_cnt: number of rx pkts
353 * @peer_timestamp_ms: time stamp of latest peer traffic
354 */
355struct tdls_ct_mac_table {
356 struct qdf_mac_addr mac_address;
357 uint32_t tx_packet_cnt;
358 uint32_t rx_packet_cnt;
359 uint32_t peer_timestamp_ms;
360};
Kabilan Kannan163fd0b2016-06-08 15:21:51 -0700361
362/**
363 * struct tdls_set_state_db - set state command data base
364 * @set_state_cnt: tdls set state count
365 * @vdev_id: vdev id of last set state command
366 */
367struct tdls_set_state_info {
368 uint8_t set_state_cnt;
369 uint8_t vdev_id;
370};
371
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700372/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373 * struct tdlsCtx_t - tdls context
374 *
375 * @peer_list: peer list
376 * @pAdapter: pointer to adapter
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700377 * @peer_update_timer: connection tracker timer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800378 * @peerDiscoverTimer: peer discovery timer
379 * @peerDiscoveryTimeoutTimer: peer discovery timeout timer
380 * @threshold_config: threshold config
381 * @discovery_peer_cnt: discovery peer count
382 * @discovery_sent_cnt: discovery sent count
383 * @ap_rssi: ap rssi
384 * @curr_candidate: current candidate
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385 * @magic: magic
Nitesh Shah98097b92016-12-28 17:16:58 +0530386 * @last_flush_ts: last timestamp when flush logs was displayed.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800387 *
388 */
389typedef struct {
390 struct list_head peer_list[TDLS_PEER_LIST_SIZE];
391 hdd_adapter_t *pAdapter;
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700392 qdf_mc_timer_t peer_update_timer;
Anurag Chouhan210db072016-02-22 18:42:15 +0530393 qdf_mc_timer_t peerDiscoveryTimeoutTimer;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800394 tdls_config_params_t threshold_config;
395 int32_t discovery_peer_cnt;
396 uint32_t discovery_sent_cnt;
397 int8_t ap_rssi;
398 struct _hddTdlsPeer_t *curr_candidate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800399 uint32_t magic;
Nitesh Shah98097b92016-12-28 17:16:58 +0530400 uint64_t last_flush_ts;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800401} tdlsCtx_t;
402
403/**
404 * struct hddTdlsPeer_t - tdls peer data
405 *
406 * @node: node
407 * @pHddTdlsCtx: pointer to tdls context
408 * @peerMac: peer mac address
409 * @staId: station identifier
410 * @rssi: rssi
411 * @tdls_support: tdls support
412 * @link_status: tdls link status
413 * @signature: signature
414 * @is_responder: is responder
415 * @discovery_processed: discovery processed flag
416 * @discovery_attempt: discovery attempt
417 * @tx_pkt: tx packet
418 * @rx_pkt: rx packet
419 * @uapsdQueues: uapsd queues
420 * @maxSp: max sp
421 * @isBufSta: is buffer sta
422 * @isOffChannelSupported: is offchannel supported flag
423 * @supported_channels_len: supported channels length
424 * @supported_channels: supported channels
425 * @supported_oper_classes_len: supported operation classes length
426 * @supported_oper_classes: supported operation classes
427 * @isForcedPeer: is forced peer
428 * @op_class_for_pref_off_chan: op class for preferred off channel
429 * @pref_off_chan_num: preferred off channel number
430 * @op_class_for_pref_off_chan_is_set: op class for preferred off channel set
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700431 * @peer_idle_timer: time to check idle traffic in tdls peers
432 * @is_peer_idle_timer_initialised: Flag to check idle timer init
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700433 * @spatial_streams: Number of TX/RX spatial streams for TDLS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800434 * @reason: reason
435 * @state_change_notification: state change notification
Agrawal Ashishd3f22f62016-09-04 13:46:15 +0530436 * @qos: QOS capability of TDLS link
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800437 */
438typedef struct _hddTdlsPeer_t {
439 struct list_head node;
440 tdlsCtx_t *pHddTdlsCtx;
441 tSirMacAddr peerMac;
442 uint16_t staId;
443 int8_t rssi;
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700444 enum tdls_cap_type tdls_support;
445 enum tdls_link_status link_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800446 uint8_t signature;
447 uint8_t is_responder;
448 uint8_t discovery_processed;
449 uint16_t discovery_attempt;
450 uint16_t tx_pkt;
451 uint16_t rx_pkt;
452 uint8_t uapsdQueues;
453 uint8_t maxSp;
454 uint8_t isBufSta;
455 uint8_t isOffChannelSupported;
456 uint8_t supported_channels_len;
457 uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
458 uint8_t supported_oper_classes_len;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -0700459 uint8_t supported_oper_classes[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800460 bool isForcedPeer;
461 uint8_t op_class_for_pref_off_chan;
462 uint8_t pref_off_chan_num;
463 uint8_t op_class_for_pref_off_chan_is_set;
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700464 qdf_mc_timer_t peer_idle_timer;
465 bool is_peer_idle_timer_initialised;
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700466 uint8_t spatial_streams;
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700467 enum tdls_link_reason reason;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800468 cfg80211_exttdls_callback state_change_notification;
Agrawal Ashishd3f22f62016-09-04 13:46:15 +0530469 uint8_t qos;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800470} hddTdlsPeer_t;
471
472/**
473 * struct tdlsConnInfo_t - tdls connection info
474 *
475 * @sessionId: Session ID
476 * @staId: TDLS peer station id
477 * @peerMac: peer mac address
478 */
479typedef struct {
480 uint8_t sessionId;
481 uint8_t staId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530482 struct qdf_mac_addr peerMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483} tdlsConnInfo_t;
484
485/**
486 * struct tdlsInfo_t - tdls info
487 *
488 * @vdev_id: vdev id
489 * @tdls_state: tdls state
490 * @notification_interval_ms: notification interval in ms
491 * @tx_discovery_threshold: tx discovery threshold
492 * @tx_teardown_threshold: tx teardown threshold
493 * @rssi_teardown_threshold: rx teardown threshold
494 * @rssi_delta: rssi delta
495 * @tdls_options: tdls options
496 * @peer_traffic_ind_window: peer traffic indication window
497 * @peer_traffic_response_timeout: peer traffic response timeout
498 * @puapsd_mask: puapsd mask
499 * @puapsd_inactivity_time: puapsd inactivity time
500 * @puapsd_rx_frame_threshold: puapsd rx frame threshold
Kabilan Kannanca670be2015-11-23 01:56:12 -0800501 * @teardown_notification_ms: tdls teardown notification interval
Kabilan Kannan421714b2015-11-23 04:44:59 -0800502 * @tdls_peer_kickout_threshold: tdls packets threshold
503 * for peer kickout operation
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800504 */
505typedef struct {
506 uint32_t vdev_id;
507 uint32_t tdls_state;
508 uint32_t notification_interval_ms;
509 uint32_t tx_discovery_threshold;
510 uint32_t tx_teardown_threshold;
511 int32_t rssi_teardown_threshold;
512 int32_t rssi_delta;
513 uint32_t tdls_options;
514 uint32_t peer_traffic_ind_window;
515 uint32_t peer_traffic_response_timeout;
516 uint32_t puapsd_mask;
517 uint32_t puapsd_inactivity_time;
518 uint32_t puapsd_rx_frame_threshold;
Kabilan Kannanca670be2015-11-23 01:56:12 -0800519 uint32_t teardown_notification_ms;
Kabilan Kannan421714b2015-11-23 04:44:59 -0800520 uint32_t tdls_peer_kickout_threshold;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800521} tdlsInfo_t;
522
523int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter);
524
525void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter);
526
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800527void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, uint8_t *mac);
528
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800529int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, const uint8_t *mac,
530 uint8_t staId);
531
532hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter,
Nitesh Shah90a02e92017-02-01 15:28:03 +0530533 const uint8_t *mac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800534
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700535hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(struct hdd_context *pHddCtx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800536 const uint8_t *mac);
537
538int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter,
539 const uint8_t *mac,
540 tCsrTdlsLinkEstablishParams *
541 tdlsLinkEstablishParams);
542hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter,
Nitesh Shah379449e2017-01-31 19:11:29 +0530543 const uint8_t *mac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800544
545int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, const uint8_t *mac,
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700546 enum tdls_cap_type cap);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800547
548void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700549 enum tdls_link_status status,
550 enum tdls_link_reason reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800551void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter,
552 const uint8_t *mac,
Srinivas Girigowda17d35172017-03-25 15:56:25 -0700553 enum tdls_link_status linkStatus,
554 enum tdls_link_reason reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800555
556int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter,
557 const uint8_t *mac);
558
559int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter,
560 const uint8_t *mac,
561 tCsrStaParams *StaParams,
Nitesh Shah99934ac2016-09-05 15:54:08 +0530562 bool isBufSta, bool isOffChannelSupported,
563 bool is_qos_wmm_sta);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800564
565int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, const uint8_t *mac,
566 int8_t rxRssi);
567
568int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, const uint8_t *mac,
569 uint8_t responder);
570
571int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, const uint8_t *mac,
572 uint8_t uSignature);
573
574int wlan_hdd_tdls_set_params(struct net_device *dev,
575 tdls_config_params_t *config);
576
577int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, const uint8_t *mac);
578
579uint16_t wlan_hdd_tdls_connected_peers(hdd_adapter_t *pAdapter);
580
581int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf,
582 int buflen);
583
584void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter);
585
586void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter);
587
588void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter,
589 uint32_t statusCode);
590
Jeff Johnson414e9f32016-10-05 15:46:19 -0700591void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800592
593void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter);
594
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700595hddTdlsPeer_t *wlan_hdd_tdls_is_progress(struct hdd_context *pHddCtx,
Nitesh Shah90a02e92017-02-01 15:28:03 +0530596 const uint8_t *mac, uint8_t skip_self);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700598int wlan_hdd_tdls_copy_scan_context(struct hdd_context *pHddCtx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599 struct wiphy *wiphy,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800600 struct cfg80211_scan_request *request);
601
602int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
Nitesh Shah9ed1a9f2017-01-05 18:55:05 +0530603 struct cfg80211_scan_request *request,
604 uint8_t source);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800605
606void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
607
608void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter,
Anurag Chouhan210db072016-02-22 18:42:15 +0530609 qdf_mc_timer_t *timer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800610 uint32_t expirationTime);
611void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter,
612 hddTdlsPeer_t *curr_peer,
Nitesh Shah8816f572017-01-31 17:56:28 +0530613 uint16_t reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800614
Nitesh Shah983e8f52016-11-25 12:36:29 +0530615void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t *hdd_tdls_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616
617int wlan_hdd_tdls_set_extctrl_param(hdd_adapter_t *pAdapter,
618 const uint8_t *mac,
619 uint32_t chan,
620 uint32_t max_latency,
621 uint32_t op_class, uint32_t min_bandwidth);
622int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, const uint8_t *mac,
623 bool forcePeer);
624
Kabilan Kannan421714b2015-11-23 04:44:59 -0800625int wlan_hdd_tdls_update_peer_mac(hdd_adapter_t *adapter,
626 const uint8_t *mac,
627 uint32_t peer_state);
628
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800629int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
630 const uint8_t *peer);
631int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
632 const uint8_t *peer,
633 cfg80211_exttdls_callback callback,
634 uint32_t chan,
635 uint32_t max_latency,
636 uint32_t op_class,
637 uint32_t min_bandwidth);
638int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter,
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +0530639 const uint8_t *mac, uint32_t *opclass,
640 uint32_t *channel, uint32_t *state,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800641 int32_t *reason);
642void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer,
Masti, Narayanraddic4a7ab82015-11-25 15:41:10 +0530643 uint32_t *state, int32_t *reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800644int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
645 cfg80211_exttdls_callback callback);
646void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited,
647 bool tdls_chan_swit_prohibited);
648
649int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
650 struct net_device *dev, const uint8_t *mac,
651 bool update, tCsrStaParams *StaParams);
652
653int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
654 struct wireless_dev *wdev,
655 const void *data,
656 int data_len);
657
658int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy,
659 struct wireless_dev *wdev,
660 const void *data,
661 int data_len);
662
663int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy,
664 struct wireless_dev *wdev,
665 const void *data,
666 int data_len);
667
668#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
669int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
670 struct net_device *dev,
671 const uint8_t *peer,
672 enum nl80211_tdls_operation oper);
673#else
674int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
675 struct net_device *dev,
676 uint8_t *peer,
677 enum nl80211_tdls_operation oper);
678#endif
679
680#ifdef TDLS_MGMT_VERSION2
681int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
682 struct net_device *dev, u8 *peer,
683 u8 action_code, u8 dialog_token,
684 u16 status_code, u32 peer_capability,
685 const u8 *buf, size_t len);
686#else
687#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
688int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
689 struct net_device *dev, const uint8_t *peer,
690 uint8_t action_code, uint8_t dialog_token,
691 uint16_t status_code, uint32_t peer_capability,
692 bool initiator, const uint8_t *buf,
693 size_t len);
694#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
695int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
696 struct net_device *dev, const uint8_t *peer,
697 uint8_t action_code, uint8_t dialog_token,
698 uint16_t status_code, uint32_t peer_capability,
699 const uint8_t *buf, size_t len);
700#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
701int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
702 struct net_device *dev, uint8_t *peer,
703 uint8_t action_code, uint8_t dialog_token,
704 uint16_t status_code, uint32_t peer_capability,
705 const uint8_t *buf, size_t len);
706#else
707int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
708 struct net_device *dev, uint8_t *peer,
709 uint8_t action_code, uint8_t dialog_token,
710 uint16_t status_code, const uint8_t *buf,
711 size_t len);
712#endif
713#endif
714
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700715void hdd_update_tdls_ct_and_teardown_links(struct hdd_context *hdd_ctx);
716void wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800717
718hddTdlsPeer_t *wlan_hdd_tdls_find_first_connected_peer(hdd_adapter_t *adapter);
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700719int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, int offchannel);
720int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, int offchanoffset);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721int hdd_set_tdls_offchannelmode(hdd_adapter_t *adapter, int offchanmode);
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700722void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter,
723 struct sk_buff *skb);
724void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
725 struct sk_buff *skb);
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700726int hdd_set_tdls_scan_type(struct hdd_context *hdd_ctx, int val);
727void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr);
728void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx);
729int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx,
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700730 hdd_adapter_t *adapter,
731 uint32_t mode);
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700732/**
733 * wlan_hdd_tdls_notify_connect() - Update tdls state for every
734 * connect event.
735 * @adapter: hdd adapter
736 * @csr_roam_info: csr information
737 *
738 * After every connect event in the system, check whether TDLS
739 * can be enabled in the system. If TDLS can be enabled, update the
740 * TDLS state as needed.
741 *
742 * Return: None
743 */
744void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter,
745 tCsrRoamInfo *csr_roam_info);
Kabilan Kannan163fd0b2016-06-08 15:21:51 -0700746
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700747/**
748 * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every
749 * disconnect event.
750 * @adapter: hdd adapter
Nitesh Shahb9d3dbb2017-01-16 16:37:20 +0530751 * @lfr_roam: roaming case
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700752 *
753 * After every disconnect event in the system, check whether TDLS
754 * can be disabled/enabled in the system and update the
755 * TDLS state as needed.
756 *
757 * Return: None
758 */
Nitesh Shahb9d3dbb2017-01-16 16:37:20 +0530759void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter, bool lfr_roam);
Nitesh Shah61c10d92016-10-19 19:29:15 +0530760void wlan_hdd_change_tdls_mode(void *hdd_ctx);
Kabilan Kannan6ca98482017-02-14 13:26:15 -0800761
762/**
763 * hdd_tdls_notify_p2p_roc() - Notify p2p roc event to TDLS
764 * @hdd_ctx: ptr to hdd context.
765 * @event: P2P roc event that affect TDLS
766 *
767 * P2P roc events notified to TDLS to avoid overlap between P2P listen
768 * and TDLS operation.
769 * Based on P2P remain on channel event, TDLS mode will be
770 * updated and TDLS source timer started with timer period
771 * equivalent to P2P ROC interval to revert the TDLS mode.
772 *
773 * Return: None
774 */
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700775void hdd_tdls_notify_p2p_roc(struct hdd_context *hdd_ctx,
Kabilan Kannan6ca98482017-02-14 13:26:15 -0800776 enum tdls_concerned_external_events event);
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700777
Kabilan Kannand053aaf2016-10-26 02:06:14 -0700778/**
779 * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode
780 * @wiphy: pointer to wireless wiphy structure.
781 * @wdev: pointer to wireless_dev structure.
782 * @data: Pointer to the data to be passed via vendor interface
783 * @data_len:Length of the data to be passed
784 *
785 * Return: Return the Success or Failure code.
786 */
787int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy,
788 struct wireless_dev *wdev,
789 const void *data,
790 int data_len);
791
Frank Liud4b2fa02017-03-29 11:46:48 +0800792QDF_STATUS hdd_tdls_register_tdls_peer(void *userdata, uint32_t vdev_id,
793 const uint8_t *mac, uint16_t sta_id,
794 uint8_t ucastsig, uint8_t qos);
795
796QDF_STATUS hdd_tdls_deregister_tdl_peer(void *userdata,
797 uint32_t vdev_id, uint8_t sta_id);
798
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800799#else
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700800static inline void hdd_update_tdls_ct_and_teardown_links(struct hdd_context *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800801{
802}
803static inline void
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700804wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800805{
806}
807static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter)
808{
809}
Kabilan Kannan36090ce2016-05-03 19:28:44 -0700810static inline void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter,
811 struct sk_buff *skb)
812{
813}
814static inline void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
815 struct sk_buff *skb)
816{
817}
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700818static inline void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr) { }
819static inline void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx) { }
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700820
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700821static inline int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx,
Archana Ramachandran2ad7de22016-04-22 16:53:25 -0700822 hdd_adapter_t *adapter,
823 uint32_t mode)
Archana Ramachandrand5d2e922016-04-20 16:57:35 -0700824{
825 return 0;
826}
Kabilan Kannan163fd0b2016-06-08 15:21:51 -0700827static inline void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter,
828 bool tdls_prohibited,
829 bool tdls_chan_swit_prohibited)
830{
831}
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700832static inline void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter,
833 tCsrRoamInfo *csr_roam_info)
834{
835}
Nitesh Shahb9d3dbb2017-01-16 16:37:20 +0530836static inline void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter,
837 bool lfr_roam)
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700838{
839}
Kabilan Kannand053aaf2016-10-26 02:06:14 -0700840
841static inline int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy,
842 struct wireless_dev *wdev,
843 const void *data,
844 int data_len)
845{
846 return 0;
847}
848
Nitesh Shah61c10d92016-10-19 19:29:15 +0530849static inline void wlan_hdd_change_tdls_mode(void *hdd_ctx)
850{
851}
852static inline void
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700853hdd_tdls_notify_p2p_roc(struct hdd_context *hdd_ctx,
Kabilan Kannan6ca98482017-02-14 13:26:15 -0800854 enum tdls_concerned_external_events event)
Nitesh Shah61c10d92016-10-19 19:29:15 +0530855{
856}
Frank Liud4b2fa02017-03-29 11:46:48 +0800857
858static QDF_STATUS hdd_tdls_register_tdls_peer(void *userdata,
859 uint32_t vdev_id,
860 const uint8_t *mac,
861 uint16_t sta_id,
862 uint8_t ucastsig,
863 uint8_t qos)
864{
865}
866
867static QDF_STATUS hdd_tdls_deregister_tdl_peer(void *userdata,
868 uint32_t vdev_id, uint8_t sta_id)
869
870{
871}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800872#endif /* End of FEATURE_WLAN_TDLS */
873
Abhishek Singh4ef5fe02016-04-27 12:21:24 +0530874#ifdef FEATURE_WLAN_DIAG_SUPPORT
875void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
876 uint8_t *peer_mac);
Abhishek Singh74bcb0a2016-04-27 12:30:48 +0530877void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac,
878 uint8_t is_off_chan_supported,
879 uint8_t is_off_chan_configured,
880 uint8_t is_off_chan_established);
Abhishek Singhaf1d0c92016-04-27 13:46:59 +0530881void hdd_wlan_block_scan_by_tdls_event(void);
Abhishek Singh4ef5fe02016-04-27 12:21:24 +0530882#else
883static inline
884void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
885 uint8_t *peer_mac) {}
Abhishek Singh74bcb0a2016-04-27 12:30:48 +0530886static inline
887void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac,
888 uint8_t is_off_chan_supported,
889 uint8_t is_off_chan_configured,
890 uint8_t is_off_chan_established) {}
Abhishek Singhaf1d0c92016-04-27 13:46:59 +0530891static inline void hdd_wlan_block_scan_by_tdls_event(void) {}
Abhishek Singh4ef5fe02016-04-27 12:21:24 +0530892#endif /* FEATURE_WLAN_DIAG_SUPPORT */
Tushnim Bhattacharyya06697712017-03-15 10:22:47 -0700893bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode);
Jeff Johnsonaf772ed2017-08-28 11:40:36 -0700894void cds_set_tdls_ct_mode(struct hdd_context *hdd_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800895#endif /* __HDD_TDLS_H */