Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Jeff Johnson | 72acff6 | 2018-12-30 10:16:21 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #ifndef __HDD_TDLS_H |
| 20 | #define __HDD_TDLS_H |
| 21 | /** |
| 22 | * DOC: wlan_hdd_tdls.h |
| 23 | * WLAN Host Device Driver TDLS include file |
| 24 | */ |
| 25 | |
Jeff Johnson | af772ed | 2017-08-28 11:40:36 -0700 | [diff] [blame] | 26 | struct hdd_context; |
| 27 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 28 | #ifdef FEATURE_WLAN_TDLS |
| 29 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 30 | /* Bit mask flag for tdls_option to FW */ |
| 31 | #define ENA_TDLS_OFFCHAN (1 << 0) /* TDLS Off Channel support */ |
| 32 | #define ENA_TDLS_BUFFER_STA (1 << 1) /* TDLS Buffer STA support */ |
| 33 | #define ENA_TDLS_SLEEP_STA (1 << 2) /* TDLS Sleep STA support */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 34 | |
Jeff Johnson | 6bff894 | 2017-10-02 13:22:18 -0700 | [diff] [blame] | 35 | int wlan_hdd_tdls_get_all_peers(struct hdd_adapter *adapter, char *buf, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 36 | int buflen); |
| 37 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 38 | int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy, |
| 39 | struct wireless_dev *wdev, |
| 40 | const void *data, |
| 41 | int data_len); |
| 42 | |
| 43 | int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy, |
| 44 | struct wireless_dev *wdev, |
| 45 | const void *data, |
| 46 | int data_len); |
| 47 | |
| 48 | int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy, |
| 49 | struct wireless_dev *wdev, |
| 50 | const void *data, |
| 51 | int data_len); |
| 52 | |
| 53 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 54 | int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, |
| 55 | struct net_device *dev, |
| 56 | const uint8_t *peer, |
| 57 | enum nl80211_tdls_operation oper); |
| 58 | #else |
| 59 | int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, |
| 60 | struct net_device *dev, |
| 61 | uint8_t *peer, |
| 62 | enum nl80211_tdls_operation oper); |
| 63 | #endif |
| 64 | |
| 65 | #ifdef TDLS_MGMT_VERSION2 |
| 66 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 67 | struct net_device *dev, u8 *peer, |
| 68 | u8 action_code, u8 dialog_token, |
| 69 | u16 status_code, u32 peer_capability, |
| 70 | const u8 *buf, size_t len); |
| 71 | #else |
| 72 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) |
| 73 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 74 | struct net_device *dev, const uint8_t *peer, |
| 75 | uint8_t action_code, uint8_t dialog_token, |
| 76 | uint16_t status_code, uint32_t peer_capability, |
| 77 | bool initiator, const uint8_t *buf, |
| 78 | size_t len); |
| 79 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 80 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 81 | struct net_device *dev, const uint8_t *peer, |
| 82 | uint8_t action_code, uint8_t dialog_token, |
| 83 | uint16_t status_code, uint32_t peer_capability, |
| 84 | const uint8_t *buf, size_t len); |
| 85 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) |
| 86 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 87 | struct net_device *dev, uint8_t *peer, |
| 88 | uint8_t action_code, uint8_t dialog_token, |
| 89 | uint16_t status_code, uint32_t peer_capability, |
| 90 | const uint8_t *buf, size_t len); |
| 91 | #else |
| 92 | int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, |
| 93 | struct net_device *dev, uint8_t *peer, |
| 94 | uint8_t action_code, uint8_t dialog_token, |
| 95 | uint16_t status_code, const uint8_t *buf, |
| 96 | size_t len); |
| 97 | #endif |
| 98 | #endif |
| 99 | |
Bala Venkatesh | 113a9e6 | 2018-08-30 15:19:02 +0530 | [diff] [blame] | 100 | /** |
| 101 | * hdd_set_tdls_offchannel() - set tdls off-channel number |
| 102 | * @hdd_ctx: Pointer to the HDD context |
| 103 | * @adapter: Pointer to the HDD adapter |
| 104 | * @offchannel: tdls off-channel number |
| 105 | * |
| 106 | * This function sets tdls off-channel number |
| 107 | * |
| 108 | * Return: 0 on success; negative errno otherwise |
| 109 | */ |
| 110 | int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, |
| 111 | struct hdd_adapter *adapter, |
| 112 | int offchannel); |
| 113 | |
| 114 | /** |
| 115 | * hdd_set_tdls_secoffchanneloffset() - set secondary tdls off-channel offset |
| 116 | * @hdd_ctx: Pointer to the HDD context |
| 117 | * @adapter: Pointer to the HDD adapter |
| 118 | * @offchanoffset: tdls off-channel offset |
| 119 | * |
| 120 | * This function sets secondary tdls off-channel offset |
| 121 | * |
| 122 | * Return: 0 on success; negative errno otherwise |
| 123 | */ |
Jeff Johnson | ae9adc8 | 2017-10-03 11:22:31 -0700 | [diff] [blame] | 124 | int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, |
Bala Venkatesh | 113a9e6 | 2018-08-30 15:19:02 +0530 | [diff] [blame] | 125 | struct hdd_adapter *adapter, |
Jeff Johnson | ae9adc8 | 2017-10-03 11:22:31 -0700 | [diff] [blame] | 126 | int offchanoffset); |
Bala Venkatesh | 113a9e6 | 2018-08-30 15:19:02 +0530 | [diff] [blame] | 127 | |
| 128 | /** |
| 129 | * hdd_set_tdls_offchannelmode() - set tdls off-channel mode |
| 130 | * @hdd_ctx: Pointer to the HDD context |
| 131 | * @adapter: Pointer to the HDD adapter |
| 132 | * @offchanmode: tdls off-channel mode |
| 133 | * 1-Enable Channel Switch |
| 134 | * 2-Disable Channel Switch |
| 135 | * |
| 136 | * This function sets tdls off-channel mode |
| 137 | * |
| 138 | * Return: 0 on success; negative errno otherwise |
| 139 | */ |
| 140 | int hdd_set_tdls_offchannelmode(struct hdd_context *hdd_ctx, |
| 141 | struct hdd_adapter *adapter, |
| 142 | int offchanmode); |
Jeff Johnson | af772ed | 2017-08-28 11:40:36 -0700 | [diff] [blame] | 143 | int hdd_set_tdls_scan_type(struct hdd_context *hdd_ctx, int val); |
Jeff Johnson | af772ed | 2017-08-28 11:40:36 -0700 | [diff] [blame] | 144 | int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx, |
Jeff Johnson | 327b9d4 | 2017-08-29 14:20:07 -0700 | [diff] [blame] | 145 | struct hdd_adapter *adapter, |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 146 | uint32_t mode); |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 147 | |
Kabilan Kannan | d053aaf | 2016-10-26 02:06:14 -0700 | [diff] [blame] | 148 | /** |
| 149 | * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode |
| 150 | * @wiphy: pointer to wireless wiphy structure. |
| 151 | * @wdev: pointer to wireless_dev structure. |
| 152 | * @data: Pointer to the data to be passed via vendor interface |
| 153 | * @data_len:Length of the data to be passed |
| 154 | * |
| 155 | * Return: Return the Success or Failure code. |
| 156 | */ |
| 157 | int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, |
| 158 | struct wireless_dev *wdev, |
| 159 | const void *data, |
| 160 | int data_len); |
| 161 | |
Jeff Johnson | 1d40f5b | 2018-03-02 08:35:53 -0800 | [diff] [blame] | 162 | QDF_STATUS hdd_tdls_register_peer(void *userdata, uint32_t vdev_id, |
| 163 | const uint8_t *mac, uint16_t sta_id, |
| 164 | uint8_t qos); |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 165 | |
Jeff Johnson | 1d40f5b | 2018-03-02 08:35:53 -0800 | [diff] [blame] | 166 | QDF_STATUS hdd_tdls_deregister_peer(void *userdata, uint32_t vdev_id, |
| 167 | uint8_t sta_id); |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 168 | |
jiad | 7b8a5e0 | 2018-11-26 16:37:57 +0800 | [diff] [blame] | 169 | /** |
| 170 | * hdd_init_tdls_config() - initialize tdls config |
| 171 | * @tdls_cfg: pointer to tdls_start_params structure |
| 172 | * |
| 173 | * Return: none |
| 174 | */ |
| 175 | void hdd_init_tdls_config(struct tdls_start_params *tdls_cfg); |
| 176 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 177 | #else |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 178 | |
Jeff Johnson | af772ed | 2017-08-28 11:40:36 -0700 | [diff] [blame] | 179 | static inline int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx, |
Jeff Johnson | 327b9d4 | 2017-08-29 14:20:07 -0700 | [diff] [blame] | 180 | struct hdd_adapter *adapter, |
Archana Ramachandran | 2ad7de2 | 2016-04-22 16:53:25 -0700 | [diff] [blame] | 181 | uint32_t mode) |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 182 | { |
| 183 | return 0; |
| 184 | } |
Kabilan Kannan | d053aaf | 2016-10-26 02:06:14 -0700 | [diff] [blame] | 185 | |
| 186 | static inline int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, |
| 187 | struct wireless_dev *wdev, |
| 188 | const void *data, |
| 189 | int data_len) |
| 190 | { |
| 191 | return 0; |
| 192 | } |
| 193 | |
Jeff Johnson | 1d40f5b | 2018-03-02 08:35:53 -0800 | [diff] [blame] | 194 | static inline |
| 195 | QDF_STATUS hdd_tdls_register_peer(void *userdata, uint32_t vdev_id, |
| 196 | const uint8_t *mac, uint16_t sta_id, |
jiad | 7b8a5e0 | 2018-11-26 16:37:57 +0800 | [diff] [blame] | 197 | uint8_t qos) |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 198 | { |
jiad | 7b8a5e0 | 2018-11-26 16:37:57 +0800 | [diff] [blame] | 199 | return QDF_STATUS_SUCCESS; |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 200 | } |
| 201 | |
Jeff Johnson | 1d40f5b | 2018-03-02 08:35:53 -0800 | [diff] [blame] | 202 | static inline |
| 203 | QDF_STATUS hdd_tdls_deregister_peer(void *userdata, uint32_t vdev_id, |
| 204 | uint8_t sta_id) |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 205 | { |
jiad | 7b8a5e0 | 2018-11-26 16:37:57 +0800 | [diff] [blame] | 206 | return QDF_STATUS_SUCCESS; |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 207 | } |
jiad | 7b8a5e0 | 2018-11-26 16:37:57 +0800 | [diff] [blame] | 208 | |
| 209 | static inline void hdd_init_tdls_config(struct tdls_start_params *tdls_cfg) |
| 210 | { |
| 211 | } |
| 212 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 213 | #endif /* End of FEATURE_WLAN_TDLS */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 214 | #endif /* __HDD_TDLS_H */ |