Gopichand Nakkala | bd9fa2d | 2013-01-08 13:16:22 -0800 | [diff] [blame] | 1 | /* |
Pradeep Reddy POTTETI | 9db32f0 | 2015-01-29 15:22:54 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -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. |
Gopichand Nakkala | bd9fa2d | 2013-01-08 13:16:22 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 28 | #ifndef __HDD_TDSL_H |
| 29 | #define __HDD_TDSL_H |
| 30 | /**=========================================================================== |
| 31 | |
| 32 | \file wlan_hdd_tdls.h |
| 33 | |
| 34 | \brief Linux HDD TDLS include file |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 35 | ==========================================================================*/ |
| 36 | |
Masti, Narayanraddi | fdde4d0 | 2015-04-16 14:41:51 +0530 | [diff] [blame] | 37 | #ifdef FEATURE_WLAN_TDLS |
| 38 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 39 | #define MAX_NUM_TDLS_PEER 3 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 40 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 41 | #define TDLS_SUB_DISCOVERY_PERIOD 100 |
| 42 | |
| 43 | #define TDLS_MAX_DISCOVER_REQS_PER_TIMER 1 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 44 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 45 | #define TDLS_DISCOVERY_PERIOD 3600000 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 46 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 47 | #define TDLS_TX_STATS_PERIOD 3600000 |
| 48 | |
| 49 | #define TDLS_IMPLICIT_TRIGGER_PKT_THRESHOLD 100 |
| 50 | |
| 51 | #define TDLS_RX_IDLE_TIMEOUT 5000 |
| 52 | |
| 53 | #define TDLS_RSSI_TRIGGER_HYSTERESIS 50 |
| 54 | |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 55 | /* before UpdateTimer expires, we want to timeout discovery response. |
| 56 | should not be more than 2000 */ |
| 57 | #define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE 1000 |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 58 | |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 59 | #define TDLS_CTX_MAGIC 0x54444c53 // "TDLS" |
| 60 | |
| 61 | #define TDLS_MAX_SCAN_SCHEDULE 10 |
Hoonki Lee | fb8df67 | 2013-04-10 18:20:34 -0700 | [diff] [blame] | 62 | #define TDLS_MAX_SCAN_REJECT 5 |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 63 | #define TDLS_DELAY_SCAN_PER_CONNECTION 100 |
| 64 | |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 65 | #define TDLS_IS_CONNECTED(peer) \ |
| 66 | ((eTDLS_LINK_CONNECTED == (peer)->link_status) || \ |
| 67 | (eTDLS_LINK_TEARING == (peer)->link_status)) |
Pradeep Reddy POTTETI | e309c15 | 2015-02-06 13:21:07 +0530 | [diff] [blame] | 68 | |
| 69 | /* TDLS Off Channel Bandwidth Offset */ |
| 70 | #define TDLS_OFF_CHANNEL_BW_OFFSET 0 |
| 71 | |
| 72 | /* TDLS Channel Switch Request */ |
| 73 | #define TDLS_CHANNEL_SWITCH_ENABLE 1 |
| 74 | #define TDLS_CHANNEL_SWITCH_DISABLE 2 |
| 75 | |
Masti, Narayanraddi | 20494af | 2015-12-17 20:56:42 +0530 | [diff] [blame] | 76 | enum tdls_disable_source { |
| 77 | HDD_SET_TDLS_MODE_SOURCE_USER = 1, |
| 78 | HDD_SET_TDLS_MODE_SOURCE_SCAN = 2, |
| 79 | HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL = 4, |
| 80 | HDD_SET_TDLS_MODE_SOURCE_BTC = 8, |
| 81 | HDD_SET_TDLS_MODE_SOURCE_P2P = 16 |
| 82 | }; |
| 83 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 84 | typedef struct |
| 85 | { |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 86 | tANI_U32 tdls; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 87 | tANI_U32 tx_period_t; |
| 88 | tANI_U32 tx_packet_n; |
| 89 | tANI_U32 discovery_period_t; |
| 90 | tANI_U32 discovery_tries_n; |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 91 | tANI_U32 idle_timeout_t; |
| 92 | tANI_U32 idle_packet_n; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 93 | tANI_U32 rssi_hysteresis; |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 94 | tANI_S32 rssi_trigger_threshold; |
| 95 | tANI_S32 rssi_teardown_threshold; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 96 | } tdls_config_params_t; |
| 97 | |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 98 | typedef struct |
| 99 | { |
| 100 | struct wiphy *wiphy; |
| 101 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) |
| 102 | struct net_device *dev; |
| 103 | #endif |
| 104 | struct cfg80211_scan_request *scan_request; |
| 105 | int magic; |
| 106 | int attempt; |
Hoonki Lee | fb8df67 | 2013-04-10 18:20:34 -0700 | [diff] [blame] | 107 | int reject; |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 108 | struct delayed_work tdls_scan_work; |
| 109 | } tdls_scan_context_t; |
| 110 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 111 | typedef enum { |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 112 | eTDLS_SUPPORT_NOT_ENABLED = 0, |
| 113 | eTDLS_SUPPORT_DISABLED, /* suppress implicit trigger and not respond to the peer */ |
| 114 | eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY, /* suppress implicit trigger, but respond to the peer */ |
| 115 | eTDLS_SUPPORT_ENABLED, /* implicit trigger */ |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 116 | } eTDLSSupportMode; |
| 117 | |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 118 | typedef enum eTDLSCapType{ |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 119 | eTDLS_CAP_NOT_SUPPORTED = -1, |
| 120 | eTDLS_CAP_UNKNOWN = 0, |
| 121 | eTDLS_CAP_SUPPORTED = 1, |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 122 | } tTDLSCapType; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 123 | |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 124 | typedef enum eTDLSLinkStatus { |
| 125 | eTDLS_LINK_IDLE = 0, |
| 126 | eTDLS_LINK_DISCOVERING, |
Gopichand Nakkala | 0592280 | 2013-03-14 12:23:19 -0700 | [diff] [blame] | 127 | eTDLS_LINK_DISCOVERED, |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 128 | eTDLS_LINK_CONNECTING, |
| 129 | eTDLS_LINK_CONNECTED, |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 130 | eTDLS_LINK_TEARING, |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 131 | } tTDLSLinkStatus; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 132 | |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 133 | |
| 134 | typedef enum { |
| 135 | eTDLS_LINK_SUCCESS, /* Success */ |
| 136 | eTDLS_LINK_UNSPECIFIED = -1, /* Unspecified reason */ |
| 137 | eTDLS_LINK_NOT_SUPPORTED = -2, /* Remote side doesn't support TDLS */ |
| 138 | eTDLS_LINK_UNSUPPORTED_BAND = -3, /* Remote side doesn't support this band */ |
| 139 | eTDLS_LINK_NOT_BENEFICIAL = -4, /* Going to AP is better than going direct */ |
| 140 | eTDLS_LINK_DROPPED_BY_REMOTE = -5 /* Remote side doesn't want it anymore */ |
| 141 | } tTDLSLinkReason; |
| 142 | |
| 143 | typedef struct { |
| 144 | int channel; /* channel hint, in channel number (NOT frequency ) */ |
| 145 | int global_operating_class; /* operating class to use */ |
| 146 | int max_latency_ms; /* max latency that can be tolerated by apps */ |
| 147 | int min_bandwidth_kbps; /* bandwidth required by apps, in kilo bits per second */ |
| 148 | } tdls_req_params_t; |
| 149 | |
| 150 | typedef enum { |
| 151 | WIFI_TDLS_DISABLED, /* TDLS is not enabled, or is disabled now */ |
| 152 | WIFI_TDLS_ENABLED, /* TDLS is enabled, but not yet tried */ |
| 153 | WIFI_TDLS_TRYING, /* Direct link is being attempted (optional) */ |
| 154 | WIFI_TDLS_ESTABLISHED, /* Direct link is established */ |
| 155 | WIFI_TDLS_ESTABLISHED_OFF_CHANNEL, /* Direct link is established using MCC */ |
| 156 | WIFI_TDLS_DROPPED, /* Direct link was established, but is now dropped */ |
| 157 | WIFI_TDLS_FAILED /* Direct link failed */ |
| 158 | } tdls_state_t; |
| 159 | |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 160 | typedef int (*cfg80211_exttdls_callback)( |
| 161 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 162 | const tANI_U8* mac, |
| 163 | #else |
| 164 | tANI_U8* mac, |
| 165 | #endif |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 166 | tANI_S32 state, |
| 167 | tANI_S32 reason, |
| 168 | void *ctx); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 169 | typedef struct { |
| 170 | tANI_U16 period; |
| 171 | tANI_U16 bytes; |
| 172 | } tdls_tx_tput_config_t; |
| 173 | |
| 174 | typedef struct { |
| 175 | tANI_U16 period; |
| 176 | tANI_U16 tries; |
| 177 | } tdls_discovery_config_t; |
| 178 | |
| 179 | typedef struct { |
| 180 | tANI_U16 timeout; |
| 181 | } tdls_rx_idle_config_t; |
| 182 | |
| 183 | typedef struct { |
| 184 | tANI_U16 rssi_thres; |
| 185 | } tdls_rssi_config_t; |
| 186 | |
Hoonki Lee | d37cbb3 | 2013-04-20 00:31:14 -0700 | [diff] [blame] | 187 | struct _hddTdlsPeer_t; |
Sunil Dutt | 41de4e2 | 2013-11-14 18:09:02 +0530 | [diff] [blame] | 188 | |
| 189 | typedef struct { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 190 | struct list_head peer_list[256]; |
| 191 | hdd_adapter_t *pAdapter; |
Hoonki Lee | d37cbb3 | 2013-04-20 00:31:14 -0700 | [diff] [blame] | 192 | #ifdef TDLS_USE_SEPARATE_DISCOVERY_TIMER |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 193 | vos_timer_t peerDiscoverTimer; |
Hoonki Lee | d37cbb3 | 2013-04-20 00:31:14 -0700 | [diff] [blame] | 194 | #endif |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 195 | vos_timer_t peerUpdateTimer; |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 196 | vos_timer_t peerDiscoveryTimeoutTimer; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 197 | tdls_config_params_t threshold_config; |
| 198 | tANI_S32 discovery_peer_cnt; |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 199 | tANI_U32 discovery_sent_cnt; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 200 | tANI_S8 ap_rssi; |
Hoonki Lee | d37cbb3 | 2013-04-20 00:31:14 -0700 | [diff] [blame] | 201 | struct _hddTdlsPeer_t *curr_candidate; |
| 202 | struct work_struct implicit_setup; |
| 203 | v_U32_t magic; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 204 | } tdlsCtx_t; |
| 205 | |
Hoonki Lee | d37cbb3 | 2013-04-20 00:31:14 -0700 | [diff] [blame] | 206 | typedef struct _hddTdlsPeer_t { |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 207 | struct list_head node; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 208 | tdlsCtx_t *pHddTdlsCtx; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 209 | tSirMacAddr peerMac; |
| 210 | tANI_U16 staId ; |
| 211 | tANI_S8 rssi; |
Gopichand Nakkala | 901e892 | 2013-03-04 23:45:58 -0800 | [diff] [blame] | 212 | tTDLSCapType tdls_support; |
| 213 | tTDLSLinkStatus link_status; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 214 | tANI_U8 signature; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 215 | tANI_U8 is_responder; |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 216 | tANI_U8 discovery_processed; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 217 | tANI_U16 discovery_attempt; |
| 218 | tANI_U16 tx_pkt; |
| 219 | tANI_U16 rx_pkt; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 220 | tANI_U8 uapsdQueues; |
Agarwal Ashish | 16020c4 | 2014-12-29 22:01:11 +0530 | [diff] [blame] | 221 | tANI_U8 qos; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 222 | tANI_U8 maxSp; |
| 223 | tANI_U8 isBufSta; |
Naresh Jayaram | 3180aa4 | 2014-02-12 21:47:26 +0530 | [diff] [blame] | 224 | tANI_U8 isOffChannelSupported; |
| 225 | tANI_U8 supported_channels_len; |
| 226 | tANI_U8 supported_channels[SIR_MAC_MAX_SUPP_CHANNELS]; |
| 227 | tANI_U8 supported_oper_classes_len; |
| 228 | tANI_U8 supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES]; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 229 | vos_timer_t peerIdleTimer; |
Hoonki Lee | 1462135 | 2013-04-16 17:51:19 -0700 | [diff] [blame] | 230 | vos_timer_t initiatorWaitTimeoutTimer; |
Naresh Jayaram | 937abdf | 2013-11-26 19:50:25 +0530 | [diff] [blame] | 231 | tANI_BOOLEAN isForcedPeer; |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 232 | /*EXT TDLS*/ |
| 233 | tTDLSLinkReason reason; |
| 234 | cfg80211_exttdls_callback state_change_notification; |
Pradeep Reddy POTTETI | e309c15 | 2015-02-06 13:21:07 +0530 | [diff] [blame] | 235 | tANI_BOOLEAN isOffChannelConfigured; |
Pradeep Reddy POTTETI | 16d8333 | 2015-03-26 18:28:13 +0530 | [diff] [blame] | 236 | tANI_BOOLEAN isOffChannelEstablished; |
Pradeep Reddy POTTETI | e309c15 | 2015-02-06 13:21:07 +0530 | [diff] [blame] | 237 | tdls_req_params_t peerParams; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 238 | } hddTdlsPeer_t; |
| 239 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 240 | typedef struct { |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 241 | /* Session ID */ |
| 242 | tANI_U8 sessionId; |
| 243 | /*TDLS peer station id */ |
| 244 | v_U8_t staId; |
| 245 | /* TDLS peer mac Address */ |
| 246 | v_MACADDR_t peerMac; |
| 247 | } tdlsConnInfo_t; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 248 | |
Agarwal Ashish | 4b87f92 | 2014-06-18 03:03:21 +0530 | [diff] [blame] | 249 | int wlan_hdd_sta_tdls_init(hdd_adapter_t *pAdapter); |
| 250 | |
| 251 | void wlan_hdd_tdls_init(hdd_context_t * pHddCtx); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 252 | |
Pradeep Reddy POTTETI | 2d4d5c4 | 2015-03-03 14:34:19 +0530 | [diff] [blame] | 253 | void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter, tANI_BOOLEAN mutexLock); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 254 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 255 | void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 256 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 257 | void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac); |
Chilam Ng | 1279e23 | 2013-01-25 15:06:52 -0800 | [diff] [blame] | 258 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 259 | int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, |
| 260 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 261 | const u8 *mac, |
| 262 | #else |
| 263 | u8 *mac, |
| 264 | #endif |
| 265 | u8 staId); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 266 | |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 267 | hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 268 | const u8 *mac, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 269 | tANI_BOOLEAN mutexLock); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 270 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 271 | hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx, |
| 272 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 273 | const u8 *mac |
| 274 | #else |
| 275 | u8 *mac |
| 276 | #endif |
| 277 | ); |
Hoonki Lee | a6d49be | 2013-04-05 09:43:25 -0700 | [diff] [blame] | 278 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 279 | int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter, |
| 280 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 281 | const u8 *mac, |
| 282 | #else |
| 283 | u8 *mac, |
| 284 | #endif |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 285 | tCsrTdlsLinkEstablishParams* tdlsLinkEstablishParams); |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 286 | hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, |
| 287 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 288 | const u8 *mac |
| 289 | #else |
| 290 | u8 *mac |
| 291 | #endif |
| 292 | ); |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 293 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 294 | int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, |
| 295 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 296 | const u8* mac, |
| 297 | #else |
| 298 | u8* mac, |
| 299 | #endif |
| 300 | tTDLSCapType cap); |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 301 | |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 302 | void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, |
| 303 | tTDLSLinkStatus status, |
| 304 | tTDLSLinkReason reason); |
| 305 | void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 306 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 307 | const u8 *mac, |
| 308 | #else |
| 309 | u8 *mac, |
| 310 | #endif |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 311 | tTDLSLinkStatus linkStatus, |
| 312 | tTDLSLinkReason reason); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 313 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 314 | int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter, u8 *mac); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 315 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 316 | int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 317 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 318 | const u8 *mac, |
| 319 | #else |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 320 | u8 *mac, |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 321 | #endif |
Naresh Jayaram | 3180aa4 | 2014-02-12 21:47:26 +0530 | [diff] [blame] | 322 | tCsrStaParams *StaParams, |
| 323 | tANI_BOOLEAN isBufSta, |
Masti, Narayanraddi | c754cdc | 2015-12-24 18:22:36 +0530 | [diff] [blame^] | 324 | tANI_BOOLEAN isOffChannelSupported, |
| 325 | tANI_BOOLEAN isQosWmmSta); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 326 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 327 | int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, |
| 328 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 329 | const u8 *mac, |
| 330 | #else |
| 331 | u8 *mac, |
| 332 | #endif |
| 333 | tANI_S8 rxRssi); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 334 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 335 | int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, |
| 336 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 337 | const u8 *mac, |
| 338 | #else |
| 339 | u8 *mac, |
| 340 | #endif |
| 341 | tANI_U8 responder); |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 342 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 343 | int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, |
| 344 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 345 | const u8 *mac, |
| 346 | #else |
| 347 | u8 *mac, |
| 348 | #endif |
| 349 | tANI_U8 uSignature); |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 350 | |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 351 | int wlan_hdd_tdls_set_params(struct net_device *dev, tdls_config_params_t *config); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 352 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 353 | int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, |
| 354 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 355 | const u8 *mac |
| 356 | #else |
| 357 | u8 *mac |
| 358 | #endif |
| 359 | ); |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 360 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 361 | tANI_U16 wlan_hdd_tdlsConnectedPeers(hdd_adapter_t *pAdapter); |
Lee Hoonki | c1262f2 | 2013-01-24 21:59:00 -0800 | [diff] [blame] | 362 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 363 | int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen); |
Chilam Ng | 16a2a1c | 2013-01-29 01:27:29 -0800 | [diff] [blame] | 364 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 365 | void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter); |
| 366 | |
| 367 | void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter); |
| 368 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 369 | void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, tANI_U32 statusCode); |
| 370 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 371 | void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 372 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 373 | void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 374 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 375 | void wlan_hdd_tdls_check_bmps(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 376 | |
Anand N Sunkad | b3ab97d | 2015-07-29 09:58:13 +0530 | [diff] [blame] | 377 | hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx, |
| 378 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 379 | const u8 *mac, |
| 380 | #else |
| 381 | u8 *mac, |
| 382 | #endif |
Pradeep Reddy POTTETI | 9db32f0 | 2015-01-29 15:22:54 +0530 | [diff] [blame] | 383 | u8 skip_self, tANI_BOOLEAN mutexLock); |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 384 | |
Gopichand Nakkala | dcbcf4e | 2013-03-23 14:32:39 -0700 | [diff] [blame] | 385 | void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, |
| 386 | eTDLSSupportMode tdls_mode, |
Masti, Narayanraddi | 20494af | 2015-12-17 20:56:42 +0530 | [diff] [blame] | 387 | v_BOOL_t bUpdateLast, |
| 388 | enum tdls_disable_source source); |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 389 | |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 390 | tANI_U32 wlan_hdd_tdls_discovery_sent_cnt(hdd_context_t *pHddCtx); |
| 391 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 392 | void wlan_hdd_tdls_check_power_save_prohibited(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 393 | |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 394 | void wlan_hdd_tdls_free_scan_request (tdls_scan_context_t *tdls_scan_ctx); |
| 395 | |
| 396 | int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx, |
| 397 | struct wiphy *wiphy, |
| 398 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) |
| 399 | struct net_device *dev, |
| 400 | #endif |
| 401 | struct cfg80211_scan_request *request); |
| 402 | |
| 403 | int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, |
| 404 | struct wiphy *wiphy, |
| 405 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) |
| 406 | struct net_device *dev, |
| 407 | #endif |
| 408 | struct cfg80211_scan_request *request); |
| 409 | |
| 410 | void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter); |
| 411 | |
Gopichand Nakkala | 3046fc9 | 2013-03-23 13:56:43 -0700 | [diff] [blame] | 412 | void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter, |
| 413 | vos_timer_t *timer, |
| 414 | v_U32_t expirationTime); |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 415 | void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter, |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 416 | hddTdlsPeer_t *curr_peer, |
| 417 | tANI_U16 reason); |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 418 | |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 419 | int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, |
| 420 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 421 | const u8 *mac, |
| 422 | #else |
| 423 | u8 *mac, |
| 424 | #endif |
Naresh Jayaram | 937abdf | 2013-11-26 19:50:25 +0530 | [diff] [blame] | 425 | tANI_BOOLEAN forcePeer); |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 426 | int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, |
| 427 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 428 | const u8 *peer |
| 429 | #else |
| 430 | u8 *peer |
| 431 | #endif |
| 432 | ); |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 433 | int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter, |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 434 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 435 | const u8 *peer, |
| 436 | #else |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 437 | u8 *peer, |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 438 | #endif |
Pradeep Reddy POTTETI | e309c15 | 2015-02-06 13:21:07 +0530 | [diff] [blame] | 439 | tdls_req_params_t *tdls_peer_params, |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 440 | cfg80211_exttdls_callback callback); |
Masti, Narayanraddi | fdde4d0 | 2015-04-16 14:41:51 +0530 | [diff] [blame] | 441 | void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter, |
| 442 | hdd_context_t *pHddCtx); |
| 443 | void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx); |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 444 | /*EXT TDLS*/ |
| 445 | int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter, |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 446 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) |
| 447 | const tANI_U8* mac, |
| 448 | #else |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 449 | tANI_U8* mac, |
Anand N Sunkad | 9bfc262 | 2015-07-30 15:18:54 +0530 | [diff] [blame] | 450 | #endif |
Atul Mittal | 115287b | 2014-07-08 13:26:33 +0530 | [diff] [blame] | 451 | tANI_S32 *state, |
| 452 | tANI_S32 *reason); |
| 453 | void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer, |
| 454 | tANI_S32 *state, |
| 455 | tANI_S32 *reason); |
| 456 | int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer, |
| 457 | cfg80211_exttdls_callback callback); |
Agarwal Ashish | ef54a18 | 2014-12-16 15:07:31 +0530 | [diff] [blame] | 458 | int hdd_set_tdls_scan_type(hdd_adapter_t *pAdapter, |
| 459 | tANI_U8 *ptr); |
Gopichand Nakkala | 3046fc9 | 2013-03-23 13:56:43 -0700 | [diff] [blame] | 460 | |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 461 | // tdlsoffchan |
Pradeep Reddy POTTETI | e309c15 | 2015-02-06 13:21:07 +0530 | [diff] [blame] | 462 | hddTdlsPeer_t *wlan_hdd_tdls_get_connected_peer(hdd_adapter_t *pAdapter); |
Mahesh A Saptasagar | 170b508 | 2015-02-16 18:50:54 +0530 | [diff] [blame] | 463 | |
| 464 | int wlan_hdd_validate_tdls_context(hdd_context_t *pHddCtx, tdlsCtx_t *pTdlsCtx); |
Masti, Narayanraddi | fdde4d0 | 2015-04-16 14:41:51 +0530 | [diff] [blame] | 465 | |
Masti, Narayanraddi | 575ccc7 | 2015-08-17 18:04:57 +0530 | [diff] [blame] | 466 | void wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx); |
Masti, Narayanraddi | 63d6235 | 2015-10-01 12:52:50 +0530 | [diff] [blame] | 467 | void wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb); |
Masti, Narayanraddi | fdde4d0 | 2015-04-16 14:41:51 +0530 | [diff] [blame] | 468 | #else |
| 469 | static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *pAdapter, |
| 470 | hdd_context_t *pHddCtx) |
| 471 | { |
| 472 | } |
| 473 | static inline void |
| 474 | wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *pHddCtx) |
| 475 | { |
| 476 | } |
Masti, Narayanraddi | 575ccc7 | 2015-08-17 18:04:57 +0530 | [diff] [blame] | 477 | static inline void |
| 478 | wlan_hdd_tdls_reenable(hdd_context_t *pHddCtx) |
| 479 | { |
| 480 | } |
Masti, Narayanraddi | 63d6235 | 2015-10-01 12:52:50 +0530 | [diff] [blame] | 481 | static inline void |
| 482 | wlan_hdd_tdls_notify_packet(hdd_adapter_t *adapter, struct sk_buff *skb) |
| 483 | { |
| 484 | } |
Masti, Narayanraddi | fdde4d0 | 2015-04-16 14:41:51 +0530 | [diff] [blame] | 485 | #endif |
Ganesh Kondabattini | f3ba097 | 2015-08-07 15:58:04 +0530 | [diff] [blame] | 486 | void wlan_hdd_tdls_update_rx_pkt_cnt_n_rssi(hdd_adapter_t *pAdapter, |
| 487 | u8 *mac, v_S7_t rssiAvg); |
Ganesh Kondabattini | cbfdc39 | 2015-09-11 19:12:59 +0530 | [diff] [blame] | 488 | |
| 489 | |
| 490 | tdlsConnInfo_t *wlan_hdd_get_conn_info(hdd_context_t *pHddCtx, |
| 491 | tANI_U8 idx); |
| 492 | |
| 493 | v_VOID_t wlan_hdd_tdls_initiator_wait_cb(v_PVOID_t userData); |
| 494 | |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 495 | #endif // __HDD_TDSL_H |