Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 37 | /* |
| 38 | * Before UpdateTimer expires, we want to timeout discovery response |
| 39 | * should not be more than 2000. |
| 40 | */ |
| 41 | #define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE 1000 |
| 42 | |
| 43 | #define TDLS_CTX_MAGIC 0x54444c53 /* "TDLS" */ |
| 44 | |
| 45 | #define TDLS_MAX_SCAN_SCHEDULE 10 |
| 46 | #define TDLS_MAX_SCAN_REJECT 5 |
| 47 | #define TDLS_DELAY_SCAN_PER_CONNECTION 100 |
| 48 | #define TDLS_MAX_CONNECTED_PEERS_TO_ALLOW_SCAN 1 |
| 49 | |
| 50 | #define TDLS_IS_CONNECTED(peer) \ |
| 51 | ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \ |
| 52 | (eTDLS_LINK_TEARING == (peer)->link_status)) |
| 53 | |
| 54 | /* Bit mask flag for tdls_option to FW */ |
| 55 | #define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */ |
| 56 | #define ENA_TDLS_BUFFER_STA (1 << 1) /* TDLS Buffer STA support */ |
| 57 | #define ENA_TDLS_SLEEP_STA (1 << 2) /* TDLS Sleep STA support */ |
| 58 | #define TDLS_SEC_OFFCHAN_OFFSET_0 0 |
| 59 | #define TDLS_SEC_OFFCHAN_OFFSET_40PLUS 40 |
| 60 | #define TDLS_SEC_OFFCHAN_OFFSET_40MINUS (-40) |
| 61 | #define TDLS_SEC_OFFCHAN_OFFSET_80 80 |
| 62 | #define TDLS_SEC_OFFCHAN_OFFSET_160 160 |
| 63 | |
| 64 | #define TDLS_PEER_LIST_SIZE 256 |
| 65 | |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 66 | #define TDLS_CT_MAC_AGE_OUT_TIME (30*60*1000) /* Age out time is 30 mins */ |
| 67 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 68 | #define EXTTDLS_EVENT_BUF_SIZE (4096) |
| 69 | |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 70 | #define TDLS_CT_MAC_MAX_TABLE_SIZE 8 |
| 71 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 72 | /** |
Nitesh Shah | 2b946fa | 2016-10-19 17:05:09 +0530 | [diff] [blame^] | 73 | * enum tdls_disable_source - TDLS disable sources |
| 74 | * @HDD_SET_TDLS_MODE_SOURCE_USER: disable from user |
| 75 | * @HDD_SET_TDLS_MODE_SOURCE_SCAN: disable during scan |
| 76 | * @HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL: disable during offchannel |
| 77 | * @HDD_SET_TDLS_MODE_SOURCE_BTC: disable during bluetooth |
| 78 | * @HDD_SET_TDLS_MODE_SOURCE_P2P: disable during p2p |
| 79 | */ |
| 80 | enum tdls_disable_source { |
| 81 | HDD_SET_TDLS_MODE_SOURCE_USER = 0, |
| 82 | HDD_SET_TDLS_MODE_SOURCE_SCAN, |
| 83 | HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL, |
| 84 | HDD_SET_TDLS_MODE_SOURCE_BTC, |
| 85 | HDD_SET_TDLS_MODE_SOURCE_P2P, |
| 86 | }; |
| 87 | |
| 88 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | * struct tdls_config_params_t - tdls config params |
| 90 | * |
| 91 | * @tdls: tdls |
| 92 | * @tx_period_t: tx period |
| 93 | * @tx_packet_n: tx packets number |
| 94 | * @discovery_tries_n: discovery tries |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 95 | * @idle_timeout_t: idle traffic time out value |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 96 | * @idle_packet_n: idle packet number |
| 97 | * @rssi_trigger_threshold: rssi trigger threshold |
| 98 | * @rssi_teardown_threshold: rssi tear down threshold |
| 99 | * @rssi_delta: rssi delta |
| 100 | */ |
| 101 | typedef struct { |
| 102 | uint32_t tdls; |
| 103 | uint32_t tx_period_t; |
| 104 | uint32_t tx_packet_n; |
| 105 | uint32_t discovery_tries_n; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 106 | uint32_t idle_timeout_t; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 107 | uint32_t idle_packet_n; |
| 108 | int32_t rssi_trigger_threshold; |
| 109 | int32_t rssi_teardown_threshold; |
| 110 | int32_t rssi_delta; |
| 111 | } tdls_config_params_t; |
| 112 | |
| 113 | /** |
| 114 | * struct tdls_scan_context_t - tdls scan context |
| 115 | * |
| 116 | * @wiphy: pointer to wiphy structure |
| 117 | * @dev: pointer to netdev |
| 118 | * @scan_request: scan request |
| 119 | * @magic: magic |
| 120 | * @attempt: attempt |
| 121 | * @reject: reject |
| 122 | * @tdls_scan_work: delayed tdls scan work |
| 123 | */ |
| 124 | typedef struct { |
| 125 | struct wiphy *wiphy; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 126 | struct cfg80211_scan_request *scan_request; |
| 127 | int magic; |
| 128 | int attempt; |
| 129 | int reject; |
| 130 | struct delayed_work tdls_scan_work; |
| 131 | } tdls_scan_context_t; |
| 132 | |
| 133 | /** |
| 134 | * enum eTDLSSupportMode - tdls support mode |
| 135 | * |
| 136 | * @eTDLS_SUPPORT_NOT_ENABLED: tdls support not enabled |
| 137 | * @eTDLS_SUPPORT_DISABLED: suppress implicit trigger and not |
| 138 | * respond to the peer |
| 139 | * @eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger, |
| 140 | * but respond to the peer |
| 141 | * @eTDLS_SUPPORT_ENABLED: implicit trigger |
Kabilan Kannan | 421714b | 2015-11-23 04:44:59 -0800 | [diff] [blame] | 142 | * @eTDLS_SUPPORT_EXTERNAL_CONTROL: External control means implicit |
| 143 | * trigger but only to a peer mac configured by user space. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 144 | */ |
| 145 | typedef enum { |
| 146 | eTDLS_SUPPORT_NOT_ENABLED = 0, |
| 147 | eTDLS_SUPPORT_DISABLED, |
| 148 | eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY, |
| 149 | eTDLS_SUPPORT_ENABLED, |
Kabilan Kannan | 421714b | 2015-11-23 04:44:59 -0800 | [diff] [blame] | 150 | eTDLS_SUPPORT_EXTERNAL_CONTROL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 151 | } eTDLSSupportMode; |
| 152 | |
| 153 | /** |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 154 | * enum tdls_spatial_streams - TDLS spatial streams |
| 155 | * @TDLS_NSS_1x1_MODE: TDLS tx/rx spatial streams = 1 |
| 156 | * @TDLS_NSS_2x2_MODE: TDLS tx/rx spatial streams = 2 |
| 157 | */ |
| 158 | enum tdls_spatial_streams { |
| 159 | TDLS_NSS_1x1_MODE = 0, |
| 160 | TDLS_NSS_2x2_MODE = 0xff, |
| 161 | }; |
| 162 | |
| 163 | /** |
Kabilan Kannan | ff89f74 | 2016-08-15 18:14:10 -0700 | [diff] [blame] | 164 | * enum tdls_nss_transition_type - TDLS NSS transition states |
| 165 | * @TDLS_NSS_TRANSITION_UNKNOWN: default state |
| 166 | * @TDLS_NSS_TRANSITION_2x2_to_1x1: transition from 2x2 to 1x1 stream |
| 167 | * @TDLS_NSS_TRANSITION_1x1_to_2x2: transition from 1x1 to 2x2 stream |
| 168 | */ |
| 169 | enum tdls_nss_transition_type { |
| 170 | TDLS_NSS_TRANSITION_UNKNOWN = 0, |
| 171 | TDLS_NSS_TRANSITION_2x2_to_1x1, |
| 172 | TDLS_NSS_TRANSITION_1x1_to_2x2, |
| 173 | }; |
| 174 | |
| 175 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 176 | * enum tTDLSCapType - tdls capability type |
| 177 | * |
| 178 | * @eTDLS_CAP_NOT_SUPPORTED: tdls not supported |
| 179 | * @eTDLS_CAP_UNKNOWN: unknown capability |
| 180 | * @eTDLS_CAP_SUPPORTED: tdls capability supported |
| 181 | */ |
| 182 | typedef enum eTDLSCapType { |
| 183 | eTDLS_CAP_NOT_SUPPORTED = -1, |
| 184 | eTDLS_CAP_UNKNOWN = 0, |
| 185 | eTDLS_CAP_SUPPORTED = 1, |
| 186 | } tTDLSCapType; |
| 187 | |
| 188 | /** |
| 189 | * enum tTDLSLinkStatus - tdls link status |
| 190 | * |
| 191 | * @eTDLS_LINK_IDLE: tdls link idle |
| 192 | * @eTDLS_LINK_DISCOVERING: tdls link discovering |
| 193 | * @eTDLS_LINK_DISCOVERED: tdls link discovered |
| 194 | * @eTDLS_LINK_CONNECTING: tdls link connecting |
| 195 | * @eTDLS_LINK_CONNECTED: tdls link connected |
| 196 | * @eTDLS_LINK_TEARING: tdls link tearing |
| 197 | */ |
| 198 | typedef enum eTDLSLinkStatus { |
| 199 | eTDLS_LINK_IDLE = 0, |
| 200 | eTDLS_LINK_DISCOVERING, |
| 201 | eTDLS_LINK_DISCOVERED, |
| 202 | eTDLS_LINK_CONNECTING, |
| 203 | eTDLS_LINK_CONNECTED, |
| 204 | eTDLS_LINK_TEARING, |
| 205 | } tTDLSLinkStatus; |
| 206 | |
| 207 | /** |
Abhishek Singh | 4ef5fe0 | 2016-04-27 12:21:24 +0530 | [diff] [blame] | 208 | * enum tdls_teardown_reason - Reason for TDLS teardown |
| 209 | * @eTDLS_TEARDOWN_EXT_CTRL: Reason ext ctrl. |
| 210 | * @eTDLS_TEARDOWN_CONCURRENCY: Reason concurrency. |
| 211 | * @eTDLS_TEARDOWN_RSSI_THRESHOLD: Reason rssi threshold. |
| 212 | * @eTDLS_TEARDOWN_TXRX_THRESHOLD: Reason txrx threshold. |
| 213 | * @eTDLS_TEARDOWN_BTCOEX: Reason BTCOEX. |
| 214 | * @eTDLS_TEARDOWN_SCAN: Reason scan. |
| 215 | * @eTDLS_TEARDOWN_BSS_DISCONNECT: Reason bss disconnected. |
| 216 | * @eTDLS_TEARDOWN_ANTENNA_SWITCH: Disconnected due to antenna switch |
| 217 | * |
| 218 | * Reason to indicate in diag event of tdls teardown. |
| 219 | */ |
| 220 | enum tdls_teardown_reason { |
| 221 | eTDLS_TEARDOWN_EXT_CTRL, |
| 222 | eTDLS_TEARDOWN_CONCURRENCY, |
| 223 | eTDLS_TEARDOWN_RSSI_THRESHOLD, |
| 224 | eTDLS_TEARDOWN_TXRX_THRESHOLD, |
| 225 | eTDLS_TEARDOWN_BTCOEX, |
| 226 | eTDLS_TEARDOWN_SCAN, |
| 227 | eTDLS_TEARDOWN_BSS_DISCONNECT, |
| 228 | eTDLS_TEARDOWN_ANTENNA_SWITCH, |
| 229 | }; |
| 230 | |
| 231 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 232 | * enum tTDLSLinkReason - tdls link reason |
| 233 | * |
| 234 | * @eTDLS_LINK_SUCCESS: Success |
| 235 | * @eTDLS_LINK_UNSPECIFIED: Unspecified reason |
| 236 | * @eTDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS |
| 237 | * @eTDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band |
| 238 | * @eTDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct |
| 239 | * @eTDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore |
| 240 | */ |
| 241 | typedef enum { |
| 242 | eTDLS_LINK_SUCCESS, |
| 243 | eTDLS_LINK_UNSPECIFIED = -1, |
| 244 | eTDLS_LINK_NOT_SUPPORTED = -2, |
| 245 | eTDLS_LINK_UNSUPPORTED_BAND = -3, |
| 246 | eTDLS_LINK_NOT_BENEFICIAL = -4, |
| 247 | eTDLS_LINK_DROPPED_BY_REMOTE = -5 |
| 248 | } tTDLSLinkReason; |
| 249 | |
| 250 | /** |
| 251 | * struct tdls_req_params_t - tdls request parameters |
| 252 | * |
| 253 | * @channel: channel hint, in channel number (NOT frequency) |
| 254 | * @global_operating_class: operating class to use |
| 255 | * @max_latency_ms: max latency that can be tolerated by apps |
| 256 | * @min_bandwidth_kbps: bandwidth required by apps, in kilo bits per second |
| 257 | */ |
| 258 | typedef struct { |
| 259 | int channel; |
| 260 | int global_operating_class; |
| 261 | int max_latency_ms; |
| 262 | int min_bandwidth_kbps; |
| 263 | } tdls_req_params_t; |
| 264 | |
| 265 | /** |
| 266 | * enum tdls_state_t - tdls state |
| 267 | * |
| 268 | * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now |
| 269 | * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried |
| 270 | * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established |
| 271 | * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC |
| 272 | * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped |
| 273 | * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed |
| 274 | */ |
| 275 | typedef enum { |
| 276 | QCA_WIFI_HAL_TDLS_DISABLED = 1, |
| 277 | QCA_WIFI_HAL_TDLS_ENABLED, |
| 278 | QCA_WIFI_HAL_TDLS_ESTABLISHED, |
| 279 | QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL, |
| 280 | QCA_WIFI_HAL_TDLS_DROPPED, |
| 281 | QCA_WIFI_HAL_TDLS_FAILED |
| 282 | } tdls_state_t; |
| 283 | |
| 284 | typedef int (*cfg80211_exttdls_callback)(const uint8_t *mac, |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 285 | uint32_t opclass, |
| 286 | uint32_t channel, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 287 | uint32_t state, |
| 288 | int32_t reason, void *ctx); |
| 289 | |
| 290 | /** |
| 291 | * struct tdls_tx_tput_config_t - tdls tx throughput config |
| 292 | * |
| 293 | * @period: period |
| 294 | * @bytes: bytes |
| 295 | */ |
| 296 | typedef struct { |
| 297 | uint16_t period; |
| 298 | uint16_t bytes; |
| 299 | } tdls_tx_tput_config_t; |
| 300 | |
| 301 | /** |
| 302 | * struct tdls_discovery_config_t - tdls discovery config |
| 303 | * |
| 304 | * @period: period |
| 305 | * @tries: number of tries |
| 306 | */ |
| 307 | typedef struct { |
| 308 | uint16_t period; |
| 309 | uint16_t tries; |
| 310 | } tdls_discovery_config_t; |
| 311 | |
| 312 | /** |
| 313 | * struct tdls_rx_idle_config_t - tdls rx idle config |
| 314 | * |
| 315 | * @timeout: timeout |
| 316 | */ |
| 317 | typedef struct { |
| 318 | uint16_t timeout; |
| 319 | } tdls_rx_idle_config_t; |
| 320 | |
| 321 | /** |
| 322 | * struct tdls_rssi_config_t - tdls rssi config |
| 323 | * |
| 324 | * @rssi_thres: rssi_thres |
| 325 | */ |
| 326 | typedef struct { |
| 327 | uint16_t rssi_thres; |
| 328 | } tdls_rssi_config_t; |
| 329 | |
| 330 | struct _hddTdlsPeer_t; |
| 331 | |
| 332 | /** |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 333 | * struct tdls_ct_mac_table - connection tracker peer mac address table |
| 334 | * @mac_address: peer mac address |
| 335 | * @tx_packet_cnt: number of tx pkts |
| 336 | * @rx_packet_cnt: number of rx pkts |
| 337 | * @peer_timestamp_ms: time stamp of latest peer traffic |
| 338 | */ |
| 339 | struct tdls_ct_mac_table { |
| 340 | struct qdf_mac_addr mac_address; |
| 341 | uint32_t tx_packet_cnt; |
| 342 | uint32_t rx_packet_cnt; |
| 343 | uint32_t peer_timestamp_ms; |
| 344 | }; |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 345 | |
| 346 | /** |
| 347 | * struct tdls_set_state_db - set state command data base |
| 348 | * @set_state_cnt: tdls set state count |
| 349 | * @vdev_id: vdev id of last set state command |
| 350 | */ |
| 351 | struct tdls_set_state_info { |
| 352 | uint8_t set_state_cnt; |
| 353 | uint8_t vdev_id; |
| 354 | }; |
| 355 | |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 356 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 357 | * struct tdlsCtx_t - tdls context |
| 358 | * |
| 359 | * @peer_list: peer list |
| 360 | * @pAdapter: pointer to adapter |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 361 | * @peer_update_timer: connection tracker timer |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 362 | * @peerDiscoverTimer: peer discovery timer |
| 363 | * @peerDiscoveryTimeoutTimer: peer discovery timeout timer |
| 364 | * @threshold_config: threshold config |
| 365 | * @discovery_peer_cnt: discovery peer count |
| 366 | * @discovery_sent_cnt: discovery sent count |
| 367 | * @ap_rssi: ap rssi |
| 368 | * @curr_candidate: current candidate |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 369 | * @ct_peer_mac_table: linear mac address table for counting the packets |
| 370 | * @valid_mac_entries: number of valid mac entry in @ct_peer_mac_table |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 371 | * @magic: magic |
| 372 | * |
| 373 | */ |
| 374 | typedef struct { |
| 375 | struct list_head peer_list[TDLS_PEER_LIST_SIZE]; |
| 376 | hdd_adapter_t *pAdapter; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 377 | qdf_mc_timer_t peer_update_timer; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 378 | qdf_mc_timer_t peerDiscoveryTimeoutTimer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 379 | tdls_config_params_t threshold_config; |
| 380 | int32_t discovery_peer_cnt; |
| 381 | uint32_t discovery_sent_cnt; |
| 382 | int8_t ap_rssi; |
| 383 | struct _hddTdlsPeer_t *curr_candidate; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 384 | struct tdls_ct_mac_table ct_peer_mac_table[TDLS_CT_MAC_MAX_TABLE_SIZE]; |
| 385 | uint8_t valid_mac_entries; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 386 | uint32_t magic; |
| 387 | } tdlsCtx_t; |
| 388 | |
| 389 | /** |
| 390 | * struct hddTdlsPeer_t - tdls peer data |
| 391 | * |
| 392 | * @node: node |
| 393 | * @pHddTdlsCtx: pointer to tdls context |
| 394 | * @peerMac: peer mac address |
| 395 | * @staId: station identifier |
| 396 | * @rssi: rssi |
| 397 | * @tdls_support: tdls support |
| 398 | * @link_status: tdls link status |
| 399 | * @signature: signature |
| 400 | * @is_responder: is responder |
| 401 | * @discovery_processed: discovery processed flag |
| 402 | * @discovery_attempt: discovery attempt |
| 403 | * @tx_pkt: tx packet |
| 404 | * @rx_pkt: rx packet |
| 405 | * @uapsdQueues: uapsd queues |
| 406 | * @maxSp: max sp |
| 407 | * @isBufSta: is buffer sta |
| 408 | * @isOffChannelSupported: is offchannel supported flag |
| 409 | * @supported_channels_len: supported channels length |
| 410 | * @supported_channels: supported channels |
| 411 | * @supported_oper_classes_len: supported operation classes length |
| 412 | * @supported_oper_classes: supported operation classes |
| 413 | * @isForcedPeer: is forced peer |
| 414 | * @op_class_for_pref_off_chan: op class for preferred off channel |
| 415 | * @pref_off_chan_num: preferred off channel number |
| 416 | * @op_class_for_pref_off_chan_is_set: op class for preferred off channel set |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 417 | * @peer_idle_timer: time to check idle traffic in tdls peers |
| 418 | * @is_peer_idle_timer_initialised: Flag to check idle timer init |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 419 | * @spatial_streams: Number of TX/RX spatial streams for TDLS |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 420 | * @reason: reason |
| 421 | * @state_change_notification: state change notification |
Agrawal Ashish | d3f22f6 | 2016-09-04 13:46:15 +0530 | [diff] [blame] | 422 | * @qos: QOS capability of TDLS link |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | */ |
| 424 | typedef struct _hddTdlsPeer_t { |
| 425 | struct list_head node; |
| 426 | tdlsCtx_t *pHddTdlsCtx; |
| 427 | tSirMacAddr peerMac; |
| 428 | uint16_t staId; |
| 429 | int8_t rssi; |
| 430 | tTDLSCapType tdls_support; |
| 431 | tTDLSLinkStatus link_status; |
| 432 | uint8_t signature; |
| 433 | uint8_t is_responder; |
| 434 | uint8_t discovery_processed; |
| 435 | uint16_t discovery_attempt; |
| 436 | uint16_t tx_pkt; |
| 437 | uint16_t rx_pkt; |
| 438 | uint8_t uapsdQueues; |
| 439 | uint8_t maxSp; |
| 440 | uint8_t isBufSta; |
| 441 | uint8_t isOffChannelSupported; |
| 442 | uint8_t supported_channels_len; |
| 443 | uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS]; |
| 444 | uint8_t supported_oper_classes_len; |
Naveen Rawat | 3b6068c | 2016-04-14 19:01:06 -0700 | [diff] [blame] | 445 | uint8_t supported_oper_classes[CDS_MAX_SUPP_OPER_CLASSES]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 446 | bool isForcedPeer; |
| 447 | uint8_t op_class_for_pref_off_chan; |
| 448 | uint8_t pref_off_chan_num; |
| 449 | uint8_t op_class_for_pref_off_chan_is_set; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 450 | qdf_mc_timer_t peer_idle_timer; |
| 451 | bool is_peer_idle_timer_initialised; |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 452 | uint8_t spatial_streams; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 453 | tTDLSLinkReason reason; |
| 454 | cfg80211_exttdls_callback state_change_notification; |
Agrawal Ashish | d3f22f6 | 2016-09-04 13:46:15 +0530 | [diff] [blame] | 455 | uint8_t qos; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 456 | } hddTdlsPeer_t; |
| 457 | |
| 458 | /** |
| 459 | * struct tdlsConnInfo_t - tdls connection info |
| 460 | * |
| 461 | * @sessionId: Session ID |
| 462 | * @staId: TDLS peer station id |
| 463 | * @peerMac: peer mac address |
| 464 | */ |
| 465 | typedef struct { |
| 466 | uint8_t sessionId; |
| 467 | uint8_t staId; |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 468 | struct qdf_mac_addr peerMac; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 469 | } tdlsConnInfo_t; |
| 470 | |
| 471 | /** |
| 472 | * struct tdlsInfo_t - tdls info |
| 473 | * |
| 474 | * @vdev_id: vdev id |
| 475 | * @tdls_state: tdls state |
| 476 | * @notification_interval_ms: notification interval in ms |
| 477 | * @tx_discovery_threshold: tx discovery threshold |
| 478 | * @tx_teardown_threshold: tx teardown threshold |
| 479 | * @rssi_teardown_threshold: rx teardown threshold |
| 480 | * @rssi_delta: rssi delta |
| 481 | * @tdls_options: tdls options |
| 482 | * @peer_traffic_ind_window: peer traffic indication window |
| 483 | * @peer_traffic_response_timeout: peer traffic response timeout |
| 484 | * @puapsd_mask: puapsd mask |
| 485 | * @puapsd_inactivity_time: puapsd inactivity time |
| 486 | * @puapsd_rx_frame_threshold: puapsd rx frame threshold |
Kabilan Kannan | ca670be | 2015-11-23 01:56:12 -0800 | [diff] [blame] | 487 | * @teardown_notification_ms: tdls teardown notification interval |
Kabilan Kannan | 421714b | 2015-11-23 04:44:59 -0800 | [diff] [blame] | 488 | * @tdls_peer_kickout_threshold: tdls packets threshold |
| 489 | * for peer kickout operation |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 490 | */ |
| 491 | typedef struct { |
| 492 | uint32_t vdev_id; |
| 493 | uint32_t tdls_state; |
| 494 | uint32_t notification_interval_ms; |
| 495 | uint32_t tx_discovery_threshold; |
| 496 | uint32_t tx_teardown_threshold; |
| 497 | int32_t rssi_teardown_threshold; |
| 498 | int32_t rssi_delta; |
| 499 | uint32_t tdls_options; |
| 500 | uint32_t peer_traffic_ind_window; |
| 501 | uint32_t peer_traffic_response_timeout; |
| 502 | uint32_t puapsd_mask; |
| 503 | uint32_t puapsd_inactivity_time; |
| 504 | uint32_t puapsd_rx_frame_threshold; |
Kabilan Kannan | ca670be | 2015-11-23 01:56:12 -0800 | [diff] [blame] | 505 | uint32_t teardown_notification_ms; |
Kabilan Kannan | 421714b | 2015-11-23 04:44:59 -0800 | [diff] [blame] | 506 | uint32_t tdls_peer_kickout_threshold; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 507 | } tdlsInfo_t; |
| 508 | |
| 509 | int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter); |
| 510 | |
| 511 | void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter); |
| 512 | |
| 513 | void wlan_hdd_tdls_extract_da(struct sk_buff *skb, uint8_t *mac); |
| 514 | |
| 515 | void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, uint8_t *mac); |
| 516 | |
| 517 | int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter, |
| 518 | const uint8_t *mac, uint8_t tx); |
| 519 | |
| 520 | int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 521 | uint8_t staId); |
| 522 | |
| 523 | hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, |
| 524 | const uint8_t *mac, bool mutexLock); |
| 525 | |
| 526 | hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, |
| 527 | const uint8_t *mac); |
| 528 | |
| 529 | int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, |
| 530 | const uint8_t *mac, |
| 531 | tCsrTdlsLinkEstablishParams * |
| 532 | tdlsLinkEstablishParams); |
| 533 | hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 534 | const uint8_t *mac, |
| 535 | bool need_mutex_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 536 | |
| 537 | int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 538 | tTDLSCapType cap); |
| 539 | |
| 540 | void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, |
| 541 | tTDLSLinkStatus status, |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 542 | tTDLSLinkReason reason, |
| 543 | bool lock_needed); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 544 | void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, |
| 545 | const uint8_t *mac, |
| 546 | tTDLSLinkStatus linkStatus, |
| 547 | tTDLSLinkReason reason); |
| 548 | |
| 549 | int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, |
| 550 | const uint8_t *mac); |
| 551 | |
| 552 | int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter, |
| 553 | const uint8_t *mac, |
| 554 | tCsrStaParams *StaParams, |
Nitesh Shah | 99934ac | 2016-09-05 15:54:08 +0530 | [diff] [blame] | 555 | bool isBufSta, bool isOffChannelSupported, |
| 556 | bool is_qos_wmm_sta); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 557 | |
| 558 | int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 559 | int8_t rxRssi); |
| 560 | |
| 561 | int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 562 | uint8_t responder); |
| 563 | |
| 564 | int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 565 | uint8_t uSignature); |
| 566 | |
| 567 | int wlan_hdd_tdls_set_params(struct net_device *dev, |
| 568 | tdls_config_params_t *config); |
| 569 | |
| 570 | int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, const uint8_t *mac); |
| 571 | |
| 572 | uint16_t wlan_hdd_tdls_connected_peers(hdd_adapter_t *pAdapter); |
| 573 | |
| 574 | int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, |
| 575 | int buflen); |
| 576 | |
| 577 | void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter); |
| 578 | |
| 579 | void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter); |
| 580 | |
| 581 | void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, |
| 582 | uint32_t statusCode); |
| 583 | |
Jeff Johnson | 414e9f3 | 2016-10-05 15:46:19 -0700 | [diff] [blame] | 584 | void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 585 | |
| 586 | void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter); |
| 587 | |
| 588 | hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 589 | const uint8_t *mac, uint8_t skip_self, |
| 590 | bool need_lock); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 591 | |
| 592 | int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx, |
| 593 | struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 594 | struct cfg80211_scan_request *request); |
| 595 | |
| 596 | int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | struct cfg80211_scan_request *request); |
| 598 | |
| 599 | void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter); |
| 600 | |
| 601 | void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter, |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 602 | qdf_mc_timer_t *timer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 603 | uint32_t expirationTime); |
| 604 | void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, |
| 605 | hddTdlsPeer_t *curr_peer, |
| 606 | uint16_t reason); |
| 607 | |
Nitesh Shah | 983e8f5 | 2016-11-25 12:36:29 +0530 | [diff] [blame] | 608 | void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t *hdd_tdls_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 609 | |
| 610 | int wlan_hdd_tdls_set_extctrl_param(hdd_adapter_t *pAdapter, |
| 611 | const uint8_t *mac, |
| 612 | uint32_t chan, |
| 613 | uint32_t max_latency, |
| 614 | uint32_t op_class, uint32_t min_bandwidth); |
| 615 | int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, const uint8_t *mac, |
| 616 | bool forcePeer); |
| 617 | |
Kabilan Kannan | 421714b | 2015-11-23 04:44:59 -0800 | [diff] [blame] | 618 | int wlan_hdd_tdls_update_peer_mac(hdd_adapter_t *adapter, |
| 619 | const uint8_t *mac, |
| 620 | uint32_t peer_state); |
| 621 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 622 | int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, |
| 623 | const uint8_t *peer); |
| 624 | int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, |
| 625 | const uint8_t *peer, |
| 626 | cfg80211_exttdls_callback callback, |
| 627 | uint32_t chan, |
| 628 | uint32_t max_latency, |
| 629 | uint32_t op_class, |
| 630 | uint32_t min_bandwidth); |
| 631 | int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter, |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 632 | const uint8_t *mac, uint32_t *opclass, |
| 633 | uint32_t *channel, uint32_t *state, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 634 | int32_t *reason); |
| 635 | void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 636 | uint32_t *state, int32_t *reason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 637 | int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer, |
| 638 | cfg80211_exttdls_callback callback); |
| 639 | void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, |
| 640 | bool tdls_chan_swit_prohibited); |
| 641 | |
| 642 | int wlan_hdd_tdls_add_station(struct wiphy *wiphy, |
| 643 | struct net_device *dev, const uint8_t *mac, |
| 644 | bool update, tCsrStaParams *StaParams); |
| 645 | |
| 646 | int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, |
| 647 | struct wireless_dev *wdev, |
| 648 | const void *data, |
| 649 | int data_len); |
| 650 | |
| 651 | int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, |
| 652 | struct wireless_dev *wdev, |
| 653 | const void *data, |
| 654 | int data_len); |
| 655 | |
| 656 | int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, |
| 657 | struct wireless_dev *wdev, |
| 658 | const void *data, |
| 659 | int data_len); |
| 660 | |
| 661 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 662 | int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, |
| 663 | struct net_device *dev, |
| 664 | const uint8_t *peer, |
| 665 | enum nl80211_tdls_operation oper); |
| 666 | #else |
| 667 | int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, |
| 668 | struct net_device *dev, |
| 669 | uint8_t *peer, |
| 670 | enum nl80211_tdls_operation oper); |
| 671 | #endif |
| 672 | |
| 673 | #ifdef TDLS_MGMT_VERSION2 |
| 674 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 675 | struct net_device *dev, u8 *peer, |
| 676 | u8 action_code, u8 dialog_token, |
| 677 | u16 status_code, u32 peer_capability, |
| 678 | const u8 *buf, size_t len); |
| 679 | #else |
| 680 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) |
| 681 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 682 | struct net_device *dev, const uint8_t *peer, |
| 683 | uint8_t action_code, uint8_t dialog_token, |
| 684 | uint16_t status_code, uint32_t peer_capability, |
| 685 | bool initiator, const uint8_t *buf, |
| 686 | size_t len); |
| 687 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 688 | int 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 | const uint8_t *buf, size_t len); |
| 693 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) |
| 694 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 695 | struct net_device *dev, uint8_t *peer, |
| 696 | uint8_t action_code, uint8_t dialog_token, |
| 697 | uint16_t status_code, uint32_t peer_capability, |
| 698 | const uint8_t *buf, size_t len); |
| 699 | #else |
| 700 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 701 | struct net_device *dev, uint8_t *peer, |
| 702 | uint8_t action_code, uint8_t dialog_token, |
| 703 | uint16_t status_code, const uint8_t *buf, |
| 704 | size_t len); |
| 705 | #endif |
| 706 | #endif |
| 707 | |
| 708 | void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter, |
| 709 | hdd_context_t *hddctx); |
| 710 | void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx); |
| 711 | |
| 712 | hddTdlsPeer_t *wlan_hdd_tdls_find_first_connected_peer(hdd_adapter_t *adapter); |
| 713 | int hdd_set_tdls_offchannel(hdd_context_t *hdd_ctx, int offchannel); |
| 714 | int hdd_set_tdls_secoffchanneloffset(hdd_context_t *hdd_ctx, int offchanoffset); |
| 715 | int hdd_set_tdls_offchannelmode(hdd_adapter_t *adapter, int offchanmode); |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 716 | void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, |
| 717 | struct sk_buff *skb); |
| 718 | void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, |
| 719 | struct sk_buff *skb); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 720 | int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val); |
Prashanth Bhatta | 527fd75 | 2016-04-28 12:35:23 -0700 | [diff] [blame] | 721 | void hdd_tdls_context_init(hdd_context_t *hdd_ctx); |
| 722 | void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx); |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 723 | int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 724 | hdd_adapter_t *adapter, |
| 725 | uint32_t mode); |
Kabilan Kannan | 32eb502 | 2016-10-04 12:24:50 -0700 | [diff] [blame] | 726 | /** |
| 727 | * wlan_hdd_tdls_notify_connect() - Update tdls state for every |
| 728 | * connect event. |
| 729 | * @adapter: hdd adapter |
| 730 | * @csr_roam_info: csr information |
| 731 | * |
| 732 | * After every connect event in the system, check whether TDLS |
| 733 | * can be enabled in the system. If TDLS can be enabled, update the |
| 734 | * TDLS state as needed. |
| 735 | * |
| 736 | * Return: None |
| 737 | */ |
| 738 | void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, |
| 739 | tCsrRoamInfo *csr_roam_info); |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 740 | |
Kabilan Kannan | 32eb502 | 2016-10-04 12:24:50 -0700 | [diff] [blame] | 741 | /** |
| 742 | * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every |
| 743 | * disconnect event. |
| 744 | * @adapter: hdd adapter |
| 745 | * |
| 746 | * After every disconnect event in the system, check whether TDLS |
| 747 | * can be disabled/enabled in the system and update the |
| 748 | * TDLS state as needed. |
| 749 | * |
| 750 | * Return: None |
| 751 | */ |
| 752 | void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter); |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 753 | |
Kabilan Kannan | d053aaf | 2016-10-26 02:06:14 -0700 | [diff] [blame] | 754 | /** |
| 755 | * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode |
| 756 | * @wiphy: pointer to wireless wiphy structure. |
| 757 | * @wdev: pointer to wireless_dev structure. |
| 758 | * @data: Pointer to the data to be passed via vendor interface |
| 759 | * @data_len:Length of the data to be passed |
| 760 | * |
| 761 | * Return: Return the Success or Failure code. |
| 762 | */ |
| 763 | int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, |
| 764 | struct wireless_dev *wdev, |
| 765 | const void *data, |
| 766 | int data_len); |
| 767 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 768 | #else |
| 769 | static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter, |
| 770 | hdd_context_t *hddctx) |
| 771 | { |
| 772 | } |
| 773 | static inline void |
| 774 | wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) |
| 775 | { |
| 776 | } |
| 777 | static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter) |
| 778 | { |
| 779 | } |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 780 | static inline void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, |
| 781 | struct sk_buff *skb) |
| 782 | { |
| 783 | } |
| 784 | static inline void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, |
| 785 | struct sk_buff *skb) |
| 786 | { |
| 787 | } |
Prashanth Bhatta | 527fd75 | 2016-04-28 12:35:23 -0700 | [diff] [blame] | 788 | static inline void hdd_tdls_context_init(hdd_context_t *hdd_ctx) { } |
| 789 | static inline void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx) { } |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 790 | |
| 791 | static inline int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 792 | hdd_adapter_t *adapter, |
| 793 | uint32_t mode) |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 794 | { |
| 795 | return 0; |
| 796 | } |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 797 | static inline void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, |
| 798 | bool tdls_prohibited, |
| 799 | bool tdls_chan_swit_prohibited) |
| 800 | { |
| 801 | } |
Kabilan Kannan | 32eb502 | 2016-10-04 12:24:50 -0700 | [diff] [blame] | 802 | static inline void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, |
| 803 | tCsrRoamInfo *csr_roam_info) |
| 804 | { |
| 805 | } |
| 806 | static inline void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter) |
| 807 | { |
| 808 | } |
Kabilan Kannan | d053aaf | 2016-10-26 02:06:14 -0700 | [diff] [blame] | 809 | |
| 810 | static inline int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, |
| 811 | struct wireless_dev *wdev, |
| 812 | const void *data, |
| 813 | int data_len) |
| 814 | { |
| 815 | return 0; |
| 816 | } |
| 817 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 818 | #endif /* End of FEATURE_WLAN_TDLS */ |
| 819 | |
Abhishek Singh | 4ef5fe0 | 2016-04-27 12:21:24 +0530 | [diff] [blame] | 820 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 821 | void hdd_send_wlan_tdls_teardown_event(uint32_t reason, |
| 822 | uint8_t *peer_mac); |
Abhishek Singh | 74bcb0a | 2016-04-27 12:30:48 +0530 | [diff] [blame] | 823 | void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, |
| 824 | uint8_t is_off_chan_supported, |
| 825 | uint8_t is_off_chan_configured, |
| 826 | uint8_t is_off_chan_established); |
Abhishek Singh | af1d0c9 | 2016-04-27 13:46:59 +0530 | [diff] [blame] | 827 | void hdd_wlan_block_scan_by_tdls_event(void); |
Abhishek Singh | 4ef5fe0 | 2016-04-27 12:21:24 +0530 | [diff] [blame] | 828 | #else |
| 829 | static inline |
| 830 | void hdd_send_wlan_tdls_teardown_event(uint32_t reason, |
| 831 | uint8_t *peer_mac) {} |
Abhishek Singh | 74bcb0a | 2016-04-27 12:30:48 +0530 | [diff] [blame] | 832 | static inline |
| 833 | void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, |
| 834 | uint8_t is_off_chan_supported, |
| 835 | uint8_t is_off_chan_configured, |
| 836 | uint8_t is_off_chan_established) {} |
Abhishek Singh | af1d0c9 | 2016-04-27 13:46:59 +0530 | [diff] [blame] | 837 | static inline void hdd_wlan_block_scan_by_tdls_event(void) {} |
Abhishek Singh | 4ef5fe0 | 2016-04-27 12:21:24 +0530 | [diff] [blame] | 838 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 839 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 840 | #endif /* __HDD_TDLS_H */ |