Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011-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 | /** |
| 20 | * DOC: wlan_hdd_wext.c |
| 21 | * |
| 22 | * Linux Wireless Extensions Implementation |
| 23 | */ |
| 24 | |
| 25 | #include <linux/version.h> |
| 26 | #include <linux/module.h> |
| 27 | #include <linux/kernel.h> |
| 28 | #include <linux/init.h> |
| 29 | #include <linux/wireless.h> |
| 30 | #include <mac_trace.h> |
| 31 | #include <wlan_hdd_includes.h> |
| 32 | #include <cds_api.h> |
Rajeev Kumar | ea95edd | 2017-01-11 20:49:36 -0800 | [diff] [blame] | 33 | #include "scheduler_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 34 | #include <net/arp.h> |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 35 | #include <cdp_txrx_cmn.h> |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 36 | #include <cdp_txrx_stats.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 37 | #include "sir_params.h" |
| 38 | #include "csr_api.h" |
| 39 | #include "csr_inside_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 40 | #include "sme_rrm_internal.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | #include <ani_global.h> |
| 42 | #include "dot11f.h" |
| 43 | #include <wlan_hdd_wowl.h> |
| 44 | #include <wlan_hdd_cfg.h> |
| 45 | #include <wlan_hdd_wmm.h> |
| 46 | #include "utils_api.h" |
| 47 | #include "wlan_hdd_p2p.h" |
| 48 | #ifdef FEATURE_WLAN_TDLS |
| 49 | #include "wlan_hdd_tdls.h" |
| 50 | #endif |
| 51 | |
| 52 | #include "cds_ieee80211_common.h" |
| 53 | #include "ol_if_athvar.h" |
| 54 | #include "dbglog_host.h" |
| 55 | #include "wma.h" |
| 56 | |
| 57 | #include "wlan_hdd_power.h" |
| 58 | #include "qwlan_version.h" |
| 59 | #include "wlan_hdd_host_offload.h" |
| 60 | |
| 61 | #include <linux/wireless.h> |
| 62 | #include <net/cfg80211.h> |
| 63 | |
| 64 | #include "wlan_hdd_misc.h" |
| 65 | |
| 66 | #include "qc_sap_ioctl.h" |
| 67 | #include "sme_api.h" |
| 68 | #include "wma_types.h" |
Dustin Brown | 6fb7a75 | 2018-11-30 11:33:57 -0800 | [diff] [blame] | 69 | #include "qdf_hashtable_test.h" |
Dustin Brown | d315c45 | 2018-11-27 11:28:48 -0800 | [diff] [blame] | 70 | #include "qdf_talloc_test.h" |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 71 | #include "qdf_str.h" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 72 | #include "qdf_trace.h" |
Dustin Brown | ebb16d1 | 2018-11-29 17:52:07 -0800 | [diff] [blame] | 73 | #include "qdf_types_test.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 74 | #include "wlan_hdd_assoc.h" |
| 75 | #include "wlan_hdd_ioctl.h" |
| 76 | #include "wlan_hdd_scan.h" |
| 77 | #include "sme_power_save_api.h" |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 78 | #include "wlan_policy_mgr_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | #include "wlan_hdd_conc_ut.h" |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 80 | #include "wlan_hdd_fips.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 81 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 82 | #include "wlan_hdd_ocb.h" |
| 83 | #include "wlan_hdd_napi.h" |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 84 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 85 | #include "wlan_hdd_nan_datapath.h" |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 86 | #include "wlan_hdd_stats.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 87 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 88 | #include "wlan_hdd_driver_ops.h" |
| 89 | #include "hif.h" |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 90 | #include "pld_common.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 91 | #endif |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 92 | #include "wlan_hdd_lro.h" |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 93 | #include "cds_utils.h" |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 94 | #include "wlan_osif_request_manager.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 95 | #include "os_if_wifi_pos.h" |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 96 | #include <cdp_txrx_stats.h> |
| 97 | #include <cds_api.h> |
Dustin Brown | 6099ddc | 2018-07-06 14:32:53 -0700 | [diff] [blame] | 98 | #include "wlan_dsc_test.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 99 | #include <wlan_osif_priv.h> |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 100 | #include "wlan_hdd_regulatory.h" |
| 101 | #include "wlan_reg_ucfg_api.h" |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 102 | #include "wlan_hdd_packet_filter_api.h" |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 103 | #include "wlan_cp_stats_mc_ucfg_api.h" |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 104 | #include "wlan_mlme_ucfg_api.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 105 | #include "cfg_mlme_sta.h" |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 106 | #include "wlan_mlme_public_struct.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 107 | #include "cfg_ucfg_api.h" |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 108 | #include "wlan_policy_mgr_ucfg.h" |
Harprit Chhabada | bec6de4 | 2018-09-10 10:21:15 -0700 | [diff] [blame] | 109 | #include "wlan_mlme_public_struct.h" |
| 110 | #include "cfg_ucfg_api.h" |
| 111 | #include "cfg_mlme_threshold.h" |
Wu Gao | 66454f1 | 2018-09-26 19:55:41 +0800 | [diff] [blame] | 112 | #include "wlan_pmo_cfg.h" |
| 113 | #include "wlan_pmo_ucfg_api.h" |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 114 | #include "dp_txrx.h" |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 115 | #include "wlan_fwol_ucfg_api.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 116 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 117 | /* Private ioctls and their sub-ioctls */ |
| 118 | #define WLAN_PRIV_SET_INT_GET_NONE (SIOCIWFIRSTPRIV + 0) |
| 119 | #define WE_SET_11D_STATE 1 |
| 120 | #define WE_WOWL 2 |
| 121 | #define WE_SET_POWER 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 122 | /* |
| 123 | * <ioctl> |
| 124 | * setMaxAssoc - Sets the maximum number of associated stations |
| 125 | * |
| 126 | * @INPUT: 1 to 32 |
| 127 | * |
| 128 | * @OUTPUT: None |
| 129 | * |
| 130 | * This IOTCL sets the maximum number of associated stations |
| 131 | * |
| 132 | * @E.g: iwpriv wlan0 setMaxAssoc <value> |
| 133 | * |
| 134 | * Supported Feature: STA |
| 135 | * |
| 136 | * Usage: Internal/External |
| 137 | * |
| 138 | * </ioctl> |
| 139 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 140 | #define WE_SET_MAX_ASSOC 4 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 141 | /* |
| 142 | * <ioctl> |
Jeff Johnson | f2cf659 | 2018-05-06 16:27:44 -0700 | [diff] [blame] | 143 | * scan_disable - Disable scan |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 144 | * |
| 145 | * @INPUT: set_value |
| 146 | * |
| 147 | * @OUTPUT: None |
| 148 | * |
| 149 | * This IOCTL is used to set disable scan |
| 150 | * |
| 151 | * @E.g: iwpriv wlan0 scan_disable 1 |
| 152 | * |
| 153 | * Supported Feature: Scan |
| 154 | * |
| 155 | * Usage: Internal/External |
| 156 | * |
| 157 | * </ioctl> |
| 158 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 159 | #define WE_SET_SCAN_DISABLE 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 160 | /* |
| 161 | * <ioctl> |
| 162 | * inactivityTO - sets the timeout value for inactivity data while |
| 163 | * in power save mode |
| 164 | * |
| 165 | * @INPUT: int1…..int255 |
| 166 | * |
| 167 | * @OUTPUT: None |
| 168 | * |
| 169 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 170 | * |
| 171 | * @E.g: iwpriv wlan0 inactivityTO 20 |
| 172 | * |
| 173 | * Supported Feature: STA |
| 174 | * |
| 175 | * Usage: Internal/External |
| 176 | * |
| 177 | * </ioctl> |
| 178 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 179 | #define WE_SET_DATA_INACTIVITY_TO 6 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 180 | /* |
| 181 | * <ioctl> |
| 182 | * setMaxTxPower - Dynamically sets the maximum transmission power |
| 183 | * |
| 184 | * @INPUT: Transmission power in dBm |
| 185 | * |
| 186 | * @OUTPUT: None |
| 187 | * |
| 188 | * This IOCTL dynamically sets the maximum transmission power |
| 189 | * This setting does not persist over reboots |
| 190 | * |
| 191 | * @E.g: iwpriv wlan0 setMaxTxPower <value in db) |
| 192 | * |
| 193 | * Supported Feature: STA |
| 194 | * |
| 195 | * Usage: Internal/External |
| 196 | * |
| 197 | * </ioctl> |
| 198 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | #define WE_SET_MAX_TX_POWER 7 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 200 | |
| 201 | #ifdef HASTINGS_BT_WAR |
| 202 | /* Temporary WAR for Hastings 1.1 only */ |
| 203 | #define WE_SET_HASTINGS_BT_WAR 8 |
| 204 | #endif |
| 205 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 206 | #define WE_SET_TM_LEVEL 9 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 207 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 208 | /* |
| 209 | * <ioctl> |
| 210 | * setphymode - Set the phymode dynamically |
| 211 | * |
| 212 | * @INPUT: 0 IEEE80211_MODE_AUTO to 22 IEEE80211_MODE_11AGN |
| 213 | * |
| 214 | * @OUTPUT: None |
| 215 | * |
| 216 | * This IOCTL sets the phymode dynamically |
| 217 | * |
| 218 | * @E.g: iwpriv wlan0 setphymode 10 |
| 219 | * |
| 220 | * Supported Feature: STA |
| 221 | * |
| 222 | * Usage: Internal/External |
| 223 | * |
| 224 | * </ioctl> |
| 225 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 226 | #define WE_SET_PHYMODE 10 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 227 | /* |
| 228 | * <ioctl> |
| 229 | * nss - Set the number of spatial streams |
| 230 | * |
| 231 | * @INPUT: int1…..int3 |
| 232 | * |
| 233 | * @OUTPUT: None |
| 234 | * |
| 235 | * This IOCTL sets the number of spatial streams. Supported values are 1 and 2 |
| 236 | * |
| 237 | * @E.g: iwpriv wlan0 nss 2 |
| 238 | * |
| 239 | * Supported Feature: STA |
| 240 | * |
| 241 | * Usage: Internal/External |
| 242 | * |
| 243 | * </ioctl> |
| 244 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | #define WE_SET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 246 | /* |
| 247 | * <ioctl> |
| 248 | * ldpc - Enables or disables LDPC |
| 249 | * |
| 250 | * @INPUT: 0 – Disable, 1 - Enable |
| 251 | * |
| 252 | * @OUTPUT: None |
| 253 | * |
| 254 | * This IOCTL enables or disables LDPC |
| 255 | * |
| 256 | * @E.g: iwpriv wlan0 ldpc 1 |
| 257 | * |
| 258 | * Supported Feature: STA |
| 259 | * |
| 260 | * Usage: Internal/External |
| 261 | * |
| 262 | * </ioctl> |
| 263 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 264 | #define WE_SET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 265 | /* |
| 266 | * <ioctl> |
| 267 | * tx_stbc - Enables or disables tx_stbc |
| 268 | * |
| 269 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 270 | * |
| 271 | * @OUTPUT: None |
| 272 | * |
| 273 | * This IOTCL used to enables or disables tx_stbc |
| 274 | * |
| 275 | * @E.g: iwpriv wlan0 tx_stbc <value> |
| 276 | * |
| 277 | * Supported Feature: STA |
| 278 | * |
| 279 | * Usage: Internal/External |
| 280 | * |
| 281 | * </ioctl> |
| 282 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | #define WE_SET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 284 | /* |
| 285 | * <ioctl> |
| 286 | * rx_stbc - Set the rx_stbc parameter |
| 287 | * |
| 288 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 289 | * |
| 290 | * @OUTPUT: None |
| 291 | * |
| 292 | * This IOTCL used to set rx_stbc parameter |
| 293 | * |
| 294 | * @E.g: iwpriv wlan0 rx_stbc <value> |
| 295 | * |
| 296 | * Supported Feature: STA |
| 297 | * |
| 298 | * Usage: Internal/External |
| 299 | * |
| 300 | * </ioctl> |
| 301 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 302 | #define WE_SET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 303 | /* |
| 304 | * <ioctl> |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 305 | * shortgi - Sets the short-guard interval |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 306 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 307 | * @INPUT: Fixed Rate: 0 - 400ns, 1 - 800ns, 2 - 1600ns, 3 - 3200us |
| 308 | * Auto Rate: 8 - 400ns, 9 - 800ns, 10 - 1600ns, 11 - 3200us |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 309 | * |
| 310 | * @OUTPUT: None |
| 311 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 312 | * This IOCTL sets the short-guard interval. |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 313 | * |
| 314 | * @E.g: iwpriv wlan0 shortgi <value> |
| 315 | * |
| 316 | * Supported Feature: STA |
| 317 | * |
| 318 | * Usage: Internal/External |
| 319 | * |
| 320 | * </ioctl> |
| 321 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 322 | #define WE_SET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 323 | /* |
| 324 | * <ioctl> |
| 325 | * enablertscts - enables or disables rts/cts. |
| 326 | * |
| 327 | * @INPUT: 1-Enable , 0-Disable |
| 328 | * |
| 329 | * @OUTPUT: None |
| 330 | * |
| 331 | * This IOCTL enables or disables rts/cts. |
| 332 | * |
| 333 | * @E.g: iwpriv wlan0 enablertscts <value> |
| 334 | * |
| 335 | * Supported Feature: STA |
| 336 | * |
| 337 | * Usage: Internal/External |
| 338 | * |
| 339 | * </ioctl> |
| 340 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 341 | #define WE_SET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 342 | /* |
| 343 | * <ioctl> |
| 344 | * chwidth - Set the channel bandwidth |
| 345 | * |
| 346 | * @INPUT: 0-20mhz to 3-160mhz |
| 347 | * |
| 348 | * @OUTPUT: None |
| 349 | * |
| 350 | * This IOTCL used to set the channel bandwidth |
| 351 | * |
| 352 | * @E.g: iwpriv wlan0 chwidth 1 |
| 353 | * |
| 354 | * Supported Feature: STA |
| 355 | * |
| 356 | * Usage: Internal/External |
| 357 | * |
| 358 | * </ioctl> |
| 359 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 360 | #define WE_SET_CHWIDTH 17 |
| 361 | #define WE_SET_ANI_EN_DIS 18 |
| 362 | #define WE_SET_ANI_POLL_PERIOD 19 |
| 363 | #define WE_SET_ANI_LISTEN_PERIOD 20 |
| 364 | #define WE_SET_ANI_OFDM_LEVEL 21 |
| 365 | #define WE_SET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 366 | /* |
| 367 | * <ioctl> |
| 368 | * cwmenable - Enables or disables the dynamic channel bandwidth |
| 369 | * |
| 370 | * @INPUT: 0-Disable, 1-Enable |
| 371 | * |
| 372 | * @OUTPUT: None |
| 373 | * |
| 374 | * This IOTCL used to enables or disables the dynamic channel bandwidth |
| 375 | * |
| 376 | * @E.g: iwpriv wlan0 cwmenable <value> |
| 377 | * |
| 378 | * Supported Feature: STA |
| 379 | * |
| 380 | * Usage: Internal/External |
| 381 | * |
| 382 | * </ioctl> |
| 383 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 384 | #define WE_SET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 385 | /* |
| 386 | * <ioctl> |
| 387 | * txchainmask - This IOCTL sets the current Tx chain mask |
| 388 | * |
| 389 | * @INPUT: Mask Value |
| 390 | * |
| 391 | * @OUTPUT: None |
| 392 | * |
| 393 | * This IOCTL sets the current Tx chain mask |
| 394 | * |
| 395 | * @E.g: iwpriv wlan0 txchainmask 1 |
| 396 | * |
| 397 | * Supported Feature: STA |
| 398 | * |
| 399 | * Usage: Internal/External |
| 400 | * |
| 401 | * </ioctl> |
| 402 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 403 | #define WE_SET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 404 | /* |
| 405 | * <ioctl> |
| 406 | * rxchainmask - Sets the current Rx chain mask |
| 407 | * |
| 408 | * @INPUT: Mask Value |
| 409 | * |
| 410 | * @OUTPUT: None |
| 411 | * |
| 412 | * This IOCTL sets the current Rx chain mask. This command is the |
| 413 | * equivalent to setting in gSetRxChainmask1x1 in WCNSS_qcom_cfg.ini. |
| 414 | * |
| 415 | * @E.g: iwpriv wlan0 rxchainmask <value> |
| 416 | * |
| 417 | * Supported Feature: STA |
| 418 | * |
| 419 | * Usage: Internal/External |
| 420 | * |
| 421 | * </ioctl> |
| 422 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | #define WE_SET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 424 | /* |
| 425 | * <ioctl> |
| 426 | * set11NRates - Fixes the Tx data rate of the 11N mode. |
| 427 | * |
| 428 | * @INPUT: 0x1b to 0x8f |
| 429 | * |
| 430 | * @OUTPUT: None |
| 431 | * |
| 432 | * This IOCTL fixes the Tx data rate of the 11N mode. |
| 433 | * |
| 434 | * @E.g: iwpriv wlan0 set11NRates 0x85 |
| 435 | * |
| 436 | * Supported Feature: STA |
| 437 | * |
| 438 | * Usage: Internal/External |
| 439 | * |
| 440 | * </ioctl> |
| 441 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 442 | #define WE_SET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 443 | /* |
| 444 | * <ioctl> |
| 445 | * ampdu - Set the the maximum subframe of ampdu |
| 446 | * |
| 447 | * @INPUT: int 1 to int 63 |
| 448 | * |
| 449 | * @OUTPUT: None |
| 450 | * |
| 451 | * This IOCTL sets the maximum subframe of ampdu. |
| 452 | * |
| 453 | * @E.g: iwpriv wlan0 ampdu 9 |
| 454 | * |
| 455 | * Supported Feature: STA |
| 456 | * |
| 457 | * Usage: Internal/External |
| 458 | * |
| 459 | * </ioctl> |
| 460 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 461 | #define WE_SET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 462 | /* |
| 463 | * <ioctl> |
| 464 | * amsdu - Sets the maximum subframe of amsdu. |
| 465 | * |
| 466 | * @INPUT: int 1 to int 31 |
| 467 | * |
| 468 | * @OUTPUT: None |
| 469 | * |
| 470 | * This IOCTL sets the maximum subframe of amsdu. |
| 471 | * |
| 472 | * @E.g: iwpriv wlan0 amsdu 9 |
| 473 | * |
| 474 | * Supported Feature: STA |
| 475 | * |
| 476 | * Usage: Internal/External |
| 477 | * |
| 478 | * </ioctl> |
| 479 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 480 | #define WE_SET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 481 | /* |
| 482 | * <ioctl> |
| 483 | * txpow2g - current 2 GHz Tx power setting |
| 484 | * |
| 485 | * @INPUT: Tx power in dBm |
| 486 | * |
| 487 | * @OUTPUT: None |
| 488 | * |
| 489 | * This IOTCL used to set 2 ghz tx power |
| 490 | * |
| 491 | * @E.g: iwpriv wlan0 txpow2g |
| 492 | * |
| 493 | * Supported Feature: STA |
| 494 | * |
| 495 | * Usage: Internal/External |
| 496 | * |
| 497 | * </ioctl> |
| 498 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 499 | #define WE_SET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 500 | /* |
| 501 | * <ioctl> |
| 502 | * txpow5g - Current 5 GHz tx power setting |
| 503 | * |
| 504 | * @INPUT: Tx power in dBm |
| 505 | * |
| 506 | * @OUTPUT: None |
| 507 | * |
| 508 | * This IOTCL used to set the 5 ghz txpower |
| 509 | * |
| 510 | * @E.g: iwpriv wlan0 txpow5g |
| 511 | * |
| 512 | * Supported Feature: STA |
| 513 | * |
| 514 | * Usage: Internal/External |
| 515 | * |
| 516 | * </ioctl> |
| 517 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 518 | #define WE_SET_TXPOW_5G 30 |
| 519 | /* Private ioctl for firmware debug log */ |
| 520 | #define WE_DBGLOG_LOG_LEVEL 31 |
| 521 | #define WE_DBGLOG_VAP_ENABLE 32 |
| 522 | #define WE_DBGLOG_VAP_DISABLE 33 |
| 523 | #define WE_DBGLOG_MODULE_ENABLE 34 |
| 524 | #define WE_DBGLOG_MODULE_DISABLE 35 |
| 525 | #define WE_DBGLOG_MOD_LOG_LEVEL 36 |
| 526 | #define WE_DBGLOG_TYPE 37 |
| 527 | #define WE_SET_TXRX_FWSTATS 38 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 528 | /* |
| 529 | * <ioctl> |
| 530 | * set11ACRates - Fixes the Tx data rate of 11AC |
| 531 | * |
| 532 | * @INPUT: 0x1 to 0x9 |
| 533 | * |
| 534 | * @OUTPUT: None |
| 535 | * |
| 536 | * This IOCTL fixes the Tx data rate of 11AC. |
| 537 | * |
| 538 | * @E.g: iwpriv wlan0 set11ACRates 0x9 |
| 539 | * |
| 540 | * Supported Feature: STA |
| 541 | * |
| 542 | * Usage: Internal/External |
| 543 | * |
| 544 | * </ioctl> |
| 545 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 546 | #define WE_SET_VHT_RATE 39 |
| 547 | #define WE_DBGLOG_REPORT_ENABLE 40 |
| 548 | #define WE_TXRX_FWSTATS_RESET 41 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 549 | /* |
| 550 | * <ioctl> |
| 551 | * setTxMaxPower2G - Set the maximum transmit power for the 2.4-GHz band |
| 552 | * |
| 553 | * @INPUT: Transmission power in dBm |
| 554 | * |
| 555 | * @OUTPUT: None |
| 556 | * |
| 557 | * This IOCTL sets the maximum transmit power for the 2.4-GHz band |
| 558 | * This setting does not persist over reboots |
| 559 | * |
| 560 | * @E.g: iwpriv wlan0 setTxMaxPower2G 10 |
| 561 | * |
| 562 | * Supported Feature: STA |
| 563 | * |
| 564 | * Usage: Internal/External |
| 565 | * |
| 566 | * </ioctl> |
| 567 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 568 | #define WE_SET_MAX_TX_POWER_2_4 42 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 569 | /* |
| 570 | * <ioctl> |
| 571 | * setTxMaxPower5G - Set the maximum transmit power for the 5-GHz band |
| 572 | * |
| 573 | * @INPUT: Transmission power in dBm |
| 574 | * |
| 575 | * @OUTPUT: None |
| 576 | * |
| 577 | * This IOCTL sets the maximum transmit power for the 5-GHz band |
| 578 | * This setting does not persist over reboots |
| 579 | * |
| 580 | * @E.g: iwpriv wlan0 setTxMaxPower5G 10 |
| 581 | * |
| 582 | * Supported Feature: STA |
| 583 | * |
| 584 | * Usage: Internal/External |
| 585 | * |
| 586 | * </ioctl> |
| 587 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 588 | #define WE_SET_MAX_TX_POWER_5_0 43 |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 589 | #define WE_SET_PKTLOG 44 |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 590 | /* Private ioctl for packet power save */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 591 | #define WE_PPS_PAID_MATCH 45 |
| 592 | #define WE_PPS_GID_MATCH 46 |
| 593 | #define WE_PPS_EARLY_TIM_CLEAR 47 |
| 594 | #define WE_PPS_EARLY_DTIM_CLEAR 48 |
| 595 | #define WE_PPS_EOF_PAD_DELIM 49 |
| 596 | #define WE_PPS_MACADDR_MISMATCH 50 |
| 597 | #define WE_PPS_DELIM_CRC_FAIL 51 |
| 598 | #define WE_PPS_GID_NSTS_ZERO 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 599 | /* |
| 600 | * <ioctl> |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 601 | * rssi_chk - Check the rssi |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 602 | * |
| 603 | * @INPUT: One argument as input |
| 604 | * |
| 605 | * @OUTPUT: rssi |
| 606 | * wlan0 rssi_chk:56 |
| 607 | * |
| 608 | * This IOTCL used to chek rssi |
| 609 | * |
| 610 | * @E.g: iwpriv wlan0 rssi_chk <value> |
| 611 | * |
| 612 | * Supported Feature: STA |
| 613 | * |
| 614 | * Usage: Internal/External |
| 615 | * |
| 616 | * </ioctl> |
| 617 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 618 | #define WE_PPS_RSSI_CHECK 53 |
Agrawal Ashish | bafaff1 | 2016-12-27 17:43:08 +0530 | [diff] [blame] | 619 | /* |
| 620 | * <ioctl> |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 621 | * htsmps - Sets the htsmps |
| 622 | * |
| 623 | * @INPUT: Atleast one int argument |
| 624 | * |
| 625 | * @OUTPUT: None |
| 626 | * |
| 627 | * This IOTCL used to set htsmps |
| 628 | * |
| 629 | * @E.g: iwpriv wlan0 htsmps <value> |
| 630 | * |
| 631 | * Supported Feature: STA |
| 632 | * |
| 633 | * Usage: Internal/External |
| 634 | * |
| 635 | * </ioctl> |
| 636 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 637 | #define WE_SET_HTSMPS 55 |
| 638 | /* Private ioctl for QPower */ |
| 639 | #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 |
| 640 | #define WE_SET_QPOWER_MAX_TX_BEFORE_WAKE 57 |
| 641 | #define WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 58 |
| 642 | #define WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 643 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 644 | /* |
| 645 | * <ioctl> |
| 646 | * gtxHTMcs - Set the tx HTM value |
| 647 | * |
| 648 | * @INPUT: Atleast one int orgument |
| 649 | * |
| 650 | * @OUTPUT: None |
| 651 | * |
| 652 | * This IOTCL sets htm tx value |
| 653 | * |
| 654 | * @E.g: iwpriv wlan0 gtxHTMcs <value> |
| 655 | * |
| 656 | * Supported Feature: STA |
| 657 | * |
| 658 | * Usage: Internal/External |
| 659 | * |
| 660 | * </ioctl> |
| 661 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 662 | #define WE_SET_GTX_HT_MCS 62 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 663 | /* |
| 664 | * <ioctl> |
| 665 | * gtxVHTMcs - Set gtxVHTMcs value |
| 666 | * |
| 667 | * @INPUT: Atleast one int argument |
| 668 | * |
| 669 | * @OUTPUT: None |
| 670 | * |
| 671 | * This IOTCL used to set gtxVHTMcs value |
| 672 | * |
| 673 | * @E.g: iwpriv wlan0 gtxVHTMcs <value> |
| 674 | * |
| 675 | * Supported Feature: STA |
| 676 | * |
| 677 | * Usage: Internal/External |
| 678 | * |
| 679 | * </ioctl> |
| 680 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 681 | #define WE_SET_GTX_VHT_MCS 63 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 682 | /* |
| 683 | * <ioctl> |
| 684 | * gtxUsrCfg - Host request for GTX mask |
| 685 | * |
| 686 | * @INPUT: Atleast one int orgument |
| 687 | * |
| 688 | * @OUTPUT: None |
| 689 | * |
| 690 | * This IOTCL used send the host request for GTX mask |
| 691 | * |
| 692 | * @E.g: iwpriv wlan0 gtxUsrCfg <value> |
| 693 | * |
| 694 | * Supported Feature: STA |
| 695 | * |
| 696 | * Usage: Internal/External |
| 697 | * |
| 698 | * </ioctl> |
| 699 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 700 | #define WE_SET_GTX_USRCFG 64 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 701 | /* |
| 702 | * <ioctl> |
| 703 | * gtxThre - Set the tx threshold |
| 704 | * |
| 705 | * @INPUT: Atleast one int argument |
| 706 | * |
| 707 | * @OUTPUT: None |
| 708 | * |
| 709 | * This IOTCL used to set tx threshold |
| 710 | * |
| 711 | * @E.g: iwpriv wlan0 gtxThre <value> |
| 712 | * |
| 713 | * Supported Feature: STA |
| 714 | * |
| 715 | * Usage: Internal/External |
| 716 | * |
| 717 | * </ioctl> |
| 718 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 719 | #define WE_SET_GTX_THRE 65 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 720 | /* |
| 721 | * <ioctl> |
| 722 | * gtxMargin - Set the gtxMargin |
| 723 | * |
| 724 | * @INPUT: 1 to 32 |
| 725 | * |
| 726 | * @OUTPUT: None |
| 727 | * |
| 728 | * This IOTCL use dto set gtxMargin |
| 729 | * |
| 730 | * @E.g: iwpriv wlan0 gtxMargini <value> |
| 731 | * |
| 732 | * Supported Feature: STA |
| 733 | * |
| 734 | * Usage: Internal/External |
| 735 | * |
| 736 | * </ioctl> |
| 737 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 738 | #define WE_SET_GTX_MARGIN 66 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 739 | /* |
| 740 | * <ioctl> |
| 741 | * gtxStep - Set the gtxStep |
| 742 | * |
| 743 | * @INPUT: None |
| 744 | * |
| 745 | * @OUTPUT: None |
| 746 | * |
| 747 | * This IOTCL used to sets gtxStep |
| 748 | * |
| 749 | * @E.g: iwpriv wlan0 gtxStep <value> |
| 750 | * |
| 751 | * Supported Feature: STA |
| 752 | * |
| 753 | * Usage: Internal/External |
| 754 | * |
| 755 | * </ioctl> |
| 756 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 757 | #define WE_SET_GTX_STEP 67 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 758 | /* |
| 759 | * <ioctl> |
| 760 | * gtxMinTpc - Sets the gtxMinTpc |
| 761 | * |
| 762 | * @INPUT: Atleast one int argument |
| 763 | * |
| 764 | * @OUTPUT: None |
| 765 | * |
| 766 | * This IOTCL sets the tx MinTpc |
| 767 | * |
| 768 | * @E.g: iwpriv wlan0 gtxMinTpc <value> |
| 769 | * |
| 770 | * Supported Feature: STA |
| 771 | * |
| 772 | * Usage: Internal/External |
| 773 | * |
| 774 | * </ioctl> |
| 775 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 776 | #define WE_SET_GTX_MINTPC 68 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 777 | /* |
| 778 | * <ioctl> |
| 779 | * gtxBWMask - Sets the BW mask (20/40/80/160 Mhz) |
| 780 | * |
| 781 | * @INPUT: Mask value |
| 782 | * |
| 783 | * @OUTPUT: None |
| 784 | * |
| 785 | * This IOTCL used to set gtxBWMask |
| 786 | * |
| 787 | * @E.g: iwpriv wlan0 gtxBWMask <value> |
| 788 | * |
| 789 | * Supported Feature: STA |
| 790 | * |
| 791 | * Usage: Internal/External |
| 792 | * |
| 793 | * </ioctl> |
| 794 | */ |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 795 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 796 | #define WE_SET_GTX_BWMASK 69 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 797 | /* |
| 798 | * <ioctl> |
| 799 | * setMccLatency - Sets the MCC latency value during STA-P2P concurrency |
| 800 | * |
| 801 | * @INPUT: set_value |
| 802 | * |
| 803 | * @OUTPUT: None |
| 804 | * |
| 805 | * This IOCTL is used to set the MCC latency value in milliseconds |
| 806 | * during STA-P2P concurrency. |
| 807 | * |
| 808 | * If 0ms latency is provided, then FW will set to a default. |
| 809 | * Otherwise, latency must be at least 30ms. |
| 810 | * |
| 811 | * @E.g: iwpriv wlan0 setMccLatency 40 |
| 812 | * |
| 813 | * |
| 814 | * Supported Feature: Concurrency |
| 815 | * |
| 816 | * Usage: Internal/External |
| 817 | * |
| 818 | * </ioctl> |
| 819 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 820 | #define WE_MCC_CONFIG_LATENCY 70 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 821 | |
| 822 | /* |
| 823 | * <ioctl> |
| 824 | * setMccQuota- Set the quota for P2P cases |
| 825 | * |
| 826 | * @INPUT: set_value [0,100] |
| 827 | * |
| 828 | * @OUTPUT: None |
| 829 | * |
| 830 | * This IOCTL is used to set the quota in milliseconds for P2P_GO/STA. |
| 831 | * |
| 832 | * Currently used to set time quota for 2 MCC vdevs/adapters using |
| 833 | * (operating channel, quota) for each mode. |
| 834 | * The info is provided run time using iwpriv command: |
| 835 | * iwpriv <wlan0 | p2p0> setMccQuota <quota in ms>. |
| 836 | * Note: the quota provided in command is for the same mode in cmd. |
| 837 | * HDD checks if MCC mode is active, gets the second mode and its |
| 838 | * operating chan. |
| 839 | * Quota for the 2nd role is calculated as 100 - quota of first mode. |
| 840 | * |
| 841 | * @E.g: iwpriv wlan0 setMccQuota 50 |
| 842 | * iwpriv p2p0 setMccQuota 50 |
| 843 | * |
| 844 | * Supported Feature: Concurrency |
| 845 | * |
| 846 | * Usage: Internal/External |
| 847 | * |
| 848 | * </ioctl> |
| 849 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 850 | #define WE_MCC_CONFIG_QUOTA 71 |
| 851 | /* Private IOCTL for debug connection issues */ |
| 852 | #define WE_SET_DEBUG_LOG 72 |
| 853 | #ifdef WE_SET_TX_POWER |
| 854 | #undef WE_SET_TX_POWER |
| 855 | #endif |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 856 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 857 | /* |
| 858 | * <ioctl> |
| 859 | * setTxPower - Set the current transmit power |
| 860 | * |
| 861 | * @INPUT: Transmission power in dBm |
| 862 | * |
| 863 | * @OUTPUT: None |
| 864 | * |
| 865 | * This IOCTL sets the current transmit power. |
| 866 | * This setting does not persist over reboots. |
| 867 | * |
| 868 | * @E.g: iwpriv wlan0 setTxPower 10 |
| 869 | * |
| 870 | * Supported Feature: STA |
| 871 | * |
| 872 | * Usage: Internal/External |
| 873 | * |
| 874 | * </ioctl> |
| 875 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 876 | #define WE_SET_TX_POWER 74 |
| 877 | /* Private ioctl for earlyrx power save feature */ |
| 878 | #define WE_SET_EARLY_RX_ADJUST_ENABLE 75 |
| 879 | #define WE_SET_EARLY_RX_TGT_BMISS_NUM 76 |
| 880 | #define WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE 77 |
| 881 | #define WE_SET_EARLY_RX_SLOP_STEP 78 |
| 882 | #define WE_SET_EARLY_RX_INIT_SLOP 79 |
| 883 | #define WE_SET_EARLY_RX_ADJUST_PAUSE 80 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 884 | /* |
| 885 | * <ioctl> |
| 886 | * setMcRate - Set the data rate for multicast data |
| 887 | * |
| 888 | * @INPUT: 1 to 32 |
| 889 | * |
| 890 | * @OUTPUT: None |
| 891 | * |
| 892 | * This IOCTL sets the data rate for multicast data. Note that this command |
| 893 | * is allowed only in STA, IBSS, or QCMobileAP mode |
| 894 | * |
| 895 | * @E.g: iwpriv wlan0 setMcRate <value> |
| 896 | * |
| 897 | * Supported Feature: STA |
| 898 | * |
| 899 | * Usage: Internal/External |
| 900 | * |
| 901 | * </ioctl> |
| 902 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 903 | #define WE_SET_MC_RATE 81 |
| 904 | #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 |
| 905 | /* Private ioctl for packet power save */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 906 | /* |
| 907 | * <ioctl> |
| 908 | * 5g_ebt - Sets the 5g_ebt |
| 909 | * |
| 910 | * @INPUT: <value> |
| 911 | * |
| 912 | * @OUTPUT: None |
| 913 | * |
| 914 | * This IOTCL used to set 5g_ebt |
| 915 | * |
| 916 | * @E.g: iwpriv wlan0 5g_ebt <value> |
| 917 | * |
| 918 | * Supported Feature: STA |
| 919 | * |
| 920 | * Usage: Internal/External |
| 921 | * |
| 922 | * </ioctl> |
| 923 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | #define WE_PPS_5G_EBT 83 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 925 | /* |
| 926 | * <ioctl> |
| 927 | * cts_cbw - Set CTS channel BW for dynamic BW adjustment |
| 928 | * |
| 929 | * @INPUT: 20 t0 160 |
| 930 | * |
| 931 | * @OUTPUT: None |
| 932 | * |
| 933 | * This IOTCL used to set CTS channel BW for dynamic BW adjustment |
| 934 | * |
| 935 | * @E.g: iwpriv wlan0 cts_cbw <value> |
| 936 | * |
| 937 | * Supported Feature: STA |
| 938 | * |
| 939 | * Usage: Internal/External |
| 940 | * |
| 941 | * </ioctl> |
| 942 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 943 | #define WE_SET_CTS_CBW 84 |
| 944 | #define WE_DUMP_STATS 85 |
| 945 | #define WE_CLEAR_STATS 86 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 946 | /* Private sub ioctl for starting/stopping the profiling */ |
| 947 | #define WE_START_FW_PROFILE 87 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 948 | |
Abhishek Singh | 3c50701 | 2016-12-01 11:15:42 +0530 | [diff] [blame] | 949 | /* |
| 950 | * <ioctl> |
| 951 | * setChanChange - Initiate channel change |
| 952 | * |
| 953 | * @INPUT: channel number to switch to. |
| 954 | * |
| 955 | * @OUTPUT: None |
| 956 | * |
| 957 | * This IOCTL is used to initiate a channel change. |
| 958 | * If called on STA/CLI interface it will send the |
| 959 | * ECSA action frame to the connected SAP/GO asking to |
| 960 | * initiate the ECSA, if supported. |
| 961 | * If called on SAP/GO interface it will initiate |
| 962 | * ECSA and ask connected peers to move to new channel. |
| 963 | * |
| 964 | * @E.g: iwpriv wlan0 setChanChange <channel> |
| 965 | * iwpriv wlan0 setChanChange 1 |
| 966 | * |
| 967 | * Supported Feature: ECSA |
| 968 | * |
| 969 | * Usage: Internal/External |
| 970 | * |
| 971 | * </ioctl> |
| 972 | */ |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 973 | #define WE_SET_CHANNEL 88 |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 974 | #define WE_SET_CONC_SYSTEM_PREF 89 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 975 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 976 | /* |
| 977 | * <ioctl> |
| 978 | * set_11ax_rate - set 11ax rates to FW |
| 979 | * |
| 980 | * @INPUT: rate code |
| 981 | * |
| 982 | * @OUTPUT: None |
| 983 | * |
| 984 | * This IOCTL fixes the Tx data rate of 11AX. |
| 985 | * |
| 986 | * @E.g: iwpriv wlan0 set_11ax_rate <rate code> |
| 987 | * |
| 988 | * Supported Feature: STA/SAP |
| 989 | * |
| 990 | * Usage: Internal |
| 991 | * |
| 992 | * </ioctl> |
| 993 | */ |
| 994 | #define WE_SET_11AX_RATE 91 |
| 995 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 996 | /* |
| 997 | * <ioctl> |
| 998 | * enable_dcm - enable Dual Carrier Modulation(DCM) |
| 999 | * |
| 1000 | * @INPUT: 0/1 |
| 1001 | * |
| 1002 | * @OUTPUT: None |
| 1003 | * |
| 1004 | * This IOCTL enables/disables DCM. |
| 1005 | * |
| 1006 | * @E.g: iwpriv wlan0 enable_dcm <0/1> |
| 1007 | * |
| 1008 | * Supported Feature: STA/SAP |
| 1009 | * |
| 1010 | * Usage: Internal |
| 1011 | * |
| 1012 | * </ioctl> |
| 1013 | */ |
| 1014 | #define WE_SET_DCM 92 |
| 1015 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1016 | /* |
| 1017 | * <ioctl> |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1018 | * range_ext - enable Range extension |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1019 | * |
| 1020 | * @INPUT: 0/1 |
| 1021 | * |
| 1022 | * @OUTPUT: None |
| 1023 | * |
| 1024 | * This IOCTL enables/disables Range extension. |
| 1025 | * |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1026 | * @E.g: iwpriv wlan0 range_ext <1/0> |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1027 | * |
| 1028 | * Supported Feature: STA/SAP |
| 1029 | * |
| 1030 | * Usage: Internal |
| 1031 | * |
| 1032 | * </ioctl> |
| 1033 | */ |
| 1034 | #define WE_SET_RANGE_EXT 93 |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1035 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1036 | /* |
| 1037 | * <ioctl> |
| 1038 | * wow_ito - sets the timeout value for inactivity data while |
| 1039 | * in power save mode during wow |
| 1040 | * |
| 1041 | * @INPUT: int |
| 1042 | * |
| 1043 | * @OUTPUT: None |
| 1044 | * |
| 1045 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 1046 | * |
| 1047 | * @E.g: iwpriv wlan0 wow_ito 20 |
| 1048 | * |
| 1049 | * Supported Feature: STA |
| 1050 | * |
| 1051 | * Usage: External |
| 1052 | * |
| 1053 | * </ioctl> |
Jeff Johnson | dcf84ce | 2017-10-05 09:26:24 -0700 | [diff] [blame] | 1054 | */ |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1055 | #define WE_SET_WOW_DATA_INACTIVITY_TO 94 |
| 1056 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 1057 | /* |
| 1058 | * <ioctl> |
| 1059 | * pdev_reset - reset the pdev |
| 1060 | * |
| 1061 | * @INPUT: Reset command to initiate: |
| 1062 | * TX_FLUSH = 1 |
| 1063 | * WARM_RESET = 2 |
| 1064 | * COLD_RESET = 3 |
| 1065 | * WARM_RESET_RESTORE_CAL = 4 |
| 1066 | * COLD_RESET_RESTORE_CAL = 5 |
| 1067 | * |
| 1068 | * @OUTPUT: None |
| 1069 | * |
| 1070 | * This IOCTL is used to reset the pdev. The primary use is |
| 1071 | * for internal testing. It is not expected that this will |
| 1072 | * be used on a production device. |
| 1073 | * |
| 1074 | * @E.g: iwpriv wlan0 pdev_reset <command> |
| 1075 | * iwpriv wlan0 pdev_reset 1 |
| 1076 | * |
| 1077 | * Supported Feature: None |
| 1078 | * |
| 1079 | * Usage: Internal |
| 1080 | * |
| 1081 | * </ioctl> |
| 1082 | */ |
| 1083 | #define WE_SET_PDEV_RESET 95 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1084 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1085 | /* |
| 1086 | * setModDTIM - Change Modulated DTIM |
| 1087 | * |
| 1088 | * @INPUT: set_value. |
| 1089 | * |
| 1090 | * @OUTPUT: None |
| 1091 | * |
| 1092 | * This IOCTL is used to change modulated DTIM |
| 1093 | * value without WIFI OFF/ON. |
| 1094 | * |
| 1095 | * @E.g: iwpriv wlan0 setModDTIM <value> |
| 1096 | * iwpriv wlan0 setModDTIM 2 |
| 1097 | * |
| 1098 | * Supported Feature: N/A |
| 1099 | * |
| 1100 | * Usage: Internal/External |
| 1101 | * |
| 1102 | * </ioctl> |
| 1103 | */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 1104 | #define WE_SET_MODULATED_DTIM 96 |
| 1105 | |
| 1106 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 1107 | #define WE_MOTION_DET_START_STOP 97 |
| 1108 | #define WE_MOTION_DET_BASE_LINE_START_STOP 98 |
| 1109 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1110 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1111 | /* Private ioctls and their sub-ioctls */ |
| 1112 | #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) |
| 1113 | #define WE_GET_11D_STATE 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1114 | #define WE_GET_WLAN_DBG 4 |
| 1115 | #define WE_GET_MAX_ASSOC 6 |
| 1116 | /* 7 is unused */ |
| 1117 | #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 1118 | |
| 1119 | /* |
| 1120 | * <ioctl> |
| 1121 | * getconcurrency - Get concurrency mode |
| 1122 | * |
| 1123 | * @INPUT: None |
| 1124 | * |
| 1125 | * @OUTPUT: It shows concurrency value |
| 1126 | * Bit 0:STA 1:SAP 2:P2P_Client 3:P2P_GO |
| 1127 | * 4:FTM 5:IBSS 6:Monitor 7:P2P_Device |
| 1128 | * 8:OCB 9:EPPING 10:QVIT 11:NDI |
| 1129 | * |
| 1130 | * This IOCTL is used to retrieve concurrency mode. |
| 1131 | * |
| 1132 | * @E.g: iwpriv wlan0 getconcurrency |
| 1133 | * wlan0 getconcurrency:5 |
| 1134 | * Above value shows STA+P2P_Client |
| 1135 | * |
| 1136 | * Supported Feature: Concurrency |
| 1137 | * |
| 1138 | * Usage: Internal/External |
| 1139 | * |
| 1140 | * </ioctl> |
| 1141 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1142 | #define WE_GET_CONCURRENCY_MODE 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1143 | /* |
| 1144 | * <ioctl> |
| 1145 | * get_nss - Get the number of spatial STBC streams (NSS) |
| 1146 | * |
| 1147 | * @INPUT: None |
| 1148 | * |
| 1149 | * @OUTPUT: NSS |
| 1150 | * wlan0 get_nss:2 |
| 1151 | * |
| 1152 | * This IOTCL used to get the number of spatial STBC streams |
| 1153 | * |
| 1154 | * @E.g: iwpriv wlan0 get_nss |
| 1155 | * |
| 1156 | * Supported Feature: STA |
| 1157 | * |
| 1158 | * Usage: Internal/External |
| 1159 | * |
| 1160 | * </ioctl> |
| 1161 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1162 | #define WE_GET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1163 | /* |
| 1164 | * <ioctl> |
| 1165 | * get_ldpc - This IOCTL gets the low density parity check (LDPC) |
| 1166 | * |
| 1167 | * @INPUT: None |
| 1168 | * |
| 1169 | * @OUTPUT: ldpc |
| 1170 | * wlan0 get_ldpc:1 |
| 1171 | * |
| 1172 | * This IOTCL used to gets the low density parity check (LDPC) |
| 1173 | * |
| 1174 | * @E.g: iwpriv wlan0 get_ldpc |
| 1175 | * |
| 1176 | * Supported Feature: STA |
| 1177 | * |
| 1178 | * Usage: Internal/External |
| 1179 | * |
| 1180 | * </ioctl> |
| 1181 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1182 | #define WE_GET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1183 | /* |
| 1184 | * <ioctl> |
| 1185 | * get_tx_stbc - Get the value of the current Tx space time block code (STBC) |
| 1186 | * |
| 1187 | * @INPUT: None |
| 1188 | * |
| 1189 | * @OUTPUT: TXSTBC |
| 1190 | * wlan0 get_tx_stbc:1 |
| 1191 | * |
| 1192 | * This IOTCL get the value of the current Tx space time block code (STBC) |
| 1193 | * |
| 1194 | * @E.g: iwpriv wlan0 get_tx_stbc |
| 1195 | * |
| 1196 | * Supported Feature: STA |
| 1197 | * |
| 1198 | * Usage: Internal/External |
| 1199 | * |
| 1200 | * </ioctl> |
| 1201 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1202 | #define WE_GET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1203 | /* |
| 1204 | * <ioctl> |
| 1205 | * get_rx_stbc - Gets the value of the current Rx STBC |
| 1206 | * |
| 1207 | * @INPUT: None |
| 1208 | * |
| 1209 | * @OUTPUT: Rx STBC |
| 1210 | * wlan0 get_rx_stbc:1 |
| 1211 | * |
| 1212 | * This IOTCL used to get the value of the current Rx STBC |
| 1213 | * |
| 1214 | * @E.g: iwpriv wlan0 get_rx_stbc |
| 1215 | * |
| 1216 | * Supported Feature: STA |
| 1217 | * |
| 1218 | * Usage: Internal/External |
| 1219 | * |
| 1220 | * </ioctl> |
| 1221 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1222 | #define WE_GET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1223 | /* |
| 1224 | * <ioctl> |
| 1225 | * get_shortgi - Get the value of the current short GI setting |
| 1226 | * |
| 1227 | * @INPUT: None |
| 1228 | * |
| 1229 | * @OUTPUT: Enable/disable of shortgi |
| 1230 | * wlan0 get_shortgi:1 |
| 1231 | * |
| 1232 | * This IOCTL gets the value of the current short GI setting |
| 1233 | * |
| 1234 | * @E.g: iwpriv wlan0 get_shortgi |
| 1235 | * |
| 1236 | * Supported Feature: STA |
| 1237 | * |
| 1238 | * Usage: Internal/External |
| 1239 | * |
| 1240 | * </ioctl> |
| 1241 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1242 | #define WE_GET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1243 | /* |
| 1244 | * <ioctl> |
| 1245 | * get_rtscts - Get the value of the current RTS/CTS setting. |
| 1246 | * |
| 1247 | * @INPUT: None |
| 1248 | * |
| 1249 | * @OUTPUT: Enable/disable of RTS/CTS |
| 1250 | * wlan0 get_rtscts:33 |
| 1251 | * |
| 1252 | * This IOTCL get the value of the current RTS/CTS setting. |
| 1253 | * |
| 1254 | * @E.g: iwpriv wlan0 get_rtscts |
| 1255 | * |
| 1256 | * Supported Feature: STA |
| 1257 | * |
| 1258 | * Usage: Internal/External |
| 1259 | * |
| 1260 | * </ioctl> |
| 1261 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1262 | #define WE_GET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1263 | /* |
| 1264 | * <ioctl> |
| 1265 | * get_chwidth - Get the current channel width setting |
| 1266 | * |
| 1267 | * @INPUT: None |
| 1268 | * |
| 1269 | * @OUTPUT: channel width |
| 1270 | * wlan0 get_chwidth:0 |
| 1271 | * |
| 1272 | * This IOTCL get the current channel width setting. |
| 1273 | * |
| 1274 | * @E.g: iwpriv wlan0 get_chwidth |
| 1275 | * |
| 1276 | * Supported Feature: STA |
| 1277 | * |
| 1278 | * Usage: Internal/External |
| 1279 | * |
| 1280 | * </ioctl> |
| 1281 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1282 | #define WE_GET_CHWIDTH 17 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1283 | /* |
| 1284 | * <ioctl> |
| 1285 | * get_anienable - Get the anienable |
| 1286 | * |
| 1287 | * @INPUT: None |
| 1288 | * |
| 1289 | * @OUTPUT: |
| 1290 | * wlan0 get_anienable:0 |
| 1291 | * |
| 1292 | * This IOTCL get the anienable |
| 1293 | * |
| 1294 | * @E.g: iwpriv wlan0 get_anienable |
| 1295 | * |
| 1296 | * Supported Feature: STA |
| 1297 | * |
| 1298 | * Usage: Internal/External |
| 1299 | * |
| 1300 | * </ioctl> |
| 1301 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1302 | #define WE_GET_ANI_EN_DIS 18 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1303 | /* |
| 1304 | * <ioctl> |
| 1305 | * get_aniplen - Get the aniplen |
| 1306 | * |
| 1307 | * @INPUT: None |
| 1308 | * |
| 1309 | * @OUTPUT: |
| 1310 | * wlan0 get_aniplen:0 |
| 1311 | * |
| 1312 | * This IOTCL get the aniplen |
| 1313 | * |
| 1314 | * @E.g: iwpriv wlan0 get_aniplen |
| 1315 | * |
| 1316 | * Supported Feature: STA |
| 1317 | * |
| 1318 | * Usage: Internal/External |
| 1319 | * |
| 1320 | * </ioctl> |
| 1321 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1322 | #define WE_GET_ANI_POLL_PERIOD 19 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1323 | /* |
| 1324 | * <ioctl> |
| 1325 | * get_anilislen- Get the anilislen |
| 1326 | * |
| 1327 | * @INPUT: None |
| 1328 | * |
| 1329 | * @OUTPUT: |
| 1330 | * wlan0 get_anilislen:0 |
| 1331 | * |
| 1332 | * This IOTCL used to get anilislen |
| 1333 | * |
| 1334 | * @E.g: iwpriv wlan0 get_anilislen |
| 1335 | * |
| 1336 | * Supported Feature: STA |
| 1337 | * |
| 1338 | * Usage: Internal/External |
| 1339 | * |
| 1340 | * </ioctl> |
| 1341 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1342 | #define WE_GET_ANI_LISTEN_PERIOD 20 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1343 | /* |
| 1344 | * <ioctl> |
| 1345 | * get_aniofdmlvl - Get the OFDM level |
| 1346 | * |
| 1347 | * @INPUT: None |
| 1348 | * |
| 1349 | * @OUTPUT: OFDM |
| 1350 | * wlan0 get_aniofdmlvl:0 |
| 1351 | * |
| 1352 | * This IOTCL used to get ofdm level |
| 1353 | * |
| 1354 | * @E.g: iwpriv wlan0 get_aniofdmlvl |
| 1355 | * |
| 1356 | * Supported Feature: STA |
| 1357 | * |
| 1358 | * Usage: Internal/External |
| 1359 | * |
| 1360 | * </ioctl> |
| 1361 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1362 | #define WE_GET_ANI_OFDM_LEVEL 21 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1363 | /* |
| 1364 | * <ioctl> |
| 1365 | * get_aniccklvl - Get the cck level |
| 1366 | * |
| 1367 | * @INPUT: None |
| 1368 | * |
| 1369 | * @OUTPUT: |
| 1370 | * wlan0 get_aniccklvl:0 |
| 1371 | * |
| 1372 | * This IOTCL used to get cck level |
| 1373 | * |
| 1374 | * @E.g: iwpriv wlan0 get_aniccklvl |
| 1375 | * |
| 1376 | * Supported Feature: STA |
| 1377 | * |
| 1378 | * Usage: Internal/External |
| 1379 | * |
| 1380 | * </ioctl> |
| 1381 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1382 | #define WE_GET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1383 | /* |
| 1384 | * <ioctl> |
| 1385 | * get_cwmenable - Get the value of the dynamic channel bandwidth setting |
| 1386 | * |
| 1387 | * @INPUT: None |
| 1388 | * |
| 1389 | * @OUTPUT: Enable/disable dynamic channel bandwidth |
| 1390 | * wlan0 get_cwmenable:0 |
| 1391 | * |
| 1392 | * This IOTCL get the value of the dynamic channel bandwidth setting |
| 1393 | * |
| 1394 | * @E.g: iwpriv wlan0 get_cwmenable |
| 1395 | * |
| 1396 | * Supported Feature: STA |
| 1397 | * |
| 1398 | * Usage: Internal/External |
| 1399 | * |
| 1400 | * </ioctl> |
| 1401 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1402 | #define WE_GET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1403 | /* |
| 1404 | * <ioctl> |
| 1405 | * get_txchainmask - Get the txchainmask that was set |
| 1406 | * |
| 1407 | * @INPUT: None |
| 1408 | * |
| 1409 | * @OUTPUT: txchainmask |
| 1410 | * wlan0 get_txchainmask:1 |
| 1411 | * |
| 1412 | * This IOCTL gets the txchainmask that was set |
| 1413 | * This command is useful if it was previously set |
| 1414 | * |
| 1415 | * @E.g: iwpriv wlan0 get_txchainmask |
| 1416 | * |
| 1417 | * Supported Feature: STA |
| 1418 | * |
| 1419 | * Usage: Internal/External |
| 1420 | * |
| 1421 | * </ioctl> |
| 1422 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1423 | #define WE_GET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1424 | /* |
| 1425 | * <ioctl> |
| 1426 | * get_rxchainmask - Get the rxchainmask that was set |
| 1427 | * |
| 1428 | * @INPUT: None |
| 1429 | * |
| 1430 | * @OUTPUT: rxchainmask |
| 1431 | * wlan0 get_rxchainmask:1 |
| 1432 | * |
| 1433 | * This IOCTL gets the rxchainmask that was set |
| 1434 | * This command is useful only if it was previously set. |
| 1435 | * |
| 1436 | * @E.g: iwpriv wlan0 get_rxchainmask |
| 1437 | * |
| 1438 | * Supported Feature: STA |
| 1439 | * |
| 1440 | * Usage: Internal/External |
| 1441 | * |
| 1442 | * </ioctl> |
| 1443 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1444 | #define WE_GET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1445 | /* |
| 1446 | * <ioctl> |
| 1447 | * get_11nrate - Get the fixed Tx data rate |
| 1448 | * |
| 1449 | * @INPUT: None |
| 1450 | * |
| 1451 | * @OUTPUT: Using this command does not return the same value as set |
| 1452 | * wlan0 get_11nrate:0 |
| 1453 | * |
| 1454 | * This IOCTL gets the fixed Tx data rate |
| 1455 | * This command is useful only if setting the fixed Tx rate. |
| 1456 | * |
| 1457 | * @E.g: iwpriv wlan0 get_11nrate |
| 1458 | * |
| 1459 | * Supported Feature: STA |
| 1460 | * |
| 1461 | * Usage: Internal/External |
| 1462 | * |
| 1463 | * </ioctl> |
| 1464 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1465 | #define WE_GET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1466 | /* |
| 1467 | * <ioctl> |
| 1468 | * get_ampdu - Get the maximum subframe of ampdu |
| 1469 | * |
| 1470 | * @INPUT: None |
| 1471 | * |
| 1472 | * @OUTPUT: Maximum subframe of ampdu |
| 1473 | * wlan0 get_ampdu:1 |
| 1474 | * |
| 1475 | * This IOCTL gets the maximum subframe of ampdu |
| 1476 | * This command is useful only if setting ampdu. |
| 1477 | * |
| 1478 | * @E.g: iwpriv wlan0 get_ampdu |
| 1479 | * |
| 1480 | * Supported Feature: STA |
| 1481 | * |
| 1482 | * Usage: Internal/External |
| 1483 | * |
| 1484 | * </ioctl> |
| 1485 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1486 | #define WE_GET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1487 | /* |
| 1488 | * <ioctl> |
| 1489 | * get_amsdu - Get the maximum subframe of amsdu |
| 1490 | * |
| 1491 | * @INPUT: None |
| 1492 | * |
| 1493 | * @OUTPUT: Maximum subframe of amsdu |
| 1494 | * wlan0 get_amsdu:1 |
| 1495 | * |
| 1496 | * This IOCTL gets the maximum subframe of amsdu. |
| 1497 | * This command is useful only if setting amsdu |
| 1498 | * |
| 1499 | * @E.g: iwpriv wlan0 get_amsdu |
| 1500 | * |
| 1501 | * Supported Feature: STA |
| 1502 | * |
| 1503 | * Usage: Internal/External |
| 1504 | * |
| 1505 | * </ioctl> |
| 1506 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1507 | #define WE_GET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1508 | /* |
| 1509 | * <ioctl> |
| 1510 | * get_txpow2g - Get the current 2 GHz Tx power setting |
| 1511 | * |
| 1512 | * @INPUT: None |
| 1513 | * |
| 1514 | * @OUTPUT: Tx Power in dbm |
| 1515 | * wlan0 get_txpow2g:0 |
| 1516 | * |
| 1517 | * This IOCTL gets the current 2 GHz Tx power setting |
| 1518 | * This command is useful if setting Tx power |
| 1519 | * |
| 1520 | * @E.g: iwpriv wlan0 get_txpow2g |
| 1521 | * |
| 1522 | * Supported Feature: STA |
| 1523 | * |
| 1524 | * Usage: Internal/External |
| 1525 | * |
| 1526 | * </ioctl> |
| 1527 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1528 | #define WE_GET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1529 | /* |
| 1530 | * <ioctl> |
| 1531 | * get_txpow5g - Get the current 5 GHz Tx power setting |
| 1532 | * |
| 1533 | * @INPUT: None |
| 1534 | * |
| 1535 | * @OUTPUT: Tx Power in dbm |
| 1536 | * wlan0 get_txpow5g:0 |
| 1537 | * |
| 1538 | * This IOCTL gets the current 5 GHz Tx power setting |
| 1539 | * This command is useful if setting Tx power |
| 1540 | * |
| 1541 | * @E.g: iwpriv wlan0 get_txpow5g |
| 1542 | * |
| 1543 | * Supported Feature: STA |
| 1544 | * |
| 1545 | * Usage: Internal/External |
| 1546 | * |
| 1547 | * </ioctl> |
| 1548 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1549 | #define WE_GET_TXPOW_5G 30 |
Rajeev Kumar | 1bcfd63 | 2015-12-07 11:38:51 -0800 | [diff] [blame] | 1550 | /* 31 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1551 | #define WE_GET_PPS_PAID_MATCH 32 |
| 1552 | #define WE_GET_PPS_GID_MATCH 33 |
| 1553 | #define WE_GET_PPS_EARLY_TIM_CLEAR 34 |
| 1554 | #define WE_GET_PPS_EARLY_DTIM_CLEAR 35 |
| 1555 | #define WE_GET_PPS_EOF_PAD_DELIM 36 |
| 1556 | #define WE_GET_PPS_MACADDR_MISMATCH 37 |
| 1557 | #define WE_GET_PPS_DELIM_CRC_FAIL 38 |
| 1558 | #define WE_GET_PPS_GID_NSTS_ZERO 39 |
| 1559 | #define WE_GET_PPS_RSSI_CHECK 40 |
| 1560 | /* Private ioctl for QPower */ |
| 1561 | #define WE_GET_QPOWER_MAX_PSPOLL_COUNT 41 |
| 1562 | #define WE_GET_QPOWER_MAX_TX_BEFORE_WAKE 42 |
| 1563 | #define WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 43 |
| 1564 | #define WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 44 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1565 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1566 | /* |
| 1567 | * <ioctl> |
| 1568 | * get_gtxHTMcs - Get the tx HTM |
| 1569 | * |
| 1570 | * @INPUT: None |
| 1571 | * |
| 1572 | * @OUTPUT: HTM |
| 1573 | * wlan0 get_gtxHTMcs:32896 |
| 1574 | * |
| 1575 | * This IOTCL used to get HTM |
| 1576 | * |
| 1577 | * @E.g: iwpriv wlan0 get_gtxHTMcs |
| 1578 | * |
| 1579 | * Supported Feature: STA |
| 1580 | * |
| 1581 | * Usage: Internal/External |
| 1582 | * |
| 1583 | * </ioctl> |
| 1584 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1585 | #define WE_GET_GTX_HT_MCS 47 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1586 | /* |
| 1587 | * <ioctl> |
| 1588 | * get_gtxVHTMcs - Get the VHTM |
| 1589 | * |
| 1590 | * @INPUT: None |
| 1591 | * |
| 1592 | * @OUTPUT: VHTM |
| 1593 | * wlan0 get_gtxVHTMcs:524800 |
| 1594 | * |
| 1595 | * This IOTCL used to get the VHTM |
| 1596 | * |
| 1597 | * @E.g: iwpriv wlan0 get_gtxVHTMcs |
| 1598 | * |
| 1599 | * Supported Feature: STA |
| 1600 | * |
| 1601 | * Usage: Internal/External |
| 1602 | * |
| 1603 | * </ioctl> |
| 1604 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1605 | #define WE_GET_GTX_VHT_MCS 48 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1606 | /* |
| 1607 | * <ioctl> |
| 1608 | * get_gtxUsrCfg - Get the tx cfg |
| 1609 | * |
| 1610 | * @INPUT: None |
| 1611 | * |
| 1612 | * @OUTPUT: TXCFG |
| 1613 | * wlan0 get_gtxUsrCfg:32 |
| 1614 | * |
| 1615 | * This IOTCL used to get the tx cfg |
| 1616 | * |
| 1617 | * @E.g: iwpriv wlan0 get_gtxUsrCfg |
| 1618 | * |
| 1619 | * Supported Feature: STA |
| 1620 | * |
| 1621 | * Usage: Internal/External |
| 1622 | * |
| 1623 | * </ioctl> |
| 1624 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1625 | #define WE_GET_GTX_USRCFG 49 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1626 | /* |
| 1627 | * <ioctl> |
| 1628 | * get_gtxThre - Get the tx threshold |
| 1629 | * |
| 1630 | * @INPUT: None |
| 1631 | * |
| 1632 | * @OUTPUT: Threshold |
| 1633 | * wlan0 get_gtxThre:3 |
| 1634 | * |
| 1635 | * This IOCTL is used to get tx threshold |
| 1636 | * |
| 1637 | * @E.g: iwpriv wlan0 get_gtxThre |
| 1638 | * |
| 1639 | * Supported Feature: STA |
| 1640 | * |
| 1641 | * Usage: Internal/External |
| 1642 | * |
| 1643 | * </ioctl> |
| 1644 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1645 | #define WE_GET_GTX_THRE 50 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1646 | /* |
| 1647 | * <ioctl> |
| 1648 | * get_gtxMargin - Get the tx margin |
| 1649 | * |
| 1650 | * @INPUT: None |
| 1651 | * |
| 1652 | * @OUTPUT: GTXMARGIN |
| 1653 | * wlan0 get_gtxMargin:2 |
| 1654 | * |
| 1655 | * This IOCTL is used to set tx margin |
| 1656 | * |
| 1657 | * @E.g: iwpriv wlan0 get_gtxMargin |
| 1658 | * |
| 1659 | * Supported Feature: STA |
| 1660 | * |
| 1661 | * Usage: Internal/External |
| 1662 | * |
| 1663 | * </ioctl> |
| 1664 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1665 | #define WE_GET_GTX_MARGIN 51 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1666 | /* |
| 1667 | * <ioctl> |
| 1668 | * get_gtxStep - Get the tx step |
| 1669 | * |
| 1670 | * @INPUT: None |
| 1671 | * |
| 1672 | * @OUTPUT: GTXSTEP |
| 1673 | * wlan0 get_gtxStep:0 |
| 1674 | * |
| 1675 | * This IOCTL is used to get the gtx step |
| 1676 | * |
| 1677 | * @E.g: iwpriv wlan0 get_gtxStep |
| 1678 | * |
| 1679 | * Supported Feature: STA |
| 1680 | * |
| 1681 | * Usage: Internal/External |
| 1682 | * |
| 1683 | * </ioctl> |
| 1684 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1685 | #define WE_GET_GTX_STEP 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1686 | /* |
| 1687 | * <ioctl> |
| 1688 | * get_gtxMinTpc - Get the tx miminum tpc |
| 1689 | * |
| 1690 | * @INPUT: None |
| 1691 | * |
| 1692 | * @OUTPUT: TPC |
| 1693 | * wlan0 get_gtxMinTpc:0 |
| 1694 | * |
| 1695 | * This IOCTL is used to get tx miminum tpc |
| 1696 | * |
| 1697 | * @E.g: iwpriv wlan0 get_gtxMinTpc |
| 1698 | * |
| 1699 | * Supported Feature: STA |
| 1700 | * |
| 1701 | * Usage: Internal/External |
| 1702 | * |
| 1703 | * </ioctl> |
| 1704 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1705 | #define WE_GET_GTX_MINTPC 53 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1706 | /* |
| 1707 | * <ioctl> |
| 1708 | * get_gtxBWMask - Get the tx BW MASK |
| 1709 | * |
| 1710 | * @INPUT: None |
| 1711 | * |
| 1712 | * @OUTPUT: MASK |
| 1713 | * wlan0 get_gtxBWMask:15 |
| 1714 | * |
| 1715 | * This IOCTL is used get gtx bw mask |
| 1716 | * |
| 1717 | * @E.g: iwpriv wlan0 get_gtxBWMask |
| 1718 | * |
| 1719 | * Supported Feature: STA |
| 1720 | * |
| 1721 | * Usage: Internal/External |
| 1722 | * |
| 1723 | * </ioctl> |
| 1724 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1725 | #define WE_GET_GTX_BWMASK 54 |
| 1726 | #define WE_GET_TEMPERATURE 56 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1727 | #define WE_CAP_TSF 58 |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 1728 | #define WE_GET_ROAM_SYNCH_DELAY 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1729 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1730 | /* |
| 1731 | * <ioctl> |
| 1732 | * get_dcm - Get dcm enablement value |
| 1733 | * |
| 1734 | * @INPUT: None |
| 1735 | * |
| 1736 | * @OUTPUT: 0/1 |
| 1737 | * wlan0 get_dcm |
| 1738 | * |
| 1739 | * This IOCTL is used get dcm value |
| 1740 | * |
| 1741 | * Supported Feature: STA/SAP |
| 1742 | * |
| 1743 | * Usage: Internal |
| 1744 | * |
| 1745 | * </ioctl> |
| 1746 | */ |
| 1747 | #define WE_GET_DCM 60 |
| 1748 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1749 | /* |
| 1750 | * <ioctl> |
| 1751 | * get_dcm - Get range extension enablement value |
| 1752 | * |
| 1753 | * @INPUT: None |
| 1754 | * |
| 1755 | * @OUTPUT: 0/1 |
| 1756 | * wlan0 get_range_ext |
| 1757 | * |
| 1758 | * This IOCTL is used get range_extension value |
| 1759 | * |
| 1760 | * Supported Feature: STA/SAP |
| 1761 | * |
| 1762 | * Usage: Internal |
| 1763 | * |
| 1764 | * </ioctl> |
| 1765 | */ |
| 1766 | #define WE_GET_RANGE_EXT 61 |
| 1767 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1768 | /* Private ioctls and their sub-ioctls */ |
| 1769 | #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) |
| 1770 | |
| 1771 | /* Private ioctls and their sub-ioctls */ |
| 1772 | #define WLAN_PRIV_SET_CHAR_GET_NONE (SIOCIWFIRSTPRIV + 3) |
| 1773 | #define WE_WOWL_ADD_PTRN 1 |
| 1774 | #define WE_WOWL_DEL_PTRN 2 |
Sreelakshmi Konamki | ded64d7 | 2017-02-23 10:39:26 +0530 | [diff] [blame] | 1775 | /* |
| 1776 | * <ioctl> |
| 1777 | * neighbor - Send neighbor report request |
| 1778 | * |
| 1779 | * @INPUT: string |
| 1780 | * |
| 1781 | * @OUTPUT: None |
| 1782 | * |
| 1783 | * This IOCTL create a Neighbor report request and send it to peer |
| 1784 | * |
| 1785 | * @E.g: iwpriv wlan0 neighbor "SSID" |
| 1786 | * |
| 1787 | * Supported Feature: 11k |
| 1788 | * |
| 1789 | * Usage: Internal/External |
| 1790 | * |
| 1791 | * </ioctl> |
| 1792 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1793 | #define WE_NEIGHBOR_REPORT_REQUEST 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1794 | /* |
| 1795 | * <ioctl> |
| 1796 | * set_ap_wps_ie - Set the P2P IE of the probe response |
| 1797 | * |
| 1798 | * @INPUT: string |
| 1799 | * |
| 1800 | * @OUTPUT: None |
| 1801 | * |
| 1802 | * This IOCTL sets the P2P IE of the probe response |
| 1803 | * |
| 1804 | * @E.g: iwpriv wlan0 set_ap_wps_ie abcd |
| 1805 | * |
| 1806 | * Supported Feature: STA |
| 1807 | * |
| 1808 | * Usage: Internal/External |
| 1809 | * |
| 1810 | * </ioctl> |
| 1811 | */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 1812 | #define WE_SET_AP_WPS_IE 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1813 | #define WE_SET_CONFIG 5 |
| 1814 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 1815 | /* |
| 1816 | * <ioctl> |
| 1817 | * unit_test - execute component-level unit tests |
| 1818 | * |
| 1819 | * @INPUT: string - the name of the component to test. |
| 1820 | * All tests are executed if unspecified |
| 1821 | * @OUTPUT: None |
| 1822 | * |
| 1823 | * Usage: Internal only |
| 1824 | * </ioctl> |
| 1825 | */ |
| 1826 | #define WE_UNIT_TEST 6 |
| 1827 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1828 | /* Private ioctls and their sub-ioctls */ |
| 1829 | #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) |
| 1830 | #define WE_SET_WLAN_DBG 1 |
| 1831 | #define WE_SET_DP_TRACE 2 |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 1832 | #define WE_SET_FW_TEST 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1833 | |
| 1834 | /* Private ioctls and their sub-ioctls */ |
| 1835 | #define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5) |
| 1836 | #define WE_WLAN_VERSION 1 |
| 1837 | #define WE_GET_STATS 2 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1838 | /* |
| 1839 | * <ioctl> |
| 1840 | * getConfig - gets the values of all configurations listed in WCNSS |
| 1841 | * |
| 1842 | * @INPUT: None |
| 1843 | * |
| 1844 | * @OUTPUT: Current configuration to the sys log |
| 1845 | * wlan0 getConfig: WLAN configuration written to system log |
| 1846 | * |
| 1847 | * This IOCTL gets the values of all configurations listed in WCNSS |
| 1848 | * |
| 1849 | * @E.g: iwpriv wlan0 getConfig |
| 1850 | * |
| 1851 | * Supported Feature: STA |
| 1852 | * |
| 1853 | * Usage: Internal/External |
| 1854 | * |
| 1855 | * </ioctl> |
| 1856 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1857 | #define WE_GET_CFG 3 |
| 1858 | #define WE_GET_WMM_STATUS 4 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1859 | /* |
| 1860 | * <ioctl> |
| 1861 | * getChannelList - Get the available channel list while in QCMobileAP |
| 1862 | * |
| 1863 | * @INPUT: None |
| 1864 | * |
| 1865 | * @OUTPUT: Channel list |
| 1866 | * wlan0 getChannelList:36 US 1..165 |
| 1867 | * |
| 1868 | * This IOCTL gets the available channel list while in QCMobileAP |
| 1869 | * |
| 1870 | * @E.g: iwpriv wlan0 getChannelList |
| 1871 | * |
| 1872 | * Supported Feature: STA |
| 1873 | * |
| 1874 | * Usage: Internal/External |
| 1875 | * |
| 1876 | * </ioctl> |
| 1877 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1878 | #define WE_GET_CHANNEL_LIST 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1879 | /* |
| 1880 | * <ioctl> |
| 1881 | * getRSSI - Get the Received Signal Strength Indicator |
| 1882 | * |
| 1883 | * @INPUT: None |
| 1884 | * |
| 1885 | * @OUTPUT: RSSI |
| 1886 | * wlan0 getRSSI:rsssi=-32 |
| 1887 | * |
| 1888 | * This IOCTL gets the Received Signal Strength Indicator (RSSI) |
| 1889 | * |
| 1890 | * @E.g: iwpriv wlan0 getRSSI |
| 1891 | * |
| 1892 | * Supported Feature: STA |
| 1893 | * |
| 1894 | * Usage: Internal/External |
| 1895 | * |
| 1896 | * </ioctl> |
| 1897 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1898 | #define WE_GET_RSSI 6 |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1899 | |
| 1900 | /* |
| 1901 | * <ioctl> |
| 1902 | * getSuspendStats - Get suspend/resume stats |
| 1903 | * |
| 1904 | * @INPUT: None |
| 1905 | * |
| 1906 | * @OUTPUT: character string containing formatted suspend/resume stats |
| 1907 | * |
| 1908 | * This ioctl is used to get suspend/resume stats formatted for display. |
| 1909 | * Currently it includes suspend/resume counts, wow wake up reasons, and |
| 1910 | * suspend fail reasons. |
| 1911 | * |
| 1912 | * @E.g: iwpriv wlan0 getSuspendStats |
| 1913 | * iwpriv wlan0 getSuspendStats |
| 1914 | * |
| 1915 | * Supported Feature: suspend/resume |
| 1916 | * |
| 1917 | * Usage: Internal |
| 1918 | * |
| 1919 | * </ioctl> |
| 1920 | */ |
| 1921 | #define WE_GET_SUSPEND_RESUME_STATS 7 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1922 | #ifdef FEATURE_WLAN_TDLS |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 1923 | /* |
| 1924 | * <ioctl> |
| 1925 | * getTdlsPeers - Get all TDLS peers. |
| 1926 | * |
| 1927 | * @INPUT: None |
| 1928 | * |
| 1929 | * @OUTPUT: Returns the MAC address of all the TDLS peers |
| 1930 | * wlan0 getTdlsPeers: |
| 1931 | * MAC Id cap up RSSI |
| 1932 | * --------------------------------- |
| 1933 | * 00:0a:f5:0e:bd:18 2 Y Y -44 |
| 1934 | * 00:0a:f5:bf:0e:12 0 N N 0 |
| 1935 | * |
| 1936 | * This IOCTL is used to get all TDLS peers. |
| 1937 | * |
| 1938 | * @E.g: iwpriv wlan0 getTdlsPeers |
| 1939 | * |
| 1940 | * Supported Feature: TDLS |
| 1941 | * |
| 1942 | * Usage: Internal/External |
| 1943 | * |
| 1944 | * </ioctl> |
| 1945 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1946 | #define WE_GET_TDLS_PEERS 8 |
| 1947 | #endif |
| 1948 | #ifdef WLAN_FEATURE_11W |
Abhishek Singh | 2f81049 | 2016-12-01 11:39:39 +0530 | [diff] [blame] | 1949 | /* |
| 1950 | * <ioctl> |
| 1951 | * getPMFInfo - get the PMF info of the connected session |
| 1952 | * |
| 1953 | * @INPUT: None |
| 1954 | * |
| 1955 | * @OUTPUT: |
| 1956 | * wlan0 getPMFInfo: |
| 1957 | * BSSID E4:F4:C6:0A:E0:36, Is PMF Assoc? 0 |
| 1958 | * Number of Unprotected Disassocs 0 |
| 1959 | * Number of Unprotected Deauths 0 |
| 1960 | * |
| 1961 | * This IOCTL is used to get the PMF stats/status of the current |
| 1962 | * connection. |
| 1963 | * |
| 1964 | * @e.g:iwpriv wlan0 getPMFInfo |
| 1965 | * |
| 1966 | * Supported Feature: PMF |
| 1967 | * |
| 1968 | * Usage: Internal/External |
| 1969 | * |
| 1970 | * </ioctl> |
| 1971 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1972 | #define WE_GET_11W_INFO 9 |
| 1973 | #endif |
| 1974 | #define WE_GET_STATES 10 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 1975 | /* |
| 1976 | * <ioctl> |
| 1977 | * getIbssSTAs - get ibss sta info |
| 1978 | * |
| 1979 | * @INPUT: None |
| 1980 | * |
| 1981 | * @OUTPUT: Give the MAC of the IBSS STA |
| 1982 | * wlan0 getIbssSTAs: |
| 1983 | * 1 .8c:fd:f0:01:9c:bf |
| 1984 | * |
| 1985 | * This IOCTL is used to get ibss sta info |
| 1986 | * |
| 1987 | * @E.g: iwpriv wlan0 getIbssSTAs |
| 1988 | * |
| 1989 | * Supported Feature: IBSS |
| 1990 | * |
| 1991 | * Usage: Internal/External |
| 1992 | * |
| 1993 | * </ioctl> |
| 1994 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1995 | #define WE_GET_IBSS_STA_INFO 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1996 | /* |
| 1997 | * <ioctl> |
| 1998 | * getphymode - Get the current phymode. |
| 1999 | * |
| 2000 | * @INPUT: None |
| 2001 | * |
| 2002 | * @OUTPUT: In phymode |
| 2003 | * wlan0 getphymode:AUTO MODE |
| 2004 | * |
| 2005 | * This IOCTL used to gets the current phymode. |
| 2006 | * |
| 2007 | * @E.g: iwpriv wlan0 getphymode |
| 2008 | * |
| 2009 | * Supported Feature: STA |
| 2010 | * |
| 2011 | * Usage: Internal/External |
| 2012 | * |
| 2013 | * </ioctl> |
| 2014 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2015 | #define WE_GET_PHYMODE 12 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2016 | |
| 2017 | /* |
| 2018 | * <ioctl> |
| 2019 | * getOemDataCap - Get the oem data caps. |
| 2020 | * |
| 2021 | * @INPUT: None |
| 2022 | * |
| 2023 | * @OUTPUT: oem data capability |
| 2024 | * |
| 2025 | * This IOCTL used to gets the current oem data cap. |
| 2026 | * |
| 2027 | * @E.g: iwpriv wlan0 getOemDataCap |
| 2028 | * |
| 2029 | * Usage: Internal/External |
| 2030 | * |
| 2031 | * </ioctl> |
| 2032 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2033 | #define WE_GET_OEM_DATA_CAP 13 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2034 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2035 | /* |
| 2036 | * <ioctl> |
| 2037 | * getSNR - Enable SNR Monitoring |
| 2038 | * |
| 2039 | * @INPUT: None |
| 2040 | * |
| 2041 | * @OUTPUT: Signal strength/ratio |
| 2042 | * wlan0 getSNR:1 |
| 2043 | * |
| 2044 | * This IOCTL is used to get ibss sta info |
| 2045 | * |
| 2046 | * @E.g: iwpriv wlan0 getSNR |
| 2047 | * |
| 2048 | * Supported Feature: STA |
| 2049 | * |
| 2050 | * Usage: Internal/External |
| 2051 | * |
| 2052 | * </ioctl> |
| 2053 | */ |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2054 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2055 | #define WE_GET_SNR 14 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2056 | #define WE_LIST_FW_PROFILE 15 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2057 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2058 | /* |
| 2059 | * <ioctl> |
| 2060 | * |
| 2061 | * get_ba_timeout - to get timeout for each AC |
| 2062 | * |
| 2063 | * @INPUT: None |
| 2064 | * |
| 2065 | * @OUTPUT: displays timeout value for each access class |
| 2066 | * |
| 2067 | * @E.g.: iwpriv wlan0 get_ba_timeout |
| 2068 | * |
| 2069 | * Usage: Internal |
| 2070 | * |
| 2071 | * </ioctl> |
| 2072 | */ |
| 2073 | #define WE_GET_BA_AGEING_TIMEOUT 16 |
| 2074 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 2075 | /* |
| 2076 | * <ioctl> |
| 2077 | * |
| 2078 | * sta_cxn_info - STA connection information |
| 2079 | * |
| 2080 | * @INPUT: none |
| 2081 | * |
| 2082 | * @OUTPUT: STA's connection information |
| 2083 | * |
| 2084 | * This IOCTL is used to get connection's information. |
| 2085 | * |
| 2086 | * @E.g: iwpriv wlan0 get_cxn_info |
| 2087 | * |
| 2088 | * Usage: Internal |
| 2089 | * |
| 2090 | * </ioctl> |
| 2091 | */ |
| 2092 | #define WE_GET_STA_CXN_INFO 17 |
| 2093 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2094 | /* Private ioctls and their sub-ioctls */ |
| 2095 | #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) |
Selvaraj, Sridhar | f793983 | 2017-03-25 16:59:50 +0530 | [diff] [blame] | 2096 | |
| 2097 | /* |
| 2098 | * <ioctl> |
| 2099 | * reassoc - Trigger STA re-association to the connected AP |
| 2100 | * |
| 2101 | * @INPUT: None |
| 2102 | * |
| 2103 | * @OUTPUT: None |
| 2104 | * |
| 2105 | * This IOCTL is used to trigger STA reassociation to the connected AP. |
| 2106 | * |
| 2107 | * @E.g: iwpriv wlan0 reassoc |
| 2108 | * |
| 2109 | * Supported Feature: Roaming |
| 2110 | * |
| 2111 | * Usage: Internal |
| 2112 | * |
| 2113 | * </ioctl> |
| 2114 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2115 | #define WE_SET_REASSOC_TRIGGER 8 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2116 | /* |
| 2117 | * <ioctl> |
| 2118 | * ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI |
| 2119 | * |
| 2120 | * @INPUT: None |
| 2121 | * |
| 2122 | * @OUTPUT: print ibss peer in info logs |
| 2123 | * pPeerInfo->numIBSSPeers = 1 |
| 2124 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2125 | * |
| 2126 | * This IOCTL is used to rint the ibss peers's MAC, rate and RSSI |
| 2127 | * in info logs |
| 2128 | * |
| 2129 | * @E.g: iwpriv wlan0 ibssPeerInfoAll |
| 2130 | * |
| 2131 | * Supported Feature: IBSS |
| 2132 | * |
| 2133 | * Usage: Internal/External |
| 2134 | * |
| 2135 | * </ioctl> |
| 2136 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2137 | #define WE_IBSS_GET_PEER_INFO_ALL 10 |
Rajeev Kumar | f4390fa | 2016-12-22 13:17:33 -0800 | [diff] [blame] | 2138 | /* Sub ioctls 11 to 16 are not used */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2139 | #define WE_GET_FW_PROFILE_DATA 18 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 2140 | /* |
| 2141 | * <ioctl> |
| 2142 | * stop_obss_scan - Stop obss scan |
| 2143 | * |
| 2144 | * @INPUT: None |
| 2145 | * |
| 2146 | * @OUTPUT: None |
| 2147 | * |
| 2148 | * This IOCTL is used to stop obss scan |
| 2149 | * |
| 2150 | * @E.g: iwpriv wlan0 stop_obss_scan |
| 2151 | * |
| 2152 | * Supported Feature: Scan |
| 2153 | * |
| 2154 | * Usage: Internal/External |
| 2155 | * |
| 2156 | * </ioctl> |
| 2157 | */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2158 | #define WE_STOP_OBSS_SCAN 19 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2159 | |
| 2160 | /* Private ioctls and their sub-ioctls */ |
| 2161 | #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) |
| 2162 | |
| 2163 | #define WE_P2P_NOA_CMD 2 |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2164 | /* subcommands 3 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2165 | |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2166 | #define WE_MAC_PWR_DEBUG_CMD 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2167 | |
Kabilan Kannan | 6894e6a | 2017-11-09 14:37:55 -0800 | [diff] [blame] | 2168 | /* subcommand 5 is unused */ |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 2169 | |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2170 | /* |
| 2171 | * <ioctl> |
| 2172 | * ibssPeerInfo - Print the ibss peers's MAC, rate and RSSI |
| 2173 | * |
| 2174 | * @INPUT: staid |
| 2175 | * |
| 2176 | * @OUTPUT: print ibss peer corresponding to staid in info logs |
| 2177 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2178 | * |
| 2179 | * This IOCTL is used to print the specific ibss peers's MAC, |
| 2180 | * rate and RSSI in info logs |
| 2181 | * |
| 2182 | * @E.g: iwpriv wlan0 ibssPeerInfo <sta_id> |
| 2183 | * iwpriv wlan0 ibssPeerInfo 0 |
| 2184 | * |
| 2185 | * Supported Feature: IBSS |
| 2186 | * |
| 2187 | * Usage: Internal/External |
| 2188 | * |
| 2189 | * </ioctl> |
| 2190 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2191 | #define WE_IBSS_GET_PEER_INFO 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2192 | #define WE_UNIT_TEST_CMD 7 |
| 2193 | |
| 2194 | #define WE_MTRACE_DUMP_CMD 8 |
| 2195 | #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 |
| 2196 | |
| 2197 | |
| 2198 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 2199 | #define WE_LED_FLASHING_PARAM 10 |
| 2200 | #endif |
| 2201 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2202 | /* |
| 2203 | * <ioctl> |
| 2204 | * pm_clist - Increments the index value of the concurrent connection list |
| 2205 | * and update with the input parameters provided. |
| 2206 | * |
| 2207 | * @INPUT: Following 8 arguments: |
| 2208 | * @vdev_id: vdev id |
| 2209 | * @tx_streams: TX streams |
| 2210 | * @rx_streams: RX streams |
| 2211 | * @chain_mask: Chain mask |
| 2212 | * @type: vdev_type |
| 2213 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2214 | * @sub_type: vdev_subtype |
| 2215 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2216 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2217 | * @channel: Channel |
| 2218 | * @mac: Mac id |
| 2219 | * |
| 2220 | * @OUTPUT: None |
| 2221 | * |
| 2222 | * This IOCTL is used to increments the index value of the concurrent connection |
| 2223 | * list and update with the input parameters provided. |
| 2224 | * |
| 2225 | * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type |
| 2226 | * sub_type channel mac |
| 2227 | * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1 |
| 2228 | * |
| 2229 | * Supported Feature: DBS |
| 2230 | * |
| 2231 | * Usage: Internal/External |
| 2232 | * |
| 2233 | * </ioctl> |
| 2234 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2235 | #define WE_POLICY_MANAGER_CLIST_CMD 11 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2236 | |
| 2237 | /* |
| 2238 | * <ioctl> |
| 2239 | * pm_dlist - Delete the index from the concurrent connection list that is |
| 2240 | * present in the given vdev_id. |
| 2241 | * |
| 2242 | * @INPUT: delete_all, vdev_id |
| 2243 | * @delete_all: delete all indices |
| 2244 | * @vdev_id: vdev id |
| 2245 | * |
| 2246 | * @OUTPUT: None |
| 2247 | * |
| 2248 | * This IOCTL is used to delete the index from the concurrent connection list |
| 2249 | * that is present in the given vdev_id. |
| 2250 | * |
| 2251 | * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id |
| 2252 | * iwpriv wlan0 pm_dlist 0 1 |
| 2253 | * |
| 2254 | * Supported Feature: DBS |
| 2255 | * |
| 2256 | * Usage: Internal/External |
| 2257 | * |
| 2258 | * </ioctl> |
| 2259 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2260 | #define WE_POLICY_MANAGER_DLIST_CMD 12 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2261 | |
| 2262 | /* |
| 2263 | * <ioctl> |
| 2264 | * pm_dbs - Set dbs capability and system preference |
| 2265 | * |
| 2266 | * @INPUT: dbs, system_pref |
| 2267 | * @dbs: Value of DBS capability to be set |
| 2268 | * @system_pref: System preference |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2269 | * 0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2270 | * |
| 2271 | * @OUTPUT: None |
| 2272 | * |
| 2273 | * This IOCTL is used to set dbs capability and system preference. |
| 2274 | * |
| 2275 | * @E.g: iwpriv wlan0 pm_dbs dbs system_pref |
| 2276 | * iwpriv wlan0 pm_dbs 1 0 |
| 2277 | * |
| 2278 | * Supported Feature: DBS |
| 2279 | * |
| 2280 | * Usage: Internal/External |
| 2281 | * |
| 2282 | * </ioctl> |
| 2283 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2284 | #define WE_POLICY_MANAGER_DBS_CMD 13 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2285 | |
| 2286 | /* |
| 2287 | * <ioctl> |
| 2288 | * pm_pcl - Set pcl for concurrency mode. |
| 2289 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2290 | * @INPUT: policy_mgr_con_mode |
| 2291 | * @policy_mgr_con_mode: concurrency mode for PCL table |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2292 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2293 | * |
| 2294 | * @OUTPUT: None |
| 2295 | * |
| 2296 | * This IOCTL is used to set pcl for concurrency mode. |
| 2297 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2298 | * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2299 | * iwpriv wlan0 pm_pcl 0 |
| 2300 | * |
| 2301 | * Supported Feature: DBS |
| 2302 | * |
| 2303 | * Usage: Internal/External |
| 2304 | * |
| 2305 | * </ioctl> |
| 2306 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2307 | #define WE_POLICY_MANAGER_PCL_CMD 14 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2308 | |
| 2309 | /* |
| 2310 | * <ioctl> |
| 2311 | * pm_cinfo - Shows the concurrent connection list. |
| 2312 | * |
| 2313 | * @INPUT: None |
| 2314 | * |
| 2315 | * @OUTPUT: None |
| 2316 | * |
| 2317 | * This IOCTL is used to show the concurrent connection list. |
| 2318 | * |
| 2319 | * @E.g: iwpriv wlan0 pm_cinfo |
| 2320 | * |
| 2321 | * Supported Feature: DBS |
| 2322 | * |
| 2323 | * Usage: Internal/External |
| 2324 | * |
| 2325 | * </ioctl> |
| 2326 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2327 | #define WE_POLICY_MANAGER_CINFO_CMD 15 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2328 | |
| 2329 | /* |
| 2330 | * <ioctl> |
| 2331 | * pm_ulist - Updates the index value of the concurrent connection list |
| 2332 | * with the input parameters provided. |
| 2333 | * |
| 2334 | * @INPUT: Following 8 arguments: |
| 2335 | * @vdev_id: vdev id |
| 2336 | * @tx_streams: TX streams |
| 2337 | * @rx_streams: RX streams |
| 2338 | * @chain_mask: Chain mask |
| 2339 | * @type: vdev_type |
| 2340 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2341 | * @sub_type: vdev_subtype |
| 2342 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2343 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2344 | * @channel: Channel |
| 2345 | * @mac: Mac id |
| 2346 | * |
| 2347 | * @OUTPUT: None |
| 2348 | * |
| 2349 | * This IOCTL is used to updates the index value of the concurrent |
| 2350 | * connection list with the input parameters provided. |
| 2351 | * |
| 2352 | * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type |
| 2353 | * sub_type channel mac |
| 2354 | * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1 |
| 2355 | * |
| 2356 | * Supported Feature: DBS |
| 2357 | * |
| 2358 | * Usage: Internal/External |
| 2359 | * |
| 2360 | * </ioctl> |
| 2361 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2362 | #define WE_POLICY_MANAGER_ULIST_CMD 16 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2363 | |
| 2364 | /* |
| 2365 | * <ioctl> |
| 2366 | * pm_query_action - Initiate actions needed on current connections as |
| 2367 | * per the channel provided. |
| 2368 | * |
| 2369 | * @INPUT: channel |
| 2370 | * @channel: Channel on which new connection will be. |
| 2371 | * |
| 2372 | * @OUTPUT: None |
| 2373 | * |
| 2374 | * This IOCTL is used to initiate actions needed on current connections |
| 2375 | * as per the channel provided. |
| 2376 | * |
| 2377 | * @E.g: iwpriv wlan0 pm_query_action channel |
| 2378 | * iwpriv wlan0 pm_query_action 6 |
| 2379 | * |
| 2380 | * Supported Feature: DBS |
| 2381 | * |
| 2382 | * Usage: Internal/External |
| 2383 | * |
| 2384 | * </ioctl> |
| 2385 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2386 | #define WE_POLICY_MANAGER_QUERY_ACTION_CMD 17 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2387 | |
| 2388 | /* |
| 2389 | * <ioctl> |
| 2390 | * pm_query_allow - Checks for allowed concurrency combination |
| 2391 | * |
| 2392 | * @INPUT: mode, channel, bandwidth |
| 2393 | * @mode: new connection mode |
| 2394 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2395 | * @channel: channel on which new connection is coming up |
| 2396 | * @bandwidth: Bandwidth requested by the connection |
| 2397 | * 0:None 1:5MHz 2:10MHz 3:20MHz |
| 2398 | * 4:40MHz 5:80MHz 6:80+80MHz 7:160MHz |
| 2399 | * |
| 2400 | * @OUTPUT: None |
| 2401 | * |
| 2402 | * This IOCTL is used to checks for allowed concurrency combination. |
| 2403 | * |
| 2404 | * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth |
| 2405 | * iwpriv wlan0 pm_query_allow 0 6 4 |
| 2406 | * |
| 2407 | * Supported Feature: DBS |
| 2408 | * |
| 2409 | * Usage: Internal/External |
| 2410 | * |
| 2411 | * </ioctl> |
| 2412 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2413 | #define WE_POLICY_MANAGER_QUERY_ALLOW_CMD 18 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2414 | |
| 2415 | /* |
| 2416 | * <ioctl> |
| 2417 | * pm_run_scenario - Create scenario with number of connections provided. |
| 2418 | * |
| 2419 | * @INPUT: num_of_conn |
| 2420 | * @num_of_conn: the number of connections (values: 1~3) |
| 2421 | * |
| 2422 | * @OUTPUT: None |
| 2423 | * |
| 2424 | * This IOCTL is used to create scenario with the number of connections |
| 2425 | * provided. |
| 2426 | * |
| 2427 | * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn |
| 2428 | * iwpriv wlan0 pm_run_scenario 1 |
| 2429 | * |
| 2430 | * Supported Feature: DBS |
| 2431 | * |
| 2432 | * Usage: Internal/External |
| 2433 | * |
| 2434 | * </ioctl> |
| 2435 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2436 | #define WE_POLICY_MANAGER_SCENARIO_CMD 19 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2437 | |
| 2438 | /* |
| 2439 | * <ioctl> |
| 2440 | * pm_set_hw_mode - Set hardware for single/dual mac. |
| 2441 | * |
| 2442 | * @INPUT: hw_mode |
| 2443 | * 0:single mac 1:dual mac |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 2444 | * 2: 2x2 5g + 1x1 2g dbs mode |
| 2445 | * 3: 2x2 2g + 1x1 5g dbs mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2446 | * |
| 2447 | * @OUTPUT: None |
| 2448 | * |
| 2449 | * This IOCTL is used to set hardware for single/dual mac. |
| 2450 | * |
| 2451 | * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode |
| 2452 | * iwpriv wlan0 pm_set_hw_mode 1 |
| 2453 | * |
| 2454 | * Supported Feature: DBS |
| 2455 | * |
| 2456 | * Usage: Internal/External |
| 2457 | * |
| 2458 | * </ioctl> |
| 2459 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2460 | #define WE_POLICY_SET_HW_MODE_CMD 20 |
| 2461 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2462 | /* |
| 2463 | * <ioctl> |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 2464 | * ch_avoid - unit test SAP channel avoidance |
| 2465 | * |
| 2466 | * @INPUT: chan avoid ranges |
| 2467 | * |
| 2468 | * @OUTPUT: none |
| 2469 | * |
| 2470 | * This IOCTL is used to fake a channel avoidance event. |
| 2471 | * To test SAP/GO chan switch during chan avoid event process. |
| 2472 | * |
| 2473 | * @E.g: iwpriv wlan0 ch_avoid 2452 2462 |
| 2474 | * |
| 2475 | * Supported Feature: SAP chan avoidance. |
| 2476 | * |
| 2477 | * Usage: Internal |
| 2478 | * |
| 2479 | * </ioctl> |
| 2480 | */ |
| 2481 | #define WE_SET_CHAN_AVOID 21 |
| 2482 | |
| 2483 | /* |
| 2484 | * <ioctl> |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2485 | * set_scan_cfg - Set dual MAC scan config parameters. |
| 2486 | * |
| 2487 | * @INPUT: dbs, dbs_plus_agile_scan, single_mac_scan_with_dbs |
| 2488 | * @dbs: Value of DBS bit |
| 2489 | * @dbs_plus_agile_scan: Value of DBS plus agile scan bit |
| 2490 | * @single_mac_scan_with_dbs: Value of Single MAC scan with DBS |
| 2491 | * |
| 2492 | * @OUTPUT: None |
| 2493 | * |
| 2494 | * This IOCTL is used to set the dual MAC scan config. |
| 2495 | * |
| 2496 | * @E.g: iwpriv wlan0 set_scan_cfg dbs dbs_plus_agile_scan |
| 2497 | * single_mac_scan_with_dbs |
| 2498 | * iwpriv wlan0 set_scan_cfg 1 0 1 |
| 2499 | * |
| 2500 | * Supported Feature: DBS |
| 2501 | * |
| 2502 | * Usage: Internal/External |
| 2503 | * |
| 2504 | * </ioctl> |
| 2505 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2506 | #define WE_SET_DUAL_MAC_SCAN_CONFIG 21 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2507 | |
| 2508 | /* |
| 2509 | * <ioctl> |
| 2510 | * set_fw_mode_cfg - Sets the dual mac FW mode config |
| 2511 | * |
| 2512 | * @INPUT: dbs, dfs |
| 2513 | * @dbs: DBS bit |
| 2514 | * @dfs: Agile DFS bit |
| 2515 | * |
| 2516 | * @OUTPUT: None |
| 2517 | * |
| 2518 | * This IOCTL is used to set the dual mac FW mode config. |
| 2519 | * |
| 2520 | * @E.g: iwpriv wlan0 set_fw_mode_cfg dbs dfs |
| 2521 | * iwpriv wlan0 set_fw_mode_cfg 1 1 |
| 2522 | * |
| 2523 | * Supported Feature: DBS |
| 2524 | * |
| 2525 | * Usage: Internal/External |
| 2526 | * |
| 2527 | * </ioctl> |
| 2528 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2529 | #define WE_SET_DUAL_MAC_FW_MODE_CONFIG 22 |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 2530 | #define WE_SET_MON_MODE_CHAN 23 |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 2531 | /* |
| 2532 | * <ioctl> |
| 2533 | * txrx_stats - TXRX statistics query |
| 2534 | * |
| 2535 | * @INPUT: query category, mac id (default mac id is 0) |
| 2536 | * |
| 2537 | * @OUTPUT: TXRX statistics result |
| 2538 | * |
| 2539 | * This IOCTL is used to get TXRX statistics counters. |
| 2540 | * |
| 2541 | * @E.g: iwpriv wlan0 txrx_stats 21 0 |
| 2542 | * iwpriv wlan0 txrx_stats 21 1 |
| 2543 | * |
| 2544 | * Usage: Internal |
| 2545 | * |
| 2546 | * </ioctl> |
| 2547 | */ |
| 2548 | #define WE_SET_TXRX_STATS 24 |
| 2549 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2550 | |
| 2551 | #ifdef FEATURE_WLAN_TDLS |
| 2552 | #undef MAX_VAR_ARGS |
| 2553 | #define MAX_VAR_ARGS 11 |
| 2554 | #else |
| 2555 | #undef MAX_VAR_ARGS |
| 2556 | #define MAX_VAR_ARGS 9 |
| 2557 | #endif |
| 2558 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2559 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 2560 | #undef MAX_VAR_ARGS |
| 2561 | #define MAX_VAR_ARGS 15 |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2562 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2563 | #define WE_MOTION_DET_CONFIG_PARAM 25 |
| 2564 | #define WE_MOTION_DET_BASE_LINE_CONFIG_PARAM 26 |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2565 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2566 | #define WE_SET_THERMAL_THROTTLE_CFG 27 |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 2567 | /* |
| 2568 | * <ioctl> |
| 2569 | * fips_test - Perform a FIPS test |
| 2570 | * |
| 2571 | * @INPUT: Binary representation of the following packed structure |
| 2572 | * |
| 2573 | * @OUTPUT: Binary representation of the following packed structure |
| 2574 | * |
| 2575 | * This IOCTL is used to perform FIPS certification testing |
| 2576 | * |
| 2577 | * @E.g: iwpriv wlan0 fips_test <test vector> |
| 2578 | * |
| 2579 | * iwpriv wlan0 fips_test <tbd> |
| 2580 | * |
| 2581 | * Supported Feature: FIPS |
| 2582 | * |
| 2583 | * Usage: Internal |
| 2584 | * |
| 2585 | * </ioctl> |
| 2586 | */ |
| 2587 | #define WLAN_PRIV_FIPS_TEST (SIOCIWFIRSTPRIV + 8) |
| 2588 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2589 | /* Private ioctls (with no sub-ioctls) */ |
| 2590 | /* note that they must be odd so that they have "get" semantics */ |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2591 | /* |
| 2592 | * <ioctl> |
| 2593 | * addTspec - Add TSPEC for each AC |
| 2594 | * |
| 2595 | * @INPUT: 19 TSPEC params |
| 2596 | * @[arg0]: handle |
| 2597 | * @[arg1]: tid |
| 2598 | * @[arg2]: dir |
| 2599 | * @[arg3]: psb |
| 2600 | * @[arg4]: up |
| 2601 | * @[arg5]: nomMsduSize |
| 2602 | * @[arg6]: maxMsduSize |
| 2603 | * @[arg7]: minDataRate |
| 2604 | * @[arg8]: meanDataRate |
| 2605 | * @[arg9]: peakDataRate |
| 2606 | * @[arg10]: maxBurstSize |
| 2607 | * @[arg11]: minPhyRate |
| 2608 | * @[arg12]: sba |
| 2609 | * @[arg13]: minServiceIntv |
| 2610 | * @[arg14]: suspendIntv |
| 2611 | * @[arg15]: burstSizeDefn |
| 2612 | * @[arg16]: ackPolicy |
| 2613 | * @[arg17]: inactivityPeriod |
| 2614 | * @[arg18]: maxServiceIntv |
| 2615 | * |
| 2616 | * @OUTPUT: Success/Failure |
| 2617 | * |
| 2618 | * This IOCTL is used to add TSPEC for each AC. |
| 2619 | * |
| 2620 | * @E.g: iwpriv wlan0 addTspec <handle> <tid> <dir> <psb> <up> <nomMsduSize> |
| 2621 | * <maxMsduSize> <minDataRate> <meanDataRate> |
| 2622 | * <peakDataRate> <maxBurstSize> <minPhyRate> |
| 2623 | * <sba> <minServiceIntv> <suspendIntv> |
| 2624 | * <burstSizeDefn> <ackPolicy> <inactivityPeriod> |
| 2625 | * <maxServiceIntv> |
| 2626 | * iwpriv wlan0 addTspec 7001 6 2 1 6 0x80D0 0x80D0 0x14500 0x14500 0x14500 |
| 2627 | * 0 0x5B8D80 0x2001 20 2000 0 0 0 2000 |
| 2628 | * wlan0 addTspec:3 |
| 2629 | * |
| 2630 | * Supported Feature: WMM |
| 2631 | * |
| 2632 | * Usage: Internal/External |
| 2633 | * |
| 2634 | * </ioctl> |
| 2635 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2636 | #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2637 | /* |
| 2638 | * <ioctl> |
| 2639 | * delTspec - Delete TSPEC entry for each AC |
| 2640 | * |
| 2641 | * @INPUT: 1 TSPEC param |
| 2642 | * @[arg0]: handle |
| 2643 | * |
| 2644 | * @OUTPUT: Success/Failure |
| 2645 | * |
| 2646 | * This IOCTL is used to delete TSPEC entry for each AC. |
| 2647 | * |
| 2648 | * @E.g: iwpriv wlan0 delTspec <handle> |
| 2649 | * iwpriv wlan0 delTspec 7001 |
| 2650 | * wlan0 delTspec:16 |
| 2651 | * |
| 2652 | * Supported Feature: WMM |
| 2653 | * |
| 2654 | * Usage: Internal/External |
| 2655 | * |
| 2656 | * </ioctl> |
| 2657 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2658 | #define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2659 | /* |
| 2660 | * <ioctl> |
| 2661 | * getTspec - Get TSPEC entry for each AC |
| 2662 | * |
| 2663 | * @INPUT: 1 TSPEC param |
| 2664 | * @[arg0]: handle |
| 2665 | * |
| 2666 | * @OUTPUT: Success/Failure |
| 2667 | * |
| 2668 | * This IOCTL is used to get TSPEC entry for each AC. |
| 2669 | * |
| 2670 | * @E.g: iwpriv wlan0 getTspec <handle> |
| 2671 | * iwpriv wlan0 getTspec 7001 |
| 2672 | * wlan0 delTspec:18 |
| 2673 | * |
| 2674 | * Supported Feature: WMM |
| 2675 | * |
| 2676 | * Usage: Internal/External |
| 2677 | * |
| 2678 | * </ioctl> |
| 2679 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2680 | #define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13) |
| 2681 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2682 | /* (SIOCIWFIRSTPRIV + 10) is currently unused */ |
| 2683 | /* (SIOCIWFIRSTPRIV + 12) is currently unused */ |
| 2684 | /* (SIOCIWFIRSTPRIV + 14) is currently unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 2685 | #define WLAN_PRIV_SET_NONE_GET_THREE_INT (SIOCIWFIRSTPRIV + 15) |
| 2686 | #define WE_GET_TSF 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2687 | /* (SIOCIWFIRSTPRIV + 16) is currently unused */ |
| 2688 | /* (SIOCIWFIRSTPRIV + 17) is currently unused */ |
| 2689 | /* (SIOCIWFIRSTPRIV + 19) is currently unused */ |
| 2690 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2691 | #define WLAN_PRIV_SET_FTIES (SIOCIWFIRSTPRIV + 20) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2692 | |
| 2693 | /* Private ioctl for setting the host offload feature */ |
| 2694 | #define WLAN_PRIV_SET_HOST_OFFLOAD (SIOCIWFIRSTPRIV + 18) |
| 2695 | |
| 2696 | /* Private ioctl to get the statistics */ |
| 2697 | #define WLAN_GET_WLAN_STATISTICS (SIOCIWFIRSTPRIV + 21) |
| 2698 | |
| 2699 | /* Private ioctl to set the Keep Alive Params */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2700 | /* |
| 2701 | * <ioctl> |
| 2702 | * setKeepAlive - Set the keep alive feature |
| 2703 | * |
| 2704 | * @INPUT: 28 bytes of information in the order of packet type, time period |
| 2705 | * host IPv4 address, destination IPv4 address, destination MAC address, bssID |
| 2706 | * |
| 2707 | * @OUTPUT: None |
| 2708 | * |
| 2709 | * This IOCTL sets the keep alive feature to send either NULL |
| 2710 | * or unsolicited ARP response packets |
| 2711 | * |
| 2712 | * @E.g: iwpriv wlan0 setKeepAlive |
| 2713 | * |
| 2714 | * Supported Feature: STA |
| 2715 | * |
| 2716 | * Usage: Internal/External |
| 2717 | * |
| 2718 | * </ioctl> |
| 2719 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2720 | #define WLAN_SET_KEEPALIVE_PARAMS (SIOCIWFIRSTPRIV + 22) |
| 2721 | |
| 2722 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2723 | /* Private ioctl to set the packet filtering params */ |
| 2724 | #define WLAN_SET_PACKET_FILTER_PARAMS (SIOCIWFIRSTPRIV + 23) |
| 2725 | #endif |
| 2726 | |
| 2727 | |
| 2728 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2729 | /* Private ioctl to get the statistics */ |
| 2730 | #define WLAN_SET_PNO (SIOCIWFIRSTPRIV + 24) |
| 2731 | #endif |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2732 | /* |
| 2733 | * <ioctl> |
| 2734 | * SETBAND - Set the operational band |
| 2735 | * |
| 2736 | * @INPUT: 0 to Auto, 1 to 5 GHz and 2 to 2.4 GHz |
| 2737 | * |
| 2738 | * @OUTPUT: None |
| 2739 | * |
| 2740 | * This IOCTL Set the operational band If the new band is different from the |
| 2741 | * current operational band, it aborts the pending scan requests, flushes |
| 2742 | * the existing scan results, and then change * the band capability |
| 2743 | * |
| 2744 | * @E.g: iwpriv wlan0 SETBAND <value> |
| 2745 | * |
| 2746 | * Supported Feature: STA |
| 2747 | * |
| 2748 | * Usage: Internal/External |
| 2749 | * |
| 2750 | * </ioctl> |
| 2751 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2752 | #define WLAN_SET_BAND_CONFIG (SIOCIWFIRSTPRIV + 25) |
| 2753 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 2754 | #define WLAN_PRIV_SET_MCBC_FILTER (SIOCIWFIRSTPRIV + 26) |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 2755 | /* (SIOCIWFIRSTPRIV + 27) is currently unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2756 | |
| 2757 | /* Private ioctls and their sub-ioctls */ |
| 2758 | #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 2759 | #define WE_SET_SMPS_PARAM 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2760 | #define WE_SET_FW_CRASH_INJECT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2761 | #define WE_DUMP_DP_TRACE_LEVEL 3 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2762 | /* Private sub ioctl for enabling and setting histogram interval of profiling */ |
| 2763 | #define WE_ENABLE_FW_PROFILE 4 |
| 2764 | #define WE_SET_FW_PROFILE_HIST_INTVL 5 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2765 | |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 2766 | /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2767 | #define WE_SET_WLAN_SUSPEND 6 |
| 2768 | #define WE_SET_WLAN_RESUME 7 |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2769 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2770 | /* |
| 2771 | * <ioctl> |
| 2772 | * log_buffer - prints host/target related communication logs via dmesg |
| 2773 | * |
| 2774 | * @INPUT: Log Id, Count |
| 2775 | * |
| 2776 | * Log Id: |
| 2777 | * 0) HTC_CREDIT_HISTORY_LOG |
| 2778 | * 1) COMMAND_LOG, |
| 2779 | * 2) COMMAND_TX_CMP_LOG, |
| 2780 | * 3) MGMT_COMMAND_LOG, |
| 2781 | * 4) MGMT_COMMAND_TX_CMP_LOG, |
| 2782 | * 5) EVENT_LOG, |
| 2783 | * 6) RX_EVENT_LOG, |
| 2784 | * 7) MGMT_EVENT_LOG |
| 2785 | * |
| 2786 | * @OUTPUT: None |
| 2787 | * |
| 2788 | * @E.g: |
| 2789 | * # print up to 10 of the most recent records from HTC Credit History |
| 2790 | * iwpriv wlan0 log_buffer 0 10 |
| 2791 | * # print up to 3 of the most recent records from Event Log |
| 2792 | * iwpriv wlan0 log_buffer 5 3 |
| 2793 | * |
| 2794 | * Supported Feature: WLAN Trace |
| 2795 | * |
| 2796 | * Usage: Internal/External |
| 2797 | * |
| 2798 | * </ioctl> |
| 2799 | */ |
| 2800 | #define WE_LOG_BUFFER 8 |
| 2801 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2802 | /* |
| 2803 | * <ioctl> |
| 2804 | * set_ba_timeout - sets Block ACK aging timeout value for each Access class |
| 2805 | * |
| 2806 | * @INPUT: Access Class [0:BK, 1:BE, 2:VI, 3:VO], Timeout value |
| 2807 | * |
| 2808 | * @OUTPUT: None |
| 2809 | * |
| 2810 | * @E.g.: |
| 2811 | * # to set duration of 2 seconds for BE |
| 2812 | * iwpriv wlan0 set_ba_timeout 1 2 |
| 2813 | * # to set duration of 3 seconds for VO |
| 2814 | * iwpriv wlan0 set_ba_timeout 3 3 |
| 2815 | * |
| 2816 | * Usage: Internal |
| 2817 | * |
| 2818 | * </ioctl> |
| 2819 | */ |
| 2820 | #define WE_SET_BA_AGEING_TIMEOUT 9 |
| 2821 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2822 | enum host_target_comm_log { |
| 2823 | HTC_CREDIT_HISTORY_LOG = 0, |
| 2824 | COMMAND_LOG, |
| 2825 | COMMAND_TX_CMP_LOG, |
| 2826 | MGMT_COMMAND_LOG, |
| 2827 | MGMT_COMMAND_TX_CMP_LOG, |
| 2828 | EVENT_LOG, |
| 2829 | RX_EVENT_LOG, |
| 2830 | MGMT_EVENT_LOG |
| 2831 | }; |
| 2832 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2833 | /* (SIOCIWFIRSTPRIV + 29) is currently unused */ |
| 2834 | |
| 2835 | /* 802.11p IOCTL */ |
| 2836 | #define WLAN_SET_DOT11P_CHANNEL_SCHED (SIOCIWFIRSTPRIV + 30) |
| 2837 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2838 | /* |
| 2839 | * <ioctl> |
| 2840 | * getLinkSpeed - Gets the current link speed in Mbps |
| 2841 | * |
| 2842 | * @INPUT: None |
| 2843 | * |
| 2844 | * @OUTPUT: linkspeed in mbps |
| 2845 | * wlan0 getLinkSpeed:7 |
| 2846 | * |
| 2847 | * This IOCTL is used get the current link speed in Mbps |
| 2848 | * |
| 2849 | * @E.g: iwpriv wlan0 getLinkSpeed |
| 2850 | * |
| 2851 | * Supported Feature: STA |
| 2852 | * |
| 2853 | * Usage: Internal/External |
| 2854 | * |
| 2855 | * </ioctl> |
| 2856 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2857 | #define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 2858 | |
| 2859 | #define WLAN_STATS_INVALID 0 |
| 2860 | #define WLAN_STATS_RETRY_CNT 1 |
| 2861 | #define WLAN_STATS_MUL_RETRY_CNT 2 |
| 2862 | #define WLAN_STATS_TX_FRM_CNT 3 |
| 2863 | #define WLAN_STATS_RX_FRM_CNT 4 |
| 2864 | #define WLAN_STATS_FRM_DUP_CNT 5 |
| 2865 | #define WLAN_STATS_FAIL_CNT 6 |
| 2866 | #define WLAN_STATS_RTS_FAIL_CNT 7 |
| 2867 | #define WLAN_STATS_ACK_FAIL_CNT 8 |
| 2868 | #define WLAN_STATS_RTS_SUC_CNT 9 |
| 2869 | #define WLAN_STATS_RX_DISCARD_CNT 10 |
| 2870 | #define WLAN_STATS_RX_ERROR_CNT 11 |
| 2871 | #define WLAN_STATS_TX_BYTE_CNT 12 |
| 2872 | |
| 2873 | #define WLAN_STATS_RX_BYTE_CNT 13 |
| 2874 | #define WLAN_STATS_RX_RATE 14 |
| 2875 | #define WLAN_STATS_TX_RATE 15 |
| 2876 | |
| 2877 | #define WLAN_STATS_RX_UC_BYTE_CNT 16 |
| 2878 | #define WLAN_STATS_RX_MC_BYTE_CNT 17 |
| 2879 | #define WLAN_STATS_RX_BC_BYTE_CNT 18 |
| 2880 | #define WLAN_STATS_TX_UC_BYTE_CNT 19 |
| 2881 | #define WLAN_STATS_TX_MC_BYTE_CNT 20 |
| 2882 | #define WLAN_STATS_TX_BC_BYTE_CNT 21 |
| 2883 | |
| 2884 | #define FILL_TLV(__p, __type, __size, __val, __tlen) do { \ |
| 2885 | if ((__tlen + __size + 2) < WE_MAX_STR_LEN) { \ |
| 2886 | *__p++ = __type; \ |
| 2887 | *__p++ = __size; \ |
| 2888 | memcpy(__p, __val, __size); \ |
| 2889 | __p += __size; \ |
| 2890 | __tlen += __size + 2; \ |
| 2891 | } else { \ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2892 | hdd_err("FILL_TLV Failed!!!"); \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2893 | } \ |
| 2894 | } while (0) |
| 2895 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2896 | #define TX_PER_TRACKING_DEFAULT_RATIO 5 |
| 2897 | #define TX_PER_TRACKING_MAX_RATIO 10 |
| 2898 | #define TX_PER_TRACKING_DEFAULT_WATERMARK 5 |
| 2899 | |
| 2900 | #define WLAN_ADAPTER 0 |
| 2901 | #define P2P_ADAPTER 1 |
| 2902 | |
| 2903 | /** |
| 2904 | * mem_alloc_copy_from_user_helper - copy from user helper |
| 2905 | * @wrqu_data: wireless extensions request data |
| 2906 | * @len: length of @wrqu_data |
| 2907 | * |
| 2908 | * Helper function to allocate buffer and copy user data. |
| 2909 | * |
| 2910 | * Return: On success return a pointer to a kernel buffer containing a |
| 2911 | * copy of the userspace data (with an additional NUL character |
| 2912 | * appended for safety). On failure return %NULL. |
| 2913 | */ |
| 2914 | void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len) |
| 2915 | { |
| 2916 | u8 *ptr = NULL; |
| 2917 | |
| 2918 | /* in order to protect the code, an extra byte is post |
| 2919 | * appended to the buffer and the null termination is added. |
| 2920 | * However, when allocating (len+1) byte of memory, we need to |
| 2921 | * make sure that there is no uint overflow when doing |
| 2922 | * addition. In theory check len < UINT_MAX protects the uint |
| 2923 | * overflow. For wlan private ioctl, the buffer size is much |
| 2924 | * less than UINT_MAX, as a good guess, now, it is assumed |
| 2925 | * that the private command buffer size is no greater than 4K |
| 2926 | * (4096 bytes). So we use 4096 as the upper boundary for now. |
| 2927 | */ |
| 2928 | if (len > MAX_USER_COMMAND_SIZE) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 2929 | hdd_err("Invalid length: %zu max: %u", |
| 2930 | len, MAX_USER_COMMAND_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2931 | return NULL; |
| 2932 | } |
| 2933 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2934 | ptr = qdf_mem_malloc(len + 1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2935 | if (NULL == ptr) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2936 | hdd_err("unable to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2937 | return NULL; |
| 2938 | } |
| 2939 | |
| 2940 | if (copy_from_user(ptr, wrqu_data, len)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2941 | hdd_err("failed to copy data to user buffer"); |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2942 | qdf_mem_free(ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2943 | return NULL; |
| 2944 | } |
| 2945 | ptr[len] = '\0'; |
| 2946 | return ptr; |
| 2947 | } |
| 2948 | |
| 2949 | /** |
| 2950 | * hdd_priv_get_data() - Get pointer to ioctl private data |
| 2951 | * @p_priv_data: pointer to iw_point struct to be filled |
| 2952 | * @wrqu: Pointer to IOCTL Data received from userspace |
| 2953 | * |
| 2954 | * Helper function to get compatible struct iw_point passed to ioctl |
| 2955 | * |
| 2956 | * Return - 0 if p_priv_data successfully filled, error otherwise |
| 2957 | */ |
| 2958 | int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) |
| 2959 | { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2960 | if ((NULL == p_priv_data) || (NULL == wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2961 | return -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2962 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2963 | #ifdef CONFIG_COMPAT |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 2964 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2965 | struct compat_iw_point *p_compat_priv_data; |
| 2966 | |
| 2967 | /* Compat task: |
| 2968 | * typecast to compat structure and copy the members. |
| 2969 | */ |
| 2970 | p_compat_priv_data = (struct compat_iw_point *)&wrqu->data; |
| 2971 | |
| 2972 | p_priv_data->pointer = compat_ptr(p_compat_priv_data->pointer); |
| 2973 | p_priv_data->length = p_compat_priv_data->length; |
| 2974 | p_priv_data->flags = p_compat_priv_data->flags; |
| 2975 | } else { |
| 2976 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2977 | |
| 2978 | /* Non compat task: directly copy the structure. */ |
| 2979 | memcpy(p_priv_data, &wrqu->data, sizeof(struct iw_point)); |
| 2980 | |
| 2981 | #ifdef CONFIG_COMPAT |
| 2982 | } |
| 2983 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2984 | |
| 2985 | return 0; |
| 2986 | } |
| 2987 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2988 | static int hdd_check_wext_control(enum hdd_wext_control wext_control, |
| 2989 | struct iw_request_info *info) |
| 2990 | { |
| 2991 | switch (wext_control) { |
| 2992 | default: |
| 2993 | case hdd_wext_disabled: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 2994 | hdd_err_rl("Rejecting disabled ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2995 | return -ENOTSUPP; |
| 2996 | case hdd_wext_deprecated: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 2997 | hdd_warn_rl("Using deprecated ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2998 | return 0; |
| 2999 | case hdd_wext_enabled: |
| 3000 | return 0; |
| 3001 | } |
| 3002 | } |
| 3003 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 3004 | int hdd_check_private_wext_control(struct hdd_context *hdd_ctx, |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3005 | struct iw_request_info *info) |
| 3006 | { |
| 3007 | return hdd_check_wext_control(hdd_ctx->config->private_wext_control, |
| 3008 | info); |
| 3009 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3010 | |
| 3011 | /** |
| 3012 | * hdd_wlan_get_stats() - Get txrx stats in SAP mode |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3013 | * @adapter: Pointer to the hdd adapter. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3014 | * @length: Size of the data copied |
| 3015 | * @buffer: Pointer to char buffer. |
| 3016 | * @buf_len: Length of the char buffer. |
| 3017 | * |
| 3018 | * This function called when the "iwpriv wlan0 get_stats" command is given. |
| 3019 | * It used to collect the txrx stats when the device is configured in SAP mode. |
| 3020 | * |
| 3021 | * Return - none |
| 3022 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3023 | void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3024 | char *buffer, uint16_t buf_len) |
| 3025 | { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3026 | struct hdd_tx_rx_stats *stats = &adapter->hdd_stats.tx_rx_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3027 | uint32_t len = 0; |
| 3028 | uint32_t total_rx_pkt = 0, total_rx_dropped = 0; |
| 3029 | uint32_t total_rx_delv = 0, total_rx_refused = 0; |
| 3030 | int i = 0; |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3031 | struct hdd_context *hdd_ctx = adapter->hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3032 | |
| 3033 | for (; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3034 | total_rx_pkt += stats->rx_packets[i]; |
| 3035 | total_rx_dropped += stats->rx_dropped[i]; |
| 3036 | total_rx_delv += stats->rx_delivered[i]; |
| 3037 | total_rx_refused += stats->rx_refused[i]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3038 | } |
| 3039 | |
| 3040 | len = scnprintf(buffer, buf_len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3041 | "\nTransmit[%lu] - " |
| 3042 | "called %u, dropped %u orphan %u," |
| 3043 | "\n[dropped] BK %u, BE %u, VI %u, VO %u" |
| 3044 | "\n[classified] BK %u, BE %u, VI %u, VO %u" |
| 3045 | "\n\nReceive[%lu] - " |
| 3046 | "packets %u, dropped %u, delivered %u, refused %u\n" |
| 3047 | "GRO - agg %u non-agg %u flushes(%u %u) disabled(conc %u low-tput %u)\n", |
| 3048 | qdf_system_ticks(), |
| 3049 | stats->tx_called, |
| 3050 | stats->tx_dropped, |
| 3051 | stats->tx_orphaned, |
| 3052 | stats->tx_dropped_ac[SME_AC_BK], |
| 3053 | stats->tx_dropped_ac[SME_AC_BE], |
| 3054 | stats->tx_dropped_ac[SME_AC_VI], |
| 3055 | stats->tx_dropped_ac[SME_AC_VO], |
| 3056 | stats->tx_classified_ac[SME_AC_BK], |
| 3057 | stats->tx_classified_ac[SME_AC_BE], |
| 3058 | stats->tx_classified_ac[SME_AC_VI], |
| 3059 | stats->tx_classified_ac[SME_AC_VO], |
| 3060 | qdf_system_ticks(), |
| 3061 | total_rx_pkt, total_rx_dropped, total_rx_delv, |
| 3062 | total_rx_refused, |
| 3063 | stats->rx_aggregated, stats->rx_non_aggregated, |
| 3064 | stats->rx_gro_flushes, |
| 3065 | stats->rx_gro_force_flushes, |
| 3066 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_concurrency), |
| 3067 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_low_tput)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3068 | |
| 3069 | for (i = 0; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3070 | if (stats->rx_packets[i] == 0) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3071 | continue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3072 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3073 | "Rx CPU[%d]:" |
| 3074 | "packets %u, dropped %u, delivered %u, refused %u\n", |
| 3075 | i, stats->rx_packets[i], stats->rx_dropped[i], |
| 3076 | stats->rx_delivered[i], stats->rx_refused[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3077 | } |
| 3078 | |
| 3079 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3080 | "\nTX_FLOW" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3081 | "\nCurrent status: %s" |
| 3082 | "\ntx-flow timer start count %u" |
| 3083 | "\npause count %u, unpause count %u", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3084 | (stats->is_txflow_paused == true ? "PAUSED" : "UNPAUSED"), |
| 3085 | stats->txflow_timer_cnt, |
| 3086 | stats->txflow_pause_cnt, |
| 3087 | stats->txflow_unpause_cnt); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3088 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 3089 | len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3090 | adapter->session_id, &buffer[len], (buf_len - len)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3091 | *length = len + 1; |
| 3092 | } |
| 3093 | |
| 3094 | /** |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3095 | * wlan_hdd_write_suspend_resume_stats() - Writes suspend/resume stats to buffer |
| 3096 | * @hdd_ctx: The Hdd context owning the stats to be written |
| 3097 | * @buffer: The char buffer to write to |
| 3098 | * @max_len: The maximum number of chars to write |
| 3099 | * |
| 3100 | * This assumes hdd_ctx has already been validated, and buffer is not NULL. |
| 3101 | * |
| 3102 | * Return - length of written content, negative number on error |
| 3103 | */ |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3104 | #ifdef QCA_SUPPORT_CP_STATS |
| 3105 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
| 3106 | char *buffer, uint16_t max_len) |
| 3107 | { |
| 3108 | int ret; |
| 3109 | QDF_STATUS status; |
| 3110 | struct suspend_resume_stats *sr_stats; |
| 3111 | |
| 3112 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3113 | ret = scnprintf(buffer, max_len, |
| 3114 | "\n" |
| 3115 | "Suspends: %u\n" |
| 3116 | "Resumes: %u\n" |
| 3117 | "\n" |
| 3118 | "Suspend Fail Reasons\n" |
| 3119 | "\tIPA: %u\n" |
| 3120 | "\tRadar: %u\n" |
| 3121 | "\tRoam: %u\n" |
| 3122 | "\tScan: %u\n" |
| 3123 | "\tInitial Wakeup: %u\n" |
| 3124 | "\n", |
| 3125 | sr_stats->suspends, sr_stats->resumes, |
| 3126 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3127 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3128 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3129 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3130 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]); |
| 3131 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3132 | status = ucfg_mc_cp_stats_write_wow_stats(hdd_ctx->psoc, |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3133 | &buffer[ret], max_len - ret, |
| 3134 | &ret); |
| 3135 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3136 | hdd_err("Failed to get WoW stats"); |
| 3137 | return qdf_status_to_os_return(status); |
| 3138 | } |
| 3139 | |
| 3140 | return ret; |
| 3141 | } |
| 3142 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3143 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3144 | char *buffer, uint16_t max_len) |
| 3145 | { |
| 3146 | QDF_STATUS status; |
| 3147 | struct suspend_resume_stats *sr_stats; |
| 3148 | struct sir_wake_lock_stats wow_stats; |
| 3149 | |
| 3150 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3151 | |
| 3152 | status = wma_get_wakelock_stats(&wow_stats); |
| 3153 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3154 | hdd_err("Failed to get WoW stats"); |
| 3155 | return qdf_status_to_os_return(status); |
| 3156 | } |
| 3157 | |
| 3158 | return scnprintf(buffer, max_len, |
| 3159 | "\n" |
| 3160 | "Suspends: %u\n" |
| 3161 | "Resumes: %u\n" |
| 3162 | "\n" |
| 3163 | "Suspend Fail Reasons\n" |
| 3164 | "\tIPA: %u\n" |
| 3165 | "\tRadar: %u\n" |
| 3166 | "\tRoam: %u\n" |
| 3167 | "\tScan: %u\n" |
| 3168 | "\tInitial Wakeup: %u\n" |
| 3169 | "\n" |
| 3170 | "WoW Wake Reasons\n" |
| 3171 | "\tunicast: %u\n" |
| 3172 | "\tbroadcast: %u\n" |
| 3173 | "\tIPv4 multicast: %u\n" |
| 3174 | "\tIPv6 multicast: %u\n" |
| 3175 | "\tIPv6 multicast RA: %u\n" |
| 3176 | "\tIPv6 multicast NS: %u\n" |
| 3177 | "\tIPv6 multicast NA: %u\n" |
| 3178 | "\tICMPv4: %u\n" |
| 3179 | "\tICMPv6: %u\n" |
| 3180 | "\tRSSI Breach: %u\n" |
| 3181 | "\tLow RSSI: %u\n" |
| 3182 | "\tG-Scan: %u\n" |
| 3183 | "\tPNO Complete: %u\n" |
| 3184 | "\tPNO Match: %u\n", |
| 3185 | sr_stats->suspends, |
| 3186 | sr_stats->resumes, |
| 3187 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3188 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3189 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3190 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3191 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP], |
| 3192 | wow_stats.wow_ucast_wake_up_count, |
| 3193 | wow_stats.wow_bcast_wake_up_count, |
| 3194 | wow_stats.wow_ipv4_mcast_wake_up_count, |
| 3195 | wow_stats.wow_ipv6_mcast_wake_up_count, |
| 3196 | wow_stats.wow_ipv6_mcast_ra_stats, |
| 3197 | wow_stats.wow_ipv6_mcast_ns_stats, |
| 3198 | wow_stats.wow_ipv6_mcast_na_stats, |
| 3199 | wow_stats.wow_icmpv4_count, |
| 3200 | wow_stats.wow_icmpv6_count, |
| 3201 | wow_stats.wow_rssi_breach_wake_up_count, |
| 3202 | wow_stats.wow_low_rssi_wake_up_count, |
| 3203 | wow_stats.wow_gscan_wake_up_count, |
| 3204 | wow_stats.wow_pno_complete_wake_up_count, |
| 3205 | wow_stats.wow_pno_match_wake_up_count); |
| 3206 | } |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3207 | #endif |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3208 | /** |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3209 | * hdd_wlan_list_fw_profile() - Get fw profiling points |
| 3210 | * @length: Size of the data copied |
| 3211 | * @buffer: Pointer to char buffer. |
| 3212 | * @buf_len: Length of the char buffer. |
| 3213 | * |
| 3214 | * This function called when the "iwpriv wlan0 listProfile" command is given. |
| 3215 | * It is used to get the supported profiling points in FW. |
| 3216 | * |
| 3217 | * Return - none |
| 3218 | */ |
| 3219 | void hdd_wlan_list_fw_profile(uint16_t *length, |
| 3220 | char *buffer, uint16_t buf_len) |
| 3221 | { |
| 3222 | uint32_t len = 0; |
| 3223 | |
| 3224 | len = scnprintf(buffer, buf_len, |
| 3225 | "PROF_CPU_IDLE: %u\n" |
| 3226 | "PROF_PPDU_PROC: %u\n" |
| 3227 | "PROF_PPDU_POST: %u\n" |
| 3228 | "PROF_HTT_TX_INPUT: %u\n" |
| 3229 | "PROF_MSDU_ENQ: %u\n" |
| 3230 | "PROF_PPDU_POST_HAL: %u\n" |
| 3231 | "PROF_COMPUTE_TX_TIME: %u\n", |
| 3232 | PROF_CPU_IDLE, |
| 3233 | PROF_PPDU_PROC, |
| 3234 | PROF_PPDU_POST, |
| 3235 | PROF_HTT_TX_INPUT, |
| 3236 | PROF_MSDU_ENQ, |
| 3237 | PROF_PPDU_POST_HAL, |
| 3238 | PROF_COMPUTE_TX_TIME); |
| 3239 | |
| 3240 | *length = len + 1; |
| 3241 | } |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3242 | |
| 3243 | #define HDD_DUMP_STAT_HELP(STAT_ID) \ |
| 3244 | hdd_nofl_info("%u -- %s", STAT_ID, (# STAT_ID)) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3245 | /** |
| 3246 | * hdd_display_stats_help() - print statistics help |
| 3247 | * |
| 3248 | * Return: none |
| 3249 | */ |
Jeff Johnson | a06efaa | 2018-04-18 09:43:21 -0700 | [diff] [blame] | 3250 | static void hdd_display_stats_help(void) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3251 | { |
Nirav Shah | e6194ac | 2018-07-13 11:04:41 +0530 | [diff] [blame] | 3252 | hdd_nofl_info("iwpriv wlan0 dumpStats [option] - dump statistics"); |
| 3253 | hdd_nofl_info("iwpriv wlan0 clearStats [option] - clear statistics"); |
| 3254 | hdd_nofl_info("options:"); |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3255 | HDD_DUMP_STAT_HELP(CDP_TXRX_PATH_STATS); |
| 3256 | HDD_DUMP_STAT_HELP(CDP_TXRX_HIST_STATS); |
| 3257 | HDD_DUMP_STAT_HELP(CDP_TXRX_TSO_STATS); |
| 3258 | HDD_DUMP_STAT_HELP(CDP_HDD_NETIF_OPER_HISTORY); |
| 3259 | HDD_DUMP_STAT_HELP(CDP_DUMP_TX_FLOW_POOL_INFO); |
| 3260 | HDD_DUMP_STAT_HELP(CDP_TXRX_DESC_STATS); |
| 3261 | HDD_DUMP_STAT_HELP(CDP_HIF_STATS); |
| 3262 | HDD_DUMP_STAT_HELP(CDP_NAPI_STATS); |
| 3263 | HDD_DUMP_STAT_HELP(CDP_DP_NAPI_STATS); |
| 3264 | HDD_DUMP_STAT_HELP(CDP_DP_RX_THREAD_STATS); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3265 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3266 | |
| 3267 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3268 | * hdd_wlan_dump_stats() - display dump Stats |
| 3269 | * @adapter: adapter handle |
| 3270 | * @value: value from user |
| 3271 | * |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3272 | * Return: 0 => success, error code on failure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3273 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3274 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3275 | { |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3276 | int ret = 0; |
| 3277 | QDF_STATUS status; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3278 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3279 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 3280 | hdd_debug("%d", value); |
| 3281 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3282 | switch (value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3283 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3284 | wlan_hdd_display_tx_rx_histogram(hdd_ctx); |
| 3285 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3286 | case CDP_HDD_NETIF_OPER_HISTORY: |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 3287 | wlan_hdd_display_netif_queue_history |
| 3288 | (hdd_ctx, |
| 3289 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3290 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3291 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 3292 | hdd_display_hif_stats(); |
| 3293 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3294 | case CDP_LRO_STATS: |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3295 | hdd_lro_display_stats(hdd_ctx); |
Alok Kumar | f28ca24 | 2018-05-07 17:51:38 +0530 | [diff] [blame] | 3296 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3297 | case CDP_NAPI_STATS: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3298 | if (hdd_display_napi_stats()) { |
| 3299 | hdd_err("error displaying napi stats"); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3300 | ret = -EFAULT; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3301 | } |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3302 | break; |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3303 | case CDP_DP_RX_THREAD_STATS: |
| 3304 | dp_txrx_ext_dump_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 3305 | CDP_DP_RX_THREAD_STATS); |
| 3306 | break; |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3307 | case CDP_DISCONNECT_STATS: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3308 | sme_display_disconnect_stats(hdd_ctx->mac_handle, |
| 3309 | adapter->session_id); |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3310 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3311 | default: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3312 | status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3313 | value, |
| 3314 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3315 | if (status == QDF_STATUS_E_INVAL) { |
| 3316 | hdd_display_stats_help(); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3317 | ret = -EINVAL; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3318 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3319 | break; |
| 3320 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3321 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3322 | } |
| 3323 | |
| 3324 | /** |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3325 | * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3326 | * @adapter: Adapter upon which the IBSS client is active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3327 | * @staIdx: Station index of the IBSS peer |
| 3328 | * |
| 3329 | * Return: QDF_STATUS_STATUS if the peer was found and displayed, |
| 3330 | * otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3331 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3332 | static QDF_STATUS hdd_wlan_get_ibss_peer_info(struct hdd_adapter *adapter, |
Jeff Johnson | af2a093 | 2016-10-05 14:52:57 -0700 | [diff] [blame] | 3333 | uint8_t staIdx) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3334 | { |
| 3335 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3336 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3337 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3338 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3339 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3340 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3341 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3342 | hdd_get_ibss_peer_info_cb, |
| 3343 | false, staIdx); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3344 | |
| 3345 | if (QDF_STATUS_SUCCESS == status) { |
| 3346 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3347 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3348 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3349 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3350 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3351 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3352 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3353 | return QDF_STATUS_E_FAILURE; |
| 3354 | } |
| 3355 | |
| 3356 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3357 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", pPeerInfo->numPeers); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3358 | { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3359 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3360 | uint32_t tx_rate = pPeerInfo->peerInfoParams[0].txRate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3361 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3362 | qdf_mem_copy(mac_addr, pPeerInfo->peerInfoParams[0]. |
| 3363 | mac_addr, sizeof(mac_addr)); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3364 | hdd_debug("PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3365 | mac_addr, (int)tx_rate, |
| 3366 | (int)pPeerInfo->peerInfoParams[0].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3367 | } |
| 3368 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3369 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3370 | } |
| 3371 | |
| 3372 | return status; |
| 3373 | } |
| 3374 | |
| 3375 | /** |
| 3376 | * hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3377 | * @adapter: Adapter upon which the IBSS clients are active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3378 | * |
| 3379 | * Return: QDF_STATUS_STATUS if the peer information was retrieved and |
| 3380 | * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3381 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3382 | static QDF_STATUS hdd_wlan_get_ibss_peer_info_all(struct hdd_adapter *adapter) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3383 | { |
| 3384 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3385 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3386 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3387 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3388 | int i; |
| 3389 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3390 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3391 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3392 | hdd_get_ibss_peer_info_cb, |
| 3393 | true, 0xFF); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3394 | |
| 3395 | if (QDF_STATUS_SUCCESS == status) { |
| 3396 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3397 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3398 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3399 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3400 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3401 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3402 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3403 | return QDF_STATUS_E_FAILURE; |
| 3404 | } |
| 3405 | |
| 3406 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3407 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3408 | (int)pPeerInfo->numPeers); |
| 3409 | for (i = 0; i < pPeerInfo->numPeers; i++) { |
| 3410 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3411 | uint32_t tx_rate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3412 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3413 | tx_rate = pPeerInfo->peerInfoParams[i].txRate; |
| 3414 | qdf_mem_copy(mac_addr, |
| 3415 | pPeerInfo->peerInfoParams[i].mac_addr, |
| 3416 | sizeof(mac_addr)); |
| 3417 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3418 | hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3419 | mac_addr, (int)tx_rate, |
| 3420 | (int)pPeerInfo->peerInfoParams[i].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3421 | } |
| 3422 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3423 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3424 | } |
| 3425 | |
| 3426 | return status; |
| 3427 | } |
| 3428 | |
| 3429 | /** |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3430 | * hdd_get_ldpc() - Get adapter LDPC |
| 3431 | * @adapter: adapter being queried |
| 3432 | * @value: where to store the value |
| 3433 | * |
| 3434 | * Return: 0 on success, negative errno on failure |
| 3435 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3436 | int hdd_get_ldpc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3437 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3438 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3439 | int ret; |
| 3440 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3441 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3442 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3443 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING); |
| 3444 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3445 | hdd_err("Failed to get LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3446 | } else { |
| 3447 | *value = ret; |
| 3448 | ret = 0; |
| 3449 | } |
| 3450 | return ret; |
| 3451 | } |
| 3452 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3453 | int hdd_set_ldpc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3454 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3455 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3456 | int ret; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3457 | QDF_STATUS status; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3458 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3459 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3460 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3461 | hdd_debug("%d", value); |
Jeff Johnson | 1ca0476 | 2018-10-25 10:24:39 -0700 | [diff] [blame] | 3462 | |
| 3463 | if (!mac_handle) { |
| 3464 | hdd_err("NULL Mac handle"); |
| 3465 | return -EINVAL; |
| 3466 | } |
| 3467 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3468 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, &ht_cap_info); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3469 | if (QDF_STATUS_SUCCESS != status) { |
| 3470 | hdd_err("Failed to get HT capability info"); |
| 3471 | return -EIO; |
| 3472 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3473 | |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3474 | ht_cap_info.adv_coding_cap = value; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3475 | status = ucfg_mlme_set_ht_cap_info(hdd_ctx->psoc, ht_cap_info); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3476 | if (QDF_STATUS_SUCCESS != status) { |
| 3477 | hdd_err("Failed to set HT capability info"); |
| 3478 | return -EIO; |
| 3479 | } |
Vignesh Viswanathan | ecd4de7 | 2018-11-22 13:02:20 +0530 | [diff] [blame] | 3480 | status = ucfg_mlme_cfg_set_vht_ldpc_coding_cap(hdd_ctx->psoc, value); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3481 | if (QDF_IS_STATUS_ERROR(status)) { |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3482 | hdd_err("Failed to set VHT LDPC capability info"); |
| 3483 | return -EIO; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3484 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3485 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3486 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING, |
| 3487 | value); |
| 3488 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3489 | hdd_err("Failed to set LDPC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3490 | ret = sme_update_he_ldpc_supp(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3491 | if (ret) |
| 3492 | hdd_err("Failed to set HE LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3493 | |
| 3494 | return ret; |
| 3495 | } |
| 3496 | |
| 3497 | /** |
| 3498 | * hdd_get_tx_stbc() - Get adapter TX STBC |
| 3499 | * @adapter: adapter being queried |
| 3500 | * @value: where to store the value |
| 3501 | * |
| 3502 | * Return: 0 on success, negative errno on failure |
| 3503 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3504 | int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3505 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3506 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3507 | int ret; |
| 3508 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3509 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3510 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3511 | WNI_CFG_HT_CAP_INFO_TX_STBC); |
| 3512 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3513 | hdd_err("Failed to get TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3514 | } else { |
| 3515 | *value = ret; |
| 3516 | ret = 0; |
| 3517 | } |
| 3518 | |
| 3519 | return ret; |
| 3520 | } |
| 3521 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3522 | int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3523 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3524 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3525 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3526 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3527 | QDF_STATUS status; |
| 3528 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3529 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3530 | hdd_debug("%d", value); |
Jeff Johnson | 57ff4fa | 2018-10-25 10:29:47 -0700 | [diff] [blame] | 3531 | |
| 3532 | if (!mac_handle) { |
| 3533 | hdd_err("NULL Mac handle"); |
| 3534 | return -EINVAL; |
| 3535 | } |
| 3536 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3537 | if (value) { |
| 3538 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3539 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3540 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3541 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3542 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3543 | return -EIO; |
| 3544 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3545 | if (!ht_cap_info.tx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3546 | hdd_err("TX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3547 | return -EINVAL; |
| 3548 | } |
| 3549 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3550 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3551 | WNI_CFG_HT_CAP_INFO_TX_STBC, |
| 3552 | value); |
| 3553 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3554 | hdd_err("Failed to set TX STBC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3555 | ret = sme_update_he_tx_stbc_cap(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3556 | if (ret) |
| 3557 | hdd_err("Failed to set HE TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3558 | |
| 3559 | return ret; |
| 3560 | } |
| 3561 | |
| 3562 | /** |
| 3563 | * hdd_get_rx_stbc() - Get adapter RX STBC |
| 3564 | * @adapter: adapter being queried |
| 3565 | * @value: where to store the value |
| 3566 | * |
| 3567 | * Return: 0 on success, negative errno on failure |
| 3568 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3569 | int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3570 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3571 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3572 | int ret; |
| 3573 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3574 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3575 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3576 | WNI_CFG_HT_CAP_INFO_RX_STBC); |
| 3577 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3578 | hdd_err("Failed to get RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3579 | } else { |
| 3580 | *value = ret; |
| 3581 | ret = 0; |
| 3582 | } |
| 3583 | |
| 3584 | return ret; |
| 3585 | } |
| 3586 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3587 | int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3588 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3589 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3590 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3591 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3592 | QDF_STATUS status; |
| 3593 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3594 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3595 | hdd_debug("%d", value); |
Jeff Johnson | b664585 | 2018-10-25 10:35:41 -0700 | [diff] [blame] | 3596 | |
| 3597 | if (!mac_handle) { |
| 3598 | hdd_err("NULL Mac handle"); |
| 3599 | return -EINVAL; |
| 3600 | } |
| 3601 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3602 | if (value) { |
| 3603 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3604 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3605 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3606 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3607 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3608 | return -EIO; |
| 3609 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3610 | if (!ht_cap_info.rx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3611 | hdd_warn("RX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3612 | return -EINVAL; |
| 3613 | } |
| 3614 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3615 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3616 | WNI_CFG_HT_CAP_INFO_RX_STBC, |
| 3617 | value); |
| 3618 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3619 | hdd_err("Failed to set RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3620 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3621 | ret = sme_update_he_rx_stbc_cap(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3622 | if (ret) |
| 3623 | hdd_err("Failed to set HE RX STBC value"); |
| 3624 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3625 | return ret; |
| 3626 | } |
| 3627 | |
| 3628 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3629 | * iw_get_linkspeed() - Get current link speed ioctl |
| 3630 | * @dev: device upon which the ioctl was received |
| 3631 | * @info: ioctl request information |
| 3632 | * @wrqu: ioctl request data |
| 3633 | * @extra: extra ioctl buffer |
| 3634 | * |
| 3635 | * Return: 0 on success, non-zero on error |
| 3636 | */ |
| 3637 | static int __iw_get_linkspeed(struct net_device *dev, |
| 3638 | struct iw_request_info *info, |
| 3639 | union iwreq_data *wrqu, char *extra) |
| 3640 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3641 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3642 | char *pLinkSpeed = (char *)extra; |
| 3643 | int len = sizeof(uint32_t) + 1; |
| 3644 | uint32_t link_speed = 0; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3645 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3646 | int ret; |
| 3647 | int rc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3648 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 3649 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 3650 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3651 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3652 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 3653 | if (0 != ret) |
| 3654 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3655 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3656 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 3657 | if (0 != ret) |
| 3658 | return ret; |
| 3659 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3660 | ret = wlan_hdd_get_link_speed(adapter, &link_speed); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3661 | if (0 != ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3662 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3663 | |
| 3664 | wrqu->data.length = len; |
| 3665 | /* return the linkspeed as a string */ |
| 3666 | rc = snprintf(pLinkSpeed, len, "%u", link_speed); |
| 3667 | if ((rc < 0) || (rc >= len)) { |
| 3668 | /* encoding or length error? */ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3669 | hdd_err("Unable to encode link speed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3670 | return -EIO; |
| 3671 | } |
| 3672 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 3673 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3674 | /* a value is being successfully returned */ |
| 3675 | return 0; |
| 3676 | } |
| 3677 | |
| 3678 | static int iw_get_linkspeed(struct net_device *dev, |
| 3679 | struct iw_request_info *info, |
| 3680 | union iwreq_data *wrqu, char *extra) |
| 3681 | { |
| 3682 | int ret; |
| 3683 | |
| 3684 | cds_ssr_protect(__func__); |
| 3685 | ret = __iw_get_linkspeed(dev, info, wrqu, extra); |
| 3686 | cds_ssr_unprotect(__func__); |
| 3687 | |
| 3688 | return ret; |
| 3689 | } |
| 3690 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3691 | int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3692 | { |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3693 | struct net_device *net = adapter->dev; |
| 3694 | struct hdd_context *phddctx = WLAN_HDD_GET_CTX(adapter); |
| 3695 | mac_handle_t mac_handle = phddctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3696 | bool band_24 = false, band_5g = false; |
| 3697 | bool ch_bond24 = false, ch_bond5g = false; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3698 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3699 | uint32_t chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3700 | uint8_t vhtchanwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3701 | eCsrPhyMode phymode = -EIO, old_phymode; |
Srinivas Girigowda | 2fb677c | 2017-03-25 15:35:34 -0700 | [diff] [blame] | 3702 | enum hdd_dot11_mode hdd_dot11mode = phddctx->config->dot11Mode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3703 | enum band_info curr_band = BAND_ALL; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3704 | int retval = 0; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3705 | uint8_t band_capability; |
| 3706 | QDF_STATUS status; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3707 | uint32_t channel_bonding_mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3708 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3709 | if (!mac_handle) |
| 3710 | return -EINVAL; |
| 3711 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3712 | old_phymode = sme_get_phy_mode(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3713 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3714 | ucfg_mlme_get_channel_bonding_24ghz(phddctx->psoc, |
| 3715 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3716 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3717 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3718 | ch_bond24 = true; |
| 3719 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3720 | ucfg_mlme_get_channel_bonding_5ghz(phddctx->psoc, |
| 3721 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3722 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3723 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3724 | ch_bond5g = true; |
| 3725 | |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3726 | status = wlan_mlme_get_band_capability(phddctx->psoc, &band_capability); |
| 3727 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3728 | hdd_err("Failed to get MLME Band capability"); |
| 3729 | return -EIO; |
| 3730 | } |
| 3731 | |
| 3732 | if (band_capability == BAND_ALL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3733 | band_24 = band_5g = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3734 | else if (band_capability == BAND_2G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3735 | band_24 = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3736 | else if (band_capability == BAND_5G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3737 | band_5g = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3738 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3739 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, &vhtchanwidth); |
| 3740 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 3741 | hdd_err("Failed to get channel_width"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3742 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3743 | hdd_debug("ch_bond24=%d ch_bond5g=%d band_24=%d band_5g=%d VHT_ch_width=%u", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3744 | ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth); |
| 3745 | |
| 3746 | switch (new_phymode) { |
| 3747 | case IEEE80211_MODE_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3748 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3749 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3750 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3751 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3752 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3753 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3754 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3755 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3756 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3757 | return -EIO; |
| 3758 | } |
| 3759 | break; |
| 3760 | case IEEE80211_MODE_11A: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3761 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11a); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3762 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_5_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3763 | phymode = eCSR_DOT11_MODE_11a; |
| 3764 | hdd_dot11mode = eHDD_DOT11_MODE_11a; |
| 3765 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3766 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3767 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3768 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3769 | return -EIO; |
| 3770 | } |
| 3771 | break; |
| 3772 | case IEEE80211_MODE_11B: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3773 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11b); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3774 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3775 | phymode = eCSR_DOT11_MODE_11b; |
| 3776 | hdd_dot11mode = eHDD_DOT11_MODE_11b; |
| 3777 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3778 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3779 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3780 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3781 | return -EIO; |
| 3782 | } |
| 3783 | break; |
| 3784 | case IEEE80211_MODE_11G: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3785 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11g); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3786 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3787 | phymode = eCSR_DOT11_MODE_11g; |
| 3788 | hdd_dot11mode = eHDD_DOT11_MODE_11g; |
| 3789 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3790 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3791 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3792 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3793 | return -EIO; |
| 3794 | } |
| 3795 | break; |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 3796 | /* UMAC doesn't have option to set MODE_11NA/MODE_11NG as phymode |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3797 | * so setting phymode as eCSR_DOT11_MODE_11n and updating the band |
| 3798 | * and channel bonding in configuration to reflect MODE_11NA/MODE_11NG |
| 3799 | */ |
| 3800 | case IEEE80211_MODE_11NA_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3801 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3802 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_5_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3803 | phymode = eCSR_DOT11_MODE_11n; |
| 3804 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3805 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3806 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3807 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3808 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3809 | return -EIO; |
| 3810 | } |
| 3811 | break; |
| 3812 | case IEEE80211_MODE_11NA_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3813 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3814 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_5_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3815 | phymode = eCSR_DOT11_MODE_11n; |
| 3816 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3817 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3818 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3819 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3820 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3821 | return -EIO; |
| 3822 | } |
| 3823 | break; |
| 3824 | case IEEE80211_MODE_11NG_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3825 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3826 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3827 | phymode = eCSR_DOT11_MODE_11n; |
| 3828 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3829 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3830 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3831 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3832 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3833 | return -EIO; |
| 3834 | } |
| 3835 | break; |
| 3836 | case IEEE80211_MODE_11NG_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3837 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3838 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3839 | phymode = eCSR_DOT11_MODE_11n; |
| 3840 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3841 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3842 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3843 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3844 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3845 | return -EIO; |
| 3846 | } |
| 3847 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3848 | case IEEE80211_MODE_11AC_VHT20: |
| 3849 | case IEEE80211_MODE_11AC_VHT40: |
| 3850 | case IEEE80211_MODE_11AC_VHT80: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3851 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11ac); |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3852 | phymode = eCSR_DOT11_MODE_11ac; |
| 3853 | hdd_dot11mode = eHDD_DOT11_MODE_11ac; |
| 3854 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3855 | if (band_5g && band_24) { |
| 3856 | curr_band = BAND_ALL; |
| 3857 | break; |
| 3858 | } else if (band_5g) { |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3859 | curr_band = BAND_5G; |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3860 | break; |
| 3861 | } else if (new_phymode != IEEE80211_MODE_11AC_VHT80) { |
| 3862 | curr_band = BAND_2G; |
| 3863 | break; |
| 3864 | } |
| 3865 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
| 3866 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3867 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3868 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3869 | return -EIO; |
| 3870 | } |
| 3871 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3872 | case IEEE80211_MODE_2G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3873 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3874 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_2_4_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3875 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3876 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3877 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3878 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3879 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3880 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3881 | return -EIO; |
| 3882 | } |
| 3883 | break; |
| 3884 | case IEEE80211_MODE_5G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3885 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3886 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_5_GHZ) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3887 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3888 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3889 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3890 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3891 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3892 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3893 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3894 | return -EIO; |
| 3895 | } |
| 3896 | break; |
| 3897 | case IEEE80211_MODE_11AGN: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3898 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3899 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3900 | phymode = eCSR_DOT11_MODE_11n; |
| 3901 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3902 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3903 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3904 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3905 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3906 | return -EIO; |
| 3907 | } |
| 3908 | break; |
| 3909 | default: |
| 3910 | return -EIO; |
| 3911 | } |
| 3912 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3913 | switch (new_phymode) { |
| 3914 | case IEEE80211_MODE_11AC_VHT20: |
| 3915 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3916 | vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 3917 | break; |
| 3918 | case IEEE80211_MODE_11AC_VHT40: |
| 3919 | vhtchanwidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 3920 | break; |
| 3921 | case IEEE80211_MODE_11AC_VHT80: |
| 3922 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3923 | break; |
| 3924 | default: |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3925 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, |
| 3926 | &vhtchanwidth); |
| 3927 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 3928 | hdd_err("Failed to get channel_width"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3929 | break; |
| 3930 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3931 | |
| 3932 | if (phymode != -EIO) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3933 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 3934 | if (!sme_config) { |
| 3935 | hdd_err("Failed to allocate memory for sme_config"); |
| 3936 | return -ENOMEM; |
| 3937 | } |
| 3938 | qdf_mem_zero(sme_config, sizeof(*sme_config)); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3939 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3940 | sme_config->csrConfig.phyMode = phymode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3941 | #ifdef QCA_HT_2040_COEX |
| 3942 | if (phymode == eCSR_DOT11_MODE_11n && |
| 3943 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3944 | sme_config->csrConfig.obssEnabled = false; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3945 | status = sme_set_ht2040_mode(mac_handle, |
| 3946 | adapter->session_id, |
| 3947 | eHT_CHAN_HT20, false); |
| 3948 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3949 | hdd_err("Failed to disable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3950 | retval = -EIO; |
| 3951 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3952 | } |
| 3953 | } else if (phymode == eCSR_DOT11_MODE_11n && |
| 3954 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3955 | sme_config->csrConfig.obssEnabled = true; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3956 | status = sme_set_ht2040_mode(mac_handle, |
| 3957 | adapter->session_id, |
| 3958 | eHT_CHAN_HT20, true); |
| 3959 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3960 | hdd_err("Failed to enable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3961 | retval = -EIO; |
| 3962 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3963 | } |
| 3964 | } |
| 3965 | #endif |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3966 | status = ucfg_mlme_set_band_capability(phddctx->psoc, |
| 3967 | curr_band); |
| 3968 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3969 | hdd_err("failed to set MLME band capability"); |
| 3970 | goto free; |
| 3971 | } |
| 3972 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 3973 | if (curr_band == BAND_2G) { |
| 3974 | status = ucfg_mlme_set_11h_enabled(phddctx->psoc, 0); |
| 3975 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 3976 | hdd_err("Failed to set 11h_enable flag"); |
| 3977 | goto free; |
| 3978 | } |
| 3979 | } |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3980 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3981 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
Jeff Johnson | 3d72577 | 2018-04-28 17:20:56 -0700 | [diff] [blame] | 3982 | else if (curr_band == BAND_5G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3983 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3984 | else { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3985 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
| 3986 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3987 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3988 | sme_update_config(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3989 | |
| 3990 | phddctx->config->dot11Mode = hdd_dot11mode; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3991 | ucfg_mlme_set_channel_bonding_24ghz( |
| 3992 | phddctx->psoc, |
| 3993 | sme_config->csrConfig.channelBondingMode24GHz); |
| 3994 | ucfg_mlme_set_channel_bonding_5ghz( |
| 3995 | phddctx->psoc, |
| 3996 | sme_config->csrConfig.channelBondingMode5GHz); |
Krunal Soni | df0f874 | 2016-09-26 14:56:31 -0700 | [diff] [blame] | 3997 | if (hdd_update_config_cfg(phddctx) == false) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3998 | hdd_err("could not update config_dat"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3999 | retval = -EIO; |
| 4000 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4001 | } |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4002 | |
| 4003 | if (band_5g) { |
| 4004 | struct ieee80211_supported_band *band; |
| 4005 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4006 | ucfg_mlme_get_channel_bonding_5ghz( |
| 4007 | phddctx->psoc, &channel_bonding_mode); |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4008 | band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4009 | if (channel_bonding_mode) |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4010 | band->ht_cap.cap |= |
| 4011 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4012 | else |
| 4013 | band->ht_cap.cap &= |
| 4014 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4015 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4016 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4017 | hdd_debug("New_Phymode= %d ch_bonding=%d band=%d VHT_ch_width=%u", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4018 | phymode, chwidth, curr_band, vhtchanwidth); |
| 4019 | } |
| 4020 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4021 | free: |
| 4022 | if (sme_config) |
| 4023 | qdf_mem_free(sme_config); |
| 4024 | return retval; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4025 | } |
| 4026 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4027 | static int hdd_validate_pdev_reset(int value) |
| 4028 | { |
| 4029 | if ((value < 1) || (value > 5)) { |
| 4030 | hdd_warn(" Invalid value %d: Use any one of the below values\n" |
| 4031 | " TX_FLUSH = 1\n" |
| 4032 | " WARM_RESET = 2\n" |
| 4033 | " COLD_RESET = 3\n" |
| 4034 | " WARM_RESET_RESTORE_CAL = 4\n" |
| 4035 | " COLD_RESET_RESTORE_CAL = 5", value); |
| 4036 | |
| 4037 | return -EINVAL; |
| 4038 | } |
| 4039 | |
| 4040 | return 0; |
| 4041 | } |
| 4042 | |
| 4043 | static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value) |
| 4044 | { |
| 4045 | int ret; |
| 4046 | |
| 4047 | hdd_debug("%d", value); |
| 4048 | |
| 4049 | ret = hdd_validate_pdev_reset(value); |
| 4050 | if (ret) |
| 4051 | return ret; |
| 4052 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4053 | ret = wma_cli_set_command(adapter->session_id, |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4054 | WMI_PDEV_PARAM_PDEV_RESET, |
| 4055 | value, PDEV_CMD); |
| 4056 | |
| 4057 | return ret; |
| 4058 | } |
| 4059 | |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4060 | static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width) |
| 4061 | { |
| 4062 | int errno; |
| 4063 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4064 | ePhyChanBondState bonding_state; |
| 4065 | uint32_t bonding_mode; |
| 4066 | tSmeConfigParams *sme_config; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4067 | mac_handle_t mac_handle; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4068 | uint32_t channel_bonding_mode; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4069 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4070 | mac_handle = hdd_ctx->mac_handle; |
| 4071 | if (!mac_handle) |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4072 | return -EINVAL; |
| 4073 | |
| 4074 | /* updating channel bonding only on 5Ghz */ |
| 4075 | hdd_debug("WMI_VDEV_PARAM_CHWIDTH val %d", ch_width); |
| 4076 | |
| 4077 | switch (ch_width) { |
| 4078 | case eHT_CHANNEL_WIDTH_20MHZ: |
| 4079 | bonding_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4080 | break; |
| 4081 | |
| 4082 | case eHT_CHANNEL_WIDTH_40MHZ: |
| 4083 | case eHT_CHANNEL_WIDTH_80MHZ: |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4084 | ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc, |
| 4085 | &channel_bonding_mode); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4086 | bonding_state = csr_convert_cb_ini_value_to_phy_cb_state( |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4087 | channel_bonding_mode); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4088 | |
| 4089 | if (bonding_state == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) |
| 4090 | return -EINVAL; |
| 4091 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4092 | bonding_mode = channel_bonding_mode; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4093 | break; |
| 4094 | |
| 4095 | default: |
| 4096 | hdd_err("Invalid channel width 0->20 1->40 2->80"); |
| 4097 | return -EINVAL; |
| 4098 | } |
| 4099 | |
| 4100 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4101 | if (!sme_config) { |
| 4102 | hdd_err("failed to allocate memory for sme_config"); |
| 4103 | return -ENOMEM; |
| 4104 | } |
| 4105 | |
| 4106 | errno = wma_cli_set_command(adapter->session_id, WMI_VDEV_PARAM_CHWIDTH, |
| 4107 | ch_width, VDEV_CMD); |
| 4108 | if (errno) |
| 4109 | goto free_config; |
| 4110 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4111 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4112 | sme_config->csrConfig.channelBondingMode5GHz = bonding_mode; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4113 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4114 | |
| 4115 | free_config: |
| 4116 | qdf_mem_free(sme_config); |
| 4117 | |
| 4118 | return errno; |
| 4119 | } |
| 4120 | |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4121 | static int hdd_we_set_11d_state(struct hdd_adapter *adapter, int state_11d) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4122 | { |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4123 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4124 | bool enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4125 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4126 | QDF_STATUS status; |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4127 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4128 | if (!mac_handle) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4129 | return -EINVAL; |
| 4130 | |
| 4131 | switch (state_11d) { |
| 4132 | case ENABLE_11D: |
| 4133 | enable_11d = true; |
| 4134 | break; |
| 4135 | case DISABLE_11D: |
| 4136 | enable_11d = false; |
| 4137 | break; |
| 4138 | default: |
| 4139 | return -EINVAL; |
| 4140 | } |
| 4141 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4142 | status = ucfg_mlme_set_11d_enabled(hdd_ctx->psoc, enable_11d); |
| 4143 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 4144 | hdd_err("Invalid 11d_enable flag"); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4145 | |
Dustin Brown | ea82d56 | 2018-05-23 12:07:16 -0700 | [diff] [blame] | 4146 | hdd_debug("11D state=%d", enable_11d); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4147 | |
| 4148 | return 0; |
| 4149 | } |
| 4150 | |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4151 | static int hdd_we_set_power(struct hdd_adapter *adapter, int value) |
| 4152 | { |
| 4153 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4154 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4155 | |
| 4156 | if (!mac_handle) |
| 4157 | return -EINVAL; |
| 4158 | |
| 4159 | switch (value) { |
| 4160 | case 1: |
| 4161 | /* Enable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4162 | sme_save_usr_ps_cfg(mac_handle, true); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4163 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4164 | SME_PS_ENABLE); |
| 4165 | return 0; |
| 4166 | case 2: |
| 4167 | /* Disable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4168 | sme_save_usr_ps_cfg(mac_handle, false); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4169 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4170 | SME_PS_DISABLE); |
| 4171 | return 0; |
| 4172 | case 3: |
| 4173 | /* Enable UASPD */ |
| 4174 | sme_ps_uapsd_enable(mac_handle, adapter->session_id); |
| 4175 | return 0; |
| 4176 | case 4: |
| 4177 | /* Disable UASPD */ |
| 4178 | sme_ps_uapsd_disable(mac_handle, adapter->session_id); |
| 4179 | return 0; |
| 4180 | default: |
| 4181 | hdd_err("Invalid value %d", value); |
| 4182 | return -EINVAL; |
| 4183 | } |
| 4184 | } |
| 4185 | |
Jeff Johnson | eb4368a | 2018-10-19 13:02:52 -0700 | [diff] [blame] | 4186 | static int hdd_we_set_max_assoc(struct hdd_adapter *adapter, int value) |
| 4187 | { |
| 4188 | struct hdd_context *hdd_ctx; |
| 4189 | QDF_STATUS status; |
| 4190 | |
| 4191 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4192 | status = ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, value); |
| 4193 | if (QDF_IS_STATUS_ERROR(status)) |
| 4194 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4195 | |
| 4196 | return qdf_status_to_os_return(status); |
| 4197 | } |
| 4198 | |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4199 | static int hdd_we_set_data_inactivity_timeout(struct hdd_adapter *adapter, |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4200 | int inactivity_timeout) |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4201 | { |
| 4202 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4203 | QDF_STATUS status; |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4204 | |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4205 | status = ucfg_mlme_set_ps_data_inactivity_timeout(hdd_ctx->psoc, |
| 4206 | inactivity_timeout); |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4207 | |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4208 | return qdf_status_to_os_return(status); |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4209 | } |
| 4210 | |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4211 | static int hdd_we_set_wow_data_inactivity_timeout(struct hdd_adapter *adapter, |
| 4212 | int value) |
| 4213 | { |
| 4214 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4215 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4216 | |
| 4217 | if (!mac_handle) |
| 4218 | return -EINVAL; |
| 4219 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4220 | if (!cfg_in_range(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT, value)) { |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4221 | hdd_err_rl("Invalid value %d", value); |
| 4222 | return -EINVAL; |
| 4223 | } |
| 4224 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4225 | ucfg_pmo_set_wow_data_inactivity_timeout(hdd_ctx->psoc, (uint8_t)value); |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4226 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4227 | return 0; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4228 | } |
| 4229 | |
Jeff Johnson | 5d4a6d1 | 2018-10-19 13:23:28 -0700 | [diff] [blame] | 4230 | static int hdd_we_set_tx_power(struct hdd_adapter *adapter, int value) |
| 4231 | { |
| 4232 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4233 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4234 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4235 | QDF_STATUS status; |
| 4236 | |
| 4237 | if (!mac_handle) |
| 4238 | return -EINVAL; |
| 4239 | |
| 4240 | status = sme_set_tx_power(mac_handle, adapter->session_id, |
| 4241 | sta_ctx->conn_info.bssId, |
| 4242 | adapter->device_mode, value); |
| 4243 | |
| 4244 | if (QDF_IS_STATUS_ERROR(status)) |
| 4245 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4246 | |
| 4247 | return qdf_status_to_os_return(status); |
| 4248 | } |
| 4249 | |
Jeff Johnson | 5e15ef5 | 2018-10-19 15:29:56 -0700 | [diff] [blame] | 4250 | static int hdd_we_set_max_tx_power(struct hdd_adapter *adapter, int value) |
| 4251 | { |
| 4252 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4253 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4254 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4255 | QDF_STATUS status; |
| 4256 | |
| 4257 | if (!mac_handle) |
| 4258 | return -EINVAL; |
| 4259 | |
| 4260 | status = sme_set_max_tx_power(mac_handle, |
| 4261 | sta_ctx->conn_info.bssId, |
| 4262 | sta_ctx->conn_info.bssId, |
| 4263 | value); |
| 4264 | |
| 4265 | if (QDF_IS_STATUS_ERROR(status)) |
| 4266 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4267 | |
| 4268 | return qdf_status_to_os_return(status); |
| 4269 | } |
| 4270 | |
Jeff Johnson | f3892b5 | 2018-10-23 11:32:04 -0700 | [diff] [blame] | 4271 | static int hdd_we_set_max_tx_power_2_4(struct hdd_adapter *adapter, int power) |
| 4272 | { |
| 4273 | QDF_STATUS status; |
| 4274 | |
| 4275 | hdd_debug("power %d dBm", power); |
| 4276 | status = sme_set_max_tx_power_per_band(BAND_2G, power); |
| 4277 | if (QDF_IS_STATUS_ERROR(status)) |
| 4278 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4279 | |
| 4280 | return qdf_status_to_os_return(status); |
| 4281 | } |
| 4282 | |
Jeff Johnson | 175004c | 2018-10-23 12:03:16 -0700 | [diff] [blame] | 4283 | static int hdd_we_set_max_tx_power_5_0(struct hdd_adapter *adapter, int power) |
| 4284 | { |
| 4285 | QDF_STATUS status; |
| 4286 | |
| 4287 | hdd_debug("power %d dBm", power); |
| 4288 | status = sme_set_max_tx_power_per_band(BAND_5G, power); |
| 4289 | if (QDF_IS_STATUS_ERROR(status)) |
| 4290 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4291 | |
| 4292 | return qdf_status_to_os_return(status); |
| 4293 | } |
| 4294 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 4295 | #ifdef HASTINGS_BT_WAR |
| 4296 | |
| 4297 | /* |
| 4298 | * replicate logic: |
| 4299 | * iwpriv wlan0 setUnitTestCmd 19 2 23 1 => enable WAR |
| 4300 | * iwpriv wlan0 setUnitTestCmd 19 2 23 0 => disable WAR |
| 4301 | */ |
| 4302 | |
| 4303 | #define HASTINGS_WAR_FW_PARAM_ID 23 |
| 4304 | |
| 4305 | static int hdd_hastings_bt_war_set_fw(struct hdd_context *hdd_ctx, |
| 4306 | uint32_t value) |
| 4307 | { |
| 4308 | uint32_t vdev_id = 0; /* not used */ |
| 4309 | uint32_t module_id = WLAN_MODULE_WAL; |
| 4310 | uint32_t arg_count = 2; |
| 4311 | uint32_t arg[2] = {HASTINGS_WAR_FW_PARAM_ID, value}; |
| 4312 | QDF_STATUS status; |
| 4313 | |
| 4314 | status = wma_form_unit_test_cmd_and_send(vdev_id, module_id, |
| 4315 | arg_count, arg); |
| 4316 | |
| 4317 | return qdf_status_to_os_return(status); |
| 4318 | } |
| 4319 | |
| 4320 | int hdd_hastings_bt_war_enable_fw(struct hdd_context *hdd_ctx) |
| 4321 | { |
| 4322 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 1); |
| 4323 | } |
| 4324 | |
| 4325 | int hdd_hastings_bt_war_disable_fw(struct hdd_context *hdd_ctx) |
| 4326 | { |
| 4327 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 0); |
| 4328 | } |
| 4329 | |
| 4330 | /* value to restore the config when the WAR is disabled */ |
| 4331 | static uint32_t iface_change_wait_time_checkpoint; |
| 4332 | static void checkpoint_iface_change_wait_time(struct hdd_context *hdd_ctx) |
| 4333 | { |
| 4334 | struct hdd_config *config = hdd_ctx->config; |
| 4335 | |
| 4336 | /* did we already checkpoint a value ? */ |
| 4337 | if (iface_change_wait_time_checkpoint) |
| 4338 | return; |
| 4339 | |
| 4340 | /* checkpoint current value */ |
| 4341 | iface_change_wait_time_checkpoint = config->iface_change_wait_time; |
| 4342 | |
| 4343 | /* was the timer enabled when we checkpointed? */ |
| 4344 | if (iface_change_wait_time_checkpoint) |
| 4345 | return; |
| 4346 | |
| 4347 | /* WAR was enabled at boot, use default when disable */ |
| 4348 | iface_change_wait_time_checkpoint = |
| 4349 | cfg_default(CFG_INTERFACE_CHANGE_WAIT); |
| 4350 | } |
| 4351 | |
| 4352 | static int hdd_hastings_war_enable(struct hdd_context *hdd_ctx) |
| 4353 | { |
| 4354 | struct hdd_config *config = hdd_ctx->config; |
| 4355 | |
| 4356 | config->iface_change_wait_time = 0; |
| 4357 | |
| 4358 | return hdd_hastings_bt_war_enable_fw(hdd_ctx); |
| 4359 | } |
| 4360 | |
| 4361 | static int hdd_hastings_war_disable(struct hdd_context *hdd_ctx) |
| 4362 | { |
| 4363 | struct hdd_config *config = hdd_ctx->config; |
| 4364 | |
| 4365 | config->iface_change_wait_time = iface_change_wait_time_checkpoint; |
| 4366 | |
| 4367 | return hdd_hastings_bt_war_disable_fw(hdd_ctx); |
| 4368 | } |
| 4369 | |
| 4370 | static int hdd_we_set_hastings_bt_war(struct hdd_adapter *adapter, int enable) |
| 4371 | { |
| 4372 | int errno; |
| 4373 | struct hdd_context *hdd_ctx; |
| 4374 | |
| 4375 | errno = hdd_validate_adapter(adapter); |
| 4376 | if (errno) |
| 4377 | return errno; |
| 4378 | |
| 4379 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4380 | checkpoint_iface_change_wait_time(hdd_ctx); |
| 4381 | |
| 4382 | return enable ? |
| 4383 | hdd_hastings_war_enable(hdd_ctx) : |
| 4384 | hdd_hastings_war_disable(hdd_ctx); |
| 4385 | } |
| 4386 | #endif |
| 4387 | |
Jeff Johnson | 5bee39b | 2018-10-23 12:34:38 -0700 | [diff] [blame] | 4388 | static int hdd_we_set_tm_level(struct hdd_adapter *adapter, int level) |
| 4389 | { |
| 4390 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4391 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4392 | QDF_STATUS status; |
| 4393 | |
| 4394 | if (!mac_handle) |
| 4395 | return -EINVAL; |
| 4396 | |
| 4397 | hdd_debug("Thermal Mitigation Level %d", level); |
| 4398 | status = sme_set_thermal_level(mac_handle, level); |
| 4399 | if (QDF_IS_STATUS_ERROR(status)) |
| 4400 | hdd_err("cfg set failed, value %d status %d", level, status); |
| 4401 | |
| 4402 | return qdf_status_to_os_return(status); |
| 4403 | } |
| 4404 | |
Jeff Johnson | 3891264 | 2018-10-24 15:01:40 -0700 | [diff] [blame] | 4405 | static int hdd_we_set_nss(struct hdd_adapter *adapter, int nss) |
| 4406 | { |
| 4407 | QDF_STATUS status; |
| 4408 | |
| 4409 | hdd_debug("NSS %d", nss); |
| 4410 | |
| 4411 | if ((nss > 2) || (nss <= 0)) { |
| 4412 | hdd_err("Invalid NSS: %d", nss); |
| 4413 | return -EINVAL; |
| 4414 | } |
| 4415 | |
| 4416 | status = hdd_update_nss(adapter, nss); |
| 4417 | if (QDF_IS_STATUS_ERROR(status)) |
| 4418 | hdd_err("cfg set failed, value %d status %d", nss, status); |
| 4419 | |
| 4420 | return qdf_status_to_os_return(status); |
| 4421 | } |
| 4422 | |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4423 | static int hdd_we_set_short_gi(struct hdd_adapter *adapter, int sgi) |
| 4424 | { |
| 4425 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
| 4426 | int errno; |
| 4427 | |
| 4428 | hdd_debug("Short GI %d", sgi); |
| 4429 | |
| 4430 | if (!mac_handle) { |
| 4431 | hdd_err("NULL Mac handle"); |
| 4432 | return -EINVAL; |
| 4433 | } |
| 4434 | |
| 4435 | if (sgi & HDD_AUTO_RATE_SGI) |
| 4436 | errno = sme_set_auto_rate_he_sgi(mac_handle, |
| 4437 | adapter->session_id, |
| 4438 | sgi); |
| 4439 | else |
| 4440 | errno = sme_update_ht_config(mac_handle, |
| 4441 | adapter->session_id, |
| 4442 | WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, |
| 4443 | sgi); |
| 4444 | if (errno) |
| 4445 | hdd_err("cfg set failed, value %d status %d", sgi, errno); |
| 4446 | |
| 4447 | return errno; |
| 4448 | } |
| 4449 | |
Jeff Johnson | 71d8038 | 2018-10-25 15:45:01 -0700 | [diff] [blame] | 4450 | static int hdd_we_set_rtscts(struct hdd_adapter *adapter, int rtscts) |
| 4451 | { |
| 4452 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4453 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4454 | uint32_t value; |
| 4455 | uint32_t rts_threshold_val; |
| 4456 | QDF_STATUS status; |
| 4457 | int errno; |
| 4458 | |
| 4459 | hdd_debug("RTSCTS %d", rtscts); |
| 4460 | |
| 4461 | if (!mac_handle) { |
| 4462 | hdd_err("NULL Mac handle"); |
| 4463 | return -EINVAL; |
| 4464 | } |
| 4465 | |
| 4466 | status = ucfg_mlme_get_rts_threshold(hdd_ctx->psoc, |
| 4467 | &rts_threshold_val); |
| 4468 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4469 | hdd_err("Get rts threshold failed, status %d", status); |
| 4470 | return -EINVAL; |
| 4471 | } |
| 4472 | |
| 4473 | if ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_RTSCTS_ENABLE) { |
| 4474 | value = rts_threshold_val; |
| 4475 | } else if (((rtscts & HDD_RTSCTS_EN_MASK) == 0) || |
| 4476 | ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_CTS_ENABLE)) { |
| 4477 | value = cfg_max(CFG_RTS_THRESHOLD); |
| 4478 | } else { |
| 4479 | hdd_err_rl("Invalid value %d", rtscts); |
| 4480 | return -EINVAL; |
| 4481 | } |
| 4482 | |
| 4483 | errno = wma_cli_set_command(adapter->session_id, |
| 4484 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 4485 | rtscts, VDEV_CMD); |
| 4486 | if (errno) { |
| 4487 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4488 | return errno; |
| 4489 | } |
| 4490 | |
| 4491 | status = ucfg_mlme_set_rts_threshold(hdd_ctx->psoc, value); |
| 4492 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4493 | hdd_err("Set rts threshold failed, status %d", status); |
| 4494 | return -EINVAL; |
| 4495 | } |
| 4496 | |
| 4497 | return 0; |
| 4498 | } |
| 4499 | |
Jeff Johnson | 50b1588 | 2018-10-26 10:27:37 -0700 | [diff] [blame] | 4500 | static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code) |
| 4501 | { |
| 4502 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4503 | int errno; |
| 4504 | |
| 4505 | hdd_debug("Rate code %d", rate_code); |
| 4506 | |
| 4507 | if (rate_code != 0xff) { |
| 4508 | rix = RC_2_RATE_IDX(rate_code); |
| 4509 | if (rate_code & 0x80) { |
| 4510 | preamble = WMI_RATE_PREAMBLE_HT; |
| 4511 | nss = HT_RC_2_STREAMS(rate_code) - 1; |
| 4512 | } else { |
| 4513 | nss = 0; |
| 4514 | rix = RC_2_RATE_IDX(rate_code); |
| 4515 | if (rate_code & 0x10) { |
| 4516 | preamble = WMI_RATE_PREAMBLE_CCK; |
| 4517 | if (rix != 0x3) |
| 4518 | /* Enable Short preamble |
| 4519 | * always for CCK except 1mbps |
| 4520 | */ |
| 4521 | rix |= 0x4; |
| 4522 | } else { |
| 4523 | preamble = WMI_RATE_PREAMBLE_OFDM; |
| 4524 | } |
| 4525 | } |
| 4526 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4527 | } |
| 4528 | |
| 4529 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4530 | rate_code, rix, preamble, nss); |
| 4531 | |
| 4532 | errno = wma_cli_set_command(adapter->session_id, |
| 4533 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4534 | rate_code, VDEV_CMD); |
| 4535 | if (errno) |
| 4536 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4537 | |
| 4538 | return errno; |
| 4539 | } |
| 4540 | |
Jeff Johnson | bd2c991 | 2018-10-26 12:34:36 -0700 | [diff] [blame] | 4541 | static int hdd_we_set_vht_rate(struct hdd_adapter *adapter, int rate_code) |
| 4542 | { |
| 4543 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4544 | int errno; |
| 4545 | |
| 4546 | hdd_debug("Rate code %d", rate_code); |
| 4547 | |
| 4548 | if (rate_code != 0xff) { |
| 4549 | rix = RC_2_RATE_IDX_11AC(rate_code); |
| 4550 | preamble = WMI_RATE_PREAMBLE_VHT; |
| 4551 | nss = HT_RC_2_STREAMS_11AC(rate_code) - 1; |
| 4552 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4553 | } |
| 4554 | |
| 4555 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4556 | rate_code, rix, preamble, nss); |
| 4557 | |
| 4558 | errno = wma_cli_set_command(adapter->session_id, |
| 4559 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4560 | rate_code, VDEV_CMD); |
| 4561 | if (errno) |
| 4562 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4563 | |
| 4564 | return errno; |
| 4565 | } |
| 4566 | |
Jeff Johnson | 7c43350 | 2018-11-12 15:00:52 -0800 | [diff] [blame] | 4567 | static int hdd_we_set_ampdu(struct hdd_adapter *adapter, int ampdu) |
| 4568 | { |
| 4569 | hdd_debug("AMPDU %d", ampdu); |
| 4570 | |
| 4571 | return wma_cli_set_command(adapter->session_id, |
| 4572 | GEN_VDEV_PARAM_AMPDU, |
| 4573 | ampdu, GEN_CMD); |
| 4574 | } |
| 4575 | |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4576 | static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) |
| 4577 | { |
| 4578 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4579 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4580 | int errno; |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4581 | QDF_STATUS status; |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4582 | |
| 4583 | hdd_debug("AMSDU %d", amsdu); |
| 4584 | |
| 4585 | if (!mac_handle) { |
| 4586 | hdd_err("NULL Mac handle"); |
| 4587 | return -EINVAL; |
| 4588 | } |
| 4589 | |
| 4590 | if (amsdu > 1) |
| 4591 | sme_set_amsdu(mac_handle, true); |
| 4592 | else |
| 4593 | sme_set_amsdu(mac_handle, false); |
| 4594 | |
| 4595 | errno = wma_cli_set_command(adapter->session_id, |
| 4596 | GEN_VDEV_PARAM_AMSDU, |
| 4597 | amsdu, GEN_CMD); |
| 4598 | if (errno) { |
| 4599 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4600 | return errno; |
| 4601 | } |
| 4602 | |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4603 | status = ucfg_mlme_set_max_amsdu_num(hdd_ctx->psoc, |
| 4604 | amsdu); |
| 4605 | if (QDF_IS_STATUS_ERROR(status)) |
| 4606 | hdd_err("Failed to set Max AMSDU Num to cfg"); |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4607 | |
| 4608 | return 0; |
| 4609 | } |
| 4610 | |
Jeff Johnson | cb598fd | 2018-10-29 10:09:07 -0700 | [diff] [blame] | 4611 | static int hdd_we_clear_stats(struct hdd_adapter *adapter, int option) |
| 4612 | { |
| 4613 | hdd_debug("option %d", option); |
| 4614 | |
| 4615 | switch (option) { |
| 4616 | case CDP_HDD_STATS: |
| 4617 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
| 4618 | memset(&adapter->hdd_stats, 0, sizeof(adapter->hdd_stats)); |
| 4619 | break; |
| 4620 | case CDP_TXRX_HIST_STATS: |
| 4621 | wlan_hdd_clear_tx_rx_histogram(adapter->hdd_ctx); |
| 4622 | break; |
| 4623 | case CDP_HDD_NETIF_OPER_HISTORY: |
| 4624 | wlan_hdd_clear_netif_queue_history(adapter->hdd_ctx); |
| 4625 | break; |
| 4626 | case CDP_HIF_STATS: |
| 4627 | hdd_clear_hif_stats(); |
| 4628 | break; |
| 4629 | case CDP_NAPI_STATS: |
| 4630 | hdd_clear_napi_stats(); |
| 4631 | break; |
| 4632 | default: |
| 4633 | cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 4634 | option); |
| 4635 | } |
| 4636 | |
| 4637 | return 0; |
| 4638 | } |
| 4639 | |
Jeff Johnson | 1a05fda | 2018-11-01 07:53:00 -0700 | [diff] [blame] | 4640 | static int hdd_we_set_green_tx_param(struct hdd_adapter *adapter, |
| 4641 | green_tx_param id, |
| 4642 | const char *id_string, |
| 4643 | int value) |
| 4644 | { |
| 4645 | int errno; |
| 4646 | |
| 4647 | hdd_debug("%s %d", id_string, value); |
| 4648 | errno = wma_cli_set_command(adapter->session_id, id, value, GTX_CMD); |
| 4649 | if (errno) |
| 4650 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4651 | |
| 4652 | return errno; |
| 4653 | } |
| 4654 | |
| 4655 | #define hdd_we_set_green_tx_param(adapter, id, value) \ |
| 4656 | hdd_we_set_green_tx_param(adapter, id, #id, value) |
| 4657 | |
| 4658 | static int hdd_we_set_gtx_ht_mcs(struct hdd_adapter *adapter, int value) |
| 4659 | { |
| 4660 | return hdd_we_set_green_tx_param(adapter, |
| 4661 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 4662 | value); |
| 4663 | } |
| 4664 | |
| 4665 | static int hdd_we_set_gtx_vht_mcs(struct hdd_adapter *adapter, int value) |
| 4666 | { |
| 4667 | return hdd_we_set_green_tx_param(adapter, |
| 4668 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 4669 | value); |
| 4670 | } |
| 4671 | |
| 4672 | static int hdd_we_set_gtx_usrcfg(struct hdd_adapter *adapter, int value) |
| 4673 | { |
| 4674 | return hdd_we_set_green_tx_param(adapter, |
| 4675 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 4676 | value); |
| 4677 | } |
| 4678 | |
| 4679 | static int hdd_we_set_gtx_thre(struct hdd_adapter *adapter, int value) |
| 4680 | { |
| 4681 | return hdd_we_set_green_tx_param(adapter, |
| 4682 | WMI_VDEV_PARAM_GTX_THRE, |
| 4683 | value); |
| 4684 | } |
| 4685 | |
| 4686 | static int hdd_we_set_gtx_margin(struct hdd_adapter *adapter, int value) |
| 4687 | { |
| 4688 | return hdd_we_set_green_tx_param(adapter, |
| 4689 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 4690 | value); |
| 4691 | } |
| 4692 | |
| 4693 | static int hdd_we_set_gtx_step(struct hdd_adapter *adapter, int value) |
| 4694 | { |
| 4695 | return hdd_we_set_green_tx_param(adapter, |
| 4696 | WMI_VDEV_PARAM_GTX_STEP, |
| 4697 | value); |
| 4698 | } |
| 4699 | |
| 4700 | static int hdd_we_set_gtx_mintpc(struct hdd_adapter *adapter, int value) |
| 4701 | { |
| 4702 | return hdd_we_set_green_tx_param(adapter, |
| 4703 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 4704 | value); |
| 4705 | } |
| 4706 | |
| 4707 | static int hdd_we_set_gtx_bwmask(struct hdd_adapter *adapter, int value) |
| 4708 | { |
| 4709 | return hdd_we_set_green_tx_param(adapter, |
| 4710 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 4711 | value); |
| 4712 | } |
| 4713 | |
Jeff Johnson | d0477f2 | 2018-10-29 12:26:25 -0700 | [diff] [blame] | 4714 | static int hdd_we_packet_power_save(struct hdd_adapter *adapter, |
| 4715 | packet_power_save id, |
| 4716 | const char *id_string, |
| 4717 | int value) |
| 4718 | { |
| 4719 | int errno; |
| 4720 | |
| 4721 | if (adapter->device_mode != QDF_STA_MODE) { |
| 4722 | hdd_err_rl("Not supported in mode %d", adapter->device_mode); |
| 4723 | return -EINVAL; |
| 4724 | } |
| 4725 | |
| 4726 | hdd_debug("%s %d", id_string, value); |
| 4727 | errno = wma_cli_set_command(adapter->session_id, id, value, PPS_CMD); |
| 4728 | if (errno) |
| 4729 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4730 | |
| 4731 | return errno; |
| 4732 | } |
| 4733 | |
| 4734 | #define hdd_we_packet_power_save(adapter, id, value) \ |
| 4735 | hdd_we_packet_power_save(adapter, id, #id, value) |
| 4736 | |
| 4737 | static int hdd_we_pps_paid_match(struct hdd_adapter *adapter, int value) |
| 4738 | { |
| 4739 | return hdd_we_packet_power_save(adapter, |
| 4740 | WMI_VDEV_PPS_PAID_MATCH, |
| 4741 | value); |
| 4742 | } |
| 4743 | |
| 4744 | static int hdd_we_pps_gid_match(struct hdd_adapter *adapter, int value) |
| 4745 | { |
| 4746 | return hdd_we_packet_power_save(adapter, |
| 4747 | WMI_VDEV_PPS_GID_MATCH, |
| 4748 | value); |
| 4749 | } |
| 4750 | |
| 4751 | static int hdd_we_pps_early_tim_clear(struct hdd_adapter *adapter, int value) |
| 4752 | { |
| 4753 | return hdd_we_packet_power_save(adapter, |
| 4754 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 4755 | value); |
| 4756 | } |
| 4757 | |
| 4758 | static int hdd_we_pps_early_dtim_clear(struct hdd_adapter *adapter, int value) |
| 4759 | { |
| 4760 | return hdd_we_packet_power_save(adapter, |
| 4761 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 4762 | value); |
| 4763 | } |
| 4764 | |
| 4765 | static int hdd_we_pps_eof_pad_delim(struct hdd_adapter *adapter, int value) |
| 4766 | { |
| 4767 | return hdd_we_packet_power_save(adapter, |
| 4768 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 4769 | value); |
| 4770 | } |
| 4771 | |
| 4772 | static int hdd_we_pps_macaddr_mismatch(struct hdd_adapter *adapter, int value) |
| 4773 | { |
| 4774 | return hdd_we_packet_power_save(adapter, |
| 4775 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 4776 | value); |
| 4777 | } |
| 4778 | |
| 4779 | static int hdd_we_pps_delim_crc_fail(struct hdd_adapter *adapter, int value) |
| 4780 | { |
| 4781 | return hdd_we_packet_power_save(adapter, |
| 4782 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 4783 | value); |
| 4784 | } |
| 4785 | |
| 4786 | static int hdd_we_pps_gid_nsts_zero(struct hdd_adapter *adapter, int value) |
| 4787 | { |
| 4788 | return hdd_we_packet_power_save(adapter, |
| 4789 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 4790 | value); |
| 4791 | } |
| 4792 | |
| 4793 | static int hdd_we_pps_rssi_check(struct hdd_adapter *adapter, int value) |
| 4794 | { |
| 4795 | return hdd_we_packet_power_save(adapter, |
| 4796 | WMI_VDEV_PPS_RSSI_CHECK, |
| 4797 | value); |
| 4798 | } |
| 4799 | |
| 4800 | static int hdd_we_pps_5g_ebt(struct hdd_adapter *adapter, int value) |
| 4801 | { |
| 4802 | return hdd_we_packet_power_save(adapter, |
| 4803 | WMI_VDEV_PPS_5G_EBT, |
| 4804 | value); |
| 4805 | } |
| 4806 | |
Jeff Johnson | cc7776d | 2018-11-02 14:10:38 -0700 | [diff] [blame] | 4807 | static int hdd_we_set_qpower(struct hdd_adapter *adapter, |
| 4808 | enum wmi_sta_powersave_param id, |
| 4809 | const char *id_string, |
| 4810 | int value) |
| 4811 | { |
| 4812 | int errno; |
| 4813 | |
| 4814 | hdd_debug("%s %d", id_string, value); |
| 4815 | errno = wma_cli_set_command(adapter->session_id, id, value, QPOWER_CMD); |
| 4816 | if (errno) |
| 4817 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4818 | |
| 4819 | return errno; |
| 4820 | } |
| 4821 | |
| 4822 | #define hdd_we_set_qpower(adapter, id, value) \ |
| 4823 | hdd_we_set_qpower(adapter, id, #id, value) |
| 4824 | |
| 4825 | static int |
| 4826 | hdd_we_set_qpower_max_pspoll_count(struct hdd_adapter *adapter, int value) |
| 4827 | { |
| 4828 | enum wmi_sta_powersave_param id = |
| 4829 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT; |
| 4830 | |
| 4831 | return hdd_we_set_qpower(adapter, id, value); |
| 4832 | } |
| 4833 | |
| 4834 | static int |
| 4835 | hdd_we_set_qpower_max_tx_before_wake(struct hdd_adapter *adapter, int value) |
| 4836 | { |
| 4837 | enum wmi_sta_powersave_param id = |
| 4838 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE; |
| 4839 | |
| 4840 | return hdd_we_set_qpower(adapter, id, value); |
| 4841 | } |
| 4842 | |
| 4843 | static int |
| 4844 | hdd_we_set_qpower_spec_pspoll_wake_interval(struct hdd_adapter *adapter, |
| 4845 | int value) |
| 4846 | { |
| 4847 | enum wmi_sta_powersave_param id = |
| 4848 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL; |
| 4849 | |
| 4850 | return hdd_we_set_qpower(adapter, id, value); |
| 4851 | } |
| 4852 | |
| 4853 | static int |
| 4854 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll(struct hdd_adapter *adapter, |
| 4855 | int value) |
| 4856 | { |
| 4857 | enum wmi_sta_powersave_param id = |
| 4858 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL; |
| 4859 | |
| 4860 | return hdd_we_set_qpower(adapter, id, value); |
| 4861 | } |
| 4862 | |
Jeff Johnson | 5d0e8cd | 2018-11-07 08:17:05 -0800 | [diff] [blame] | 4863 | static int hdd_we_set_pdev(struct hdd_adapter *adapter, |
| 4864 | WMI_PDEV_PARAM id, |
| 4865 | const char *id_string, |
| 4866 | int value) |
| 4867 | { |
| 4868 | int errno; |
| 4869 | |
| 4870 | hdd_debug("%s %d", id_string, value); |
| 4871 | errno = wma_cli_set_command(adapter->session_id, id, value, PDEV_CMD); |
| 4872 | if (errno) |
| 4873 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4874 | |
| 4875 | return errno; |
| 4876 | } |
| 4877 | |
| 4878 | #define hdd_we_set_pdev(adapter, id, value) \ |
| 4879 | hdd_we_set_pdev(adapter, id, #id, value) |
| 4880 | |
| 4881 | static int hdd_we_set_ani_en_dis(struct hdd_adapter *adapter, int value) |
| 4882 | { |
| 4883 | return hdd_we_set_pdev(adapter, |
| 4884 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 4885 | value); |
| 4886 | } |
| 4887 | |
| 4888 | static int hdd_we_set_ani_poll_period(struct hdd_adapter *adapter, int value) |
| 4889 | { |
| 4890 | return hdd_we_set_pdev(adapter, |
| 4891 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 4892 | value); |
| 4893 | } |
| 4894 | |
| 4895 | static int hdd_we_set_ani_listen_period(struct hdd_adapter *adapter, int value) |
| 4896 | { |
| 4897 | return hdd_we_set_pdev(adapter, |
| 4898 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 4899 | value); |
| 4900 | } |
| 4901 | |
| 4902 | static int hdd_we_set_ani_ofdm_level(struct hdd_adapter *adapter, int value) |
| 4903 | { |
| 4904 | return hdd_we_set_pdev(adapter, |
| 4905 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 4906 | value); |
| 4907 | } |
| 4908 | |
| 4909 | static int hdd_we_set_ani_cck_level(struct hdd_adapter *adapter, int value) |
| 4910 | { |
| 4911 | return hdd_we_set_pdev(adapter, |
| 4912 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 4913 | value); |
| 4914 | } |
| 4915 | |
| 4916 | static int hdd_we_set_dynamic_bw(struct hdd_adapter *adapter, int value) |
| 4917 | { |
| 4918 | return hdd_we_set_pdev(adapter, |
| 4919 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 4920 | value); |
| 4921 | } |
| 4922 | |
| 4923 | static int hdd_we_set_cts_cbw(struct hdd_adapter *adapter, int value) |
| 4924 | { |
| 4925 | return hdd_we_set_pdev(adapter, |
| 4926 | WMI_PDEV_PARAM_CTS_CBW, |
| 4927 | value); |
| 4928 | } |
| 4929 | |
| 4930 | static int hdd_we_set_tx_chainmask(struct hdd_adapter *adapter, int value) |
| 4931 | { |
| 4932 | int errno; |
| 4933 | |
| 4934 | errno = hdd_we_set_pdev(adapter, |
| 4935 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 4936 | value); |
| 4937 | if (errno) |
| 4938 | return errno; |
| 4939 | |
| 4940 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 4941 | } |
| 4942 | |
| 4943 | static int hdd_we_set_rx_chainmask(struct hdd_adapter *adapter, int value) |
| 4944 | { |
| 4945 | int errno; |
| 4946 | |
| 4947 | errno = hdd_we_set_pdev(adapter, |
| 4948 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 4949 | value); |
| 4950 | if (errno) |
| 4951 | return errno; |
| 4952 | |
| 4953 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 4954 | } |
| 4955 | |
| 4956 | static int hdd_we_set_txpow_2g(struct hdd_adapter *adapter, int value) |
| 4957 | { |
| 4958 | return hdd_we_set_pdev(adapter, |
| 4959 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 4960 | value); |
| 4961 | } |
| 4962 | |
| 4963 | static int hdd_we_set_txpow_5g(struct hdd_adapter *adapter, int value) |
| 4964 | { |
| 4965 | return hdd_we_set_pdev(adapter, |
| 4966 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 4967 | value); |
| 4968 | } |
| 4969 | |
Jeff Johnson | 2e38127 | 2018-11-10 09:33:39 -0800 | [diff] [blame] | 4970 | static int hdd_we_set_vdev(struct hdd_adapter *adapter, |
| 4971 | int id, |
| 4972 | const char *id_string, |
| 4973 | int value) |
| 4974 | { |
| 4975 | int errno; |
| 4976 | |
| 4977 | hdd_debug("%s %d", id_string, value); |
| 4978 | errno = wma_cli_set_command(adapter->session_id, id, value, VDEV_CMD); |
| 4979 | if (errno) |
| 4980 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4981 | |
| 4982 | return errno; |
| 4983 | } |
| 4984 | |
| 4985 | #define hdd_we_set_vdev(adapter, id, value) \ |
| 4986 | hdd_we_set_vdev(adapter, id, #id, value) |
| 4987 | |
| 4988 | static int hdd_we_set_txrx_fwstats(struct hdd_adapter *adapter, int value) |
| 4989 | { |
| 4990 | return hdd_we_set_vdev(adapter, |
| 4991 | WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID, |
| 4992 | value); |
| 4993 | } |
| 4994 | |
| 4995 | static int hdd_we_txrx_fwstats_reset(struct hdd_adapter *adapter, int value) |
| 4996 | { |
| 4997 | return hdd_we_set_vdev(adapter, |
| 4998 | WMA_VDEV_TXRX_FWSTATS_RESET_CMDID, |
| 4999 | value); |
| 5000 | } |
| 5001 | |
| 5002 | static int hdd_we_set_htsmps(struct hdd_adapter *adapter, int value) |
| 5003 | { |
| 5004 | return hdd_we_set_vdev(adapter, |
| 5005 | WMI_STA_SMPS_FORCE_MODE_CMDID, |
| 5006 | value); |
| 5007 | } |
| 5008 | |
| 5009 | static int hdd_we_set_early_rx_adjust_enable(struct hdd_adapter *adapter, |
| 5010 | int value) |
| 5011 | { |
| 5012 | if ((value != 0) && (value != 1)) |
| 5013 | return -EINVAL; |
| 5014 | |
| 5015 | return hdd_we_set_vdev(adapter, |
| 5016 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, |
| 5017 | value); |
| 5018 | } |
| 5019 | |
| 5020 | static int hdd_we_set_early_rx_tgt_bmiss_num(struct hdd_adapter *adapter, |
| 5021 | int value) |
| 5022 | { |
| 5023 | return hdd_we_set_vdev(adapter, |
| 5024 | WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, |
| 5025 | value); |
| 5026 | } |
| 5027 | |
| 5028 | static int hdd_we_set_early_rx_bmiss_sample_cycle(struct hdd_adapter *adapter, |
| 5029 | int value) |
| 5030 | { |
| 5031 | return hdd_we_set_vdev(adapter, |
| 5032 | WMI_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 5033 | value); |
| 5034 | } |
| 5035 | |
| 5036 | static int hdd_we_set_early_rx_slop_step(struct hdd_adapter *adapter, int value) |
| 5037 | { |
| 5038 | return hdd_we_set_vdev(adapter, |
| 5039 | WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP, |
| 5040 | value); |
| 5041 | } |
| 5042 | |
| 5043 | static int hdd_we_set_early_rx_init_slop(struct hdd_adapter *adapter, int value) |
| 5044 | { |
| 5045 | return hdd_we_set_vdev(adapter, |
| 5046 | WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP, |
| 5047 | value); |
| 5048 | } |
| 5049 | |
| 5050 | static int hdd_we_set_early_rx_adjust_pause(struct hdd_adapter *adapter, |
| 5051 | int value) |
| 5052 | { |
| 5053 | if ((value != 0) && (value != 1)) |
| 5054 | return -EINVAL; |
| 5055 | |
| 5056 | return hdd_we_set_vdev(adapter, |
| 5057 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, |
| 5058 | value); |
| 5059 | } |
| 5060 | |
| 5061 | static int hdd_we_set_early_rx_drift_sample(struct hdd_adapter *adapter, |
| 5062 | int value) |
| 5063 | { |
| 5064 | return hdd_we_set_vdev(adapter, |
| 5065 | WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE, |
| 5066 | value); |
| 5067 | } |
| 5068 | |
| 5069 | static int hdd_we_set_dcm(struct hdd_adapter *adapter, int value) |
| 5070 | { |
| 5071 | return hdd_we_set_vdev(adapter, |
| 5072 | WMI_VDEV_PARAM_HE_DCM, |
| 5073 | value); |
| 5074 | } |
| 5075 | |
| 5076 | static int hdd_we_set_range_ext(struct hdd_adapter *adapter, int value) |
| 5077 | { |
| 5078 | return hdd_we_set_vdev(adapter, |
| 5079 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5080 | value); |
| 5081 | } |
| 5082 | |
Jeff Johnson | 22e57f1 | 2018-11-10 16:02:00 -0800 | [diff] [blame] | 5083 | static int hdd_we_set_dbg(struct hdd_adapter *adapter, |
| 5084 | int id, |
| 5085 | const char *id_string, |
| 5086 | int value) |
| 5087 | { |
| 5088 | int errno; |
| 5089 | |
| 5090 | hdd_debug("%s %d", id_string, value); |
| 5091 | errno = wma_cli_set_command(adapter->session_id, id, value, DBG_CMD); |
| 5092 | if (errno) |
| 5093 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5094 | |
| 5095 | return errno; |
| 5096 | } |
| 5097 | |
| 5098 | #define hdd_we_set_dbg(adapter, id, value) \ |
| 5099 | hdd_we_set_dbg(adapter, id, #id, value) |
| 5100 | |
| 5101 | static int hdd_we_dbglog_log_level(struct hdd_adapter *adapter, int value) |
| 5102 | { |
| 5103 | return hdd_we_set_dbg(adapter, |
| 5104 | WMI_DBGLOG_LOG_LEVEL, |
| 5105 | value); |
| 5106 | } |
| 5107 | |
| 5108 | static int hdd_we_dbglog_vap_enable(struct hdd_adapter *adapter, int value) |
| 5109 | { |
| 5110 | return hdd_we_set_dbg(adapter, |
| 5111 | WMI_DBGLOG_VAP_ENABLE, |
| 5112 | value); |
| 5113 | } |
| 5114 | |
| 5115 | static int hdd_we_dbglog_vap_disable(struct hdd_adapter *adapter, int value) |
| 5116 | { |
| 5117 | return hdd_we_set_dbg(adapter, |
| 5118 | WMI_DBGLOG_VAP_DISABLE, |
| 5119 | value); |
| 5120 | } |
| 5121 | |
| 5122 | static int hdd_we_dbglog_module_enable(struct hdd_adapter *adapter, int value) |
| 5123 | { |
| 5124 | return hdd_we_set_dbg(adapter, |
| 5125 | WMI_DBGLOG_MODULE_ENABLE, |
| 5126 | value); |
| 5127 | } |
| 5128 | |
| 5129 | static int hdd_we_dbglog_module_disable(struct hdd_adapter *adapter, int value) |
| 5130 | { |
| 5131 | return hdd_we_set_dbg(adapter, |
| 5132 | WMI_DBGLOG_MODULE_DISABLE, |
| 5133 | value); |
| 5134 | } |
| 5135 | |
| 5136 | static int hdd_we_dbglog_mod_log_level(struct hdd_adapter *adapter, int value) |
| 5137 | { |
| 5138 | return hdd_we_set_dbg(adapter, |
| 5139 | WMI_DBGLOG_MOD_LOG_LEVEL, |
| 5140 | value); |
| 5141 | } |
| 5142 | |
| 5143 | static int hdd_we_dbglog_type(struct hdd_adapter *adapter, int value) |
| 5144 | { |
| 5145 | return hdd_we_set_dbg(adapter, |
| 5146 | WMI_DBGLOG_TYPE, |
| 5147 | value); |
| 5148 | } |
| 5149 | |
| 5150 | static int hdd_we_dbglog_report_enable(struct hdd_adapter *adapter, int value) |
| 5151 | { |
| 5152 | return hdd_we_set_dbg(adapter, |
| 5153 | WMI_DBGLOG_REPORT_ENABLE, |
| 5154 | value); |
| 5155 | } |
| 5156 | |
| 5157 | static int hdd_we_start_fw_profile(struct hdd_adapter *adapter, int value) |
| 5158 | { |
| 5159 | return hdd_we_set_dbg(adapter, |
| 5160 | WMI_WLAN_PROFILE_TRIGGER_CMDID, |
| 5161 | value); |
| 5162 | } |
| 5163 | |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5164 | static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel) |
| 5165 | { |
| 5166 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5167 | QDF_STATUS status; |
| 5168 | |
| 5169 | hdd_debug("Set Channel %d Session ID %d mode %d", channel, |
| 5170 | adapter->session_id, adapter->device_mode); |
| 5171 | |
| 5172 | if (!hdd_ctx->mac_handle) |
| 5173 | return -EINVAL; |
| 5174 | |
| 5175 | switch (adapter->device_mode) { |
| 5176 | case QDF_STA_MODE: |
| 5177 | case QDF_P2P_CLIENT_MODE: |
| 5178 | /* supported */ |
| 5179 | break; |
| 5180 | default: |
| 5181 | hdd_err("change channel not supported for device mode %d", |
| 5182 | adapter->device_mode); |
| 5183 | return -EINVAL; |
| 5184 | } |
| 5185 | |
| 5186 | status = sme_ext_change_channel(hdd_ctx->mac_handle, channel, |
| 5187 | adapter->session_id); |
| 5188 | if (status != QDF_STATUS_SUCCESS) |
| 5189 | hdd_err("Error in change channel status %d", status); |
| 5190 | |
| 5191 | return qdf_status_to_os_return(status); |
| 5192 | } |
| 5193 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 5194 | static int hdd_we_mcc_config_latency(struct hdd_adapter *adapter, int latency) |
| 5195 | { |
| 5196 | hdd_debug("MCC latency %d", latency); |
| 5197 | |
| 5198 | wlan_hdd_set_mcc_latency(adapter, latency); |
| 5199 | |
| 5200 | return 0; |
| 5201 | } |
| 5202 | |
| 5203 | static int hdd_we_mcc_config_quota(struct hdd_adapter *adapter, int quota) |
| 5204 | { |
| 5205 | hdd_debug("MCC quota %dms", quota); |
| 5206 | |
| 5207 | return wlan_hdd_set_mcc_p2p_quota(adapter, quota); |
| 5208 | } |
| 5209 | |
Jeff Johnson | 33ec198 | 2018-11-12 21:40:33 -0800 | [diff] [blame] | 5210 | static int hdd_we_set_debug_log(struct hdd_adapter *adapter, int value) |
| 5211 | { |
| 5212 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5213 | |
| 5214 | if (!hdd_ctx->mac_handle) |
| 5215 | return -EINVAL; |
| 5216 | |
| 5217 | sme_update_connect_debug(hdd_ctx->mac_handle, value); |
| 5218 | |
| 5219 | return 0; |
| 5220 | } |
| 5221 | |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5222 | static int hdd_we_set_scan_disable(struct hdd_adapter *adapter, int value) |
| 5223 | { |
| 5224 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5225 | |
| 5226 | hdd_debug("%d", value); |
| 5227 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5228 | if (!hdd_ctx->psoc) |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5229 | return -EINVAL; |
| 5230 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5231 | if (value) |
| 5232 | ucfg_scan_psoc_set_disable(hdd_ctx->psoc, REASON_USER_SPACE); |
| 5233 | else |
| 5234 | ucfg_scan_psoc_set_enable(hdd_ctx->psoc, REASON_USER_SPACE); |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5235 | |
| 5236 | return 0; |
| 5237 | } |
| 5238 | |
Jeff Johnson | d3f1efd | 2018-11-13 13:26:19 -0800 | [diff] [blame] | 5239 | static int hdd_we_set_conc_system_pref(struct hdd_adapter *adapter, |
| 5240 | int preference) |
| 5241 | { |
| 5242 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5243 | |
| 5244 | hdd_debug("%d", preference); |
| 5245 | |
| 5246 | if (!hdd_ctx->psoc) |
| 5247 | return -EINVAL; |
| 5248 | |
| 5249 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, preference); |
| 5250 | |
| 5251 | return 0; |
| 5252 | } |
| 5253 | |
Jeff Johnson | 74696bb | 2018-11-13 13:30:36 -0800 | [diff] [blame] | 5254 | static int hdd_we_set_11ax_rate(struct hdd_adapter *adapter, int rate) |
| 5255 | { |
| 5256 | return hdd_set_11ax_rate(adapter, rate, NULL); |
| 5257 | } |
| 5258 | |
Jeff Johnson | b43ec12 | 2018-11-13 14:17:08 -0800 | [diff] [blame] | 5259 | static int hdd_we_set_modulated_dtim(struct hdd_adapter *adapter, int value) |
| 5260 | { |
| 5261 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5262 | |
| 5263 | hdd_debug("%d", value); |
| 5264 | |
| 5265 | if (!hdd_ctx->psoc) |
| 5266 | return -EINVAL; |
| 5267 | |
| 5268 | if ((value < cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM)) || |
| 5269 | (value > cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM))) { |
| 5270 | hdd_err("Invalid value %d", value); |
| 5271 | return -EINVAL; |
| 5272 | } |
| 5273 | |
| 5274 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, value); |
| 5275 | |
| 5276 | return 0; |
| 5277 | } |
| 5278 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5279 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5280 | /** |
| 5281 | * hdd_we_motion_det_start_stop - start/stop motion detection |
| 5282 | * @adapter: hdd adapter |
| 5283 | * @value: start/stop value to set |
| 5284 | * |
| 5285 | * Return: 0 on success, error on failure |
| 5286 | */ |
| 5287 | static int hdd_we_motion_det_start_stop(struct hdd_adapter *adapter, int value) |
| 5288 | { |
| 5289 | struct sme_motion_det_en motion_det; |
| 5290 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5291 | |
| 5292 | if (value < 0 || value > 1) { |
| 5293 | hdd_err("Invalid value %d in mt_start", value); |
| 5294 | return -EINVAL; |
| 5295 | } |
| 5296 | motion_det.vdev_id = adapter->session_id; |
| 5297 | motion_det.enable = value; |
| 5298 | |
| 5299 | if (!value) |
| 5300 | adapter->motion_detection_mode = 0; |
| 5301 | |
| 5302 | sme_motion_det_enable(hdd_ctx->mac_handle, &motion_det); |
| 5303 | |
| 5304 | return 0; |
| 5305 | } |
| 5306 | |
| 5307 | /** |
| 5308 | * hdd_we_motion_det_base_line_start_stop - start/stop md baselining |
| 5309 | * @adapter: hdd adapter |
| 5310 | * @value: start/stop value to set |
| 5311 | * |
| 5312 | * Return: 0 on success, error on failure |
| 5313 | */ |
| 5314 | static int hdd_we_motion_det_base_line_start_stop(struct hdd_adapter *adapter, |
| 5315 | int value) |
| 5316 | { |
| 5317 | struct sme_motion_det_base_line_en motion_det_base_line; |
| 5318 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5319 | |
| 5320 | if (value < 0 || value > 1) { |
| 5321 | hdd_err("Invalid value %d in mt_bl_start", value); |
| 5322 | return -EINVAL; |
| 5323 | } |
| 5324 | |
| 5325 | motion_det_base_line.vdev_id = adapter->session_id; |
| 5326 | motion_det_base_line.enable = value; |
| 5327 | sme_motion_det_base_line_enable(hdd_ctx->mac_handle, |
| 5328 | &motion_det_base_line); |
| 5329 | |
| 5330 | return 0; |
| 5331 | } |
| 5332 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
| 5333 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5334 | typedef int (*setint_getnone_fn)(struct hdd_adapter *adapter, int value); |
| 5335 | static const setint_getnone_fn setint_getnone_cb[] = { |
| 5336 | [WE_SET_11D_STATE] = hdd_we_set_11d_state, |
| 5337 | [WE_SET_POWER] = hdd_we_set_power, |
| 5338 | [WE_SET_MAX_ASSOC] = hdd_we_set_max_assoc, |
| 5339 | [WE_SET_DATA_INACTIVITY_TO] = hdd_we_set_data_inactivity_timeout, |
| 5340 | [WE_SET_WOW_DATA_INACTIVITY_TO] = |
| 5341 | hdd_we_set_wow_data_inactivity_timeout, |
| 5342 | [WE_SET_MC_RATE] = wlan_hdd_set_mc_rate, |
| 5343 | [WE_SET_TX_POWER] = hdd_we_set_tx_power, |
| 5344 | [WE_SET_MAX_TX_POWER] = hdd_we_set_max_tx_power, |
| 5345 | [WE_SET_MAX_TX_POWER_2_4] = hdd_we_set_max_tx_power_2_4, |
| 5346 | [WE_SET_MAX_TX_POWER_5_0] = hdd_we_set_max_tx_power_5_0, |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 5347 | #ifdef HASTINGS_BT_WAR |
| 5348 | [WE_SET_HASTINGS_BT_WAR] = hdd_we_set_hastings_bt_war, |
| 5349 | #endif |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5350 | [WE_SET_TM_LEVEL] = hdd_we_set_tm_level, |
| 5351 | [WE_SET_PHYMODE] = wlan_hdd_update_phymode, |
| 5352 | [WE_SET_NSS] = hdd_we_set_nss, |
| 5353 | [WE_SET_GTX_HT_MCS] = hdd_we_set_gtx_ht_mcs, |
| 5354 | [WE_SET_GTX_VHT_MCS] = hdd_we_set_gtx_vht_mcs, |
| 5355 | [WE_SET_GTX_USRCFG] = hdd_we_set_gtx_usrcfg, |
| 5356 | [WE_SET_GTX_THRE] = hdd_we_set_gtx_thre, |
| 5357 | [WE_SET_GTX_MARGIN] = hdd_we_set_gtx_margin, |
| 5358 | [WE_SET_GTX_STEP] = hdd_we_set_gtx_step, |
| 5359 | [WE_SET_GTX_MINTPC] = hdd_we_set_gtx_mintpc, |
| 5360 | [WE_SET_GTX_BWMASK] = hdd_we_set_gtx_bwmask, |
| 5361 | [WE_SET_LDPC] = hdd_set_ldpc, |
| 5362 | [WE_SET_TX_STBC] = hdd_set_tx_stbc, |
| 5363 | [WE_SET_RX_STBC] = hdd_set_rx_stbc, |
| 5364 | [WE_SET_SHORT_GI] = hdd_we_set_short_gi, |
| 5365 | [WE_SET_RTSCTS] = hdd_we_set_rtscts, |
| 5366 | [WE_SET_CHWIDTH] = hdd_we_set_ch_width, |
| 5367 | [WE_SET_ANI_EN_DIS] = hdd_we_set_ani_en_dis, |
| 5368 | [WE_SET_ANI_POLL_PERIOD] = hdd_we_set_ani_poll_period, |
| 5369 | [WE_SET_ANI_LISTEN_PERIOD] = hdd_we_set_ani_listen_period, |
| 5370 | [WE_SET_ANI_OFDM_LEVEL] = hdd_we_set_ani_ofdm_level, |
| 5371 | [WE_SET_ANI_CCK_LEVEL] = hdd_we_set_ani_cck_level, |
| 5372 | [WE_SET_DYNAMIC_BW] = hdd_we_set_dynamic_bw, |
| 5373 | [WE_SET_CTS_CBW] = hdd_we_set_cts_cbw, |
| 5374 | [WE_SET_11N_RATE] = hdd_we_set_11n_rate, |
| 5375 | [WE_SET_VHT_RATE] = hdd_we_set_vht_rate, |
| 5376 | [WE_SET_AMPDU] = hdd_we_set_ampdu, |
| 5377 | [WE_SET_AMSDU] = hdd_we_set_amsdu, |
| 5378 | [WE_SET_TX_CHAINMASK] = hdd_we_set_tx_chainmask, |
| 5379 | [WE_SET_RX_CHAINMASK] = hdd_we_set_rx_chainmask, |
| 5380 | [WE_SET_TXPOW_2G] = hdd_we_set_txpow_2g, |
| 5381 | [WE_SET_TXPOW_5G] = hdd_we_set_txpow_5g, |
| 5382 | [WE_DBGLOG_LOG_LEVEL] = hdd_we_dbglog_log_level, |
| 5383 | [WE_DBGLOG_VAP_ENABLE] = hdd_we_dbglog_vap_enable, |
| 5384 | [WE_DBGLOG_VAP_DISABLE] = hdd_we_dbglog_vap_disable, |
| 5385 | [WE_DBGLOG_MODULE_ENABLE] = hdd_we_dbglog_module_enable, |
| 5386 | [WE_DBGLOG_MODULE_DISABLE] = hdd_we_dbglog_module_disable, |
| 5387 | [WE_DBGLOG_MOD_LOG_LEVEL] = hdd_we_dbglog_mod_log_level, |
| 5388 | [WE_DBGLOG_TYPE] = hdd_we_dbglog_type, |
| 5389 | [WE_DBGLOG_REPORT_ENABLE] = hdd_we_dbglog_report_enable, |
| 5390 | [WE_SET_TXRX_FWSTATS] = hdd_we_set_txrx_fwstats, |
| 5391 | [WE_TXRX_FWSTATS_RESET] = hdd_we_txrx_fwstats_reset, |
| 5392 | [WE_DUMP_STATS] = hdd_wlan_dump_stats, |
| 5393 | [WE_CLEAR_STATS] = hdd_we_clear_stats, |
| 5394 | [WE_PPS_PAID_MATCH] = hdd_we_pps_paid_match, |
| 5395 | [WE_PPS_GID_MATCH] = hdd_we_pps_gid_match, |
| 5396 | [WE_PPS_EARLY_TIM_CLEAR] = hdd_we_pps_early_tim_clear, |
| 5397 | [WE_PPS_EARLY_DTIM_CLEAR] = hdd_we_pps_early_dtim_clear, |
| 5398 | [WE_PPS_EOF_PAD_DELIM] = hdd_we_pps_eof_pad_delim, |
| 5399 | [WE_PPS_MACADDR_MISMATCH] = hdd_we_pps_macaddr_mismatch, |
| 5400 | [WE_PPS_DELIM_CRC_FAIL] = hdd_we_pps_delim_crc_fail, |
| 5401 | [WE_PPS_GID_NSTS_ZERO] = hdd_we_pps_gid_nsts_zero, |
| 5402 | [WE_PPS_RSSI_CHECK] = hdd_we_pps_rssi_check, |
| 5403 | [WE_PPS_5G_EBT] = hdd_we_pps_5g_ebt, |
| 5404 | [WE_SET_HTSMPS] = hdd_we_set_htsmps, |
| 5405 | [WE_SET_QPOWER_MAX_PSPOLL_COUNT] = hdd_we_set_qpower_max_pspoll_count, |
| 5406 | [WE_SET_QPOWER_MAX_TX_BEFORE_WAKE] = |
| 5407 | hdd_we_set_qpower_max_tx_before_wake, |
| 5408 | [WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL] = |
| 5409 | hdd_we_set_qpower_spec_pspoll_wake_interval, |
| 5410 | [WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL] = |
| 5411 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll, |
| 5412 | [WE_MCC_CONFIG_LATENCY] = hdd_we_mcc_config_latency, |
| 5413 | [WE_MCC_CONFIG_QUOTA] = hdd_we_mcc_config_quota, |
| 5414 | [WE_SET_DEBUG_LOG] = hdd_we_set_debug_log, |
| 5415 | [WE_SET_EARLY_RX_ADJUST_ENABLE] = hdd_we_set_early_rx_adjust_enable, |
| 5416 | [WE_SET_EARLY_RX_TGT_BMISS_NUM] = hdd_we_set_early_rx_tgt_bmiss_num, |
| 5417 | [WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE] = |
| 5418 | hdd_we_set_early_rx_bmiss_sample_cycle, |
| 5419 | [WE_SET_EARLY_RX_SLOP_STEP] = hdd_we_set_early_rx_slop_step, |
| 5420 | [WE_SET_EARLY_RX_INIT_SLOP] = hdd_we_set_early_rx_init_slop, |
| 5421 | [WE_SET_EARLY_RX_ADJUST_PAUSE] = hdd_we_set_early_rx_adjust_pause, |
| 5422 | [WE_SET_EARLY_RX_DRIFT_SAMPLE] = hdd_we_set_early_rx_drift_sample, |
| 5423 | [WE_SET_SCAN_DISABLE] = hdd_we_set_scan_disable, |
| 5424 | [WE_START_FW_PROFILE] = hdd_we_start_fw_profile, |
| 5425 | [WE_SET_CHANNEL] = hdd_we_set_channel, |
| 5426 | [WE_SET_CONC_SYSTEM_PREF] = hdd_we_set_conc_system_pref, |
| 5427 | [WE_SET_11AX_RATE] = hdd_we_set_11ax_rate, |
| 5428 | [WE_SET_DCM] = hdd_we_set_dcm, |
| 5429 | [WE_SET_RANGE_EXT] = hdd_we_set_range_ext, |
| 5430 | [WE_SET_PDEV_RESET] = hdd_handle_pdev_reset, |
| 5431 | [WE_SET_MODULATED_DTIM] = hdd_we_set_modulated_dtim, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5432 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5433 | [WE_MOTION_DET_START_STOP] = hdd_we_motion_det_start_stop, |
| 5434 | [WE_MOTION_DET_BASE_LINE_START_STOP] = |
| 5435 | hdd_we_motion_det_base_line_start_stop, |
| 5436 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5437 | }; |
| 5438 | |
| 5439 | static setint_getnone_fn hdd_get_setint_getnone_cb(int param) |
| 5440 | { |
| 5441 | if (param < 0) |
| 5442 | return NULL; |
| 5443 | |
| 5444 | if (param >= QDF_ARRAY_SIZE(setint_getnone_cb)) |
| 5445 | return NULL; |
| 5446 | |
| 5447 | return setint_getnone_cb[param]; |
| 5448 | } |
| 5449 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5450 | /** |
| 5451 | * iw_setint_getnone() - Generic "set integer" private ioctl handler |
| 5452 | * @dev: device upon which the ioctl was received |
| 5453 | * @info: ioctl request information |
| 5454 | * @wrqu: ioctl request data |
| 5455 | * @extra: ioctl extra data |
| 5456 | * |
| 5457 | * Return: 0 on success, non-zero on error |
| 5458 | */ |
| 5459 | static int __iw_setint_getnone(struct net_device *dev, |
| 5460 | struct iw_request_info *info, |
| 5461 | union iwreq_data *wrqu, char *extra) |
| 5462 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5463 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5464 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5465 | setint_getnone_fn cb; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5466 | int *value = (int *)extra; |
| 5467 | int sub_cmd = value[0]; |
| 5468 | int set_value = value[1]; |
| 5469 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5470 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5471 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5472 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5473 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5474 | ret = wlan_hdd_validate_context(hdd_ctx); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5475 | if (ret) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5476 | return ret; |
| 5477 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5478 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5479 | if (ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5480 | return ret; |
| 5481 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5482 | cb = hdd_get_setint_getnone_cb(sub_cmd); |
| 5483 | if (!cb) { |
Rajeev Kumar | d056536 | 2018-03-01 12:02:01 -0800 | [diff] [blame] | 5484 | hdd_debug("Invalid sub command %d", sub_cmd); |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5485 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5486 | } |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5487 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5488 | ret = cb(adapter, set_value); |
| 5489 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5490 | hdd_exit(); |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5491 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5492 | return ret; |
| 5493 | } |
| 5494 | |
| 5495 | static int iw_setint_getnone(struct net_device *dev, |
| 5496 | struct iw_request_info *info, |
| 5497 | union iwreq_data *wrqu, |
| 5498 | char *extra) |
| 5499 | { |
| 5500 | int ret; |
| 5501 | |
| 5502 | cds_ssr_protect(__func__); |
| 5503 | ret = __iw_setint_getnone(dev, info, wrqu, extra); |
| 5504 | cds_ssr_unprotect(__func__); |
| 5505 | |
| 5506 | return ret; |
| 5507 | } |
| 5508 | |
| 5509 | /** |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5510 | * __iw_setnone_get_threeint() - return three value to up layer. |
| 5511 | * |
| 5512 | * @dev: pointer of net_device of this wireless card |
| 5513 | * @info: meta data about Request sent |
| 5514 | * @wrqu: include request info |
| 5515 | * @extra: buf used for in/Output |
| 5516 | * |
| 5517 | * Return: execute result |
| 5518 | */ |
| 5519 | static int __iw_setnone_get_threeint(struct net_device *dev, |
| 5520 | struct iw_request_info *info, |
| 5521 | union iwreq_data *wrqu, char *extra) |
| 5522 | { |
| 5523 | int ret = 0; /* success */ |
| 5524 | uint32_t *value = (int *)extra; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 5525 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5526 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5527 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5528 | hdd_enter_dev(dev); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5529 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5530 | if (0 != ret) |
| 5531 | return ret; |
| 5532 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5533 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5534 | if (0 != ret) |
| 5535 | return ret; |
| 5536 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5537 | hdd_debug("param = %d", value[0]); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5538 | switch (value[0]) { |
| 5539 | case WE_GET_TSF: |
| 5540 | ret = hdd_indicate_tsf(adapter, value, 3); |
| 5541 | break; |
| 5542 | default: |
| 5543 | hdd_err("Invalid IOCTL get_value command %d", value[0]); |
| 5544 | break; |
| 5545 | } |
| 5546 | return ret; |
| 5547 | } |
| 5548 | |
| 5549 | /** |
| 5550 | * iw_setnone_get_threeint() - return three value to up layer. |
| 5551 | * |
| 5552 | * @dev: pointer of net_device of this wireless card |
| 5553 | * @info: meta data about Request sent |
| 5554 | * @wrqu: include request info |
| 5555 | * @extra: buf used for in/Output |
| 5556 | * |
| 5557 | * Return: execute result |
| 5558 | */ |
| 5559 | static int iw_setnone_get_threeint(struct net_device *dev, |
| 5560 | struct iw_request_info *info, |
| 5561 | union iwreq_data *wrqu, char *extra) |
| 5562 | { |
| 5563 | int ret; |
| 5564 | |
| 5565 | cds_ssr_protect(__func__); |
| 5566 | ret = __iw_setnone_get_threeint(dev, info, wrqu, extra); |
| 5567 | cds_ssr_unprotect(__func__); |
| 5568 | |
| 5569 | return ret; |
| 5570 | } |
| 5571 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5572 | #ifdef WLAN_UNIT_TEST |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5573 | typedef uint32_t (*hdd_ut_callback)(void); |
| 5574 | |
| 5575 | struct hdd_ut_entry { |
| 5576 | const hdd_ut_callback callback; |
| 5577 | const char *name; |
| 5578 | }; |
| 5579 | |
| 5580 | struct hdd_ut_entry hdd_ut_entries[] = { |
| 5581 | { .name = "dsc", .callback = dsc_unit_test }, |
Dustin Brown | 6fb7a75 | 2018-11-30 11:33:57 -0800 | [diff] [blame] | 5582 | { .name = "ht", .callback = qdf_ht_unit_test }, |
Dustin Brown | d315c45 | 2018-11-27 11:28:48 -0800 | [diff] [blame] | 5583 | { .name = "talloc", .callback = qdf_talloc_unit_test }, |
Dustin Brown | ebb16d1 | 2018-11-29 17:52:07 -0800 | [diff] [blame] | 5584 | { .name = "types", .callback = qdf_types_unit_test }, |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5585 | }; |
| 5586 | |
| 5587 | #define hdd_for_each_ut_entry(cursor) \ |
| 5588 | for (cursor = hdd_ut_entries; \ |
| 5589 | cursor < hdd_ut_entries + ARRAY_SIZE(hdd_ut_entries); \ |
| 5590 | cursor++) |
| 5591 | |
| 5592 | static struct hdd_ut_entry *hdd_ut_lookup(const char *name) |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5593 | { |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5594 | struct hdd_ut_entry *entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5595 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5596 | hdd_for_each_ut_entry(entry) { |
| 5597 | if (qdf_str_eq(entry->name, name)) |
| 5598 | return entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5599 | } |
| 5600 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5601 | return NULL; |
| 5602 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5603 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5604 | static uint32_t hdd_ut_single(const struct hdd_ut_entry *entry) |
| 5605 | { |
| 5606 | uint32_t errors; |
| 5607 | |
| 5608 | hdd_nofl_info("START: '%s'", entry->name); |
| 5609 | |
| 5610 | errors = entry->callback(); |
| 5611 | if (errors) |
| 5612 | hdd_nofl_err("FAIL: '%s' with %u errors", entry->name, errors); |
| 5613 | else |
| 5614 | hdd_nofl_info("PASS: '%s'", entry->name); |
| 5615 | |
| 5616 | return errors; |
| 5617 | } |
| 5618 | |
| 5619 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *name) |
| 5620 | { |
| 5621 | struct hdd_ut_entry *entry; |
| 5622 | uint32_t errors = 0; |
| 5623 | |
| 5624 | hdd_nofl_info("Unit tests begin"); |
| 5625 | |
| 5626 | if (!name || !name[0] || qdf_str_eq(name, "all")) { |
| 5627 | hdd_for_each_ut_entry(entry) |
| 5628 | errors += hdd_ut_single(entry); |
| 5629 | } else { |
| 5630 | entry = hdd_ut_lookup(name); |
| 5631 | if (entry) |
| 5632 | errors += hdd_ut_single(entry); |
| 5633 | else |
| 5634 | hdd_nofl_err("Unit test '%s' not found", name); |
| 5635 | } |
| 5636 | |
| 5637 | hdd_nofl_info("Unit tests complete"); |
| 5638 | |
| 5639 | return errors ? -EPERM : 0; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5640 | } |
| 5641 | #else |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5642 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *name) |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5643 | { |
| 5644 | return -EOPNOTSUPP; |
| 5645 | } |
| 5646 | #endif /* WLAN_UNIT_TEST */ |
| 5647 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5648 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5649 | * iw_setchar_getnone() - Generic "set string" private ioctl handler |
| 5650 | * @dev: device upon which the ioctl was received |
| 5651 | * @info: ioctl request information |
| 5652 | * @wrqu: ioctl request data |
| 5653 | * @extra: ioctl extra data |
| 5654 | * |
| 5655 | * Return: 0 on success, non-zero on error |
| 5656 | */ |
| 5657 | static int __iw_setchar_getnone(struct net_device *dev, |
| 5658 | struct iw_request_info *info, |
| 5659 | union iwreq_data *wrqu, char *extra) |
| 5660 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5661 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5662 | int sub_cmd; |
| 5663 | int ret; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5664 | char *str_arg = NULL; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5665 | struct hdd_adapter *adapter = (netdev_priv(dev)); |
| 5666 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5667 | struct iw_point s_priv_data; |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 5668 | bool neighbor_report_req_support = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5669 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5670 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 5671 | |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5672 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5673 | hdd_err("permission check failed"); |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5674 | return -EPERM; |
| 5675 | } |
| 5676 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5677 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5678 | if (0 != ret) |
| 5679 | return ret; |
| 5680 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5681 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5682 | if (0 != ret) |
| 5683 | return ret; |
| 5684 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5685 | /* helper function to get iwreq_data with compat handling. */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5686 | if (hdd_priv_get_data(&s_priv_data, wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5687 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5688 | |
| 5689 | /* make sure all params are correctly passed to function */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5690 | if ((NULL == s_priv_data.pointer) || (0 == s_priv_data.length)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5691 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5692 | |
| 5693 | sub_cmd = s_priv_data.flags; |
| 5694 | |
| 5695 | /* ODD number is used for set, copy data using copy_from_user */ |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5696 | str_arg = mem_alloc_copy_from_user_helper(s_priv_data.pointer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5697 | s_priv_data.length); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5698 | if (!str_arg) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5699 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5700 | return -ENOMEM; |
| 5701 | } |
| 5702 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5703 | hdd_debug("Received length: %d data: %s", |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5704 | s_priv_data.length, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5705 | |
| 5706 | switch (sub_cmd) { |
| 5707 | case WE_WOWL_ADD_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5708 | hdd_debug("ADD_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 5709 | if (!hdd_add_wowl_ptrn(adapter, str_arg)) |
| 5710 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5711 | break; |
| 5712 | case WE_WOWL_DEL_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5713 | hdd_debug("DEL_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 5714 | if (!hdd_del_wowl_ptrn(adapter, str_arg)) |
| 5715 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5716 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5717 | case WE_NEIGHBOR_REPORT_REQUEST: |
| 5718 | { |
| 5719 | tRrmNeighborReq neighborReq; |
| 5720 | tRrmNeighborRspCallbackInfo callbackInfo; |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 5721 | bool rrm_enabled = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5722 | |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 5723 | ucfg_wlan_mlme_get_rrm_enabled(hdd_ctx->psoc, |
| 5724 | &rrm_enabled); |
| 5725 | |
| 5726 | if (rrm_enabled) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5727 | neighborReq.neighbor_report_offload = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5728 | neighborReq.no_ssid = |
| 5729 | (s_priv_data.length - 1) ? false : true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5730 | hdd_debug("Neighbor Request ssid present %d", |
| 5731 | neighborReq.no_ssid); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5732 | if (!neighborReq.no_ssid) { |
| 5733 | neighborReq.ssid.length = |
| 5734 | (s_priv_data.length - 1) > |
| 5735 | 32 ? 32 : (s_priv_data.length - 1); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 5736 | qdf_mem_copy(neighborReq.ssid.ssId, |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5737 | str_arg, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5738 | neighborReq.ssid.length); |
| 5739 | } |
| 5740 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5741 | /* |
| 5742 | * If 11k offload is supported by FW and enabled |
| 5743 | * in the ini, set the offload to true |
| 5744 | */ |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 5745 | if (QDF_IS_STATUS_ERROR( |
| 5746 | ucfg_fwol_is_neighbor_report_req_supported( |
| 5747 | hdd_ctx->psoc, &neighbor_report_req_support))) |
| 5748 | hdd_err("Neighbor report req bit get fail"); |
| 5749 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5750 | if (hdd_ctx->config->is_11k_offload_supported && |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 5751 | neighbor_report_req_support) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5752 | hdd_debug("Neighbor report offloaded to FW"); |
| 5753 | neighborReq.neighbor_report_offload = true; |
| 5754 | } |
| 5755 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5756 | callbackInfo.neighborRspCallback = NULL; |
| 5757 | callbackInfo.neighborRspCallbackContext = NULL; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5758 | callbackInfo.timeout = 5000; /* 5 seconds */ |
| 5759 | sme_neighbor_report_request( |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5760 | hdd_ctx->mac_handle, |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5761 | adapter->session_id, |
| 5762 | &neighborReq, |
| 5763 | &callbackInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5764 | } else { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5765 | hdd_err("Ignoring neighbor request as RRM not enabled"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5766 | ret = -EINVAL; |
| 5767 | } |
| 5768 | } |
| 5769 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5770 | case WE_SET_AP_WPS_IE: |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 5771 | hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5772 | break; |
| 5773 | case WE_SET_CONFIG: |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5774 | status = hdd_execute_global_config_command(hdd_ctx, str_arg); |
| 5775 | if (QDF_IS_STATUS_ERROR(status)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5776 | ret = -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5777 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5778 | break; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5779 | case WE_UNIT_TEST: |
| 5780 | ret = hdd_we_unit_test(hdd_ctx, str_arg); |
| 5781 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5782 | default: |
| 5783 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5784 | hdd_err("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5785 | ret = -EINVAL; |
| 5786 | break; |
| 5787 | } |
| 5788 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5789 | |
| 5790 | qdf_mem_free(str_arg); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5791 | hdd_exit(); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5792 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5793 | return ret; |
| 5794 | } |
| 5795 | |
| 5796 | static int iw_setchar_getnone(struct net_device *dev, |
| 5797 | struct iw_request_info *info, |
| 5798 | union iwreq_data *wrqu, char *extra) |
| 5799 | { |
| 5800 | int ret; |
| 5801 | |
| 5802 | cds_ssr_protect(__func__); |
| 5803 | ret = __iw_setchar_getnone(dev, info, wrqu, extra); |
| 5804 | cds_ssr_unprotect(__func__); |
| 5805 | |
| 5806 | return ret; |
| 5807 | } |
| 5808 | |
| 5809 | /** |
| 5810 | * iw_setnone_getint() - Generic "get integer" private ioctl handler |
| 5811 | * @dev: device upon which the ioctl was received |
| 5812 | * @info: ioctl request information |
| 5813 | * @wrqu: ioctl request data |
| 5814 | * @extra: ioctl extra data |
| 5815 | * |
| 5816 | * Return: 0 on success, non-zero on error |
| 5817 | */ |
| 5818 | static int __iw_setnone_getint(struct net_device *dev, |
| 5819 | struct iw_request_info *info, |
| 5820 | union iwreq_data *wrqu, char *extra) |
| 5821 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5822 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5823 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5824 | int *value = (int *)extra; |
| 5825 | int ret; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5826 | tSmeConfigParams *sme_config; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5827 | struct hdd_context *hdd_ctx; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 5828 | QDF_STATUS status; |
| 5829 | bool bval = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5830 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5831 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5832 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5833 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5834 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5835 | if (0 != ret) |
| 5836 | return ret; |
| 5837 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5838 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5839 | if (0 != ret) |
| 5840 | return ret; |
| 5841 | |
Rajeev Kumar | 1117fcf | 2018-02-15 16:25:19 -0800 | [diff] [blame] | 5842 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 5843 | if (!sme_config) { |
| 5844 | hdd_err("failed to allocate memory for sme_config"); |
| 5845 | return -ENOMEM; |
| 5846 | } |
| 5847 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5848 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5849 | switch (value[0]) { |
| 5850 | case WE_GET_11D_STATE: |
| 5851 | { |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 5852 | status = ucfg_mlme_is_11d_enabled(hdd_ctx->psoc, &bval); |
| 5853 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 5854 | hdd_err("Invalid 11d_enable flag"); |
| 5855 | *value = bval; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5856 | hdd_debug("11D state=%d!!", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5857 | |
| 5858 | break; |
| 5859 | } |
| 5860 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5861 | case WE_GET_WLAN_DBG: |
| 5862 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 5863 | qdf_trace_display(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5864 | *value = 0; |
| 5865 | break; |
| 5866 | } |
| 5867 | case WE_GET_MAX_ASSOC: |
| 5868 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 5869 | if (ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, *value) != |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 5870 | QDF_STATUS_SUCCESS) { |
| 5871 | hdd_err("CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5872 | ret = -EIO; |
| 5873 | } |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 5874 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5875 | break; |
| 5876 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5877 | |
| 5878 | case WE_GET_CONCURRENCY_MODE: |
| 5879 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 5880 | *value = policy_mgr_get_concurrency_mode(hdd_ctx->psoc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5881 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5882 | hdd_debug("concurrency mode=%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5883 | break; |
| 5884 | } |
| 5885 | |
| 5886 | case WE_GET_NSS: |
| 5887 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5888 | sme_get_config_param(mac_handle, sme_config); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 5889 | status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval); |
| 5890 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 5891 | hdd_err("unable to get vht_enable2x2"); |
| 5892 | *value = (bval == 0) ? 1 : 2; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 5893 | if (policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc)) |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 5894 | *value = *value - 1; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5895 | hdd_debug("GET_NSS: Current NSS:%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5896 | break; |
| 5897 | } |
| 5898 | |
| 5899 | case WE_GET_GTX_HT_MCS: |
| 5900 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5901 | hdd_debug("GET WMI_VDEV_PARAM_GTX_HT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5902 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5903 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 5904 | GTX_CMD); |
| 5905 | break; |
| 5906 | } |
| 5907 | |
| 5908 | case WE_GET_GTX_VHT_MCS: |
| 5909 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5910 | hdd_debug("GET WMI_VDEV_PARAM_GTX_VHT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5911 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5912 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 5913 | GTX_CMD); |
| 5914 | break; |
| 5915 | } |
| 5916 | |
| 5917 | case WE_GET_GTX_USRCFG: |
| 5918 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5919 | hdd_debug("GET WMI_VDEV_PARAM_GTX_USR_CFG"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5920 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5921 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 5922 | GTX_CMD); |
| 5923 | break; |
| 5924 | } |
| 5925 | |
| 5926 | case WE_GET_GTX_THRE: |
| 5927 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5928 | hdd_debug("GET WMI_VDEV_PARAM_GTX_THRE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5929 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5930 | WMI_VDEV_PARAM_GTX_THRE, |
| 5931 | GTX_CMD); |
| 5932 | break; |
| 5933 | } |
| 5934 | |
| 5935 | case WE_GET_GTX_MARGIN: |
| 5936 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5937 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MARGIN"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5938 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5939 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 5940 | GTX_CMD); |
| 5941 | break; |
| 5942 | } |
| 5943 | |
| 5944 | case WE_GET_GTX_STEP: |
| 5945 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5946 | hdd_debug("GET WMI_VDEV_PARAM_GTX_STEP"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5947 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5948 | WMI_VDEV_PARAM_GTX_STEP, |
| 5949 | GTX_CMD); |
| 5950 | break; |
| 5951 | } |
| 5952 | |
| 5953 | case WE_GET_GTX_MINTPC: |
| 5954 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5955 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MINTPC"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5956 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5957 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 5958 | GTX_CMD); |
| 5959 | break; |
| 5960 | } |
| 5961 | |
| 5962 | case WE_GET_GTX_BWMASK: |
| 5963 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5964 | hdd_debug("GET WMI_VDEV_PARAM_GTX_BW_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5965 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5966 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 5967 | GTX_CMD); |
| 5968 | break; |
| 5969 | } |
| 5970 | |
| 5971 | case WE_GET_LDPC: |
| 5972 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5973 | ret = hdd_get_ldpc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5974 | break; |
| 5975 | } |
| 5976 | |
| 5977 | case WE_GET_TX_STBC: |
| 5978 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5979 | ret = hdd_get_tx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5980 | break; |
| 5981 | } |
| 5982 | |
| 5983 | case WE_GET_RX_STBC: |
| 5984 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5985 | ret = hdd_get_rx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5986 | break; |
| 5987 | } |
| 5988 | |
| 5989 | case WE_GET_SHORT_GI: |
| 5990 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5991 | hdd_debug("GET WMI_VDEV_PARAM_SGI"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5992 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | a5c5aad | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5993 | WMI_VDEV_PARAM_SGI, |
| 5994 | VDEV_CMD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5995 | break; |
| 5996 | } |
| 5997 | |
| 5998 | case WE_GET_RTSCTS: |
| 5999 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6000 | hdd_debug("GET WMI_VDEV_PARAM_ENABLE_RTSCTS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6001 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6002 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 6003 | VDEV_CMD); |
| 6004 | break; |
| 6005 | } |
| 6006 | |
| 6007 | case WE_GET_CHWIDTH: |
| 6008 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6009 | hdd_debug("GET WMI_VDEV_PARAM_CHWIDTH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6010 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6011 | WMI_VDEV_PARAM_CHWIDTH, |
| 6012 | VDEV_CMD); |
| 6013 | break; |
| 6014 | } |
| 6015 | |
| 6016 | case WE_GET_ANI_EN_DIS: |
| 6017 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6018 | hdd_debug("GET WMI_PDEV_PARAM_ANI_ENABLE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6019 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6020 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 6021 | PDEV_CMD); |
| 6022 | break; |
| 6023 | } |
| 6024 | |
| 6025 | case WE_GET_ANI_POLL_PERIOD: |
| 6026 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6027 | hdd_debug("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6028 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6029 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 6030 | PDEV_CMD); |
| 6031 | break; |
| 6032 | } |
| 6033 | |
| 6034 | case WE_GET_ANI_LISTEN_PERIOD: |
| 6035 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6036 | hdd_debug("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6037 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6038 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 6039 | PDEV_CMD); |
| 6040 | break; |
| 6041 | } |
| 6042 | |
| 6043 | case WE_GET_ANI_OFDM_LEVEL: |
| 6044 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6045 | hdd_debug("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6046 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6047 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 6048 | PDEV_CMD); |
| 6049 | break; |
| 6050 | } |
| 6051 | |
| 6052 | case WE_GET_ANI_CCK_LEVEL: |
| 6053 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6054 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6055 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6056 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 6057 | PDEV_CMD); |
| 6058 | break; |
| 6059 | } |
| 6060 | |
| 6061 | case WE_GET_DYNAMIC_BW: |
| 6062 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6063 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6064 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6065 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 6066 | PDEV_CMD); |
| 6067 | break; |
| 6068 | } |
| 6069 | |
| 6070 | case WE_GET_11N_RATE: |
| 6071 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6072 | hdd_debug("GET WMI_VDEV_PARAM_FIXED_RATE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6073 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6074 | WMI_VDEV_PARAM_FIXED_RATE, |
| 6075 | VDEV_CMD); |
| 6076 | break; |
| 6077 | } |
| 6078 | |
| 6079 | case WE_GET_AMPDU: |
| 6080 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6081 | hdd_debug("GET AMPDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6082 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6083 | GEN_VDEV_PARAM_AMPDU, |
| 6084 | GEN_CMD); |
| 6085 | break; |
| 6086 | } |
| 6087 | |
| 6088 | case WE_GET_AMSDU: |
| 6089 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6090 | hdd_debug("GET AMSDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6091 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6092 | GEN_VDEV_PARAM_AMSDU, |
| 6093 | GEN_CMD); |
| 6094 | break; |
| 6095 | } |
| 6096 | |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6097 | case WE_GET_ROAM_SYNCH_DELAY: |
| 6098 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6099 | hdd_debug("GET ROAM SYNCH DELAY"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6100 | *value = wma_cli_get_command(adapter->session_id, |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6101 | GEN_VDEV_ROAM_SYNCH_DELAY, |
| 6102 | GEN_CMD); |
| 6103 | break; |
| 6104 | } |
| 6105 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6106 | case WE_GET_TX_CHAINMASK: |
| 6107 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6108 | hdd_debug("GET WMI_PDEV_PARAM_TX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6109 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6110 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 6111 | PDEV_CMD); |
| 6112 | break; |
| 6113 | } |
| 6114 | |
| 6115 | case WE_GET_RX_CHAINMASK: |
| 6116 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6117 | hdd_debug("GET WMI_PDEV_PARAM_RX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6118 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6119 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 6120 | PDEV_CMD); |
| 6121 | break; |
| 6122 | } |
| 6123 | |
| 6124 | case WE_GET_TXPOW_2G: |
| 6125 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6126 | uint8_t txpow2g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6127 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6128 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6129 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6130 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 6131 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6132 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow2g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6133 | hdd_debug("2G tx_power %d", txpow2g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6134 | break; |
| 6135 | } |
| 6136 | |
| 6137 | case WE_GET_TXPOW_5G: |
| 6138 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6139 | uint8_t txpow5g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6140 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6141 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6142 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6143 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 6144 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6145 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow5g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6146 | hdd_debug("5G tx_power %d", txpow5g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6147 | break; |
| 6148 | } |
| 6149 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6150 | case WE_GET_PPS_PAID_MATCH: |
| 6151 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6152 | hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6153 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6154 | WMI_VDEV_PPS_PAID_MATCH, |
| 6155 | PPS_CMD); |
| 6156 | break; |
| 6157 | } |
| 6158 | |
| 6159 | case WE_GET_PPS_GID_MATCH: |
| 6160 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6161 | hdd_debug("GET WMI_VDEV_PPS_GID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6162 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6163 | WMI_VDEV_PPS_GID_MATCH, |
| 6164 | PPS_CMD); |
| 6165 | break; |
| 6166 | } |
| 6167 | |
| 6168 | case WE_GET_PPS_EARLY_TIM_CLEAR: |
| 6169 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6170 | hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6171 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6172 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 6173 | PPS_CMD); |
| 6174 | break; |
| 6175 | } |
| 6176 | |
| 6177 | case WE_GET_PPS_EARLY_DTIM_CLEAR: |
| 6178 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6179 | hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6180 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6181 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 6182 | PPS_CMD); |
| 6183 | break; |
| 6184 | } |
| 6185 | |
| 6186 | case WE_GET_PPS_EOF_PAD_DELIM: |
| 6187 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6188 | hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6189 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6190 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 6191 | PPS_CMD); |
| 6192 | break; |
| 6193 | } |
| 6194 | |
| 6195 | case WE_GET_PPS_MACADDR_MISMATCH: |
| 6196 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6197 | hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6198 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6199 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 6200 | PPS_CMD); |
| 6201 | break; |
| 6202 | } |
| 6203 | |
| 6204 | case WE_GET_PPS_DELIM_CRC_FAIL: |
| 6205 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6206 | hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6207 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6208 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 6209 | PPS_CMD); |
| 6210 | break; |
| 6211 | } |
| 6212 | |
| 6213 | case WE_GET_PPS_GID_NSTS_ZERO: |
| 6214 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6215 | hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6216 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6217 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 6218 | PPS_CMD); |
| 6219 | break; |
| 6220 | } |
| 6221 | |
| 6222 | case WE_GET_PPS_RSSI_CHECK: |
| 6223 | { |
| 6224 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6225 | hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6226 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6227 | WMI_VDEV_PPS_RSSI_CHECK, |
| 6228 | PPS_CMD); |
| 6229 | break; |
| 6230 | } |
| 6231 | |
| 6232 | case WE_GET_QPOWER_MAX_PSPOLL_COUNT: |
| 6233 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6234 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6235 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6236 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 6237 | QPOWER_CMD); |
| 6238 | break; |
| 6239 | } |
| 6240 | |
| 6241 | case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 6242 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6243 | hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6244 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6245 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 6246 | QPOWER_CMD); |
| 6247 | break; |
| 6248 | } |
| 6249 | |
| 6250 | case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 6251 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6252 | hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6253 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6254 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 6255 | QPOWER_CMD); |
| 6256 | break; |
| 6257 | } |
| 6258 | |
| 6259 | case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 6260 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6261 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6262 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6263 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 6264 | QPOWER_CMD); |
| 6265 | break; |
| 6266 | } |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6267 | case WE_CAP_TSF: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6268 | ret = hdd_capture_tsf(adapter, (uint32_t *)value, 1); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6269 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6270 | case WE_GET_TEMPERATURE: |
| 6271 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6272 | hdd_debug("WE_GET_TEMPERATURE"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6273 | ret = wlan_hdd_get_temperature(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6274 | break; |
| 6275 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6276 | case WE_GET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6277 | hdd_debug("GET WMI_VDEV_PARAM_HE_DCM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6278 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6279 | WMI_VDEV_PARAM_HE_DCM, |
| 6280 | VDEV_CMD); |
| 6281 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6282 | case WE_GET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6283 | hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6284 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6285 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 6286 | VDEV_CMD); |
| 6287 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6288 | default: |
| 6289 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6290 | hdd_err("Invalid IOCTL get_value command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6291 | value[0]); |
| 6292 | break; |
| 6293 | } |
| 6294 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6295 | hdd_exit(); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 6296 | qdf_mem_free(sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6297 | return ret; |
| 6298 | } |
| 6299 | |
| 6300 | static int iw_setnone_getint(struct net_device *dev, |
| 6301 | struct iw_request_info *info, |
| 6302 | union iwreq_data *wrqu, char *extra) |
| 6303 | { |
| 6304 | int ret; |
| 6305 | |
| 6306 | cds_ssr_protect(__func__); |
| 6307 | ret = __iw_setnone_getint(dev, info, wrqu, extra); |
| 6308 | cds_ssr_unprotect(__func__); |
| 6309 | |
| 6310 | return ret; |
| 6311 | } |
| 6312 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6313 | static int hdd_set_fwtest(int argc, int cmd, int value) |
| 6314 | { |
| 6315 | struct set_fwtest_params *fw_test; |
| 6316 | |
| 6317 | /* check for max number of arguments */ |
| 6318 | if (argc > (WMA_MAX_NUM_ARGS) || |
| 6319 | argc != HDD_FWTEST_PARAMS) { |
| 6320 | hdd_err("Too Many args %d", argc); |
| 6321 | return -EINVAL; |
| 6322 | } |
| 6323 | /* |
| 6324 | * check if number of arguments are 3 then, check |
| 6325 | * then set the default value for sounding interval. |
| 6326 | */ |
| 6327 | if (HDD_FWTEST_PARAMS == argc) { |
| 6328 | if (HDD_FWTEST_SU_PARAM_ID == cmd && 0 == value) |
| 6329 | value = HDD_FWTEST_SU_DEFAULT_VALUE; |
| 6330 | if (HDD_FWTEST_MU_PARAM_ID == cmd && 0 == value) |
| 6331 | value = HDD_FWTEST_MU_DEFAULT_VALUE; |
| 6332 | } |
| 6333 | /* check sounding interval value should not exceed to max */ |
| 6334 | if (value > HDD_FWTEST_MAX_VALUE) { |
| 6335 | hdd_err("Invalid arguments value should not exceed max: %d", |
| 6336 | value); |
| 6337 | return -EINVAL; |
| 6338 | } |
| 6339 | fw_test = qdf_mem_malloc(sizeof(*fw_test)); |
| 6340 | if (NULL == fw_test) { |
| 6341 | hdd_err("qdf_mem_malloc failed for fw_test"); |
| 6342 | return -ENOMEM; |
| 6343 | } |
| 6344 | fw_test->arg = cmd; |
| 6345 | fw_test->value = value; |
| 6346 | if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) { |
| 6347 | qdf_mem_free(fw_test); |
| 6348 | hdd_err("Not able to post FW_TEST_CMD message to WMA"); |
| 6349 | return -EINVAL; |
| 6350 | } |
| 6351 | return 0; |
| 6352 | } |
| 6353 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6354 | /** |
| 6355 | * iw_set_three_ints_getnone() - Generic "set 3 params" private ioctl handler |
| 6356 | * @dev: device upon which the ioctl was received |
| 6357 | * @info: ioctl request information |
| 6358 | * @wrqu: ioctl request data |
| 6359 | * @extra: ioctl extra data |
| 6360 | * |
| 6361 | * Return: 0 on success, non-zero on error |
| 6362 | */ |
| 6363 | static int __iw_set_three_ints_getnone(struct net_device *dev, |
| 6364 | struct iw_request_info *info, |
| 6365 | union iwreq_data *wrqu, char *extra) |
| 6366 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6367 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6368 | int *value = (int *)extra; |
| 6369 | int sub_cmd = value[0]; |
| 6370 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6371 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6372 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6373 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6374 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6375 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6376 | |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6377 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6378 | hdd_err("permission check failed"); |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6379 | return -EPERM; |
| 6380 | } |
| 6381 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6382 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6383 | if (0 != ret) |
| 6384 | return ret; |
| 6385 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6386 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6387 | if (0 != ret) |
| 6388 | return ret; |
| 6389 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6390 | switch (sub_cmd) { |
| 6391 | |
| 6392 | case WE_SET_WLAN_DBG: |
Dustin Brown | 36e2e5c | 2017-05-16 15:41:37 -0700 | [diff] [blame] | 6393 | qdf_print_set_category_verbose(qdf_get_pidx(), value[1], |
| 6394 | value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6395 | break; |
| 6396 | case WE_SET_DP_TRACE: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6397 | qdf_dp_trace_set_value(value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6398 | break; |
Himanshu Agarwal | ad4c039 | 2018-05-08 16:53:36 +0530 | [diff] [blame] | 6399 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6400 | case WE_SET_DUAL_MAC_SCAN_CONFIG: |
| 6401 | hdd_debug("Ioctl to set dual mac scan config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6402 | status = |
| 6403 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 6404 | &dual_mac_feature); |
| 6405 | if (status != QDF_STATUS_SUCCESS) |
| 6406 | hdd_err("can't get dual mac feature val, use def"); |
| 6407 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6408 | hdd_err("Dual mac feature is disabled from INI"); |
| 6409 | return -EPERM; |
| 6410 | } |
| 6411 | hdd_debug("%d %d %d", value[1], value[2], value[3]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6412 | policy_mgr_set_dual_mac_scan_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6413 | value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6414 | break; |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6415 | case WE_SET_FW_TEST: |
| 6416 | { |
| 6417 | ret = hdd_set_fwtest(value[1], value[2], value[3]); |
| 6418 | if (ret) { |
| 6419 | hdd_err("Not able to set fwtest %d", ret); |
| 6420 | return ret; |
| 6421 | } |
| 6422 | } |
| 6423 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6424 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6425 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6426 | break; |
| 6427 | |
| 6428 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6429 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6430 | return ret; |
| 6431 | } |
| 6432 | |
| 6433 | int iw_set_three_ints_getnone(struct net_device *dev, |
| 6434 | struct iw_request_info *info, |
| 6435 | union iwreq_data *wrqu, char *extra) |
| 6436 | { |
| 6437 | int ret; |
| 6438 | |
| 6439 | cds_ssr_protect(__func__); |
| 6440 | ret = __iw_set_three_ints_getnone(dev, info, wrqu, extra); |
| 6441 | cds_ssr_unprotect(__func__); |
| 6442 | |
| 6443 | return ret; |
| 6444 | } |
| 6445 | |
| 6446 | /** |
| 6447 | * hdd_connection_state_string() - Get connection state string |
| 6448 | * @connection_state: enum to be converted to a string |
| 6449 | * |
| 6450 | * Return: the string equivalent of @connection_state |
| 6451 | */ |
| 6452 | static const char * |
| 6453 | hdd_connection_state_string(eConnectionState connection_state) |
| 6454 | { |
| 6455 | switch (connection_state) { |
| 6456 | CASE_RETURN_STRING(eConnectionState_NotConnected); |
| 6457 | CASE_RETURN_STRING(eConnectionState_Connecting); |
| 6458 | CASE_RETURN_STRING(eConnectionState_Associated); |
| 6459 | CASE_RETURN_STRING(eConnectionState_IbssDisconnected); |
| 6460 | CASE_RETURN_STRING(eConnectionState_IbssConnected); |
| 6461 | CASE_RETURN_STRING(eConnectionState_Disconnecting); |
| 6462 | default: |
| 6463 | return "UNKNOWN"; |
| 6464 | } |
| 6465 | } |
| 6466 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6467 | #if defined(FEATURE_OEM_DATA_SUPPORT) |
| 6468 | /** |
| 6469 | * iw_get_oem_data_cap_wrapper() - wrapper function to call legacy or new |
| 6470 | * wifi_pos api to get oem data caps |
| 6471 | * @dev: net device upon which the request was received |
| 6472 | * @info: ioctl request information |
| 6473 | * @wrqu: ioctl request data |
| 6474 | * @extra: ioctl data payload |
| 6475 | * |
| 6476 | * Return: 0 for success, negative errno value on failure |
| 6477 | */ |
| 6478 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6479 | struct iw_request_info *info, |
| 6480 | union iwreq_data *wrqu, char *extra) |
| 6481 | { |
| 6482 | return iw_get_oem_data_cap(dev, info, wrqu, extra); |
| 6483 | } |
| 6484 | #elif defined(WIFI_POS_CONVERGED) |
| 6485 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6486 | struct iw_request_info *info, |
| 6487 | union iwreq_data *wrqu, char *extra) |
| 6488 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6489 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6490 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6491 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6492 | return os_if_wifi_pos_populate_caps(hdd_ctx->psoc, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6493 | (struct wifi_pos_driver_caps *)extra); |
| 6494 | } |
| 6495 | #else |
| 6496 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6497 | struct iw_request_info *info, |
| 6498 | union iwreq_data *wrqu, char *extra) |
| 6499 | { |
| 6500 | return -ENOTSUPP; |
| 6501 | } |
| 6502 | #endif |
| 6503 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 6504 | #ifdef WLAN_UNIT_TEST |
| 6505 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6506 | struct hdd_adapter *adapter, |
| 6507 | char *extra) |
| 6508 | { |
| 6509 | QDF_STATUS status; |
| 6510 | |
| 6511 | status = sme_get_sta_cxn_info(hdd_ctx->mac_handle, adapter->session_id, |
| 6512 | extra, WE_MAX_STR_LEN); |
| 6513 | if (status != QDF_STATUS_SUCCESS) |
| 6514 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6515 | "\nNo active connection"); |
| 6516 | |
| 6517 | return 0; |
| 6518 | } |
| 6519 | #else |
| 6520 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6521 | struct hdd_adapter *adapter, |
| 6522 | char *extra) |
| 6523 | { |
| 6524 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6525 | "\nNot supported"); |
| 6526 | return -ENOTSUPP; |
| 6527 | } |
| 6528 | #endif |
| 6529 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6530 | /** |
| 6531 | * iw_get_char_setnone() - Generic "get string" private ioctl handler |
| 6532 | * @dev: device upon which the ioctl was received |
| 6533 | * @info: ioctl request information |
| 6534 | * @wrqu: ioctl request data |
| 6535 | * @extra: ioctl extra data |
| 6536 | * |
| 6537 | * Return: 0 on success, non-zero on error |
| 6538 | */ |
| 6539 | static int __iw_get_char_setnone(struct net_device *dev, |
| 6540 | struct iw_request_info *info, |
| 6541 | union iwreq_data *wrqu, char *extra) |
| 6542 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6543 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6544 | int sub_cmd = wrqu->data.flags; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6545 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6546 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6547 | int ret; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6548 | QDF_STATUS status; |
| 6549 | uint8_t value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6550 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6551 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6552 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6553 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6554 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6555 | if (0 != ret) |
| 6556 | return ret; |
| 6557 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6558 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6559 | if (0 != ret) |
| 6560 | return ret; |
| 6561 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6562 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6563 | switch (sub_cmd) { |
| 6564 | case WE_WLAN_VERSION: |
| 6565 | { |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 6566 | wrqu->data.length = hdd_wlan_get_version(hdd_ctx, |
| 6567 | WE_MAX_STR_LEN, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6568 | break; |
| 6569 | } |
| 6570 | |
| 6571 | case WE_GET_STATS: |
| 6572 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6573 | hdd_wlan_get_stats(adapter, &(wrqu->data.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6574 | extra, WE_MAX_STR_LEN); |
| 6575 | break; |
| 6576 | } |
| 6577 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6578 | case WE_GET_SUSPEND_RESUME_STATS: |
| 6579 | { |
| 6580 | ret = wlan_hdd_write_suspend_resume_stats(hdd_ctx, extra, |
| 6581 | WE_MAX_STR_LEN); |
| 6582 | if (ret >= 0) { |
| 6583 | wrqu->data.length = ret; |
| 6584 | ret = 0; |
| 6585 | } |
| 6586 | |
| 6587 | break; |
| 6588 | } |
| 6589 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6590 | case WE_LIST_FW_PROFILE: |
| 6591 | hdd_wlan_list_fw_profile(&(wrqu->data.length), |
| 6592 | extra, WE_MAX_STR_LEN); |
| 6593 | break; |
| 6594 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6595 | /* The case prints the current state of the HDD, SME, CSR, PE, |
| 6596 | * TL it can be extended for WDI Global State as well. And |
| 6597 | * currently it only checks P2P_CLIENT adapter. P2P_DEVICE |
| 6598 | * and P2P_GO have not been added as of now. |
| 6599 | */ |
| 6600 | case WE_GET_STATES: |
| 6601 | { |
| 6602 | int buf = 0, len = 0; |
| 6603 | int adapter_num = 0; |
| 6604 | int count = 0, check = 1; |
| 6605 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6606 | struct hdd_station_ctx *sta_ctx = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6607 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6608 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6609 | struct hdd_adapter *useAdapter = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6610 | |
| 6611 | /* Print wlan0 or p2p0 states based on the adapter_num |
| 6612 | * by using the correct adapter |
| 6613 | */ |
| 6614 | while (adapter_num < 2) { |
| 6615 | if (WLAN_ADAPTER == adapter_num) { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6616 | useAdapter = adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6617 | buf = |
| 6618 | scnprintf(extra + len, |
| 6619 | WE_MAX_STR_LEN - len, |
| 6620 | "\n\n wlan0 States:-"); |
| 6621 | len += buf; |
| 6622 | } else if (P2P_ADAPTER == adapter_num) { |
| 6623 | buf = |
| 6624 | scnprintf(extra + len, |
| 6625 | WE_MAX_STR_LEN - len, |
| 6626 | "\n\n p2p0 States:-"); |
| 6627 | len += buf; |
| 6628 | |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6629 | if (!hdd_ctx) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6630 | buf = |
| 6631 | scnprintf(extra + len, |
| 6632 | WE_MAX_STR_LEN - |
| 6633 | len, |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6634 | "\n hdd_ctx is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6635 | len += buf; |
| 6636 | break; |
| 6637 | } |
| 6638 | |
| 6639 | /* Printing p2p0 states only in the |
| 6640 | * case when the device is configured |
| 6641 | * as a p2p_client |
| 6642 | */ |
| 6643 | useAdapter = |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6644 | hdd_get_adapter(hdd_ctx, |
Krunal Soni | f07bb38 | 2016-03-10 13:02:11 -0800 | [diff] [blame] | 6645 | QDF_P2P_CLIENT_MODE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6646 | if (!useAdapter) { |
| 6647 | buf = |
| 6648 | scnprintf(extra + len, |
| 6649 | WE_MAX_STR_LEN - |
| 6650 | len, |
| 6651 | "\n Device not configured as P2P_CLIENT."); |
| 6652 | len += buf; |
| 6653 | break; |
| 6654 | } |
| 6655 | } |
| 6656 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6657 | if (!mac_handle) { |
Jeff Johnson | 2a8a64f | 2018-04-28 12:31:36 -0700 | [diff] [blame] | 6658 | buf = scnprintf(extra + len, |
| 6659 | WE_MAX_STR_LEN - len, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6660 | "\n mac_handle is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6661 | len += buf; |
| 6662 | break; |
| 6663 | } |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6664 | sta_ctx = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6665 | WLAN_HDD_GET_STATION_CTX_PTR(useAdapter); |
| 6666 | |
| 6667 | |
| 6668 | buf = |
| 6669 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
| 6670 | "\n HDD Conn State - %s " |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6671 | "\n\n SME State:" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6672 | "\n Neighbour Roam State - %s" |
| 6673 | "\n CSR State - %s" |
| 6674 | "\n CSR Substate - %s", |
| 6675 | hdd_connection_state_string |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6676 | (sta_ctx->conn_info.connState), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6677 | mac_trace_get_neighbour_roam_state |
| 6678 | (sme_get_neighbor_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6679 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6680 | mac_trace_getcsr_roam_state |
| 6681 | (sme_get_current_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6682 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6683 | mac_trace_getcsr_roam_sub_state |
| 6684 | (sme_get_current_roam_sub_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6685 | (mac_handle, useAdapter->session_id)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6686 | ); |
| 6687 | len += buf; |
| 6688 | adapter_num++; |
| 6689 | } |
| 6690 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6691 | if (mac_handle) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6692 | /* Printing Lim State starting with global lim states */ |
| 6693 | buf = |
| 6694 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6695 | "\n\n LIM STATES:-" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6696 | "\n Global Sme State - %s " |
| 6697 | "\n Global mlm State - %s " "\n", |
| 6698 | mac_trace_get_lim_sme_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6699 | (sme_get_lim_sme_state(mac_handle)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6700 | mac_trace_get_lim_mlm_state |
Jeff Johnson | 71d465a | 2018-12-05 11:13:30 -0800 | [diff] [blame] | 6701 | (sme_get_lim_mlm_state(mac_handle)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6702 | ); |
| 6703 | len += buf; |
| 6704 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6705 | while (check < 3 && count < 255) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6706 | if (sme_is_lim_session_valid(mac_handle, count)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6707 | buf = |
| 6708 | scnprintf(extra + len, |
| 6709 | WE_MAX_STR_LEN - |
| 6710 | len, |
| 6711 | "\n Lim Valid Session %d:-" |
| 6712 | "\n PE Sme State - %s " |
| 6713 | "\n PE Mlm State - %s " |
| 6714 | "\n", check, |
| 6715 | mac_trace_get_lim_sme_state |
| 6716 | (sme_get_lim_sme_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6717 | (mac_handle, count)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6718 | mac_trace_get_lim_mlm_state |
| 6719 | (sme_get_lim_mlm_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6720 | (mac_handle, count)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6721 | ); |
| 6722 | |
| 6723 | len += buf; |
| 6724 | check++; |
| 6725 | } |
| 6726 | count++; |
| 6727 | } |
| 6728 | } |
| 6729 | |
| 6730 | wrqu->data.length = strlen(extra) + 1; |
| 6731 | break; |
| 6732 | } |
| 6733 | |
| 6734 | case WE_GET_CFG: |
| 6735 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6736 | hdd_debug("Printing CLD global INI Config"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6737 | hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(adapter), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6738 | extra, |
| 6739 | QCSAP_IOCTL_MAX_STR_LEN); |
| 6740 | wrqu->data.length = strlen(extra) + 1; |
| 6741 | break; |
| 6742 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6743 | case WE_GET_RSSI: |
| 6744 | { |
| 6745 | int8_t s7Rssi = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6746 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6747 | wlan_hdd_get_rssi(adapter, &s7Rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6748 | snprintf(extra, WE_MAX_STR_LEN, "rssi=%d", s7Rssi); |
| 6749 | wrqu->data.length = strlen(extra) + 1; |
| 6750 | break; |
| 6751 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6752 | |
| 6753 | case WE_GET_WMM_STATUS: |
| 6754 | { |
| 6755 | snprintf(extra, WE_MAX_STR_LEN, |
| 6756 | "\nDir: 0=up, 1=down, 3=both\n" |
| 6757 | "|------------------------|\n" |
| 6758 | "|AC | ACM |Admitted| Dir |\n" |
| 6759 | "|------------------------|\n" |
| 6760 | "|VO | %d | %3s | %d |\n" |
| 6761 | "|VI | %d | %3s | %d |\n" |
| 6762 | "|BE | %d | %3s | %d |\n" |
| 6763 | "|BK | %d | %3s | %d |\n" |
| 6764 | "|------------------------|\n", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6765 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6766 | wmmAcStatus[SME_AC_VO].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6767 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6768 | wmmAcStatus[SME_AC_VO]. |
| 6769 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6770 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6771 | wmmAcStatus[SME_AC_VO].wmmAcTspecInfo. |
| 6772 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6773 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6774 | wmmAcStatus[SME_AC_VI].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6775 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6776 | wmmAcStatus[SME_AC_VI]. |
| 6777 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6778 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6779 | wmmAcStatus[SME_AC_VI].wmmAcTspecInfo. |
| 6780 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6781 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6782 | wmmAcStatus[SME_AC_BE].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6783 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6784 | wmmAcStatus[SME_AC_BE]. |
| 6785 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6786 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6787 | wmmAcStatus[SME_AC_BE].wmmAcTspecInfo. |
| 6788 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6789 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6790 | wmmAcStatus[SME_AC_BK].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6791 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6792 | wmmAcStatus[SME_AC_BK]. |
| 6793 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6794 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6795 | wmmAcStatus[SME_AC_BK].wmmAcTspecInfo. |
| 6796 | ts_info.direction); |
| 6797 | |
| 6798 | wrqu->data.length = strlen(extra) + 1; |
| 6799 | break; |
| 6800 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 6801 | |
| 6802 | case WE_GET_BA_AGEING_TIMEOUT: |
| 6803 | { |
| 6804 | uint8_t ac_cat = 4; |
Yuanyuan Liu | 755671e | 2019-01-16 16:47:19 -0800 | [diff] [blame] | 6805 | uint32_t duration[WME_AC_NUM], i; |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 6806 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 6807 | |
| 6808 | if (!soc) { |
| 6809 | hdd_err("Invalid SOC handle"); |
| 6810 | break; |
| 6811 | } |
| 6812 | |
| 6813 | for (i = 0; i < ac_cat; i++) |
| 6814 | cdp_get_ba_timeout(soc, i, &duration[i]); |
| 6815 | |
| 6816 | snprintf(extra, WE_MAX_STR_LEN, |
| 6817 | "\n|------------------------------|\n" |
| 6818 | "|AC | BA aging timeout duration |\n" |
| 6819 | "|--------------------------------|\n" |
| 6820 | "|VO | %d |\n" |
| 6821 | "|VI | %d |\n" |
| 6822 | "|BE | %d |\n" |
| 6823 | "|BK | %d |\n" |
| 6824 | "|--------------------------------|\n", |
| 6825 | duration[3], duration[2], duration[1], duration[0]); |
| 6826 | |
| 6827 | wrqu->data.length = strlen(extra) + 1; |
| 6828 | break; |
| 6829 | } |
| 6830 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6831 | case WE_GET_CHANNEL_LIST: |
| 6832 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6833 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6834 | uint8_t i, len; |
| 6835 | char *buf; |
Wu Gao | aa15514 | 2019-01-14 15:09:26 +0800 | [diff] [blame] | 6836 | uint8_t ubuf[CFG_COUNTRY_CODE_LEN]; |
| 6837 | uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; |
Srinivas Girigowda | c231df6 | 2017-03-24 18:27:57 -0700 | [diff] [blame] | 6838 | struct channel_list_info channel_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6839 | |
| 6840 | memset(&channel_list, 0, sizeof(channel_list)); |
Agrawal Ashish | 6c9bca7 | 2016-09-04 13:37:59 +0530 | [diff] [blame] | 6841 | status = iw_get_channel_list(dev, info, wrqu, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6842 | (char *)&channel_list); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6843 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6844 | hdd_err("GetChannelList Failed!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6845 | return -EINVAL; |
| 6846 | } |
| 6847 | buf = extra; |
| 6848 | /* |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 6849 | * Maximum channels = CFG_VALID_CHANNEL_LIST_LEN. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6850 | * Maximum buffer needed = 5 * number of channels. |
| 6851 | * Check ifsufficient buffer is available and then |
| 6852 | * proceed to fill the buffer. |
| 6853 | */ |
| 6854 | if (WE_MAX_STR_LEN < |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 6855 | (5 * CFG_VALID_CHANNEL_LIST_LEN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6856 | hdd_err("Insufficient Buffer to populate channel list"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6857 | return -EINVAL; |
| 6858 | } |
| 6859 | len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", |
| 6860 | channel_list.num_channels); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6861 | if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, |
| 6862 | ubuf, |
| 6863 | &ubuf_len)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6864 | /* Printing Country code in getChannelList */ |
| 6865 | for (i = 0; i < (ubuf_len - 1); i++) |
| 6866 | len += scnprintf(buf + len, |
| 6867 | WE_MAX_STR_LEN - len, |
| 6868 | "%c", ubuf[i]); |
| 6869 | } |
| 6870 | for (i = 0; i < channel_list.num_channels; i++) { |
| 6871 | len += |
| 6872 | scnprintf(buf + len, WE_MAX_STR_LEN - len, |
| 6873 | " %u", channel_list.channels[i]); |
| 6874 | } |
| 6875 | wrqu->data.length = strlen(extra) + 1; |
| 6876 | |
| 6877 | break; |
| 6878 | } |
| 6879 | #ifdef FEATURE_WLAN_TDLS |
| 6880 | case WE_GET_TDLS_PEERS: |
| 6881 | { |
| 6882 | wrqu->data.length = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6883 | wlan_hdd_tdls_get_all_peers(adapter, extra, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6884 | WE_MAX_STR_LEN) + 1; |
| 6885 | break; |
| 6886 | } |
| 6887 | #endif |
| 6888 | #ifdef WLAN_FEATURE_11W |
| 6889 | case WE_GET_11W_INFO: |
| 6890 | { |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6891 | struct csr_roam_profile *roam_profile = |
| 6892 | hdd_roam_profile(adapter); |
| 6893 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6894 | hdd_debug("WE_GET_11W_ENABLED = %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6895 | roam_profile->MFPEnabled); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6896 | |
| 6897 | snprintf(extra, WE_MAX_STR_LEN, |
| 6898 | "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d" |
| 6899 | "\n Number of Unprotected Disassocs %d" |
| 6900 | "\n Number of Unprotected Deauths %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6901 | roam_profile->BSSIDs.bssid->bytes[0], |
| 6902 | roam_profile->BSSIDs.bssid->bytes[1], |
| 6903 | roam_profile->BSSIDs.bssid->bytes[2], |
| 6904 | roam_profile->BSSIDs.bssid->bytes[3], |
| 6905 | roam_profile->BSSIDs.bssid->bytes[4], |
| 6906 | roam_profile->BSSIDs.bssid->bytes[5], |
| 6907 | roam_profile->MFPEnabled, |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 6908 | adapter->hdd_stats.hdd_pmf_stats. |
| 6909 | num_unprot_disassoc_rx, |
| 6910 | adapter->hdd_stats.hdd_pmf_stats. |
| 6911 | num_unprot_deauth_rx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6912 | |
| 6913 | wrqu->data.length = strlen(extra) + 1; |
| 6914 | break; |
| 6915 | } |
| 6916 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6917 | case WE_GET_IBSS_STA_INFO: |
| 6918 | { |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6919 | struct hdd_station_ctx *sta_ctx = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6920 | WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6921 | int idx = 0; |
| 6922 | int length = 0, buf = 0; |
| 6923 | |
Naveen Rawat | c45d162 | 2016-07-05 12:20:09 -0700 | [diff] [blame] | 6924 | for (idx = 0; idx < MAX_PEERS; idx++) { |
Naveen Rawat | ac027cb | 2017-04-27 15:02:42 -0700 | [diff] [blame] | 6925 | if (HDD_WLAN_INVALID_STA_ID != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6926 | sta_ctx->conn_info.staId[idx]) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6927 | buf = snprintf |
| 6928 | ((extra + length), |
| 6929 | WE_MAX_STR_LEN - length, |
| 6930 | "\n%d .%02x:%02x:%02x:%02x:%02x:%02x\n", |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6931 | sta_ctx->conn_info.staId[idx], |
| 6932 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6933 | peerMacAddress[idx].bytes[0], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6934 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6935 | peerMacAddress[idx].bytes[1], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6936 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6937 | peerMacAddress[idx].bytes[2], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6938 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6939 | peerMacAddress[idx].bytes[3], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6940 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6941 | peerMacAddress[idx].bytes[4], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6942 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6943 | peerMacAddress[idx].bytes[5] |
| 6944 | ); |
| 6945 | length += buf; |
| 6946 | } |
| 6947 | } |
| 6948 | wrqu->data.length = strlen(extra) + 1; |
| 6949 | break; |
| 6950 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6951 | case WE_GET_PHYMODE: |
| 6952 | { |
| 6953 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6954 | struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6955 | eCsrPhyMode phymode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6956 | enum band_info currBand; |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6957 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6958 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6959 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 6960 | if (!sme_config) { |
| 6961 | hdd_err("Out of memory"); |
| 6962 | ret = -ENOMEM; |
| 6963 | break; |
| 6964 | } |
| 6965 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6966 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6967 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6968 | sme_config->csrConfig.channelBondingMode24GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6969 | ch_bond24 = true; |
| 6970 | |
| 6971 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6972 | sme_config->csrConfig.channelBondingMode5GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6973 | ch_bond5g = true; |
| 6974 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6975 | qdf_mem_free(sme_config); |
| 6976 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6977 | phymode = sme_get_phy_mode(mac_handle); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6978 | if ((QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6979 | sme_get_freq_band(mac_handle, &currBand))) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6980 | hdd_err("Failed to get current band config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6981 | return -EIO; |
| 6982 | } |
| 6983 | |
| 6984 | switch (phymode) { |
| 6985 | case eCSR_DOT11_MODE_AUTO: |
| 6986 | snprintf(extra, WE_MAX_STR_LEN, "AUTO MODE"); |
| 6987 | break; |
| 6988 | case eCSR_DOT11_MODE_11n: |
| 6989 | case eCSR_DOT11_MODE_11n_ONLY: |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6990 | if (currBand == BAND_2G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6991 | if (ch_bond24) |
| 6992 | snprintf(extra, WE_MAX_STR_LEN, |
| 6993 | "11NGHT40"); |
| 6994 | else |
| 6995 | snprintf(extra, WE_MAX_STR_LEN, |
| 6996 | "11NGHT20"); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6997 | } else if (currBand == BAND_5G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6998 | if (ch_bond5g) |
| 6999 | snprintf(extra, WE_MAX_STR_LEN, |
| 7000 | "11NAHT40"); |
| 7001 | else |
| 7002 | snprintf(extra, WE_MAX_STR_LEN, |
| 7003 | "11NAHT20"); |
| 7004 | } else { |
| 7005 | snprintf(extra, WE_MAX_STR_LEN, "11N"); |
| 7006 | } |
| 7007 | break; |
| 7008 | case eCSR_DOT11_MODE_abg: |
| 7009 | snprintf(extra, WE_MAX_STR_LEN, "11ABG"); |
| 7010 | break; |
| 7011 | case eCSR_DOT11_MODE_11a: |
| 7012 | snprintf(extra, WE_MAX_STR_LEN, "11A"); |
| 7013 | break; |
| 7014 | case eCSR_DOT11_MODE_11b: |
| 7015 | case eCSR_DOT11_MODE_11b_ONLY: |
| 7016 | snprintf(extra, WE_MAX_STR_LEN, "11B"); |
| 7017 | break; |
| 7018 | case eCSR_DOT11_MODE_11g: |
| 7019 | case eCSR_DOT11_MODE_11g_ONLY: |
| 7020 | snprintf(extra, WE_MAX_STR_LEN, "11G"); |
| 7021 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7022 | case eCSR_DOT11_MODE_11ac: |
| 7023 | case eCSR_DOT11_MODE_11ac_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7024 | status = |
| 7025 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7026 | &value); |
| 7027 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7028 | hdd_err("Failed to set channel_width"); |
| 7029 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7030 | snprintf(extra, WE_MAX_STR_LEN, |
| 7031 | "11ACVHT20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7032 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7033 | snprintf(extra, WE_MAX_STR_LEN, |
| 7034 | "11ACVHT40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7035 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7036 | snprintf(extra, WE_MAX_STR_LEN, |
| 7037 | "11ACVHT80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7038 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7039 | snprintf(extra, WE_MAX_STR_LEN, |
| 7040 | "11ACVHT160"); |
| 7041 | break; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7042 | case eCSR_DOT11_MODE_11ax: |
| 7043 | case eCSR_DOT11_MODE_11ax_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7044 | status = |
| 7045 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7046 | &value); |
| 7047 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7048 | hdd_err("Failed to set channel_width"); |
| 7049 | |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7050 | /* currently using vhtChannelWidth */ |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7051 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7052 | snprintf(extra, WE_MAX_STR_LEN, |
| 7053 | "11AX_HE_20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7054 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7055 | snprintf(extra, WE_MAX_STR_LEN, |
| 7056 | "11AX_HE_40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7057 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7058 | snprintf(extra, WE_MAX_STR_LEN, |
| 7059 | "11AX_HE_80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7060 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7061 | snprintf(extra, WE_MAX_STR_LEN, |
| 7062 | "11AX_HE_160"); |
| 7063 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7064 | } |
| 7065 | |
| 7066 | wrqu->data.length = strlen(extra) + 1; |
| 7067 | break; |
| 7068 | } |
| 7069 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7070 | case WE_GET_OEM_DATA_CAP: |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 7071 | return iw_get_oem_data_cap_wrapper(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7072 | case WE_GET_SNR: |
| 7073 | { |
| 7074 | int8_t s7snr = 0; |
| 7075 | int status = 0; |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7076 | struct hdd_context *hdd_ctx; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7077 | struct hdd_station_ctx *sta_ctx; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7078 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7079 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7080 | status = wlan_hdd_validate_context(hdd_ctx); |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7081 | if (status) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7082 | return status; |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7083 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7084 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7085 | if (0 == hdd_ctx->config->fEnableSNRMonitoring || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7086 | eConnectionState_Associated != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7087 | sta_ctx->conn_info.connState) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7088 | hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d", |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7089 | hdd_ctx->config->fEnableSNRMonitoring, |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7090 | sta_ctx->conn_info.connState); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7091 | return -ENONET; |
| 7092 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7093 | wlan_hdd_get_snr(adapter, &s7snr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7094 | snprintf(extra, WE_MAX_STR_LEN, "snr=%d", s7snr); |
| 7095 | wrqu->data.length = strlen(extra) + 1; |
| 7096 | break; |
| 7097 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7098 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 7099 | case WE_GET_STA_CXN_INFO: |
| 7100 | ret = hdd_get_sta_cxn_info(hdd_ctx, adapter, extra); |
| 7101 | wrqu->data.length = strlen(extra) + 1; |
| 7102 | break; |
| 7103 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7104 | default: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7105 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7106 | break; |
| 7107 | } |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7108 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7109 | hdd_exit(); |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7110 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7111 | } |
| 7112 | |
| 7113 | static int iw_get_char_setnone(struct net_device *dev, |
| 7114 | struct iw_request_info *info, |
| 7115 | union iwreq_data *wrqu, char *extra) |
| 7116 | { |
| 7117 | int ret; |
| 7118 | |
| 7119 | cds_ssr_protect(__func__); |
| 7120 | ret = __iw_get_char_setnone(dev, info, wrqu, extra); |
| 7121 | cds_ssr_unprotect(__func__); |
| 7122 | |
| 7123 | return ret; |
| 7124 | } |
| 7125 | |
| 7126 | /** |
| 7127 | * iw_setnone_getnone() - Generic "action" private ioctl handler |
| 7128 | * @dev: device upon which the ioctl was received |
| 7129 | * @info: ioctl request information |
| 7130 | * @wrqu: ioctl request data |
| 7131 | * @extra: ioctl extra data |
| 7132 | * |
| 7133 | * Return: 0 on success, non-zero on error |
| 7134 | */ |
| 7135 | static int __iw_setnone_getnone(struct net_device *dev, |
| 7136 | struct iw_request_info *info, |
| 7137 | union iwreq_data *wrqu, char *extra) |
| 7138 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7139 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7140 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7141 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7142 | int ret; |
| 7143 | int sub_cmd; |
| 7144 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7145 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7146 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7147 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7148 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7149 | if (0 != ret) |
| 7150 | return ret; |
| 7151 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7152 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7153 | if (0 != ret) |
| 7154 | return ret; |
| 7155 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7156 | #ifdef CONFIG_COMPAT |
| 7157 | /* this ioctl is a special case where a sub-ioctl is used and both |
| 7158 | * the number of get and set args is 0. in this specific case the |
| 7159 | * logic in iwpriv places the sub_cmd in the data.flags portion of |
| 7160 | * the iwreq. unfortunately the location of this field will be |
| 7161 | * different between 32-bit and 64-bit userspace, and the standard |
| 7162 | * compat support in the kernel does not handle this case. so we |
| 7163 | * need to explicitly handle it here. |
| 7164 | */ |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 7165 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7166 | struct compat_iw_point *compat_iw_point = |
| 7167 | (struct compat_iw_point *)&wrqu->data; |
| 7168 | sub_cmd = compat_iw_point->flags; |
| 7169 | } else { |
| 7170 | sub_cmd = wrqu->data.flags; |
| 7171 | } |
| 7172 | #else |
| 7173 | sub_cmd = wrqu->data.flags; |
| 7174 | #endif |
| 7175 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7176 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7177 | switch (sub_cmd) { |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7178 | case WE_GET_FW_PROFILE_DATA: |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7179 | ret = wma_cli_set_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7180 | WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, |
| 7181 | 0, DBG_CMD); |
| 7182 | break; |
| 7183 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7184 | case WE_IBSS_GET_PEER_INFO_ALL: |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7185 | hdd_wlan_get_ibss_peer_info_all(adapter); |
| 7186 | break; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7187 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7188 | case WE_SET_REASSOC_TRIGGER: |
| 7189 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7190 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7191 | tSirMacAddr bssid; |
Krunal Soni | bfd0549 | 2017-10-03 15:48:37 -0700 | [diff] [blame] | 7192 | uint32_t roamId = INVALID_ROAM_ID; |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7193 | uint8_t operating_ch = |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 7194 | adapter->session.station.conn_info.operationChannel; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7195 | tCsrRoamModifyProfileFields modProfileFields; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7196 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7197 | sme_get_modify_profile_fields(mac_handle, adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7198 | &modProfileFields); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7199 | if (roaming_offload_enabled(hdd_ctx)) { |
| 7200 | qdf_mem_copy(bssid, |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 7201 | &adapter->session.station.conn_info.bssId, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7202 | sizeof(bssid)); |
Naveen Rawat | 664a7cb | 2017-01-19 17:58:14 -0800 | [diff] [blame] | 7203 | hdd_wma_send_fastreassoc_cmd(adapter, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7204 | bssid, operating_ch); |
| 7205 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7206 | sme_roam_reassoc(mac_handle, adapter->session_id, |
| 7207 | NULL, modProfileFields, &roamId, 1); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7208 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7209 | return 0; |
| 7210 | } |
| 7211 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7212 | case WE_STOP_OBSS_SCAN: |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7213 | /* |
| 7214 | * 1.OBSS Scan is mandatory while operating in 2.4GHz |
| 7215 | * 2.OBSS scan is stopped by Firmware during the disassociation |
| 7216 | * 3.OBSS stop comamnd is added for debugging purpose |
| 7217 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7218 | if (!mac_handle) { |
| 7219 | hdd_err("mac_handle context is NULL"); |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7220 | return -EINVAL; |
| 7221 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7222 | sme_ht40_stop_obss_scan(mac_handle, adapter->session_id); |
| 7223 | break; |
| 7224 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7225 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7226 | hdd_err("unknown ioctl %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7227 | break; |
| 7228 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7229 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7230 | return ret; |
| 7231 | } |
| 7232 | |
| 7233 | static int iw_setnone_getnone(struct net_device *dev, |
| 7234 | struct iw_request_info *info, |
| 7235 | union iwreq_data *wrqu, char *extra) |
| 7236 | { |
| 7237 | int ret; |
| 7238 | |
| 7239 | cds_ssr_protect(__func__); |
| 7240 | ret = __iw_setnone_getnone(dev, info, wrqu, extra); |
| 7241 | cds_ssr_unprotect(__func__); |
| 7242 | |
| 7243 | return ret; |
| 7244 | } |
| 7245 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7246 | #ifdef MPC_UT_FRAMEWORK |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7247 | static void |
| 7248 | hdd_policy_mgr_set_hw_mode_ut(struct hdd_context *hdd_ctx, |
| 7249 | struct hdd_adapter *adapter, int cmd) |
| 7250 | { |
| 7251 | enum hw_mode_ss_config mac0_ss; |
| 7252 | enum hw_mode_bandwidth mac0_bw; |
| 7253 | enum hw_mode_ss_config mac1_ss; |
| 7254 | enum hw_mode_bandwidth mac1_bw; |
| 7255 | enum hw_mode_mac_band_cap mac0_band_cap; |
| 7256 | enum hw_mode_dbs_capab dbs; |
| 7257 | |
| 7258 | switch (cmd) { |
| 7259 | case 0: |
| 7260 | hdd_debug("set hw mode for single mac"); |
| 7261 | mac0_ss = HW_MODE_SS_2x2; |
| 7262 | mac0_bw = HW_MODE_80_MHZ; |
| 7263 | mac1_ss = HW_MODE_SS_0x0; |
| 7264 | mac1_bw = HW_MODE_BW_NONE; |
| 7265 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7266 | dbs = HW_MODE_DBS_NONE; |
| 7267 | break; |
| 7268 | case 1: |
| 7269 | hdd_debug("set hw mode for dual mac"); |
| 7270 | mac0_ss = HW_MODE_SS_1x1; |
| 7271 | mac0_bw = HW_MODE_80_MHZ; |
| 7272 | mac1_ss = HW_MODE_SS_1x1; |
| 7273 | mac1_bw = HW_MODE_40_MHZ; |
| 7274 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7275 | dbs = HW_MODE_DBS; |
| 7276 | break; |
| 7277 | case 2: |
| 7278 | hdd_debug("set hw mode for 2x2 5g + 1x1 2g"); |
| 7279 | mac0_ss = HW_MODE_SS_2x2; |
| 7280 | mac0_bw = HW_MODE_80_MHZ; |
| 7281 | mac1_ss = HW_MODE_SS_1x1; |
| 7282 | mac1_bw = HW_MODE_40_MHZ; |
| 7283 | mac0_band_cap = HW_MODE_MAC_BAND_5G; |
| 7284 | dbs = HW_MODE_DBS; |
| 7285 | break; |
| 7286 | case 3: |
| 7287 | hdd_debug("set hw mode for 2x2 2g + 1x1 5g"); |
| 7288 | mac0_ss = HW_MODE_SS_2x2; |
| 7289 | mac0_bw = HW_MODE_40_MHZ; |
| 7290 | mac1_ss = HW_MODE_SS_1x1; |
| 7291 | mac1_bw = HW_MODE_40_MHZ; |
| 7292 | mac0_band_cap = HW_MODE_MAC_BAND_2G; |
| 7293 | dbs = HW_MODE_DBS; |
| 7294 | break; |
| 7295 | default: |
| 7296 | hdd_err("unknown cmd %d", cmd); |
| 7297 | return; |
| 7298 | } |
| 7299 | policy_mgr_pdev_set_hw_mode(hdd_ctx->psoc, adapter->session_id, |
| 7300 | mac0_ss, mac0_bw, mac1_ss, mac1_bw, |
| 7301 | mac0_band_cap, dbs, HW_MODE_AGILE_DFS_NONE, |
| 7302 | HW_MODE_SBS_NONE, |
| 7303 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
| 7304 | } |
| 7305 | |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7306 | static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx, |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7307 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7308 | { |
Jeff Johnson | ac8b0de | 2017-02-10 09:22:22 -0800 | [diff] [blame] | 7309 | switch (sub_cmd) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7310 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7311 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7312 | hdd_debug("<iwpriv wlan0 pm_clist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7313 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7314 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7315 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7316 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7317 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7318 | return 0; |
| 7319 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7320 | policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7321 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7322 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7323 | } |
| 7324 | break; |
| 7325 | |
| 7326 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7327 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7328 | hdd_debug("<iwpriv wlan0 pm_dlist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7329 | if ((apps_args[0] < 0) || (apps_args[1] < 0)) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7330 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7331 | return 0; |
| 7332 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7333 | policy_mgr_decr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7334 | apps_args[0], apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7335 | } |
| 7336 | break; |
| 7337 | |
| 7338 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7339 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7340 | hdd_debug("<iwpriv wlan0 pm_ulist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7341 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7342 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7343 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7344 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7345 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7346 | return 0; |
| 7347 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7348 | policy_mgr_update_connection_info_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7349 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7350 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7351 | } |
| 7352 | break; |
| 7353 | |
| 7354 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7355 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7356 | hdd_debug("<iwpriv wlan0 pm_dbs> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7357 | if (apps_args[0] == 0) |
| 7358 | wma_set_dbs_capability_ut(0); |
| 7359 | else |
| 7360 | wma_set_dbs_capability_ut(1); |
| 7361 | |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7362 | if (apps_args[1] >= PM_THROUGHPUT && |
| 7363 | apps_args[1] <= PM_LATENCY) { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7364 | hdd_debug("setting system pref to [%d]\n", |
| 7365 | apps_args[1]); |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 7366 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, |
| 7367 | apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7368 | } |
| 7369 | } |
| 7370 | break; |
| 7371 | |
| 7372 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7373 | { |
| 7374 | uint8_t pcl[QDF_MAX_NUM_CHAN] = {0}; |
| 7375 | uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0}; |
| 7376 | uint32_t pcl_len = 0, i = 0; |
| 7377 | |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7378 | hdd_debug("<iwpriv wlan0 pm_pcl> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7379 | |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7380 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7381 | hdd_err("Invalid input param received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7382 | return 0; |
| 7383 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7384 | policy_mgr_get_pcl(hdd_ctx->psoc, apps_args[0], |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7385 | pcl, &pcl_len, |
| 7386 | weight_list, QDF_ARRAY_SIZE(weight_list)); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7387 | hdd_debug("PCL list for role[%d] is {", apps_args[0]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7388 | for (i = 0 ; i < pcl_len; i++) |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7389 | hdd_debug(" %d, ", pcl[i]); |
| 7390 | hdd_debug("}--------->\n"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7391 | } |
| 7392 | break; |
| 7393 | |
| 7394 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7395 | { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7396 | hdd_debug("pm_set_hw_mode cmd %d", apps_args[0]); |
| 7397 | hdd_policy_mgr_set_hw_mode_ut(hdd_ctx, adapter, apps_args[0]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7398 | } |
| 7399 | break; |
| 7400 | |
| 7401 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7402 | { |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7403 | hdd_debug("<iwpriv wlan0 pm_query_action> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7404 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7405 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7406 | return 0; |
| 7407 | } |
Tushnim Bhattacharyya | dfbce70 | 2018-03-27 12:46:48 -0700 | [diff] [blame] | 7408 | policy_mgr_current_connections_update( |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7409 | hdd_ctx->psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7410 | adapter->session_id, apps_args[0], |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 7411 | POLICY_MGR_UPDATE_REASON_UT); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7412 | } |
| 7413 | break; |
| 7414 | |
| 7415 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7416 | { |
| 7417 | bool allow; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7418 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 7419 | hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7420 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7421 | (apps_args[2] < 0)) { |
| 7422 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7423 | return 0; |
| 7424 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7425 | allow = policy_mgr_allow_concurrency(hdd_ctx->psoc, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7426 | apps_args[0], apps_args[1], apps_args[2]); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7427 | hdd_debug("allow %d {0 = don't allow, 1 = allow}", allow); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7428 | } |
| 7429 | break; |
| 7430 | |
| 7431 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7432 | { |
| 7433 | clean_report(hdd_ctx); |
| 7434 | if (apps_args[0] == 1) { |
| 7435 | wlan_hdd_one_connection_scenario(hdd_ctx); |
| 7436 | } else if (apps_args[0] == 2) { |
| 7437 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7438 | 6, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7439 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7440 | 36, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7441 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7442 | 6, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7443 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7444 | 36, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7445 | } else if (apps_args[0] == 3) { |
| 7446 | /* MCC on same band with 2x2 same mac*/ |
| 7447 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7448 | 6, 11, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7449 | /* MCC on diff band with 2x2 same mac*/ |
| 7450 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7451 | 6, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7452 | /* MCC on diff band with 1x1 diff mac */ |
| 7453 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7454 | 36, 6, POLICY_MGR_ONE_ONE, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7455 | /* MCC on diff band with 1x1 same mac */ |
| 7456 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7457 | 36, 6, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7458 | /* SCC on same band with 2x2 same mac */ |
| 7459 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7460 | 36, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7461 | /* SCC on same band with 1x1 same mac */ |
| 7462 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7463 | 36, 36, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7464 | /* MCC on same band with 2x2 same mac */ |
| 7465 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7466 | 36, 149, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7467 | /* MCC on same band with 1x1 same mac */ |
| 7468 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7469 | 36, 149, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7470 | } |
| 7471 | print_report(hdd_ctx); |
| 7472 | } |
| 7473 | break; |
| 7474 | } |
| 7475 | return 0; |
| 7476 | } |
| 7477 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7478 | static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx, |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7479 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7480 | { |
| 7481 | return 0; |
| 7482 | } |
| 7483 | #endif |
| 7484 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7485 | /** |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7486 | * hdd_ch_avoid_unit_cmd - unit test ch avoidance |
| 7487 | * @hdd_ctx: hdd_context |
| 7488 | * @num_args: input args number |
| 7489 | * @apps_args: args data ptr |
| 7490 | * |
| 7491 | * This is to inject a ch avoid event to do unit test SAP chan avoidance. |
| 7492 | * |
| 7493 | * Return: void |
| 7494 | */ |
| 7495 | #if WLAN_DEBUG |
| 7496 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7497 | int num_args, int *apps_args) |
| 7498 | { |
| 7499 | struct ch_avoid_ind_type ch_avoid; |
| 7500 | int cnt = 0, i; |
| 7501 | |
| 7502 | if (num_args < 2 || num_args > CH_AVOID_MAX_RANGE * 2 || |
| 7503 | num_args % 2 != 0) |
| 7504 | return; |
| 7505 | hdd_info("simulate ch avoid num_args %d", num_args); |
| 7506 | for (i = 0; i < num_args && i < CH_AVOID_MAX_RANGE * 2; i++) { |
| 7507 | ch_avoid.avoid_freq_range[cnt].start_freq = |
| 7508 | apps_args[i]; |
| 7509 | ch_avoid.avoid_freq_range[cnt].end_freq = |
| 7510 | apps_args[++i]; |
| 7511 | |
| 7512 | hdd_info("simulate ch avoid [%d %d]", |
| 7513 | ch_avoid.avoid_freq_range[cnt].start_freq, |
| 7514 | ch_avoid.avoid_freq_range[cnt].end_freq); |
| 7515 | cnt++; |
| 7516 | } |
| 7517 | ch_avoid.ch_avoid_range_cnt = cnt; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7518 | ucfg_reg_unit_simulate_ch_avoid(hdd_ctx->psoc, &ch_avoid); |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7519 | } |
| 7520 | #else |
| 7521 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7522 | int num_args, int *apps_args) |
| 7523 | { |
| 7524 | } |
| 7525 | #endif |
| 7526 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7527 | * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7528 | * @dev: device upon which the ioctl was received |
| 7529 | * @info: ioctl request information |
| 7530 | * @wrqu: ioctl request data |
| 7531 | * @extra: ioctl extra data |
| 7532 | * |
| 7533 | * This is an SSR-protected generic handler for private ioctls which |
| 7534 | * take multiple arguments. Note that this implementation is also |
| 7535 | * somewhat unique in that it is shared by both STA-mode and SAP-mode |
| 7536 | * interfaces. |
| 7537 | * |
| 7538 | * Return: 0 on success, non-zero on error |
| 7539 | */ |
| 7540 | static int __iw_set_var_ints_getnone(struct net_device *dev, |
| 7541 | struct iw_request_info *info, |
| 7542 | union iwreq_data *wrqu, char *extra) |
| 7543 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7544 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7545 | mac_handle_t mac_handle; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7546 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7547 | int sub_cmd; |
| 7548 | int *apps_args = (int *) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7549 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7550 | int ret, num_args; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7551 | void *soc = NULL; |
| 7552 | struct cdp_pdev *pdev = NULL; |
| 7553 | struct cdp_vdev *vdev = NULL; |
| 7554 | struct cdp_txrx_stats_req req = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7555 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7556 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7557 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7558 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7559 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7560 | if (0 != ret) |
| 7561 | return ret; |
| 7562 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7563 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7564 | if (0 != ret) |
| 7565 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7566 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7567 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7568 | sub_cmd = wrqu->data.flags; |
| 7569 | num_args = wrqu->data.length; |
| 7570 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7571 | hdd_debug("Received length %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7572 | |
| 7573 | switch (sub_cmd) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7574 | case WE_IBSS_GET_PEER_INFO: |
| 7575 | { |
| 7576 | pr_info("Station ID = %d\n", apps_args[0]); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7577 | hdd_wlan_get_ibss_peer_info(adapter, apps_args[0]); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7578 | } |
| 7579 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7580 | |
| 7581 | case WE_P2P_NOA_CMD: |
| 7582 | { |
Srinivas Girigowda | 5d5fdc5 | 2017-03-24 22:30:57 -0700 | [diff] [blame] | 7583 | struct p2p_app_set_ps p2pNoA; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7584 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7585 | if (adapter->device_mode != QDF_P2P_GO_MODE) { |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7586 | hdd_err("Setting NoA is not allowed in Device mode %s(%d)", |
Dustin Brown | 458027c | 2018-10-19 12:26:27 -0700 | [diff] [blame] | 7587 | qdf_opmode_str(adapter->device_mode), |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7588 | adapter->device_mode); |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7589 | return -EINVAL; |
| 7590 | } |
| 7591 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7592 | p2pNoA.opp_ps = apps_args[0]; |
| 7593 | p2pNoA.ctWindow = apps_args[1]; |
| 7594 | p2pNoA.duration = apps_args[2]; |
| 7595 | p2pNoA.interval = apps_args[3]; |
| 7596 | p2pNoA.count = apps_args[4]; |
| 7597 | p2pNoA.single_noa_duration = apps_args[5]; |
| 7598 | p2pNoA.psSelection = apps_args[6]; |
| 7599 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7600 | hdd_debug("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7601 | apps_args[0], apps_args[1], apps_args[2], |
| 7602 | apps_args[3], apps_args[4], |
| 7603 | apps_args[5], apps_args[6]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7604 | |
| 7605 | hdd_set_p2p_ps(dev, &p2pNoA); |
| 7606 | |
| 7607 | } |
| 7608 | break; |
| 7609 | |
| 7610 | case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD: |
| 7611 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7612 | hdd_debug("SELECTIVE_MODULE_LOG %d arg1 %d arg2", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7613 | apps_args[0], apps_args[1]); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 7614 | qdf_trace_enable(apps_args[0], apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7615 | } |
| 7616 | break; |
| 7617 | |
| 7618 | case WE_MTRACE_DUMP_CMD: |
| 7619 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7620 | hdd_debug("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7621 | apps_args[0], apps_args[1], |
| 7622 | apps_args[2], apps_args[3]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7623 | qdf_trace_dump_all((void *)mac_handle, apps_args[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7624 | apps_args[1], apps_args[2], |
| 7625 | apps_args[3]); |
| 7626 | |
| 7627 | } |
| 7628 | break; |
| 7629 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7630 | case WE_POLICY_MANAGER_CINFO_CMD: |
| 7631 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7632 | struct policy_mgr_conc_connection_info *conn_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7633 | uint32_t i = 0, len = 0; |
| 7634 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7635 | hdd_info("<iwpriv wlan0 pm_cinfo> is called"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7636 | conn_info = policy_mgr_get_conn_info(&len); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7637 | pr_info("+--------------------------+\n"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7638 | for (i = 0; i < len; i++) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7639 | pr_info("|table_index[%d]\t\t\n", i); |
| 7640 | pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id); |
| 7641 | pr_info("|\t|chan - %-10d|\n", conn_info->chan); |
| 7642 | pr_info("|\t|bw - %-10d|\n", conn_info->bw); |
| 7643 | pr_info("|\t|mode - %-10d|\n", conn_info->mode); |
| 7644 | pr_info("|\t|mac - %-10d|\n", conn_info->mac); |
| 7645 | pr_info("|\t|in_use - %-10d|\n", conn_info->in_use); |
| 7646 | pr_info("+--------------------------+\n"); |
| 7647 | conn_info++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7648 | } |
| 7649 | } |
| 7650 | break; |
| 7651 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7652 | case WE_UNIT_TEST_CMD: |
| 7653 | { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7654 | QDF_STATUS status; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7655 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7656 | if ((apps_args[0] < WLAN_MODULE_ID_MIN) || |
| 7657 | (apps_args[0] >= WLAN_MODULE_ID_MAX)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7658 | hdd_err("Invalid MODULE ID %d", apps_args[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7659 | return -EINVAL; |
| 7660 | } |
Sourav Mohapatra | ea7210b | 2018-11-16 16:58:52 +0530 | [diff] [blame] | 7661 | if ((apps_args[1] > (WMA_MAX_NUM_ARGS)) || |
Anurag Chouhan | 7756418 | 2016-09-03 16:38:01 +0530 | [diff] [blame] | 7662 | (apps_args[1] < 0)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7663 | hdd_err("Too Many/Few args %d", apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7664 | return -EINVAL; |
| 7665 | } |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7666 | status = sme_send_unit_test_cmd(adapter->session_id, |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7667 | apps_args[0], |
| 7668 | apps_args[1], |
| 7669 | &apps_args[2]); |
| 7670 | if (QDF_STATUS_SUCCESS != status) { |
Jeff Johnson | 21d63bb | 2017-10-07 17:45:33 -0700 | [diff] [blame] | 7671 | hdd_err("sme_send_unit_test_cmd returned %d", status); |
| 7672 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7673 | } |
| 7674 | } |
| 7675 | break; |
| 7676 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 7677 | case WE_LED_FLASHING_PARAM: |
| 7678 | { |
| 7679 | int i; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7680 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7681 | if (num_args != 4) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7682 | hdd_err("gpio_control: 4 parameters are required"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7683 | return -EINVAL; |
| 7684 | } |
| 7685 | for (i = 0; i < num_args; i++) { |
| 7686 | if (apps_args[i] >= 0x7fffffff) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7687 | hdd_err("gpio_control: parameter should be less than 0x7fffffff"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7688 | return -EINVAL; |
| 7689 | } |
| 7690 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7691 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7692 | 0, apps_args[0], apps_args[1]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7693 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7694 | 1, apps_args[2], apps_args[3]); |
| 7695 | } |
| 7696 | break; |
| 7697 | #endif |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 7698 | case WE_SET_PKTLOG: |
| 7699 | { |
| 7700 | int ret; |
| 7701 | |
| 7702 | if (num_args < 1 || num_args > 2) { |
| 7703 | hdd_err("pktlog: either 1 or 2 parameters are required"); |
| 7704 | return -EINVAL; |
| 7705 | } |
| 7706 | |
| 7707 | ret = hdd_process_pktlog_command(hdd_ctx, apps_args[0], |
| 7708 | apps_args[1]); |
| 7709 | if (ret) |
| 7710 | return ret; |
| 7711 | break; |
| 7712 | } |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7713 | case WE_MAC_PWR_DEBUG_CMD: |
| 7714 | { |
| 7715 | struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args; |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7716 | int i, j; |
| 7717 | |
| 7718 | if (num_args < 3) { |
| 7719 | hdd_err("number of arguments can't be null %d", |
| 7720 | num_args); |
| 7721 | return -EINVAL; |
| 7722 | } |
| 7723 | if (num_args - 3 != apps_args[2]) { |
| 7724 | hdd_err("arg list of size %d doesn't match num_args %d", |
| 7725 | num_args-3, apps_args[2]); |
| 7726 | return -EINVAL; |
| 7727 | } |
| 7728 | if ((apps_args[1] < WLAN_MODULE_ID_MIN) || |
| 7729 | (apps_args[1] >= WLAN_MODULE_ID_MAX)) { |
| 7730 | hdd_err("Invalid MODULE ID %d", apps_args[1]); |
| 7731 | return -EINVAL; |
| 7732 | } |
| 7733 | if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) { |
| 7734 | hdd_err("Too Many args %d", apps_args[2]); |
| 7735 | return -EINVAL; |
| 7736 | } |
| 7737 | mac_pwr_dbg_args.pdev_id = apps_args[0]; |
| 7738 | mac_pwr_dbg_args.module_id = apps_args[1]; |
| 7739 | mac_pwr_dbg_args.num_args = apps_args[2]; |
| 7740 | |
| 7741 | for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++) |
| 7742 | mac_pwr_dbg_args.args[i] = apps_args[j]; |
| 7743 | |
| 7744 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7745 | sme_process_mac_pwr_dbg_cmd(mac_handle, |
| 7746 | adapter->session_id, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7747 | &mac_pwr_dbg_args)) { |
| 7748 | return -EINVAL; |
| 7749 | } |
| 7750 | } |
| 7751 | break; |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7752 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7753 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7754 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7755 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7756 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7757 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7758 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7759 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7760 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7761 | { |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 7762 | if (!hdd_ctx->config->is_unit_test_framework_enabled) { |
| 7763 | hdd_warn_rl("UT framework is disabled"); |
| 7764 | return -EINVAL; |
| 7765 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7766 | iw_get_policy_manager_ut_ops(hdd_ctx, adapter, |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 7767 | sub_cmd, apps_args); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7768 | } |
| 7769 | break; |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7770 | case WE_SET_CHAN_AVOID: |
| 7771 | { |
| 7772 | hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args); |
| 7773 | } |
| 7774 | break; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7775 | case WE_SET_TXRX_STATS: |
| 7776 | { |
| 7777 | ret = cds_get_datapath_handles(&soc, &pdev, &vdev, |
| 7778 | adapter->session_id); |
| 7779 | |
| 7780 | if (ret != 0) { |
| 7781 | hdd_err("Invalid handles"); |
| 7782 | break; |
| 7783 | } |
| 7784 | |
| 7785 | req.stats = apps_args[0]; |
| 7786 | /* default value of secondary parameter is 0(mac_id) */ |
| 7787 | req.mac_id = apps_args[1]; |
| 7788 | |
| 7789 | hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", |
| 7790 | req.stats, req.mac_id); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7791 | if (apps_args[0] == CDP_TXRX_STATS_28) { |
| 7792 | if (sta_ctx->conn_info.uIsAuthenticated) { |
| 7793 | hdd_debug("ap mac addr: %pM", |
| 7794 | (void *)&sta_ctx->conn_info.bssId); |
| 7795 | req.peer_addr = |
| 7796 | (char *)&sta_ctx->conn_info.bssId; |
| 7797 | } |
| 7798 | } |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7799 | ret = cdp_txrx_stats_request(soc, vdev, &req); |
| 7800 | break; |
| 7801 | } |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 7802 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 7803 | case WE_MOTION_DET_CONFIG_PARAM: |
| 7804 | { |
| 7805 | struct sme_motion_det_cfg motion_det_cfg; |
| 7806 | |
| 7807 | if (num_args != 15) { |
| 7808 | hdd_err("mt_config: Invalid no of args"); |
| 7809 | return -EINVAL; |
| 7810 | } |
| 7811 | |
| 7812 | motion_det_cfg.vdev_id = adapter->session_id; |
| 7813 | motion_det_cfg.time_t1 = apps_args[0]; |
| 7814 | motion_det_cfg.time_t2 = apps_args[1]; |
| 7815 | motion_det_cfg.n1 = apps_args[2]; |
| 7816 | motion_det_cfg.n2 = apps_args[3]; |
| 7817 | motion_det_cfg.time_t1_gap = apps_args[4]; |
| 7818 | motion_det_cfg.time_t2_gap = apps_args[5]; |
| 7819 | motion_det_cfg.coarse_K = apps_args[6]; |
| 7820 | motion_det_cfg.fine_K = apps_args[7]; |
| 7821 | motion_det_cfg.coarse_Q = apps_args[8]; |
| 7822 | motion_det_cfg.fine_Q = apps_args[9]; |
| 7823 | motion_det_cfg.md_coarse_thr_high = apps_args[10]; |
| 7824 | motion_det_cfg.md_fine_thr_high = apps_args[11]; |
| 7825 | motion_det_cfg.md_coarse_thr_low = apps_args[12]; |
| 7826 | motion_det_cfg.md_fine_thr_low = apps_args[13]; |
| 7827 | adapter->motion_detection_mode = apps_args[14]; |
| 7828 | sme_motion_det_config(hdd_ctx->mac_handle, &motion_det_cfg); |
| 7829 | } |
| 7830 | break; |
| 7831 | case WE_MOTION_DET_BASE_LINE_CONFIG_PARAM: |
| 7832 | { |
| 7833 | struct sme_motion_det_base_line_cfg motion_det_base_line_cfg; |
| 7834 | |
| 7835 | if (num_args != 4) { |
| 7836 | hdd_err("mt_bl_config: Invalid no of args"); |
| 7837 | return -EINVAL; |
| 7838 | } |
| 7839 | |
| 7840 | motion_det_base_line_cfg.vdev_id = adapter->session_id; |
| 7841 | motion_det_base_line_cfg.bl_time_t = apps_args[0]; |
| 7842 | motion_det_base_line_cfg.bl_packet_gap = apps_args[1]; |
| 7843 | motion_det_base_line_cfg.bl_n = apps_args[2]; |
| 7844 | motion_det_base_line_cfg.bl_num_meas = apps_args[3]; |
| 7845 | sme_motion_det_base_line_config(hdd_ctx->mac_handle, |
| 7846 | &motion_det_base_line_cfg); |
| 7847 | } |
| 7848 | break; |
| 7849 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 7850 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 7851 | case WE_SET_THERMAL_THROTTLE_CFG: |
| 7852 | { |
| 7853 | QDF_STATUS status; |
| 7854 | |
| 7855 | if (num_args != 7) { |
| 7856 | hdd_err("set_thermal_cfg: Invalid no of args"); |
| 7857 | return -EINVAL; |
| 7858 | } |
| 7859 | |
| 7860 | /* Check for valid inputs */ |
| 7861 | if (apps_args[0] < 0 || apps_args[0] > 1 || apps_args[1] < 0 || |
| 7862 | apps_args[2] < 0 || apps_args[2] > 100 || |
| 7863 | apps_args[3] < 0 || apps_args[3] > 3 || apps_args[4] < 0 || |
| 7864 | apps_args[5] < 0 || apps_args[6] < 0 || |
| 7865 | apps_args[5] <= apps_args[4]) |
| 7866 | return -EINVAL; |
| 7867 | |
| 7868 | status = sme_set_thermal_throttle_cfg(hdd_ctx->mac_handle, |
| 7869 | apps_args[0], |
| 7870 | apps_args[1], |
| 7871 | apps_args[2], |
| 7872 | apps_args[3], |
| 7873 | apps_args[6]); |
| 7874 | if (QDF_IS_STATUS_ERROR(status)) |
| 7875 | return qdf_status_to_os_return(status); |
| 7876 | |
| 7877 | if (!apps_args[6]) { |
| 7878 | status = sme_set_thermal_mgmt(hdd_ctx->mac_handle, |
| 7879 | apps_args[4], |
| 7880 | apps_args[5]); |
| 7881 | if (QDF_IS_STATUS_ERROR(status)) |
| 7882 | return qdf_status_to_os_return(status); |
| 7883 | } |
| 7884 | break; |
| 7885 | } |
| 7886 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7887 | default: |
| 7888 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7889 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7890 | } |
| 7891 | break; |
| 7892 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7893 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7894 | return 0; |
| 7895 | } |
| 7896 | |
| 7897 | /** |
| 7898 | * iw_hdd_set_var_ints_getnone() - set var ints getnone callback |
| 7899 | * @dev: pointer to net_device structure |
| 7900 | * @info: pointer to iw_request_info structure |
| 7901 | * @wrqu: pointer to iwreq_data |
| 7902 | * @extra; extra |
| 7903 | * |
| 7904 | * Return: 0 on success, error number otherwise |
| 7905 | * |
| 7906 | */ |
| 7907 | static int iw_hdd_set_var_ints_getnone(struct net_device *dev, |
| 7908 | struct iw_request_info *info, |
| 7909 | union iwreq_data *wrqu, char *extra) |
| 7910 | { |
| 7911 | union iwreq_data u_priv_wrqu; |
| 7912 | int apps_args[MAX_VAR_ARGS] = {0}; |
| 7913 | int ret, num_args; |
| 7914 | |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7915 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7916 | hdd_err("permission check failed"); |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7917 | return -EPERM; |
| 7918 | } |
| 7919 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7920 | /* Helper function to get iwreq_data with compat handling. */ |
| 7921 | if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) |
| 7922 | return -EINVAL; |
| 7923 | |
| 7924 | if (NULL == u_priv_wrqu.data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7925 | hdd_err("NULL data pointer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7926 | return -EINVAL; |
| 7927 | } |
| 7928 | |
| 7929 | num_args = u_priv_wrqu.data.length; |
| 7930 | if (num_args > MAX_VAR_ARGS) |
| 7931 | num_args = MAX_VAR_ARGS; |
| 7932 | |
| 7933 | if (copy_from_user(apps_args, u_priv_wrqu.data.pointer, |
| 7934 | (sizeof(int)) * num_args)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7935 | hdd_err("failed to copy data from user buffer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7936 | return -EFAULT; |
| 7937 | } |
| 7938 | |
| 7939 | cds_ssr_protect(__func__); |
| 7940 | ret = __iw_set_var_ints_getnone(dev, info, &u_priv_wrqu, |
| 7941 | (char *)&apps_args); |
| 7942 | cds_ssr_unprotect(__func__); |
| 7943 | return ret; |
| 7944 | } |
| 7945 | |
| 7946 | /** |
| 7947 | * iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7948 | * @dev: device upon which the ioctl was received |
| 7949 | * @info: ioctl request information |
| 7950 | * @wrqu: ioctl request data |
| 7951 | * @extra: ioctl extra data |
| 7952 | * |
| 7953 | * This is a generic handler for private ioctls which take multiple |
| 7954 | * arguments. Note that this implementation is also somewhat unique |
| 7955 | * in that it is shared by both STA-mode and SAP-mode interfaces. |
| 7956 | * |
| 7957 | * Return: 0 on success, non-zero on error |
| 7958 | */ |
| 7959 | int iw_set_var_ints_getnone(struct net_device *dev, |
| 7960 | struct iw_request_info *info, |
| 7961 | union iwreq_data *wrqu, char *extra) |
| 7962 | { |
| 7963 | int ret; |
| 7964 | |
| 7965 | cds_ssr_protect(__func__); |
| 7966 | ret = __iw_set_var_ints_getnone(dev, info, wrqu, extra); |
| 7967 | cds_ssr_unprotect(__func__); |
| 7968 | return ret; |
| 7969 | } |
| 7970 | |
| 7971 | /** |
| 7972 | * iw_add_tspec - Add TSpec private ioctl handler |
| 7973 | * @dev: device upon which the ioctl was received |
| 7974 | * @info: ioctl request information |
| 7975 | * @wrqu: ioctl request data |
| 7976 | * @extra: ioctl extra data |
| 7977 | * |
| 7978 | * Return: 0 on success, non-zero on error |
| 7979 | */ |
| 7980 | static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7981 | union iwreq_data *wrqu, char *extra) |
| 7982 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7983 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7984 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7985 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7986 | int params[HDD_WLAN_WMM_PARAM_COUNT]; |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 7987 | struct sme_qos_wmmtspecinfo tSpec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7988 | uint32_t handle; |
| 7989 | struct iw_point s_priv_data; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7990 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7991 | int ret; |
| 7992 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7993 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7994 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7995 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7996 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7997 | if (0 != ret) |
| 7998 | return ret; |
| 7999 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8000 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8001 | if (0 != ret) |
| 8002 | return ret; |
| 8003 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8004 | /* make sure the application is sufficiently priviledged */ |
| 8005 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8006 | /* this ioctl wants to return status to user space it must be */ |
| 8007 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8008 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8009 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8010 | |
| 8011 | /* we must be associated in order to add a tspec */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8012 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8013 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8014 | return 0; |
| 8015 | } |
| 8016 | /* since we are defined to be a "get" ioctl, and since the number */ |
| 8017 | /* of params exceeds the number of params that wireless extensions */ |
| 8018 | /* will pass down in the iwreq_data, we must copy the "set" params. */ |
| 8019 | /* We must handle the compat for iwreq_data in 32U/64K environment. */ |
| 8020 | |
| 8021 | /* helper function to get iwreq_data with compat handling. */ |
| 8022 | if (hdd_priv_get_data(&s_priv_data, wrqu)) { |
| 8023 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8024 | return 0; |
| 8025 | } |
| 8026 | /* make sure all params are correctly passed to function */ |
| 8027 | if ((NULL == s_priv_data.pointer) || |
| 8028 | (HDD_WLAN_WMM_PARAM_COUNT != s_priv_data.length)) { |
| 8029 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8030 | return 0; |
| 8031 | } |
| 8032 | /* from user space ourselves */ |
| 8033 | if (copy_from_user(¶ms, s_priv_data.pointer, sizeof(params))) { |
| 8034 | /* hmmm, can't get them */ |
| 8035 | return -EIO; |
| 8036 | } |
| 8037 | /* clear the tspec */ |
| 8038 | memset(&tSpec, 0, sizeof(tSpec)); |
| 8039 | |
| 8040 | /* validate the handle */ |
| 8041 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8042 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8043 | /* that one is reserved */ |
| 8044 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8045 | return 0; |
| 8046 | } |
| 8047 | /* validate the TID */ |
| 8048 | if (params[HDD_WLAN_WMM_PARAM_TID] > 7) { |
| 8049 | /* out of range */ |
| 8050 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8051 | return 0; |
| 8052 | } |
| 8053 | tSpec.ts_info.tid = params[HDD_WLAN_WMM_PARAM_TID]; |
| 8054 | |
| 8055 | /* validate the direction */ |
| 8056 | switch (params[HDD_WLAN_WMM_PARAM_DIRECTION]) { |
| 8057 | case HDD_WLAN_WMM_DIRECTION_UPSTREAM: |
| 8058 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_UPLINK; |
| 8059 | break; |
| 8060 | |
| 8061 | case HDD_WLAN_WMM_DIRECTION_DOWNSTREAM: |
| 8062 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_DOWNLINK; |
| 8063 | break; |
| 8064 | |
| 8065 | case HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL: |
| 8066 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_BOTH; |
| 8067 | break; |
| 8068 | |
| 8069 | default: |
| 8070 | /* unknown */ |
| 8071 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8072 | return 0; |
| 8073 | } |
| 8074 | |
| 8075 | tSpec.ts_info.psb = params[HDD_WLAN_WMM_PARAM_APSD]; |
| 8076 | |
| 8077 | /* validate the user priority */ |
| 8078 | if (params[HDD_WLAN_WMM_PARAM_USER_PRIORITY] >= SME_QOS_WMM_UP_MAX) { |
| 8079 | /* out of range */ |
| 8080 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8081 | return 0; |
| 8082 | } |
| 8083 | tSpec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY]; |
| 8084 | if (0 > tSpec.ts_info.up || SME_QOS_WMM_UP_MAX < tSpec.ts_info.up) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8085 | hdd_err("***ts_info.up out of bounds***"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8086 | return 0; |
| 8087 | } |
| 8088 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8089 | hdd_debug("TS_INFO PSB %d UP %d !!!", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8090 | tSpec.ts_info.psb, tSpec.ts_info.up); |
| 8091 | |
| 8092 | tSpec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE]; |
| 8093 | tSpec.maximum_msdu_size = params[HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE]; |
| 8094 | tSpec.min_data_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE]; |
| 8095 | tSpec.mean_data_rate = params[HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE]; |
| 8096 | tSpec.peak_data_rate = params[HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE]; |
| 8097 | tSpec.max_burst_size = params[HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE]; |
| 8098 | tSpec.min_phy_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE]; |
| 8099 | tSpec.surplus_bw_allowance = |
| 8100 | params[HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE]; |
| 8101 | tSpec.min_service_interval = |
| 8102 | params[HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL]; |
| 8103 | tSpec.max_service_interval = |
| 8104 | params[HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL]; |
| 8105 | tSpec.suspension_interval = |
| 8106 | params[HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL]; |
| 8107 | tSpec.inactivity_interval = |
| 8108 | params[HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL]; |
| 8109 | |
| 8110 | tSpec.ts_info.burst_size_defn = |
| 8111 | params[HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN]; |
| 8112 | |
| 8113 | /* validate the ts info ack policy */ |
| 8114 | switch (params[HDD_WLAN_WMM_PARAM_ACK_POLICY]) { |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8115 | case TS_INFO_ACK_POLICY_NORMAL_ACK: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8116 | tSpec.ts_info.ack_policy = SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK; |
| 8117 | break; |
| 8118 | |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8119 | case TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8120 | tSpec.ts_info.ack_policy = |
| 8121 | SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK; |
| 8122 | break; |
| 8123 | |
| 8124 | default: |
| 8125 | /* unknown */ |
| 8126 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8127 | return 0; |
| 8128 | } |
| 8129 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8130 | *pStatus = hdd_wmm_addts(adapter, handle, &tSpec); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8131 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8132 | return 0; |
| 8133 | } |
| 8134 | |
| 8135 | static int iw_add_tspec(struct net_device *dev, |
| 8136 | struct iw_request_info *info, |
| 8137 | union iwreq_data *wrqu, char *extra) |
| 8138 | { |
| 8139 | int ret; |
| 8140 | |
| 8141 | cds_ssr_protect(__func__); |
| 8142 | ret = __iw_add_tspec(dev, info, wrqu, extra); |
| 8143 | cds_ssr_unprotect(__func__); |
| 8144 | |
| 8145 | return ret; |
| 8146 | } |
| 8147 | |
| 8148 | /** |
| 8149 | * iw_del_tspec - Delete TSpec private ioctl handler |
| 8150 | * @dev: device upon which the ioctl was received |
| 8151 | * @info: ioctl request information |
| 8152 | * @wrqu: ioctl request data |
| 8153 | * @extra: ioctl extra data |
| 8154 | * |
| 8155 | * Return: 0 on success, non-zero on error |
| 8156 | */ |
| 8157 | static int __iw_del_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8158 | union iwreq_data *wrqu, char *extra) |
| 8159 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8160 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8161 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8162 | int *params = (int *)extra; |
| 8163 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 8164 | uint32_t handle; |
| 8165 | int ret; |
| 8166 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8167 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8168 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8169 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8170 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8171 | if (0 != ret) |
| 8172 | return ret; |
| 8173 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8174 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8175 | if (0 != ret) |
| 8176 | return ret; |
| 8177 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8178 | /* make sure the application is sufficiently priviledged */ |
| 8179 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8180 | /* this ioctl wants to return status to user space it must be */ |
| 8181 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8182 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8183 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8184 | |
| 8185 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8186 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8187 | /* is no need to copy the params from user space */ |
| 8188 | |
| 8189 | /* validate the handle */ |
| 8190 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8191 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8192 | /* that one is reserved */ |
| 8193 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8194 | return 0; |
| 8195 | } |
| 8196 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8197 | *pStatus = hdd_wmm_delts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8198 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8199 | return 0; |
| 8200 | } |
| 8201 | |
| 8202 | static int iw_del_tspec(struct net_device *dev, |
| 8203 | struct iw_request_info *info, |
| 8204 | union iwreq_data *wrqu, char *extra) |
| 8205 | { |
| 8206 | int ret; |
| 8207 | |
| 8208 | cds_ssr_protect(__func__); |
| 8209 | ret = __iw_del_tspec(dev, info, wrqu, extra); |
| 8210 | cds_ssr_unprotect(__func__); |
| 8211 | |
| 8212 | return ret; |
| 8213 | } |
| 8214 | |
| 8215 | /** |
| 8216 | * iw_get_tspec - Get TSpec private ioctl handler |
| 8217 | * @dev: device upon which the ioctl was received |
| 8218 | * @info: ioctl request information |
| 8219 | * @wrqu: ioctl request data |
| 8220 | * @extra: ioctl extra data |
| 8221 | * |
| 8222 | * Return: 0 on success, non-zero on error |
| 8223 | */ |
| 8224 | static int __iw_get_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8225 | union iwreq_data *wrqu, char *extra) |
| 8226 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8227 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8228 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8229 | int *params = (int *)extra; |
| 8230 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 8231 | uint32_t handle; |
| 8232 | int ret; |
| 8233 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8234 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8235 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8236 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8237 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8238 | if (0 != ret) |
| 8239 | return ret; |
| 8240 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8241 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8242 | if (0 != ret) |
| 8243 | return ret; |
| 8244 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8245 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8246 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8247 | /* is no need to copy the params from user space */ |
| 8248 | |
| 8249 | /* validate the handle */ |
| 8250 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8251 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8252 | /* that one is reserved */ |
| 8253 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 8254 | return 0; |
| 8255 | } |
| 8256 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8257 | *pStatus = hdd_wmm_checkts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8258 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8259 | return 0; |
| 8260 | } |
| 8261 | |
| 8262 | static int iw_get_tspec(struct net_device *dev, |
| 8263 | struct iw_request_info *info, |
| 8264 | union iwreq_data *wrqu, char *extra) |
| 8265 | { |
| 8266 | int ret; |
| 8267 | |
| 8268 | cds_ssr_protect(__func__); |
| 8269 | ret = __iw_get_tspec(dev, info, wrqu, extra); |
| 8270 | cds_ssr_unprotect(__func__); |
| 8271 | |
| 8272 | return ret; |
| 8273 | } |
| 8274 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8275 | /** |
| 8276 | * iw_set_fties - Set FT IEs private ioctl handler |
| 8277 | * @dev: device upon which the ioctl was received |
| 8278 | * @info: ioctl request information |
| 8279 | * @wrqu: ioctl request data |
| 8280 | * @extra: ioctl extra data |
| 8281 | * |
| 8282 | * Each time the supplicant has the auth_request or reassoc request |
| 8283 | * IEs ready they are pushed to the driver. The driver will in turn |
| 8284 | * use it to send out the auth req and reassoc req for 11r FT Assoc. |
| 8285 | * |
| 8286 | * Return: 0 on success, non-zero on error |
| 8287 | */ |
| 8288 | static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info, |
| 8289 | union iwreq_data *wrqu, char *extra) |
| 8290 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8291 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8292 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8293 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8294 | int ret; |
| 8295 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8296 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8297 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8298 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8299 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8300 | if (0 != ret) |
| 8301 | return ret; |
| 8302 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8303 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8304 | if (0 != ret) |
| 8305 | return ret; |
| 8306 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8307 | if (!wrqu->data.length) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8308 | hdd_err("called with 0 length IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8309 | return -EINVAL; |
| 8310 | } |
| 8311 | if (wrqu->data.pointer == NULL) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8312 | hdd_err("called with NULL IE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8313 | return -EINVAL; |
| 8314 | } |
| 8315 | /* Added for debug on reception of Re-assoc Req. */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8316 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8317 | hdd_debug("Called with Ie of length = %d when not associated", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8318 | wrqu->data.length); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8319 | hdd_debug("Should be Re-assoc Req IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8320 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8321 | hdd_debug("called with Ie of length = %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8322 | |
| 8323 | /* Pass the received FT IEs to SME */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8324 | sme_set_ft_ies(hdd_ctx->mac_handle, adapter->session_id, |
| 8325 | extra, wrqu->data.length); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8326 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8327 | return 0; |
| 8328 | } |
| 8329 | |
| 8330 | static int iw_set_fties(struct net_device *dev, |
| 8331 | struct iw_request_info *info, |
| 8332 | union iwreq_data *wrqu, char *extra) |
| 8333 | { |
| 8334 | int ret; |
| 8335 | |
| 8336 | cds_ssr_protect(__func__); |
| 8337 | ret = __iw_set_fties(dev, info, wrqu, extra); |
| 8338 | cds_ssr_unprotect(__func__); |
| 8339 | |
| 8340 | return ret; |
| 8341 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8342 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8343 | /** |
| 8344 | * iw_set_dynamic_mcbc_filter() - Set Dynamic MCBC Filter ioctl handler |
| 8345 | * @dev: device upon which the ioctl was received |
| 8346 | * @info: ioctl request information |
| 8347 | * @wrqu: ioctl request data |
| 8348 | * @extra: ioctl extra data |
| 8349 | * |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8350 | * This IOCTL is OBSOLETE as of Jan 30, 2017. We are leaving it here for the |
| 8351 | * time being to provide guidance in migrating to standard APIs. |
| 8352 | * |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8353 | * Return: 0 on success, non-zero on error |
| 8354 | */ |
| 8355 | static int iw_set_dynamic_mcbc_filter(struct net_device *dev, |
| 8356 | struct iw_request_info *info, |
| 8357 | union iwreq_data *wrqu, |
| 8358 | char *extra) |
| 8359 | { |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8360 | hdd_err("\n" |
| 8361 | "setMCBCFilter is obsolete. Use the following instead:\n" |
| 8362 | "Configure multicast filtering via the ‘ip’ command.\n" |
| 8363 | "\tip maddr add 11:22:33:44:55:66 dev wlan0 # allow traffic to address\n" |
| 8364 | "\tip maddr del 11:22:33:44:55:66 dev wlan0 # undo allow\n" |
| 8365 | "Configure broadcast filtering via ini item, 'g_enable_non_arp_bc_hw_filter.'\n" |
| 8366 | "\tg_enable_non_arp_bc_hw_filter=1 # drop all non-ARP broadcast traffic\n" |
| 8367 | "\tg_enable_non_arp_bc_hw_filter=0 # allow all broadcast traffic"); |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 8368 | return -EINVAL; |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8369 | } |
| 8370 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8371 | /** |
| 8372 | * iw_set_host_offload - Set host offload ioctl handler |
| 8373 | * @dev: device upon which the ioctl was received |
| 8374 | * @info: ioctl request information |
| 8375 | * @wrqu: ioctl request data |
| 8376 | * @extra: ioctl extra data |
| 8377 | * |
| 8378 | * Return: 0 on success, non-zero on error |
| 8379 | */ |
| 8380 | static int __iw_set_host_offload(struct net_device *dev, |
| 8381 | struct iw_request_info *info, |
| 8382 | union iwreq_data *wrqu, char *extra) |
| 8383 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8384 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Srinivas Girigowda | 077143e | 2017-03-25 10:47:27 -0700 | [diff] [blame] | 8385 | struct host_offload_req *pRequest = (struct host_offload_req *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8386 | tSirHostOffloadReq offloadRequest; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8387 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8388 | int ret; |
| 8389 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8390 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8391 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8392 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8393 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8394 | if (0 != ret) |
| 8395 | return ret; |
| 8396 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8397 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8398 | if (0 != ret) |
| 8399 | return ret; |
| 8400 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8401 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8402 | hdd_err("dev is not in CONNECTED state, ignore!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8403 | return -EINVAL; |
| 8404 | } |
| 8405 | |
| 8406 | /* Debug display of request components. */ |
| 8407 | switch (pRequest->offloadType) { |
| 8408 | case WLAN_IPV4_ARP_REPLY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8409 | hdd_debug("Host offload request: ARP reply"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8410 | switch (pRequest->enableOrDisable) { |
| 8411 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8412 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8413 | break; |
| 8414 | case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8415 | hdd_debug(" BC Filtering enable"); |
Jeff Johnson | 00052dd | 2018-04-29 19:19:06 -0700 | [diff] [blame] | 8416 | /* fallthrough */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8417 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8418 | hdd_debug(" ARP offload enable"); |
| 8419 | hdd_debug(" IP address: %d.%d.%d.%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8420 | pRequest->params.hostIpv4Addr[0], |
| 8421 | pRequest->params.hostIpv4Addr[1], |
| 8422 | pRequest->params.hostIpv4Addr[2], |
| 8423 | pRequest->params.hostIpv4Addr[3]); |
| 8424 | } |
| 8425 | break; |
| 8426 | |
| 8427 | case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8428 | hdd_debug("Host offload request: neighbor discovery"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8429 | switch (pRequest->enableOrDisable) { |
| 8430 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8431 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8432 | break; |
| 8433 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8434 | hdd_debug(" enable"); |
| 8435 | hdd_debug(" IP address: %x:%x:%x:%x:%x:%x:%x:%x", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8436 | *(uint16_t *) (pRequest->params.hostIpv6Addr), |
| 8437 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8438 | 2), |
| 8439 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8440 | 4), |
| 8441 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8442 | 6), |
| 8443 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8444 | 8), |
| 8445 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8446 | 10), |
| 8447 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8448 | 12), |
| 8449 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 8450 | 14)); |
| 8451 | } |
| 8452 | } |
| 8453 | |
Hanumanth Reddy Pothula | 8fcade5 | 2017-12-01 13:49:40 +0530 | [diff] [blame] | 8454 | qdf_mem_zero(&offloadRequest, sizeof(offloadRequest)); |
| 8455 | offloadRequest.offloadType = pRequest->offloadType; |
| 8456 | offloadRequest.enableOrDisable = pRequest->enableOrDisable; |
| 8457 | qdf_mem_copy(&offloadRequest.params, &pRequest->params, |
| 8458 | sizeof(pRequest->params)); |
| 8459 | qdf_mem_copy(&offloadRequest.bssid, &pRequest->bssId.bytes, |
| 8460 | QDF_MAC_ADDR_SIZE); |
| 8461 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8462 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8463 | sme_set_host_offload(hdd_ctx->mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8464 | adapter->session_id, &offloadRequest)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8465 | hdd_err("Failure to execute host offload request"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8466 | return -EINVAL; |
| 8467 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8468 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8469 | return 0; |
| 8470 | } |
| 8471 | |
| 8472 | static int iw_set_host_offload(struct net_device *dev, |
| 8473 | struct iw_request_info *info, |
| 8474 | union iwreq_data *wrqu, char *extra) |
| 8475 | { |
| 8476 | int ret; |
| 8477 | |
| 8478 | cds_ssr_protect(__func__); |
| 8479 | ret = __iw_set_host_offload(dev, info, wrqu, extra); |
| 8480 | cds_ssr_unprotect(__func__); |
| 8481 | |
| 8482 | return ret; |
| 8483 | } |
| 8484 | |
| 8485 | /** |
| 8486 | * iw_set_keepalive_params - Set keepalive params ioctl handler |
| 8487 | * @dev: device upon which the ioctl was received |
| 8488 | * @info: ioctl request information |
| 8489 | * @wrqu: ioctl request data |
| 8490 | * @extra: ioctl extra data |
| 8491 | * |
| 8492 | * Return: 0 on success, non-zero on error |
| 8493 | */ |
| 8494 | static int __iw_set_keepalive_params(struct net_device *dev, |
| 8495 | struct iw_request_info *info, |
| 8496 | union iwreq_data *wrqu, char *extra) |
| 8497 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8498 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8499 | tpSirKeepAliveReq request = (tpSirKeepAliveReq) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8500 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8501 | int ret; |
| 8502 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8503 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8504 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8505 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8506 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8507 | if (0 != ret) |
| 8508 | return ret; |
| 8509 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8510 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8511 | if (0 != ret) |
| 8512 | return ret; |
| 8513 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8514 | if (wrqu->data.length != sizeof(*request)) { |
| 8515 | hdd_err("Invalid length %d", wrqu->data.length); |
| 8516 | return -EINVAL; |
| 8517 | } |
| 8518 | |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8519 | if (request->timePeriod > cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8520 | hdd_err("Value of timePeriod %d exceed Max limit %d", |
| 8521 | request->timePeriod, |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8522 | cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8523 | return -EINVAL; |
| 8524 | } |
| 8525 | |
| 8526 | /* Debug display of request components. */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8527 | hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8528 | request->timePeriod, sizeof(tSirKeepAliveReq)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8529 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8530 | switch (request->packetType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8531 | case WLAN_KEEP_ALIVE_NULL_PKT: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8532 | hdd_debug("Keep Alive Request: Tx NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8533 | break; |
| 8534 | |
| 8535 | case WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8536 | hdd_debug("Keep Alive Request: Tx UnSolicited ARP RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8537 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8538 | hdd_debug("Host IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8539 | request->hostIpv4Addr[0], request->hostIpv4Addr[1], |
| 8540 | request->hostIpv4Addr[2], request->hostIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8541 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8542 | hdd_debug("Dest IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8543 | request->destIpv4Addr[0], request->destIpv4Addr[1], |
| 8544 | request->destIpv4Addr[2], request->destIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8545 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8546 | hdd_debug("Dest MAC address: "MAC_ADDRESS_STR, |
Srinivas Girigowda | 9c330a9 | 2015-11-24 12:28:25 -0800 | [diff] [blame] | 8547 | MAC_ADDR_ARRAY(request->dest_macaddr.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8548 | break; |
| 8549 | } |
| 8550 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8551 | hdd_debug("Keep alive period %d", request->timePeriod); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8552 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8553 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8554 | sme_set_keep_alive(hdd_ctx->mac_handle, |
| 8555 | adapter->session_id, request)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8556 | hdd_err("Failure to execute Keep Alive"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8557 | return -EINVAL; |
| 8558 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8559 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8560 | return 0; |
| 8561 | } |
| 8562 | |
| 8563 | static int iw_set_keepalive_params(struct net_device *dev, |
| 8564 | struct iw_request_info *info, |
| 8565 | union iwreq_data *wrqu, |
| 8566 | char *extra) |
| 8567 | { |
| 8568 | int ret; |
| 8569 | |
| 8570 | cds_ssr_protect(__func__); |
| 8571 | ret = __iw_set_keepalive_params(dev, info, wrqu, extra); |
| 8572 | cds_ssr_unprotect(__func__); |
| 8573 | |
| 8574 | return ret; |
| 8575 | } |
| 8576 | |
| 8577 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 8578 | /** |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8579 | * validate_packet_filter_params_size() - Validate the size of the params rcvd |
| 8580 | * @priv_data: Pointer to the priv data from user space |
| 8581 | * @request: Pointer to the struct containing the copied data from user space |
| 8582 | * |
| 8583 | * Return: False on invalid length, true otherwise |
| 8584 | */ |
| 8585 | static bool validate_packet_filter_params_size(struct pkt_filter_cfg *request, |
| 8586 | uint16_t length) |
| 8587 | { |
| 8588 | int max_params_size, rcvd_params_size; |
| 8589 | |
| 8590 | max_params_size = HDD_MAX_CMP_PER_PACKET_FILTER * |
| 8591 | sizeof(struct pkt_filter_param_cfg); |
| 8592 | |
| 8593 | if (length < sizeof(struct pkt_filter_cfg) - max_params_size) { |
| 8594 | hdd_err("Less than minimum number of arguments needed"); |
| 8595 | return false; |
| 8596 | } |
| 8597 | |
| 8598 | rcvd_params_size = request->num_params * |
| 8599 | sizeof(struct pkt_filter_param_cfg); |
| 8600 | |
| 8601 | if (length != sizeof(struct pkt_filter_cfg) - |
| 8602 | max_params_size + rcvd_params_size) { |
| 8603 | hdd_err("Arguments do not match the number of params provided"); |
| 8604 | return false; |
| 8605 | } |
| 8606 | |
| 8607 | return true; |
| 8608 | } |
| 8609 | |
| 8610 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8611 | * __iw_set_packet_filter_params() - set packet filter parameters in target |
| 8612 | * @dev: Pointer to netdev |
| 8613 | * @info: Pointer to iw request info |
| 8614 | * @wrqu: Pointer to data |
| 8615 | * @extra: Pointer to extra data |
| 8616 | * |
| 8617 | * Return: 0 on success, non-zero on error |
| 8618 | */ |
| 8619 | static int __iw_set_packet_filter_params(struct net_device *dev, |
| 8620 | struct iw_request_info *info, |
| 8621 | union iwreq_data *wrqu, char *extra) |
| 8622 | { |
| 8623 | int ret; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8624 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8625 | struct iw_point priv_data; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8626 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8627 | struct pkt_filter_cfg *request = NULL; |
| 8628 | |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8629 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8630 | hdd_err("permission check failed"); |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8631 | return -EPERM; |
| 8632 | } |
| 8633 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8634 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8635 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8636 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8637 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8638 | if (0 != ret) |
| 8639 | return ret; |
| 8640 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8641 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8642 | if (0 != ret) |
| 8643 | return ret; |
| 8644 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8645 | if (hdd_priv_get_data(&priv_data, wrqu)) { |
| 8646 | hdd_err("failed to get priv data"); |
| 8647 | return -EINVAL; |
| 8648 | } |
| 8649 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8650 | if ((NULL == priv_data.pointer) || (0 == priv_data.length)) { |
Jeff Johnson | 36e74c4 | 2017-09-18 08:15:42 -0700 | [diff] [blame] | 8651 | hdd_err("invalid priv data %pK or invalid priv data length %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8652 | priv_data.pointer, priv_data.length); |
| 8653 | return -EINVAL; |
| 8654 | } |
| 8655 | |
Arun Khandavalli | 75d246b | 2017-08-07 19:46:06 +0530 | [diff] [blame] | 8656 | if (adapter->device_mode != QDF_STA_MODE) { |
| 8657 | hdd_err("Packet filter not supported for this mode :%d", |
| 8658 | adapter->device_mode); |
| 8659 | return -ENOTSUPP; |
| 8660 | } |
| 8661 | |
Mukul Sharma | be846bb | 2017-05-09 17:41:52 +0530 | [diff] [blame] | 8662 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
| 8663 | hdd_err("Packet filter not supported in disconnected state"); |
| 8664 | return -ENOTSUPP; |
| 8665 | } |
| 8666 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8667 | /* copy data using copy_from_user */ |
| 8668 | request = mem_alloc_copy_from_user_helper(priv_data.pointer, |
| 8669 | priv_data.length); |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8670 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8671 | if (NULL == request) { |
| 8672 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
| 8673 | return -ENOMEM; |
| 8674 | } |
| 8675 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8676 | if (!validate_packet_filter_params_size(request, priv_data.length)) { |
| 8677 | hdd_err("Invalid priv data length %d", priv_data.length); |
| 8678 | qdf_mem_free(request); |
| 8679 | return -EINVAL; |
| 8680 | } |
| 8681 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 8682 | if (request->filter_action == HDD_RCV_FILTER_SET) |
| 8683 | hdd_ctx->user_configured_pkt_filter_rules |= |
| 8684 | 1 << request->filter_id; |
| 8685 | else if (request->filter_action == HDD_RCV_FILTER_CLEAR) |
| 8686 | hdd_ctx->user_configured_pkt_filter_rules &= |
| 8687 | ~(1 << request->filter_id); |
| 8688 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8689 | ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8690 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 8691 | qdf_mem_free(request); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8692 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8693 | return ret; |
| 8694 | } |
| 8695 | |
| 8696 | /** |
| 8697 | * iw_set_packet_filter_params() - set packet filter parameters in target |
| 8698 | * @dev: Pointer to netdev |
| 8699 | * @info: Pointer to iw request info |
| 8700 | * @wrqu: Pointer to data |
| 8701 | * @extra: Pointer to extra data |
| 8702 | * |
| 8703 | * Return: 0 on success, non-zero on error |
| 8704 | */ |
| 8705 | static int iw_set_packet_filter_params(struct net_device *dev, |
| 8706 | struct iw_request_info *info, |
| 8707 | union iwreq_data *wrqu, char *extra) |
| 8708 | { |
| 8709 | int ret; |
| 8710 | |
| 8711 | cds_ssr_protect(__func__); |
| 8712 | ret = __iw_set_packet_filter_params(dev, info, wrqu, extra); |
| 8713 | cds_ssr_unprotect(__func__); |
| 8714 | |
| 8715 | return ret; |
| 8716 | } |
| 8717 | #endif |
| 8718 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8719 | #ifdef QCA_SUPPORT_CP_STATS |
| 8720 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
| 8721 | { |
| 8722 | return wlan_hdd_get_station_stats(adapter); |
| 8723 | } |
| 8724 | #else /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8725 | struct hdd_statistics_priv { |
| 8726 | tCsrSummaryStatsInfo summary_stats; |
| 8727 | tCsrGlobalClassAStatsInfo class_a_stats; |
| 8728 | tCsrGlobalClassDStatsInfo class_d_stats; |
| 8729 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8730 | |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8731 | /** |
| 8732 | * hdd_statistics_cb() - "Get statistics" callback function |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8733 | * @stats: statistics payload |
| 8734 | * @context: opaque context originally passed to SME. HDD always passes |
| 8735 | * a cookie for the request context |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8736 | * |
| 8737 | * Return: None |
| 8738 | */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8739 | static void hdd_statistics_cb(void *stats, void *context) |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8740 | { |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8741 | struct osif_request *request; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8742 | struct hdd_statistics_priv *priv; |
| 8743 | tCsrSummaryStatsInfo *summary_stats; |
| 8744 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8745 | tCsrGlobalClassDStatsInfo *class_d_stats; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8746 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8747 | request = osif_request_get(context); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8748 | if (!request) { |
| 8749 | hdd_err("Obsolete request"); |
| 8750 | return; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8751 | } |
| 8752 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8753 | priv = osif_request_priv(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8754 | |
| 8755 | summary_stats = (tCsrSummaryStatsInfo *)stats; |
| 8756 | priv->summary_stats = *summary_stats; |
| 8757 | |
| 8758 | class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); |
| 8759 | priv->class_a_stats = *class_a_stats; |
| 8760 | |
| 8761 | class_d_stats = (tCsrGlobalClassDStatsInfo *)(class_a_stats + 1); |
| 8762 | priv->class_d_stats = *class_d_stats; |
| 8763 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8764 | osif_request_complete(request); |
| 8765 | osif_request_put(request); |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8766 | } |
| 8767 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8768 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8769 | { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8770 | int ret = 0; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8771 | void *cookie; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8772 | QDF_STATUS status; |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8773 | struct osif_request *request; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8774 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8775 | struct hdd_statistics_priv *priv; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8776 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8777 | static const struct osif_request_params params = { |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8778 | .priv_size = sizeof(*priv), |
| 8779 | .timeout_ms = WLAN_WAIT_TIME_STATS, |
| 8780 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8781 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8782 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8783 | request = osif_request_alloc(¶ms); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8784 | if (!request) { |
| 8785 | hdd_warn("request allocation failed"); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8786 | return -EINVAL; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8787 | } |
| 8788 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8789 | cookie = osif_request_cookie(request); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8790 | status = sme_get_statistics(hdd_ctx->mac_handle, eCSR_HDD, |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8791 | SME_SUMMARY_STATS | |
| 8792 | SME_GLOBAL_CLASSA_STATS | |
| 8793 | SME_GLOBAL_CLASSD_STATS, |
| 8794 | hdd_statistics_cb, |
| 8795 | sta_ctx->conn_info.staId[0], |
| 8796 | cookie, adapter->session_id); |
| 8797 | |
| 8798 | if (QDF_STATUS_SUCCESS != status) { |
| 8799 | hdd_warn("Unable to retrieve SME statistics"); |
| 8800 | goto put_request; |
| 8801 | } |
| 8802 | |
| 8803 | /* request was sent -- wait for the response */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8804 | ret = osif_request_wait_for_response(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8805 | if (ret) { |
| 8806 | hdd_err("Failed to wait for statistics, errno %d", ret); |
| 8807 | goto put_request; |
| 8808 | } |
| 8809 | |
| 8810 | /* update the adapter cache with the fresh results */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8811 | priv = osif_request_priv(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8812 | adapter->hdd_stats.summary_stat = priv->summary_stats; |
| 8813 | adapter->hdd_stats.class_a_stat = priv->class_a_stats; |
| 8814 | adapter->hdd_stats.class_d_stat = priv->class_d_stats; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8815 | |
| 8816 | put_request: |
| 8817 | /* |
| 8818 | * either we never sent a request, we sent a request and |
| 8819 | * received a response or we sent a request and timed out. |
| 8820 | * regardless we are done with the request. |
| 8821 | */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8822 | osif_request_put(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8823 | return ret; |
| 8824 | } |
| 8825 | #endif /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8826 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8827 | static int __iw_get_statistics(struct net_device *dev, |
| 8828 | struct iw_request_info *info, |
| 8829 | union iwreq_data *wrqu, char *extra) |
| 8830 | { |
| 8831 | int ret; |
| 8832 | char *p; |
| 8833 | int tlen; |
| 8834 | struct hdd_station_ctx *sta_ctx; |
| 8835 | tCsrSummaryStatsInfo *summary_stats; |
| 8836 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8837 | tCsrGlobalClassDStatsInfo *class_d_stats; |
| 8838 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 8839 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8840 | |
| 8841 | hdd_enter_dev(dev); |
| 8842 | |
| 8843 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8844 | if (0 != ret) |
| 8845 | return ret; |
| 8846 | |
| 8847 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8848 | if (0 != ret) |
| 8849 | return ret; |
| 8850 | |
| 8851 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 8852 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
| 8853 | wrqu->data.length = 0; |
| 8854 | return 0; |
| 8855 | } |
| 8856 | |
| 8857 | hdd_get_wlan_stats(adapter); |
| 8858 | |
| 8859 | summary_stats = &(adapter->hdd_stats.summary_stat); |
| 8860 | class_a_stats = &(adapter->hdd_stats.class_a_stat); |
| 8861 | class_d_stats = &(adapter->hdd_stats.class_d_stat); |
| 8862 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8863 | p = extra; |
| 8864 | tlen = 0; |
| 8865 | |
| 8866 | FILL_TLV(p, WLAN_STATS_RETRY_CNT, |
| 8867 | sizeof(summary_stats->retry_cnt), |
| 8868 | &(summary_stats->retry_cnt[0]), tlen); |
| 8869 | |
| 8870 | FILL_TLV(p, WLAN_STATS_MUL_RETRY_CNT, |
| 8871 | sizeof(summary_stats->multiple_retry_cnt), |
| 8872 | &(summary_stats->multiple_retry_cnt[0]), tlen); |
| 8873 | |
| 8874 | FILL_TLV(p, WLAN_STATS_TX_FRM_CNT, |
| 8875 | sizeof(summary_stats->tx_frm_cnt), |
| 8876 | &(summary_stats->tx_frm_cnt[0]), tlen); |
| 8877 | |
| 8878 | FILL_TLV(p, WLAN_STATS_RX_FRM_CNT, |
| 8879 | sizeof(summary_stats->rx_frm_cnt), |
| 8880 | &(summary_stats->rx_frm_cnt), tlen); |
| 8881 | |
| 8882 | FILL_TLV(p, WLAN_STATS_FRM_DUP_CNT, |
| 8883 | sizeof(summary_stats->frm_dup_cnt), |
| 8884 | &(summary_stats->frm_dup_cnt), tlen); |
| 8885 | |
| 8886 | FILL_TLV(p, WLAN_STATS_FAIL_CNT, |
| 8887 | sizeof(summary_stats->fail_cnt), |
| 8888 | &(summary_stats->fail_cnt[0]), tlen); |
| 8889 | |
| 8890 | FILL_TLV(p, WLAN_STATS_RTS_FAIL_CNT, |
| 8891 | sizeof(summary_stats->rts_fail_cnt), |
| 8892 | &(summary_stats->rts_fail_cnt), tlen); |
| 8893 | |
| 8894 | FILL_TLV(p, WLAN_STATS_ACK_FAIL_CNT, |
| 8895 | sizeof(summary_stats->ack_fail_cnt), |
| 8896 | &(summary_stats->ack_fail_cnt), tlen); |
| 8897 | |
| 8898 | FILL_TLV(p, WLAN_STATS_RTS_SUC_CNT, |
| 8899 | sizeof(summary_stats->rts_succ_cnt), |
| 8900 | &(summary_stats->rts_succ_cnt), tlen); |
| 8901 | |
| 8902 | FILL_TLV(p, WLAN_STATS_RX_DISCARD_CNT, |
| 8903 | sizeof(summary_stats->rx_discard_cnt), |
| 8904 | &(summary_stats->rx_discard_cnt), tlen); |
| 8905 | |
| 8906 | FILL_TLV(p, WLAN_STATS_RX_ERROR_CNT, |
| 8907 | sizeof(summary_stats->rx_error_cnt), |
| 8908 | &(summary_stats->rx_error_cnt), tlen); |
| 8909 | |
| 8910 | FILL_TLV(p, WLAN_STATS_TX_BYTE_CNT, |
| 8911 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8912 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8913 | |
| 8914 | FILL_TLV(p, WLAN_STATS_RX_BYTE_CNT, |
| 8915 | sizeof(class_d_stats->rx_byte_cnt), |
| 8916 | &(class_d_stats->rx_byte_cnt), tlen); |
| 8917 | |
| 8918 | FILL_TLV(p, WLAN_STATS_RX_RATE, |
| 8919 | sizeof(class_d_stats->rx_rate), |
| 8920 | &(class_d_stats->rx_rate), tlen); |
| 8921 | |
| 8922 | /* Transmit rate, in units of 500 kbit/sec */ |
| 8923 | FILL_TLV(p, WLAN_STATS_TX_RATE, |
| 8924 | sizeof(class_a_stats->tx_rate), |
| 8925 | &(class_a_stats->tx_rate), tlen); |
| 8926 | |
| 8927 | FILL_TLV(p, WLAN_STATS_RX_UC_BYTE_CNT, |
| 8928 | sizeof(class_d_stats->rx_uc_byte_cnt[0]), |
| 8929 | &(class_d_stats->rx_uc_byte_cnt[0]), tlen); |
| 8930 | FILL_TLV(p, WLAN_STATS_RX_MC_BYTE_CNT, |
| 8931 | sizeof(class_d_stats->rx_mc_byte_cnt), |
| 8932 | &(class_d_stats->rx_mc_byte_cnt), tlen); |
| 8933 | FILL_TLV(p, WLAN_STATS_RX_BC_BYTE_CNT, |
| 8934 | sizeof(class_d_stats->rx_bc_byte_cnt), |
| 8935 | &(class_d_stats->rx_bc_byte_cnt), tlen); |
| 8936 | FILL_TLV(p, WLAN_STATS_TX_UC_BYTE_CNT, |
| 8937 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8938 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8939 | FILL_TLV(p, WLAN_STATS_TX_MC_BYTE_CNT, |
| 8940 | sizeof(class_d_stats->tx_mc_byte_cnt), |
| 8941 | &(class_d_stats->tx_mc_byte_cnt), tlen); |
| 8942 | FILL_TLV(p, WLAN_STATS_TX_BC_BYTE_CNT, |
| 8943 | sizeof(class_d_stats->tx_bc_byte_cnt), |
| 8944 | &(class_d_stats->tx_bc_byte_cnt), tlen); |
| 8945 | |
| 8946 | wrqu->data.length = tlen; |
| 8947 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8948 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8949 | |
| 8950 | return 0; |
| 8951 | } |
| 8952 | |
| 8953 | static int iw_get_statistics(struct net_device *dev, |
| 8954 | struct iw_request_info *info, |
| 8955 | union iwreq_data *wrqu, char *extra) |
| 8956 | { |
| 8957 | int ret; |
| 8958 | |
| 8959 | cds_ssr_protect(__func__); |
| 8960 | ret = __iw_get_statistics(dev, info, wrqu, extra); |
| 8961 | cds_ssr_unprotect(__func__); |
| 8962 | |
| 8963 | return ret; |
| 8964 | } |
| 8965 | |
| 8966 | #ifdef FEATURE_WLAN_SCAN_PNO |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8967 | /*Max Len for PNO notification*/ |
| 8968 | #define MAX_PNO_NOTIFY_LEN 100 |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8969 | static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev, |
| 8970 | struct scan_event *event, void *args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8971 | { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8972 | struct vdev_osif_priv *osif_priv; |
| 8973 | struct wireless_dev *wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8974 | union iwreq_data wrqu; |
| 8975 | char buf[MAX_PNO_NOTIFY_LEN + 1]; |
| 8976 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8977 | wlan_vdev_obj_lock(vdev); |
| 8978 | osif_priv = wlan_vdev_get_ospriv(vdev); |
| 8979 | wlan_vdev_obj_unlock(vdev); |
| 8980 | if (!osif_priv) { |
| 8981 | hdd_err("osif_priv is null"); |
| 8982 | return; |
| 8983 | } |
| 8984 | |
| 8985 | wdev = osif_priv->wdev; |
| 8986 | if (!wdev) { |
| 8987 | hdd_err("wdev is null"); |
| 8988 | return; |
| 8989 | } |
| 8990 | |
| 8991 | hdd_debug("A preferred network was found"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8992 | |
| 8993 | /* create the event */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8994 | qdf_mem_zero(&wrqu, sizeof(wrqu)); |
| 8995 | qdf_mem_zero(buf, sizeof(buf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8996 | |
| 8997 | snprintf(buf, MAX_PNO_NOTIFY_LEN, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8998 | "QCOM: Found preferred network:"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8999 | |
| 9000 | wrqu.data.pointer = buf; |
| 9001 | wrqu.data.length = strlen(buf); |
| 9002 | |
| 9003 | /* send the event */ |
| 9004 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9005 | wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9006 | } |
| 9007 | |
| 9008 | /** |
| 9009 | * __iw_set_pno() - Preferred Network Offload ioctl handler |
| 9010 | * @dev: device upon which the ioctl was received |
| 9011 | * @info: ioctl request information |
| 9012 | * @wrqu: ioctl request data |
| 9013 | * @extra: ioctl extra data |
| 9014 | * |
| 9015 | * This function parses a Preferred Network Offload command |
| 9016 | * Input is string based and expected to be of the form: |
| 9017 | * |
| 9018 | * <enable(1) | disable(0)> |
| 9019 | * when enabling: |
| 9020 | * <number of networks> |
| 9021 | * for each network: |
| 9022 | * <ssid_len> <ssid> <authentication> <encryption> |
| 9023 | * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9024 | * <scan_time (seconds)> |
| 9025 | * <scan_repeat_count (0 means indefinite)> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9026 | * <suspend mode> |
| 9027 | * |
| 9028 | * e.g: |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9029 | * 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 5 2 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9030 | * |
| 9031 | * this translates into: |
| 9032 | * ----------------------------- |
| 9033 | * enable PNO |
| 9034 | * 2 networks |
| 9035 | * Network 1: |
| 9036 | * test - with authentication type 0 and encryption type 0, |
| 9037 | * search on 3 channels: 1 6 and 11, |
| 9038 | * SSID bcast type is unknown (directed probe will be sent if |
| 9039 | * AP not found) and must meet -40dBm RSSI |
| 9040 | * Network 2: |
| 9041 | * test2 - with authentication type 4 and encryption type 4, |
| 9042 | * search on 6 channels 1, 2, 3, 4, 5 and 6 |
| 9043 | * bcast type is non-bcast (directed probe will be sent) |
| 9044 | * and must not meet any RSSI threshold |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9045 | * scan every 5 seconds 2 times |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9046 | * enable on suspend |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9047 | */ |
| 9048 | static int __iw_set_pno(struct net_device *dev, |
| 9049 | struct iw_request_info *info, |
| 9050 | union iwreq_data *wrqu, char *extra) |
| 9051 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9052 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9053 | struct hdd_context *hdd_ctx; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9054 | uint8_t value; |
| 9055 | struct wlan_objmgr_vdev *vdev; |
| 9056 | struct wlan_objmgr_psoc *psoc; |
| 9057 | int ret = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9058 | int offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9059 | char *ptr, *data; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9060 | uint8_t i, j, params; |
| 9061 | QDF_STATUS status; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9062 | size_t len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9063 | |
| 9064 | /* request is a large struct, so we make it static to avoid |
| 9065 | * stack overflow. This API is only invoked via ioctl, so it |
| 9066 | * is serialized by the kernel rtnl_lock and hence does not |
| 9067 | * need to be reentrant |
| 9068 | */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9069 | static struct pno_scan_req_params req; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9070 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9071 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9072 | |
| 9073 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9074 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9075 | if (ret) |
| 9076 | return ret; |
| 9077 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9078 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9079 | if (0 != ret) |
| 9080 | return ret; |
| 9081 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9082 | vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->pdev, |
| 9083 | dev->dev_addr, |
| 9084 | WLAN_LEGACY_MAC_ID); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9085 | if (!vdev) { |
| 9086 | hdd_err("vdev object is NULL"); |
| 9087 | return -EIO; |
| 9088 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9089 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9090 | /* making sure argument string ends with '\0' */ |
| 9091 | len = (wrqu->data.length + 1); |
| 9092 | data = qdf_mem_malloc(len); |
| 9093 | if (!data) { |
| 9094 | hdd_err("fail to allocate memory %zu", len); |
| 9095 | return -EINVAL; |
| 9096 | } |
| 9097 | qdf_mem_copy(data, extra, (len-1)); |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9098 | ptr = data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9099 | |
Hanumanth Reddy Pothula | 3048c93 | 2018-05-15 12:43:39 +0530 | [diff] [blame] | 9100 | hdd_debug("PNO data len %d data %s", wrqu->data.length, data); |
| 9101 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9102 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9103 | hdd_err("PNO enable input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9104 | ret = -EINVAL; |
| 9105 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9106 | } |
| 9107 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9108 | if (!value) { |
| 9109 | status = ucfg_scan_pno_stop(vdev); |
| 9110 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9111 | hdd_err("Failed to disabled PNO"); |
| 9112 | ret = -EINVAL; |
| 9113 | } else { |
| 9114 | hdd_debug("PNO scan disabled"); |
| 9115 | } |
| 9116 | goto exit; |
| 9117 | } |
| 9118 | |
| 9119 | if (ucfg_scan_get_pno_in_progress(vdev)) { |
| 9120 | hdd_debug("pno is already in progress"); |
| 9121 | ret = -EBUSY; |
| 9122 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9123 | } |
| 9124 | |
| 9125 | ptr += offset; |
| 9126 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9127 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9128 | hdd_err("PNO count input not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9129 | ret = -EINVAL; |
| 9130 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9131 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9132 | req.networks_cnt = value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9133 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9134 | hdd_debug("PNO enable networks count %d offset %d", |
| 9135 | req.networks_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9136 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9137 | if ((0 == req.networks_cnt) || |
| 9138 | (req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9139 | hdd_err("Network count %d invalid", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9140 | req.networks_cnt); |
| 9141 | ret = -EINVAL; |
| 9142 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9143 | } |
| 9144 | |
| 9145 | ptr += offset; |
| 9146 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9147 | for (i = 0; i < req.networks_cnt; i++) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9148 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9149 | req.networks_list[i].ssid.length = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9150 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9151 | params = sscanf(ptr, " %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9152 | &(req.networks_list[i].ssid.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9153 | &offset); |
| 9154 | |
| 9155 | if (1 != params) { |
| 9156 | hdd_err("PNO ssid length input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9157 | ret = -EINVAL; |
| 9158 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9159 | } |
| 9160 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9161 | if ((0 == req.networks_list[i].ssid.length) || |
| 9162 | (req.networks_list[i].ssid.length > 32)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9163 | hdd_err("SSID Len %d is not correct for network %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9164 | req.networks_list[i].ssid.length, i); |
| 9165 | ret = -EINVAL; |
| 9166 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9167 | } |
| 9168 | |
| 9169 | /* Advance to SSID */ |
| 9170 | ptr += offset; |
| 9171 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9172 | memcpy(req.networks_list[i].ssid.ssid, ptr, |
| 9173 | req.networks_list[i].ssid.length); |
| 9174 | ptr += req.networks_list[i].ssid.length; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9175 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9176 | params = sscanf(ptr, " %u %u %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9177 | &(req.networks_list[i].authentication), |
| 9178 | &(req.networks_list[i].encryption), |
| 9179 | &(req.networks_list[i].channel_cnt), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9180 | &offset); |
| 9181 | |
| 9182 | if (3 != params) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9183 | hdd_err("Incorrect cmd %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9184 | ret = -EINVAL; |
| 9185 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9186 | } |
| 9187 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9188 | hdd_debug("PNO len %d ssid %.*s auth %d encry %d channel count %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9189 | req.networks_list[i].ssid.length, |
| 9190 | req.networks_list[i].ssid.length, |
| 9191 | req.networks_list[i].ssid.ssid, |
| 9192 | req.networks_list[i].authentication, |
| 9193 | req.networks_list[i].encryption, |
| 9194 | req.networks_list[i].channel_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9195 | |
| 9196 | /* Advance to channel list */ |
| 9197 | ptr += offset; |
| 9198 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9199 | if (SCAN_PNO_MAX_NETW_CHANNELS_EX < |
| 9200 | req.networks_list[i].channel_cnt) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9201 | hdd_err("Incorrect number of channels"); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9202 | ret = -EINVAL; |
| 9203 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9204 | } |
| 9205 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9206 | if (0 != req.networks_list[i].channel_cnt) { |
| 9207 | for (j = 0; j < req.networks_list[i].channel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9208 | j++) { |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9209 | if (1 != sscanf(ptr, " %hhu %n", &value, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9210 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9211 | hdd_err("PNO network channel is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9212 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9213 | ret = -EINVAL; |
| 9214 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9215 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9216 | if (!IS_CHANNEL_VALID(value)) { |
| 9217 | hdd_err("invalid channel: %hhu", value); |
| 9218 | ret = -EINVAL; |
| 9219 | goto exit; |
| 9220 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9221 | req.networks_list[i].channels[j] = |
| 9222 | cds_chan_to_freq(value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9223 | /* Advance to next channel number */ |
| 9224 | ptr += offset; |
| 9225 | } |
| 9226 | } |
| 9227 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9228 | if (1 != sscanf(ptr, " %u %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9229 | &(req.networks_list[i].bc_new_type), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9230 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9231 | hdd_err("PNO broadcast network type is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9232 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9233 | ret = -EINVAL; |
| 9234 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9235 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9236 | if (req.networks_list[i].bc_new_type > 2) { |
| 9237 | hdd_err("invalid bcast nw type: %u", |
| 9238 | req.networks_list[i].bc_new_type); |
| 9239 | ret = -EINVAL; |
| 9240 | goto exit; |
| 9241 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9242 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9243 | hdd_debug("PNO bcastNetwType %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9244 | req.networks_list[i].bc_new_type, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9245 | |
| 9246 | /* Advance to rssi Threshold */ |
| 9247 | ptr += offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9248 | if (1 != sscanf(ptr, " %d %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9249 | &(req.networks_list[i].rssi_thresh), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9250 | &offset)) { |
| 9251 | hdd_err("PNO rssi threshold input is not valid %s", |
| 9252 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9253 | ret = -EINVAL; |
| 9254 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9255 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9256 | hdd_debug("PNO rssi %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9257 | req.networks_list[i].rssi_thresh, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9258 | /* Advance to next network */ |
| 9259 | ptr += offset; |
| 9260 | } /* For ucNetworkCount */ |
| 9261 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9262 | req.fast_scan_period = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9263 | if (sscanf(ptr, " %u %n", &(req.fast_scan_period), &offset) > 0) { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9264 | req.fast_scan_period *= MSEC_PER_SEC; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9265 | ptr += offset; |
| 9266 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9267 | if (req.fast_scan_period == 0) { |
| 9268 | hdd_err("invalid fast scan period %u", |
| 9269 | req.fast_scan_period); |
| 9270 | ret = -EINVAL; |
| 9271 | goto exit; |
| 9272 | } |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9273 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9274 | req.fast_scan_max_cycles = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9275 | if (sscanf(ptr, " %hhu %n", &value, |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9276 | &offset) > 0) |
| 9277 | ptr += offset; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9278 | req.fast_scan_max_cycles = value; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9279 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9280 | wlan_pdev_obj_lock(hdd_ctx->pdev); |
| 9281 | psoc = wlan_pdev_get_psoc(hdd_ctx->pdev); |
| 9282 | wlan_pdev_obj_unlock(hdd_ctx->pdev); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9283 | ucfg_scan_register_pno_cb(psoc, |
| 9284 | found_pref_network_cb, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9285 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9286 | ucfg_scan_get_pno_def_params(vdev, &req); |
| 9287 | status = ucfg_scan_pno_start(vdev, &req); |
| 9288 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9289 | hdd_err("Failed to enable PNO"); |
| 9290 | ret = -EINVAL; |
| 9291 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9292 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9293 | exit: |
| 9294 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9295 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9296 | qdf_mem_free(data); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9297 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9298 | } |
| 9299 | |
| 9300 | static int iw_set_pno(struct net_device *dev, |
| 9301 | struct iw_request_info *info, |
| 9302 | union iwreq_data *wrqu, char *extra) |
| 9303 | { |
| 9304 | int ret; |
| 9305 | |
| 9306 | cds_ssr_protect(__func__); |
| 9307 | ret = __iw_set_pno(dev, info, wrqu, extra); |
| 9308 | cds_ssr_unprotect(__func__); |
| 9309 | |
| 9310 | return ret; |
| 9311 | } |
| 9312 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 9313 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9314 | static int __iw_set_band_config(struct net_device *dev, |
| 9315 | struct iw_request_info *info, |
| 9316 | union iwreq_data *wrqu, char *extra) |
| 9317 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9318 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9319 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9320 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9321 | int *value = (int *)extra; |
| 9322 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9323 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9324 | |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9325 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9326 | hdd_err("permission check failed"); |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9327 | return -EPERM; |
| 9328 | } |
| 9329 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9330 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9331 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9332 | if (0 != ret) |
| 9333 | return ret; |
| 9334 | |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 9335 | return hdd_reg_set_band(dev, value[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9336 | } |
| 9337 | |
| 9338 | static int iw_set_band_config(struct net_device *dev, |
| 9339 | struct iw_request_info *info, |
| 9340 | union iwreq_data *wrqu, char *extra) |
| 9341 | { |
| 9342 | int ret; |
| 9343 | |
| 9344 | cds_ssr_protect(__func__); |
| 9345 | ret = __iw_set_band_config(dev, info, wrqu, extra); |
| 9346 | cds_ssr_unprotect(__func__); |
| 9347 | |
| 9348 | return ret; |
| 9349 | } |
| 9350 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9351 | static int printk_adapter(void *priv, const char *fmt, ...) |
| 9352 | { |
| 9353 | int ret; |
| 9354 | va_list args; |
| 9355 | |
| 9356 | va_start(args, fmt); |
| 9357 | ret = vprintk(fmt, args); |
| 9358 | ret += printk("\n"); |
| 9359 | va_end(args); |
| 9360 | |
| 9361 | return ret; |
| 9362 | } |
| 9363 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9364 | static void hdd_ioctl_log_buffer(int log_id, uint32_t count) |
| 9365 | { |
| 9366 | qdf_abstract_print *print = &printk_adapter; |
| 9367 | |
| 9368 | switch (log_id) { |
| 9369 | case HTC_CREDIT_HISTORY_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9370 | cds_print_htc_credit_history(count, print, NULL); |
| 9371 | break; |
| 9372 | case COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9373 | wma_print_wmi_cmd_log(count, print, NULL); |
| 9374 | break; |
| 9375 | case COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9376 | wma_print_wmi_cmd_tx_cmp_log(count, print, NULL); |
| 9377 | break; |
| 9378 | case MGMT_COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9379 | wma_print_wmi_mgmt_cmd_log(count, print, NULL); |
| 9380 | break; |
| 9381 | case MGMT_COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9382 | wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL); |
| 9383 | break; |
| 9384 | case EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9385 | wma_print_wmi_event_log(count, print, NULL); |
| 9386 | break; |
| 9387 | case RX_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9388 | wma_print_wmi_rx_event_log(count, print, NULL); |
| 9389 | break; |
| 9390 | case MGMT_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9391 | wma_print_wmi_mgmt_event_log(count, print, NULL); |
| 9392 | break; |
| 9393 | default: |
| 9394 | print(NULL, "Invalid Log Id %d", log_id); |
| 9395 | break; |
| 9396 | } |
| 9397 | } |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9398 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9399 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
| 9400 | int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2) |
| 9401 | { |
| 9402 | struct hdd_context *hdd_ctx; |
| 9403 | int ret; |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9404 | bool crash_inject; |
| 9405 | QDF_STATUS status; |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9406 | |
| 9407 | hdd_debug("WE_SET_FW_CRASH_INJECT: %d %d", |
| 9408 | v1, v2); |
| 9409 | pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n", |
| 9410 | v1, v2); |
| 9411 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9412 | |
Vignesh Viswanathan | a1f3a1a | 2018-10-04 13:10:46 +0530 | [diff] [blame] | 9413 | status = ucfg_mlme_get_crash_inject(hdd_ctx->psoc, &crash_inject); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9414 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9415 | hdd_err("Failed to get crash inject ini config"); |
| 9416 | return 0; |
| 9417 | } |
| 9418 | |
| 9419 | if (!crash_inject) { |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9420 | hdd_err("Crash Inject ini disabled, Ignore Crash Inject"); |
| 9421 | return 0; |
| 9422 | } |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9423 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9424 | if (v1 == 3) { |
| 9425 | cds_trigger_recovery(QDF_REASON_UNSPECIFIED); |
| 9426 | return 0; |
| 9427 | } |
| 9428 | ret = wma_cli_set2_command(adapter->session_id, |
| 9429 | GEN_PARAM_CRASH_INJECT, |
| 9430 | v1, v2, GEN_CMD); |
| 9431 | return ret; |
| 9432 | } |
| 9433 | #endif |
| 9434 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9435 | #ifdef CONFIG_DP_TRACE |
| 9436 | void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) |
| 9437 | { |
| 9438 | hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d", |
| 9439 | cmd_type, count); |
| 9440 | if (cmd_type == DUMP_DP_TRACE) |
| 9441 | qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID); |
| 9442 | else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE) |
| 9443 | qdf_dp_trace_enable_live_mode(); |
| 9444 | else if (cmd_type == CLEAR_DP_TRACE_BUFFER) |
| 9445 | qdf_dp_trace_clear_buffer(); |
| 9446 | else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE) |
| 9447 | qdf_dp_trace_disable_live_mode(); |
| 9448 | } |
| 9449 | #endif |
| 9450 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9451 | static int __iw_set_two_ints_getnone(struct net_device *dev, |
| 9452 | struct iw_request_info *info, |
| 9453 | union iwreq_data *wrqu, char *extra) |
| 9454 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9455 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9456 | int *value = (int *)extra; |
| 9457 | int sub_cmd = value[0]; |
| 9458 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9459 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9460 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9461 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9462 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9463 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 9464 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9465 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9466 | if (0 != ret) |
| 9467 | return ret; |
| 9468 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9469 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9470 | if (0 != ret) |
| 9471 | return ret; |
| 9472 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9473 | switch (sub_cmd) { |
| 9474 | case WE_SET_SMPS_PARAM: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9475 | hdd_debug("WE_SET_SMPS_PARAM val %d %d", value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 9476 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9477 | WMI_STA_SMPS_PARAM_CMDID, |
| 9478 | value[1] << WMA_SMPS_PARAM_VALUE_S |
| 9479 | | value[2], |
| 9480 | VDEV_CMD); |
| 9481 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9482 | case WE_SET_FW_CRASH_INJECT: |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9483 | ret = hdd_crash_inject(adapter, value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9484 | break; |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9485 | case WE_ENABLE_FW_PROFILE: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9486 | hdd_err("WE_ENABLE_FW_PROFILE: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9487 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 9488 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9489 | WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, |
| 9490 | value[1], value[2], DBG_CMD); |
| 9491 | break; |
| 9492 | case WE_SET_FW_PROFILE_HIST_INTVL: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9493 | hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9494 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 9495 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9496 | WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, |
| 9497 | value[1], value[2], DBG_CMD); |
| 9498 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9499 | case WE_SET_DUAL_MAC_FW_MODE_CONFIG: |
| 9500 | hdd_debug("Ioctl to set dual fw mode config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9501 | status = |
| 9502 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 9503 | &dual_mac_feature); |
| 9504 | if (status != QDF_STATUS_SUCCESS) |
| 9505 | hdd_err("can't get dual mac feature val, use def"); |
| 9506 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9507 | hdd_err("Dual mac feature is disabled from INI"); |
| 9508 | return -EPERM; |
| 9509 | } |
| 9510 | hdd_debug("%d %d", value[1], value[2]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 9511 | policy_mgr_set_dual_mac_fw_mode_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 9512 | value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9513 | break; |
| 9514 | case WE_DUMP_DP_TRACE_LEVEL: |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9515 | hdd_set_dump_dp_trace(value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9516 | break; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9517 | case WE_SET_MON_MODE_CHAN: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9518 | ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9519 | break; |
Rajeev Kumar | 15b40a2 | 2018-04-12 11:45:24 -0700 | [diff] [blame] | 9520 | case WE_SET_WLAN_SUSPEND: |
Dustin Brown | 5409643 | 2017-02-23 13:00:44 -0800 | [diff] [blame] | 9521 | ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, |
| 9522 | value[1], value[2]); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9523 | break; |
| 9524 | case WE_SET_WLAN_RESUME: |
Dustin Brown | bc81a47 | 2016-10-26 16:56:59 -0700 | [diff] [blame] | 9525 | ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9526 | break; |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9527 | case WE_LOG_BUFFER: { |
| 9528 | int log_id = value[1]; |
| 9529 | uint32_t count = value[2] < 0 ? 0 : value[2]; |
| 9530 | |
| 9531 | hdd_ioctl_log_buffer(log_id, count); |
| 9532 | |
| 9533 | break; |
| 9534 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 9535 | case WE_SET_BA_AGEING_TIMEOUT: |
| 9536 | { |
| 9537 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 9538 | |
| 9539 | if (!soc) { |
| 9540 | hdd_err("Invalid handles"); |
| 9541 | break; |
| 9542 | } |
| 9543 | cdp_set_ba_timeout(soc, value[1], value[2]); |
| 9544 | break; |
| 9545 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9546 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9547 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9548 | break; |
| 9549 | } |
| 9550 | |
| 9551 | return ret; |
| 9552 | } |
| 9553 | |
| 9554 | static int iw_set_two_ints_getnone(struct net_device *dev, |
| 9555 | struct iw_request_info *info, |
| 9556 | union iwreq_data *wrqu, char *extra) |
| 9557 | { |
| 9558 | int ret; |
| 9559 | |
| 9560 | cds_ssr_protect(__func__); |
| 9561 | ret = __iw_set_two_ints_getnone(dev, info, wrqu, extra); |
| 9562 | cds_ssr_unprotect(__func__); |
| 9563 | |
| 9564 | return ret; |
| 9565 | } |
| 9566 | |
| 9567 | /* Define the Wireless Extensions to the Linux Network Device structure */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9568 | |
| 9569 | static const iw_handler we_private[] = { |
| 9570 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9571 | [WLAN_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_setint_getnone, |
| 9572 | [WLAN_PRIV_SET_NONE_GET_INT - SIOCIWFIRSTPRIV] = iw_setnone_getint, |
| 9573 | [WLAN_PRIV_SET_CHAR_GET_NONE - SIOCIWFIRSTPRIV] = iw_setchar_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9574 | [WLAN_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9575 | iw_set_three_ints_getnone, |
| 9576 | [WLAN_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] = iw_get_char_setnone, |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9577 | [WLAN_PRIV_SET_NONE_GET_NONE - SIOCIWFIRSTPRIV] = iw_setnone_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9578 | [WLAN_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9579 | iw_hdd_set_var_ints_getnone, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9580 | [WLAN_PRIV_SET_NONE_GET_THREE_INT - SIOCIWFIRSTPRIV] = |
| 9581 | iw_setnone_get_threeint, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9582 | #ifdef WLAN_FEATURE_FIPS |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 9583 | [WLAN_PRIV_FIPS_TEST - SIOCIWFIRSTPRIV] = hdd_fips_test, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9584 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9585 | [WLAN_PRIV_ADD_TSPEC - SIOCIWFIRSTPRIV] = iw_add_tspec, |
| 9586 | [WLAN_PRIV_DEL_TSPEC - SIOCIWFIRSTPRIV] = iw_del_tspec, |
| 9587 | [WLAN_PRIV_GET_TSPEC - SIOCIWFIRSTPRIV] = iw_get_tspec, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9588 | [WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9589 | [WLAN_PRIV_SET_HOST_OFFLOAD - SIOCIWFIRSTPRIV] = iw_set_host_offload, |
| 9590 | [WLAN_GET_WLAN_STATISTICS - SIOCIWFIRSTPRIV] = iw_get_statistics, |
| 9591 | [WLAN_SET_KEEPALIVE_PARAMS - SIOCIWFIRSTPRIV] = |
| 9592 | iw_set_keepalive_params, |
| 9593 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 9594 | [WLAN_SET_PACKET_FILTER_PARAMS - SIOCIWFIRSTPRIV] = |
| 9595 | iw_set_packet_filter_params, |
| 9596 | #endif |
| 9597 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9598 | [WLAN_SET_PNO - SIOCIWFIRSTPRIV] = iw_set_pno, |
| 9599 | #endif |
| 9600 | [WLAN_SET_BAND_CONFIG - SIOCIWFIRSTPRIV] = iw_set_band_config, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 9601 | [WLAN_PRIV_SET_MCBC_FILTER - SIOCIWFIRSTPRIV] = |
| 9602 | iw_set_dynamic_mcbc_filter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9603 | [WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed, |
| 9604 | [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9605 | iw_set_two_ints_getnone, |
| 9606 | [WLAN_SET_DOT11P_CHANNEL_SCHED - SIOCIWFIRSTPRIV] = |
| 9607 | iw_set_dot11p_channel_sched, |
| 9608 | }; |
| 9609 | |
| 9610 | /*Maximum command length can be only 15 */ |
| 9611 | static const struct iw_priv_args we_private_args[] = { |
| 9612 | |
| 9613 | /* handlers for main ioctl */ |
| 9614 | {WLAN_PRIV_SET_INT_GET_NONE, |
| 9615 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9616 | 0, |
| 9617 | ""}, |
| 9618 | |
| 9619 | /* handlers for sub-ioctl */ |
| 9620 | {WE_SET_11D_STATE, |
| 9621 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9622 | 0, |
| 9623 | "set11Dstate"}, |
| 9624 | |
| 9625 | {WE_WOWL, |
| 9626 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9627 | 0, |
| 9628 | "wowl"}, |
| 9629 | |
| 9630 | {WE_SET_POWER, |
| 9631 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9632 | 0, |
| 9633 | "setPower"}, |
| 9634 | |
| 9635 | {WE_SET_MAX_ASSOC, |
| 9636 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9637 | 0, |
| 9638 | "setMaxAssoc"}, |
| 9639 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9640 | {WE_SET_SCAN_DISABLE, |
| 9641 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9642 | 0, |
| 9643 | "scan_disable"}, |
| 9644 | |
| 9645 | {WE_SET_DATA_INACTIVITY_TO, |
| 9646 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9647 | 0, |
| 9648 | "inactivityTO"}, |
| 9649 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 9650 | {WE_SET_WOW_DATA_INACTIVITY_TO, |
| 9651 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9652 | 0, |
| 9653 | "wow_ito"}, |
| 9654 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9655 | {WE_SET_MAX_TX_POWER, |
| 9656 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9657 | 0, |
| 9658 | "setMaxTxPower"}, |
| 9659 | |
| 9660 | {WE_SET_TX_POWER, |
| 9661 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9662 | 0, |
| 9663 | "setTxPower"}, |
| 9664 | |
| 9665 | {WE_SET_MC_RATE, |
| 9666 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9667 | 0, |
| 9668 | "setMcRate"}, |
| 9669 | |
| 9670 | {WE_SET_MAX_TX_POWER_2_4, |
| 9671 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9672 | 0, |
| 9673 | "setTxMaxPower2G"}, |
| 9674 | |
| 9675 | {WE_SET_MAX_TX_POWER_5_0, |
| 9676 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9677 | 0, |
| 9678 | "setTxMaxPower5G"}, |
| 9679 | |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9680 | #ifndef REMOVE_PKT_LOG |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9681 | {WE_SET_PKTLOG, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 9682 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9683 | 0, |
| 9684 | "pktlog"}, |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9685 | #endif |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9686 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9687 | /* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA |
| 9688 | * as well to keep same syntax as in SAP. Now onwards, STA |
Jeff Johnson | 3bb7c73 | 2017-01-12 08:40:17 -0800 | [diff] [blame] | 9689 | * will support both |
| 9690 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9691 | {WE_SET_MAX_TX_POWER, |
| 9692 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9693 | 0, |
| 9694 | "setTxMaxPower"}, |
| 9695 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 9696 | #ifdef HASTINGS_BT_WAR |
| 9697 | {WE_SET_HASTINGS_BT_WAR, |
| 9698 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9699 | 0, |
| 9700 | "hastings_bt_war"}, |
| 9701 | #endif |
| 9702 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9703 | {WE_SET_TM_LEVEL, |
| 9704 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9705 | 0, |
| 9706 | "setTmLevel"}, |
| 9707 | |
| 9708 | {WE_SET_PHYMODE, |
| 9709 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9710 | 0, |
| 9711 | "setphymode"}, |
| 9712 | |
| 9713 | {WE_SET_NSS, |
| 9714 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9715 | 0, |
| 9716 | "nss"}, |
| 9717 | |
| 9718 | {WE_SET_LDPC, |
| 9719 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9720 | 0, |
| 9721 | "ldpc"}, |
| 9722 | |
| 9723 | {WE_SET_TX_STBC, |
| 9724 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9725 | 0, |
| 9726 | "tx_stbc"}, |
| 9727 | |
| 9728 | {WE_SET_RX_STBC, |
| 9729 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9730 | 0, |
| 9731 | "rx_stbc"}, |
| 9732 | |
| 9733 | {WE_SET_SHORT_GI, |
| 9734 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9735 | 0, |
| 9736 | "shortgi"}, |
| 9737 | |
| 9738 | {WE_SET_RTSCTS, |
| 9739 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9740 | 0, |
| 9741 | "enablertscts"}, |
| 9742 | |
| 9743 | {WE_SET_CHWIDTH, |
| 9744 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9745 | 0, |
| 9746 | "chwidth"}, |
| 9747 | |
| 9748 | {WE_SET_ANI_EN_DIS, |
| 9749 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9750 | 0, |
| 9751 | "anienable"}, |
| 9752 | |
| 9753 | {WE_SET_ANI_POLL_PERIOD, |
| 9754 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9755 | 0, |
| 9756 | "aniplen"}, |
| 9757 | |
| 9758 | {WE_SET_ANI_LISTEN_PERIOD, |
| 9759 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9760 | 0, |
| 9761 | "anilislen"}, |
| 9762 | |
| 9763 | {WE_SET_ANI_OFDM_LEVEL, |
| 9764 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9765 | 0, |
| 9766 | "aniofdmlvl"}, |
| 9767 | |
| 9768 | {WE_SET_ANI_CCK_LEVEL, |
| 9769 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9770 | 0, |
| 9771 | "aniccklvl"}, |
| 9772 | |
| 9773 | {WE_SET_DYNAMIC_BW, |
| 9774 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9775 | 0, |
| 9776 | "cwmenable"}, |
| 9777 | |
| 9778 | {WE_SET_CTS_CBW, |
| 9779 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9780 | 0, |
| 9781 | "cts_cbw" }, |
| 9782 | |
| 9783 | {WE_SET_GTX_HT_MCS, |
| 9784 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9785 | 0, |
| 9786 | "gtxHTMcs"}, |
| 9787 | |
| 9788 | {WE_SET_GTX_VHT_MCS, |
| 9789 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9790 | 0, |
| 9791 | "gtxVHTMcs"}, |
| 9792 | |
| 9793 | {WE_SET_GTX_USRCFG, |
| 9794 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9795 | 0, |
| 9796 | "gtxUsrCfg"}, |
| 9797 | |
| 9798 | {WE_SET_GTX_THRE, |
| 9799 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9800 | 0, |
| 9801 | "gtxThre"}, |
| 9802 | |
| 9803 | {WE_SET_GTX_MARGIN, |
| 9804 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9805 | 0, |
| 9806 | "gtxMargin"}, |
| 9807 | |
| 9808 | {WE_SET_GTX_STEP, |
| 9809 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9810 | 0, |
| 9811 | "gtxStep"}, |
| 9812 | |
| 9813 | {WE_SET_GTX_MINTPC, |
| 9814 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9815 | 0, |
| 9816 | "gtxMinTpc"}, |
| 9817 | |
| 9818 | {WE_SET_GTX_BWMASK, |
| 9819 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9820 | 0, |
| 9821 | "gtxBWMask"}, |
| 9822 | |
| 9823 | {WE_SET_TX_CHAINMASK, |
| 9824 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9825 | 0, |
| 9826 | "txchainmask"}, |
| 9827 | |
| 9828 | {WE_SET_RX_CHAINMASK, |
| 9829 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9830 | 0, |
| 9831 | "rxchainmask"}, |
| 9832 | |
| 9833 | {WE_SET_11N_RATE, |
| 9834 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9835 | 0, |
| 9836 | "set11NRates"}, |
| 9837 | |
| 9838 | {WE_SET_VHT_RATE, |
| 9839 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9840 | 0, |
| 9841 | "set11ACRates"}, |
| 9842 | |
| 9843 | {WE_SET_AMPDU, |
| 9844 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9845 | 0, |
| 9846 | "ampdu"}, |
| 9847 | |
| 9848 | {WE_SET_AMSDU, |
| 9849 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9850 | 0, |
| 9851 | "amsdu"}, |
| 9852 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9853 | {WE_SET_TXPOW_2G, |
| 9854 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9855 | 0, |
| 9856 | "txpow2g"}, |
| 9857 | |
| 9858 | {WE_SET_TXPOW_5G, |
| 9859 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9860 | 0, |
| 9861 | "txpow5g"}, |
| 9862 | |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9863 | #ifdef FEATURE_FW_LOG_PARSING |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9864 | /* Sub-cmds DBGLOG specific commands */ |
| 9865 | {WE_DBGLOG_LOG_LEVEL, |
| 9866 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9867 | 0, |
| 9868 | "dl_loglevel"}, |
| 9869 | |
| 9870 | {WE_DBGLOG_VAP_ENABLE, |
| 9871 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9872 | 0, |
| 9873 | "dl_vapon"}, |
| 9874 | |
| 9875 | {WE_DBGLOG_VAP_DISABLE, |
| 9876 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9877 | 0, |
| 9878 | "dl_vapoff"}, |
| 9879 | |
| 9880 | {WE_DBGLOG_MODULE_ENABLE, |
| 9881 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9882 | 0, |
| 9883 | "dl_modon"}, |
| 9884 | |
| 9885 | {WE_DBGLOG_MODULE_DISABLE, |
| 9886 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9887 | 0, |
| 9888 | "dl_modoff"}, |
| 9889 | |
| 9890 | {WE_DBGLOG_MOD_LOG_LEVEL, |
| 9891 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9892 | 0, |
| 9893 | "dl_mod_loglevel"}, |
| 9894 | |
| 9895 | {WE_DBGLOG_TYPE, |
| 9896 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9897 | 0, |
| 9898 | "dl_type"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 9899 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9900 | {WE_DBGLOG_REPORT_ENABLE, |
| 9901 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9902 | 0, |
| 9903 | "dl_report"}, |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9904 | #endif /* FEATURE_FW_LOG_PARSING */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9905 | |
| 9906 | {WE_SET_TXRX_FWSTATS, |
| 9907 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9908 | 0, |
| 9909 | "txrx_fw_stats"}, |
| 9910 | |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9911 | {WE_SET_TXRX_STATS, |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 9912 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9913 | 0, |
| 9914 | "txrx_stats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 9915 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 9916 | {WE_SET_THERMAL_THROTTLE_CFG, |
| 9917 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9918 | 0, |
| 9919 | "set_thermal_cfg"}, |
| 9920 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9921 | {WE_TXRX_FWSTATS_RESET, |
| 9922 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9923 | 0, |
| 9924 | "txrx_fw_st_rst"}, |
| 9925 | |
| 9926 | {WE_PPS_PAID_MATCH, |
| 9927 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9928 | 0, "paid_match"}, |
| 9929 | |
| 9930 | {WE_PPS_GID_MATCH, |
| 9931 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9932 | 0, "gid_match"}, |
| 9933 | |
| 9934 | {WE_PPS_EARLY_TIM_CLEAR, |
| 9935 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9936 | 0, "tim_clear"}, |
| 9937 | |
| 9938 | {WE_PPS_EARLY_DTIM_CLEAR, |
| 9939 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9940 | 0, "dtim_clear"}, |
| 9941 | |
| 9942 | {WE_PPS_EOF_PAD_DELIM, |
| 9943 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9944 | 0, "eof_delim"}, |
| 9945 | |
| 9946 | {WE_PPS_MACADDR_MISMATCH, |
| 9947 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9948 | 0, "mac_match"}, |
| 9949 | |
| 9950 | {WE_PPS_DELIM_CRC_FAIL, |
| 9951 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9952 | 0, "delim_fail"}, |
| 9953 | |
| 9954 | {WE_PPS_GID_NSTS_ZERO, |
| 9955 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9956 | 0, "nsts_zero"}, |
| 9957 | |
| 9958 | {WE_PPS_RSSI_CHECK, |
| 9959 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9960 | 0, "rssi_chk"}, |
| 9961 | |
| 9962 | {WE_PPS_5G_EBT, |
| 9963 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9964 | 0, "5g_ebt"}, |
| 9965 | |
| 9966 | {WE_SET_HTSMPS, |
| 9967 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9968 | 0, "htsmps"}, |
| 9969 | |
| 9970 | {WE_SET_QPOWER_MAX_PSPOLL_COUNT, |
| 9971 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9972 | 0, "set_qpspollcnt"}, |
| 9973 | |
| 9974 | {WE_SET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 9975 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9976 | 0, "set_qtxwake"}, |
| 9977 | |
| 9978 | {WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 9979 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9980 | 0, "set_qwakeintv"}, |
| 9981 | |
| 9982 | {WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 9983 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9984 | 0, "set_qnodatapoll"}, |
| 9985 | |
| 9986 | /* handlers for MCC time quota and latency sub ioctls */ |
| 9987 | {WE_MCC_CONFIG_LATENCY, |
| 9988 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9989 | 0, "setMccLatency"}, |
| 9990 | |
| 9991 | {WE_MCC_CONFIG_QUOTA, |
| 9992 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9993 | 0, "setMccQuota"}, |
| 9994 | |
| 9995 | {WE_SET_DEBUG_LOG, |
| 9996 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9997 | 0, "setDbgLvl"}, |
| 9998 | |
| 9999 | /* handlers for early_rx power save */ |
| 10000 | {WE_SET_EARLY_RX_ADJUST_ENABLE, |
| 10001 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10002 | 0, "erx_enable"}, |
| 10003 | |
| 10004 | {WE_SET_EARLY_RX_TGT_BMISS_NUM, |
| 10005 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10006 | 0, "erx_bmiss_val"}, |
| 10007 | |
| 10008 | {WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 10009 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10010 | 0, "erx_bmiss_smpl"}, |
| 10011 | |
| 10012 | {WE_SET_EARLY_RX_SLOP_STEP, |
| 10013 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10014 | 0, "erx_slop_step"}, |
| 10015 | |
| 10016 | {WE_SET_EARLY_RX_INIT_SLOP, |
| 10017 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10018 | 0, "erx_init_slop"}, |
| 10019 | |
| 10020 | {WE_SET_EARLY_RX_ADJUST_PAUSE, |
| 10021 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10022 | 0, "erx_adj_pause"}, |
| 10023 | |
| 10024 | {WE_SET_EARLY_RX_DRIFT_SAMPLE, |
| 10025 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10026 | 0, "erx_dri_sample"}, |
| 10027 | |
| 10028 | {WE_DUMP_STATS, |
| 10029 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10030 | 0, "dumpStats"}, |
| 10031 | |
| 10032 | {WE_CLEAR_STATS, |
| 10033 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10034 | 0, "clearStats"}, |
| 10035 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10036 | {WE_START_FW_PROFILE, |
| 10037 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10038 | 0, "startProfile"}, |
| 10039 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 10040 | {WE_SET_CHANNEL, |
| 10041 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10042 | 0, "setChanChange" }, |
| 10043 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 10044 | {WE_SET_CONC_SYSTEM_PREF, |
| 10045 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10046 | 0, "setConcSysPref" }, |
| 10047 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 10048 | {WE_SET_PDEV_RESET, |
| 10049 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10050 | 0, "pdev_reset" }, |
| 10051 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10052 | {WE_SET_MODULATED_DTIM, |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 10053 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10054 | 0, "setModDTIM" }, |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10055 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10056 | {WLAN_PRIV_SET_NONE_GET_INT, |
| 10057 | 0, |
| 10058 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10059 | ""}, |
| 10060 | |
| 10061 | /* handlers for sub-ioctl */ |
| 10062 | {WE_GET_11D_STATE, |
| 10063 | 0, |
| 10064 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10065 | "get11Dstate"}, |
| 10066 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10067 | {WE_GET_WLAN_DBG, |
| 10068 | 0, |
| 10069 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10070 | "getwlandbg"}, |
| 10071 | |
| 10072 | {WE_GET_MAX_ASSOC, |
| 10073 | 0, |
| 10074 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10075 | "getMaxAssoc"}, |
| 10076 | |
| 10077 | {WE_GET_SAP_AUTO_CHANNEL_SELECTION, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10078 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10079 | "getAutoChannel"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10080 | |
| 10081 | {WE_GET_CONCURRENCY_MODE, |
| 10082 | 0, |
| 10083 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10084 | "getconcurrency"}, |
| 10085 | |
| 10086 | {WE_GET_NSS, |
| 10087 | 0, |
| 10088 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10089 | "get_nss"}, |
| 10090 | |
| 10091 | {WE_GET_LDPC, |
| 10092 | 0, |
| 10093 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10094 | "get_ldpc"}, |
| 10095 | |
| 10096 | {WE_GET_TX_STBC, |
| 10097 | 0, |
| 10098 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10099 | "get_tx_stbc"}, |
| 10100 | |
| 10101 | {WE_GET_RX_STBC, |
| 10102 | 0, |
| 10103 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10104 | "get_rx_stbc"}, |
| 10105 | |
| 10106 | {WE_GET_SHORT_GI, |
| 10107 | 0, |
| 10108 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10109 | "get_shortgi"}, |
| 10110 | |
| 10111 | {WE_GET_RTSCTS, |
| 10112 | 0, |
| 10113 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10114 | "get_rtscts"}, |
| 10115 | |
| 10116 | {WE_GET_CHWIDTH, |
| 10117 | 0, |
| 10118 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10119 | "get_chwidth"}, |
| 10120 | |
| 10121 | {WE_GET_ANI_EN_DIS, |
| 10122 | 0, |
| 10123 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10124 | "get_anienable"}, |
| 10125 | |
| 10126 | {WE_GET_ANI_POLL_PERIOD, |
| 10127 | 0, |
| 10128 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10129 | "get_aniplen"}, |
| 10130 | |
| 10131 | {WE_GET_ANI_LISTEN_PERIOD, |
| 10132 | 0, |
| 10133 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10134 | "get_anilislen"}, |
| 10135 | |
| 10136 | {WE_GET_ANI_OFDM_LEVEL, |
| 10137 | 0, |
| 10138 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10139 | "get_aniofdmlvl"}, |
| 10140 | |
| 10141 | {WE_GET_ANI_CCK_LEVEL, |
| 10142 | 0, |
| 10143 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10144 | "get_aniccklvl"}, |
| 10145 | |
| 10146 | {WE_GET_DYNAMIC_BW, |
| 10147 | 0, |
| 10148 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10149 | "get_cwmenable"}, |
| 10150 | |
| 10151 | {WE_GET_GTX_HT_MCS, |
| 10152 | 0, |
| 10153 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10154 | "get_gtxHTMcs"}, |
| 10155 | |
| 10156 | {WE_GET_GTX_VHT_MCS, |
| 10157 | 0, |
| 10158 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10159 | "get_gtxVHTMcs"}, |
| 10160 | |
| 10161 | {WE_GET_GTX_USRCFG, |
| 10162 | 0, |
| 10163 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10164 | "get_gtxUsrCfg"}, |
| 10165 | |
| 10166 | {WE_GET_GTX_THRE, |
| 10167 | 0, |
| 10168 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10169 | "get_gtxThre"}, |
| 10170 | |
| 10171 | {WE_GET_GTX_MARGIN, |
| 10172 | 0, |
| 10173 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10174 | "get_gtxMargin"}, |
| 10175 | |
| 10176 | {WE_GET_GTX_STEP, |
| 10177 | 0, |
| 10178 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10179 | "get_gtxStep"}, |
| 10180 | |
| 10181 | {WE_GET_GTX_MINTPC, |
| 10182 | 0, |
| 10183 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10184 | "get_gtxMinTpc"}, |
| 10185 | |
| 10186 | {WE_GET_GTX_BWMASK, |
| 10187 | 0, |
| 10188 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10189 | "get_gtxBWMask"}, |
| 10190 | |
| 10191 | {WE_GET_TX_CHAINMASK, |
| 10192 | 0, |
| 10193 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10194 | "get_txchainmask"}, |
| 10195 | |
| 10196 | {WE_GET_RX_CHAINMASK, |
| 10197 | 0, |
| 10198 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10199 | "get_rxchainmask"}, |
| 10200 | |
| 10201 | {WE_GET_11N_RATE, |
| 10202 | 0, |
| 10203 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10204 | "get_11nrate"}, |
| 10205 | |
| 10206 | {WE_GET_AMPDU, |
| 10207 | 0, |
| 10208 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10209 | "get_ampdu"}, |
| 10210 | |
| 10211 | {WE_GET_AMSDU, |
| 10212 | 0, |
| 10213 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10214 | "get_amsdu"}, |
| 10215 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10216 | {WE_GET_TXPOW_2G, |
| 10217 | 0, |
| 10218 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10219 | "get_txpow2g"}, |
| 10220 | |
| 10221 | {WE_GET_TXPOW_5G, |
| 10222 | 0, |
| 10223 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10224 | "get_txpow5g"}, |
| 10225 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10226 | {WE_GET_PPS_PAID_MATCH, |
| 10227 | 0, |
| 10228 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10229 | "get_paid_match"}, |
| 10230 | |
| 10231 | {WE_GET_PPS_GID_MATCH, |
| 10232 | 0, |
| 10233 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10234 | "get_gid_match"}, |
| 10235 | |
| 10236 | {WE_GET_PPS_EARLY_TIM_CLEAR, |
| 10237 | 0, |
| 10238 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10239 | "get_tim_clear"}, |
| 10240 | |
| 10241 | {WE_GET_PPS_EARLY_DTIM_CLEAR, |
| 10242 | 0, |
| 10243 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10244 | "get_dtim_clear"}, |
| 10245 | |
| 10246 | {WE_GET_PPS_EOF_PAD_DELIM, |
| 10247 | 0, |
| 10248 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10249 | "get_eof_delim"}, |
| 10250 | |
| 10251 | {WE_GET_PPS_MACADDR_MISMATCH, |
| 10252 | 0, |
| 10253 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10254 | "get_mac_match"}, |
| 10255 | |
| 10256 | {WE_GET_PPS_DELIM_CRC_FAIL, |
| 10257 | 0, |
| 10258 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10259 | "get_delim_fail"}, |
| 10260 | |
| 10261 | {WE_GET_PPS_GID_NSTS_ZERO, |
| 10262 | 0, |
| 10263 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10264 | "get_nsts_zero"}, |
| 10265 | |
| 10266 | {WE_GET_PPS_RSSI_CHECK, |
| 10267 | 0, |
| 10268 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10269 | "get_rssi_chk"}, |
| 10270 | |
| 10271 | {WE_GET_QPOWER_MAX_PSPOLL_COUNT, |
| 10272 | 0, |
| 10273 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10274 | "get_qpspollcnt"}, |
| 10275 | |
| 10276 | {WE_GET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 10277 | 0, |
| 10278 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10279 | "get_qtxwake"}, |
| 10280 | |
| 10281 | {WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 10282 | 0, |
| 10283 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10284 | "get_qwakeintv"}, |
| 10285 | |
| 10286 | {WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 10287 | 0, |
| 10288 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10289 | "get_qnodatapoll"}, |
| 10290 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10291 | {WE_CAP_TSF, |
| 10292 | 0, |
| 10293 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10294 | "cap_tsf"}, |
| 10295 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10296 | {WE_GET_TEMPERATURE, |
| 10297 | 0, |
| 10298 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10299 | "get_temp"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10300 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10301 | {WE_GET_DCM, |
| 10302 | 0, |
| 10303 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10304 | "get_dcm"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10305 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10306 | {WE_GET_RANGE_EXT, |
| 10307 | 0, |
| 10308 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10309 | "get_range_ext"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10310 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10311 | /* handlers for main ioctl */ |
| 10312 | {WLAN_PRIV_SET_CHAR_GET_NONE, |
| 10313 | IW_PRIV_TYPE_CHAR | 512, |
| 10314 | 0, |
| 10315 | ""}, |
| 10316 | |
| 10317 | /* handlers for sub-ioctl */ |
| 10318 | {WE_WOWL_ADD_PTRN, |
| 10319 | IW_PRIV_TYPE_CHAR | 512, |
| 10320 | 0, |
| 10321 | "wowlAddPtrn"}, |
| 10322 | |
| 10323 | {WE_WOWL_DEL_PTRN, |
| 10324 | IW_PRIV_TYPE_CHAR | 512, |
| 10325 | 0, |
| 10326 | "wowlDelPtrn"}, |
| 10327 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10328 | /* handlers for sub-ioctl */ |
| 10329 | {WE_NEIGHBOR_REPORT_REQUEST, |
| 10330 | IW_PRIV_TYPE_CHAR | 512, |
| 10331 | 0, |
| 10332 | "neighbor"}, |
Deepak Dhamdhere | 641bf32 | 2016-01-06 15:19:03 -0800 | [diff] [blame] | 10333 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10334 | {WE_SET_AP_WPS_IE, |
| 10335 | IW_PRIV_TYPE_CHAR | 512, |
| 10336 | 0, |
| 10337 | "set_ap_wps_ie"}, |
| 10338 | |
| 10339 | {WE_SET_CONFIG, |
| 10340 | IW_PRIV_TYPE_CHAR | 512, |
| 10341 | 0, |
| 10342 | "setConfig"}, |
| 10343 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 10344 | #ifdef WLAN_UNIT_TEST |
| 10345 | {WE_UNIT_TEST, |
| 10346 | IW_PRIV_TYPE_CHAR | 512, |
| 10347 | 0, |
| 10348 | "unit_test"}, |
| 10349 | #endif |
| 10350 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10351 | /* handlers for main ioctl */ |
| 10352 | {WLAN_PRIV_SET_THREE_INT_GET_NONE, |
| 10353 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10354 | 0, |
| 10355 | ""}, |
| 10356 | |
| 10357 | /* handlers for sub-ioctl */ |
| 10358 | {WE_SET_WLAN_DBG, |
| 10359 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10360 | 0, |
| 10361 | "setwlandbg"}, |
| 10362 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10363 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10364 | /* handlers for sub-ioctl */ |
| 10365 | {WE_SET_DP_TRACE, |
| 10366 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10367 | 0, |
| 10368 | "set_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10369 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10370 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 10371 | {WE_SET_FW_TEST, |
| 10372 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10373 | 0, "fw_test"}, |
| 10374 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10375 | /* handlers for main ioctl */ |
| 10376 | {WLAN_PRIV_SET_NONE_GET_THREE_INT, |
| 10377 | 0, |
| 10378 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10379 | ""}, |
| 10380 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10381 | {WE_GET_TSF, |
| 10382 | 0, |
| 10383 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10384 | "get_tsf"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10385 | |
| 10386 | {WE_SET_DUAL_MAC_SCAN_CONFIG, |
| 10387 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10388 | 0, |
| 10389 | "set_scan_cfg"}, |
| 10390 | |
| 10391 | /* handlers for main ioctl */ |
| 10392 | {WLAN_PRIV_GET_CHAR_SET_NONE, |
| 10393 | 0, |
| 10394 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10395 | ""}, |
| 10396 | |
| 10397 | /* handlers for sub-ioctl */ |
| 10398 | {WE_WLAN_VERSION, |
| 10399 | 0, |
| 10400 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10401 | "version"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10402 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10403 | {WE_GET_STATS, |
| 10404 | 0, |
| 10405 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10406 | "getStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10407 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 10408 | {WE_GET_SUSPEND_RESUME_STATS, |
| 10409 | 0, |
| 10410 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10411 | "getSuspendStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10412 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10413 | {WE_LIST_FW_PROFILE, |
| 10414 | 0, |
| 10415 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10416 | "listProfile"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10417 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10418 | {WE_GET_STATES, |
| 10419 | 0, |
| 10420 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10421 | "getHostStates"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10422 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10423 | {WE_GET_CFG, |
| 10424 | 0, |
| 10425 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10426 | "getConfig"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10427 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10428 | {WE_GET_RSSI, |
| 10429 | 0, |
| 10430 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10431 | "getRSSI"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10432 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10433 | {WE_GET_WMM_STATUS, |
| 10434 | 0, |
| 10435 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10436 | "getWmmStatus"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10437 | |
| 10438 | {WE_GET_CHANNEL_LIST, |
| 10439 | 0, |
| 10440 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10441 | "getChannelList"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10442 | #ifdef FEATURE_WLAN_TDLS |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10443 | {WE_GET_TDLS_PEERS, |
| 10444 | 0, |
| 10445 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10446 | "getTdlsPeers"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10447 | #endif |
| 10448 | #ifdef WLAN_FEATURE_11W |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10449 | {WE_GET_11W_INFO, |
| 10450 | 0, |
| 10451 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10452 | "getPMFInfo"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10453 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10454 | {WE_GET_STA_CXN_INFO, |
| 10455 | 0, |
| 10456 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10457 | "get_cxn_info" }, |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 10458 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10459 | {WE_GET_IBSS_STA_INFO, |
| 10460 | 0, |
| 10461 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10462 | "getIbssSTAs"}, |
| 10463 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10464 | {WE_GET_PHYMODE, |
| 10465 | 0, |
| 10466 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10467 | "getphymode"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10468 | #if defined(FEATURE_OEM_DATA_SUPPORT) || defined(WIFI_POS_CONVERGED) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10469 | {WE_GET_OEM_DATA_CAP, |
| 10470 | 0, |
| 10471 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10472 | "getOemDataCap"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10473 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10474 | {WE_GET_SNR, |
| 10475 | 0, |
| 10476 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10477 | "getSNR"}, |
| 10478 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 10479 | {WE_GET_BA_AGEING_TIMEOUT, |
| 10480 | 0, |
| 10481 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10482 | "get_ba_timeout"}, |
| 10483 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10484 | /* handlers for main ioctl */ |
| 10485 | {WLAN_PRIV_SET_NONE_GET_NONE, |
| 10486 | 0, |
| 10487 | 0, |
| 10488 | ""}, |
| 10489 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10490 | /* handlers for sub-ioctl */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10491 | {WE_IBSS_GET_PEER_INFO_ALL, |
| 10492 | 0, |
| 10493 | 0, |
| 10494 | "ibssPeerInfoAll"}, |
| 10495 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10496 | {WE_GET_FW_PROFILE_DATA, |
| 10497 | 0, |
| 10498 | 0, |
| 10499 | "getProfileData"}, |
| 10500 | |
| 10501 | {WE_SET_REASSOC_TRIGGER, |
| 10502 | 0, |
| 10503 | 0, |
| 10504 | "reassoc"}, |
| 10505 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 10506 | {WE_STOP_OBSS_SCAN, |
| 10507 | 0, |
| 10508 | 0, |
| 10509 | "stop_obss_scan"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10510 | /* handlers for main ioctl */ |
| 10511 | {WLAN_PRIV_SET_VAR_INT_GET_NONE, |
| 10512 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10513 | 0, |
| 10514 | ""}, |
| 10515 | |
| 10516 | /* handlers for sub-ioctl */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10517 | {WE_IBSS_GET_PEER_INFO, |
| 10518 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10519 | 0, |
| 10520 | "ibssPeerInfo"}, |
| 10521 | |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10522 | #ifdef TRACE_RECORD |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10523 | /* handlers for sub-ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10524 | {WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD, |
| 10525 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10526 | 0, |
| 10527 | "setdumplog"}, |
| 10528 | |
| 10529 | {WE_MTRACE_DUMP_CMD, |
| 10530 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10531 | 0, |
| 10532 | "dumplog"}, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10533 | #endif |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 10534 | |
| 10535 | {WE_POLICY_MANAGER_CINFO_CMD, |
| 10536 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10537 | 0, |
| 10538 | "pm_cinfo"}, |
| 10539 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10540 | #ifdef MPC_UT_FRAMEWORK |
| 10541 | {WE_POLICY_MANAGER_CLIST_CMD, |
| 10542 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10543 | 0, |
| 10544 | "pm_clist"}, |
| 10545 | |
| 10546 | {WE_POLICY_MANAGER_DLIST_CMD, |
| 10547 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10548 | 0, |
| 10549 | "pm_dlist"}, |
| 10550 | |
| 10551 | {WE_POLICY_MANAGER_DBS_CMD, |
| 10552 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10553 | 0, |
| 10554 | "pm_dbs"}, |
| 10555 | |
| 10556 | {WE_POLICY_MANAGER_PCL_CMD, |
| 10557 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10558 | 0, |
| 10559 | "pm_pcl"}, |
| 10560 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10561 | {WE_POLICY_MANAGER_ULIST_CMD, |
| 10562 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10563 | 0, |
| 10564 | "pm_ulist"}, |
| 10565 | |
| 10566 | {WE_POLICY_MANAGER_QUERY_ACTION_CMD, |
| 10567 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10568 | 0, |
| 10569 | "pm_query_action"}, |
| 10570 | |
| 10571 | {WE_POLICY_MANAGER_QUERY_ALLOW_CMD, |
| 10572 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10573 | 0, |
| 10574 | "pm_query_allow"}, |
| 10575 | |
| 10576 | {WE_POLICY_MANAGER_SCENARIO_CMD, |
| 10577 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10578 | 0, |
| 10579 | "pm_run_scenario"}, |
| 10580 | |
| 10581 | {WE_POLICY_SET_HW_MODE_CMD, |
| 10582 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10583 | 0, |
| 10584 | "pm_set_hw_mode"}, |
| 10585 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10586 | {WE_UNIT_TEST_CMD, |
| 10587 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10588 | 0, |
| 10589 | "setUnitTestCmd"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10590 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10591 | {WE_MAC_PWR_DEBUG_CMD, |
| 10592 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10593 | 0, |
| 10594 | "halPwrDebug"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10595 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 10596 | {WE_LED_FLASHING_PARAM, |
| 10597 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10598 | 0, |
| 10599 | "gpio_control"}, |
| 10600 | #endif |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 10601 | #ifdef WLAN_DEBUG |
| 10602 | {WE_SET_CHAN_AVOID, |
| 10603 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10604 | 0, |
| 10605 | "ch_avoid"}, |
| 10606 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10607 | /* handlers for main ioctl */ |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 10608 | {WLAN_PRIV_FIPS_TEST, |
| 10609 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10610 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10611 | "fips_test"}, |
| 10612 | |
| 10613 | /* handlers for main ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10614 | {WLAN_PRIV_ADD_TSPEC, |
| 10615 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
| 10616 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10617 | "addTspec"}, |
| 10618 | |
| 10619 | /* handlers for main ioctl */ |
| 10620 | {WLAN_PRIV_DEL_TSPEC, |
| 10621 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10622 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10623 | "delTspec"}, |
| 10624 | |
| 10625 | /* handlers for main ioctl */ |
| 10626 | {WLAN_PRIV_GET_TSPEC, |
| 10627 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10628 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10629 | "getTspec"}, |
| 10630 | |
| 10631 | /* handlers for main ioctl - host offload */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10632 | {WLAN_PRIV_SET_HOST_OFFLOAD, |
| 10633 | IW_PRIV_TYPE_BYTE | sizeof(struct host_offload_req), |
| 10634 | 0, |
| 10635 | "setHostOffload"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10636 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10637 | {WLAN_GET_WLAN_STATISTICS, |
| 10638 | 0, |
| 10639 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10640 | "getWlanStats"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10641 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10642 | {WLAN_SET_KEEPALIVE_PARAMS, |
| 10643 | IW_PRIV_TYPE_BYTE | sizeof(tSirKeepAliveReq) | |
| 10644 | IW_PRIV_SIZE_FIXED, |
| 10645 | 0, |
| 10646 | "setKeepAlive"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10647 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10648 | {WLAN_SET_PACKET_FILTER_PARAMS, |
| 10649 | IW_PRIV_TYPE_BYTE | |
| 10650 | sizeof(struct pkt_filter_cfg), |
| 10651 | 0, |
| 10652 | "setPktFilter"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10653 | #endif |
| 10654 | #ifdef FEATURE_WLAN_SCAN_PNO |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10655 | {WLAN_SET_PNO, |
| 10656 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10657 | 0, |
| 10658 | "setpno"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10659 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10660 | {WLAN_SET_BAND_CONFIG, |
| 10661 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10662 | 0, |
| 10663 | "SETBAND"}, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10664 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10665 | {WLAN_PRIV_SET_MCBC_FILTER, |
| 10666 | 0, |
| 10667 | 0, |
| 10668 | "setMCBCFilter"}, |
| 10669 | |
| 10670 | {WLAN_GET_LINK_SPEED, |
| 10671 | IW_PRIV_TYPE_CHAR | 18, |
| 10672 | IW_PRIV_TYPE_CHAR | 5, |
| 10673 | "getLinkSpeed"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10674 | |
| 10675 | /* handlers for main ioctl */ |
| 10676 | {WLAN_PRIV_SET_TWO_INT_GET_NONE, |
| 10677 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10678 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10679 | ""}, |
| 10680 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10681 | {WE_SET_SMPS_PARAM, |
| 10682 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10683 | 0, "set_smps_param"}, |
| 10684 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10685 | {WLAN_SET_DOT11P_CHANNEL_SCHED, |
| 10686 | IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10687 | 0, "set_dot11p" }, |
| 10688 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10689 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10690 | {WE_SET_FW_CRASH_INJECT, |
| 10691 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10692 | 0, "crash_inject"}, |
| 10693 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10694 | #endif |
Rachit Kankane | b103562 | 2018-01-24 18:41:35 +0530 | [diff] [blame] | 10695 | #if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY) |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 10696 | {WE_LOG_BUFFER, |
| 10697 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10698 | 0, "log_buffer"}, |
| 10699 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10700 | #endif |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 10701 | {WE_SET_BA_AGEING_TIMEOUT, |
| 10702 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10703 | 0, "set_ba_timeout"}, |
| 10704 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 10705 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 10706 | {WE_SET_WLAN_SUSPEND, |
| 10707 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10708 | 0, "wlan_suspend"}, |
| 10709 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 10710 | {WE_SET_WLAN_RESUME, |
| 10711 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10712 | 0, "wlan_resume"}, |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 10713 | #endif |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10714 | {WE_ENABLE_FW_PROFILE, |
| 10715 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10716 | 0, "enableProfile"}, |
| 10717 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10718 | {WE_SET_FW_PROFILE_HIST_INTVL, |
| 10719 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10720 | 0, "set_hist_intvl"}, |
| 10721 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10722 | {WE_SET_DUAL_MAC_FW_MODE_CONFIG, |
| 10723 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10724 | 0, "set_fw_mode_cfg"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10725 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10726 | {WE_DUMP_DP_TRACE_LEVEL, |
| 10727 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10728 | 0, "dump_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10729 | #endif |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10730 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 10731 | {WE_SET_MON_MODE_CHAN, |
| 10732 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10733 | 0, "setMonChan"}, |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10734 | #endif |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 10735 | {WE_GET_ROAM_SYNCH_DELAY, |
| 10736 | 0, |
| 10737 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10738 | "hostroamdelay"}, |
| 10739 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 10740 | {WE_SET_11AX_RATE, |
| 10741 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10742 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10743 | "set_11ax_rate"}, |
| 10744 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10745 | {WE_SET_DCM, |
| 10746 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10747 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10748 | "enable_dcm"}, |
| 10749 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10750 | {WE_SET_RANGE_EXT, |
| 10751 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10752 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10753 | "range_ext"}, |
| 10754 | |
Naveen Rawat | c921c7b | 2017-06-13 17:29:51 -0700 | [diff] [blame] | 10755 | {WLAN_PRIV_SET_FTIES, |
| 10756 | IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, |
| 10757 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10758 | "set_ft_ies"}, |
| 10759 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 10760 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 10761 | {WE_MOTION_DET_START_STOP, |
| 10762 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10763 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10764 | "mt_start"}, |
| 10765 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 10766 | {WE_MOTION_DET_BASE_LINE_START_STOP, |
| 10767 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10768 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10769 | "mt_bl_start"}, |
| 10770 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 10771 | {WE_MOTION_DET_CONFIG_PARAM, |
| 10772 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10773 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10774 | "mt_config"}, |
| 10775 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 10776 | {WE_MOTION_DET_BASE_LINE_CONFIG_PARAM, |
| 10777 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10778 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10779 | "mt_bl_config"}, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 10780 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10781 | }; |
| 10782 | |
| 10783 | const struct iw_handler_def we_handler_def = { |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10784 | .num_standard = 0, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 10785 | .num_private = QDF_ARRAY_SIZE(we_private), |
| 10786 | .num_private_args = QDF_ARRAY_SIZE(we_private_args), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10787 | |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10788 | .standard = NULL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10789 | .private = (iw_handler *) we_private, |
| 10790 | .private_args = we_private_args, |
| 10791 | .get_wireless_stats = NULL, |
| 10792 | }; |
| 10793 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10794 | void hdd_register_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10795 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10796 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10797 | |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 10798 | dev->wireless_handlers = &we_handler_def; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10799 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 10800 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10801 | } |
| 10802 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10803 | void hdd_unregister_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10804 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10805 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10806 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10807 | rtnl_lock(); |
| 10808 | dev->wireless_handlers = NULL; |
| 10809 | rtnl_unlock(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10810 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10811 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10812 | } |