blob: 285bb7856769ff7d81b0dbcfcec1d17a80b350bb [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
3 *
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
35#ifdef FEATURE_WLAN_TDLS
36
37#define TDLS_SUB_DISCOVERY_PERIOD 100
38
39#define TDLS_MAX_DISCOVER_REQS_PER_TIMER 1
40
41#define TDLS_DISCOVERY_PERIOD 3600000
42
43#define TDLS_TX_STATS_PERIOD 3600000
44
45#define TDLS_IMPLICIT_TRIGGER_PKT_THRESHOLD 100
46
47#define TDLS_RX_IDLE_TIMEOUT 5000
48
49#define TDLS_RSSI_TRIGGER_HYSTERESIS 50
50
51/*
52 * Before UpdateTimer expires, we want to timeout discovery response
53 * should not be more than 2000.
54 */
55#define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE 1000
56
57#define TDLS_CTX_MAGIC 0x54444c53 /* "TDLS" */
58
59#define TDLS_MAX_SCAN_SCHEDULE 10
60#define TDLS_MAX_SCAN_REJECT 5
61#define TDLS_DELAY_SCAN_PER_CONNECTION 100
62#define TDLS_MAX_CONNECTED_PEERS_TO_ALLOW_SCAN 1
63
64#define TDLS_IS_CONNECTED(peer) \
65 ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \
66 (eTDLS_LINK_TEARING == (peer)->link_status))
67
68/* Bit mask flag for tdls_option to FW */
69#define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */
70#define ENA_TDLS_BUFFER_STA (1 << 1) /* TDLS Buffer STA support */
71#define ENA_TDLS_SLEEP_STA (1 << 2) /* TDLS Sleep STA support */
72#define TDLS_SEC_OFFCHAN_OFFSET_0 0
73#define TDLS_SEC_OFFCHAN_OFFSET_40PLUS 40
74#define TDLS_SEC_OFFCHAN_OFFSET_40MINUS (-40)
75#define TDLS_SEC_OFFCHAN_OFFSET_80 80
76#define TDLS_SEC_OFFCHAN_OFFSET_160 160
77
78#define TDLS_PEER_LIST_SIZE 256
79
80#define EXTTDLS_EVENT_BUF_SIZE (4096)
81
82/**
83 * struct tdls_config_params_t - tdls config params
84 *
85 * @tdls: tdls
86 * @tx_period_t: tx period
87 * @tx_packet_n: tx packets number
88 * @discovery_tries_n: discovery tries
89 * @idle_packet_n: idle packet number
90 * @rssi_trigger_threshold: rssi trigger threshold
91 * @rssi_teardown_threshold: rssi tear down threshold
92 * @rssi_delta: rssi delta
93 */
94typedef struct {
95 uint32_t tdls;
96 uint32_t tx_period_t;
97 uint32_t tx_packet_n;
98 uint32_t discovery_tries_n;
99 uint32_t idle_packet_n;
100 int32_t rssi_trigger_threshold;
101 int32_t rssi_teardown_threshold;
102 int32_t rssi_delta;
103} tdls_config_params_t;
104
105/**
106 * struct tdls_scan_context_t - tdls scan context
107 *
108 * @wiphy: pointer to wiphy structure
109 * @dev: pointer to netdev
110 * @scan_request: scan request
111 * @magic: magic
112 * @attempt: attempt
113 * @reject: reject
114 * @tdls_scan_work: delayed tdls scan work
115 */
116typedef struct {
117 struct wiphy *wiphy;
118#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
119 struct net_device *dev;
120#endif
121 struct cfg80211_scan_request *scan_request;
122 int magic;
123 int attempt;
124 int reject;
125 struct delayed_work tdls_scan_work;
126} tdls_scan_context_t;
127
128/**
129 * enum eTDLSSupportMode - tdls support mode
130 *
131 * @eTDLS_SUPPORT_NOT_ENABLED: tdls support not enabled
132 * @eTDLS_SUPPORT_DISABLED: suppress implicit trigger and not
133 * respond to the peer
134 * @eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
135 * but respond to the peer
136 * @eTDLS_SUPPORT_ENABLED: implicit trigger
137 */
138typedef enum {
139 eTDLS_SUPPORT_NOT_ENABLED = 0,
140 eTDLS_SUPPORT_DISABLED,
141 eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
142 eTDLS_SUPPORT_ENABLED,
143} eTDLSSupportMode;
144
145/**
146 * enum tTDLSCapType - tdls capability type
147 *
148 * @eTDLS_CAP_NOT_SUPPORTED: tdls not supported
149 * @eTDLS_CAP_UNKNOWN: unknown capability
150 * @eTDLS_CAP_SUPPORTED: tdls capability supported
151 */
152typedef enum eTDLSCapType {
153 eTDLS_CAP_NOT_SUPPORTED = -1,
154 eTDLS_CAP_UNKNOWN = 0,
155 eTDLS_CAP_SUPPORTED = 1,
156} tTDLSCapType;
157
158/**
159 * enum tTDLSLinkStatus - tdls link status
160 *
161 * @eTDLS_LINK_IDLE: tdls link idle
162 * @eTDLS_LINK_DISCOVERING: tdls link discovering
163 * @eTDLS_LINK_DISCOVERED: tdls link discovered
164 * @eTDLS_LINK_CONNECTING: tdls link connecting
165 * @eTDLS_LINK_CONNECTED: tdls link connected
166 * @eTDLS_LINK_TEARING: tdls link tearing
167 */
168typedef enum eTDLSLinkStatus {
169 eTDLS_LINK_IDLE = 0,
170 eTDLS_LINK_DISCOVERING,
171 eTDLS_LINK_DISCOVERED,
172 eTDLS_LINK_CONNECTING,
173 eTDLS_LINK_CONNECTED,
174 eTDLS_LINK_TEARING,
175} tTDLSLinkStatus;
176
177/**
178 * enum tTDLSLinkReason - tdls link reason
179 *
180 * @eTDLS_LINK_SUCCESS: Success
181 * @eTDLS_LINK_UNSPECIFIED: Unspecified reason
182 * @eTDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS
183 * @eTDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band
184 * @eTDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct
185 * @eTDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore
186 */
187typedef enum {
188 eTDLS_LINK_SUCCESS,
189 eTDLS_LINK_UNSPECIFIED = -1,
190 eTDLS_LINK_NOT_SUPPORTED = -2,
191 eTDLS_LINK_UNSUPPORTED_BAND = -3,
192 eTDLS_LINK_NOT_BENEFICIAL = -4,
193 eTDLS_LINK_DROPPED_BY_REMOTE = -5
194} tTDLSLinkReason;
195
196/**
197 * struct tdls_req_params_t - tdls request parameters
198 *
199 * @channel: channel hint, in channel number (NOT frequency)
200 * @global_operating_class: operating class to use
201 * @max_latency_ms: max latency that can be tolerated by apps
202 * @min_bandwidth_kbps: bandwidth required by apps, in kilo bits per second
203 */
204typedef struct {
205 int channel;
206 int global_operating_class;
207 int max_latency_ms;
208 int min_bandwidth_kbps;
209} tdls_req_params_t;
210
211/**
212 * enum tdls_state_t - tdls state
213 *
214 * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now
215 * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried
216 * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established
217 * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC
218 * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped
219 * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed
220 */
221typedef enum {
222 QCA_WIFI_HAL_TDLS_DISABLED = 1,
223 QCA_WIFI_HAL_TDLS_ENABLED,
224 QCA_WIFI_HAL_TDLS_ESTABLISHED,
225 QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL,
226 QCA_WIFI_HAL_TDLS_DROPPED,
227 QCA_WIFI_HAL_TDLS_FAILED
228} tdls_state_t;
229
230typedef int (*cfg80211_exttdls_callback)(const uint8_t *mac,
231 uint32_t state,
232 int32_t reason, void *ctx);
233
234/**
235 * struct tdls_tx_tput_config_t - tdls tx throughput config
236 *
237 * @period: period
238 * @bytes: bytes
239 */
240typedef struct {
241 uint16_t period;
242 uint16_t bytes;
243} tdls_tx_tput_config_t;
244
245/**
246 * struct tdls_discovery_config_t - tdls discovery config
247 *
248 * @period: period
249 * @tries: number of tries
250 */
251typedef struct {
252 uint16_t period;
253 uint16_t tries;
254} tdls_discovery_config_t;
255
256/**
257 * struct tdls_rx_idle_config_t - tdls rx idle config
258 *
259 * @timeout: timeout
260 */
261typedef struct {
262 uint16_t timeout;
263} tdls_rx_idle_config_t;
264
265/**
266 * struct tdls_rssi_config_t - tdls rssi config
267 *
268 * @rssi_thres: rssi_thres
269 */
270typedef struct {
271 uint16_t rssi_thres;
272} tdls_rssi_config_t;
273
274struct _hddTdlsPeer_t;
275
276/**
277 * struct tdlsCtx_t - tdls context
278 *
279 * @peer_list: peer list
280 * @pAdapter: pointer to adapter
281 * @peerDiscoverTimer: peer discovery timer
282 * @peerDiscoveryTimeoutTimer: peer discovery timeout timer
283 * @threshold_config: threshold config
284 * @discovery_peer_cnt: discovery peer count
285 * @discovery_sent_cnt: discovery sent count
286 * @ap_rssi: ap rssi
287 * @curr_candidate: current candidate
288 * @implicit_setup: implicit setup work queue
289 * @magic: magic
290 *
291 */
292typedef struct {
293 struct list_head peer_list[TDLS_PEER_LIST_SIZE];
294 hdd_adapter_t *pAdapter;
295 cdf_mc_timer_t peerDiscoveryTimeoutTimer;
296 tdls_config_params_t threshold_config;
297 int32_t discovery_peer_cnt;
298 uint32_t discovery_sent_cnt;
299 int8_t ap_rssi;
300 struct _hddTdlsPeer_t *curr_candidate;
301 struct work_struct implicit_setup;
302 uint32_t magic;
303} tdlsCtx_t;
304
305/**
306 * struct hddTdlsPeer_t - tdls peer data
307 *
308 * @node: node
309 * @pHddTdlsCtx: pointer to tdls context
310 * @peerMac: peer mac address
311 * @staId: station identifier
312 * @rssi: rssi
313 * @tdls_support: tdls support
314 * @link_status: tdls link status
315 * @signature: signature
316 * @is_responder: is responder
317 * @discovery_processed: discovery processed flag
318 * @discovery_attempt: discovery attempt
319 * @tx_pkt: tx packet
320 * @rx_pkt: rx packet
321 * @uapsdQueues: uapsd queues
322 * @maxSp: max sp
323 * @isBufSta: is buffer sta
324 * @isOffChannelSupported: is offchannel supported flag
325 * @supported_channels_len: supported channels length
326 * @supported_channels: supported channels
327 * @supported_oper_classes_len: supported operation classes length
328 * @supported_oper_classes: supported operation classes
329 * @isForcedPeer: is forced peer
330 * @op_class_for_pref_off_chan: op class for preferred off channel
331 * @pref_off_chan_num: preferred off channel number
332 * @op_class_for_pref_off_chan_is_set: op class for preferred off channel set
333 * @reason: reason
334 * @state_change_notification: state change notification
335 */
336typedef struct _hddTdlsPeer_t {
337 struct list_head node;
338 tdlsCtx_t *pHddTdlsCtx;
339 tSirMacAddr peerMac;
340 uint16_t staId;
341 int8_t rssi;
342 tTDLSCapType tdls_support;
343 tTDLSLinkStatus link_status;
344 uint8_t signature;
345 uint8_t is_responder;
346 uint8_t discovery_processed;
347 uint16_t discovery_attempt;
348 uint16_t tx_pkt;
349 uint16_t rx_pkt;
350 uint8_t uapsdQueues;
351 uint8_t maxSp;
352 uint8_t isBufSta;
353 uint8_t isOffChannelSupported;
354 uint8_t supported_channels_len;
355 uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
356 uint8_t supported_oper_classes_len;
357 uint8_t supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
358 bool isForcedPeer;
359 uint8_t op_class_for_pref_off_chan;
360 uint8_t pref_off_chan_num;
361 uint8_t op_class_for_pref_off_chan_is_set;
362 tTDLSLinkReason reason;
363 cfg80211_exttdls_callback state_change_notification;
364} hddTdlsPeer_t;
365
366/**
367 * struct tdlsConnInfo_t - tdls connection info
368 *
369 * @sessionId: Session ID
370 * @staId: TDLS peer station id
371 * @peerMac: peer mac address
372 */
373typedef struct {
374 uint8_t sessionId;
375 uint8_t staId;
376 struct cdf_mac_addr peerMac;
377} tdlsConnInfo_t;
378
379/**
380 * struct tdlsInfo_t - tdls info
381 *
382 * @vdev_id: vdev id
383 * @tdls_state: tdls state
384 * @notification_interval_ms: notification interval in ms
385 * @tx_discovery_threshold: tx discovery threshold
386 * @tx_teardown_threshold: tx teardown threshold
387 * @rssi_teardown_threshold: rx teardown threshold
388 * @rssi_delta: rssi delta
389 * @tdls_options: tdls options
390 * @peer_traffic_ind_window: peer traffic indication window
391 * @peer_traffic_response_timeout: peer traffic response timeout
392 * @puapsd_mask: puapsd mask
393 * @puapsd_inactivity_time: puapsd inactivity time
394 * @puapsd_rx_frame_threshold: puapsd rx frame threshold
395 */
396typedef struct {
397 uint32_t vdev_id;
398 uint32_t tdls_state;
399 uint32_t notification_interval_ms;
400 uint32_t tx_discovery_threshold;
401 uint32_t tx_teardown_threshold;
402 int32_t rssi_teardown_threshold;
403 int32_t rssi_delta;
404 uint32_t tdls_options;
405 uint32_t peer_traffic_ind_window;
406 uint32_t peer_traffic_response_timeout;
407 uint32_t puapsd_mask;
408 uint32_t puapsd_inactivity_time;
409 uint32_t puapsd_rx_frame_threshold;
410} tdlsInfo_t;
411
412int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter);
413
414void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter);
415
416void wlan_hdd_tdls_extract_da(struct sk_buff *skb, uint8_t *mac);
417
418void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, uint8_t *mac);
419
420int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter,
421 const uint8_t *mac, uint8_t tx);
422
423int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, const uint8_t *mac,
424 uint8_t staId);
425
426hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter,
427 const uint8_t *mac, bool mutexLock);
428
429hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx,
430 const uint8_t *mac);
431
432int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter,
433 const uint8_t *mac,
434 tCsrTdlsLinkEstablishParams *
435 tdlsLinkEstablishParams);
436hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter,
437 const uint8_t *mac);
438
439int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, const uint8_t *mac,
440 tTDLSCapType cap);
441
442void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
443 tTDLSLinkStatus status,
444 tTDLSLinkReason reason);
445void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter,
446 const uint8_t *mac,
447 tTDLSLinkStatus linkStatus,
448 tTDLSLinkReason reason);
449
450int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter,
451 const uint8_t *mac);
452
453int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter,
454 const uint8_t *mac,
455 tCsrStaParams *StaParams,
456 bool isBufSta, bool isOffChannelSupported);
457
458int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, const uint8_t *mac,
459 int8_t rxRssi);
460
461int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, const uint8_t *mac,
462 uint8_t responder);
463
464int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, const uint8_t *mac,
465 uint8_t uSignature);
466
467int wlan_hdd_tdls_set_params(struct net_device *dev,
468 tdls_config_params_t *config);
469
470int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, const uint8_t *mac);
471
472uint16_t wlan_hdd_tdls_connected_peers(hdd_adapter_t *pAdapter);
473
474int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf,
475 int buflen);
476
477void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter);
478
479void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter);
480
481void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter,
482 uint32_t statusCode);
483
484void wlan_hdd_tdls_tncrement_peer_count(hdd_adapter_t *pAdapter);
485
486void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter);
487
488hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx,
489 const uint8_t *mac, uint8_t skip_self);
490
491int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
492 struct wiphy *wiphy,
493#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
494 struct net_device *dev,
495#endif
496 struct cfg80211_scan_request *request);
497
498int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
499#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
500 struct net_device *dev,
501#endif
502 struct cfg80211_scan_request *request);
503
504void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
505
506void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter,
507 cdf_mc_timer_t *timer,
508 uint32_t expirationTime);
509void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter,
510 hddTdlsPeer_t *curr_peer,
511 uint16_t reason);
512
513void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t *pHddTdlsCtx,
514 hddTdlsPeer_t *curr_candidate);
515
516int wlan_hdd_tdls_set_extctrl_param(hdd_adapter_t *pAdapter,
517 const uint8_t *mac,
518 uint32_t chan,
519 uint32_t max_latency,
520 uint32_t op_class, uint32_t min_bandwidth);
521int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, const uint8_t *mac,
522 bool forcePeer);
523
524int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
525 const uint8_t *peer);
526int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
527 const uint8_t *peer,
528 cfg80211_exttdls_callback callback,
529 uint32_t chan,
530 uint32_t max_latency,
531 uint32_t op_class,
532 uint32_t min_bandwidth);
533int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter,
534 const uint8_t *mac, int32_t *state,
535 int32_t *reason);
536void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer,
537 int32_t *state, int32_t *reason);
538int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
539 cfg80211_exttdls_callback callback);
540void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited,
541 bool tdls_chan_swit_prohibited);
542
543int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
544 struct net_device *dev, const uint8_t *mac,
545 bool update, tCsrStaParams *StaParams);
546
547int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
548 struct wireless_dev *wdev,
549 const void *data,
550 int data_len);
551
552int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy,
553 struct wireless_dev *wdev,
554 const void *data,
555 int data_len);
556
557int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy,
558 struct wireless_dev *wdev,
559 const void *data,
560 int data_len);
561
562#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
563int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
564 struct net_device *dev,
565 const uint8_t *peer,
566 enum nl80211_tdls_operation oper);
567#else
568int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
569 struct net_device *dev,
570 uint8_t *peer,
571 enum nl80211_tdls_operation oper);
572#endif
573
574#ifdef TDLS_MGMT_VERSION2
575int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
576 struct net_device *dev, u8 *peer,
577 u8 action_code, u8 dialog_token,
578 u16 status_code, u32 peer_capability,
579 const u8 *buf, size_t len);
580#else
581#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
582int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
583 struct net_device *dev, const uint8_t *peer,
584 uint8_t action_code, uint8_t dialog_token,
585 uint16_t status_code, uint32_t peer_capability,
586 bool initiator, const uint8_t *buf,
587 size_t len);
588#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
589int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
590 struct net_device *dev, const uint8_t *peer,
591 uint8_t action_code, uint8_t dialog_token,
592 uint16_t status_code, uint32_t peer_capability,
593 const uint8_t *buf, size_t len);
594#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
595int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
596 struct net_device *dev, uint8_t *peer,
597 uint8_t action_code, uint8_t dialog_token,
598 uint16_t status_code, uint32_t peer_capability,
599 const uint8_t *buf, size_t len);
600#else
601int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
602 struct net_device *dev, uint8_t *peer,
603 uint8_t action_code, uint8_t dialog_token,
604 uint16_t status_code, const uint8_t *buf,
605 size_t len);
606#endif
607#endif
608
609void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
610 hdd_context_t *hddctx);
611void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx);
612
613hddTdlsPeer_t *wlan_hdd_tdls_find_first_connected_peer(hdd_adapter_t *adapter);
614int hdd_set_tdls_offchannel(hdd_context_t *hdd_ctx, int offchannel);
615int hdd_set_tdls_secoffchanneloffset(hdd_context_t *hdd_ctx, int offchanoffset);
616int hdd_set_tdls_offchannelmode(hdd_adapter_t *adapter, int offchanmode);
617int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val);
618
619#else
620static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
621 hdd_context_t *hddctx)
622{
623}
624static inline void
625wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
626{
627}
628static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter)
629{
630}
631#endif /* End of FEATURE_WLAN_TDLS */
632
633#endif /* __HDD_TDLS_H */