Gopichand Nakkala | bd9fa2d | 2013-01-08 13:16:22 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012-2013, 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 | */ |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 21 | #ifndef __HDD_TDSL_H |
| 22 | #define __HDD_TDSL_H |
| 23 | /**=========================================================================== |
| 24 | |
| 25 | \file wlan_hdd_tdls.h |
| 26 | |
| 27 | \brief Linux HDD TDLS include file |
Gopichand Nakkala | 0c1331e | 2013-01-07 22:49:07 -0800 | [diff] [blame] | 28 | |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 29 | ==========================================================================*/ |
| 30 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 31 | #define MAX_NUM_TDLS_PEER 3 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 32 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 33 | #define TDLS_SUB_DISCOVERY_PERIOD 100 |
| 34 | |
| 35 | #define TDLS_MAX_DISCOVER_REQS_PER_TIMER 1 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 36 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 37 | #define TDLS_DISCOVERY_PERIOD 3600000 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 38 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 39 | #define TDLS_TX_STATS_PERIOD 3600000 |
| 40 | |
| 41 | #define TDLS_IMPLICIT_TRIGGER_PKT_THRESHOLD 100 |
| 42 | |
| 43 | #define TDLS_RX_IDLE_TIMEOUT 5000 |
| 44 | |
| 45 | #define TDLS_RSSI_TRIGGER_HYSTERESIS 50 |
| 46 | |
| 47 | typedef struct |
| 48 | { |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 49 | tANI_U32 tdls; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 50 | tANI_U32 tx_period_t; |
| 51 | tANI_U32 tx_packet_n; |
| 52 | tANI_U32 discovery_period_t; |
| 53 | tANI_U32 discovery_tries_n; |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 54 | tANI_U32 idle_timeout_t; |
| 55 | tANI_U32 idle_packet_n; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 56 | tANI_U32 rssi_hysteresis; |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 57 | tANI_S32 rssi_trigger_threshold; |
| 58 | tANI_S32 rssi_teardown_threshold; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 59 | } tdls_config_params_t; |
| 60 | |
| 61 | typedef enum { |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 62 | eTDLS_SUPPORT_DISABLED = 0, |
| 63 | eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY, |
| 64 | eTDLS_SUPPORT_ENABLED, |
| 65 | } eTDLSSupportMode; |
| 66 | |
| 67 | typedef enum { |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 68 | eTDLS_CAP_NOT_SUPPORTED = -1, |
| 69 | eTDLS_CAP_UNKNOWN = 0, |
| 70 | eTDLS_CAP_SUPPORTED = 1, |
| 71 | } eTDLSCapType; |
| 72 | |
| 73 | typedef enum { |
| 74 | eTDLS_LINK_NOT_CONNECTED = 0, |
| 75 | eTDLS_LINK_CONNECTED = 1, |
| 76 | } eTDLSLinkStatus; |
| 77 | |
| 78 | typedef struct { |
| 79 | tANI_U16 period; |
| 80 | tANI_U16 bytes; |
| 81 | } tdls_tx_tput_config_t; |
| 82 | |
| 83 | typedef struct { |
| 84 | tANI_U16 period; |
| 85 | tANI_U16 tries; |
| 86 | } tdls_discovery_config_t; |
| 87 | |
| 88 | typedef struct { |
| 89 | tANI_U16 timeout; |
| 90 | } tdls_rx_idle_config_t; |
| 91 | |
| 92 | typedef struct { |
| 93 | tANI_U16 rssi_thres; |
| 94 | } tdls_rssi_config_t; |
| 95 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 96 | typedef struct { |
| 97 | struct list_head node; |
| 98 | tSirMacAddr peerMac; |
| 99 | tANI_U16 staId ; |
| 100 | tANI_S8 rssi; |
| 101 | tANI_S8 tdls_support; |
| 102 | tANI_S8 link_status; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 103 | tANI_U8 signature; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 104 | tANI_U8 is_responder; |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 105 | tANI_U8 discovery_processed; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 106 | tANI_U16 discovery_attempt; |
| 107 | tANI_U16 tx_pkt; |
| 108 | tANI_U16 rx_pkt; |
| 109 | vos_timer_t peerIdleTimer; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame^] | 110 | tANI_U8 isTDLSInProgress; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 111 | } hddTdlsPeer_t; |
| 112 | |
| 113 | |
| 114 | typedef struct { |
| 115 | struct list_head peer_list[256]; |
| 116 | struct mutex lock; |
| 117 | struct net_device *dev; |
| 118 | vos_timer_t peerDiscoverTimer; |
| 119 | vos_timer_t peerUpdateTimer; |
| 120 | tdls_config_params_t threshold_config; |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 121 | tANI_S32 discovery_peer_cnt; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame^] | 122 | tANI_U16 connected_peer_count; |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 123 | tANI_S8 ap_rssi; |
| 124 | } tdlsCtx_t; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 125 | |
| 126 | int wlan_hdd_tdls_init(struct net_device *dev); |
| 127 | |
| 128 | void wlan_hdd_tdls_exit(void); |
| 129 | |
Gopichand Nakkala | 91b0926 | 2013-02-10 14:27:02 -0800 | [diff] [blame] | 130 | void wlan_hdd_tdls_timers_stop(void); |
| 131 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 132 | void wlan_hdd_tdls_timers_destroy(void); |
| 133 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 134 | void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 135 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 136 | void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac); |
Chilam Ng | 1279e23 | 2013-01-25 15:06:52 -0800 | [diff] [blame] | 137 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 138 | int wlan_hdd_tdls_increment_pkt_count(u8 *mac, u8 tx); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 139 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 140 | int wlan_hdd_tdls_set_sta_id(u8 *mac, u8 staId); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 141 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 142 | hddTdlsPeer_t *wlan_hdd_tdls_find_peer(u8 *mac); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 143 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 144 | hddTdlsPeer_t *wlan_hdd_tdls_get_peer(u8 *mac); |
| 145 | |
| 146 | void wlan_hdd_tdls_set_link_status(hddTdlsPeer_t *curr_peer, int status); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 147 | |
| 148 | int wlan_hdd_tdls_set_cap(u8 *mac, int cap); |
| 149 | |
| 150 | int wlan_hdd_tdls_set_rssi(u8 *mac, tANI_S8 rxRssi); |
| 151 | |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 152 | int wlan_hdd_tdls_set_responder(u8 *mac, tANI_U8 responder); |
| 153 | |
| 154 | int wlan_hdd_tdls_get_responder(u8 *mac); |
| 155 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 156 | int wlan_hdd_tdls_set_signature(u8 *mac, tANI_U8 uSignature); |
| 157 | |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 158 | 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] | 159 | |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 160 | int wlan_hdd_tdls_reset_peer(u8 *mac); |
| 161 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame^] | 162 | tANI_U16 wlan_hdd_tdlsConnectedPeers(void); |
Lee Hoonki | c1262f2 | 2013-01-24 21:59:00 -0800 | [diff] [blame] | 163 | |
Chilam Ng | 16a2a1c | 2013-01-29 01:27:29 -0800 | [diff] [blame] | 164 | int wlan_hdd_tdls_get_all_peers(char *buf, int buflen); |
| 165 | |
Gopichand Nakkala | c369458 | 2013-02-13 20:51:22 -0800 | [diff] [blame] | 166 | void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter); |
| 167 | |
| 168 | void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter); |
| 169 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame^] | 170 | void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, tANI_U32 statusCode); |
| 171 | |
| 172 | void wlan_hdd_tdls_increment_peer_count(void); |
| 173 | |
| 174 | void wlan_hdd_tdls_decrement_peer_count(void); |
| 175 | |
| 176 | void wlan_hdd_tdls_check_bmps(hdd_context_t *pHddCtx); |
| 177 | |
| 178 | void wlan_hdd_tdls_set_connection_progress(u8* mac, u8 isProgress); |
| 179 | |
| 180 | u8 wlan_hdd_tdls_is_progress(u8* mac, u8 skip_self); |
Hoonki Lee | 387663d | 2013-02-05 18:08:43 -0800 | [diff] [blame] | 181 | |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 182 | #endif // __HDD_TDSL_H |