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 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 33 | #define TDLS_MAX_DISCOVER_ATTEMPT 2 |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 34 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 35 | #define TDLS_DISCOVERY_PERIOD 3600000 |
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_TX_STATS_PERIOD 3600000 |
| 38 | |
| 39 | #define TDLS_IMPLICIT_TRIGGER_PKT_THRESHOLD 100 |
| 40 | |
| 41 | #define TDLS_RX_IDLE_TIMEOUT 5000 |
| 42 | |
| 43 | #define TDLS_RSSI_TRIGGER_HYSTERESIS 50 |
| 44 | |
| 45 | typedef struct |
| 46 | { |
| 47 | tANI_U32 tx_period_t; |
| 48 | tANI_U32 tx_packet_n; |
| 49 | tANI_U32 discovery_period_t; |
| 50 | tANI_U32 discovery_tries_n; |
| 51 | tANI_U32 rx_timeout_t; |
| 52 | tANI_U32 rssi_hysteresis; |
| 53 | } tdls_config_params_t; |
| 54 | |
| 55 | typedef enum { |
| 56 | eTDLS_CAP_NOT_SUPPORTED = -1, |
| 57 | eTDLS_CAP_UNKNOWN = 0, |
| 58 | eTDLS_CAP_SUPPORTED = 1, |
| 59 | } eTDLSCapType; |
| 60 | |
| 61 | typedef enum { |
| 62 | eTDLS_LINK_NOT_CONNECTED = 0, |
| 63 | eTDLS_LINK_CONNECTED = 1, |
| 64 | } eTDLSLinkStatus; |
| 65 | |
| 66 | typedef struct { |
| 67 | tANI_U16 period; |
| 68 | tANI_U16 bytes; |
| 69 | } tdls_tx_tput_config_t; |
| 70 | |
| 71 | typedef struct { |
| 72 | tANI_U16 period; |
| 73 | tANI_U16 tries; |
| 74 | } tdls_discovery_config_t; |
| 75 | |
| 76 | typedef struct { |
| 77 | tANI_U16 timeout; |
| 78 | } tdls_rx_idle_config_t; |
| 79 | |
| 80 | typedef struct { |
| 81 | tANI_U16 rssi_thres; |
| 82 | } tdls_rssi_config_t; |
| 83 | |
| 84 | |
| 85 | int wlan_hdd_tdls_init(struct net_device *dev); |
| 86 | |
| 87 | void wlan_hdd_tdls_exit(void); |
| 88 | |
| 89 | u8 wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac); |
| 90 | |
Chilam Ng | 1279e23 | 2013-01-25 15:06:52 -0800 | [diff] [blame] | 91 | u8 wlan_hdd_tdls_extract_sa(struct sk_buff *skb, u8 *mac); |
| 92 | |
| 93 | int wlan_hdd_tdls_add_peer_to_list(u8 key, u8 *mac, u8 tx); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 94 | |
| 95 | int wlan_hdd_saveTdlsPeer(tCsrRoamInfo *pRoamInfo); |
| 96 | |
| 97 | int wlan_hdd_findTdlsPeer(tSirMacAddr peerMac); |
| 98 | |
| 99 | int wlan_hdd_tdls_set_link_status(u8 *mac, int status); |
| 100 | |
| 101 | int wlan_hdd_tdls_set_cap(u8 *mac, int cap); |
| 102 | |
| 103 | int wlan_hdd_tdls_set_rssi(u8 *mac, tANI_S8 rxRssi); |
| 104 | |
| 105 | int wlan_hdd_tdls_set_params(tdls_config_params_t *config); |
| 106 | |
| 107 | void wlan_hdd_removeTdlsPeer(tCsrRoamInfo *pRoamInfo); |
Lee Hoonki | c1262f2 | 2013-01-24 21:59:00 -0800 | [diff] [blame^] | 108 | |
| 109 | u8 wlan_hdd_tdlsConnectedPeers(void); |
| 110 | |
Kiran V | 1ccee93 | 2012-12-12 14:49:46 -0800 | [diff] [blame] | 111 | #endif // __HDD_TDSL_H |