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> |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 31 | #include "osif_sync.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 32 | #include <wlan_hdd_includes.h> |
| 33 | #include <cds_api.h> |
Rajeev Kumar | ea95edd | 2017-01-11 20:49:36 -0800 | [diff] [blame] | 34 | #include "scheduler_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | #include <net/arp.h> |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 36 | #include <cdp_txrx_cmn.h> |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 37 | #include <cdp_txrx_stats.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 38 | #include "sir_params.h" |
| 39 | #include "csr_api.h" |
| 40 | #include "csr_inside_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | #include "sme_rrm_internal.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 42 | #include <ani_global.h> |
| 43 | #include "dot11f.h" |
| 44 | #include <wlan_hdd_wowl.h> |
| 45 | #include <wlan_hdd_cfg.h> |
| 46 | #include <wlan_hdd_wmm.h> |
| 47 | #include "utils_api.h" |
| 48 | #include "wlan_hdd_p2p.h" |
| 49 | #ifdef FEATURE_WLAN_TDLS |
| 50 | #include "wlan_hdd_tdls.h" |
| 51 | #endif |
| 52 | |
| 53 | #include "cds_ieee80211_common.h" |
| 54 | #include "ol_if_athvar.h" |
| 55 | #include "dbglog_host.h" |
| 56 | #include "wma.h" |
| 57 | |
| 58 | #include "wlan_hdd_power.h" |
| 59 | #include "qwlan_version.h" |
| 60 | #include "wlan_hdd_host_offload.h" |
| 61 | |
| 62 | #include <linux/wireless.h> |
| 63 | #include <net/cfg80211.h> |
| 64 | |
| 65 | #include "wlan_hdd_misc.h" |
| 66 | |
| 67 | #include "qc_sap_ioctl.h" |
| 68 | #include "sme_api.h" |
| 69 | #include "wma_types.h" |
Dustin Brown | 05a0658f | 2019-03-05 11:27:38 -0800 | [diff] [blame] | 70 | #include "qdf_delayed_work_test.h" |
Dustin Brown | 6fb7a75 | 2018-11-30 11:33:57 -0800 | [diff] [blame] | 71 | #include "qdf_hashtable_test.h" |
Dustin Brown | 9c49a33 | 2019-03-05 11:27:38 -0800 | [diff] [blame] | 72 | #include "qdf_periodic_work_test.h" |
Dustin Brown | 92acafe | 2019-02-15 17:17:10 -0800 | [diff] [blame^] | 73 | #include "qdf_ptr_hash_test.h" |
Dustin Brown | 128e2d0 | 2019-02-15 12:59:07 -0800 | [diff] [blame] | 74 | #include "qdf_slist_test.h" |
Dustin Brown | d315c45 | 2018-11-27 11:28:48 -0800 | [diff] [blame] | 75 | #include "qdf_talloc_test.h" |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 76 | #include "qdf_str.h" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 77 | #include "qdf_trace.h" |
Dustin Brown | ebb16d1 | 2018-11-29 17:52:07 -0800 | [diff] [blame] | 78 | #include "qdf_types_test.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | #include "wlan_hdd_assoc.h" |
| 80 | #include "wlan_hdd_ioctl.h" |
| 81 | #include "wlan_hdd_scan.h" |
| 82 | #include "sme_power_save_api.h" |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 83 | #include "wlan_policy_mgr_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | #include "wlan_hdd_conc_ut.h" |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 85 | #include "wlan_hdd_fips.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 86 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | #include "wlan_hdd_ocb.h" |
| 88 | #include "wlan_hdd_napi.h" |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 89 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 90 | #include "wlan_hdd_nan_datapath.h" |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 91 | #include "wlan_hdd_stats.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 92 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 93 | #include "wlan_hdd_driver_ops.h" |
| 94 | #include "hif.h" |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 95 | #include "pld_common.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 96 | #endif |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 97 | #include "wlan_hdd_lro.h" |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 98 | #include "cds_utils.h" |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 99 | #include "wlan_osif_request_manager.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 100 | #include "os_if_wifi_pos.h" |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 101 | #include <cdp_txrx_stats.h> |
| 102 | #include <cds_api.h> |
Dustin Brown | 6099ddc | 2018-07-06 14:32:53 -0700 | [diff] [blame] | 103 | #include "wlan_dsc_test.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 104 | #include <wlan_osif_priv.h> |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 105 | #include "wlan_hdd_regulatory.h" |
| 106 | #include "wlan_reg_ucfg_api.h" |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 107 | #include "wlan_hdd_packet_filter_api.h" |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 108 | #include "wlan_cp_stats_mc_ucfg_api.h" |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 109 | #include "wlan_mlme_ucfg_api.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 110 | #include "cfg_mlme_sta.h" |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 111 | #include "wlan_mlme_public_struct.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 112 | #include "cfg_ucfg_api.h" |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 113 | #include "wlan_policy_mgr_ucfg.h" |
Harprit Chhabada | bec6de4 | 2018-09-10 10:21:15 -0700 | [diff] [blame] | 114 | #include "wlan_mlme_public_struct.h" |
| 115 | #include "cfg_ucfg_api.h" |
| 116 | #include "cfg_mlme_threshold.h" |
Wu Gao | 66454f1 | 2018-09-26 19:55:41 +0800 | [diff] [blame] | 117 | #include "wlan_pmo_cfg.h" |
| 118 | #include "wlan_pmo_ucfg_api.h" |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 119 | #include "dp_txrx.h" |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 120 | #include "wlan_fwol_ucfg_api.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 121 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 122 | /* Private ioctls and their sub-ioctls */ |
| 123 | #define WLAN_PRIV_SET_INT_GET_NONE (SIOCIWFIRSTPRIV + 0) |
| 124 | #define WE_SET_11D_STATE 1 |
| 125 | #define WE_WOWL 2 |
| 126 | #define WE_SET_POWER 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 127 | /* |
| 128 | * <ioctl> |
| 129 | * setMaxAssoc - Sets the maximum number of associated stations |
| 130 | * |
| 131 | * @INPUT: 1 to 32 |
| 132 | * |
| 133 | * @OUTPUT: None |
| 134 | * |
| 135 | * This IOTCL sets the maximum number of associated stations |
| 136 | * |
| 137 | * @E.g: iwpriv wlan0 setMaxAssoc <value> |
| 138 | * |
| 139 | * Supported Feature: STA |
| 140 | * |
| 141 | * Usage: Internal/External |
| 142 | * |
| 143 | * </ioctl> |
| 144 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 145 | #define WE_SET_MAX_ASSOC 4 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 146 | /* |
| 147 | * <ioctl> |
Jeff Johnson | f2cf659 | 2018-05-06 16:27:44 -0700 | [diff] [blame] | 148 | * scan_disable - Disable scan |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 149 | * |
| 150 | * @INPUT: set_value |
| 151 | * |
| 152 | * @OUTPUT: None |
| 153 | * |
| 154 | * This IOCTL is used to set disable scan |
| 155 | * |
| 156 | * @E.g: iwpriv wlan0 scan_disable 1 |
| 157 | * |
| 158 | * Supported Feature: Scan |
| 159 | * |
| 160 | * Usage: Internal/External |
| 161 | * |
| 162 | * </ioctl> |
| 163 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 164 | #define WE_SET_SCAN_DISABLE 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 165 | /* |
| 166 | * <ioctl> |
| 167 | * inactivityTO - sets the timeout value for inactivity data while |
| 168 | * in power save mode |
| 169 | * |
| 170 | * @INPUT: int1…..int255 |
| 171 | * |
| 172 | * @OUTPUT: None |
| 173 | * |
| 174 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 175 | * |
| 176 | * @E.g: iwpriv wlan0 inactivityTO 20 |
| 177 | * |
| 178 | * Supported Feature: STA |
| 179 | * |
| 180 | * Usage: Internal/External |
| 181 | * |
| 182 | * </ioctl> |
| 183 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | #define WE_SET_DATA_INACTIVITY_TO 6 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 185 | /* |
| 186 | * <ioctl> |
| 187 | * setMaxTxPower - Dynamically sets the maximum transmission power |
| 188 | * |
| 189 | * @INPUT: Transmission power in dBm |
| 190 | * |
| 191 | * @OUTPUT: None |
| 192 | * |
| 193 | * This IOCTL dynamically sets the maximum transmission power |
| 194 | * This setting does not persist over reboots |
| 195 | * |
| 196 | * @E.g: iwpriv wlan0 setMaxTxPower <value in db) |
| 197 | * |
| 198 | * Supported Feature: STA |
| 199 | * |
| 200 | * Usage: Internal/External |
| 201 | * |
| 202 | * </ioctl> |
| 203 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 204 | #define WE_SET_MAX_TX_POWER 7 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 205 | |
| 206 | #ifdef HASTINGS_BT_WAR |
| 207 | /* Temporary WAR for Hastings 1.1 only */ |
| 208 | #define WE_SET_HASTINGS_BT_WAR 8 |
| 209 | #endif |
| 210 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 211 | #define WE_SET_TM_LEVEL 9 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 212 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 213 | /* |
| 214 | * <ioctl> |
| 215 | * setphymode - Set the phymode dynamically |
| 216 | * |
| 217 | * @INPUT: 0 IEEE80211_MODE_AUTO to 22 IEEE80211_MODE_11AGN |
| 218 | * |
| 219 | * @OUTPUT: None |
| 220 | * |
| 221 | * This IOCTL sets the phymode dynamically |
| 222 | * |
| 223 | * @E.g: iwpriv wlan0 setphymode 10 |
| 224 | * |
| 225 | * Supported Feature: STA |
| 226 | * |
| 227 | * Usage: Internal/External |
| 228 | * |
| 229 | * </ioctl> |
| 230 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 231 | #define WE_SET_PHYMODE 10 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 232 | /* |
| 233 | * <ioctl> |
| 234 | * nss - Set the number of spatial streams |
| 235 | * |
| 236 | * @INPUT: int1…..int3 |
| 237 | * |
| 238 | * @OUTPUT: None |
| 239 | * |
| 240 | * This IOCTL sets the number of spatial streams. Supported values are 1 and 2 |
| 241 | * |
| 242 | * @E.g: iwpriv wlan0 nss 2 |
| 243 | * |
| 244 | * Supported Feature: STA |
| 245 | * |
| 246 | * Usage: Internal/External |
| 247 | * |
| 248 | * </ioctl> |
| 249 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 250 | #define WE_SET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 251 | /* |
| 252 | * <ioctl> |
| 253 | * ldpc - Enables or disables LDPC |
| 254 | * |
| 255 | * @INPUT: 0 – Disable, 1 - Enable |
| 256 | * |
| 257 | * @OUTPUT: None |
| 258 | * |
| 259 | * This IOCTL enables or disables LDPC |
| 260 | * |
| 261 | * @E.g: iwpriv wlan0 ldpc 1 |
| 262 | * |
| 263 | * Supported Feature: STA |
| 264 | * |
| 265 | * Usage: Internal/External |
| 266 | * |
| 267 | * </ioctl> |
| 268 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 269 | #define WE_SET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 270 | /* |
| 271 | * <ioctl> |
| 272 | * tx_stbc - Enables or disables tx_stbc |
| 273 | * |
| 274 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 275 | * |
| 276 | * @OUTPUT: None |
| 277 | * |
| 278 | * This IOTCL used to enables or disables tx_stbc |
| 279 | * |
| 280 | * @E.g: iwpriv wlan0 tx_stbc <value> |
| 281 | * |
| 282 | * Supported Feature: STA |
| 283 | * |
| 284 | * Usage: Internal/External |
| 285 | * |
| 286 | * </ioctl> |
| 287 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 288 | #define WE_SET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 289 | /* |
| 290 | * <ioctl> |
| 291 | * rx_stbc - Set the rx_stbc parameter |
| 292 | * |
| 293 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 294 | * |
| 295 | * @OUTPUT: None |
| 296 | * |
| 297 | * This IOTCL used to set rx_stbc parameter |
| 298 | * |
| 299 | * @E.g: iwpriv wlan0 rx_stbc <value> |
| 300 | * |
| 301 | * Supported Feature: STA |
| 302 | * |
| 303 | * Usage: Internal/External |
| 304 | * |
| 305 | * </ioctl> |
| 306 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 307 | #define WE_SET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 308 | /* |
| 309 | * <ioctl> |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 310 | * shortgi - Sets the short-guard interval |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 311 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 312 | * @INPUT: Fixed Rate: 0 - 400ns, 1 - 800ns, 2 - 1600ns, 3 - 3200us |
| 313 | * Auto Rate: 8 - 400ns, 9 - 800ns, 10 - 1600ns, 11 - 3200us |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 314 | * |
| 315 | * @OUTPUT: None |
| 316 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 317 | * This IOCTL sets the short-guard interval. |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 318 | * |
| 319 | * @E.g: iwpriv wlan0 shortgi <value> |
| 320 | * |
| 321 | * Supported Feature: STA |
| 322 | * |
| 323 | * Usage: Internal/External |
| 324 | * |
| 325 | * </ioctl> |
| 326 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 327 | #define WE_SET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 328 | /* |
| 329 | * <ioctl> |
| 330 | * enablertscts - enables or disables rts/cts. |
| 331 | * |
| 332 | * @INPUT: 1-Enable , 0-Disable |
| 333 | * |
| 334 | * @OUTPUT: None |
| 335 | * |
| 336 | * This IOCTL enables or disables rts/cts. |
| 337 | * |
| 338 | * @E.g: iwpriv wlan0 enablertscts <value> |
| 339 | * |
| 340 | * Supported Feature: STA |
| 341 | * |
| 342 | * Usage: Internal/External |
| 343 | * |
| 344 | * </ioctl> |
| 345 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 346 | #define WE_SET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 347 | /* |
| 348 | * <ioctl> |
| 349 | * chwidth - Set the channel bandwidth |
| 350 | * |
| 351 | * @INPUT: 0-20mhz to 3-160mhz |
| 352 | * |
| 353 | * @OUTPUT: None |
| 354 | * |
| 355 | * This IOTCL used to set the channel bandwidth |
| 356 | * |
| 357 | * @E.g: iwpriv wlan0 chwidth 1 |
| 358 | * |
| 359 | * Supported Feature: STA |
| 360 | * |
| 361 | * Usage: Internal/External |
| 362 | * |
| 363 | * </ioctl> |
| 364 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 365 | #define WE_SET_CHWIDTH 17 |
| 366 | #define WE_SET_ANI_EN_DIS 18 |
| 367 | #define WE_SET_ANI_POLL_PERIOD 19 |
| 368 | #define WE_SET_ANI_LISTEN_PERIOD 20 |
| 369 | #define WE_SET_ANI_OFDM_LEVEL 21 |
| 370 | #define WE_SET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 371 | /* |
| 372 | * <ioctl> |
| 373 | * cwmenable - Enables or disables the dynamic channel bandwidth |
| 374 | * |
| 375 | * @INPUT: 0-Disable, 1-Enable |
| 376 | * |
| 377 | * @OUTPUT: None |
| 378 | * |
| 379 | * This IOTCL used to enables or disables the dynamic channel bandwidth |
| 380 | * |
| 381 | * @E.g: iwpriv wlan0 cwmenable <value> |
| 382 | * |
| 383 | * Supported Feature: STA |
| 384 | * |
| 385 | * Usage: Internal/External |
| 386 | * |
| 387 | * </ioctl> |
| 388 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 389 | #define WE_SET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 390 | /* |
| 391 | * <ioctl> |
| 392 | * txchainmask - This IOCTL sets the current Tx chain mask |
| 393 | * |
| 394 | * @INPUT: Mask Value |
| 395 | * |
| 396 | * @OUTPUT: None |
| 397 | * |
| 398 | * This IOCTL sets the current Tx chain mask |
| 399 | * |
| 400 | * @E.g: iwpriv wlan0 txchainmask 1 |
| 401 | * |
| 402 | * Supported Feature: STA |
| 403 | * |
| 404 | * Usage: Internal/External |
| 405 | * |
| 406 | * </ioctl> |
| 407 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | #define WE_SET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 409 | /* |
| 410 | * <ioctl> |
| 411 | * rxchainmask - Sets the current Rx chain mask |
| 412 | * |
| 413 | * @INPUT: Mask Value |
| 414 | * |
| 415 | * @OUTPUT: None |
| 416 | * |
| 417 | * This IOCTL sets the current Rx chain mask. This command is the |
| 418 | * equivalent to setting in gSetRxChainmask1x1 in WCNSS_qcom_cfg.ini. |
| 419 | * |
| 420 | * @E.g: iwpriv wlan0 rxchainmask <value> |
| 421 | * |
| 422 | * Supported Feature: STA |
| 423 | * |
| 424 | * Usage: Internal/External |
| 425 | * |
| 426 | * </ioctl> |
| 427 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 428 | #define WE_SET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 429 | /* |
| 430 | * <ioctl> |
| 431 | * set11NRates - Fixes the Tx data rate of the 11N mode. |
| 432 | * |
| 433 | * @INPUT: 0x1b to 0x8f |
| 434 | * |
| 435 | * @OUTPUT: None |
| 436 | * |
| 437 | * This IOCTL fixes the Tx data rate of the 11N mode. |
| 438 | * |
| 439 | * @E.g: iwpriv wlan0 set11NRates 0x85 |
| 440 | * |
| 441 | * Supported Feature: STA |
| 442 | * |
| 443 | * Usage: Internal/External |
| 444 | * |
| 445 | * </ioctl> |
| 446 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 447 | #define WE_SET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 448 | /* |
| 449 | * <ioctl> |
| 450 | * ampdu - Set the the maximum subframe of ampdu |
| 451 | * |
| 452 | * @INPUT: int 1 to int 63 |
| 453 | * |
| 454 | * @OUTPUT: None |
| 455 | * |
| 456 | * This IOCTL sets the maximum subframe of ampdu. |
| 457 | * |
| 458 | * @E.g: iwpriv wlan0 ampdu 9 |
| 459 | * |
| 460 | * Supported Feature: STA |
| 461 | * |
| 462 | * Usage: Internal/External |
| 463 | * |
| 464 | * </ioctl> |
| 465 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 466 | #define WE_SET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 467 | /* |
| 468 | * <ioctl> |
| 469 | * amsdu - Sets the maximum subframe of amsdu. |
| 470 | * |
| 471 | * @INPUT: int 1 to int 31 |
| 472 | * |
| 473 | * @OUTPUT: None |
| 474 | * |
| 475 | * This IOCTL sets the maximum subframe of amsdu. |
| 476 | * |
| 477 | * @E.g: iwpriv wlan0 amsdu 9 |
| 478 | * |
| 479 | * Supported Feature: STA |
| 480 | * |
| 481 | * Usage: Internal/External |
| 482 | * |
| 483 | * </ioctl> |
| 484 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 485 | #define WE_SET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 486 | /* |
| 487 | * <ioctl> |
| 488 | * txpow2g - current 2 GHz Tx power setting |
| 489 | * |
| 490 | * @INPUT: Tx power in dBm |
| 491 | * |
| 492 | * @OUTPUT: None |
| 493 | * |
| 494 | * This IOTCL used to set 2 ghz tx power |
| 495 | * |
| 496 | * @E.g: iwpriv wlan0 txpow2g |
| 497 | * |
| 498 | * Supported Feature: STA |
| 499 | * |
| 500 | * Usage: Internal/External |
| 501 | * |
| 502 | * </ioctl> |
| 503 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 504 | #define WE_SET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 505 | /* |
| 506 | * <ioctl> |
| 507 | * txpow5g - Current 5 GHz tx power setting |
| 508 | * |
| 509 | * @INPUT: Tx power in dBm |
| 510 | * |
| 511 | * @OUTPUT: None |
| 512 | * |
| 513 | * This IOTCL used to set the 5 ghz txpower |
| 514 | * |
| 515 | * @E.g: iwpriv wlan0 txpow5g |
| 516 | * |
| 517 | * Supported Feature: STA |
| 518 | * |
| 519 | * Usage: Internal/External |
| 520 | * |
| 521 | * </ioctl> |
| 522 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 523 | #define WE_SET_TXPOW_5G 30 |
| 524 | /* Private ioctl for firmware debug log */ |
| 525 | #define WE_DBGLOG_LOG_LEVEL 31 |
| 526 | #define WE_DBGLOG_VAP_ENABLE 32 |
| 527 | #define WE_DBGLOG_VAP_DISABLE 33 |
| 528 | #define WE_DBGLOG_MODULE_ENABLE 34 |
| 529 | #define WE_DBGLOG_MODULE_DISABLE 35 |
| 530 | #define WE_DBGLOG_MOD_LOG_LEVEL 36 |
| 531 | #define WE_DBGLOG_TYPE 37 |
| 532 | #define WE_SET_TXRX_FWSTATS 38 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 533 | /* |
| 534 | * <ioctl> |
| 535 | * set11ACRates - Fixes the Tx data rate of 11AC |
| 536 | * |
| 537 | * @INPUT: 0x1 to 0x9 |
| 538 | * |
| 539 | * @OUTPUT: None |
| 540 | * |
| 541 | * This IOCTL fixes the Tx data rate of 11AC. |
| 542 | * |
| 543 | * @E.g: iwpriv wlan0 set11ACRates 0x9 |
| 544 | * |
| 545 | * Supported Feature: STA |
| 546 | * |
| 547 | * Usage: Internal/External |
| 548 | * |
| 549 | * </ioctl> |
| 550 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 551 | #define WE_SET_VHT_RATE 39 |
| 552 | #define WE_DBGLOG_REPORT_ENABLE 40 |
| 553 | #define WE_TXRX_FWSTATS_RESET 41 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 554 | /* |
| 555 | * <ioctl> |
| 556 | * setTxMaxPower2G - Set the maximum transmit power for the 2.4-GHz band |
| 557 | * |
| 558 | * @INPUT: Transmission power in dBm |
| 559 | * |
| 560 | * @OUTPUT: None |
| 561 | * |
| 562 | * This IOCTL sets the maximum transmit power for the 2.4-GHz band |
| 563 | * This setting does not persist over reboots |
| 564 | * |
| 565 | * @E.g: iwpriv wlan0 setTxMaxPower2G 10 |
| 566 | * |
| 567 | * Supported Feature: STA |
| 568 | * |
| 569 | * Usage: Internal/External |
| 570 | * |
| 571 | * </ioctl> |
| 572 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 573 | #define WE_SET_MAX_TX_POWER_2_4 42 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 574 | /* |
| 575 | * <ioctl> |
| 576 | * setTxMaxPower5G - Set the maximum transmit power for the 5-GHz band |
| 577 | * |
| 578 | * @INPUT: Transmission power in dBm |
| 579 | * |
| 580 | * @OUTPUT: None |
| 581 | * |
| 582 | * This IOCTL sets the maximum transmit power for the 5-GHz band |
| 583 | * This setting does not persist over reboots |
| 584 | * |
| 585 | * @E.g: iwpriv wlan0 setTxMaxPower5G 10 |
| 586 | * |
| 587 | * Supported Feature: STA |
| 588 | * |
| 589 | * Usage: Internal/External |
| 590 | * |
| 591 | * </ioctl> |
| 592 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 593 | #define WE_SET_MAX_TX_POWER_5_0 43 |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 594 | #define WE_SET_PKTLOG 44 |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 595 | /* Private ioctl for packet power save */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 596 | #define WE_PPS_PAID_MATCH 45 |
| 597 | #define WE_PPS_GID_MATCH 46 |
| 598 | #define WE_PPS_EARLY_TIM_CLEAR 47 |
| 599 | #define WE_PPS_EARLY_DTIM_CLEAR 48 |
| 600 | #define WE_PPS_EOF_PAD_DELIM 49 |
| 601 | #define WE_PPS_MACADDR_MISMATCH 50 |
| 602 | #define WE_PPS_DELIM_CRC_FAIL 51 |
| 603 | #define WE_PPS_GID_NSTS_ZERO 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 604 | /* |
| 605 | * <ioctl> |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 606 | * rssi_chk - Check the rssi |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 607 | * |
| 608 | * @INPUT: One argument as input |
| 609 | * |
| 610 | * @OUTPUT: rssi |
| 611 | * wlan0 rssi_chk:56 |
| 612 | * |
| 613 | * This IOTCL used to chek rssi |
| 614 | * |
| 615 | * @E.g: iwpriv wlan0 rssi_chk <value> |
| 616 | * |
| 617 | * Supported Feature: STA |
| 618 | * |
| 619 | * Usage: Internal/External |
| 620 | * |
| 621 | * </ioctl> |
| 622 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 623 | #define WE_PPS_RSSI_CHECK 53 |
Agrawal Ashish | bafaff1 | 2016-12-27 17:43:08 +0530 | [diff] [blame] | 624 | /* |
| 625 | * <ioctl> |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 626 | * htsmps - Sets the htsmps |
| 627 | * |
| 628 | * @INPUT: Atleast one int argument |
| 629 | * |
| 630 | * @OUTPUT: None |
| 631 | * |
| 632 | * This IOTCL used to set htsmps |
| 633 | * |
| 634 | * @E.g: iwpriv wlan0 htsmps <value> |
| 635 | * |
| 636 | * Supported Feature: STA |
| 637 | * |
| 638 | * Usage: Internal/External |
| 639 | * |
| 640 | * </ioctl> |
| 641 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 642 | #define WE_SET_HTSMPS 55 |
| 643 | /* Private ioctl for QPower */ |
| 644 | #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 |
| 645 | #define WE_SET_QPOWER_MAX_TX_BEFORE_WAKE 57 |
| 646 | #define WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 58 |
| 647 | #define WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 649 | /* |
| 650 | * <ioctl> |
| 651 | * gtxHTMcs - Set the tx HTM value |
| 652 | * |
| 653 | * @INPUT: Atleast one int orgument |
| 654 | * |
| 655 | * @OUTPUT: None |
| 656 | * |
| 657 | * This IOTCL sets htm tx value |
| 658 | * |
| 659 | * @E.g: iwpriv wlan0 gtxHTMcs <value> |
| 660 | * |
| 661 | * Supported Feature: STA |
| 662 | * |
| 663 | * Usage: Internal/External |
| 664 | * |
| 665 | * </ioctl> |
| 666 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 667 | #define WE_SET_GTX_HT_MCS 62 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 668 | /* |
| 669 | * <ioctl> |
| 670 | * gtxVHTMcs - Set gtxVHTMcs value |
| 671 | * |
| 672 | * @INPUT: Atleast one int argument |
| 673 | * |
| 674 | * @OUTPUT: None |
| 675 | * |
| 676 | * This IOTCL used to set gtxVHTMcs value |
| 677 | * |
| 678 | * @E.g: iwpriv wlan0 gtxVHTMcs <value> |
| 679 | * |
| 680 | * Supported Feature: STA |
| 681 | * |
| 682 | * Usage: Internal/External |
| 683 | * |
| 684 | * </ioctl> |
| 685 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 686 | #define WE_SET_GTX_VHT_MCS 63 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 687 | /* |
| 688 | * <ioctl> |
| 689 | * gtxUsrCfg - Host request for GTX mask |
| 690 | * |
| 691 | * @INPUT: Atleast one int orgument |
| 692 | * |
| 693 | * @OUTPUT: None |
| 694 | * |
| 695 | * This IOTCL used send the host request for GTX mask |
| 696 | * |
| 697 | * @E.g: iwpriv wlan0 gtxUsrCfg <value> |
| 698 | * |
| 699 | * Supported Feature: STA |
| 700 | * |
| 701 | * Usage: Internal/External |
| 702 | * |
| 703 | * </ioctl> |
| 704 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 705 | #define WE_SET_GTX_USRCFG 64 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 706 | /* |
| 707 | * <ioctl> |
| 708 | * gtxThre - Set the tx threshold |
| 709 | * |
| 710 | * @INPUT: Atleast one int argument |
| 711 | * |
| 712 | * @OUTPUT: None |
| 713 | * |
| 714 | * This IOTCL used to set tx threshold |
| 715 | * |
| 716 | * @E.g: iwpriv wlan0 gtxThre <value> |
| 717 | * |
| 718 | * Supported Feature: STA |
| 719 | * |
| 720 | * Usage: Internal/External |
| 721 | * |
| 722 | * </ioctl> |
| 723 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 724 | #define WE_SET_GTX_THRE 65 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 725 | /* |
| 726 | * <ioctl> |
| 727 | * gtxMargin - Set the gtxMargin |
| 728 | * |
| 729 | * @INPUT: 1 to 32 |
| 730 | * |
| 731 | * @OUTPUT: None |
| 732 | * |
| 733 | * This IOTCL use dto set gtxMargin |
| 734 | * |
| 735 | * @E.g: iwpriv wlan0 gtxMargini <value> |
| 736 | * |
| 737 | * Supported Feature: STA |
| 738 | * |
| 739 | * Usage: Internal/External |
| 740 | * |
| 741 | * </ioctl> |
| 742 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 743 | #define WE_SET_GTX_MARGIN 66 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 744 | /* |
| 745 | * <ioctl> |
| 746 | * gtxStep - Set the gtxStep |
| 747 | * |
| 748 | * @INPUT: None |
| 749 | * |
| 750 | * @OUTPUT: None |
| 751 | * |
| 752 | * This IOTCL used to sets gtxStep |
| 753 | * |
| 754 | * @E.g: iwpriv wlan0 gtxStep <value> |
| 755 | * |
| 756 | * Supported Feature: STA |
| 757 | * |
| 758 | * Usage: Internal/External |
| 759 | * |
| 760 | * </ioctl> |
| 761 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 762 | #define WE_SET_GTX_STEP 67 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 763 | /* |
| 764 | * <ioctl> |
| 765 | * gtxMinTpc - Sets the gtxMinTpc |
| 766 | * |
| 767 | * @INPUT: Atleast one int argument |
| 768 | * |
| 769 | * @OUTPUT: None |
| 770 | * |
| 771 | * This IOTCL sets the tx MinTpc |
| 772 | * |
| 773 | * @E.g: iwpriv wlan0 gtxMinTpc <value> |
| 774 | * |
| 775 | * Supported Feature: STA |
| 776 | * |
| 777 | * Usage: Internal/External |
| 778 | * |
| 779 | * </ioctl> |
| 780 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 781 | #define WE_SET_GTX_MINTPC 68 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 782 | /* |
| 783 | * <ioctl> |
| 784 | * gtxBWMask - Sets the BW mask (20/40/80/160 Mhz) |
| 785 | * |
| 786 | * @INPUT: Mask value |
| 787 | * |
| 788 | * @OUTPUT: None |
| 789 | * |
| 790 | * This IOTCL used to set gtxBWMask |
| 791 | * |
| 792 | * @E.g: iwpriv wlan0 gtxBWMask <value> |
| 793 | * |
| 794 | * Supported Feature: STA |
| 795 | * |
| 796 | * Usage: Internal/External |
| 797 | * |
| 798 | * </ioctl> |
| 799 | */ |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 800 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 801 | #define WE_SET_GTX_BWMASK 69 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 802 | /* |
| 803 | * <ioctl> |
| 804 | * setMccLatency - Sets the MCC latency value during STA-P2P concurrency |
| 805 | * |
| 806 | * @INPUT: set_value |
| 807 | * |
| 808 | * @OUTPUT: None |
| 809 | * |
| 810 | * This IOCTL is used to set the MCC latency value in milliseconds |
| 811 | * during STA-P2P concurrency. |
| 812 | * |
| 813 | * If 0ms latency is provided, then FW will set to a default. |
| 814 | * Otherwise, latency must be at least 30ms. |
| 815 | * |
| 816 | * @E.g: iwpriv wlan0 setMccLatency 40 |
| 817 | * |
| 818 | * |
| 819 | * Supported Feature: Concurrency |
| 820 | * |
| 821 | * Usage: Internal/External |
| 822 | * |
| 823 | * </ioctl> |
| 824 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 825 | #define WE_MCC_CONFIG_LATENCY 70 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 826 | |
| 827 | /* |
| 828 | * <ioctl> |
| 829 | * setMccQuota- Set the quota for P2P cases |
| 830 | * |
| 831 | * @INPUT: set_value [0,100] |
| 832 | * |
| 833 | * @OUTPUT: None |
| 834 | * |
| 835 | * This IOCTL is used to set the quota in milliseconds for P2P_GO/STA. |
| 836 | * |
| 837 | * Currently used to set time quota for 2 MCC vdevs/adapters using |
| 838 | * (operating channel, quota) for each mode. |
| 839 | * The info is provided run time using iwpriv command: |
| 840 | * iwpriv <wlan0 | p2p0> setMccQuota <quota in ms>. |
| 841 | * Note: the quota provided in command is for the same mode in cmd. |
| 842 | * HDD checks if MCC mode is active, gets the second mode and its |
| 843 | * operating chan. |
| 844 | * Quota for the 2nd role is calculated as 100 - quota of first mode. |
| 845 | * |
| 846 | * @E.g: iwpriv wlan0 setMccQuota 50 |
| 847 | * iwpriv p2p0 setMccQuota 50 |
| 848 | * |
| 849 | * Supported Feature: Concurrency |
| 850 | * |
| 851 | * Usage: Internal/External |
| 852 | * |
| 853 | * </ioctl> |
| 854 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 855 | #define WE_MCC_CONFIG_QUOTA 71 |
| 856 | /* Private IOCTL for debug connection issues */ |
| 857 | #define WE_SET_DEBUG_LOG 72 |
| 858 | #ifdef WE_SET_TX_POWER |
| 859 | #undef WE_SET_TX_POWER |
| 860 | #endif |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 861 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 862 | /* |
| 863 | * <ioctl> |
| 864 | * setTxPower - Set the current transmit power |
| 865 | * |
| 866 | * @INPUT: Transmission power in dBm |
| 867 | * |
| 868 | * @OUTPUT: None |
| 869 | * |
| 870 | * This IOCTL sets the current transmit power. |
| 871 | * This setting does not persist over reboots. |
| 872 | * |
| 873 | * @E.g: iwpriv wlan0 setTxPower 10 |
| 874 | * |
| 875 | * Supported Feature: STA |
| 876 | * |
| 877 | * Usage: Internal/External |
| 878 | * |
| 879 | * </ioctl> |
| 880 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 881 | #define WE_SET_TX_POWER 74 |
| 882 | /* Private ioctl for earlyrx power save feature */ |
| 883 | #define WE_SET_EARLY_RX_ADJUST_ENABLE 75 |
| 884 | #define WE_SET_EARLY_RX_TGT_BMISS_NUM 76 |
| 885 | #define WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE 77 |
| 886 | #define WE_SET_EARLY_RX_SLOP_STEP 78 |
| 887 | #define WE_SET_EARLY_RX_INIT_SLOP 79 |
| 888 | #define WE_SET_EARLY_RX_ADJUST_PAUSE 80 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 889 | /* |
| 890 | * <ioctl> |
| 891 | * setMcRate - Set the data rate for multicast data |
| 892 | * |
| 893 | * @INPUT: 1 to 32 |
| 894 | * |
| 895 | * @OUTPUT: None |
| 896 | * |
| 897 | * This IOCTL sets the data rate for multicast data. Note that this command |
| 898 | * is allowed only in STA, IBSS, or QCMobileAP mode |
| 899 | * |
| 900 | * @E.g: iwpriv wlan0 setMcRate <value> |
| 901 | * |
| 902 | * Supported Feature: STA |
| 903 | * |
| 904 | * Usage: Internal/External |
| 905 | * |
| 906 | * </ioctl> |
| 907 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 908 | #define WE_SET_MC_RATE 81 |
| 909 | #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 |
| 910 | /* Private ioctl for packet power save */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 911 | /* |
| 912 | * <ioctl> |
| 913 | * 5g_ebt - Sets the 5g_ebt |
| 914 | * |
| 915 | * @INPUT: <value> |
| 916 | * |
| 917 | * @OUTPUT: None |
| 918 | * |
| 919 | * This IOTCL used to set 5g_ebt |
| 920 | * |
| 921 | * @E.g: iwpriv wlan0 5g_ebt <value> |
| 922 | * |
| 923 | * Supported Feature: STA |
| 924 | * |
| 925 | * Usage: Internal/External |
| 926 | * |
| 927 | * </ioctl> |
| 928 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 929 | #define WE_PPS_5G_EBT 83 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 930 | /* |
| 931 | * <ioctl> |
| 932 | * cts_cbw - Set CTS channel BW for dynamic BW adjustment |
| 933 | * |
| 934 | * @INPUT: 20 t0 160 |
| 935 | * |
| 936 | * @OUTPUT: None |
| 937 | * |
| 938 | * This IOTCL used to set CTS channel BW for dynamic BW adjustment |
| 939 | * |
| 940 | * @E.g: iwpriv wlan0 cts_cbw <value> |
| 941 | * |
| 942 | * Supported Feature: STA |
| 943 | * |
| 944 | * Usage: Internal/External |
| 945 | * |
| 946 | * </ioctl> |
| 947 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 948 | #define WE_SET_CTS_CBW 84 |
| 949 | #define WE_DUMP_STATS 85 |
| 950 | #define WE_CLEAR_STATS 86 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 951 | /* Private sub ioctl for starting/stopping the profiling */ |
| 952 | #define WE_START_FW_PROFILE 87 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 953 | |
Abhishek Singh | 3c50701 | 2016-12-01 11:15:42 +0530 | [diff] [blame] | 954 | /* |
| 955 | * <ioctl> |
| 956 | * setChanChange - Initiate channel change |
| 957 | * |
| 958 | * @INPUT: channel number to switch to. |
| 959 | * |
| 960 | * @OUTPUT: None |
| 961 | * |
| 962 | * This IOCTL is used to initiate a channel change. |
| 963 | * If called on STA/CLI interface it will send the |
| 964 | * ECSA action frame to the connected SAP/GO asking to |
| 965 | * initiate the ECSA, if supported. |
| 966 | * If called on SAP/GO interface it will initiate |
| 967 | * ECSA and ask connected peers to move to new channel. |
| 968 | * |
| 969 | * @E.g: iwpriv wlan0 setChanChange <channel> |
| 970 | * iwpriv wlan0 setChanChange 1 |
| 971 | * |
| 972 | * Supported Feature: ECSA |
| 973 | * |
| 974 | * Usage: Internal/External |
| 975 | * |
| 976 | * </ioctl> |
| 977 | */ |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 978 | #define WE_SET_CHANNEL 88 |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 979 | #define WE_SET_CONC_SYSTEM_PREF 89 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 980 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 981 | /* |
| 982 | * <ioctl> |
| 983 | * set_11ax_rate - set 11ax rates to FW |
| 984 | * |
| 985 | * @INPUT: rate code |
| 986 | * |
| 987 | * @OUTPUT: None |
| 988 | * |
| 989 | * This IOCTL fixes the Tx data rate of 11AX. |
| 990 | * |
| 991 | * @E.g: iwpriv wlan0 set_11ax_rate <rate code> |
| 992 | * |
| 993 | * Supported Feature: STA/SAP |
| 994 | * |
| 995 | * Usage: Internal |
| 996 | * |
| 997 | * </ioctl> |
| 998 | */ |
| 999 | #define WE_SET_11AX_RATE 91 |
| 1000 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1001 | /* |
| 1002 | * <ioctl> |
| 1003 | * enable_dcm - enable Dual Carrier Modulation(DCM) |
| 1004 | * |
| 1005 | * @INPUT: 0/1 |
| 1006 | * |
| 1007 | * @OUTPUT: None |
| 1008 | * |
| 1009 | * This IOCTL enables/disables DCM. |
| 1010 | * |
| 1011 | * @E.g: iwpriv wlan0 enable_dcm <0/1> |
| 1012 | * |
| 1013 | * Supported Feature: STA/SAP |
| 1014 | * |
| 1015 | * Usage: Internal |
| 1016 | * |
| 1017 | * </ioctl> |
| 1018 | */ |
| 1019 | #define WE_SET_DCM 92 |
| 1020 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1021 | /* |
| 1022 | * <ioctl> |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1023 | * range_ext - enable Range extension |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1024 | * |
| 1025 | * @INPUT: 0/1 |
| 1026 | * |
| 1027 | * @OUTPUT: None |
| 1028 | * |
| 1029 | * This IOCTL enables/disables Range extension. |
| 1030 | * |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1031 | * @E.g: iwpriv wlan0 range_ext <1/0> |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1032 | * |
| 1033 | * Supported Feature: STA/SAP |
| 1034 | * |
| 1035 | * Usage: Internal |
| 1036 | * |
| 1037 | * </ioctl> |
| 1038 | */ |
| 1039 | #define WE_SET_RANGE_EXT 93 |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1040 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1041 | /* |
| 1042 | * <ioctl> |
| 1043 | * wow_ito - sets the timeout value for inactivity data while |
| 1044 | * in power save mode during wow |
| 1045 | * |
| 1046 | * @INPUT: int |
| 1047 | * |
| 1048 | * @OUTPUT: None |
| 1049 | * |
| 1050 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 1051 | * |
| 1052 | * @E.g: iwpriv wlan0 wow_ito 20 |
| 1053 | * |
| 1054 | * Supported Feature: STA |
| 1055 | * |
| 1056 | * Usage: External |
| 1057 | * |
| 1058 | * </ioctl> |
Jeff Johnson | dcf84ce | 2017-10-05 09:26:24 -0700 | [diff] [blame] | 1059 | */ |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1060 | #define WE_SET_WOW_DATA_INACTIVITY_TO 94 |
| 1061 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 1062 | /* |
| 1063 | * <ioctl> |
| 1064 | * pdev_reset - reset the pdev |
| 1065 | * |
| 1066 | * @INPUT: Reset command to initiate: |
| 1067 | * TX_FLUSH = 1 |
| 1068 | * WARM_RESET = 2 |
| 1069 | * COLD_RESET = 3 |
| 1070 | * WARM_RESET_RESTORE_CAL = 4 |
| 1071 | * COLD_RESET_RESTORE_CAL = 5 |
| 1072 | * |
| 1073 | * @OUTPUT: None |
| 1074 | * |
| 1075 | * This IOCTL is used to reset the pdev. The primary use is |
| 1076 | * for internal testing. It is not expected that this will |
| 1077 | * be used on a production device. |
| 1078 | * |
| 1079 | * @E.g: iwpriv wlan0 pdev_reset <command> |
| 1080 | * iwpriv wlan0 pdev_reset 1 |
| 1081 | * |
| 1082 | * Supported Feature: None |
| 1083 | * |
| 1084 | * Usage: Internal |
| 1085 | * |
| 1086 | * </ioctl> |
| 1087 | */ |
| 1088 | #define WE_SET_PDEV_RESET 95 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1089 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1090 | /* |
| 1091 | * setModDTIM - Change Modulated DTIM |
| 1092 | * |
| 1093 | * @INPUT: set_value. |
| 1094 | * |
| 1095 | * @OUTPUT: None |
| 1096 | * |
| 1097 | * This IOCTL is used to change modulated DTIM |
| 1098 | * value without WIFI OFF/ON. |
| 1099 | * |
| 1100 | * @E.g: iwpriv wlan0 setModDTIM <value> |
| 1101 | * iwpriv wlan0 setModDTIM 2 |
| 1102 | * |
| 1103 | * Supported Feature: N/A |
| 1104 | * |
| 1105 | * Usage: Internal/External |
| 1106 | * |
| 1107 | * </ioctl> |
| 1108 | */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 1109 | #define WE_SET_MODULATED_DTIM 96 |
| 1110 | |
| 1111 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 1112 | #define WE_MOTION_DET_START_STOP 97 |
| 1113 | #define WE_MOTION_DET_BASE_LINE_START_STOP 98 |
| 1114 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1115 | |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1116 | /* |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1117 | * set_btc_mode Set BTCoexMode |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1118 | * |
| 1119 | * @INPUT: set_value. |
| 1120 | * |
| 1121 | * @OUTPUT: None |
| 1122 | * |
| 1123 | * This IOCTL is used to set the BT COex operating mode |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1124 | * Allowed values are 0(TDD), 1(FDD), 2(Hybrid) |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1125 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1126 | * @E.g: iwpriv wlan0 set_btc_mode <value> |
| 1127 | * iwpriv wlan0 set_btc_mode 2 |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1128 | * |
| 1129 | * Supported Feature: N/A |
| 1130 | * |
| 1131 | * Usage: Internal/External |
| 1132 | * |
| 1133 | * </ioctl> |
| 1134 | */ |
| 1135 | #define WE_SET_BTCOEX_MODE 99 |
| 1136 | |
| 1137 | /* |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1138 | * set_btc_rssi- Set WLAN low RSSI threshold for BTCOex |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1139 | * |
| 1140 | * @INPUT: set_value. |
| 1141 | * |
| 1142 | * @OUTPUT: None |
| 1143 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1144 | * This IOCTL is used to modify the threshold at which |
| 1145 | * the COex mode changes from TDD to Hybrid mode |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1146 | * Allowed values are from -100 to 0 |
| 1147 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1148 | * @E.g: iwpriv wlan0 set_btc_rssi <value> |
| 1149 | * iwpriv wlan0 set_btc_rssi -70 |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1150 | * |
| 1151 | * Supported Feature: N/A |
| 1152 | * |
| 1153 | * Usage: Internal/External |
| 1154 | * |
| 1155 | * </ioctl> |
| 1156 | */ |
| 1157 | #define WE_SET_BTCOEX_RSSI_THRESHOLD 100 |
| 1158 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | /* Private ioctls and their sub-ioctls */ |
| 1160 | #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) |
| 1161 | #define WE_GET_11D_STATE 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1162 | #define WE_GET_WLAN_DBG 4 |
| 1163 | #define WE_GET_MAX_ASSOC 6 |
| 1164 | /* 7 is unused */ |
| 1165 | #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 1166 | |
| 1167 | /* |
| 1168 | * <ioctl> |
| 1169 | * getconcurrency - Get concurrency mode |
| 1170 | * |
| 1171 | * @INPUT: None |
| 1172 | * |
| 1173 | * @OUTPUT: It shows concurrency value |
| 1174 | * Bit 0:STA 1:SAP 2:P2P_Client 3:P2P_GO |
| 1175 | * 4:FTM 5:IBSS 6:Monitor 7:P2P_Device |
| 1176 | * 8:OCB 9:EPPING 10:QVIT 11:NDI |
| 1177 | * |
| 1178 | * This IOCTL is used to retrieve concurrency mode. |
| 1179 | * |
| 1180 | * @E.g: iwpriv wlan0 getconcurrency |
| 1181 | * wlan0 getconcurrency:5 |
| 1182 | * Above value shows STA+P2P_Client |
| 1183 | * |
| 1184 | * Supported Feature: Concurrency |
| 1185 | * |
| 1186 | * Usage: Internal/External |
| 1187 | * |
| 1188 | * </ioctl> |
| 1189 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1190 | #define WE_GET_CONCURRENCY_MODE 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1191 | /* |
| 1192 | * <ioctl> |
| 1193 | * get_nss - Get the number of spatial STBC streams (NSS) |
| 1194 | * |
| 1195 | * @INPUT: None |
| 1196 | * |
| 1197 | * @OUTPUT: NSS |
| 1198 | * wlan0 get_nss:2 |
| 1199 | * |
| 1200 | * This IOTCL used to get the number of spatial STBC streams |
| 1201 | * |
| 1202 | * @E.g: iwpriv wlan0 get_nss |
| 1203 | * |
| 1204 | * Supported Feature: STA |
| 1205 | * |
| 1206 | * Usage: Internal/External |
| 1207 | * |
| 1208 | * </ioctl> |
| 1209 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1210 | #define WE_GET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1211 | /* |
| 1212 | * <ioctl> |
| 1213 | * get_ldpc - This IOCTL gets the low density parity check (LDPC) |
| 1214 | * |
| 1215 | * @INPUT: None |
| 1216 | * |
| 1217 | * @OUTPUT: ldpc |
| 1218 | * wlan0 get_ldpc:1 |
| 1219 | * |
| 1220 | * This IOTCL used to gets the low density parity check (LDPC) |
| 1221 | * |
| 1222 | * @E.g: iwpriv wlan0 get_ldpc |
| 1223 | * |
| 1224 | * Supported Feature: STA |
| 1225 | * |
| 1226 | * Usage: Internal/External |
| 1227 | * |
| 1228 | * </ioctl> |
| 1229 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1230 | #define WE_GET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1231 | /* |
| 1232 | * <ioctl> |
| 1233 | * get_tx_stbc - Get the value of the current Tx space time block code (STBC) |
| 1234 | * |
| 1235 | * @INPUT: None |
| 1236 | * |
| 1237 | * @OUTPUT: TXSTBC |
| 1238 | * wlan0 get_tx_stbc:1 |
| 1239 | * |
| 1240 | * This IOTCL get the value of the current Tx space time block code (STBC) |
| 1241 | * |
| 1242 | * @E.g: iwpriv wlan0 get_tx_stbc |
| 1243 | * |
| 1244 | * Supported Feature: STA |
| 1245 | * |
| 1246 | * Usage: Internal/External |
| 1247 | * |
| 1248 | * </ioctl> |
| 1249 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1250 | #define WE_GET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1251 | /* |
| 1252 | * <ioctl> |
| 1253 | * get_rx_stbc - Gets the value of the current Rx STBC |
| 1254 | * |
| 1255 | * @INPUT: None |
| 1256 | * |
| 1257 | * @OUTPUT: Rx STBC |
| 1258 | * wlan0 get_rx_stbc:1 |
| 1259 | * |
| 1260 | * This IOTCL used to get the value of the current Rx STBC |
| 1261 | * |
| 1262 | * @E.g: iwpriv wlan0 get_rx_stbc |
| 1263 | * |
| 1264 | * Supported Feature: STA |
| 1265 | * |
| 1266 | * Usage: Internal/External |
| 1267 | * |
| 1268 | * </ioctl> |
| 1269 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1270 | #define WE_GET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1271 | /* |
| 1272 | * <ioctl> |
| 1273 | * get_shortgi - Get the value of the current short GI setting |
| 1274 | * |
| 1275 | * @INPUT: None |
| 1276 | * |
| 1277 | * @OUTPUT: Enable/disable of shortgi |
| 1278 | * wlan0 get_shortgi:1 |
| 1279 | * |
| 1280 | * This IOCTL gets the value of the current short GI setting |
| 1281 | * |
| 1282 | * @E.g: iwpriv wlan0 get_shortgi |
| 1283 | * |
| 1284 | * Supported Feature: STA |
| 1285 | * |
| 1286 | * Usage: Internal/External |
| 1287 | * |
| 1288 | * </ioctl> |
| 1289 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1290 | #define WE_GET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1291 | /* |
| 1292 | * <ioctl> |
| 1293 | * get_rtscts - Get the value of the current RTS/CTS setting. |
| 1294 | * |
| 1295 | * @INPUT: None |
| 1296 | * |
| 1297 | * @OUTPUT: Enable/disable of RTS/CTS |
| 1298 | * wlan0 get_rtscts:33 |
| 1299 | * |
| 1300 | * This IOTCL get the value of the current RTS/CTS setting. |
| 1301 | * |
| 1302 | * @E.g: iwpriv wlan0 get_rtscts |
| 1303 | * |
| 1304 | * Supported Feature: STA |
| 1305 | * |
| 1306 | * Usage: Internal/External |
| 1307 | * |
| 1308 | * </ioctl> |
| 1309 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1310 | #define WE_GET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1311 | /* |
| 1312 | * <ioctl> |
| 1313 | * get_chwidth - Get the current channel width setting |
| 1314 | * |
| 1315 | * @INPUT: None |
| 1316 | * |
| 1317 | * @OUTPUT: channel width |
| 1318 | * wlan0 get_chwidth:0 |
| 1319 | * |
| 1320 | * This IOTCL get the current channel width setting. |
| 1321 | * |
| 1322 | * @E.g: iwpriv wlan0 get_chwidth |
| 1323 | * |
| 1324 | * Supported Feature: STA |
| 1325 | * |
| 1326 | * Usage: Internal/External |
| 1327 | * |
| 1328 | * </ioctl> |
| 1329 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1330 | #define WE_GET_CHWIDTH 17 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1331 | /* |
| 1332 | * <ioctl> |
| 1333 | * get_anienable - Get the anienable |
| 1334 | * |
| 1335 | * @INPUT: None |
| 1336 | * |
| 1337 | * @OUTPUT: |
| 1338 | * wlan0 get_anienable:0 |
| 1339 | * |
| 1340 | * This IOTCL get the anienable |
| 1341 | * |
| 1342 | * @E.g: iwpriv wlan0 get_anienable |
| 1343 | * |
| 1344 | * Supported Feature: STA |
| 1345 | * |
| 1346 | * Usage: Internal/External |
| 1347 | * |
| 1348 | * </ioctl> |
| 1349 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1350 | #define WE_GET_ANI_EN_DIS 18 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1351 | /* |
| 1352 | * <ioctl> |
| 1353 | * get_aniplen - Get the aniplen |
| 1354 | * |
| 1355 | * @INPUT: None |
| 1356 | * |
| 1357 | * @OUTPUT: |
| 1358 | * wlan0 get_aniplen:0 |
| 1359 | * |
| 1360 | * This IOTCL get the aniplen |
| 1361 | * |
| 1362 | * @E.g: iwpriv wlan0 get_aniplen |
| 1363 | * |
| 1364 | * Supported Feature: STA |
| 1365 | * |
| 1366 | * Usage: Internal/External |
| 1367 | * |
| 1368 | * </ioctl> |
| 1369 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1370 | #define WE_GET_ANI_POLL_PERIOD 19 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1371 | /* |
| 1372 | * <ioctl> |
| 1373 | * get_anilislen- Get the anilislen |
| 1374 | * |
| 1375 | * @INPUT: None |
| 1376 | * |
| 1377 | * @OUTPUT: |
| 1378 | * wlan0 get_anilislen:0 |
| 1379 | * |
| 1380 | * This IOTCL used to get anilislen |
| 1381 | * |
| 1382 | * @E.g: iwpriv wlan0 get_anilislen |
| 1383 | * |
| 1384 | * Supported Feature: STA |
| 1385 | * |
| 1386 | * Usage: Internal/External |
| 1387 | * |
| 1388 | * </ioctl> |
| 1389 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1390 | #define WE_GET_ANI_LISTEN_PERIOD 20 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1391 | /* |
| 1392 | * <ioctl> |
| 1393 | * get_aniofdmlvl - Get the OFDM level |
| 1394 | * |
| 1395 | * @INPUT: None |
| 1396 | * |
| 1397 | * @OUTPUT: OFDM |
| 1398 | * wlan0 get_aniofdmlvl:0 |
| 1399 | * |
| 1400 | * This IOTCL used to get ofdm level |
| 1401 | * |
| 1402 | * @E.g: iwpriv wlan0 get_aniofdmlvl |
| 1403 | * |
| 1404 | * Supported Feature: STA |
| 1405 | * |
| 1406 | * Usage: Internal/External |
| 1407 | * |
| 1408 | * </ioctl> |
| 1409 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1410 | #define WE_GET_ANI_OFDM_LEVEL 21 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1411 | /* |
| 1412 | * <ioctl> |
| 1413 | * get_aniccklvl - Get the cck level |
| 1414 | * |
| 1415 | * @INPUT: None |
| 1416 | * |
| 1417 | * @OUTPUT: |
| 1418 | * wlan0 get_aniccklvl:0 |
| 1419 | * |
| 1420 | * This IOTCL used to get cck level |
| 1421 | * |
| 1422 | * @E.g: iwpriv wlan0 get_aniccklvl |
| 1423 | * |
| 1424 | * Supported Feature: STA |
| 1425 | * |
| 1426 | * Usage: Internal/External |
| 1427 | * |
| 1428 | * </ioctl> |
| 1429 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1430 | #define WE_GET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1431 | /* |
| 1432 | * <ioctl> |
| 1433 | * get_cwmenable - Get the value of the dynamic channel bandwidth setting |
| 1434 | * |
| 1435 | * @INPUT: None |
| 1436 | * |
| 1437 | * @OUTPUT: Enable/disable dynamic channel bandwidth |
| 1438 | * wlan0 get_cwmenable:0 |
| 1439 | * |
| 1440 | * This IOTCL get the value of the dynamic channel bandwidth setting |
| 1441 | * |
| 1442 | * @E.g: iwpriv wlan0 get_cwmenable |
| 1443 | * |
| 1444 | * Supported Feature: STA |
| 1445 | * |
| 1446 | * Usage: Internal/External |
| 1447 | * |
| 1448 | * </ioctl> |
| 1449 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1450 | #define WE_GET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1451 | /* |
| 1452 | * <ioctl> |
| 1453 | * get_txchainmask - Get the txchainmask that was set |
| 1454 | * |
| 1455 | * @INPUT: None |
| 1456 | * |
| 1457 | * @OUTPUT: txchainmask |
| 1458 | * wlan0 get_txchainmask:1 |
| 1459 | * |
| 1460 | * This IOCTL gets the txchainmask that was set |
| 1461 | * This command is useful if it was previously set |
| 1462 | * |
| 1463 | * @E.g: iwpriv wlan0 get_txchainmask |
| 1464 | * |
| 1465 | * Supported Feature: STA |
| 1466 | * |
| 1467 | * Usage: Internal/External |
| 1468 | * |
| 1469 | * </ioctl> |
| 1470 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1471 | #define WE_GET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1472 | /* |
| 1473 | * <ioctl> |
| 1474 | * get_rxchainmask - Get the rxchainmask that was set |
| 1475 | * |
| 1476 | * @INPUT: None |
| 1477 | * |
| 1478 | * @OUTPUT: rxchainmask |
| 1479 | * wlan0 get_rxchainmask:1 |
| 1480 | * |
| 1481 | * This IOCTL gets the rxchainmask that was set |
| 1482 | * This command is useful only if it was previously set. |
| 1483 | * |
| 1484 | * @E.g: iwpriv wlan0 get_rxchainmask |
| 1485 | * |
| 1486 | * Supported Feature: STA |
| 1487 | * |
| 1488 | * Usage: Internal/External |
| 1489 | * |
| 1490 | * </ioctl> |
| 1491 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1492 | #define WE_GET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1493 | /* |
| 1494 | * <ioctl> |
| 1495 | * get_11nrate - Get the fixed Tx data rate |
| 1496 | * |
| 1497 | * @INPUT: None |
| 1498 | * |
| 1499 | * @OUTPUT: Using this command does not return the same value as set |
| 1500 | * wlan0 get_11nrate:0 |
| 1501 | * |
| 1502 | * This IOCTL gets the fixed Tx data rate |
| 1503 | * This command is useful only if setting the fixed Tx rate. |
| 1504 | * |
| 1505 | * @E.g: iwpriv wlan0 get_11nrate |
| 1506 | * |
| 1507 | * Supported Feature: STA |
| 1508 | * |
| 1509 | * Usage: Internal/External |
| 1510 | * |
| 1511 | * </ioctl> |
| 1512 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1513 | #define WE_GET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1514 | /* |
| 1515 | * <ioctl> |
| 1516 | * get_ampdu - Get the maximum subframe of ampdu |
| 1517 | * |
| 1518 | * @INPUT: None |
| 1519 | * |
| 1520 | * @OUTPUT: Maximum subframe of ampdu |
| 1521 | * wlan0 get_ampdu:1 |
| 1522 | * |
| 1523 | * This IOCTL gets the maximum subframe of ampdu |
| 1524 | * This command is useful only if setting ampdu. |
| 1525 | * |
| 1526 | * @E.g: iwpriv wlan0 get_ampdu |
| 1527 | * |
| 1528 | * Supported Feature: STA |
| 1529 | * |
| 1530 | * Usage: Internal/External |
| 1531 | * |
| 1532 | * </ioctl> |
| 1533 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1534 | #define WE_GET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1535 | /* |
| 1536 | * <ioctl> |
| 1537 | * get_amsdu - Get the maximum subframe of amsdu |
| 1538 | * |
| 1539 | * @INPUT: None |
| 1540 | * |
| 1541 | * @OUTPUT: Maximum subframe of amsdu |
| 1542 | * wlan0 get_amsdu:1 |
| 1543 | * |
| 1544 | * This IOCTL gets the maximum subframe of amsdu. |
| 1545 | * This command is useful only if setting amsdu |
| 1546 | * |
| 1547 | * @E.g: iwpriv wlan0 get_amsdu |
| 1548 | * |
| 1549 | * Supported Feature: STA |
| 1550 | * |
| 1551 | * Usage: Internal/External |
| 1552 | * |
| 1553 | * </ioctl> |
| 1554 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1555 | #define WE_GET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1556 | /* |
| 1557 | * <ioctl> |
| 1558 | * get_txpow2g - Get the current 2 GHz Tx power setting |
| 1559 | * |
| 1560 | * @INPUT: None |
| 1561 | * |
| 1562 | * @OUTPUT: Tx Power in dbm |
| 1563 | * wlan0 get_txpow2g:0 |
| 1564 | * |
| 1565 | * This IOCTL gets the current 2 GHz Tx power setting |
| 1566 | * This command is useful if setting Tx power |
| 1567 | * |
| 1568 | * @E.g: iwpriv wlan0 get_txpow2g |
| 1569 | * |
| 1570 | * Supported Feature: STA |
| 1571 | * |
| 1572 | * Usage: Internal/External |
| 1573 | * |
| 1574 | * </ioctl> |
| 1575 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1576 | #define WE_GET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1577 | /* |
| 1578 | * <ioctl> |
| 1579 | * get_txpow5g - Get the current 5 GHz Tx power setting |
| 1580 | * |
| 1581 | * @INPUT: None |
| 1582 | * |
| 1583 | * @OUTPUT: Tx Power in dbm |
| 1584 | * wlan0 get_txpow5g:0 |
| 1585 | * |
| 1586 | * This IOCTL gets the current 5 GHz Tx power setting |
| 1587 | * This command is useful if setting Tx power |
| 1588 | * |
| 1589 | * @E.g: iwpriv wlan0 get_txpow5g |
| 1590 | * |
| 1591 | * Supported Feature: STA |
| 1592 | * |
| 1593 | * Usage: Internal/External |
| 1594 | * |
| 1595 | * </ioctl> |
| 1596 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1597 | #define WE_GET_TXPOW_5G 30 |
Rajeev Kumar | 1bcfd63 | 2015-12-07 11:38:51 -0800 | [diff] [blame] | 1598 | /* 31 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1599 | #define WE_GET_PPS_PAID_MATCH 32 |
| 1600 | #define WE_GET_PPS_GID_MATCH 33 |
| 1601 | #define WE_GET_PPS_EARLY_TIM_CLEAR 34 |
| 1602 | #define WE_GET_PPS_EARLY_DTIM_CLEAR 35 |
| 1603 | #define WE_GET_PPS_EOF_PAD_DELIM 36 |
| 1604 | #define WE_GET_PPS_MACADDR_MISMATCH 37 |
| 1605 | #define WE_GET_PPS_DELIM_CRC_FAIL 38 |
| 1606 | #define WE_GET_PPS_GID_NSTS_ZERO 39 |
| 1607 | #define WE_GET_PPS_RSSI_CHECK 40 |
| 1608 | /* Private ioctl for QPower */ |
| 1609 | #define WE_GET_QPOWER_MAX_PSPOLL_COUNT 41 |
| 1610 | #define WE_GET_QPOWER_MAX_TX_BEFORE_WAKE 42 |
| 1611 | #define WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 43 |
| 1612 | #define WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 44 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1613 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1614 | /* |
| 1615 | * <ioctl> |
| 1616 | * get_gtxHTMcs - Get the tx HTM |
| 1617 | * |
| 1618 | * @INPUT: None |
| 1619 | * |
| 1620 | * @OUTPUT: HTM |
| 1621 | * wlan0 get_gtxHTMcs:32896 |
| 1622 | * |
| 1623 | * This IOTCL used to get HTM |
| 1624 | * |
| 1625 | * @E.g: iwpriv wlan0 get_gtxHTMcs |
| 1626 | * |
| 1627 | * Supported Feature: STA |
| 1628 | * |
| 1629 | * Usage: Internal/External |
| 1630 | * |
| 1631 | * </ioctl> |
| 1632 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1633 | #define WE_GET_GTX_HT_MCS 47 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1634 | /* |
| 1635 | * <ioctl> |
| 1636 | * get_gtxVHTMcs - Get the VHTM |
| 1637 | * |
| 1638 | * @INPUT: None |
| 1639 | * |
| 1640 | * @OUTPUT: VHTM |
| 1641 | * wlan0 get_gtxVHTMcs:524800 |
| 1642 | * |
| 1643 | * This IOTCL used to get the VHTM |
| 1644 | * |
| 1645 | * @E.g: iwpriv wlan0 get_gtxVHTMcs |
| 1646 | * |
| 1647 | * Supported Feature: STA |
| 1648 | * |
| 1649 | * Usage: Internal/External |
| 1650 | * |
| 1651 | * </ioctl> |
| 1652 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1653 | #define WE_GET_GTX_VHT_MCS 48 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1654 | /* |
| 1655 | * <ioctl> |
| 1656 | * get_gtxUsrCfg - Get the tx cfg |
| 1657 | * |
| 1658 | * @INPUT: None |
| 1659 | * |
| 1660 | * @OUTPUT: TXCFG |
| 1661 | * wlan0 get_gtxUsrCfg:32 |
| 1662 | * |
| 1663 | * This IOTCL used to get the tx cfg |
| 1664 | * |
| 1665 | * @E.g: iwpriv wlan0 get_gtxUsrCfg |
| 1666 | * |
| 1667 | * Supported Feature: STA |
| 1668 | * |
| 1669 | * Usage: Internal/External |
| 1670 | * |
| 1671 | * </ioctl> |
| 1672 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1673 | #define WE_GET_GTX_USRCFG 49 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1674 | /* |
| 1675 | * <ioctl> |
| 1676 | * get_gtxThre - Get the tx threshold |
| 1677 | * |
| 1678 | * @INPUT: None |
| 1679 | * |
| 1680 | * @OUTPUT: Threshold |
| 1681 | * wlan0 get_gtxThre:3 |
| 1682 | * |
| 1683 | * This IOCTL is used to get tx threshold |
| 1684 | * |
| 1685 | * @E.g: iwpriv wlan0 get_gtxThre |
| 1686 | * |
| 1687 | * Supported Feature: STA |
| 1688 | * |
| 1689 | * Usage: Internal/External |
| 1690 | * |
| 1691 | * </ioctl> |
| 1692 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1693 | #define WE_GET_GTX_THRE 50 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1694 | /* |
| 1695 | * <ioctl> |
| 1696 | * get_gtxMargin - Get the tx margin |
| 1697 | * |
| 1698 | * @INPUT: None |
| 1699 | * |
| 1700 | * @OUTPUT: GTXMARGIN |
| 1701 | * wlan0 get_gtxMargin:2 |
| 1702 | * |
| 1703 | * This IOCTL is used to set tx margin |
| 1704 | * |
| 1705 | * @E.g: iwpriv wlan0 get_gtxMargin |
| 1706 | * |
| 1707 | * Supported Feature: STA |
| 1708 | * |
| 1709 | * Usage: Internal/External |
| 1710 | * |
| 1711 | * </ioctl> |
| 1712 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1713 | #define WE_GET_GTX_MARGIN 51 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1714 | /* |
| 1715 | * <ioctl> |
| 1716 | * get_gtxStep - Get the tx step |
| 1717 | * |
| 1718 | * @INPUT: None |
| 1719 | * |
| 1720 | * @OUTPUT: GTXSTEP |
| 1721 | * wlan0 get_gtxStep:0 |
| 1722 | * |
| 1723 | * This IOCTL is used to get the gtx step |
| 1724 | * |
| 1725 | * @E.g: iwpriv wlan0 get_gtxStep |
| 1726 | * |
| 1727 | * Supported Feature: STA |
| 1728 | * |
| 1729 | * Usage: Internal/External |
| 1730 | * |
| 1731 | * </ioctl> |
| 1732 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1733 | #define WE_GET_GTX_STEP 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1734 | /* |
| 1735 | * <ioctl> |
| 1736 | * get_gtxMinTpc - Get the tx miminum tpc |
| 1737 | * |
| 1738 | * @INPUT: None |
| 1739 | * |
| 1740 | * @OUTPUT: TPC |
| 1741 | * wlan0 get_gtxMinTpc:0 |
| 1742 | * |
| 1743 | * This IOCTL is used to get tx miminum tpc |
| 1744 | * |
| 1745 | * @E.g: iwpriv wlan0 get_gtxMinTpc |
| 1746 | * |
| 1747 | * Supported Feature: STA |
| 1748 | * |
| 1749 | * Usage: Internal/External |
| 1750 | * |
| 1751 | * </ioctl> |
| 1752 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1753 | #define WE_GET_GTX_MINTPC 53 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1754 | /* |
| 1755 | * <ioctl> |
| 1756 | * get_gtxBWMask - Get the tx BW MASK |
| 1757 | * |
| 1758 | * @INPUT: None |
| 1759 | * |
| 1760 | * @OUTPUT: MASK |
| 1761 | * wlan0 get_gtxBWMask:15 |
| 1762 | * |
| 1763 | * This IOCTL is used get gtx bw mask |
| 1764 | * |
| 1765 | * @E.g: iwpriv wlan0 get_gtxBWMask |
| 1766 | * |
| 1767 | * Supported Feature: STA |
| 1768 | * |
| 1769 | * Usage: Internal/External |
| 1770 | * |
| 1771 | * </ioctl> |
| 1772 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1773 | #define WE_GET_GTX_BWMASK 54 |
| 1774 | #define WE_GET_TEMPERATURE 56 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1775 | #define WE_CAP_TSF 58 |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 1776 | #define WE_GET_ROAM_SYNCH_DELAY 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1777 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1778 | /* |
| 1779 | * <ioctl> |
| 1780 | * get_dcm - Get dcm enablement value |
| 1781 | * |
| 1782 | * @INPUT: None |
| 1783 | * |
| 1784 | * @OUTPUT: 0/1 |
| 1785 | * wlan0 get_dcm |
| 1786 | * |
| 1787 | * This IOCTL is used get dcm value |
| 1788 | * |
| 1789 | * Supported Feature: STA/SAP |
| 1790 | * |
| 1791 | * Usage: Internal |
| 1792 | * |
| 1793 | * </ioctl> |
| 1794 | */ |
| 1795 | #define WE_GET_DCM 60 |
| 1796 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1797 | /* |
| 1798 | * <ioctl> |
| 1799 | * get_dcm - Get range extension enablement value |
| 1800 | * |
| 1801 | * @INPUT: None |
| 1802 | * |
| 1803 | * @OUTPUT: 0/1 |
| 1804 | * wlan0 get_range_ext |
| 1805 | * |
| 1806 | * This IOCTL is used get range_extension value |
| 1807 | * |
| 1808 | * Supported Feature: STA/SAP |
| 1809 | * |
| 1810 | * Usage: Internal |
| 1811 | * |
| 1812 | * </ioctl> |
| 1813 | */ |
| 1814 | #define WE_GET_RANGE_EXT 61 |
| 1815 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1816 | /* Private ioctls and their sub-ioctls */ |
| 1817 | #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) |
| 1818 | |
| 1819 | /* Private ioctls and their sub-ioctls */ |
| 1820 | #define WLAN_PRIV_SET_CHAR_GET_NONE (SIOCIWFIRSTPRIV + 3) |
| 1821 | #define WE_WOWL_ADD_PTRN 1 |
| 1822 | #define WE_WOWL_DEL_PTRN 2 |
Sreelakshmi Konamki | ded64d7 | 2017-02-23 10:39:26 +0530 | [diff] [blame] | 1823 | /* |
| 1824 | * <ioctl> |
| 1825 | * neighbor - Send neighbor report request |
| 1826 | * |
| 1827 | * @INPUT: string |
| 1828 | * |
| 1829 | * @OUTPUT: None |
| 1830 | * |
| 1831 | * This IOCTL create a Neighbor report request and send it to peer |
| 1832 | * |
| 1833 | * @E.g: iwpriv wlan0 neighbor "SSID" |
| 1834 | * |
| 1835 | * Supported Feature: 11k |
| 1836 | * |
| 1837 | * Usage: Internal/External |
| 1838 | * |
| 1839 | * </ioctl> |
| 1840 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1841 | #define WE_NEIGHBOR_REPORT_REQUEST 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1842 | /* |
| 1843 | * <ioctl> |
| 1844 | * set_ap_wps_ie - Set the P2P IE of the probe response |
| 1845 | * |
| 1846 | * @INPUT: string |
| 1847 | * |
| 1848 | * @OUTPUT: None |
| 1849 | * |
| 1850 | * This IOCTL sets the P2P IE of the probe response |
| 1851 | * |
| 1852 | * @E.g: iwpriv wlan0 set_ap_wps_ie abcd |
| 1853 | * |
| 1854 | * Supported Feature: STA |
| 1855 | * |
| 1856 | * Usage: Internal/External |
| 1857 | * |
| 1858 | * </ioctl> |
| 1859 | */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 1860 | #define WE_SET_AP_WPS_IE 4 |
Jeff Johnson | 0fcc94e | 2019-03-06 19:48:17 -0800 | [diff] [blame] | 1861 | |
| 1862 | /* 5 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1863 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 1864 | /* |
| 1865 | * <ioctl> |
| 1866 | * unit_test - execute component-level unit tests |
| 1867 | * |
| 1868 | * @INPUT: string - the name of the component to test. |
| 1869 | * All tests are executed if unspecified |
| 1870 | * @OUTPUT: None |
| 1871 | * |
| 1872 | * Usage: Internal only |
| 1873 | * </ioctl> |
| 1874 | */ |
| 1875 | #define WE_UNIT_TEST 6 |
| 1876 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1877 | /* Private ioctls and their sub-ioctls */ |
| 1878 | #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) |
| 1879 | #define WE_SET_WLAN_DBG 1 |
| 1880 | #define WE_SET_DP_TRACE 2 |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 1881 | #define WE_SET_FW_TEST 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1882 | |
| 1883 | /* Private ioctls and their sub-ioctls */ |
| 1884 | #define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5) |
| 1885 | #define WE_WLAN_VERSION 1 |
| 1886 | #define WE_GET_STATS 2 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1887 | /* |
| 1888 | * <ioctl> |
| 1889 | * getConfig - gets the values of all configurations listed in WCNSS |
| 1890 | * |
| 1891 | * @INPUT: None |
| 1892 | * |
| 1893 | * @OUTPUT: Current configuration to the sys log |
| 1894 | * wlan0 getConfig: WLAN configuration written to system log |
| 1895 | * |
| 1896 | * This IOCTL gets the values of all configurations listed in WCNSS |
| 1897 | * |
| 1898 | * @E.g: iwpriv wlan0 getConfig |
| 1899 | * |
| 1900 | * Supported Feature: STA |
| 1901 | * |
| 1902 | * Usage: Internal/External |
| 1903 | * |
| 1904 | * </ioctl> |
| 1905 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1906 | #define WE_GET_CFG 3 |
| 1907 | #define WE_GET_WMM_STATUS 4 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1908 | /* |
| 1909 | * <ioctl> |
| 1910 | * getChannelList - Get the available channel list while in QCMobileAP |
| 1911 | * |
| 1912 | * @INPUT: None |
| 1913 | * |
| 1914 | * @OUTPUT: Channel list |
| 1915 | * wlan0 getChannelList:36 US 1..165 |
| 1916 | * |
| 1917 | * This IOCTL gets the available channel list while in QCMobileAP |
| 1918 | * |
| 1919 | * @E.g: iwpriv wlan0 getChannelList |
| 1920 | * |
| 1921 | * Supported Feature: STA |
| 1922 | * |
| 1923 | * Usage: Internal/External |
| 1924 | * |
| 1925 | * </ioctl> |
| 1926 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1927 | #define WE_GET_CHANNEL_LIST 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1928 | /* |
| 1929 | * <ioctl> |
| 1930 | * getRSSI - Get the Received Signal Strength Indicator |
| 1931 | * |
| 1932 | * @INPUT: None |
| 1933 | * |
| 1934 | * @OUTPUT: RSSI |
| 1935 | * wlan0 getRSSI:rsssi=-32 |
| 1936 | * |
| 1937 | * This IOCTL gets the Received Signal Strength Indicator (RSSI) |
| 1938 | * |
| 1939 | * @E.g: iwpriv wlan0 getRSSI |
| 1940 | * |
| 1941 | * Supported Feature: STA |
| 1942 | * |
| 1943 | * Usage: Internal/External |
| 1944 | * |
| 1945 | * </ioctl> |
| 1946 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1947 | #define WE_GET_RSSI 6 |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1948 | |
| 1949 | /* |
| 1950 | * <ioctl> |
| 1951 | * getSuspendStats - Get suspend/resume stats |
| 1952 | * |
| 1953 | * @INPUT: None |
| 1954 | * |
| 1955 | * @OUTPUT: character string containing formatted suspend/resume stats |
| 1956 | * |
| 1957 | * This ioctl is used to get suspend/resume stats formatted for display. |
| 1958 | * Currently it includes suspend/resume counts, wow wake up reasons, and |
| 1959 | * suspend fail reasons. |
| 1960 | * |
| 1961 | * @E.g: iwpriv wlan0 getSuspendStats |
| 1962 | * iwpriv wlan0 getSuspendStats |
| 1963 | * |
| 1964 | * Supported Feature: suspend/resume |
| 1965 | * |
| 1966 | * Usage: Internal |
| 1967 | * |
| 1968 | * </ioctl> |
| 1969 | */ |
| 1970 | #define WE_GET_SUSPEND_RESUME_STATS 7 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1971 | #ifdef FEATURE_WLAN_TDLS |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 1972 | /* |
| 1973 | * <ioctl> |
| 1974 | * getTdlsPeers - Get all TDLS peers. |
| 1975 | * |
| 1976 | * @INPUT: None |
| 1977 | * |
| 1978 | * @OUTPUT: Returns the MAC address of all the TDLS peers |
| 1979 | * wlan0 getTdlsPeers: |
| 1980 | * MAC Id cap up RSSI |
| 1981 | * --------------------------------- |
| 1982 | * 00:0a:f5:0e:bd:18 2 Y Y -44 |
| 1983 | * 00:0a:f5:bf:0e:12 0 N N 0 |
| 1984 | * |
| 1985 | * This IOCTL is used to get all TDLS peers. |
| 1986 | * |
| 1987 | * @E.g: iwpriv wlan0 getTdlsPeers |
| 1988 | * |
| 1989 | * Supported Feature: TDLS |
| 1990 | * |
| 1991 | * Usage: Internal/External |
| 1992 | * |
| 1993 | * </ioctl> |
| 1994 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1995 | #define WE_GET_TDLS_PEERS 8 |
| 1996 | #endif |
| 1997 | #ifdef WLAN_FEATURE_11W |
Abhishek Singh | 2f81049 | 2016-12-01 11:39:39 +0530 | [diff] [blame] | 1998 | /* |
| 1999 | * <ioctl> |
| 2000 | * getPMFInfo - get the PMF info of the connected session |
| 2001 | * |
| 2002 | * @INPUT: None |
| 2003 | * |
| 2004 | * @OUTPUT: |
| 2005 | * wlan0 getPMFInfo: |
| 2006 | * BSSID E4:F4:C6:0A:E0:36, Is PMF Assoc? 0 |
| 2007 | * Number of Unprotected Disassocs 0 |
| 2008 | * Number of Unprotected Deauths 0 |
| 2009 | * |
| 2010 | * This IOCTL is used to get the PMF stats/status of the current |
| 2011 | * connection. |
| 2012 | * |
| 2013 | * @e.g:iwpriv wlan0 getPMFInfo |
| 2014 | * |
| 2015 | * Supported Feature: PMF |
| 2016 | * |
| 2017 | * Usage: Internal/External |
| 2018 | * |
| 2019 | * </ioctl> |
| 2020 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2021 | #define WE_GET_11W_INFO 9 |
| 2022 | #endif |
| 2023 | #define WE_GET_STATES 10 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2024 | /* |
| 2025 | * <ioctl> |
| 2026 | * getIbssSTAs - get ibss sta info |
| 2027 | * |
| 2028 | * @INPUT: None |
| 2029 | * |
| 2030 | * @OUTPUT: Give the MAC of the IBSS STA |
| 2031 | * wlan0 getIbssSTAs: |
| 2032 | * 1 .8c:fd:f0:01:9c:bf |
| 2033 | * |
| 2034 | * This IOCTL is used to get ibss sta info |
| 2035 | * |
| 2036 | * @E.g: iwpriv wlan0 getIbssSTAs |
| 2037 | * |
| 2038 | * Supported Feature: IBSS |
| 2039 | * |
| 2040 | * Usage: Internal/External |
| 2041 | * |
| 2042 | * </ioctl> |
| 2043 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2044 | #define WE_GET_IBSS_STA_INFO 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2045 | /* |
| 2046 | * <ioctl> |
| 2047 | * getphymode - Get the current phymode. |
| 2048 | * |
| 2049 | * @INPUT: None |
| 2050 | * |
| 2051 | * @OUTPUT: In phymode |
| 2052 | * wlan0 getphymode:AUTO MODE |
| 2053 | * |
| 2054 | * This IOCTL used to gets the current phymode. |
| 2055 | * |
| 2056 | * @E.g: iwpriv wlan0 getphymode |
| 2057 | * |
| 2058 | * Supported Feature: STA |
| 2059 | * |
| 2060 | * Usage: Internal/External |
| 2061 | * |
| 2062 | * </ioctl> |
| 2063 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2064 | #define WE_GET_PHYMODE 12 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2065 | |
| 2066 | /* |
| 2067 | * <ioctl> |
| 2068 | * getOemDataCap - Get the oem data caps. |
| 2069 | * |
| 2070 | * @INPUT: None |
| 2071 | * |
| 2072 | * @OUTPUT: oem data capability |
| 2073 | * |
| 2074 | * This IOCTL used to gets the current oem data cap. |
| 2075 | * |
| 2076 | * @E.g: iwpriv wlan0 getOemDataCap |
| 2077 | * |
| 2078 | * Usage: Internal/External |
| 2079 | * |
| 2080 | * </ioctl> |
| 2081 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2082 | #define WE_GET_OEM_DATA_CAP 13 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2083 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2084 | /* |
| 2085 | * <ioctl> |
| 2086 | * getSNR - Enable SNR Monitoring |
| 2087 | * |
| 2088 | * @INPUT: None |
| 2089 | * |
| 2090 | * @OUTPUT: Signal strength/ratio |
| 2091 | * wlan0 getSNR:1 |
| 2092 | * |
| 2093 | * This IOCTL is used to get ibss sta info |
| 2094 | * |
| 2095 | * @E.g: iwpriv wlan0 getSNR |
| 2096 | * |
| 2097 | * Supported Feature: STA |
| 2098 | * |
| 2099 | * Usage: Internal/External |
| 2100 | * |
| 2101 | * </ioctl> |
| 2102 | */ |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2103 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2104 | #define WE_GET_SNR 14 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2105 | #define WE_LIST_FW_PROFILE 15 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2106 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2107 | /* |
| 2108 | * <ioctl> |
| 2109 | * |
| 2110 | * get_ba_timeout - to get timeout for each AC |
| 2111 | * |
| 2112 | * @INPUT: None |
| 2113 | * |
| 2114 | * @OUTPUT: displays timeout value for each access class |
| 2115 | * |
| 2116 | * @E.g.: iwpriv wlan0 get_ba_timeout |
| 2117 | * |
| 2118 | * Usage: Internal |
| 2119 | * |
| 2120 | * </ioctl> |
| 2121 | */ |
| 2122 | #define WE_GET_BA_AGEING_TIMEOUT 16 |
| 2123 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 2124 | /* |
| 2125 | * <ioctl> |
| 2126 | * |
| 2127 | * sta_cxn_info - STA connection information |
| 2128 | * |
| 2129 | * @INPUT: none |
| 2130 | * |
| 2131 | * @OUTPUT: STA's connection information |
| 2132 | * |
| 2133 | * This IOCTL is used to get connection's information. |
| 2134 | * |
| 2135 | * @E.g: iwpriv wlan0 get_cxn_info |
| 2136 | * |
| 2137 | * Usage: Internal |
| 2138 | * |
| 2139 | * </ioctl> |
| 2140 | */ |
| 2141 | #define WE_GET_STA_CXN_INFO 17 |
| 2142 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2143 | /* Private ioctls and their sub-ioctls */ |
| 2144 | #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) |
Selvaraj, Sridhar | f793983 | 2017-03-25 16:59:50 +0530 | [diff] [blame] | 2145 | |
| 2146 | /* |
| 2147 | * <ioctl> |
| 2148 | * reassoc - Trigger STA re-association to the connected AP |
| 2149 | * |
| 2150 | * @INPUT: None |
| 2151 | * |
| 2152 | * @OUTPUT: None |
| 2153 | * |
| 2154 | * This IOCTL is used to trigger STA reassociation to the connected AP. |
| 2155 | * |
| 2156 | * @E.g: iwpriv wlan0 reassoc |
| 2157 | * |
| 2158 | * Supported Feature: Roaming |
| 2159 | * |
| 2160 | * Usage: Internal |
| 2161 | * |
| 2162 | * </ioctl> |
| 2163 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2164 | #define WE_SET_REASSOC_TRIGGER 8 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2165 | /* |
| 2166 | * <ioctl> |
| 2167 | * ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI |
| 2168 | * |
| 2169 | * @INPUT: None |
| 2170 | * |
| 2171 | * @OUTPUT: print ibss peer in info logs |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 2172 | * peer_info->numIBSSPeers = 1 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2173 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2174 | * |
| 2175 | * This IOCTL is used to rint the ibss peers's MAC, rate and RSSI |
| 2176 | * in info logs |
| 2177 | * |
| 2178 | * @E.g: iwpriv wlan0 ibssPeerInfoAll |
| 2179 | * |
| 2180 | * Supported Feature: IBSS |
| 2181 | * |
| 2182 | * Usage: Internal/External |
| 2183 | * |
| 2184 | * </ioctl> |
| 2185 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2186 | #define WE_IBSS_GET_PEER_INFO_ALL 10 |
Rajeev Kumar | f4390fa | 2016-12-22 13:17:33 -0800 | [diff] [blame] | 2187 | /* Sub ioctls 11 to 16 are not used */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2188 | #define WE_GET_FW_PROFILE_DATA 18 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 2189 | /* |
| 2190 | * <ioctl> |
| 2191 | * stop_obss_scan - Stop obss scan |
| 2192 | * |
| 2193 | * @INPUT: None |
| 2194 | * |
| 2195 | * @OUTPUT: None |
| 2196 | * |
| 2197 | * This IOCTL is used to stop obss scan |
| 2198 | * |
| 2199 | * @E.g: iwpriv wlan0 stop_obss_scan |
| 2200 | * |
| 2201 | * Supported Feature: Scan |
| 2202 | * |
| 2203 | * Usage: Internal/External |
| 2204 | * |
| 2205 | * </ioctl> |
| 2206 | */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2207 | #define WE_STOP_OBSS_SCAN 19 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2208 | |
| 2209 | /* Private ioctls and their sub-ioctls */ |
| 2210 | #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) |
| 2211 | |
| 2212 | #define WE_P2P_NOA_CMD 2 |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2213 | /* subcommands 3 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2214 | |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2215 | #define WE_MAC_PWR_DEBUG_CMD 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2216 | |
Kabilan Kannan | 6894e6a | 2017-11-09 14:37:55 -0800 | [diff] [blame] | 2217 | /* subcommand 5 is unused */ |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 2218 | |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2219 | /* |
| 2220 | * <ioctl> |
| 2221 | * ibssPeerInfo - Print the ibss peers's MAC, rate and RSSI |
| 2222 | * |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 2223 | * @INPUT: sta_id |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2224 | * |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 2225 | * @OUTPUT: print ibss peer corresponding to sta_id in info logs |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2226 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2227 | * |
| 2228 | * This IOCTL is used to print the specific ibss peers's MAC, |
| 2229 | * rate and RSSI in info logs |
| 2230 | * |
| 2231 | * @E.g: iwpriv wlan0 ibssPeerInfo <sta_id> |
| 2232 | * iwpriv wlan0 ibssPeerInfo 0 |
| 2233 | * |
| 2234 | * Supported Feature: IBSS |
| 2235 | * |
| 2236 | * Usage: Internal/External |
| 2237 | * |
| 2238 | * </ioctl> |
| 2239 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2240 | #define WE_IBSS_GET_PEER_INFO 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2241 | #define WE_UNIT_TEST_CMD 7 |
| 2242 | |
| 2243 | #define WE_MTRACE_DUMP_CMD 8 |
| 2244 | #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 |
| 2245 | |
| 2246 | |
| 2247 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 2248 | #define WE_LED_FLASHING_PARAM 10 |
| 2249 | #endif |
| 2250 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2251 | /* |
| 2252 | * <ioctl> |
| 2253 | * pm_clist - Increments the index value of the concurrent connection list |
| 2254 | * and update with the input parameters provided. |
| 2255 | * |
| 2256 | * @INPUT: Following 8 arguments: |
| 2257 | * @vdev_id: vdev id |
| 2258 | * @tx_streams: TX streams |
| 2259 | * @rx_streams: RX streams |
| 2260 | * @chain_mask: Chain mask |
| 2261 | * @type: vdev_type |
| 2262 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2263 | * @sub_type: vdev_subtype |
| 2264 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2265 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2266 | * @channel: Channel |
| 2267 | * @mac: Mac id |
| 2268 | * |
| 2269 | * @OUTPUT: None |
| 2270 | * |
| 2271 | * This IOCTL is used to increments the index value of the concurrent connection |
| 2272 | * list and update with the input parameters provided. |
| 2273 | * |
| 2274 | * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type |
| 2275 | * sub_type channel mac |
| 2276 | * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1 |
| 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_CLIST_CMD 11 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2285 | |
| 2286 | /* |
| 2287 | * <ioctl> |
| 2288 | * pm_dlist - Delete the index from the concurrent connection list that is |
| 2289 | * present in the given vdev_id. |
| 2290 | * |
| 2291 | * @INPUT: delete_all, vdev_id |
| 2292 | * @delete_all: delete all indices |
| 2293 | * @vdev_id: vdev id |
| 2294 | * |
| 2295 | * @OUTPUT: None |
| 2296 | * |
| 2297 | * This IOCTL is used to delete the index from the concurrent connection list |
| 2298 | * that is present in the given vdev_id. |
| 2299 | * |
| 2300 | * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id |
| 2301 | * iwpriv wlan0 pm_dlist 0 1 |
| 2302 | * |
| 2303 | * Supported Feature: DBS |
| 2304 | * |
| 2305 | * Usage: Internal/External |
| 2306 | * |
| 2307 | * </ioctl> |
| 2308 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2309 | #define WE_POLICY_MANAGER_DLIST_CMD 12 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2310 | |
| 2311 | /* |
| 2312 | * <ioctl> |
| 2313 | * pm_dbs - Set dbs capability and system preference |
| 2314 | * |
| 2315 | * @INPUT: dbs, system_pref |
| 2316 | * @dbs: Value of DBS capability to be set |
| 2317 | * @system_pref: System preference |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2318 | * 0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2319 | * |
| 2320 | * @OUTPUT: None |
| 2321 | * |
| 2322 | * This IOCTL is used to set dbs capability and system preference. |
| 2323 | * |
| 2324 | * @E.g: iwpriv wlan0 pm_dbs dbs system_pref |
| 2325 | * iwpriv wlan0 pm_dbs 1 0 |
| 2326 | * |
| 2327 | * Supported Feature: DBS |
| 2328 | * |
| 2329 | * Usage: Internal/External |
| 2330 | * |
| 2331 | * </ioctl> |
| 2332 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2333 | #define WE_POLICY_MANAGER_DBS_CMD 13 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2334 | |
| 2335 | /* |
| 2336 | * <ioctl> |
| 2337 | * pm_pcl - Set pcl for concurrency mode. |
| 2338 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2339 | * @INPUT: policy_mgr_con_mode |
| 2340 | * @policy_mgr_con_mode: concurrency mode for PCL table |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2341 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2342 | * |
| 2343 | * @OUTPUT: None |
| 2344 | * |
| 2345 | * This IOCTL is used to set pcl for concurrency mode. |
| 2346 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2347 | * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2348 | * iwpriv wlan0 pm_pcl 0 |
| 2349 | * |
| 2350 | * Supported Feature: DBS |
| 2351 | * |
| 2352 | * Usage: Internal/External |
| 2353 | * |
| 2354 | * </ioctl> |
| 2355 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2356 | #define WE_POLICY_MANAGER_PCL_CMD 14 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2357 | |
| 2358 | /* |
| 2359 | * <ioctl> |
| 2360 | * pm_cinfo - Shows the concurrent connection list. |
| 2361 | * |
| 2362 | * @INPUT: None |
| 2363 | * |
| 2364 | * @OUTPUT: None |
| 2365 | * |
| 2366 | * This IOCTL is used to show the concurrent connection list. |
| 2367 | * |
| 2368 | * @E.g: iwpriv wlan0 pm_cinfo |
| 2369 | * |
| 2370 | * Supported Feature: DBS |
| 2371 | * |
| 2372 | * Usage: Internal/External |
| 2373 | * |
| 2374 | * </ioctl> |
| 2375 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2376 | #define WE_POLICY_MANAGER_CINFO_CMD 15 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2377 | |
| 2378 | /* |
| 2379 | * <ioctl> |
| 2380 | * pm_ulist - Updates the index value of the concurrent connection list |
| 2381 | * with the input parameters provided. |
| 2382 | * |
| 2383 | * @INPUT: Following 8 arguments: |
| 2384 | * @vdev_id: vdev id |
| 2385 | * @tx_streams: TX streams |
| 2386 | * @rx_streams: RX streams |
| 2387 | * @chain_mask: Chain mask |
| 2388 | * @type: vdev_type |
| 2389 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2390 | * @sub_type: vdev_subtype |
| 2391 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2392 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2393 | * @channel: Channel |
| 2394 | * @mac: Mac id |
| 2395 | * |
| 2396 | * @OUTPUT: None |
| 2397 | * |
| 2398 | * This IOCTL is used to updates the index value of the concurrent |
| 2399 | * connection list with the input parameters provided. |
| 2400 | * |
| 2401 | * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type |
| 2402 | * sub_type channel mac |
| 2403 | * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1 |
| 2404 | * |
| 2405 | * Supported Feature: DBS |
| 2406 | * |
| 2407 | * Usage: Internal/External |
| 2408 | * |
| 2409 | * </ioctl> |
| 2410 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2411 | #define WE_POLICY_MANAGER_ULIST_CMD 16 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2412 | |
| 2413 | /* |
| 2414 | * <ioctl> |
| 2415 | * pm_query_action - Initiate actions needed on current connections as |
| 2416 | * per the channel provided. |
| 2417 | * |
| 2418 | * @INPUT: channel |
| 2419 | * @channel: Channel on which new connection will be. |
| 2420 | * |
| 2421 | * @OUTPUT: None |
| 2422 | * |
| 2423 | * This IOCTL is used to initiate actions needed on current connections |
| 2424 | * as per the channel provided. |
| 2425 | * |
| 2426 | * @E.g: iwpriv wlan0 pm_query_action channel |
| 2427 | * iwpriv wlan0 pm_query_action 6 |
| 2428 | * |
| 2429 | * Supported Feature: DBS |
| 2430 | * |
| 2431 | * Usage: Internal/External |
| 2432 | * |
| 2433 | * </ioctl> |
| 2434 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2435 | #define WE_POLICY_MANAGER_QUERY_ACTION_CMD 17 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2436 | |
| 2437 | /* |
| 2438 | * <ioctl> |
| 2439 | * pm_query_allow - Checks for allowed concurrency combination |
| 2440 | * |
| 2441 | * @INPUT: mode, channel, bandwidth |
| 2442 | * @mode: new connection mode |
| 2443 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2444 | * @channel: channel on which new connection is coming up |
| 2445 | * @bandwidth: Bandwidth requested by the connection |
| 2446 | * 0:None 1:5MHz 2:10MHz 3:20MHz |
| 2447 | * 4:40MHz 5:80MHz 6:80+80MHz 7:160MHz |
| 2448 | * |
| 2449 | * @OUTPUT: None |
| 2450 | * |
| 2451 | * This IOCTL is used to checks for allowed concurrency combination. |
| 2452 | * |
| 2453 | * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth |
| 2454 | * iwpriv wlan0 pm_query_allow 0 6 4 |
| 2455 | * |
| 2456 | * Supported Feature: DBS |
| 2457 | * |
| 2458 | * Usage: Internal/External |
| 2459 | * |
| 2460 | * </ioctl> |
| 2461 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2462 | #define WE_POLICY_MANAGER_QUERY_ALLOW_CMD 18 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2463 | |
| 2464 | /* |
| 2465 | * <ioctl> |
| 2466 | * pm_run_scenario - Create scenario with number of connections provided. |
| 2467 | * |
| 2468 | * @INPUT: num_of_conn |
| 2469 | * @num_of_conn: the number of connections (values: 1~3) |
| 2470 | * |
| 2471 | * @OUTPUT: None |
| 2472 | * |
| 2473 | * This IOCTL is used to create scenario with the number of connections |
| 2474 | * provided. |
| 2475 | * |
| 2476 | * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn |
| 2477 | * iwpriv wlan0 pm_run_scenario 1 |
| 2478 | * |
| 2479 | * Supported Feature: DBS |
| 2480 | * |
| 2481 | * Usage: Internal/External |
| 2482 | * |
| 2483 | * </ioctl> |
| 2484 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2485 | #define WE_POLICY_MANAGER_SCENARIO_CMD 19 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2486 | |
| 2487 | /* |
| 2488 | * <ioctl> |
| 2489 | * pm_set_hw_mode - Set hardware for single/dual mac. |
| 2490 | * |
| 2491 | * @INPUT: hw_mode |
| 2492 | * 0:single mac 1:dual mac |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 2493 | * 2: 2x2 5g + 1x1 2g dbs mode |
| 2494 | * 3: 2x2 2g + 1x1 5g dbs mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2495 | * |
| 2496 | * @OUTPUT: None |
| 2497 | * |
| 2498 | * This IOCTL is used to set hardware for single/dual mac. |
| 2499 | * |
| 2500 | * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode |
| 2501 | * iwpriv wlan0 pm_set_hw_mode 1 |
| 2502 | * |
| 2503 | * Supported Feature: DBS |
| 2504 | * |
| 2505 | * Usage: Internal/External |
| 2506 | * |
| 2507 | * </ioctl> |
| 2508 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2509 | #define WE_POLICY_SET_HW_MODE_CMD 20 |
| 2510 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2511 | /* |
| 2512 | * <ioctl> |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 2513 | * ch_avoid - unit test SAP channel avoidance |
| 2514 | * |
| 2515 | * @INPUT: chan avoid ranges |
| 2516 | * |
| 2517 | * @OUTPUT: none |
| 2518 | * |
| 2519 | * This IOCTL is used to fake a channel avoidance event. |
| 2520 | * To test SAP/GO chan switch during chan avoid event process. |
| 2521 | * |
| 2522 | * @E.g: iwpriv wlan0 ch_avoid 2452 2462 |
| 2523 | * |
| 2524 | * Supported Feature: SAP chan avoidance. |
| 2525 | * |
| 2526 | * Usage: Internal |
| 2527 | * |
| 2528 | * </ioctl> |
| 2529 | */ |
| 2530 | #define WE_SET_CHAN_AVOID 21 |
| 2531 | |
| 2532 | /* |
| 2533 | * <ioctl> |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2534 | * set_scan_cfg - Set dual MAC scan config parameters. |
| 2535 | * |
| 2536 | * @INPUT: dbs, dbs_plus_agile_scan, single_mac_scan_with_dbs |
| 2537 | * @dbs: Value of DBS bit |
| 2538 | * @dbs_plus_agile_scan: Value of DBS plus agile scan bit |
| 2539 | * @single_mac_scan_with_dbs: Value of Single MAC scan with DBS |
| 2540 | * |
| 2541 | * @OUTPUT: None |
| 2542 | * |
| 2543 | * This IOCTL is used to set the dual MAC scan config. |
| 2544 | * |
| 2545 | * @E.g: iwpriv wlan0 set_scan_cfg dbs dbs_plus_agile_scan |
| 2546 | * single_mac_scan_with_dbs |
| 2547 | * iwpriv wlan0 set_scan_cfg 1 0 1 |
| 2548 | * |
| 2549 | * Supported Feature: DBS |
| 2550 | * |
| 2551 | * Usage: Internal/External |
| 2552 | * |
| 2553 | * </ioctl> |
| 2554 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2555 | #define WE_SET_DUAL_MAC_SCAN_CONFIG 21 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2556 | |
| 2557 | /* |
| 2558 | * <ioctl> |
| 2559 | * set_fw_mode_cfg - Sets the dual mac FW mode config |
| 2560 | * |
| 2561 | * @INPUT: dbs, dfs |
| 2562 | * @dbs: DBS bit |
| 2563 | * @dfs: Agile DFS bit |
| 2564 | * |
| 2565 | * @OUTPUT: None |
| 2566 | * |
| 2567 | * This IOCTL is used to set the dual mac FW mode config. |
| 2568 | * |
| 2569 | * @E.g: iwpriv wlan0 set_fw_mode_cfg dbs dfs |
| 2570 | * iwpriv wlan0 set_fw_mode_cfg 1 1 |
| 2571 | * |
| 2572 | * Supported Feature: DBS |
| 2573 | * |
| 2574 | * Usage: Internal/External |
| 2575 | * |
| 2576 | * </ioctl> |
| 2577 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2578 | #define WE_SET_DUAL_MAC_FW_MODE_CONFIG 22 |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 2579 | #define WE_SET_MON_MODE_CHAN 23 |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 2580 | /* |
| 2581 | * <ioctl> |
| 2582 | * txrx_stats - TXRX statistics query |
| 2583 | * |
| 2584 | * @INPUT: query category, mac id (default mac id is 0) |
| 2585 | * |
| 2586 | * @OUTPUT: TXRX statistics result |
| 2587 | * |
| 2588 | * This IOCTL is used to get TXRX statistics counters. |
| 2589 | * |
| 2590 | * @E.g: iwpriv wlan0 txrx_stats 21 0 |
| 2591 | * iwpriv wlan0 txrx_stats 21 1 |
| 2592 | * |
| 2593 | * Usage: Internal |
| 2594 | * |
| 2595 | * </ioctl> |
| 2596 | */ |
| 2597 | #define WE_SET_TXRX_STATS 24 |
| 2598 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2599 | |
| 2600 | #ifdef FEATURE_WLAN_TDLS |
| 2601 | #undef MAX_VAR_ARGS |
| 2602 | #define MAX_VAR_ARGS 11 |
| 2603 | #else |
| 2604 | #undef MAX_VAR_ARGS |
| 2605 | #define MAX_VAR_ARGS 9 |
| 2606 | #endif |
| 2607 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2608 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 2609 | #undef MAX_VAR_ARGS |
| 2610 | #define MAX_VAR_ARGS 15 |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2611 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2612 | #define WE_MOTION_DET_CONFIG_PARAM 25 |
| 2613 | #define WE_MOTION_DET_BASE_LINE_CONFIG_PARAM 26 |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2614 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2615 | #define WE_SET_THERMAL_THROTTLE_CFG 27 |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 2616 | /* |
| 2617 | * <ioctl> |
| 2618 | * fips_test - Perform a FIPS test |
| 2619 | * |
| 2620 | * @INPUT: Binary representation of the following packed structure |
| 2621 | * |
| 2622 | * @OUTPUT: Binary representation of the following packed structure |
| 2623 | * |
| 2624 | * This IOCTL is used to perform FIPS certification testing |
| 2625 | * |
| 2626 | * @E.g: iwpriv wlan0 fips_test <test vector> |
| 2627 | * |
| 2628 | * iwpriv wlan0 fips_test <tbd> |
| 2629 | * |
| 2630 | * Supported Feature: FIPS |
| 2631 | * |
| 2632 | * Usage: Internal |
| 2633 | * |
| 2634 | * </ioctl> |
| 2635 | */ |
| 2636 | #define WLAN_PRIV_FIPS_TEST (SIOCIWFIRSTPRIV + 8) |
| 2637 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2638 | /* Private ioctls (with no sub-ioctls) */ |
| 2639 | /* note that they must be odd so that they have "get" semantics */ |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2640 | /* |
| 2641 | * <ioctl> |
| 2642 | * addTspec - Add TSPEC for each AC |
| 2643 | * |
| 2644 | * @INPUT: 19 TSPEC params |
| 2645 | * @[arg0]: handle |
| 2646 | * @[arg1]: tid |
| 2647 | * @[arg2]: dir |
| 2648 | * @[arg3]: psb |
| 2649 | * @[arg4]: up |
| 2650 | * @[arg5]: nomMsduSize |
| 2651 | * @[arg6]: maxMsduSize |
| 2652 | * @[arg7]: minDataRate |
| 2653 | * @[arg8]: meanDataRate |
| 2654 | * @[arg9]: peakDataRate |
| 2655 | * @[arg10]: maxBurstSize |
| 2656 | * @[arg11]: minPhyRate |
| 2657 | * @[arg12]: sba |
| 2658 | * @[arg13]: minServiceIntv |
| 2659 | * @[arg14]: suspendIntv |
| 2660 | * @[arg15]: burstSizeDefn |
| 2661 | * @[arg16]: ackPolicy |
| 2662 | * @[arg17]: inactivityPeriod |
| 2663 | * @[arg18]: maxServiceIntv |
| 2664 | * |
| 2665 | * @OUTPUT: Success/Failure |
| 2666 | * |
| 2667 | * This IOCTL is used to add TSPEC for each AC. |
| 2668 | * |
| 2669 | * @E.g: iwpriv wlan0 addTspec <handle> <tid> <dir> <psb> <up> <nomMsduSize> |
| 2670 | * <maxMsduSize> <minDataRate> <meanDataRate> |
| 2671 | * <peakDataRate> <maxBurstSize> <minPhyRate> |
| 2672 | * <sba> <minServiceIntv> <suspendIntv> |
| 2673 | * <burstSizeDefn> <ackPolicy> <inactivityPeriod> |
| 2674 | * <maxServiceIntv> |
| 2675 | * iwpriv wlan0 addTspec 7001 6 2 1 6 0x80D0 0x80D0 0x14500 0x14500 0x14500 |
| 2676 | * 0 0x5B8D80 0x2001 20 2000 0 0 0 2000 |
| 2677 | * wlan0 addTspec:3 |
| 2678 | * |
| 2679 | * Supported Feature: WMM |
| 2680 | * |
| 2681 | * Usage: Internal/External |
| 2682 | * |
| 2683 | * </ioctl> |
| 2684 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2685 | #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2686 | /* |
| 2687 | * <ioctl> |
| 2688 | * delTspec - Delete TSPEC entry for each AC |
| 2689 | * |
| 2690 | * @INPUT: 1 TSPEC param |
| 2691 | * @[arg0]: handle |
| 2692 | * |
| 2693 | * @OUTPUT: Success/Failure |
| 2694 | * |
| 2695 | * This IOCTL is used to delete TSPEC entry for each AC. |
| 2696 | * |
| 2697 | * @E.g: iwpriv wlan0 delTspec <handle> |
| 2698 | * iwpriv wlan0 delTspec 7001 |
| 2699 | * wlan0 delTspec:16 |
| 2700 | * |
| 2701 | * Supported Feature: WMM |
| 2702 | * |
| 2703 | * Usage: Internal/External |
| 2704 | * |
| 2705 | * </ioctl> |
| 2706 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2707 | #define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2708 | /* |
| 2709 | * <ioctl> |
| 2710 | * getTspec - Get TSPEC entry for each AC |
| 2711 | * |
| 2712 | * @INPUT: 1 TSPEC param |
| 2713 | * @[arg0]: handle |
| 2714 | * |
| 2715 | * @OUTPUT: Success/Failure |
| 2716 | * |
| 2717 | * This IOCTL is used to get TSPEC entry for each AC. |
| 2718 | * |
| 2719 | * @E.g: iwpriv wlan0 getTspec <handle> |
| 2720 | * iwpriv wlan0 getTspec 7001 |
| 2721 | * wlan0 delTspec:18 |
| 2722 | * |
| 2723 | * Supported Feature: WMM |
| 2724 | * |
| 2725 | * Usage: Internal/External |
| 2726 | * |
| 2727 | * </ioctl> |
| 2728 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2729 | #define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13) |
| 2730 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2731 | /* (SIOCIWFIRSTPRIV + 10) is currently unused */ |
| 2732 | /* (SIOCIWFIRSTPRIV + 12) is currently unused */ |
| 2733 | /* (SIOCIWFIRSTPRIV + 14) is currently unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 2734 | #define WLAN_PRIV_SET_NONE_GET_THREE_INT (SIOCIWFIRSTPRIV + 15) |
| 2735 | #define WE_GET_TSF 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2736 | /* (SIOCIWFIRSTPRIV + 16) is currently unused */ |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 2737 | |
| 2738 | #ifdef FEATURE_WLM_STATS |
| 2739 | /* |
| 2740 | * <ioctl> |
| 2741 | * |
| 2742 | * get_wlm_stats - Get stats from FW for game latency |
| 2743 | * |
| 2744 | * @INPUT: BITMASK inform of decimal number |
| 2745 | * |
| 2746 | * @OUTPUT: HEX string given by FW |
| 2747 | * |
| 2748 | * This IOCTL is used to get game latency related STATS from FW |
| 2749 | * |
| 2750 | * @E.g.: iwpriv wlan0 get_wlm_stats 1 |
| 2751 | * |
| 2752 | * Usage: internal |
| 2753 | * |
| 2754 | * </ioctl> |
| 2755 | */ |
| 2756 | #define WLAN_GET_WLM_STATS (SIOCIWFIRSTPRIV + 17) |
| 2757 | #endif |
| 2758 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2759 | /* (SIOCIWFIRSTPRIV + 19) is currently unused */ |
| 2760 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2761 | #define WLAN_PRIV_SET_FTIES (SIOCIWFIRSTPRIV + 20) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2762 | |
| 2763 | /* Private ioctl for setting the host offload feature */ |
| 2764 | #define WLAN_PRIV_SET_HOST_OFFLOAD (SIOCIWFIRSTPRIV + 18) |
| 2765 | |
| 2766 | /* Private ioctl to get the statistics */ |
| 2767 | #define WLAN_GET_WLAN_STATISTICS (SIOCIWFIRSTPRIV + 21) |
| 2768 | |
| 2769 | /* Private ioctl to set the Keep Alive Params */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2770 | /* |
| 2771 | * <ioctl> |
| 2772 | * setKeepAlive - Set the keep alive feature |
| 2773 | * |
| 2774 | * @INPUT: 28 bytes of information in the order of packet type, time period |
| 2775 | * host IPv4 address, destination IPv4 address, destination MAC address, bssID |
| 2776 | * |
| 2777 | * @OUTPUT: None |
| 2778 | * |
| 2779 | * This IOCTL sets the keep alive feature to send either NULL |
| 2780 | * or unsolicited ARP response packets |
| 2781 | * |
| 2782 | * @E.g: iwpriv wlan0 setKeepAlive |
| 2783 | * |
| 2784 | * Supported Feature: STA |
| 2785 | * |
| 2786 | * Usage: Internal/External |
| 2787 | * |
| 2788 | * </ioctl> |
| 2789 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2790 | #define WLAN_SET_KEEPALIVE_PARAMS (SIOCIWFIRSTPRIV + 22) |
| 2791 | |
| 2792 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2793 | /* Private ioctl to set the packet filtering params */ |
| 2794 | #define WLAN_SET_PACKET_FILTER_PARAMS (SIOCIWFIRSTPRIV + 23) |
| 2795 | #endif |
| 2796 | |
| 2797 | |
| 2798 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2799 | /* Private ioctl to get the statistics */ |
| 2800 | #define WLAN_SET_PNO (SIOCIWFIRSTPRIV + 24) |
| 2801 | #endif |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2802 | /* |
| 2803 | * <ioctl> |
| 2804 | * SETBAND - Set the operational band |
| 2805 | * |
| 2806 | * @INPUT: 0 to Auto, 1 to 5 GHz and 2 to 2.4 GHz |
| 2807 | * |
| 2808 | * @OUTPUT: None |
| 2809 | * |
| 2810 | * This IOCTL Set the operational band If the new band is different from the |
| 2811 | * current operational band, it aborts the pending scan requests, flushes |
| 2812 | * the existing scan results, and then change * the band capability |
| 2813 | * |
| 2814 | * @E.g: iwpriv wlan0 SETBAND <value> |
| 2815 | * |
| 2816 | * Supported Feature: STA |
| 2817 | * |
| 2818 | * Usage: Internal/External |
| 2819 | * |
| 2820 | * </ioctl> |
| 2821 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2822 | #define WLAN_SET_BAND_CONFIG (SIOCIWFIRSTPRIV + 25) |
| 2823 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 2824 | #define WLAN_PRIV_SET_MCBC_FILTER (SIOCIWFIRSTPRIV + 26) |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 2825 | /* (SIOCIWFIRSTPRIV + 27) is currently unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2826 | |
| 2827 | /* Private ioctls and their sub-ioctls */ |
| 2828 | #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 2829 | #define WE_SET_SMPS_PARAM 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2830 | #define WE_SET_FW_CRASH_INJECT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2831 | #define WE_DUMP_DP_TRACE_LEVEL 3 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2832 | /* Private sub ioctl for enabling and setting histogram interval of profiling */ |
| 2833 | #define WE_ENABLE_FW_PROFILE 4 |
| 2834 | #define WE_SET_FW_PROFILE_HIST_INTVL 5 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2835 | |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 2836 | /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2837 | #define WE_SET_WLAN_SUSPEND 6 |
| 2838 | #define WE_SET_WLAN_RESUME 7 |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2839 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2840 | /* |
| 2841 | * <ioctl> |
| 2842 | * log_buffer - prints host/target related communication logs via dmesg |
| 2843 | * |
| 2844 | * @INPUT: Log Id, Count |
| 2845 | * |
| 2846 | * Log Id: |
| 2847 | * 0) HTC_CREDIT_HISTORY_LOG |
| 2848 | * 1) COMMAND_LOG, |
| 2849 | * 2) COMMAND_TX_CMP_LOG, |
| 2850 | * 3) MGMT_COMMAND_LOG, |
| 2851 | * 4) MGMT_COMMAND_TX_CMP_LOG, |
| 2852 | * 5) EVENT_LOG, |
| 2853 | * 6) RX_EVENT_LOG, |
| 2854 | * 7) MGMT_EVENT_LOG |
| 2855 | * |
| 2856 | * @OUTPUT: None |
| 2857 | * |
| 2858 | * @E.g: |
| 2859 | * # print up to 10 of the most recent records from HTC Credit History |
| 2860 | * iwpriv wlan0 log_buffer 0 10 |
| 2861 | * # print up to 3 of the most recent records from Event Log |
| 2862 | * iwpriv wlan0 log_buffer 5 3 |
| 2863 | * |
| 2864 | * Supported Feature: WLAN Trace |
| 2865 | * |
| 2866 | * Usage: Internal/External |
| 2867 | * |
| 2868 | * </ioctl> |
| 2869 | */ |
| 2870 | #define WE_LOG_BUFFER 8 |
| 2871 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2872 | /* |
| 2873 | * <ioctl> |
| 2874 | * set_ba_timeout - sets Block ACK aging timeout value for each Access class |
| 2875 | * |
| 2876 | * @INPUT: Access Class [0:BK, 1:BE, 2:VI, 3:VO], Timeout value |
| 2877 | * |
| 2878 | * @OUTPUT: None |
| 2879 | * |
| 2880 | * @E.g.: |
| 2881 | * # to set duration of 2 seconds for BE |
| 2882 | * iwpriv wlan0 set_ba_timeout 1 2 |
| 2883 | * # to set duration of 3 seconds for VO |
| 2884 | * iwpriv wlan0 set_ba_timeout 3 3 |
| 2885 | * |
| 2886 | * Usage: Internal |
| 2887 | * |
| 2888 | * </ioctl> |
| 2889 | */ |
| 2890 | #define WE_SET_BA_AGEING_TIMEOUT 9 |
| 2891 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2892 | enum host_target_comm_log { |
| 2893 | HTC_CREDIT_HISTORY_LOG = 0, |
| 2894 | COMMAND_LOG, |
| 2895 | COMMAND_TX_CMP_LOG, |
| 2896 | MGMT_COMMAND_LOG, |
| 2897 | MGMT_COMMAND_TX_CMP_LOG, |
| 2898 | EVENT_LOG, |
| 2899 | RX_EVENT_LOG, |
| 2900 | MGMT_EVENT_LOG |
| 2901 | }; |
| 2902 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2903 | /* (SIOCIWFIRSTPRIV + 29) is currently unused */ |
| 2904 | |
| 2905 | /* 802.11p IOCTL */ |
| 2906 | #define WLAN_SET_DOT11P_CHANNEL_SCHED (SIOCIWFIRSTPRIV + 30) |
| 2907 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2908 | /* |
| 2909 | * <ioctl> |
| 2910 | * getLinkSpeed - Gets the current link speed in Mbps |
| 2911 | * |
| 2912 | * @INPUT: None |
| 2913 | * |
| 2914 | * @OUTPUT: linkspeed in mbps |
| 2915 | * wlan0 getLinkSpeed:7 |
| 2916 | * |
| 2917 | * This IOCTL is used get the current link speed in Mbps |
| 2918 | * |
| 2919 | * @E.g: iwpriv wlan0 getLinkSpeed |
| 2920 | * |
| 2921 | * Supported Feature: STA |
| 2922 | * |
| 2923 | * Usage: Internal/External |
| 2924 | * |
| 2925 | * </ioctl> |
| 2926 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2927 | #define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 2928 | |
| 2929 | #define WLAN_STATS_INVALID 0 |
| 2930 | #define WLAN_STATS_RETRY_CNT 1 |
| 2931 | #define WLAN_STATS_MUL_RETRY_CNT 2 |
| 2932 | #define WLAN_STATS_TX_FRM_CNT 3 |
| 2933 | #define WLAN_STATS_RX_FRM_CNT 4 |
| 2934 | #define WLAN_STATS_FRM_DUP_CNT 5 |
| 2935 | #define WLAN_STATS_FAIL_CNT 6 |
| 2936 | #define WLAN_STATS_RTS_FAIL_CNT 7 |
| 2937 | #define WLAN_STATS_ACK_FAIL_CNT 8 |
| 2938 | #define WLAN_STATS_RTS_SUC_CNT 9 |
| 2939 | #define WLAN_STATS_RX_DISCARD_CNT 10 |
| 2940 | #define WLAN_STATS_RX_ERROR_CNT 11 |
| 2941 | #define WLAN_STATS_TX_BYTE_CNT 12 |
| 2942 | |
| 2943 | #define WLAN_STATS_RX_BYTE_CNT 13 |
| 2944 | #define WLAN_STATS_RX_RATE 14 |
| 2945 | #define WLAN_STATS_TX_RATE 15 |
| 2946 | |
| 2947 | #define WLAN_STATS_RX_UC_BYTE_CNT 16 |
| 2948 | #define WLAN_STATS_RX_MC_BYTE_CNT 17 |
| 2949 | #define WLAN_STATS_RX_BC_BYTE_CNT 18 |
| 2950 | #define WLAN_STATS_TX_UC_BYTE_CNT 19 |
| 2951 | #define WLAN_STATS_TX_MC_BYTE_CNT 20 |
| 2952 | #define WLAN_STATS_TX_BC_BYTE_CNT 21 |
| 2953 | |
| 2954 | #define FILL_TLV(__p, __type, __size, __val, __tlen) do { \ |
| 2955 | if ((__tlen + __size + 2) < WE_MAX_STR_LEN) { \ |
| 2956 | *__p++ = __type; \ |
| 2957 | *__p++ = __size; \ |
| 2958 | memcpy(__p, __val, __size); \ |
| 2959 | __p += __size; \ |
| 2960 | __tlen += __size + 2; \ |
| 2961 | } else { \ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2962 | hdd_err("FILL_TLV Failed!!!"); \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2963 | } \ |
| 2964 | } while (0) |
| 2965 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2966 | #define TX_PER_TRACKING_DEFAULT_RATIO 5 |
| 2967 | #define TX_PER_TRACKING_MAX_RATIO 10 |
| 2968 | #define TX_PER_TRACKING_DEFAULT_WATERMARK 5 |
| 2969 | |
| 2970 | #define WLAN_ADAPTER 0 |
| 2971 | #define P2P_ADAPTER 1 |
| 2972 | |
| 2973 | /** |
| 2974 | * mem_alloc_copy_from_user_helper - copy from user helper |
| 2975 | * @wrqu_data: wireless extensions request data |
| 2976 | * @len: length of @wrqu_data |
| 2977 | * |
| 2978 | * Helper function to allocate buffer and copy user data. |
| 2979 | * |
| 2980 | * Return: On success return a pointer to a kernel buffer containing a |
| 2981 | * copy of the userspace data (with an additional NUL character |
| 2982 | * appended for safety). On failure return %NULL. |
| 2983 | */ |
| 2984 | void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len) |
| 2985 | { |
| 2986 | u8 *ptr = NULL; |
| 2987 | |
| 2988 | /* in order to protect the code, an extra byte is post |
| 2989 | * appended to the buffer and the null termination is added. |
| 2990 | * However, when allocating (len+1) byte of memory, we need to |
| 2991 | * make sure that there is no uint overflow when doing |
| 2992 | * addition. In theory check len < UINT_MAX protects the uint |
| 2993 | * overflow. For wlan private ioctl, the buffer size is much |
| 2994 | * less than UINT_MAX, as a good guess, now, it is assumed |
| 2995 | * that the private command buffer size is no greater than 4K |
| 2996 | * (4096 bytes). So we use 4096 as the upper boundary for now. |
| 2997 | */ |
| 2998 | if (len > MAX_USER_COMMAND_SIZE) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 2999 | hdd_err("Invalid length: %zu max: %u", |
| 3000 | len, MAX_USER_COMMAND_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3001 | return NULL; |
| 3002 | } |
| 3003 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 3004 | ptr = qdf_mem_malloc(len + 1); |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 3005 | if (!ptr) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3006 | hdd_err("unable to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3007 | return NULL; |
| 3008 | } |
| 3009 | |
| 3010 | if (copy_from_user(ptr, wrqu_data, len)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3011 | hdd_err("failed to copy data to user buffer"); |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 3012 | qdf_mem_free(ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3013 | return NULL; |
| 3014 | } |
| 3015 | ptr[len] = '\0'; |
| 3016 | return ptr; |
| 3017 | } |
| 3018 | |
| 3019 | /** |
| 3020 | * hdd_priv_get_data() - Get pointer to ioctl private data |
| 3021 | * @p_priv_data: pointer to iw_point struct to be filled |
| 3022 | * @wrqu: Pointer to IOCTL Data received from userspace |
| 3023 | * |
| 3024 | * Helper function to get compatible struct iw_point passed to ioctl |
| 3025 | * |
| 3026 | * Return - 0 if p_priv_data successfully filled, error otherwise |
| 3027 | */ |
| 3028 | int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) |
| 3029 | { |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 3030 | if ((!p_priv_data) || (!wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3031 | return -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3032 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3033 | #ifdef CONFIG_COMPAT |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 3034 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3035 | struct compat_iw_point *p_compat_priv_data; |
| 3036 | |
| 3037 | /* Compat task: |
| 3038 | * typecast to compat structure and copy the members. |
| 3039 | */ |
| 3040 | p_compat_priv_data = (struct compat_iw_point *)&wrqu->data; |
| 3041 | |
| 3042 | p_priv_data->pointer = compat_ptr(p_compat_priv_data->pointer); |
| 3043 | p_priv_data->length = p_compat_priv_data->length; |
| 3044 | p_priv_data->flags = p_compat_priv_data->flags; |
| 3045 | } else { |
| 3046 | #endif /* #ifdef CONFIG_COMPAT */ |
| 3047 | |
| 3048 | /* Non compat task: directly copy the structure. */ |
| 3049 | memcpy(p_priv_data, &wrqu->data, sizeof(struct iw_point)); |
| 3050 | |
| 3051 | #ifdef CONFIG_COMPAT |
| 3052 | } |
| 3053 | #endif /* #ifdef CONFIG_COMPAT */ |
| 3054 | |
| 3055 | return 0; |
| 3056 | } |
| 3057 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3058 | static int hdd_check_wext_control(enum hdd_wext_control wext_control, |
| 3059 | struct iw_request_info *info) |
| 3060 | { |
| 3061 | switch (wext_control) { |
| 3062 | default: |
| 3063 | case hdd_wext_disabled: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 3064 | hdd_err_rl("Rejecting disabled ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3065 | return -ENOTSUPP; |
| 3066 | case hdd_wext_deprecated: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 3067 | hdd_warn_rl("Using deprecated ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3068 | return 0; |
| 3069 | case hdd_wext_enabled: |
| 3070 | return 0; |
| 3071 | } |
| 3072 | } |
| 3073 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 3074 | int hdd_check_private_wext_control(struct hdd_context *hdd_ctx, |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3075 | struct iw_request_info *info) |
| 3076 | { |
| 3077 | return hdd_check_wext_control(hdd_ctx->config->private_wext_control, |
| 3078 | info); |
| 3079 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3080 | |
| 3081 | /** |
| 3082 | * hdd_wlan_get_stats() - Get txrx stats in SAP mode |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3083 | * @adapter: Pointer to the hdd adapter. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3084 | * @length: Size of the data copied |
| 3085 | * @buffer: Pointer to char buffer. |
| 3086 | * @buf_len: Length of the char buffer. |
| 3087 | * |
| 3088 | * This function called when the "iwpriv wlan0 get_stats" command is given. |
| 3089 | * It used to collect the txrx stats when the device is configured in SAP mode. |
| 3090 | * |
| 3091 | * Return - none |
| 3092 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3093 | void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3094 | char *buffer, uint16_t buf_len) |
| 3095 | { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3096 | struct hdd_tx_rx_stats *stats = &adapter->hdd_stats.tx_rx_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3097 | uint32_t len = 0; |
| 3098 | uint32_t total_rx_pkt = 0, total_rx_dropped = 0; |
| 3099 | uint32_t total_rx_delv = 0, total_rx_refused = 0; |
| 3100 | int i = 0; |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3101 | struct hdd_context *hdd_ctx = adapter->hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3102 | |
| 3103 | for (; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3104 | total_rx_pkt += stats->rx_packets[i]; |
| 3105 | total_rx_dropped += stats->rx_dropped[i]; |
| 3106 | total_rx_delv += stats->rx_delivered[i]; |
| 3107 | total_rx_refused += stats->rx_refused[i]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3108 | } |
| 3109 | |
| 3110 | len = scnprintf(buffer, buf_len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3111 | "\nTransmit[%lu] - " |
| 3112 | "called %u, dropped %u orphan %u," |
| 3113 | "\n[dropped] BK %u, BE %u, VI %u, VO %u" |
| 3114 | "\n[classified] BK %u, BE %u, VI %u, VO %u" |
| 3115 | "\n\nReceive[%lu] - " |
Manjunathappa Prakash | f39d237 | 2019-02-25 18:18:57 -0800 | [diff] [blame] | 3116 | "packets %u, dropped %u, unsolict_arp_n_mcast_drp %u, delivered %u, refused %u\n" |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3117 | "GRO - agg %u non-agg %u flushes(%u %u) disabled(conc %u low-tput %u)\n", |
| 3118 | qdf_system_ticks(), |
| 3119 | stats->tx_called, |
| 3120 | stats->tx_dropped, |
| 3121 | stats->tx_orphaned, |
| 3122 | stats->tx_dropped_ac[SME_AC_BK], |
| 3123 | stats->tx_dropped_ac[SME_AC_BE], |
| 3124 | stats->tx_dropped_ac[SME_AC_VI], |
| 3125 | stats->tx_dropped_ac[SME_AC_VO], |
| 3126 | stats->tx_classified_ac[SME_AC_BK], |
| 3127 | stats->tx_classified_ac[SME_AC_BE], |
| 3128 | stats->tx_classified_ac[SME_AC_VI], |
| 3129 | stats->tx_classified_ac[SME_AC_VO], |
| 3130 | qdf_system_ticks(), |
Manjunathappa Prakash | f39d237 | 2019-02-25 18:18:57 -0800 | [diff] [blame] | 3131 | total_rx_pkt, total_rx_dropped, |
| 3132 | qdf_atomic_read(&stats->rx_usolict_arp_n_mcast_drp), |
| 3133 | total_rx_delv, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3134 | total_rx_refused, |
| 3135 | stats->rx_aggregated, stats->rx_non_aggregated, |
| 3136 | stats->rx_gro_flushes, |
| 3137 | stats->rx_gro_force_flushes, |
| 3138 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_concurrency), |
| 3139 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_low_tput)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3140 | |
| 3141 | for (i = 0; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3142 | if (stats->rx_packets[i] == 0) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3143 | continue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3144 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3145 | "Rx CPU[%d]:" |
| 3146 | "packets %u, dropped %u, delivered %u, refused %u\n", |
| 3147 | i, stats->rx_packets[i], stats->rx_dropped[i], |
| 3148 | stats->rx_delivered[i], stats->rx_refused[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3149 | } |
| 3150 | |
| 3151 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3152 | "\nTX_FLOW" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3153 | "\nCurrent status: %s" |
| 3154 | "\ntx-flow timer start count %u" |
| 3155 | "\npause count %u, unpause count %u", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3156 | (stats->is_txflow_paused == true ? "PAUSED" : "UNPAUSED"), |
| 3157 | stats->txflow_timer_cnt, |
| 3158 | stats->txflow_pause_cnt, |
| 3159 | stats->txflow_unpause_cnt); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3160 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 3161 | len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3162 | adapter->vdev_id, &buffer[len], (buf_len - len)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3163 | *length = len + 1; |
| 3164 | } |
| 3165 | |
| 3166 | /** |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3167 | * wlan_hdd_write_suspend_resume_stats() - Writes suspend/resume stats to buffer |
| 3168 | * @hdd_ctx: The Hdd context owning the stats to be written |
| 3169 | * @buffer: The char buffer to write to |
| 3170 | * @max_len: The maximum number of chars to write |
| 3171 | * |
| 3172 | * This assumes hdd_ctx has already been validated, and buffer is not NULL. |
| 3173 | * |
| 3174 | * Return - length of written content, negative number on error |
| 3175 | */ |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3176 | #ifdef QCA_SUPPORT_CP_STATS |
| 3177 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
| 3178 | char *buffer, uint16_t max_len) |
| 3179 | { |
| 3180 | int ret; |
| 3181 | QDF_STATUS status; |
| 3182 | struct suspend_resume_stats *sr_stats; |
| 3183 | |
| 3184 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3185 | ret = scnprintf(buffer, max_len, |
| 3186 | "\n" |
| 3187 | "Suspends: %u\n" |
| 3188 | "Resumes: %u\n" |
| 3189 | "\n" |
| 3190 | "Suspend Fail Reasons\n" |
| 3191 | "\tIPA: %u\n" |
| 3192 | "\tRadar: %u\n" |
| 3193 | "\tRoam: %u\n" |
| 3194 | "\tScan: %u\n" |
| 3195 | "\tInitial Wakeup: %u\n" |
| 3196 | "\n", |
| 3197 | sr_stats->suspends, sr_stats->resumes, |
| 3198 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3199 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3200 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3201 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3202 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]); |
| 3203 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3204 | status = ucfg_mc_cp_stats_write_wow_stats(hdd_ctx->psoc, |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3205 | &buffer[ret], max_len - ret, |
| 3206 | &ret); |
| 3207 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3208 | hdd_err("Failed to get WoW stats"); |
| 3209 | return qdf_status_to_os_return(status); |
| 3210 | } |
| 3211 | |
| 3212 | return ret; |
| 3213 | } |
| 3214 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3215 | 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] | 3216 | char *buffer, uint16_t max_len) |
| 3217 | { |
| 3218 | QDF_STATUS status; |
| 3219 | struct suspend_resume_stats *sr_stats; |
| 3220 | struct sir_wake_lock_stats wow_stats; |
| 3221 | |
| 3222 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3223 | |
| 3224 | status = wma_get_wakelock_stats(&wow_stats); |
| 3225 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3226 | hdd_err("Failed to get WoW stats"); |
| 3227 | return qdf_status_to_os_return(status); |
| 3228 | } |
| 3229 | |
| 3230 | return scnprintf(buffer, max_len, |
| 3231 | "\n" |
| 3232 | "Suspends: %u\n" |
| 3233 | "Resumes: %u\n" |
| 3234 | "\n" |
| 3235 | "Suspend Fail Reasons\n" |
| 3236 | "\tIPA: %u\n" |
| 3237 | "\tRadar: %u\n" |
| 3238 | "\tRoam: %u\n" |
| 3239 | "\tScan: %u\n" |
| 3240 | "\tInitial Wakeup: %u\n" |
| 3241 | "\n" |
| 3242 | "WoW Wake Reasons\n" |
| 3243 | "\tunicast: %u\n" |
| 3244 | "\tbroadcast: %u\n" |
| 3245 | "\tIPv4 multicast: %u\n" |
| 3246 | "\tIPv6 multicast: %u\n" |
| 3247 | "\tIPv6 multicast RA: %u\n" |
| 3248 | "\tIPv6 multicast NS: %u\n" |
| 3249 | "\tIPv6 multicast NA: %u\n" |
| 3250 | "\tICMPv4: %u\n" |
| 3251 | "\tICMPv6: %u\n" |
| 3252 | "\tRSSI Breach: %u\n" |
| 3253 | "\tLow RSSI: %u\n" |
| 3254 | "\tG-Scan: %u\n" |
| 3255 | "\tPNO Complete: %u\n" |
| 3256 | "\tPNO Match: %u\n", |
| 3257 | sr_stats->suspends, |
| 3258 | sr_stats->resumes, |
| 3259 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3260 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3261 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3262 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3263 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP], |
| 3264 | wow_stats.wow_ucast_wake_up_count, |
| 3265 | wow_stats.wow_bcast_wake_up_count, |
| 3266 | wow_stats.wow_ipv4_mcast_wake_up_count, |
| 3267 | wow_stats.wow_ipv6_mcast_wake_up_count, |
| 3268 | wow_stats.wow_ipv6_mcast_ra_stats, |
| 3269 | wow_stats.wow_ipv6_mcast_ns_stats, |
| 3270 | wow_stats.wow_ipv6_mcast_na_stats, |
| 3271 | wow_stats.wow_icmpv4_count, |
| 3272 | wow_stats.wow_icmpv6_count, |
| 3273 | wow_stats.wow_rssi_breach_wake_up_count, |
| 3274 | wow_stats.wow_low_rssi_wake_up_count, |
| 3275 | wow_stats.wow_gscan_wake_up_count, |
| 3276 | wow_stats.wow_pno_complete_wake_up_count, |
| 3277 | wow_stats.wow_pno_match_wake_up_count); |
| 3278 | } |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3279 | #endif |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3280 | /** |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3281 | * hdd_wlan_list_fw_profile() - Get fw profiling points |
| 3282 | * @length: Size of the data copied |
| 3283 | * @buffer: Pointer to char buffer. |
| 3284 | * @buf_len: Length of the char buffer. |
| 3285 | * |
| 3286 | * This function called when the "iwpriv wlan0 listProfile" command is given. |
| 3287 | * It is used to get the supported profiling points in FW. |
| 3288 | * |
| 3289 | * Return - none |
| 3290 | */ |
| 3291 | void hdd_wlan_list_fw_profile(uint16_t *length, |
| 3292 | char *buffer, uint16_t buf_len) |
| 3293 | { |
| 3294 | uint32_t len = 0; |
| 3295 | |
| 3296 | len = scnprintf(buffer, buf_len, |
| 3297 | "PROF_CPU_IDLE: %u\n" |
| 3298 | "PROF_PPDU_PROC: %u\n" |
| 3299 | "PROF_PPDU_POST: %u\n" |
| 3300 | "PROF_HTT_TX_INPUT: %u\n" |
| 3301 | "PROF_MSDU_ENQ: %u\n" |
| 3302 | "PROF_PPDU_POST_HAL: %u\n" |
| 3303 | "PROF_COMPUTE_TX_TIME: %u\n", |
| 3304 | PROF_CPU_IDLE, |
| 3305 | PROF_PPDU_PROC, |
| 3306 | PROF_PPDU_POST, |
| 3307 | PROF_HTT_TX_INPUT, |
| 3308 | PROF_MSDU_ENQ, |
| 3309 | PROF_PPDU_POST_HAL, |
| 3310 | PROF_COMPUTE_TX_TIME); |
| 3311 | |
| 3312 | *length = len + 1; |
| 3313 | } |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3314 | |
| 3315 | #define HDD_DUMP_STAT_HELP(STAT_ID) \ |
| 3316 | hdd_nofl_info("%u -- %s", STAT_ID, (# STAT_ID)) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3317 | /** |
| 3318 | * hdd_display_stats_help() - print statistics help |
| 3319 | * |
| 3320 | * Return: none |
| 3321 | */ |
Jeff Johnson | a06efaa | 2018-04-18 09:43:21 -0700 | [diff] [blame] | 3322 | static void hdd_display_stats_help(void) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3323 | { |
Nirav Shah | e6194ac | 2018-07-13 11:04:41 +0530 | [diff] [blame] | 3324 | hdd_nofl_info("iwpriv wlan0 dumpStats [option] - dump statistics"); |
| 3325 | hdd_nofl_info("iwpriv wlan0 clearStats [option] - clear statistics"); |
| 3326 | hdd_nofl_info("options:"); |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3327 | HDD_DUMP_STAT_HELP(CDP_TXRX_PATH_STATS); |
| 3328 | HDD_DUMP_STAT_HELP(CDP_TXRX_HIST_STATS); |
| 3329 | HDD_DUMP_STAT_HELP(CDP_TXRX_TSO_STATS); |
| 3330 | HDD_DUMP_STAT_HELP(CDP_HDD_NETIF_OPER_HISTORY); |
| 3331 | HDD_DUMP_STAT_HELP(CDP_DUMP_TX_FLOW_POOL_INFO); |
| 3332 | HDD_DUMP_STAT_HELP(CDP_TXRX_DESC_STATS); |
| 3333 | HDD_DUMP_STAT_HELP(CDP_HIF_STATS); |
| 3334 | HDD_DUMP_STAT_HELP(CDP_NAPI_STATS); |
| 3335 | HDD_DUMP_STAT_HELP(CDP_DP_NAPI_STATS); |
| 3336 | HDD_DUMP_STAT_HELP(CDP_DP_RX_THREAD_STATS); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3337 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3338 | |
| 3339 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3340 | * hdd_wlan_dump_stats() - display dump Stats |
| 3341 | * @adapter: adapter handle |
| 3342 | * @value: value from user |
| 3343 | * |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3344 | * Return: 0 => success, error code on failure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3345 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3346 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3347 | { |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3348 | int ret = 0; |
| 3349 | QDF_STATUS status; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3350 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3351 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 3352 | hdd_debug("%d", value); |
| 3353 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3354 | switch (value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3355 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3356 | wlan_hdd_display_tx_rx_histogram(hdd_ctx); |
| 3357 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3358 | case CDP_HDD_NETIF_OPER_HISTORY: |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 3359 | wlan_hdd_display_netif_queue_history |
| 3360 | (hdd_ctx, |
| 3361 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3362 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3363 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 3364 | hdd_display_hif_stats(); |
| 3365 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3366 | case CDP_LRO_STATS: |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3367 | hdd_lro_display_stats(hdd_ctx); |
Alok Kumar | f28ca24 | 2018-05-07 17:51:38 +0530 | [diff] [blame] | 3368 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3369 | case CDP_NAPI_STATS: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3370 | if (hdd_display_napi_stats()) { |
| 3371 | hdd_err("error displaying napi stats"); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3372 | ret = -EFAULT; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3373 | } |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3374 | break; |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3375 | case CDP_DP_RX_THREAD_STATS: |
| 3376 | dp_txrx_ext_dump_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 3377 | CDP_DP_RX_THREAD_STATS); |
| 3378 | break; |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3379 | case CDP_DISCONNECT_STATS: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3380 | sme_display_disconnect_stats(hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3381 | adapter->vdev_id); |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3382 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3383 | default: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3384 | status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3385 | value, |
| 3386 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3387 | if (status == QDF_STATUS_E_INVAL) { |
| 3388 | hdd_display_stats_help(); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3389 | ret = -EINVAL; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3390 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3391 | break; |
| 3392 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3393 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3394 | } |
| 3395 | |
| 3396 | /** |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3397 | * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3398 | * @adapter: Adapter upon which the IBSS client is active |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 3399 | * @sta_id: Station index of the IBSS peer |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3400 | * |
| 3401 | * Return: QDF_STATUS_STATUS if the peer was found and displayed, |
| 3402 | * otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3403 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3404 | static QDF_STATUS hdd_wlan_get_ibss_peer_info(struct hdd_adapter *adapter, |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 3405 | uint8_t sta_id) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3406 | { |
| 3407 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3408 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | 93107ad | 2019-02-26 08:14:46 -0800 | [diff] [blame] | 3409 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3410 | tSirPeerInfoRspParams *peer_info = &sta_ctx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3411 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3412 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3413 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3414 | hdd_get_ibss_peer_info_cb, |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 3415 | false, sta_id); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3416 | |
| 3417 | if (QDF_STATUS_SUCCESS == status) { |
| 3418 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3419 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3420 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3421 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3422 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3423 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3424 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3425 | return QDF_STATUS_E_FAILURE; |
| 3426 | } |
| 3427 | |
| 3428 | /** Print the peer info */ |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3429 | hdd_debug("peer_info->numIBSSPeers = %d ", peer_info->numPeers); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3430 | { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3431 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3432 | uint32_t tx_rate = peer_info->peerInfoParams[0].txRate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3433 | |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3434 | qdf_mem_copy(mac_addr, peer_info->peerInfoParams[0]. |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3435 | mac_addr, sizeof(mac_addr)); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3436 | hdd_debug("PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3437 | mac_addr, (int)tx_rate, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3438 | (int)peer_info->peerInfoParams[0].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3439 | } |
| 3440 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3441 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3442 | } |
| 3443 | |
| 3444 | return status; |
| 3445 | } |
| 3446 | |
| 3447 | /** |
| 3448 | * hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3449 | * @adapter: Adapter upon which the IBSS clients are active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3450 | * |
| 3451 | * Return: QDF_STATUS_STATUS if the peer information was retrieved and |
| 3452 | * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3453 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3454 | 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] | 3455 | { |
| 3456 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3457 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | 93107ad | 2019-02-26 08:14:46 -0800 | [diff] [blame] | 3458 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3459 | tSirPeerInfoRspParams *peer_info = &sta_ctx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3460 | int i; |
| 3461 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3462 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3463 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3464 | hdd_get_ibss_peer_info_cb, |
| 3465 | true, 0xFF); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3466 | |
| 3467 | if (QDF_STATUS_SUCCESS == status) { |
| 3468 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3469 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3470 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3471 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3472 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3473 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3474 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3475 | return QDF_STATUS_E_FAILURE; |
| 3476 | } |
| 3477 | |
| 3478 | /** Print the peer info */ |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3479 | hdd_debug("peer_info->numIBSSPeers = %d ", |
| 3480 | (int)peer_info->numPeers); |
| 3481 | for (i = 0; i < peer_info->numPeers; i++) { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3482 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3483 | uint32_t tx_rate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3484 | |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3485 | tx_rate = peer_info->peerInfoParams[i].txRate; |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3486 | qdf_mem_copy(mac_addr, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3487 | peer_info->peerInfoParams[i].mac_addr, |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3488 | sizeof(mac_addr)); |
| 3489 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3490 | hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3491 | mac_addr, (int)tx_rate, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3492 | (int)peer_info->peerInfoParams[i].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3493 | } |
| 3494 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3495 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3496 | } |
| 3497 | |
| 3498 | return status; |
| 3499 | } |
| 3500 | |
| 3501 | /** |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3502 | * hdd_get_ldpc() - Get adapter LDPC |
| 3503 | * @adapter: adapter being queried |
| 3504 | * @value: where to store the value |
| 3505 | * |
| 3506 | * Return: 0 on success, negative errno on failure |
| 3507 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3508 | int hdd_get_ldpc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3509 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3510 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3511 | int ret; |
| 3512 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3513 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3514 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3515 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING); |
| 3516 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3517 | hdd_err("Failed to get LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3518 | } else { |
| 3519 | *value = ret; |
| 3520 | ret = 0; |
| 3521 | } |
| 3522 | return ret; |
| 3523 | } |
| 3524 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3525 | int hdd_set_ldpc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3526 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3527 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3528 | int ret; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3529 | QDF_STATUS status; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3530 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3531 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3532 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3533 | hdd_debug("%d", value); |
Jeff Johnson | 1ca0476 | 2018-10-25 10:24:39 -0700 | [diff] [blame] | 3534 | |
| 3535 | if (!mac_handle) { |
| 3536 | hdd_err("NULL Mac handle"); |
| 3537 | return -EINVAL; |
| 3538 | } |
| 3539 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3540 | 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] | 3541 | if (QDF_STATUS_SUCCESS != status) { |
| 3542 | hdd_err("Failed to get HT capability info"); |
| 3543 | return -EIO; |
| 3544 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3545 | |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3546 | ht_cap_info.adv_coding_cap = value; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3547 | 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] | 3548 | if (QDF_STATUS_SUCCESS != status) { |
| 3549 | hdd_err("Failed to set HT capability info"); |
| 3550 | return -EIO; |
| 3551 | } |
Vignesh Viswanathan | ecd4de7 | 2018-11-22 13:02:20 +0530 | [diff] [blame] | 3552 | 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] | 3553 | if (QDF_IS_STATUS_ERROR(status)) { |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3554 | hdd_err("Failed to set VHT LDPC capability info"); |
| 3555 | return -EIO; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3556 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3557 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3558 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING, |
| 3559 | value); |
| 3560 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3561 | hdd_err("Failed to set LDPC value"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3562 | ret = sme_update_he_ldpc_supp(mac_handle, adapter->vdev_id, value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3563 | if (ret) |
| 3564 | hdd_err("Failed to set HE LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3565 | |
| 3566 | return ret; |
| 3567 | } |
| 3568 | |
| 3569 | /** |
| 3570 | * hdd_get_tx_stbc() - Get adapter TX STBC |
| 3571 | * @adapter: adapter being queried |
| 3572 | * @value: where to store the value |
| 3573 | * |
| 3574 | * Return: 0 on success, negative errno on failure |
| 3575 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3576 | int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3577 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3578 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3579 | int ret; |
| 3580 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3581 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3582 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3583 | WNI_CFG_HT_CAP_INFO_TX_STBC); |
| 3584 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3585 | hdd_err("Failed to get TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3586 | } else { |
| 3587 | *value = ret; |
| 3588 | ret = 0; |
| 3589 | } |
| 3590 | |
| 3591 | return ret; |
| 3592 | } |
| 3593 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3594 | int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3595 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3596 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3597 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3598 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3599 | QDF_STATUS status; |
| 3600 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3601 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3602 | hdd_debug("%d", value); |
Jeff Johnson | 57ff4fa | 2018-10-25 10:29:47 -0700 | [diff] [blame] | 3603 | |
| 3604 | if (!mac_handle) { |
| 3605 | hdd_err("NULL Mac handle"); |
| 3606 | return -EINVAL; |
| 3607 | } |
| 3608 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3609 | if (value) { |
| 3610 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3611 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3612 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3613 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3614 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3615 | return -EIO; |
| 3616 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3617 | if (!ht_cap_info.tx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3618 | hdd_err("TX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3619 | return -EINVAL; |
| 3620 | } |
| 3621 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3622 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3623 | WNI_CFG_HT_CAP_INFO_TX_STBC, |
| 3624 | value); |
| 3625 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3626 | hdd_err("Failed to set TX STBC value"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3627 | ret = sme_update_he_tx_stbc_cap(mac_handle, adapter->vdev_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3628 | if (ret) |
| 3629 | hdd_err("Failed to set HE TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3630 | |
| 3631 | return ret; |
| 3632 | } |
| 3633 | |
| 3634 | /** |
| 3635 | * hdd_get_rx_stbc() - Get adapter RX STBC |
| 3636 | * @adapter: adapter being queried |
| 3637 | * @value: where to store the value |
| 3638 | * |
| 3639 | * Return: 0 on success, negative errno on failure |
| 3640 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3641 | int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3642 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3643 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3644 | int ret; |
| 3645 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3646 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3647 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3648 | WNI_CFG_HT_CAP_INFO_RX_STBC); |
| 3649 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3650 | hdd_err("Failed to get RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3651 | } else { |
| 3652 | *value = ret; |
| 3653 | ret = 0; |
| 3654 | } |
| 3655 | |
| 3656 | return ret; |
| 3657 | } |
| 3658 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3659 | int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3660 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3661 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3662 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3663 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3664 | QDF_STATUS status; |
| 3665 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3666 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3667 | hdd_debug("%d", value); |
Jeff Johnson | b664585 | 2018-10-25 10:35:41 -0700 | [diff] [blame] | 3668 | |
| 3669 | if (!mac_handle) { |
| 3670 | hdd_err("NULL Mac handle"); |
| 3671 | return -EINVAL; |
| 3672 | } |
| 3673 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3674 | if (value) { |
| 3675 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3676 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3677 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3678 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3679 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3680 | return -EIO; |
| 3681 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3682 | if (!ht_cap_info.rx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3683 | hdd_warn("RX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3684 | return -EINVAL; |
| 3685 | } |
| 3686 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3687 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3688 | WNI_CFG_HT_CAP_INFO_RX_STBC, |
| 3689 | value); |
| 3690 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3691 | hdd_err("Failed to set RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3692 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3693 | ret = sme_update_he_rx_stbc_cap(mac_handle, adapter->vdev_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3694 | if (ret) |
| 3695 | hdd_err("Failed to set HE RX STBC value"); |
| 3696 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3697 | return ret; |
| 3698 | } |
| 3699 | |
| 3700 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3701 | * iw_get_linkspeed() - Get current link speed ioctl |
| 3702 | * @dev: device upon which the ioctl was received |
| 3703 | * @info: ioctl request information |
| 3704 | * @wrqu: ioctl request data |
| 3705 | * @extra: extra ioctl buffer |
| 3706 | * |
| 3707 | * Return: 0 on success, non-zero on error |
| 3708 | */ |
| 3709 | static int __iw_get_linkspeed(struct net_device *dev, |
| 3710 | struct iw_request_info *info, |
| 3711 | union iwreq_data *wrqu, char *extra) |
| 3712 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3713 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 21451ae | 2019-03-10 21:54:04 -0700 | [diff] [blame] | 3714 | char *out_link_speed = (char *)extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3715 | int len = sizeof(uint32_t) + 1; |
| 3716 | uint32_t link_speed = 0; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3717 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3718 | int ret; |
| 3719 | int rc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3720 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 3721 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 3722 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3723 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3724 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 3725 | if (0 != ret) |
| 3726 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3727 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3728 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 3729 | if (0 != ret) |
| 3730 | return ret; |
| 3731 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3732 | ret = wlan_hdd_get_link_speed(adapter, &link_speed); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3733 | if (0 != ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3734 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3735 | |
| 3736 | wrqu->data.length = len; |
| 3737 | /* return the linkspeed as a string */ |
Jeff Johnson | 21451ae | 2019-03-10 21:54:04 -0700 | [diff] [blame] | 3738 | rc = snprintf(out_link_speed, len, "%u", link_speed); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3739 | if ((rc < 0) || (rc >= len)) { |
| 3740 | /* encoding or length error? */ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3741 | hdd_err("Unable to encode link speed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3742 | return -EIO; |
| 3743 | } |
| 3744 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 3745 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3746 | /* a value is being successfully returned */ |
| 3747 | return 0; |
| 3748 | } |
| 3749 | |
| 3750 | static int iw_get_linkspeed(struct net_device *dev, |
| 3751 | struct iw_request_info *info, |
| 3752 | union iwreq_data *wrqu, char *extra) |
| 3753 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3754 | int errno; |
| 3755 | struct osif_vdev_sync *vdev_sync; |
| 3756 | |
| 3757 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 3758 | if (errno) |
| 3759 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3760 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3761 | errno = __iw_get_linkspeed(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3762 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3763 | osif_vdev_sync_op_stop(vdev_sync); |
| 3764 | |
| 3765 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3766 | } |
| 3767 | |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3768 | #ifdef FEATURE_WLM_STATS |
| 3769 | static void wlan_get_wlm_stats_cb(void *cookie, const char *data) |
| 3770 | { |
| 3771 | struct osif_request *request; |
| 3772 | char *priv; |
| 3773 | |
| 3774 | request = osif_request_get(cookie); |
| 3775 | if (!request) { |
| 3776 | hdd_err("Obsolete request"); |
| 3777 | return; |
| 3778 | } |
| 3779 | priv = osif_request_priv(request); |
| 3780 | strlcpy(priv, data, WE_MAX_STR_LEN); |
| 3781 | osif_request_complete(request); |
| 3782 | osif_request_put(request); |
| 3783 | } |
| 3784 | |
| 3785 | static int wlan_get_wlm_stats(struct hdd_adapter *adapter, uint32_t bitmask, |
| 3786 | char *response) |
| 3787 | { |
| 3788 | struct osif_request *request; |
| 3789 | void *cookie; |
| 3790 | int errno; |
| 3791 | char *priv; |
| 3792 | static const struct osif_request_params params = { |
| 3793 | .priv_size = WE_MAX_STR_LEN, |
| 3794 | .timeout_ms = 2000, |
| 3795 | }; |
| 3796 | |
| 3797 | if (!adapter) { |
| 3798 | hdd_err("NULL argument"); |
| 3799 | return -EINVAL; |
| 3800 | } |
| 3801 | request = osif_request_alloc(¶ms); |
| 3802 | if (!request) { |
| 3803 | hdd_err("Request allocation failure"); |
| 3804 | return -ENOMEM; |
| 3805 | } |
| 3806 | cookie = osif_request_cookie(request); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3807 | errno = wma_wlm_stats_req(adapter->vdev_id, bitmask, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3808 | params.priv_size, |
| 3809 | wlan_get_wlm_stats_cb, cookie); |
| 3810 | if (errno) { |
| 3811 | hdd_err("Request failed be sent, %d", errno); |
| 3812 | goto cleanup; |
| 3813 | } |
| 3814 | errno = osif_request_wait_for_response(request); |
| 3815 | if (errno) { |
| 3816 | hdd_err("Timeout happened, can't complete the req"); |
| 3817 | goto cleanup; |
| 3818 | } |
| 3819 | priv = osif_request_priv(request); |
| 3820 | strlcpy(response, priv, params.priv_size); |
| 3821 | |
| 3822 | cleanup: |
| 3823 | osif_request_put(request); |
| 3824 | |
| 3825 | return errno; |
| 3826 | } |
| 3827 | |
| 3828 | /* |
| 3829 | * Due to a limitation in iwpriv the "get_wlm_stats" ioctl is defined |
| 3830 | * to take as input a variable-length string as opposed to taking a |
| 3831 | * single integer "bitmask" value. Hence we must have a buffer large |
| 3832 | * enough to hold a string representing the largest possible |
| 3833 | * value. MAX_INT = 2,147,483,647 which can be fit in 10 chars. |
| 3834 | * Round up to 12 to hold the trailing NUL and be a multiple of 4. |
| 3835 | */ |
| 3836 | #define WLM_USER_DATA_SIZE 12 |
| 3837 | |
| 3838 | static int __iw_get_wlm_stats(struct net_device *dev, |
| 3839 | struct iw_request_info *info, |
| 3840 | union iwreq_data *wrqu, char *extra) |
| 3841 | { |
| 3842 | struct iw_point priv_data; |
| 3843 | char user_data[WLM_USER_DATA_SIZE] = {0}; |
| 3844 | uint32_t bitmask = 0; |
| 3845 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 3846 | struct hdd_context *hdd_ctx; |
| 3847 | int errno; |
| 3848 | |
| 3849 | hdd_enter_dev(dev); |
| 3850 | |
| 3851 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 3852 | errno = wlan_hdd_validate_context(hdd_ctx); |
| 3853 | if (errno) |
| 3854 | return errno; |
| 3855 | |
| 3856 | if (!capable(CAP_NET_ADMIN)) { |
| 3857 | hdd_err("permission check failed"); |
| 3858 | return -EPERM; |
| 3859 | } |
| 3860 | |
| 3861 | /* |
| 3862 | * Since this is GETTER iwpriv ioctl, driver needs to |
| 3863 | * copy SET data from user space to kernel space. |
| 3864 | * Helper function to get iwreq_data with compat handling. |
| 3865 | */ |
| 3866 | if (hdd_priv_get_data(&priv_data, wrqu)) |
| 3867 | return -EINVAL; |
| 3868 | |
| 3869 | /* |
| 3870 | * priv_data.pointer should be pointing to data given |
| 3871 | * to iwpriv command. |
| 3872 | * |
| 3873 | * For example "iwpriv wlan0 get_wlm_stats 1234" |
| 3874 | * |
| 3875 | * priv_data.pointer should be pointing to "1234" |
| 3876 | * priv_data.length should be zero as this GETTER iwpriv ioctl |
| 3877 | */ |
| 3878 | if (!priv_data.pointer) { |
| 3879 | hdd_err("NULL data pointer"); |
| 3880 | return -EINVAL; |
| 3881 | } |
| 3882 | |
| 3883 | /* |
| 3884 | * ideally driver should have used priv_data.length to copy |
| 3885 | * data from priv_data.pointer but this iwpriv IOCTL has been |
| 3886 | * declared as GETTER in nature which makes length field zero |
| 3887 | * for input arguments but priv_data.pointer still points to |
| 3888 | * user's input argument (just doesn't pass the length of the |
| 3889 | * argument) |
| 3890 | */ |
| 3891 | if (copy_from_user(user_data, priv_data.pointer, |
| 3892 | sizeof(user_data) - 1)) { |
| 3893 | hdd_err("failed to copy data from user buffer"); |
| 3894 | return -EFAULT; |
| 3895 | } |
| 3896 | |
| 3897 | /* |
| 3898 | * user data is given in ascii, convert ascii to integer |
| 3899 | */ |
| 3900 | if (kstrtou32(user_data, 0, &bitmask)) { |
| 3901 | hdd_err("failed to parse input %s", user_data); |
| 3902 | return -EFAULT; |
| 3903 | } |
| 3904 | |
| 3905 | if (wlan_get_wlm_stats(adapter, bitmask, extra)) { |
| 3906 | hdd_err("returning failure"); |
| 3907 | return -EFAULT; |
| 3908 | } |
| 3909 | wrqu->data.length = strlen(extra) + 1; |
| 3910 | |
| 3911 | return 0; |
| 3912 | } |
| 3913 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3914 | static int iw_get_wlm_stats(struct net_device *net_dev, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3915 | struct iw_request_info *info, |
| 3916 | union iwreq_data *wrqu, char *extra) |
| 3917 | { |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3918 | struct osif_vdev_sync *vdev_sync; |
| 3919 | int errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3920 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3921 | errno = osif_vdev_sync_op_start(net_dev, &vdev_sync); |
| 3922 | if (errno) |
| 3923 | return errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3924 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3925 | errno = __iw_get_wlm_stats(net_dev, info, wrqu, extra); |
| 3926 | |
| 3927 | osif_vdev_sync_op_stop(vdev_sync); |
| 3928 | |
| 3929 | return errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3930 | } |
| 3931 | #endif /* FEATURE_WLM_STATS */ |
| 3932 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3933 | int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3934 | { |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3935 | struct net_device *net = adapter->dev; |
| 3936 | struct hdd_context *phddctx = WLAN_HDD_GET_CTX(adapter); |
| 3937 | mac_handle_t mac_handle = phddctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3938 | bool band_24 = false, band_5g = false; |
| 3939 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 3940 | struct sme_config_params *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3941 | uint32_t chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3942 | uint8_t vhtchanwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3943 | eCsrPhyMode phymode = -EIO, old_phymode; |
Srinivas Girigowda | 2fb677c | 2017-03-25 15:35:34 -0700 | [diff] [blame] | 3944 | enum hdd_dot11_mode hdd_dot11mode = phddctx->config->dot11Mode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3945 | enum band_info curr_band = BAND_ALL; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3946 | int retval = 0; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3947 | uint8_t band_capability; |
| 3948 | QDF_STATUS status; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3949 | uint32_t channel_bonding_mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3950 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3951 | if (!mac_handle) |
| 3952 | return -EINVAL; |
| 3953 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3954 | old_phymode = sme_get_phy_mode(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3955 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3956 | ucfg_mlme_get_channel_bonding_24ghz(phddctx->psoc, |
| 3957 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3958 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3959 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3960 | ch_bond24 = true; |
| 3961 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3962 | ucfg_mlme_get_channel_bonding_5ghz(phddctx->psoc, |
| 3963 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3964 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3965 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3966 | ch_bond5g = true; |
| 3967 | |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3968 | status = wlan_mlme_get_band_capability(phddctx->psoc, &band_capability); |
| 3969 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3970 | hdd_err("Failed to get MLME Band capability"); |
| 3971 | return -EIO; |
| 3972 | } |
| 3973 | |
| 3974 | if (band_capability == BAND_ALL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3975 | band_24 = band_5g = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3976 | else if (band_capability == BAND_2G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3977 | band_24 = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3978 | else if (band_capability == BAND_5G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3979 | band_5g = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3980 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3981 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, &vhtchanwidth); |
| 3982 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 3983 | hdd_err("Failed to get channel_width"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3984 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3985 | 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] | 3986 | ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth); |
| 3987 | |
| 3988 | switch (new_phymode) { |
| 3989 | case IEEE80211_MODE_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3990 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3991 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3992 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3993 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3994 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3995 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3996 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3997 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3998 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3999 | return -EIO; |
| 4000 | } |
| 4001 | break; |
| 4002 | case IEEE80211_MODE_11A: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4003 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11a); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4004 | 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] | 4005 | phymode = eCSR_DOT11_MODE_11a; |
| 4006 | hdd_dot11mode = eHDD_DOT11_MODE_11a; |
| 4007 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4008 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4009 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4010 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4011 | return -EIO; |
| 4012 | } |
| 4013 | break; |
| 4014 | case IEEE80211_MODE_11B: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4015 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11b); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4016 | 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] | 4017 | phymode = eCSR_DOT11_MODE_11b; |
| 4018 | hdd_dot11mode = eHDD_DOT11_MODE_11b; |
| 4019 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4020 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4021 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4022 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4023 | return -EIO; |
| 4024 | } |
| 4025 | break; |
| 4026 | case IEEE80211_MODE_11G: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4027 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11g); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4028 | 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] | 4029 | phymode = eCSR_DOT11_MODE_11g; |
| 4030 | hdd_dot11mode = eHDD_DOT11_MODE_11g; |
| 4031 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4032 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4033 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4034 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4035 | return -EIO; |
| 4036 | } |
| 4037 | break; |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 4038 | /* 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] | 4039 | * so setting phymode as eCSR_DOT11_MODE_11n and updating the band |
| 4040 | * and channel bonding in configuration to reflect MODE_11NA/MODE_11NG |
| 4041 | */ |
| 4042 | case IEEE80211_MODE_11NA_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4043 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4044 | 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] | 4045 | phymode = eCSR_DOT11_MODE_11n; |
| 4046 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4047 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4048 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4049 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4050 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4051 | return -EIO; |
| 4052 | } |
| 4053 | break; |
| 4054 | case IEEE80211_MODE_11NA_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4055 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4056 | 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] | 4057 | phymode = eCSR_DOT11_MODE_11n; |
| 4058 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4059 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4060 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4061 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4062 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4063 | return -EIO; |
| 4064 | } |
| 4065 | break; |
| 4066 | case IEEE80211_MODE_11NG_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4067 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4068 | 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] | 4069 | phymode = eCSR_DOT11_MODE_11n; |
| 4070 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4071 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4072 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4073 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4074 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4075 | return -EIO; |
| 4076 | } |
| 4077 | break; |
| 4078 | case IEEE80211_MODE_11NG_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4079 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4080 | 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] | 4081 | phymode = eCSR_DOT11_MODE_11n; |
| 4082 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4083 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4084 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4085 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4086 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4087 | return -EIO; |
| 4088 | } |
| 4089 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4090 | case IEEE80211_MODE_11AC_VHT20: |
| 4091 | case IEEE80211_MODE_11AC_VHT40: |
| 4092 | case IEEE80211_MODE_11AC_VHT80: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4093 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11ac); |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 4094 | phymode = eCSR_DOT11_MODE_11ac; |
| 4095 | hdd_dot11mode = eHDD_DOT11_MODE_11ac; |
| 4096 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 4097 | if (band_5g && band_24) { |
| 4098 | curr_band = BAND_ALL; |
| 4099 | break; |
| 4100 | } else if (band_5g) { |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4101 | curr_band = BAND_5G; |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 4102 | break; |
| 4103 | } else if (new_phymode != IEEE80211_MODE_11AC_VHT80) { |
| 4104 | curr_band = BAND_2G; |
| 4105 | break; |
| 4106 | } |
| 4107 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
| 4108 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4109 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4110 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4111 | return -EIO; |
| 4112 | } |
| 4113 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4114 | case IEEE80211_MODE_2G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4115 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4116 | 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] | 4117 | phymode = eCSR_DOT11_MODE_AUTO; |
| 4118 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 4119 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4120 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4121 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4122 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4123 | return -EIO; |
| 4124 | } |
| 4125 | break; |
| 4126 | case IEEE80211_MODE_5G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4127 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4128 | 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] | 4129 | phymode = eCSR_DOT11_MODE_AUTO; |
| 4130 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 4131 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 4132 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4133 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4134 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4135 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4136 | return -EIO; |
| 4137 | } |
| 4138 | break; |
| 4139 | case IEEE80211_MODE_11AGN: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4140 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4141 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4142 | phymode = eCSR_DOT11_MODE_11n; |
| 4143 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4144 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4145 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4146 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4147 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4148 | return -EIO; |
| 4149 | } |
| 4150 | break; |
| 4151 | default: |
| 4152 | return -EIO; |
| 4153 | } |
| 4154 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4155 | switch (new_phymode) { |
| 4156 | case IEEE80211_MODE_11AC_VHT20: |
| 4157 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4158 | vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 4159 | break; |
| 4160 | case IEEE80211_MODE_11AC_VHT40: |
| 4161 | vhtchanwidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 4162 | break; |
| 4163 | case IEEE80211_MODE_11AC_VHT80: |
| 4164 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 4165 | break; |
| 4166 | default: |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4167 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, |
| 4168 | &vhtchanwidth); |
| 4169 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 4170 | hdd_err("Failed to get channel_width"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4171 | break; |
| 4172 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4173 | |
| 4174 | if (phymode != -EIO) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4175 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4176 | if (!sme_config) { |
| 4177 | hdd_err("Failed to allocate memory for sme_config"); |
| 4178 | return -ENOMEM; |
| 4179 | } |
| 4180 | qdf_mem_zero(sme_config, sizeof(*sme_config)); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4181 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4182 | sme_config->csrConfig.phyMode = phymode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4183 | #ifdef QCA_HT_2040_COEX |
| 4184 | if (phymode == eCSR_DOT11_MODE_11n && |
| 4185 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4186 | sme_config->csrConfig.obssEnabled = false; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4187 | status = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4188 | adapter->vdev_id, |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4189 | eHT_CHAN_HT20, false); |
| 4190 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4191 | hdd_err("Failed to disable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4192 | retval = -EIO; |
| 4193 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4194 | } |
| 4195 | } else if (phymode == eCSR_DOT11_MODE_11n && |
| 4196 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4197 | sme_config->csrConfig.obssEnabled = true; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4198 | status = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4199 | adapter->vdev_id, |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4200 | eHT_CHAN_HT20, true); |
| 4201 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4202 | hdd_err("Failed to enable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4203 | retval = -EIO; |
| 4204 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4205 | } |
| 4206 | } |
| 4207 | #endif |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 4208 | status = ucfg_mlme_set_band_capability(phddctx->psoc, |
| 4209 | curr_band); |
| 4210 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4211 | hdd_err("failed to set MLME band capability"); |
| 4212 | goto free; |
| 4213 | } |
| 4214 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4215 | if (curr_band == BAND_2G) { |
| 4216 | status = ucfg_mlme_set_11h_enabled(phddctx->psoc, 0); |
| 4217 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 4218 | hdd_err("Failed to set 11h_enable flag"); |
| 4219 | goto free; |
| 4220 | } |
| 4221 | } |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4222 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4223 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
Jeff Johnson | 3d72577 | 2018-04-28 17:20:56 -0700 | [diff] [blame] | 4224 | else if (curr_band == BAND_5G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4225 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4226 | else { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4227 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
| 4228 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4229 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4230 | sme_update_config(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4231 | |
| 4232 | phddctx->config->dot11Mode = hdd_dot11mode; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4233 | ucfg_mlme_set_channel_bonding_24ghz( |
| 4234 | phddctx->psoc, |
| 4235 | sme_config->csrConfig.channelBondingMode24GHz); |
| 4236 | ucfg_mlme_set_channel_bonding_5ghz( |
| 4237 | phddctx->psoc, |
| 4238 | sme_config->csrConfig.channelBondingMode5GHz); |
Krunal Soni | df0f874 | 2016-09-26 14:56:31 -0700 | [diff] [blame] | 4239 | if (hdd_update_config_cfg(phddctx) == false) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4240 | hdd_err("could not update config_dat"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4241 | retval = -EIO; |
| 4242 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4243 | } |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4244 | |
| 4245 | if (band_5g) { |
| 4246 | struct ieee80211_supported_band *band; |
| 4247 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4248 | ucfg_mlme_get_channel_bonding_5ghz( |
| 4249 | phddctx->psoc, &channel_bonding_mode); |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4250 | band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4251 | if (channel_bonding_mode) |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4252 | band->ht_cap.cap |= |
| 4253 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4254 | else |
| 4255 | band->ht_cap.cap &= |
| 4256 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4257 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4258 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4259 | 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] | 4260 | phymode, chwidth, curr_band, vhtchanwidth); |
| 4261 | } |
| 4262 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4263 | free: |
| 4264 | if (sme_config) |
| 4265 | qdf_mem_free(sme_config); |
| 4266 | return retval; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4267 | } |
| 4268 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4269 | static int hdd_validate_pdev_reset(int value) |
| 4270 | { |
| 4271 | if ((value < 1) || (value > 5)) { |
| 4272 | hdd_warn(" Invalid value %d: Use any one of the below values\n" |
| 4273 | " TX_FLUSH = 1\n" |
| 4274 | " WARM_RESET = 2\n" |
| 4275 | " COLD_RESET = 3\n" |
| 4276 | " WARM_RESET_RESTORE_CAL = 4\n" |
| 4277 | " COLD_RESET_RESTORE_CAL = 5", value); |
| 4278 | |
| 4279 | return -EINVAL; |
| 4280 | } |
| 4281 | |
| 4282 | return 0; |
| 4283 | } |
| 4284 | |
| 4285 | static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value) |
| 4286 | { |
| 4287 | int ret; |
| 4288 | |
| 4289 | hdd_debug("%d", value); |
| 4290 | |
| 4291 | ret = hdd_validate_pdev_reset(value); |
| 4292 | if (ret) |
| 4293 | return ret; |
| 4294 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4295 | ret = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4296 | WMI_PDEV_PARAM_PDEV_RESET, |
| 4297 | value, PDEV_CMD); |
| 4298 | |
| 4299 | return ret; |
| 4300 | } |
| 4301 | |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4302 | static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width) |
| 4303 | { |
| 4304 | int errno; |
| 4305 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4306 | uint32_t bonding_mode; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 4307 | struct sme_config_params *sme_config; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4308 | mac_handle_t mac_handle; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4309 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4310 | mac_handle = hdd_ctx->mac_handle; |
| 4311 | if (!mac_handle) |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4312 | return -EINVAL; |
| 4313 | |
| 4314 | /* updating channel bonding only on 5Ghz */ |
| 4315 | hdd_debug("WMI_VDEV_PARAM_CHWIDTH val %d", ch_width); |
| 4316 | |
| 4317 | switch (ch_width) { |
| 4318 | case eHT_CHANNEL_WIDTH_20MHZ: |
| 4319 | bonding_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4320 | break; |
| 4321 | |
| 4322 | case eHT_CHANNEL_WIDTH_40MHZ: |
| 4323 | case eHT_CHANNEL_WIDTH_80MHZ: |
Kiran Kumar Lokere | 9df090b | 2019-02-07 18:48:22 -0800 | [diff] [blame] | 4324 | bonding_mode = 1; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4325 | break; |
| 4326 | |
| 4327 | default: |
| 4328 | hdd_err("Invalid channel width 0->20 1->40 2->80"); |
| 4329 | return -EINVAL; |
| 4330 | } |
| 4331 | |
| 4332 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4333 | if (!sme_config) { |
| 4334 | hdd_err("failed to allocate memory for sme_config"); |
| 4335 | return -ENOMEM; |
| 4336 | } |
| 4337 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4338 | errno = wma_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_CHWIDTH, |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4339 | ch_width, VDEV_CMD); |
| 4340 | if (errno) |
| 4341 | goto free_config; |
| 4342 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4343 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4344 | sme_config->csrConfig.channelBondingMode5GHz = bonding_mode; |
Kiran Kumar Lokere | 9df090b | 2019-02-07 18:48:22 -0800 | [diff] [blame] | 4345 | sme_config->csrConfig.channelBondingMode24GHz = bonding_mode; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4346 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4347 | |
| 4348 | free_config: |
| 4349 | qdf_mem_free(sme_config); |
| 4350 | |
| 4351 | return errno; |
| 4352 | } |
| 4353 | |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4354 | 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] | 4355 | { |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4356 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4357 | bool enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4358 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4359 | QDF_STATUS status; |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4360 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4361 | if (!mac_handle) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4362 | return -EINVAL; |
| 4363 | |
| 4364 | switch (state_11d) { |
| 4365 | case ENABLE_11D: |
| 4366 | enable_11d = true; |
| 4367 | break; |
| 4368 | case DISABLE_11D: |
| 4369 | enable_11d = false; |
| 4370 | break; |
| 4371 | default: |
| 4372 | return -EINVAL; |
| 4373 | } |
| 4374 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4375 | status = ucfg_mlme_set_11d_enabled(hdd_ctx->psoc, enable_11d); |
| 4376 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 4377 | hdd_err("Invalid 11d_enable flag"); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4378 | |
Dustin Brown | ea82d56 | 2018-05-23 12:07:16 -0700 | [diff] [blame] | 4379 | hdd_debug("11D state=%d", enable_11d); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4380 | |
| 4381 | return 0; |
| 4382 | } |
| 4383 | |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4384 | static int hdd_we_set_power(struct hdd_adapter *adapter, int value) |
| 4385 | { |
| 4386 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4387 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4388 | |
| 4389 | if (!mac_handle) |
| 4390 | return -EINVAL; |
| 4391 | |
| 4392 | switch (value) { |
| 4393 | case 1: |
| 4394 | /* Enable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4395 | sme_save_usr_ps_cfg(mac_handle, true); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4396 | sme_ps_enable_disable(mac_handle, adapter->vdev_id, |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4397 | SME_PS_ENABLE); |
| 4398 | return 0; |
| 4399 | case 2: |
| 4400 | /* Disable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4401 | sme_save_usr_ps_cfg(mac_handle, false); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4402 | sme_ps_enable_disable(mac_handle, adapter->vdev_id, |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4403 | SME_PS_DISABLE); |
| 4404 | return 0; |
| 4405 | case 3: |
| 4406 | /* Enable UASPD */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4407 | sme_ps_uapsd_enable(mac_handle, adapter->vdev_id); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4408 | return 0; |
| 4409 | case 4: |
| 4410 | /* Disable UASPD */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4411 | sme_ps_uapsd_disable(mac_handle, adapter->vdev_id); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4412 | return 0; |
| 4413 | default: |
| 4414 | hdd_err("Invalid value %d", value); |
| 4415 | return -EINVAL; |
| 4416 | } |
| 4417 | } |
| 4418 | |
Jeff Johnson | eb4368a | 2018-10-19 13:02:52 -0700 | [diff] [blame] | 4419 | static int hdd_we_set_max_assoc(struct hdd_adapter *adapter, int value) |
| 4420 | { |
| 4421 | struct hdd_context *hdd_ctx; |
| 4422 | QDF_STATUS status; |
| 4423 | |
| 4424 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4425 | status = ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, value); |
| 4426 | if (QDF_IS_STATUS_ERROR(status)) |
| 4427 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4428 | |
| 4429 | return qdf_status_to_os_return(status); |
| 4430 | } |
| 4431 | |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4432 | static int hdd_we_set_data_inactivity_timeout(struct hdd_adapter *adapter, |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4433 | int inactivity_timeout) |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4434 | { |
| 4435 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4436 | QDF_STATUS status; |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4437 | |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4438 | status = ucfg_mlme_set_ps_data_inactivity_timeout(hdd_ctx->psoc, |
| 4439 | inactivity_timeout); |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4440 | |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4441 | return qdf_status_to_os_return(status); |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4442 | } |
| 4443 | |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4444 | static int hdd_we_set_wow_data_inactivity_timeout(struct hdd_adapter *adapter, |
| 4445 | int value) |
| 4446 | { |
| 4447 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4448 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4449 | |
| 4450 | if (!mac_handle) |
| 4451 | return -EINVAL; |
| 4452 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4453 | if (!cfg_in_range(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT, value)) { |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4454 | hdd_err_rl("Invalid value %d", value); |
| 4455 | return -EINVAL; |
| 4456 | } |
| 4457 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4458 | 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] | 4459 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4460 | return 0; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4461 | } |
| 4462 | |
Jeff Johnson | 5d4a6d1 | 2018-10-19 13:23:28 -0700 | [diff] [blame] | 4463 | static int hdd_we_set_tx_power(struct hdd_adapter *adapter, int value) |
| 4464 | { |
| 4465 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4466 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4467 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4468 | QDF_STATUS status; |
| 4469 | |
| 4470 | if (!mac_handle) |
| 4471 | return -EINVAL; |
| 4472 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4473 | status = sme_set_tx_power(mac_handle, adapter->vdev_id, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 4474 | sta_ctx->conn_info.bssid, |
Jeff Johnson | 5d4a6d1 | 2018-10-19 13:23:28 -0700 | [diff] [blame] | 4475 | adapter->device_mode, value); |
| 4476 | |
| 4477 | if (QDF_IS_STATUS_ERROR(status)) |
| 4478 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4479 | |
| 4480 | return qdf_status_to_os_return(status); |
| 4481 | } |
| 4482 | |
Jeff Johnson | 5e15ef5 | 2018-10-19 15:29:56 -0700 | [diff] [blame] | 4483 | static int hdd_we_set_max_tx_power(struct hdd_adapter *adapter, int value) |
| 4484 | { |
| 4485 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4486 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4487 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4488 | QDF_STATUS status; |
| 4489 | |
| 4490 | if (!mac_handle) |
| 4491 | return -EINVAL; |
| 4492 | |
| 4493 | status = sme_set_max_tx_power(mac_handle, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 4494 | sta_ctx->conn_info.bssid, |
| 4495 | sta_ctx->conn_info.bssid, |
Jeff Johnson | 5e15ef5 | 2018-10-19 15:29:56 -0700 | [diff] [blame] | 4496 | value); |
| 4497 | |
| 4498 | if (QDF_IS_STATUS_ERROR(status)) |
| 4499 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4500 | |
| 4501 | return qdf_status_to_os_return(status); |
| 4502 | } |
| 4503 | |
Jeff Johnson | f3892b5 | 2018-10-23 11:32:04 -0700 | [diff] [blame] | 4504 | static int hdd_we_set_max_tx_power_2_4(struct hdd_adapter *adapter, int power) |
| 4505 | { |
| 4506 | QDF_STATUS status; |
| 4507 | |
| 4508 | hdd_debug("power %d dBm", power); |
| 4509 | status = sme_set_max_tx_power_per_band(BAND_2G, power); |
| 4510 | if (QDF_IS_STATUS_ERROR(status)) |
| 4511 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4512 | |
| 4513 | return qdf_status_to_os_return(status); |
| 4514 | } |
| 4515 | |
Jeff Johnson | 175004c | 2018-10-23 12:03:16 -0700 | [diff] [blame] | 4516 | static int hdd_we_set_max_tx_power_5_0(struct hdd_adapter *adapter, int power) |
| 4517 | { |
| 4518 | QDF_STATUS status; |
| 4519 | |
| 4520 | hdd_debug("power %d dBm", power); |
| 4521 | status = sme_set_max_tx_power_per_band(BAND_5G, power); |
| 4522 | if (QDF_IS_STATUS_ERROR(status)) |
| 4523 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4524 | |
| 4525 | return qdf_status_to_os_return(status); |
| 4526 | } |
| 4527 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 4528 | #ifdef HASTINGS_BT_WAR |
| 4529 | |
| 4530 | /* |
| 4531 | * replicate logic: |
| 4532 | * iwpriv wlan0 setUnitTestCmd 19 2 23 1 => enable WAR |
| 4533 | * iwpriv wlan0 setUnitTestCmd 19 2 23 0 => disable WAR |
| 4534 | */ |
| 4535 | |
| 4536 | #define HASTINGS_WAR_FW_PARAM_ID 23 |
| 4537 | |
| 4538 | static int hdd_hastings_bt_war_set_fw(struct hdd_context *hdd_ctx, |
| 4539 | uint32_t value) |
| 4540 | { |
| 4541 | uint32_t vdev_id = 0; /* not used */ |
| 4542 | uint32_t module_id = WLAN_MODULE_WAL; |
| 4543 | uint32_t arg_count = 2; |
| 4544 | uint32_t arg[2] = {HASTINGS_WAR_FW_PARAM_ID, value}; |
| 4545 | QDF_STATUS status; |
| 4546 | |
| 4547 | status = wma_form_unit_test_cmd_and_send(vdev_id, module_id, |
| 4548 | arg_count, arg); |
| 4549 | |
| 4550 | return qdf_status_to_os_return(status); |
| 4551 | } |
| 4552 | |
| 4553 | int hdd_hastings_bt_war_enable_fw(struct hdd_context *hdd_ctx) |
| 4554 | { |
| 4555 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 1); |
| 4556 | } |
| 4557 | |
| 4558 | int hdd_hastings_bt_war_disable_fw(struct hdd_context *hdd_ctx) |
| 4559 | { |
| 4560 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 0); |
| 4561 | } |
| 4562 | |
| 4563 | /* value to restore the config when the WAR is disabled */ |
| 4564 | static uint32_t iface_change_wait_time_checkpoint; |
| 4565 | static void checkpoint_iface_change_wait_time(struct hdd_context *hdd_ctx) |
| 4566 | { |
| 4567 | struct hdd_config *config = hdd_ctx->config; |
| 4568 | |
| 4569 | /* did we already checkpoint a value ? */ |
| 4570 | if (iface_change_wait_time_checkpoint) |
| 4571 | return; |
| 4572 | |
| 4573 | /* checkpoint current value */ |
| 4574 | iface_change_wait_time_checkpoint = config->iface_change_wait_time; |
| 4575 | |
| 4576 | /* was the timer enabled when we checkpointed? */ |
| 4577 | if (iface_change_wait_time_checkpoint) |
| 4578 | return; |
| 4579 | |
| 4580 | /* WAR was enabled at boot, use default when disable */ |
| 4581 | iface_change_wait_time_checkpoint = |
| 4582 | cfg_default(CFG_INTERFACE_CHANGE_WAIT); |
| 4583 | } |
| 4584 | |
| 4585 | static int hdd_hastings_war_enable(struct hdd_context *hdd_ctx) |
| 4586 | { |
| 4587 | struct hdd_config *config = hdd_ctx->config; |
| 4588 | |
| 4589 | config->iface_change_wait_time = 0; |
| 4590 | |
| 4591 | return hdd_hastings_bt_war_enable_fw(hdd_ctx); |
| 4592 | } |
| 4593 | |
| 4594 | static int hdd_hastings_war_disable(struct hdd_context *hdd_ctx) |
| 4595 | { |
| 4596 | struct hdd_config *config = hdd_ctx->config; |
| 4597 | |
| 4598 | config->iface_change_wait_time = iface_change_wait_time_checkpoint; |
| 4599 | |
| 4600 | return hdd_hastings_bt_war_disable_fw(hdd_ctx); |
| 4601 | } |
| 4602 | |
| 4603 | static int hdd_we_set_hastings_bt_war(struct hdd_adapter *adapter, int enable) |
| 4604 | { |
| 4605 | int errno; |
| 4606 | struct hdd_context *hdd_ctx; |
| 4607 | |
| 4608 | errno = hdd_validate_adapter(adapter); |
| 4609 | if (errno) |
| 4610 | return errno; |
| 4611 | |
| 4612 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4613 | checkpoint_iface_change_wait_time(hdd_ctx); |
| 4614 | |
| 4615 | return enable ? |
| 4616 | hdd_hastings_war_enable(hdd_ctx) : |
| 4617 | hdd_hastings_war_disable(hdd_ctx); |
| 4618 | } |
| 4619 | #endif |
| 4620 | |
Jeff Johnson | 5bee39b | 2018-10-23 12:34:38 -0700 | [diff] [blame] | 4621 | static int hdd_we_set_tm_level(struct hdd_adapter *adapter, int level) |
| 4622 | { |
| 4623 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4624 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4625 | QDF_STATUS status; |
| 4626 | |
| 4627 | if (!mac_handle) |
| 4628 | return -EINVAL; |
| 4629 | |
| 4630 | hdd_debug("Thermal Mitigation Level %d", level); |
| 4631 | status = sme_set_thermal_level(mac_handle, level); |
| 4632 | if (QDF_IS_STATUS_ERROR(status)) |
| 4633 | hdd_err("cfg set failed, value %d status %d", level, status); |
| 4634 | |
| 4635 | return qdf_status_to_os_return(status); |
| 4636 | } |
| 4637 | |
Jeff Johnson | 3891264 | 2018-10-24 15:01:40 -0700 | [diff] [blame] | 4638 | static int hdd_we_set_nss(struct hdd_adapter *adapter, int nss) |
| 4639 | { |
| 4640 | QDF_STATUS status; |
| 4641 | |
| 4642 | hdd_debug("NSS %d", nss); |
| 4643 | |
| 4644 | if ((nss > 2) || (nss <= 0)) { |
| 4645 | hdd_err("Invalid NSS: %d", nss); |
| 4646 | return -EINVAL; |
| 4647 | } |
| 4648 | |
| 4649 | status = hdd_update_nss(adapter, nss); |
| 4650 | if (QDF_IS_STATUS_ERROR(status)) |
| 4651 | hdd_err("cfg set failed, value %d status %d", nss, status); |
| 4652 | |
| 4653 | return qdf_status_to_os_return(status); |
| 4654 | } |
| 4655 | |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4656 | static int hdd_we_set_short_gi(struct hdd_adapter *adapter, int sgi) |
| 4657 | { |
| 4658 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
| 4659 | int errno; |
| 4660 | |
| 4661 | hdd_debug("Short GI %d", sgi); |
| 4662 | |
| 4663 | if (!mac_handle) { |
| 4664 | hdd_err("NULL Mac handle"); |
| 4665 | return -EINVAL; |
| 4666 | } |
| 4667 | |
| 4668 | if (sgi & HDD_AUTO_RATE_SGI) |
| 4669 | errno = sme_set_auto_rate_he_sgi(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4670 | adapter->vdev_id, |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4671 | sgi); |
| 4672 | else |
| 4673 | errno = sme_update_ht_config(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4674 | adapter->vdev_id, |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4675 | WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, |
| 4676 | sgi); |
| 4677 | if (errno) |
| 4678 | hdd_err("cfg set failed, value %d status %d", sgi, errno); |
| 4679 | |
| 4680 | return errno; |
| 4681 | } |
| 4682 | |
Jeff Johnson | 71d8038 | 2018-10-25 15:45:01 -0700 | [diff] [blame] | 4683 | static int hdd_we_set_rtscts(struct hdd_adapter *adapter, int rtscts) |
| 4684 | { |
| 4685 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4686 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4687 | uint32_t value; |
| 4688 | uint32_t rts_threshold_val; |
| 4689 | QDF_STATUS status; |
| 4690 | int errno; |
| 4691 | |
| 4692 | hdd_debug("RTSCTS %d", rtscts); |
| 4693 | |
| 4694 | if (!mac_handle) { |
| 4695 | hdd_err("NULL Mac handle"); |
| 4696 | return -EINVAL; |
| 4697 | } |
| 4698 | |
| 4699 | status = ucfg_mlme_get_rts_threshold(hdd_ctx->psoc, |
| 4700 | &rts_threshold_val); |
| 4701 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4702 | hdd_err("Get rts threshold failed, status %d", status); |
| 4703 | return -EINVAL; |
| 4704 | } |
| 4705 | |
| 4706 | if ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_RTSCTS_ENABLE) { |
| 4707 | value = rts_threshold_val; |
| 4708 | } else if (((rtscts & HDD_RTSCTS_EN_MASK) == 0) || |
| 4709 | ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_CTS_ENABLE)) { |
| 4710 | value = cfg_max(CFG_RTS_THRESHOLD); |
| 4711 | } else { |
| 4712 | hdd_err_rl("Invalid value %d", rtscts); |
| 4713 | return -EINVAL; |
| 4714 | } |
| 4715 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4716 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 71d8038 | 2018-10-25 15:45:01 -0700 | [diff] [blame] | 4717 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 4718 | rtscts, VDEV_CMD); |
| 4719 | if (errno) { |
| 4720 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4721 | return errno; |
| 4722 | } |
| 4723 | |
| 4724 | status = ucfg_mlme_set_rts_threshold(hdd_ctx->psoc, value); |
| 4725 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4726 | hdd_err("Set rts threshold failed, status %d", status); |
| 4727 | return -EINVAL; |
| 4728 | } |
| 4729 | |
| 4730 | return 0; |
| 4731 | } |
| 4732 | |
Jeff Johnson | 50b1588 | 2018-10-26 10:27:37 -0700 | [diff] [blame] | 4733 | static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code) |
| 4734 | { |
| 4735 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4736 | int errno; |
| 4737 | |
| 4738 | hdd_debug("Rate code %d", rate_code); |
| 4739 | |
| 4740 | if (rate_code != 0xff) { |
| 4741 | rix = RC_2_RATE_IDX(rate_code); |
| 4742 | if (rate_code & 0x80) { |
| 4743 | preamble = WMI_RATE_PREAMBLE_HT; |
| 4744 | nss = HT_RC_2_STREAMS(rate_code) - 1; |
| 4745 | } else { |
| 4746 | nss = 0; |
| 4747 | rix = RC_2_RATE_IDX(rate_code); |
| 4748 | if (rate_code & 0x10) { |
| 4749 | preamble = WMI_RATE_PREAMBLE_CCK; |
| 4750 | if (rix != 0x3) |
| 4751 | /* Enable Short preamble |
| 4752 | * always for CCK except 1mbps |
| 4753 | */ |
| 4754 | rix |= 0x4; |
| 4755 | } else { |
| 4756 | preamble = WMI_RATE_PREAMBLE_OFDM; |
| 4757 | } |
| 4758 | } |
| 4759 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4760 | } |
| 4761 | |
| 4762 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4763 | rate_code, rix, preamble, nss); |
| 4764 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4765 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 50b1588 | 2018-10-26 10:27:37 -0700 | [diff] [blame] | 4766 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4767 | rate_code, VDEV_CMD); |
| 4768 | if (errno) |
| 4769 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4770 | |
| 4771 | return errno; |
| 4772 | } |
| 4773 | |
Jeff Johnson | bd2c991 | 2018-10-26 12:34:36 -0700 | [diff] [blame] | 4774 | static int hdd_we_set_vht_rate(struct hdd_adapter *adapter, int rate_code) |
| 4775 | { |
| 4776 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4777 | int errno; |
| 4778 | |
| 4779 | hdd_debug("Rate code %d", rate_code); |
| 4780 | |
| 4781 | if (rate_code != 0xff) { |
| 4782 | rix = RC_2_RATE_IDX_11AC(rate_code); |
| 4783 | preamble = WMI_RATE_PREAMBLE_VHT; |
| 4784 | nss = HT_RC_2_STREAMS_11AC(rate_code) - 1; |
| 4785 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4786 | } |
| 4787 | |
| 4788 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4789 | rate_code, rix, preamble, nss); |
| 4790 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4791 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | bd2c991 | 2018-10-26 12:34:36 -0700 | [diff] [blame] | 4792 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4793 | rate_code, VDEV_CMD); |
| 4794 | if (errno) |
| 4795 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4796 | |
| 4797 | return errno; |
| 4798 | } |
| 4799 | |
Jeff Johnson | 7c43350 | 2018-11-12 15:00:52 -0800 | [diff] [blame] | 4800 | static int hdd_we_set_ampdu(struct hdd_adapter *adapter, int ampdu) |
| 4801 | { |
| 4802 | hdd_debug("AMPDU %d", ampdu); |
| 4803 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4804 | return wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 7c43350 | 2018-11-12 15:00:52 -0800 | [diff] [blame] | 4805 | GEN_VDEV_PARAM_AMPDU, |
| 4806 | ampdu, GEN_CMD); |
| 4807 | } |
| 4808 | |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4809 | static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) |
| 4810 | { |
| 4811 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4812 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4813 | int errno; |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4814 | QDF_STATUS status; |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4815 | |
| 4816 | hdd_debug("AMSDU %d", amsdu); |
| 4817 | |
| 4818 | if (!mac_handle) { |
| 4819 | hdd_err("NULL Mac handle"); |
| 4820 | return -EINVAL; |
| 4821 | } |
| 4822 | |
| 4823 | if (amsdu > 1) |
| 4824 | sme_set_amsdu(mac_handle, true); |
| 4825 | else |
| 4826 | sme_set_amsdu(mac_handle, false); |
| 4827 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4828 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4829 | GEN_VDEV_PARAM_AMSDU, |
| 4830 | amsdu, GEN_CMD); |
| 4831 | if (errno) { |
| 4832 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4833 | return errno; |
| 4834 | } |
| 4835 | |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4836 | status = ucfg_mlme_set_max_amsdu_num(hdd_ctx->psoc, |
| 4837 | amsdu); |
| 4838 | if (QDF_IS_STATUS_ERROR(status)) |
| 4839 | hdd_err("Failed to set Max AMSDU Num to cfg"); |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4840 | |
| 4841 | return 0; |
| 4842 | } |
| 4843 | |
Jeff Johnson | cb598fd | 2018-10-29 10:09:07 -0700 | [diff] [blame] | 4844 | static int hdd_we_clear_stats(struct hdd_adapter *adapter, int option) |
| 4845 | { |
| 4846 | hdd_debug("option %d", option); |
| 4847 | |
| 4848 | switch (option) { |
| 4849 | case CDP_HDD_STATS: |
| 4850 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
| 4851 | memset(&adapter->hdd_stats, 0, sizeof(adapter->hdd_stats)); |
| 4852 | break; |
| 4853 | case CDP_TXRX_HIST_STATS: |
| 4854 | wlan_hdd_clear_tx_rx_histogram(adapter->hdd_ctx); |
| 4855 | break; |
| 4856 | case CDP_HDD_NETIF_OPER_HISTORY: |
| 4857 | wlan_hdd_clear_netif_queue_history(adapter->hdd_ctx); |
| 4858 | break; |
| 4859 | case CDP_HIF_STATS: |
| 4860 | hdd_clear_hif_stats(); |
| 4861 | break; |
| 4862 | case CDP_NAPI_STATS: |
| 4863 | hdd_clear_napi_stats(); |
| 4864 | break; |
| 4865 | default: |
| 4866 | cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 4867 | option); |
| 4868 | } |
| 4869 | |
| 4870 | return 0; |
| 4871 | } |
| 4872 | |
Jeff Johnson | 1a05fda | 2018-11-01 07:53:00 -0700 | [diff] [blame] | 4873 | static int hdd_we_set_green_tx_param(struct hdd_adapter *adapter, |
| 4874 | green_tx_param id, |
| 4875 | const char *id_string, |
| 4876 | int value) |
| 4877 | { |
| 4878 | int errno; |
| 4879 | |
| 4880 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4881 | errno = wma_cli_set_command(adapter->vdev_id, id, value, GTX_CMD); |
Jeff Johnson | 1a05fda | 2018-11-01 07:53:00 -0700 | [diff] [blame] | 4882 | if (errno) |
| 4883 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4884 | |
| 4885 | return errno; |
| 4886 | } |
| 4887 | |
| 4888 | #define hdd_we_set_green_tx_param(adapter, id, value) \ |
| 4889 | hdd_we_set_green_tx_param(adapter, id, #id, value) |
| 4890 | |
| 4891 | static int hdd_we_set_gtx_ht_mcs(struct hdd_adapter *adapter, int value) |
| 4892 | { |
| 4893 | return hdd_we_set_green_tx_param(adapter, |
| 4894 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 4895 | value); |
| 4896 | } |
| 4897 | |
| 4898 | static int hdd_we_set_gtx_vht_mcs(struct hdd_adapter *adapter, int value) |
| 4899 | { |
| 4900 | return hdd_we_set_green_tx_param(adapter, |
| 4901 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 4902 | value); |
| 4903 | } |
| 4904 | |
| 4905 | static int hdd_we_set_gtx_usrcfg(struct hdd_adapter *adapter, int value) |
| 4906 | { |
| 4907 | return hdd_we_set_green_tx_param(adapter, |
| 4908 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 4909 | value); |
| 4910 | } |
| 4911 | |
| 4912 | static int hdd_we_set_gtx_thre(struct hdd_adapter *adapter, int value) |
| 4913 | { |
| 4914 | return hdd_we_set_green_tx_param(adapter, |
| 4915 | WMI_VDEV_PARAM_GTX_THRE, |
| 4916 | value); |
| 4917 | } |
| 4918 | |
| 4919 | static int hdd_we_set_gtx_margin(struct hdd_adapter *adapter, int value) |
| 4920 | { |
| 4921 | return hdd_we_set_green_tx_param(adapter, |
| 4922 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 4923 | value); |
| 4924 | } |
| 4925 | |
| 4926 | static int hdd_we_set_gtx_step(struct hdd_adapter *adapter, int value) |
| 4927 | { |
| 4928 | return hdd_we_set_green_tx_param(adapter, |
| 4929 | WMI_VDEV_PARAM_GTX_STEP, |
| 4930 | value); |
| 4931 | } |
| 4932 | |
| 4933 | static int hdd_we_set_gtx_mintpc(struct hdd_adapter *adapter, int value) |
| 4934 | { |
| 4935 | return hdd_we_set_green_tx_param(adapter, |
| 4936 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 4937 | value); |
| 4938 | } |
| 4939 | |
| 4940 | static int hdd_we_set_gtx_bwmask(struct hdd_adapter *adapter, int value) |
| 4941 | { |
| 4942 | return hdd_we_set_green_tx_param(adapter, |
| 4943 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 4944 | value); |
| 4945 | } |
| 4946 | |
Jeff Johnson | d0477f2 | 2018-10-29 12:26:25 -0700 | [diff] [blame] | 4947 | static int hdd_we_packet_power_save(struct hdd_adapter *adapter, |
| 4948 | packet_power_save id, |
| 4949 | const char *id_string, |
| 4950 | int value) |
| 4951 | { |
| 4952 | int errno; |
| 4953 | |
| 4954 | if (adapter->device_mode != QDF_STA_MODE) { |
| 4955 | hdd_err_rl("Not supported in mode %d", adapter->device_mode); |
| 4956 | return -EINVAL; |
| 4957 | } |
| 4958 | |
| 4959 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4960 | errno = wma_cli_set_command(adapter->vdev_id, id, value, PPS_CMD); |
Jeff Johnson | d0477f2 | 2018-10-29 12:26:25 -0700 | [diff] [blame] | 4961 | if (errno) |
| 4962 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4963 | |
| 4964 | return errno; |
| 4965 | } |
| 4966 | |
| 4967 | #define hdd_we_packet_power_save(adapter, id, value) \ |
| 4968 | hdd_we_packet_power_save(adapter, id, #id, value) |
| 4969 | |
| 4970 | static int hdd_we_pps_paid_match(struct hdd_adapter *adapter, int value) |
| 4971 | { |
| 4972 | return hdd_we_packet_power_save(adapter, |
| 4973 | WMI_VDEV_PPS_PAID_MATCH, |
| 4974 | value); |
| 4975 | } |
| 4976 | |
| 4977 | static int hdd_we_pps_gid_match(struct hdd_adapter *adapter, int value) |
| 4978 | { |
| 4979 | return hdd_we_packet_power_save(adapter, |
| 4980 | WMI_VDEV_PPS_GID_MATCH, |
| 4981 | value); |
| 4982 | } |
| 4983 | |
| 4984 | static int hdd_we_pps_early_tim_clear(struct hdd_adapter *adapter, int value) |
| 4985 | { |
| 4986 | return hdd_we_packet_power_save(adapter, |
| 4987 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 4988 | value); |
| 4989 | } |
| 4990 | |
| 4991 | static int hdd_we_pps_early_dtim_clear(struct hdd_adapter *adapter, int value) |
| 4992 | { |
| 4993 | return hdd_we_packet_power_save(adapter, |
| 4994 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 4995 | value); |
| 4996 | } |
| 4997 | |
| 4998 | static int hdd_we_pps_eof_pad_delim(struct hdd_adapter *adapter, int value) |
| 4999 | { |
| 5000 | return hdd_we_packet_power_save(adapter, |
| 5001 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 5002 | value); |
| 5003 | } |
| 5004 | |
| 5005 | static int hdd_we_pps_macaddr_mismatch(struct hdd_adapter *adapter, int value) |
| 5006 | { |
| 5007 | return hdd_we_packet_power_save(adapter, |
| 5008 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 5009 | value); |
| 5010 | } |
| 5011 | |
| 5012 | static int hdd_we_pps_delim_crc_fail(struct hdd_adapter *adapter, int value) |
| 5013 | { |
| 5014 | return hdd_we_packet_power_save(adapter, |
| 5015 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 5016 | value); |
| 5017 | } |
| 5018 | |
| 5019 | static int hdd_we_pps_gid_nsts_zero(struct hdd_adapter *adapter, int value) |
| 5020 | { |
| 5021 | return hdd_we_packet_power_save(adapter, |
| 5022 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 5023 | value); |
| 5024 | } |
| 5025 | |
| 5026 | static int hdd_we_pps_rssi_check(struct hdd_adapter *adapter, int value) |
| 5027 | { |
| 5028 | return hdd_we_packet_power_save(adapter, |
| 5029 | WMI_VDEV_PPS_RSSI_CHECK, |
| 5030 | value); |
| 5031 | } |
| 5032 | |
| 5033 | static int hdd_we_pps_5g_ebt(struct hdd_adapter *adapter, int value) |
| 5034 | { |
| 5035 | return hdd_we_packet_power_save(adapter, |
| 5036 | WMI_VDEV_PPS_5G_EBT, |
| 5037 | value); |
| 5038 | } |
| 5039 | |
Jeff Johnson | cc7776d | 2018-11-02 14:10:38 -0700 | [diff] [blame] | 5040 | static int hdd_we_set_qpower(struct hdd_adapter *adapter, |
| 5041 | enum wmi_sta_powersave_param id, |
| 5042 | const char *id_string, |
| 5043 | int value) |
| 5044 | { |
| 5045 | int errno; |
| 5046 | |
| 5047 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5048 | errno = wma_cli_set_command(adapter->vdev_id, id, value, QPOWER_CMD); |
Jeff Johnson | cc7776d | 2018-11-02 14:10:38 -0700 | [diff] [blame] | 5049 | if (errno) |
| 5050 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5051 | |
| 5052 | return errno; |
| 5053 | } |
| 5054 | |
| 5055 | #define hdd_we_set_qpower(adapter, id, value) \ |
| 5056 | hdd_we_set_qpower(adapter, id, #id, value) |
| 5057 | |
| 5058 | static int |
| 5059 | hdd_we_set_qpower_max_pspoll_count(struct hdd_adapter *adapter, int value) |
| 5060 | { |
| 5061 | enum wmi_sta_powersave_param id = |
| 5062 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT; |
| 5063 | |
| 5064 | return hdd_we_set_qpower(adapter, id, value); |
| 5065 | } |
| 5066 | |
| 5067 | static int |
| 5068 | hdd_we_set_qpower_max_tx_before_wake(struct hdd_adapter *adapter, int value) |
| 5069 | { |
| 5070 | enum wmi_sta_powersave_param id = |
| 5071 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE; |
| 5072 | |
| 5073 | return hdd_we_set_qpower(adapter, id, value); |
| 5074 | } |
| 5075 | |
| 5076 | static int |
| 5077 | hdd_we_set_qpower_spec_pspoll_wake_interval(struct hdd_adapter *adapter, |
| 5078 | int value) |
| 5079 | { |
| 5080 | enum wmi_sta_powersave_param id = |
| 5081 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL; |
| 5082 | |
| 5083 | return hdd_we_set_qpower(adapter, id, value); |
| 5084 | } |
| 5085 | |
| 5086 | static int |
| 5087 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll(struct hdd_adapter *adapter, |
| 5088 | int value) |
| 5089 | { |
| 5090 | enum wmi_sta_powersave_param id = |
| 5091 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL; |
| 5092 | |
| 5093 | return hdd_we_set_qpower(adapter, id, value); |
| 5094 | } |
| 5095 | |
Jeff Johnson | 5d0e8cd | 2018-11-07 08:17:05 -0800 | [diff] [blame] | 5096 | static int hdd_we_set_pdev(struct hdd_adapter *adapter, |
| 5097 | WMI_PDEV_PARAM id, |
| 5098 | const char *id_string, |
| 5099 | int value) |
| 5100 | { |
| 5101 | int errno; |
| 5102 | |
| 5103 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5104 | errno = wma_cli_set_command(adapter->vdev_id, id, value, PDEV_CMD); |
Jeff Johnson | 5d0e8cd | 2018-11-07 08:17:05 -0800 | [diff] [blame] | 5105 | if (errno) |
| 5106 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5107 | |
| 5108 | return errno; |
| 5109 | } |
| 5110 | |
| 5111 | #define hdd_we_set_pdev(adapter, id, value) \ |
| 5112 | hdd_we_set_pdev(adapter, id, #id, value) |
| 5113 | |
| 5114 | static int hdd_we_set_ani_en_dis(struct hdd_adapter *adapter, int value) |
| 5115 | { |
| 5116 | return hdd_we_set_pdev(adapter, |
| 5117 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 5118 | value); |
| 5119 | } |
| 5120 | |
| 5121 | static int hdd_we_set_ani_poll_period(struct hdd_adapter *adapter, int value) |
| 5122 | { |
| 5123 | return hdd_we_set_pdev(adapter, |
| 5124 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 5125 | value); |
| 5126 | } |
| 5127 | |
| 5128 | static int hdd_we_set_ani_listen_period(struct hdd_adapter *adapter, int value) |
| 5129 | { |
| 5130 | return hdd_we_set_pdev(adapter, |
| 5131 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 5132 | value); |
| 5133 | } |
| 5134 | |
| 5135 | static int hdd_we_set_ani_ofdm_level(struct hdd_adapter *adapter, int value) |
| 5136 | { |
| 5137 | return hdd_we_set_pdev(adapter, |
| 5138 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 5139 | value); |
| 5140 | } |
| 5141 | |
| 5142 | static int hdd_we_set_ani_cck_level(struct hdd_adapter *adapter, int value) |
| 5143 | { |
| 5144 | return hdd_we_set_pdev(adapter, |
| 5145 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 5146 | value); |
| 5147 | } |
| 5148 | |
| 5149 | static int hdd_we_set_dynamic_bw(struct hdd_adapter *adapter, int value) |
| 5150 | { |
| 5151 | return hdd_we_set_pdev(adapter, |
| 5152 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 5153 | value); |
| 5154 | } |
| 5155 | |
| 5156 | static int hdd_we_set_cts_cbw(struct hdd_adapter *adapter, int value) |
| 5157 | { |
| 5158 | return hdd_we_set_pdev(adapter, |
| 5159 | WMI_PDEV_PARAM_CTS_CBW, |
| 5160 | value); |
| 5161 | } |
| 5162 | |
| 5163 | static int hdd_we_set_tx_chainmask(struct hdd_adapter *adapter, int value) |
| 5164 | { |
| 5165 | int errno; |
| 5166 | |
| 5167 | errno = hdd_we_set_pdev(adapter, |
| 5168 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 5169 | value); |
| 5170 | if (errno) |
| 5171 | return errno; |
| 5172 | |
| 5173 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 5174 | } |
| 5175 | |
| 5176 | static int hdd_we_set_rx_chainmask(struct hdd_adapter *adapter, int value) |
| 5177 | { |
| 5178 | int errno; |
| 5179 | |
| 5180 | errno = hdd_we_set_pdev(adapter, |
| 5181 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 5182 | value); |
| 5183 | if (errno) |
| 5184 | return errno; |
| 5185 | |
| 5186 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 5187 | } |
| 5188 | |
| 5189 | static int hdd_we_set_txpow_2g(struct hdd_adapter *adapter, int value) |
| 5190 | { |
| 5191 | return hdd_we_set_pdev(adapter, |
| 5192 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 5193 | value); |
| 5194 | } |
| 5195 | |
| 5196 | static int hdd_we_set_txpow_5g(struct hdd_adapter *adapter, int value) |
| 5197 | { |
| 5198 | return hdd_we_set_pdev(adapter, |
| 5199 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 5200 | value); |
| 5201 | } |
| 5202 | |
Jeff Johnson | 2e38127 | 2018-11-10 09:33:39 -0800 | [diff] [blame] | 5203 | static int hdd_we_set_vdev(struct hdd_adapter *adapter, |
| 5204 | int id, |
| 5205 | const char *id_string, |
| 5206 | int value) |
| 5207 | { |
| 5208 | int errno; |
| 5209 | |
| 5210 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5211 | errno = wma_cli_set_command(adapter->vdev_id, id, value, VDEV_CMD); |
Jeff Johnson | 2e38127 | 2018-11-10 09:33:39 -0800 | [diff] [blame] | 5212 | if (errno) |
| 5213 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5214 | |
| 5215 | return errno; |
| 5216 | } |
| 5217 | |
| 5218 | #define hdd_we_set_vdev(adapter, id, value) \ |
| 5219 | hdd_we_set_vdev(adapter, id, #id, value) |
| 5220 | |
| 5221 | static int hdd_we_set_txrx_fwstats(struct hdd_adapter *adapter, int value) |
| 5222 | { |
| 5223 | return hdd_we_set_vdev(adapter, |
| 5224 | WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID, |
| 5225 | value); |
| 5226 | } |
| 5227 | |
| 5228 | static int hdd_we_txrx_fwstats_reset(struct hdd_adapter *adapter, int value) |
| 5229 | { |
| 5230 | return hdd_we_set_vdev(adapter, |
| 5231 | WMA_VDEV_TXRX_FWSTATS_RESET_CMDID, |
| 5232 | value); |
| 5233 | } |
| 5234 | |
| 5235 | static int hdd_we_set_htsmps(struct hdd_adapter *adapter, int value) |
| 5236 | { |
| 5237 | return hdd_we_set_vdev(adapter, |
| 5238 | WMI_STA_SMPS_FORCE_MODE_CMDID, |
| 5239 | value); |
| 5240 | } |
| 5241 | |
| 5242 | static int hdd_we_set_early_rx_adjust_enable(struct hdd_adapter *adapter, |
| 5243 | int value) |
| 5244 | { |
| 5245 | if ((value != 0) && (value != 1)) |
| 5246 | return -EINVAL; |
| 5247 | |
| 5248 | return hdd_we_set_vdev(adapter, |
| 5249 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, |
| 5250 | value); |
| 5251 | } |
| 5252 | |
| 5253 | static int hdd_we_set_early_rx_tgt_bmiss_num(struct hdd_adapter *adapter, |
| 5254 | int value) |
| 5255 | { |
| 5256 | return hdd_we_set_vdev(adapter, |
| 5257 | WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, |
| 5258 | value); |
| 5259 | } |
| 5260 | |
| 5261 | static int hdd_we_set_early_rx_bmiss_sample_cycle(struct hdd_adapter *adapter, |
| 5262 | int value) |
| 5263 | { |
| 5264 | return hdd_we_set_vdev(adapter, |
| 5265 | WMI_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 5266 | value); |
| 5267 | } |
| 5268 | |
| 5269 | static int hdd_we_set_early_rx_slop_step(struct hdd_adapter *adapter, int value) |
| 5270 | { |
| 5271 | return hdd_we_set_vdev(adapter, |
| 5272 | WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP, |
| 5273 | value); |
| 5274 | } |
| 5275 | |
| 5276 | static int hdd_we_set_early_rx_init_slop(struct hdd_adapter *adapter, int value) |
| 5277 | { |
| 5278 | return hdd_we_set_vdev(adapter, |
| 5279 | WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP, |
| 5280 | value); |
| 5281 | } |
| 5282 | |
| 5283 | static int hdd_we_set_early_rx_adjust_pause(struct hdd_adapter *adapter, |
| 5284 | int value) |
| 5285 | { |
| 5286 | if ((value != 0) && (value != 1)) |
| 5287 | return -EINVAL; |
| 5288 | |
| 5289 | return hdd_we_set_vdev(adapter, |
| 5290 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, |
| 5291 | value); |
| 5292 | } |
| 5293 | |
| 5294 | static int hdd_we_set_early_rx_drift_sample(struct hdd_adapter *adapter, |
| 5295 | int value) |
| 5296 | { |
| 5297 | return hdd_we_set_vdev(adapter, |
| 5298 | WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE, |
| 5299 | value); |
| 5300 | } |
| 5301 | |
| 5302 | static int hdd_we_set_dcm(struct hdd_adapter *adapter, int value) |
| 5303 | { |
| 5304 | return hdd_we_set_vdev(adapter, |
| 5305 | WMI_VDEV_PARAM_HE_DCM, |
| 5306 | value); |
| 5307 | } |
| 5308 | |
| 5309 | static int hdd_we_set_range_ext(struct hdd_adapter *adapter, int value) |
| 5310 | { |
| 5311 | return hdd_we_set_vdev(adapter, |
| 5312 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5313 | value); |
| 5314 | } |
| 5315 | |
Jeff Johnson | 22e57f1 | 2018-11-10 16:02:00 -0800 | [diff] [blame] | 5316 | static int hdd_we_set_dbg(struct hdd_adapter *adapter, |
| 5317 | int id, |
| 5318 | const char *id_string, |
| 5319 | int value) |
| 5320 | { |
| 5321 | int errno; |
| 5322 | |
| 5323 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5324 | errno = wma_cli_set_command(adapter->vdev_id, id, value, DBG_CMD); |
Jeff Johnson | 22e57f1 | 2018-11-10 16:02:00 -0800 | [diff] [blame] | 5325 | if (errno) |
| 5326 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5327 | |
| 5328 | return errno; |
| 5329 | } |
| 5330 | |
| 5331 | #define hdd_we_set_dbg(adapter, id, value) \ |
| 5332 | hdd_we_set_dbg(adapter, id, #id, value) |
| 5333 | |
| 5334 | static int hdd_we_dbglog_log_level(struct hdd_adapter *adapter, int value) |
| 5335 | { |
| 5336 | return hdd_we_set_dbg(adapter, |
| 5337 | WMI_DBGLOG_LOG_LEVEL, |
| 5338 | value); |
| 5339 | } |
| 5340 | |
| 5341 | static int hdd_we_dbglog_vap_enable(struct hdd_adapter *adapter, int value) |
| 5342 | { |
| 5343 | return hdd_we_set_dbg(adapter, |
| 5344 | WMI_DBGLOG_VAP_ENABLE, |
| 5345 | value); |
| 5346 | } |
| 5347 | |
| 5348 | static int hdd_we_dbglog_vap_disable(struct hdd_adapter *adapter, int value) |
| 5349 | { |
| 5350 | return hdd_we_set_dbg(adapter, |
| 5351 | WMI_DBGLOG_VAP_DISABLE, |
| 5352 | value); |
| 5353 | } |
| 5354 | |
| 5355 | static int hdd_we_dbglog_module_enable(struct hdd_adapter *adapter, int value) |
| 5356 | { |
| 5357 | return hdd_we_set_dbg(adapter, |
| 5358 | WMI_DBGLOG_MODULE_ENABLE, |
| 5359 | value); |
| 5360 | } |
| 5361 | |
| 5362 | static int hdd_we_dbglog_module_disable(struct hdd_adapter *adapter, int value) |
| 5363 | { |
| 5364 | return hdd_we_set_dbg(adapter, |
| 5365 | WMI_DBGLOG_MODULE_DISABLE, |
| 5366 | value); |
| 5367 | } |
| 5368 | |
| 5369 | static int hdd_we_dbglog_mod_log_level(struct hdd_adapter *adapter, int value) |
| 5370 | { |
| 5371 | return hdd_we_set_dbg(adapter, |
| 5372 | WMI_DBGLOG_MOD_LOG_LEVEL, |
| 5373 | value); |
| 5374 | } |
| 5375 | |
| 5376 | static int hdd_we_dbglog_type(struct hdd_adapter *adapter, int value) |
| 5377 | { |
| 5378 | return hdd_we_set_dbg(adapter, |
| 5379 | WMI_DBGLOG_TYPE, |
| 5380 | value); |
| 5381 | } |
| 5382 | |
| 5383 | static int hdd_we_dbglog_report_enable(struct hdd_adapter *adapter, int value) |
| 5384 | { |
| 5385 | return hdd_we_set_dbg(adapter, |
| 5386 | WMI_DBGLOG_REPORT_ENABLE, |
| 5387 | value); |
| 5388 | } |
| 5389 | |
| 5390 | static int hdd_we_start_fw_profile(struct hdd_adapter *adapter, int value) |
| 5391 | { |
| 5392 | return hdd_we_set_dbg(adapter, |
| 5393 | WMI_WLAN_PROFILE_TRIGGER_CMDID, |
| 5394 | value); |
| 5395 | } |
| 5396 | |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5397 | static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel) |
| 5398 | { |
| 5399 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5400 | QDF_STATUS status; |
| 5401 | |
| 5402 | hdd_debug("Set Channel %d Session ID %d mode %d", channel, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5403 | adapter->vdev_id, adapter->device_mode); |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5404 | |
| 5405 | if (!hdd_ctx->mac_handle) |
| 5406 | return -EINVAL; |
| 5407 | |
| 5408 | switch (adapter->device_mode) { |
| 5409 | case QDF_STA_MODE: |
| 5410 | case QDF_P2P_CLIENT_MODE: |
| 5411 | /* supported */ |
| 5412 | break; |
| 5413 | default: |
| 5414 | hdd_err("change channel not supported for device mode %d", |
| 5415 | adapter->device_mode); |
| 5416 | return -EINVAL; |
| 5417 | } |
| 5418 | |
| 5419 | status = sme_ext_change_channel(hdd_ctx->mac_handle, channel, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5420 | adapter->vdev_id); |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5421 | if (status != QDF_STATUS_SUCCESS) |
| 5422 | hdd_err("Error in change channel status %d", status); |
| 5423 | |
| 5424 | return qdf_status_to_os_return(status); |
| 5425 | } |
| 5426 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 5427 | static int hdd_we_mcc_config_latency(struct hdd_adapter *adapter, int latency) |
| 5428 | { |
| 5429 | hdd_debug("MCC latency %d", latency); |
| 5430 | |
| 5431 | wlan_hdd_set_mcc_latency(adapter, latency); |
| 5432 | |
| 5433 | return 0; |
| 5434 | } |
| 5435 | |
| 5436 | static int hdd_we_mcc_config_quota(struct hdd_adapter *adapter, int quota) |
| 5437 | { |
| 5438 | hdd_debug("MCC quota %dms", quota); |
| 5439 | |
| 5440 | return wlan_hdd_set_mcc_p2p_quota(adapter, quota); |
| 5441 | } |
| 5442 | |
Jeff Johnson | 33ec198 | 2018-11-12 21:40:33 -0800 | [diff] [blame] | 5443 | static int hdd_we_set_debug_log(struct hdd_adapter *adapter, int value) |
| 5444 | { |
| 5445 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5446 | |
| 5447 | if (!hdd_ctx->mac_handle) |
| 5448 | return -EINVAL; |
| 5449 | |
| 5450 | sme_update_connect_debug(hdd_ctx->mac_handle, value); |
| 5451 | |
| 5452 | return 0; |
| 5453 | } |
| 5454 | |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5455 | static int hdd_we_set_scan_disable(struct hdd_adapter *adapter, int value) |
| 5456 | { |
| 5457 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5458 | |
| 5459 | hdd_debug("%d", value); |
| 5460 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5461 | if (!hdd_ctx->psoc) |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5462 | return -EINVAL; |
| 5463 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5464 | if (value) |
| 5465 | ucfg_scan_psoc_set_disable(hdd_ctx->psoc, REASON_USER_SPACE); |
| 5466 | else |
| 5467 | ucfg_scan_psoc_set_enable(hdd_ctx->psoc, REASON_USER_SPACE); |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5468 | |
| 5469 | return 0; |
| 5470 | } |
| 5471 | |
Jeff Johnson | d3f1efd | 2018-11-13 13:26:19 -0800 | [diff] [blame] | 5472 | static int hdd_we_set_conc_system_pref(struct hdd_adapter *adapter, |
| 5473 | int preference) |
| 5474 | { |
| 5475 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5476 | |
| 5477 | hdd_debug("%d", preference); |
| 5478 | |
| 5479 | if (!hdd_ctx->psoc) |
| 5480 | return -EINVAL; |
| 5481 | |
| 5482 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, preference); |
| 5483 | |
| 5484 | return 0; |
| 5485 | } |
| 5486 | |
Jeff Johnson | 74696bb | 2018-11-13 13:30:36 -0800 | [diff] [blame] | 5487 | static int hdd_we_set_11ax_rate(struct hdd_adapter *adapter, int rate) |
| 5488 | { |
| 5489 | return hdd_set_11ax_rate(adapter, rate, NULL); |
| 5490 | } |
| 5491 | |
Jeff Johnson | b43ec12 | 2018-11-13 14:17:08 -0800 | [diff] [blame] | 5492 | static int hdd_we_set_modulated_dtim(struct hdd_adapter *adapter, int value) |
| 5493 | { |
| 5494 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5495 | |
| 5496 | hdd_debug("%d", value); |
| 5497 | |
| 5498 | if (!hdd_ctx->psoc) |
| 5499 | return -EINVAL; |
| 5500 | |
| 5501 | if ((value < cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM)) || |
| 5502 | (value > cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM))) { |
| 5503 | hdd_err("Invalid value %d", value); |
| 5504 | return -EINVAL; |
| 5505 | } |
| 5506 | |
| 5507 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, value); |
| 5508 | |
| 5509 | return 0; |
| 5510 | } |
| 5511 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5512 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5513 | /** |
| 5514 | * hdd_we_motion_det_start_stop - start/stop motion detection |
| 5515 | * @adapter: hdd adapter |
| 5516 | * @value: start/stop value to set |
| 5517 | * |
| 5518 | * Return: 0 on success, error on failure |
| 5519 | */ |
| 5520 | static int hdd_we_motion_det_start_stop(struct hdd_adapter *adapter, int value) |
| 5521 | { |
| 5522 | struct sme_motion_det_en motion_det; |
| 5523 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5524 | |
| 5525 | if (value < 0 || value > 1) { |
| 5526 | hdd_err("Invalid value %d in mt_start", value); |
| 5527 | return -EINVAL; |
| 5528 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5529 | motion_det.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5530 | motion_det.enable = value; |
| 5531 | |
| 5532 | if (!value) |
| 5533 | adapter->motion_detection_mode = 0; |
| 5534 | |
| 5535 | sme_motion_det_enable(hdd_ctx->mac_handle, &motion_det); |
| 5536 | |
| 5537 | return 0; |
| 5538 | } |
| 5539 | |
| 5540 | /** |
| 5541 | * hdd_we_motion_det_base_line_start_stop - start/stop md baselining |
| 5542 | * @adapter: hdd adapter |
| 5543 | * @value: start/stop value to set |
| 5544 | * |
| 5545 | * Return: 0 on success, error on failure |
| 5546 | */ |
| 5547 | static int hdd_we_motion_det_base_line_start_stop(struct hdd_adapter *adapter, |
| 5548 | int value) |
| 5549 | { |
| 5550 | struct sme_motion_det_base_line_en motion_det_base_line; |
| 5551 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5552 | |
| 5553 | if (value < 0 || value > 1) { |
| 5554 | hdd_err("Invalid value %d in mt_bl_start", value); |
| 5555 | return -EINVAL; |
| 5556 | } |
| 5557 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5558 | motion_det_base_line.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5559 | motion_det_base_line.enable = value; |
| 5560 | sme_motion_det_base_line_enable(hdd_ctx->mac_handle, |
| 5561 | &motion_det_base_line); |
| 5562 | |
| 5563 | return 0; |
| 5564 | } |
| 5565 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
| 5566 | |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 5567 | int wlan_hdd_set_btcoex_mode(struct hdd_adapter *adapter, int value) |
| 5568 | { |
| 5569 | struct coex_config_params coex_cfg_params = {0}; |
| 5570 | |
| 5571 | coex_cfg_params.config_type = WMI_COEX_CONFIG_BTC_MODE; |
| 5572 | coex_cfg_params.config_arg1 = value; |
| 5573 | coex_cfg_params.vdev_id = adapter->vdev_id; |
| 5574 | |
| 5575 | if (value < cfg_min(CFG_BTC_MODE) || value > cfg_max(CFG_BTC_MODE)) { |
| 5576 | hdd_err_rl("Invalid value %d", value); |
| 5577 | return -EINVAL; |
| 5578 | } |
| 5579 | |
| 5580 | if (QDF_IS_STATUS_ERROR(sme_send_coex_config_cmd(&coex_cfg_params))) { |
| 5581 | hdd_err_rl("Failed to send coex BTC mode"); |
| 5582 | return -EINVAL; |
| 5583 | } |
| 5584 | |
| 5585 | return 0; |
| 5586 | } |
| 5587 | |
| 5588 | int wlan_hdd_set_btcoex_rssi_threshold(struct hdd_adapter *adapter, int value) |
| 5589 | { |
| 5590 | struct coex_config_params coex_cfg_params = {0}; |
| 5591 | |
| 5592 | coex_cfg_params.config_type = WMI_COEX_CONFIG_BT_LOW_RSSI_THRESHOLD; |
| 5593 | coex_cfg_params.config_arg1 = value; |
| 5594 | coex_cfg_params.vdev_id = adapter->vdev_id; |
| 5595 | |
| 5596 | if (value < cfg_min(CFG_WLAN_LOW_RSSI_THRESHOLD) || |
| 5597 | value > cfg_max(CFG_WLAN_LOW_RSSI_THRESHOLD)) { |
| 5598 | hdd_err_rl("Invalid value %d", value); |
| 5599 | return -EINVAL; |
| 5600 | } |
| 5601 | |
| 5602 | if (QDF_IS_STATUS_ERROR(sme_send_coex_config_cmd(&coex_cfg_params))) { |
| 5603 | hdd_err_rl("Failed to send coex BTC RSSI Threshold"); |
| 5604 | return -EINVAL; |
| 5605 | } |
| 5606 | return 0; |
| 5607 | } |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5608 | typedef int (*setint_getnone_fn)(struct hdd_adapter *adapter, int value); |
| 5609 | static const setint_getnone_fn setint_getnone_cb[] = { |
| 5610 | [WE_SET_11D_STATE] = hdd_we_set_11d_state, |
| 5611 | [WE_SET_POWER] = hdd_we_set_power, |
| 5612 | [WE_SET_MAX_ASSOC] = hdd_we_set_max_assoc, |
| 5613 | [WE_SET_DATA_INACTIVITY_TO] = hdd_we_set_data_inactivity_timeout, |
| 5614 | [WE_SET_WOW_DATA_INACTIVITY_TO] = |
| 5615 | hdd_we_set_wow_data_inactivity_timeout, |
| 5616 | [WE_SET_MC_RATE] = wlan_hdd_set_mc_rate, |
| 5617 | [WE_SET_TX_POWER] = hdd_we_set_tx_power, |
| 5618 | [WE_SET_MAX_TX_POWER] = hdd_we_set_max_tx_power, |
| 5619 | [WE_SET_MAX_TX_POWER_2_4] = hdd_we_set_max_tx_power_2_4, |
| 5620 | [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] | 5621 | #ifdef HASTINGS_BT_WAR |
| 5622 | [WE_SET_HASTINGS_BT_WAR] = hdd_we_set_hastings_bt_war, |
| 5623 | #endif |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5624 | [WE_SET_TM_LEVEL] = hdd_we_set_tm_level, |
| 5625 | [WE_SET_PHYMODE] = wlan_hdd_update_phymode, |
| 5626 | [WE_SET_NSS] = hdd_we_set_nss, |
| 5627 | [WE_SET_GTX_HT_MCS] = hdd_we_set_gtx_ht_mcs, |
| 5628 | [WE_SET_GTX_VHT_MCS] = hdd_we_set_gtx_vht_mcs, |
| 5629 | [WE_SET_GTX_USRCFG] = hdd_we_set_gtx_usrcfg, |
| 5630 | [WE_SET_GTX_THRE] = hdd_we_set_gtx_thre, |
| 5631 | [WE_SET_GTX_MARGIN] = hdd_we_set_gtx_margin, |
| 5632 | [WE_SET_GTX_STEP] = hdd_we_set_gtx_step, |
| 5633 | [WE_SET_GTX_MINTPC] = hdd_we_set_gtx_mintpc, |
| 5634 | [WE_SET_GTX_BWMASK] = hdd_we_set_gtx_bwmask, |
| 5635 | [WE_SET_LDPC] = hdd_set_ldpc, |
| 5636 | [WE_SET_TX_STBC] = hdd_set_tx_stbc, |
| 5637 | [WE_SET_RX_STBC] = hdd_set_rx_stbc, |
| 5638 | [WE_SET_SHORT_GI] = hdd_we_set_short_gi, |
| 5639 | [WE_SET_RTSCTS] = hdd_we_set_rtscts, |
| 5640 | [WE_SET_CHWIDTH] = hdd_we_set_ch_width, |
| 5641 | [WE_SET_ANI_EN_DIS] = hdd_we_set_ani_en_dis, |
| 5642 | [WE_SET_ANI_POLL_PERIOD] = hdd_we_set_ani_poll_period, |
| 5643 | [WE_SET_ANI_LISTEN_PERIOD] = hdd_we_set_ani_listen_period, |
| 5644 | [WE_SET_ANI_OFDM_LEVEL] = hdd_we_set_ani_ofdm_level, |
| 5645 | [WE_SET_ANI_CCK_LEVEL] = hdd_we_set_ani_cck_level, |
| 5646 | [WE_SET_DYNAMIC_BW] = hdd_we_set_dynamic_bw, |
| 5647 | [WE_SET_CTS_CBW] = hdd_we_set_cts_cbw, |
| 5648 | [WE_SET_11N_RATE] = hdd_we_set_11n_rate, |
| 5649 | [WE_SET_VHT_RATE] = hdd_we_set_vht_rate, |
| 5650 | [WE_SET_AMPDU] = hdd_we_set_ampdu, |
| 5651 | [WE_SET_AMSDU] = hdd_we_set_amsdu, |
| 5652 | [WE_SET_TX_CHAINMASK] = hdd_we_set_tx_chainmask, |
| 5653 | [WE_SET_RX_CHAINMASK] = hdd_we_set_rx_chainmask, |
| 5654 | [WE_SET_TXPOW_2G] = hdd_we_set_txpow_2g, |
| 5655 | [WE_SET_TXPOW_5G] = hdd_we_set_txpow_5g, |
| 5656 | [WE_DBGLOG_LOG_LEVEL] = hdd_we_dbglog_log_level, |
| 5657 | [WE_DBGLOG_VAP_ENABLE] = hdd_we_dbglog_vap_enable, |
| 5658 | [WE_DBGLOG_VAP_DISABLE] = hdd_we_dbglog_vap_disable, |
| 5659 | [WE_DBGLOG_MODULE_ENABLE] = hdd_we_dbglog_module_enable, |
| 5660 | [WE_DBGLOG_MODULE_DISABLE] = hdd_we_dbglog_module_disable, |
| 5661 | [WE_DBGLOG_MOD_LOG_LEVEL] = hdd_we_dbglog_mod_log_level, |
| 5662 | [WE_DBGLOG_TYPE] = hdd_we_dbglog_type, |
| 5663 | [WE_DBGLOG_REPORT_ENABLE] = hdd_we_dbglog_report_enable, |
| 5664 | [WE_SET_TXRX_FWSTATS] = hdd_we_set_txrx_fwstats, |
| 5665 | [WE_TXRX_FWSTATS_RESET] = hdd_we_txrx_fwstats_reset, |
| 5666 | [WE_DUMP_STATS] = hdd_wlan_dump_stats, |
| 5667 | [WE_CLEAR_STATS] = hdd_we_clear_stats, |
| 5668 | [WE_PPS_PAID_MATCH] = hdd_we_pps_paid_match, |
| 5669 | [WE_PPS_GID_MATCH] = hdd_we_pps_gid_match, |
| 5670 | [WE_PPS_EARLY_TIM_CLEAR] = hdd_we_pps_early_tim_clear, |
| 5671 | [WE_PPS_EARLY_DTIM_CLEAR] = hdd_we_pps_early_dtim_clear, |
| 5672 | [WE_PPS_EOF_PAD_DELIM] = hdd_we_pps_eof_pad_delim, |
| 5673 | [WE_PPS_MACADDR_MISMATCH] = hdd_we_pps_macaddr_mismatch, |
| 5674 | [WE_PPS_DELIM_CRC_FAIL] = hdd_we_pps_delim_crc_fail, |
| 5675 | [WE_PPS_GID_NSTS_ZERO] = hdd_we_pps_gid_nsts_zero, |
| 5676 | [WE_PPS_RSSI_CHECK] = hdd_we_pps_rssi_check, |
| 5677 | [WE_PPS_5G_EBT] = hdd_we_pps_5g_ebt, |
| 5678 | [WE_SET_HTSMPS] = hdd_we_set_htsmps, |
| 5679 | [WE_SET_QPOWER_MAX_PSPOLL_COUNT] = hdd_we_set_qpower_max_pspoll_count, |
| 5680 | [WE_SET_QPOWER_MAX_TX_BEFORE_WAKE] = |
| 5681 | hdd_we_set_qpower_max_tx_before_wake, |
| 5682 | [WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL] = |
| 5683 | hdd_we_set_qpower_spec_pspoll_wake_interval, |
| 5684 | [WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL] = |
| 5685 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll, |
| 5686 | [WE_MCC_CONFIG_LATENCY] = hdd_we_mcc_config_latency, |
| 5687 | [WE_MCC_CONFIG_QUOTA] = hdd_we_mcc_config_quota, |
| 5688 | [WE_SET_DEBUG_LOG] = hdd_we_set_debug_log, |
| 5689 | [WE_SET_EARLY_RX_ADJUST_ENABLE] = hdd_we_set_early_rx_adjust_enable, |
| 5690 | [WE_SET_EARLY_RX_TGT_BMISS_NUM] = hdd_we_set_early_rx_tgt_bmiss_num, |
| 5691 | [WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE] = |
| 5692 | hdd_we_set_early_rx_bmiss_sample_cycle, |
| 5693 | [WE_SET_EARLY_RX_SLOP_STEP] = hdd_we_set_early_rx_slop_step, |
| 5694 | [WE_SET_EARLY_RX_INIT_SLOP] = hdd_we_set_early_rx_init_slop, |
| 5695 | [WE_SET_EARLY_RX_ADJUST_PAUSE] = hdd_we_set_early_rx_adjust_pause, |
| 5696 | [WE_SET_EARLY_RX_DRIFT_SAMPLE] = hdd_we_set_early_rx_drift_sample, |
| 5697 | [WE_SET_SCAN_DISABLE] = hdd_we_set_scan_disable, |
| 5698 | [WE_START_FW_PROFILE] = hdd_we_start_fw_profile, |
| 5699 | [WE_SET_CHANNEL] = hdd_we_set_channel, |
| 5700 | [WE_SET_CONC_SYSTEM_PREF] = hdd_we_set_conc_system_pref, |
| 5701 | [WE_SET_11AX_RATE] = hdd_we_set_11ax_rate, |
| 5702 | [WE_SET_DCM] = hdd_we_set_dcm, |
| 5703 | [WE_SET_RANGE_EXT] = hdd_we_set_range_ext, |
| 5704 | [WE_SET_PDEV_RESET] = hdd_handle_pdev_reset, |
| 5705 | [WE_SET_MODULATED_DTIM] = hdd_we_set_modulated_dtim, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5706 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5707 | [WE_MOTION_DET_START_STOP] = hdd_we_motion_det_start_stop, |
| 5708 | [WE_MOTION_DET_BASE_LINE_START_STOP] = |
| 5709 | hdd_we_motion_det_base_line_start_stop, |
| 5710 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 5711 | [WE_SET_BTCOEX_MODE] = wlan_hdd_set_btcoex_mode, |
| 5712 | [WE_SET_BTCOEX_RSSI_THRESHOLD] = wlan_hdd_set_btcoex_rssi_threshold, |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5713 | }; |
| 5714 | |
| 5715 | static setint_getnone_fn hdd_get_setint_getnone_cb(int param) |
| 5716 | { |
| 5717 | if (param < 0) |
| 5718 | return NULL; |
| 5719 | |
| 5720 | if (param >= QDF_ARRAY_SIZE(setint_getnone_cb)) |
| 5721 | return NULL; |
| 5722 | |
| 5723 | return setint_getnone_cb[param]; |
| 5724 | } |
| 5725 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5726 | /** |
| 5727 | * iw_setint_getnone() - Generic "set integer" private ioctl handler |
| 5728 | * @dev: device upon which the ioctl was received |
| 5729 | * @info: ioctl request information |
| 5730 | * @wrqu: ioctl request data |
| 5731 | * @extra: ioctl extra data |
| 5732 | * |
| 5733 | * Return: 0 on success, non-zero on error |
| 5734 | */ |
| 5735 | static int __iw_setint_getnone(struct net_device *dev, |
| 5736 | struct iw_request_info *info, |
| 5737 | union iwreq_data *wrqu, char *extra) |
| 5738 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5739 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5740 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5741 | setint_getnone_fn cb; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5742 | int *value = (int *)extra; |
| 5743 | int sub_cmd = value[0]; |
| 5744 | int set_value = value[1]; |
| 5745 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5746 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5747 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5748 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5749 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5750 | ret = wlan_hdd_validate_context(hdd_ctx); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5751 | if (ret) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5752 | return ret; |
| 5753 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5754 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5755 | if (ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5756 | return ret; |
| 5757 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5758 | cb = hdd_get_setint_getnone_cb(sub_cmd); |
| 5759 | if (!cb) { |
Rajeev Kumar | d056536 | 2018-03-01 12:02:01 -0800 | [diff] [blame] | 5760 | hdd_debug("Invalid sub command %d", sub_cmd); |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5761 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5762 | } |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5763 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5764 | ret = cb(adapter, set_value); |
| 5765 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5766 | hdd_exit(); |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5767 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5768 | return ret; |
| 5769 | } |
| 5770 | |
| 5771 | static int iw_setint_getnone(struct net_device *dev, |
| 5772 | struct iw_request_info *info, |
| 5773 | union iwreq_data *wrqu, |
| 5774 | char *extra) |
| 5775 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5776 | int errno; |
| 5777 | struct osif_vdev_sync *vdev_sync; |
| 5778 | |
| 5779 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 5780 | if (errno) |
| 5781 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5782 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5783 | errno = __iw_setint_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5784 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5785 | osif_vdev_sync_op_stop(vdev_sync); |
| 5786 | |
| 5787 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5788 | } |
| 5789 | |
| 5790 | /** |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5791 | * __iw_setnone_get_threeint() - return three value to up layer. |
| 5792 | * |
| 5793 | * @dev: pointer of net_device of this wireless card |
| 5794 | * @info: meta data about Request sent |
| 5795 | * @wrqu: include request info |
| 5796 | * @extra: buf used for in/Output |
| 5797 | * |
| 5798 | * Return: execute result |
| 5799 | */ |
| 5800 | static int __iw_setnone_get_threeint(struct net_device *dev, |
| 5801 | struct iw_request_info *info, |
| 5802 | union iwreq_data *wrqu, char *extra) |
| 5803 | { |
| 5804 | int ret = 0; /* success */ |
| 5805 | uint32_t *value = (int *)extra; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 5806 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5807 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5808 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5809 | hdd_enter_dev(dev); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5810 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5811 | if (0 != ret) |
| 5812 | return ret; |
| 5813 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5814 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5815 | if (0 != ret) |
| 5816 | return ret; |
| 5817 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5818 | hdd_debug("param = %d", value[0]); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5819 | switch (value[0]) { |
| 5820 | case WE_GET_TSF: |
| 5821 | ret = hdd_indicate_tsf(adapter, value, 3); |
| 5822 | break; |
| 5823 | default: |
| 5824 | hdd_err("Invalid IOCTL get_value command %d", value[0]); |
| 5825 | break; |
| 5826 | } |
| 5827 | return ret; |
| 5828 | } |
| 5829 | |
| 5830 | /** |
| 5831 | * iw_setnone_get_threeint() - return three value to up layer. |
| 5832 | * |
| 5833 | * @dev: pointer of net_device of this wireless card |
| 5834 | * @info: meta data about Request sent |
| 5835 | * @wrqu: include request info |
| 5836 | * @extra: buf used for in/Output |
| 5837 | * |
| 5838 | * Return: execute result |
| 5839 | */ |
| 5840 | static int iw_setnone_get_threeint(struct net_device *dev, |
| 5841 | struct iw_request_info *info, |
| 5842 | union iwreq_data *wrqu, char *extra) |
| 5843 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5844 | int errno; |
| 5845 | struct osif_vdev_sync *vdev_sync; |
| 5846 | |
| 5847 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 5848 | if (errno) |
| 5849 | return errno; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5850 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5851 | errno = __iw_setnone_get_threeint(dev, info, wrqu, extra); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5852 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5853 | osif_vdev_sync_op_stop(vdev_sync); |
| 5854 | |
| 5855 | return errno; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5856 | } |
| 5857 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5858 | #ifdef WLAN_UNIT_TEST |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5859 | typedef uint32_t (*hdd_ut_callback)(void); |
| 5860 | |
| 5861 | struct hdd_ut_entry { |
| 5862 | const hdd_ut_callback callback; |
| 5863 | const char *name; |
| 5864 | }; |
| 5865 | |
| 5866 | struct hdd_ut_entry hdd_ut_entries[] = { |
| 5867 | { .name = "dsc", .callback = dsc_unit_test }, |
Dustin Brown | 05a0658f | 2019-03-05 11:27:38 -0800 | [diff] [blame] | 5868 | { .name = "qdf_delayed_work", .callback = qdf_delayed_work_unit_test }, |
Dustin Brown | 9c49a33 | 2019-03-05 11:27:38 -0800 | [diff] [blame] | 5869 | { .name = "qdf_ht", .callback = qdf_ht_unit_test }, |
| 5870 | { .name = "qdf_periodic_work", |
| 5871 | .callback = qdf_periodic_work_unit_test }, |
Dustin Brown | 92acafe | 2019-02-15 17:17:10 -0800 | [diff] [blame^] | 5872 | { .name = "qdf_ptr_hash", .callback = qdf_ptr_hash_unit_test }, |
Dustin Brown | 128e2d0 | 2019-02-15 12:59:07 -0800 | [diff] [blame] | 5873 | { .name = "qdf_slist", .callback = qdf_slist_unit_test }, |
Dustin Brown | 9c49a33 | 2019-03-05 11:27:38 -0800 | [diff] [blame] | 5874 | { .name = "qdf_talloc", .callback = qdf_talloc_unit_test }, |
| 5875 | { .name = "qdf_types", .callback = qdf_types_unit_test }, |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5876 | }; |
| 5877 | |
| 5878 | #define hdd_for_each_ut_entry(cursor) \ |
| 5879 | for (cursor = hdd_ut_entries; \ |
| 5880 | cursor < hdd_ut_entries + ARRAY_SIZE(hdd_ut_entries); \ |
| 5881 | cursor++) |
| 5882 | |
| 5883 | static struct hdd_ut_entry *hdd_ut_lookup(const char *name) |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5884 | { |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5885 | struct hdd_ut_entry *entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5886 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5887 | hdd_for_each_ut_entry(entry) { |
| 5888 | if (qdf_str_eq(entry->name, name)) |
| 5889 | return entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5890 | } |
| 5891 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5892 | return NULL; |
| 5893 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5894 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5895 | static uint32_t hdd_ut_single(const struct hdd_ut_entry *entry) |
| 5896 | { |
| 5897 | uint32_t errors; |
| 5898 | |
| 5899 | hdd_nofl_info("START: '%s'", entry->name); |
| 5900 | |
| 5901 | errors = entry->callback(); |
| 5902 | if (errors) |
| 5903 | hdd_nofl_err("FAIL: '%s' with %u errors", entry->name, errors); |
| 5904 | else |
| 5905 | hdd_nofl_info("PASS: '%s'", entry->name); |
| 5906 | |
| 5907 | return errors; |
| 5908 | } |
| 5909 | |
| 5910 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *name) |
| 5911 | { |
| 5912 | struct hdd_ut_entry *entry; |
| 5913 | uint32_t errors = 0; |
| 5914 | |
| 5915 | hdd_nofl_info("Unit tests begin"); |
| 5916 | |
| 5917 | if (!name || !name[0] || qdf_str_eq(name, "all")) { |
| 5918 | hdd_for_each_ut_entry(entry) |
| 5919 | errors += hdd_ut_single(entry); |
| 5920 | } else { |
| 5921 | entry = hdd_ut_lookup(name); |
| 5922 | if (entry) |
| 5923 | errors += hdd_ut_single(entry); |
| 5924 | else |
| 5925 | hdd_nofl_err("Unit test '%s' not found", name); |
| 5926 | } |
| 5927 | |
| 5928 | hdd_nofl_info("Unit tests complete"); |
| 5929 | |
| 5930 | return errors ? -EPERM : 0; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5931 | } |
| 5932 | #else |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5933 | 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] | 5934 | { |
| 5935 | return -EOPNOTSUPP; |
| 5936 | } |
| 5937 | #endif /* WLAN_UNIT_TEST */ |
| 5938 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5939 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5940 | * iw_setchar_getnone() - Generic "set string" private ioctl handler |
| 5941 | * @dev: device upon which the ioctl was received |
| 5942 | * @info: ioctl request information |
| 5943 | * @wrqu: ioctl request data |
| 5944 | * @extra: ioctl extra data |
| 5945 | * |
| 5946 | * Return: 0 on success, non-zero on error |
| 5947 | */ |
| 5948 | static int __iw_setchar_getnone(struct net_device *dev, |
| 5949 | struct iw_request_info *info, |
| 5950 | union iwreq_data *wrqu, char *extra) |
| 5951 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5952 | int sub_cmd; |
| 5953 | int ret; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5954 | char *str_arg = NULL; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5955 | struct hdd_adapter *adapter = (netdev_priv(dev)); |
| 5956 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5957 | struct iw_point s_priv_data; |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 5958 | bool neighbor_report_req_support = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5959 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5960 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 5961 | |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5962 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5963 | hdd_err("permission check failed"); |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5964 | return -EPERM; |
| 5965 | } |
| 5966 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5967 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5968 | if (0 != ret) |
| 5969 | return ret; |
| 5970 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5971 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5972 | if (0 != ret) |
| 5973 | return ret; |
| 5974 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5975 | /* helper function to get iwreq_data with compat handling. */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5976 | if (hdd_priv_get_data(&s_priv_data, wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5977 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5978 | |
| 5979 | /* make sure all params are correctly passed to function */ |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 5980 | if ((!s_priv_data.pointer) || (0 == s_priv_data.length)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5981 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5982 | |
| 5983 | sub_cmd = s_priv_data.flags; |
| 5984 | |
| 5985 | /* ODD number is used for set, copy data using copy_from_user */ |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5986 | str_arg = mem_alloc_copy_from_user_helper(s_priv_data.pointer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5987 | s_priv_data.length); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5988 | if (!str_arg) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5989 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5990 | return -ENOMEM; |
| 5991 | } |
| 5992 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5993 | hdd_debug("Received length: %d data: %s", |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5994 | s_priv_data.length, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5995 | |
| 5996 | switch (sub_cmd) { |
| 5997 | case WE_WOWL_ADD_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5998 | hdd_debug("ADD_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 5999 | if (!hdd_add_wowl_ptrn(adapter, str_arg)) |
| 6000 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6001 | break; |
| 6002 | case WE_WOWL_DEL_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6003 | hdd_debug("DEL_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 6004 | if (!hdd_del_wowl_ptrn(adapter, str_arg)) |
| 6005 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6006 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6007 | case WE_NEIGHBOR_REPORT_REQUEST: |
| 6008 | { |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6009 | tRrmNeighborReq request; |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6010 | tRrmNeighborRspCallbackInfo callback; |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 6011 | bool rrm_enabled = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6012 | |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 6013 | ucfg_wlan_mlme_get_rrm_enabled(hdd_ctx->psoc, |
| 6014 | &rrm_enabled); |
| 6015 | |
| 6016 | if (rrm_enabled) { |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6017 | request.neighbor_report_offload = false; |
| 6018 | request.no_ssid = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6019 | (s_priv_data.length - 1) ? false : true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6020 | hdd_debug("Neighbor Request ssid present %d", |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6021 | request.no_ssid); |
| 6022 | if (!request.no_ssid) { |
| 6023 | request.ssid.length = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6024 | (s_priv_data.length - 1) > |
| 6025 | 32 ? 32 : (s_priv_data.length - 1); |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6026 | qdf_mem_copy(request.ssid.ssId, |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6027 | str_arg, |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6028 | request.ssid.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6029 | } |
| 6030 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6031 | /* |
| 6032 | * If 11k offload is supported by FW and enabled |
| 6033 | * in the ini, set the offload to true |
| 6034 | */ |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 6035 | if (QDF_IS_STATUS_ERROR( |
| 6036 | ucfg_fwol_is_neighbor_report_req_supported( |
| 6037 | hdd_ctx->psoc, &neighbor_report_req_support))) |
| 6038 | hdd_err("Neighbor report req bit get fail"); |
| 6039 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6040 | if (hdd_ctx->config->is_11k_offload_supported && |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 6041 | neighbor_report_req_support) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6042 | hdd_debug("Neighbor report offloaded to FW"); |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6043 | request.neighbor_report_offload = true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6044 | } |
| 6045 | |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6046 | callback.neighborRspCallback = NULL; |
| 6047 | callback.neighborRspCallbackContext = NULL; |
| 6048 | callback.timeout = 5000; /* 5 seconds */ |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6049 | sme_neighbor_report_request( |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6050 | hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6051 | adapter->vdev_id, |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6052 | &request, |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6053 | &callback); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6054 | } else { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6055 | hdd_err("Ignoring neighbor request as RRM not enabled"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6056 | ret = -EINVAL; |
| 6057 | } |
| 6058 | } |
| 6059 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6060 | case WE_SET_AP_WPS_IE: |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 6061 | hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6062 | break; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6063 | case WE_UNIT_TEST: |
| 6064 | ret = hdd_we_unit_test(hdd_ctx, str_arg); |
| 6065 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6066 | default: |
| 6067 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6068 | hdd_err("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6069 | ret = -EINVAL; |
| 6070 | break; |
| 6071 | } |
| 6072 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6073 | |
| 6074 | qdf_mem_free(str_arg); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6075 | hdd_exit(); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6076 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6077 | return ret; |
| 6078 | } |
| 6079 | |
| 6080 | static int iw_setchar_getnone(struct net_device *dev, |
| 6081 | struct iw_request_info *info, |
| 6082 | union iwreq_data *wrqu, char *extra) |
| 6083 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6084 | int errno; |
| 6085 | struct osif_vdev_sync *vdev_sync; |
| 6086 | |
| 6087 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6088 | if (errno) |
| 6089 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6090 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6091 | errno = __iw_setchar_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6092 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6093 | osif_vdev_sync_op_stop(vdev_sync); |
| 6094 | |
| 6095 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6096 | } |
| 6097 | |
| 6098 | /** |
| 6099 | * iw_setnone_getint() - Generic "get integer" private ioctl handler |
| 6100 | * @dev: device upon which the ioctl was received |
| 6101 | * @info: ioctl request information |
| 6102 | * @wrqu: ioctl request data |
| 6103 | * @extra: ioctl extra data |
| 6104 | * |
| 6105 | * Return: 0 on success, non-zero on error |
| 6106 | */ |
| 6107 | static int __iw_setnone_getint(struct net_device *dev, |
| 6108 | struct iw_request_info *info, |
| 6109 | union iwreq_data *wrqu, char *extra) |
| 6110 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6111 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6112 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6113 | int *value = (int *)extra; |
| 6114 | int ret; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 6115 | struct sme_config_params *sme_config; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6116 | struct hdd_context *hdd_ctx; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6117 | QDF_STATUS status; |
| 6118 | bool bval = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6119 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6120 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6121 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6122 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6123 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6124 | if (0 != ret) |
| 6125 | return ret; |
| 6126 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6127 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6128 | if (0 != ret) |
| 6129 | return ret; |
| 6130 | |
Rajeev Kumar | 1117fcf | 2018-02-15 16:25:19 -0800 | [diff] [blame] | 6131 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 6132 | if (!sme_config) { |
| 6133 | hdd_err("failed to allocate memory for sme_config"); |
| 6134 | return -ENOMEM; |
| 6135 | } |
| 6136 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6137 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6138 | switch (value[0]) { |
| 6139 | case WE_GET_11D_STATE: |
| 6140 | { |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 6141 | status = ucfg_mlme_is_11d_enabled(hdd_ctx->psoc, &bval); |
| 6142 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 6143 | hdd_err("Invalid 11d_enable flag"); |
| 6144 | *value = bval; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6145 | hdd_debug("11D state=%d!!", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6146 | |
| 6147 | break; |
| 6148 | } |
| 6149 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6150 | case WE_GET_WLAN_DBG: |
| 6151 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6152 | qdf_trace_display(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6153 | *value = 0; |
| 6154 | break; |
| 6155 | } |
| 6156 | case WE_GET_MAX_ASSOC: |
| 6157 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6158 | if (ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, *value) != |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 6159 | QDF_STATUS_SUCCESS) { |
| 6160 | hdd_err("CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6161 | ret = -EIO; |
| 6162 | } |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 6163 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6164 | break; |
| 6165 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6166 | |
| 6167 | case WE_GET_CONCURRENCY_MODE: |
| 6168 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6169 | *value = policy_mgr_get_concurrency_mode(hdd_ctx->psoc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6170 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6171 | hdd_debug("concurrency mode=%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6172 | break; |
| 6173 | } |
| 6174 | |
| 6175 | case WE_GET_NSS: |
| 6176 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6177 | sme_get_config_param(mac_handle, sme_config); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6178 | status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval); |
| 6179 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 6180 | hdd_err("unable to get vht_enable2x2"); |
| 6181 | *value = (bval == 0) ? 1 : 2; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6182 | if (policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc)) |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 6183 | *value = *value - 1; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6184 | hdd_debug("GET_NSS: Current NSS:%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6185 | break; |
| 6186 | } |
| 6187 | |
| 6188 | case WE_GET_GTX_HT_MCS: |
| 6189 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6190 | hdd_debug("GET WMI_VDEV_PARAM_GTX_HT_MCS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6191 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6192 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 6193 | GTX_CMD); |
| 6194 | break; |
| 6195 | } |
| 6196 | |
| 6197 | case WE_GET_GTX_VHT_MCS: |
| 6198 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6199 | hdd_debug("GET WMI_VDEV_PARAM_GTX_VHT_MCS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6200 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6201 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 6202 | GTX_CMD); |
| 6203 | break; |
| 6204 | } |
| 6205 | |
| 6206 | case WE_GET_GTX_USRCFG: |
| 6207 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6208 | hdd_debug("GET WMI_VDEV_PARAM_GTX_USR_CFG"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6209 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6210 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 6211 | GTX_CMD); |
| 6212 | break; |
| 6213 | } |
| 6214 | |
| 6215 | case WE_GET_GTX_THRE: |
| 6216 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6217 | hdd_debug("GET WMI_VDEV_PARAM_GTX_THRE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6218 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6219 | WMI_VDEV_PARAM_GTX_THRE, |
| 6220 | GTX_CMD); |
| 6221 | break; |
| 6222 | } |
| 6223 | |
| 6224 | case WE_GET_GTX_MARGIN: |
| 6225 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6226 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MARGIN"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6227 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6228 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 6229 | GTX_CMD); |
| 6230 | break; |
| 6231 | } |
| 6232 | |
| 6233 | case WE_GET_GTX_STEP: |
| 6234 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6235 | hdd_debug("GET WMI_VDEV_PARAM_GTX_STEP"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6236 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6237 | WMI_VDEV_PARAM_GTX_STEP, |
| 6238 | GTX_CMD); |
| 6239 | break; |
| 6240 | } |
| 6241 | |
| 6242 | case WE_GET_GTX_MINTPC: |
| 6243 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6244 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MINTPC"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6245 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6246 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 6247 | GTX_CMD); |
| 6248 | break; |
| 6249 | } |
| 6250 | |
| 6251 | case WE_GET_GTX_BWMASK: |
| 6252 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6253 | hdd_debug("GET WMI_VDEV_PARAM_GTX_BW_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6254 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6255 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 6256 | GTX_CMD); |
| 6257 | break; |
| 6258 | } |
| 6259 | |
| 6260 | case WE_GET_LDPC: |
| 6261 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6262 | ret = hdd_get_ldpc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6263 | break; |
| 6264 | } |
| 6265 | |
| 6266 | case WE_GET_TX_STBC: |
| 6267 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6268 | ret = hdd_get_tx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6269 | break; |
| 6270 | } |
| 6271 | |
| 6272 | case WE_GET_RX_STBC: |
| 6273 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6274 | ret = hdd_get_rx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6275 | break; |
| 6276 | } |
| 6277 | |
| 6278 | case WE_GET_SHORT_GI: |
| 6279 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6280 | hdd_debug("GET WMI_VDEV_PARAM_SGI"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6281 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | a5c5aad | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 6282 | WMI_VDEV_PARAM_SGI, |
| 6283 | VDEV_CMD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6284 | break; |
| 6285 | } |
| 6286 | |
| 6287 | case WE_GET_RTSCTS: |
| 6288 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6289 | hdd_debug("GET WMI_VDEV_PARAM_ENABLE_RTSCTS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6290 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6291 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 6292 | VDEV_CMD); |
| 6293 | break; |
| 6294 | } |
| 6295 | |
| 6296 | case WE_GET_CHWIDTH: |
| 6297 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6298 | hdd_debug("GET WMI_VDEV_PARAM_CHWIDTH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6299 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6300 | WMI_VDEV_PARAM_CHWIDTH, |
| 6301 | VDEV_CMD); |
| 6302 | break; |
| 6303 | } |
| 6304 | |
| 6305 | case WE_GET_ANI_EN_DIS: |
| 6306 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6307 | hdd_debug("GET WMI_PDEV_PARAM_ANI_ENABLE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6308 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6309 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 6310 | PDEV_CMD); |
| 6311 | break; |
| 6312 | } |
| 6313 | |
| 6314 | case WE_GET_ANI_POLL_PERIOD: |
| 6315 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6316 | hdd_debug("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6317 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6318 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 6319 | PDEV_CMD); |
| 6320 | break; |
| 6321 | } |
| 6322 | |
| 6323 | case WE_GET_ANI_LISTEN_PERIOD: |
| 6324 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6325 | hdd_debug("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6326 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6327 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 6328 | PDEV_CMD); |
| 6329 | break; |
| 6330 | } |
| 6331 | |
| 6332 | case WE_GET_ANI_OFDM_LEVEL: |
| 6333 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6334 | hdd_debug("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6335 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6336 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 6337 | PDEV_CMD); |
| 6338 | break; |
| 6339 | } |
| 6340 | |
| 6341 | case WE_GET_ANI_CCK_LEVEL: |
| 6342 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6343 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6344 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6345 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 6346 | PDEV_CMD); |
| 6347 | break; |
| 6348 | } |
| 6349 | |
| 6350 | case WE_GET_DYNAMIC_BW: |
| 6351 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6352 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6353 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6354 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 6355 | PDEV_CMD); |
| 6356 | break; |
| 6357 | } |
| 6358 | |
| 6359 | case WE_GET_11N_RATE: |
| 6360 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6361 | hdd_debug("GET WMI_VDEV_PARAM_FIXED_RATE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6362 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6363 | WMI_VDEV_PARAM_FIXED_RATE, |
| 6364 | VDEV_CMD); |
| 6365 | break; |
| 6366 | } |
| 6367 | |
| 6368 | case WE_GET_AMPDU: |
| 6369 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6370 | hdd_debug("GET AMPDU"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6371 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6372 | GEN_VDEV_PARAM_AMPDU, |
| 6373 | GEN_CMD); |
| 6374 | break; |
| 6375 | } |
| 6376 | |
| 6377 | case WE_GET_AMSDU: |
| 6378 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6379 | hdd_debug("GET AMSDU"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6380 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6381 | GEN_VDEV_PARAM_AMSDU, |
| 6382 | GEN_CMD); |
| 6383 | break; |
| 6384 | } |
| 6385 | |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6386 | case WE_GET_ROAM_SYNCH_DELAY: |
| 6387 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6388 | hdd_debug("GET ROAM SYNCH DELAY"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6389 | *value = wma_cli_get_command(adapter->vdev_id, |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6390 | GEN_VDEV_ROAM_SYNCH_DELAY, |
| 6391 | GEN_CMD); |
| 6392 | break; |
| 6393 | } |
| 6394 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6395 | case WE_GET_TX_CHAINMASK: |
| 6396 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6397 | hdd_debug("GET WMI_PDEV_PARAM_TX_CHAIN_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6398 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6399 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 6400 | PDEV_CMD); |
| 6401 | break; |
| 6402 | } |
| 6403 | |
| 6404 | case WE_GET_RX_CHAINMASK: |
| 6405 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6406 | hdd_debug("GET WMI_PDEV_PARAM_RX_CHAIN_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6407 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6408 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 6409 | PDEV_CMD); |
| 6410 | break; |
| 6411 | } |
| 6412 | |
| 6413 | case WE_GET_TXPOW_2G: |
| 6414 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6415 | uint8_t txpow2g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6416 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6417 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6418 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6419 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 6420 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6421 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow2g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6422 | hdd_debug("2G tx_power %d", txpow2g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6423 | break; |
| 6424 | } |
| 6425 | |
| 6426 | case WE_GET_TXPOW_5G: |
| 6427 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6428 | uint8_t txpow5g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6429 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6430 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6431 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6432 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 6433 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6434 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow5g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6435 | hdd_debug("5G tx_power %d", txpow5g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6436 | break; |
| 6437 | } |
| 6438 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6439 | case WE_GET_PPS_PAID_MATCH: |
| 6440 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6441 | hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6442 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6443 | WMI_VDEV_PPS_PAID_MATCH, |
| 6444 | PPS_CMD); |
| 6445 | break; |
| 6446 | } |
| 6447 | |
| 6448 | case WE_GET_PPS_GID_MATCH: |
| 6449 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6450 | hdd_debug("GET WMI_VDEV_PPS_GID_MATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6451 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6452 | WMI_VDEV_PPS_GID_MATCH, |
| 6453 | PPS_CMD); |
| 6454 | break; |
| 6455 | } |
| 6456 | |
| 6457 | case WE_GET_PPS_EARLY_TIM_CLEAR: |
| 6458 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6459 | hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6460 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6461 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 6462 | PPS_CMD); |
| 6463 | break; |
| 6464 | } |
| 6465 | |
| 6466 | case WE_GET_PPS_EARLY_DTIM_CLEAR: |
| 6467 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6468 | hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6469 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6470 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 6471 | PPS_CMD); |
| 6472 | break; |
| 6473 | } |
| 6474 | |
| 6475 | case WE_GET_PPS_EOF_PAD_DELIM: |
| 6476 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6477 | hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6478 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6479 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 6480 | PPS_CMD); |
| 6481 | break; |
| 6482 | } |
| 6483 | |
| 6484 | case WE_GET_PPS_MACADDR_MISMATCH: |
| 6485 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6486 | hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6487 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6488 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 6489 | PPS_CMD); |
| 6490 | break; |
| 6491 | } |
| 6492 | |
| 6493 | case WE_GET_PPS_DELIM_CRC_FAIL: |
| 6494 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6495 | hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6496 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6497 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 6498 | PPS_CMD); |
| 6499 | break; |
| 6500 | } |
| 6501 | |
| 6502 | case WE_GET_PPS_GID_NSTS_ZERO: |
| 6503 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6504 | hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6505 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6506 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 6507 | PPS_CMD); |
| 6508 | break; |
| 6509 | } |
| 6510 | |
| 6511 | case WE_GET_PPS_RSSI_CHECK: |
| 6512 | { |
| 6513 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6514 | hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6515 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6516 | WMI_VDEV_PPS_RSSI_CHECK, |
| 6517 | PPS_CMD); |
| 6518 | break; |
| 6519 | } |
| 6520 | |
| 6521 | case WE_GET_QPOWER_MAX_PSPOLL_COUNT: |
| 6522 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6523 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6524 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6525 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 6526 | QPOWER_CMD); |
| 6527 | break; |
| 6528 | } |
| 6529 | |
| 6530 | case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 6531 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6532 | hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6533 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6534 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 6535 | QPOWER_CMD); |
| 6536 | break; |
| 6537 | } |
| 6538 | |
| 6539 | case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 6540 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6541 | hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6542 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6543 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 6544 | QPOWER_CMD); |
| 6545 | break; |
| 6546 | } |
| 6547 | |
| 6548 | case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 6549 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6550 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6551 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6552 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 6553 | QPOWER_CMD); |
| 6554 | break; |
| 6555 | } |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6556 | case WE_CAP_TSF: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6557 | ret = hdd_capture_tsf(adapter, (uint32_t *)value, 1); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6558 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6559 | case WE_GET_TEMPERATURE: |
| 6560 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6561 | hdd_debug("WE_GET_TEMPERATURE"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6562 | ret = wlan_hdd_get_temperature(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6563 | break; |
| 6564 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6565 | case WE_GET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6566 | hdd_debug("GET WMI_VDEV_PARAM_HE_DCM"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6567 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6568 | WMI_VDEV_PARAM_HE_DCM, |
| 6569 | VDEV_CMD); |
| 6570 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6571 | case WE_GET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6572 | hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6573 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6574 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 6575 | VDEV_CMD); |
| 6576 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6577 | default: |
| 6578 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6579 | hdd_err("Invalid IOCTL get_value command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6580 | value[0]); |
| 6581 | break; |
| 6582 | } |
| 6583 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6584 | hdd_exit(); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 6585 | qdf_mem_free(sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6586 | return ret; |
| 6587 | } |
| 6588 | |
| 6589 | static int iw_setnone_getint(struct net_device *dev, |
| 6590 | struct iw_request_info *info, |
| 6591 | union iwreq_data *wrqu, char *extra) |
| 6592 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6593 | int errno; |
| 6594 | struct osif_vdev_sync *vdev_sync; |
| 6595 | |
| 6596 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6597 | if (errno) |
| 6598 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6599 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6600 | errno = __iw_setnone_getint(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6601 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6602 | osif_vdev_sync_op_stop(vdev_sync); |
| 6603 | |
| 6604 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6605 | } |
| 6606 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6607 | static int hdd_set_fwtest(int argc, int cmd, int value) |
| 6608 | { |
| 6609 | struct set_fwtest_params *fw_test; |
| 6610 | |
| 6611 | /* check for max number of arguments */ |
| 6612 | if (argc > (WMA_MAX_NUM_ARGS) || |
| 6613 | argc != HDD_FWTEST_PARAMS) { |
| 6614 | hdd_err("Too Many args %d", argc); |
| 6615 | return -EINVAL; |
| 6616 | } |
| 6617 | /* |
| 6618 | * check if number of arguments are 3 then, check |
| 6619 | * then set the default value for sounding interval. |
| 6620 | */ |
| 6621 | if (HDD_FWTEST_PARAMS == argc) { |
| 6622 | if (HDD_FWTEST_SU_PARAM_ID == cmd && 0 == value) |
| 6623 | value = HDD_FWTEST_SU_DEFAULT_VALUE; |
| 6624 | if (HDD_FWTEST_MU_PARAM_ID == cmd && 0 == value) |
| 6625 | value = HDD_FWTEST_MU_DEFAULT_VALUE; |
| 6626 | } |
| 6627 | /* check sounding interval value should not exceed to max */ |
| 6628 | if (value > HDD_FWTEST_MAX_VALUE) { |
| 6629 | hdd_err("Invalid arguments value should not exceed max: %d", |
| 6630 | value); |
| 6631 | return -EINVAL; |
| 6632 | } |
| 6633 | fw_test = qdf_mem_malloc(sizeof(*fw_test)); |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 6634 | if (!fw_test) { |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6635 | hdd_err("qdf_mem_malloc failed for fw_test"); |
| 6636 | return -ENOMEM; |
| 6637 | } |
| 6638 | fw_test->arg = cmd; |
| 6639 | fw_test->value = value; |
| 6640 | if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) { |
| 6641 | qdf_mem_free(fw_test); |
| 6642 | hdd_err("Not able to post FW_TEST_CMD message to WMA"); |
| 6643 | return -EINVAL; |
| 6644 | } |
| 6645 | return 0; |
| 6646 | } |
| 6647 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6648 | /** |
| 6649 | * iw_set_three_ints_getnone() - Generic "set 3 params" private ioctl handler |
| 6650 | * @dev: device upon which the ioctl was received |
| 6651 | * @info: ioctl request information |
| 6652 | * @wrqu: ioctl request data |
| 6653 | * @extra: ioctl extra data |
| 6654 | * |
| 6655 | * Return: 0 on success, non-zero on error |
| 6656 | */ |
| 6657 | static int __iw_set_three_ints_getnone(struct net_device *dev, |
| 6658 | struct iw_request_info *info, |
| 6659 | union iwreq_data *wrqu, char *extra) |
| 6660 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6661 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6662 | int *value = (int *)extra; |
| 6663 | int sub_cmd = value[0]; |
| 6664 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6665 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6666 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6667 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6668 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6669 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6670 | |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6671 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6672 | hdd_err("permission check failed"); |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6673 | return -EPERM; |
| 6674 | } |
| 6675 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6676 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6677 | if (0 != ret) |
| 6678 | return ret; |
| 6679 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6680 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6681 | if (0 != ret) |
| 6682 | return ret; |
| 6683 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6684 | switch (sub_cmd) { |
| 6685 | |
| 6686 | case WE_SET_WLAN_DBG: |
Dustin Brown | 36e2e5c | 2017-05-16 15:41:37 -0700 | [diff] [blame] | 6687 | qdf_print_set_category_verbose(qdf_get_pidx(), value[1], |
| 6688 | value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6689 | break; |
| 6690 | case WE_SET_DP_TRACE: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6691 | qdf_dp_trace_set_value(value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6692 | break; |
Himanshu Agarwal | ad4c039 | 2018-05-08 16:53:36 +0530 | [diff] [blame] | 6693 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6694 | case WE_SET_DUAL_MAC_SCAN_CONFIG: |
| 6695 | hdd_debug("Ioctl to set dual mac scan config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6696 | status = |
| 6697 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 6698 | &dual_mac_feature); |
| 6699 | if (status != QDF_STATUS_SUCCESS) |
| 6700 | hdd_err("can't get dual mac feature val, use def"); |
| 6701 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6702 | hdd_err("Dual mac feature is disabled from INI"); |
| 6703 | return -EPERM; |
| 6704 | } |
| 6705 | hdd_debug("%d %d %d", value[1], value[2], value[3]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6706 | policy_mgr_set_dual_mac_scan_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6707 | value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6708 | break; |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6709 | case WE_SET_FW_TEST: |
| 6710 | { |
| 6711 | ret = hdd_set_fwtest(value[1], value[2], value[3]); |
| 6712 | if (ret) { |
| 6713 | hdd_err("Not able to set fwtest %d", ret); |
| 6714 | return ret; |
| 6715 | } |
| 6716 | } |
| 6717 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6718 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6719 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6720 | break; |
| 6721 | |
| 6722 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6723 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6724 | return ret; |
| 6725 | } |
| 6726 | |
| 6727 | int iw_set_three_ints_getnone(struct net_device *dev, |
| 6728 | struct iw_request_info *info, |
| 6729 | union iwreq_data *wrqu, char *extra) |
| 6730 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6731 | int errno; |
| 6732 | struct osif_vdev_sync *vdev_sync; |
| 6733 | |
| 6734 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6735 | if (errno) |
| 6736 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6737 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6738 | errno = __iw_set_three_ints_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6739 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6740 | osif_vdev_sync_op_stop(vdev_sync); |
| 6741 | |
| 6742 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6743 | } |
| 6744 | |
| 6745 | /** |
| 6746 | * hdd_connection_state_string() - Get connection state string |
| 6747 | * @connection_state: enum to be converted to a string |
| 6748 | * |
| 6749 | * Return: the string equivalent of @connection_state |
| 6750 | */ |
| 6751 | static const char * |
| 6752 | hdd_connection_state_string(eConnectionState connection_state) |
| 6753 | { |
| 6754 | switch (connection_state) { |
| 6755 | CASE_RETURN_STRING(eConnectionState_NotConnected); |
| 6756 | CASE_RETURN_STRING(eConnectionState_Connecting); |
| 6757 | CASE_RETURN_STRING(eConnectionState_Associated); |
| 6758 | CASE_RETURN_STRING(eConnectionState_IbssDisconnected); |
| 6759 | CASE_RETURN_STRING(eConnectionState_IbssConnected); |
| 6760 | CASE_RETURN_STRING(eConnectionState_Disconnecting); |
| 6761 | default: |
| 6762 | return "UNKNOWN"; |
| 6763 | } |
| 6764 | } |
| 6765 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6766 | #if defined(FEATURE_OEM_DATA_SUPPORT) |
| 6767 | /** |
| 6768 | * iw_get_oem_data_cap_wrapper() - wrapper function to call legacy or new |
| 6769 | * wifi_pos api to get oem data caps |
| 6770 | * @dev: net device upon which the request was received |
| 6771 | * @info: ioctl request information |
| 6772 | * @wrqu: ioctl request data |
| 6773 | * @extra: ioctl data payload |
| 6774 | * |
| 6775 | * Return: 0 for success, negative errno value on failure |
| 6776 | */ |
| 6777 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6778 | struct iw_request_info *info, |
| 6779 | union iwreq_data *wrqu, char *extra) |
| 6780 | { |
| 6781 | return iw_get_oem_data_cap(dev, info, wrqu, extra); |
| 6782 | } |
| 6783 | #elif defined(WIFI_POS_CONVERGED) |
| 6784 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6785 | struct iw_request_info *info, |
| 6786 | union iwreq_data *wrqu, char *extra) |
| 6787 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6788 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6789 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6790 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6791 | return os_if_wifi_pos_populate_caps(hdd_ctx->psoc, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6792 | (struct wifi_pos_driver_caps *)extra); |
| 6793 | } |
| 6794 | #else |
| 6795 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6796 | struct iw_request_info *info, |
| 6797 | union iwreq_data *wrqu, char *extra) |
| 6798 | { |
| 6799 | return -ENOTSUPP; |
| 6800 | } |
| 6801 | #endif |
| 6802 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 6803 | #ifdef WLAN_UNIT_TEST |
| 6804 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6805 | struct hdd_adapter *adapter, |
| 6806 | char *extra) |
| 6807 | { |
| 6808 | QDF_STATUS status; |
| 6809 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6810 | status = sme_get_sta_cxn_info(hdd_ctx->mac_handle, adapter->vdev_id, |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 6811 | extra, WE_MAX_STR_LEN); |
| 6812 | if (status != QDF_STATUS_SUCCESS) |
| 6813 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6814 | "\nNo active connection"); |
| 6815 | |
| 6816 | return 0; |
| 6817 | } |
| 6818 | #else |
| 6819 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6820 | struct hdd_adapter *adapter, |
| 6821 | char *extra) |
| 6822 | { |
| 6823 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6824 | "\nNot supported"); |
| 6825 | return -ENOTSUPP; |
| 6826 | } |
| 6827 | #endif |
| 6828 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6829 | /** |
| 6830 | * iw_get_char_setnone() - Generic "get string" private ioctl handler |
| 6831 | * @dev: device upon which the ioctl was received |
| 6832 | * @info: ioctl request information |
| 6833 | * @wrqu: ioctl request data |
| 6834 | * @extra: ioctl extra data |
| 6835 | * |
| 6836 | * Return: 0 on success, non-zero on error |
| 6837 | */ |
| 6838 | static int __iw_get_char_setnone(struct net_device *dev, |
| 6839 | struct iw_request_info *info, |
| 6840 | union iwreq_data *wrqu, char *extra) |
| 6841 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6842 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6843 | int sub_cmd = wrqu->data.flags; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6844 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6845 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6846 | int ret; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6847 | QDF_STATUS status; |
| 6848 | uint8_t value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6849 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6850 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6851 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6852 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6853 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6854 | if (0 != ret) |
| 6855 | return ret; |
| 6856 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6857 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6858 | if (0 != ret) |
| 6859 | return ret; |
| 6860 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6861 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6862 | switch (sub_cmd) { |
| 6863 | case WE_WLAN_VERSION: |
| 6864 | { |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 6865 | wrqu->data.length = hdd_wlan_get_version(hdd_ctx, |
| 6866 | WE_MAX_STR_LEN, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6867 | break; |
| 6868 | } |
| 6869 | |
| 6870 | case WE_GET_STATS: |
| 6871 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6872 | hdd_wlan_get_stats(adapter, &(wrqu->data.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6873 | extra, WE_MAX_STR_LEN); |
| 6874 | break; |
| 6875 | } |
| 6876 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6877 | case WE_GET_SUSPEND_RESUME_STATS: |
| 6878 | { |
| 6879 | ret = wlan_hdd_write_suspend_resume_stats(hdd_ctx, extra, |
| 6880 | WE_MAX_STR_LEN); |
| 6881 | if (ret >= 0) { |
| 6882 | wrqu->data.length = ret; |
| 6883 | ret = 0; |
| 6884 | } |
| 6885 | |
| 6886 | break; |
| 6887 | } |
| 6888 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6889 | case WE_LIST_FW_PROFILE: |
| 6890 | hdd_wlan_list_fw_profile(&(wrqu->data.length), |
| 6891 | extra, WE_MAX_STR_LEN); |
| 6892 | break; |
| 6893 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6894 | /* The case prints the current state of the HDD, SME, CSR, PE, |
| 6895 | * TL it can be extended for WDI Global State as well. And |
| 6896 | * currently it only checks P2P_CLIENT adapter. P2P_DEVICE |
| 6897 | * and P2P_GO have not been added as of now. |
| 6898 | */ |
| 6899 | case WE_GET_STATES: |
| 6900 | { |
| 6901 | int buf = 0, len = 0; |
| 6902 | int adapter_num = 0; |
| 6903 | int count = 0, check = 1; |
| 6904 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6905 | struct hdd_station_ctx *sta_ctx = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6906 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6907 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6908 | struct hdd_adapter *stat_adapter = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6909 | |
| 6910 | /* Print wlan0 or p2p0 states based on the adapter_num |
| 6911 | * by using the correct adapter |
| 6912 | */ |
| 6913 | while (adapter_num < 2) { |
| 6914 | if (WLAN_ADAPTER == adapter_num) { |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6915 | stat_adapter = adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6916 | buf = |
| 6917 | scnprintf(extra + len, |
| 6918 | WE_MAX_STR_LEN - len, |
| 6919 | "\n\n wlan0 States:-"); |
| 6920 | len += buf; |
| 6921 | } else if (P2P_ADAPTER == adapter_num) { |
| 6922 | buf = |
| 6923 | scnprintf(extra + len, |
| 6924 | WE_MAX_STR_LEN - len, |
| 6925 | "\n\n p2p0 States:-"); |
| 6926 | len += buf; |
| 6927 | |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6928 | if (!hdd_ctx) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6929 | buf = |
| 6930 | scnprintf(extra + len, |
| 6931 | WE_MAX_STR_LEN - |
| 6932 | len, |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6933 | "\n hdd_ctx is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6934 | len += buf; |
| 6935 | break; |
| 6936 | } |
| 6937 | |
| 6938 | /* Printing p2p0 states only in the |
| 6939 | * case when the device is configured |
| 6940 | * as a p2p_client |
| 6941 | */ |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6942 | stat_adapter = |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6943 | hdd_get_adapter(hdd_ctx, |
Krunal Soni | f07bb38 | 2016-03-10 13:02:11 -0800 | [diff] [blame] | 6944 | QDF_P2P_CLIENT_MODE); |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6945 | if (!stat_adapter) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6946 | buf = |
| 6947 | scnprintf(extra + len, |
| 6948 | WE_MAX_STR_LEN - |
| 6949 | len, |
| 6950 | "\n Device not configured as P2P_CLIENT."); |
| 6951 | len += buf; |
| 6952 | break; |
| 6953 | } |
| 6954 | } |
| 6955 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6956 | if (!mac_handle) { |
Jeff Johnson | 2a8a64f | 2018-04-28 12:31:36 -0700 | [diff] [blame] | 6957 | buf = scnprintf(extra + len, |
| 6958 | WE_MAX_STR_LEN - len, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6959 | "\n mac_handle is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6960 | len += buf; |
| 6961 | break; |
| 6962 | } |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6963 | sta_ctx = |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6964 | WLAN_HDD_GET_STATION_CTX_PTR(stat_adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6965 | |
| 6966 | |
| 6967 | buf = |
| 6968 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
| 6969 | "\n HDD Conn State - %s " |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6970 | "\n\n SME State:" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6971 | "\n Neighbour Roam State - %s" |
| 6972 | "\n CSR State - %s" |
| 6973 | "\n CSR Substate - %s", |
| 6974 | hdd_connection_state_string |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 6975 | (sta_ctx->conn_info.conn_state), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6976 | mac_trace_get_neighbour_roam_state |
| 6977 | (sme_get_neighbor_roam_state |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6978 | (mac_handle, stat_adapter->vdev_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6979 | mac_trace_getcsr_roam_state |
| 6980 | (sme_get_current_roam_state |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6981 | (mac_handle, stat_adapter->vdev_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6982 | mac_trace_getcsr_roam_sub_state |
| 6983 | (sme_get_current_roam_sub_state |
Jeff Johnson | e8e148f | 2019-03-23 12:25:52 -0700 | [diff] [blame] | 6984 | (mac_handle, stat_adapter->vdev_id)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6985 | ); |
| 6986 | len += buf; |
| 6987 | adapter_num++; |
| 6988 | } |
| 6989 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6990 | if (mac_handle) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6991 | /* Printing Lim State starting with global lim states */ |
| 6992 | buf = |
| 6993 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6994 | "\n\n LIM STATES:-" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6995 | "\n Global Sme State - %s " |
| 6996 | "\n Global mlm State - %s " "\n", |
| 6997 | mac_trace_get_lim_sme_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6998 | (sme_get_lim_sme_state(mac_handle)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6999 | mac_trace_get_lim_mlm_state |
Jeff Johnson | 71d465a | 2018-12-05 11:13:30 -0800 | [diff] [blame] | 7000 | (sme_get_lim_mlm_state(mac_handle)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7001 | ); |
| 7002 | len += buf; |
| 7003 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7004 | while (check < 3 && count < 255) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7005 | if (sme_is_lim_session_valid(mac_handle, count)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7006 | buf = |
| 7007 | scnprintf(extra + len, |
| 7008 | WE_MAX_STR_LEN - |
| 7009 | len, |
| 7010 | "\n Lim Valid Session %d:-" |
| 7011 | "\n PE Sme State - %s " |
| 7012 | "\n PE Mlm State - %s " |
| 7013 | "\n", check, |
| 7014 | mac_trace_get_lim_sme_state |
| 7015 | (sme_get_lim_sme_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7016 | (mac_handle, count)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7017 | mac_trace_get_lim_mlm_state |
| 7018 | (sme_get_lim_mlm_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7019 | (mac_handle, count)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7020 | ); |
| 7021 | |
| 7022 | len += buf; |
| 7023 | check++; |
| 7024 | } |
| 7025 | count++; |
| 7026 | } |
| 7027 | } |
| 7028 | |
| 7029 | wrqu->data.length = strlen(extra) + 1; |
| 7030 | break; |
| 7031 | } |
| 7032 | |
| 7033 | case WE_GET_CFG: |
| 7034 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7035 | hdd_debug("Printing CLD global INI Config"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7036 | hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(adapter), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7037 | extra, |
| 7038 | QCSAP_IOCTL_MAX_STR_LEN); |
| 7039 | wrqu->data.length = strlen(extra) + 1; |
| 7040 | break; |
| 7041 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7042 | case WE_GET_RSSI: |
| 7043 | { |
| 7044 | int8_t s7Rssi = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7045 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7046 | wlan_hdd_get_rssi(adapter, &s7Rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7047 | snprintf(extra, WE_MAX_STR_LEN, "rssi=%d", s7Rssi); |
| 7048 | wrqu->data.length = strlen(extra) + 1; |
| 7049 | break; |
| 7050 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7051 | |
| 7052 | case WE_GET_WMM_STATUS: |
| 7053 | { |
| 7054 | snprintf(extra, WE_MAX_STR_LEN, |
| 7055 | "\nDir: 0=up, 1=down, 3=both\n" |
| 7056 | "|------------------------|\n" |
| 7057 | "|AC | ACM |Admitted| Dir |\n" |
| 7058 | "|------------------------|\n" |
| 7059 | "|VO | %d | %3s | %d |\n" |
| 7060 | "|VI | %d | %3s | %d |\n" |
| 7061 | "|BE | %d | %3s | %d |\n" |
| 7062 | "|BK | %d | %3s | %d |\n" |
| 7063 | "|------------------------|\n", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7064 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7065 | ac_status[SME_AC_VO].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7066 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7067 | ac_status[SME_AC_VO]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7068 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7069 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7070 | ac_status[SME_AC_VO].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7071 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7072 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7073 | ac_status[SME_AC_VI].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7074 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7075 | ac_status[SME_AC_VI]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7076 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7077 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7078 | ac_status[SME_AC_VI].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7079 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7080 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7081 | ac_status[SME_AC_BE].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7082 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7083 | ac_status[SME_AC_BE]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7084 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7085 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7086 | ac_status[SME_AC_BE].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7087 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7088 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7089 | ac_status[SME_AC_BK].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7090 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7091 | ac_status[SME_AC_BK]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7092 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7093 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7094 | ac_status[SME_AC_BK].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7095 | ts_info.direction); |
| 7096 | |
| 7097 | wrqu->data.length = strlen(extra) + 1; |
| 7098 | break; |
| 7099 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 7100 | |
| 7101 | case WE_GET_BA_AGEING_TIMEOUT: |
| 7102 | { |
| 7103 | uint8_t ac_cat = 4; |
Srinivas Girigowda | 167ea82 | 2019-03-21 17:19:30 -0700 | [diff] [blame] | 7104 | uint32_t duration[QCA_WLAN_AC_ALL], i; |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 7105 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 7106 | |
| 7107 | if (!soc) { |
| 7108 | hdd_err("Invalid SOC handle"); |
| 7109 | break; |
| 7110 | } |
| 7111 | |
| 7112 | for (i = 0; i < ac_cat; i++) |
| 7113 | cdp_get_ba_timeout(soc, i, &duration[i]); |
| 7114 | |
| 7115 | snprintf(extra, WE_MAX_STR_LEN, |
| 7116 | "\n|------------------------------|\n" |
| 7117 | "|AC | BA aging timeout duration |\n" |
| 7118 | "|--------------------------------|\n" |
| 7119 | "|VO | %d |\n" |
| 7120 | "|VI | %d |\n" |
| 7121 | "|BE | %d |\n" |
| 7122 | "|BK | %d |\n" |
| 7123 | "|--------------------------------|\n", |
| 7124 | duration[3], duration[2], duration[1], duration[0]); |
| 7125 | |
| 7126 | wrqu->data.length = strlen(extra) + 1; |
| 7127 | break; |
| 7128 | } |
| 7129 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7130 | case WE_GET_CHANNEL_LIST: |
| 7131 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7132 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7133 | uint8_t i, len; |
| 7134 | char *buf; |
Wu Gao | aa15514 | 2019-01-14 15:09:26 +0800 | [diff] [blame] | 7135 | uint8_t ubuf[CFG_COUNTRY_CODE_LEN]; |
| 7136 | uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; |
Srinivas Girigowda | c231df6 | 2017-03-24 18:27:57 -0700 | [diff] [blame] | 7137 | struct channel_list_info channel_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7138 | |
| 7139 | memset(&channel_list, 0, sizeof(channel_list)); |
Agrawal Ashish | 6c9bca7 | 2016-09-04 13:37:59 +0530 | [diff] [blame] | 7140 | status = iw_get_channel_list(dev, info, wrqu, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7141 | (char *)&channel_list); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7142 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7143 | hdd_err("GetChannelList Failed!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7144 | return -EINVAL; |
| 7145 | } |
| 7146 | buf = extra; |
| 7147 | /* |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 7148 | * Maximum channels = CFG_VALID_CHANNEL_LIST_LEN. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7149 | * Maximum buffer needed = 5 * number of channels. |
| 7150 | * Check ifsufficient buffer is available and then |
| 7151 | * proceed to fill the buffer. |
| 7152 | */ |
| 7153 | if (WE_MAX_STR_LEN < |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 7154 | (5 * CFG_VALID_CHANNEL_LIST_LEN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7155 | hdd_err("Insufficient Buffer to populate channel list"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7156 | return -EINVAL; |
| 7157 | } |
| 7158 | len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", |
| 7159 | channel_list.num_channels); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7160 | if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, |
| 7161 | ubuf, |
| 7162 | &ubuf_len)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7163 | /* Printing Country code in getChannelList */ |
| 7164 | for (i = 0; i < (ubuf_len - 1); i++) |
| 7165 | len += scnprintf(buf + len, |
| 7166 | WE_MAX_STR_LEN - len, |
| 7167 | "%c", ubuf[i]); |
| 7168 | } |
| 7169 | for (i = 0; i < channel_list.num_channels; i++) { |
| 7170 | len += |
| 7171 | scnprintf(buf + len, WE_MAX_STR_LEN - len, |
| 7172 | " %u", channel_list.channels[i]); |
| 7173 | } |
| 7174 | wrqu->data.length = strlen(extra) + 1; |
| 7175 | |
| 7176 | break; |
| 7177 | } |
| 7178 | #ifdef FEATURE_WLAN_TDLS |
| 7179 | case WE_GET_TDLS_PEERS: |
| 7180 | { |
| 7181 | wrqu->data.length = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7182 | wlan_hdd_tdls_get_all_peers(adapter, extra, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7183 | WE_MAX_STR_LEN) + 1; |
| 7184 | break; |
| 7185 | } |
| 7186 | #endif |
| 7187 | #ifdef WLAN_FEATURE_11W |
| 7188 | case WE_GET_11W_INFO: |
| 7189 | { |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7190 | struct csr_roam_profile *roam_profile = |
| 7191 | hdd_roam_profile(adapter); |
| 7192 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7193 | hdd_debug("WE_GET_11W_ENABLED = %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7194 | roam_profile->MFPEnabled); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7195 | |
| 7196 | snprintf(extra, WE_MAX_STR_LEN, |
| 7197 | "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d" |
| 7198 | "\n Number of Unprotected Disassocs %d" |
| 7199 | "\n Number of Unprotected Deauths %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7200 | roam_profile->BSSIDs.bssid->bytes[0], |
| 7201 | roam_profile->BSSIDs.bssid->bytes[1], |
| 7202 | roam_profile->BSSIDs.bssid->bytes[2], |
| 7203 | roam_profile->BSSIDs.bssid->bytes[3], |
| 7204 | roam_profile->BSSIDs.bssid->bytes[4], |
| 7205 | roam_profile->BSSIDs.bssid->bytes[5], |
| 7206 | roam_profile->MFPEnabled, |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 7207 | adapter->hdd_stats.hdd_pmf_stats. |
| 7208 | num_unprot_disassoc_rx, |
| 7209 | adapter->hdd_stats.hdd_pmf_stats. |
| 7210 | num_unprot_deauth_rx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7211 | |
| 7212 | wrqu->data.length = strlen(extra) + 1; |
| 7213 | break; |
| 7214 | } |
| 7215 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7216 | case WE_GET_IBSS_STA_INFO: |
| 7217 | { |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7218 | struct hdd_station_ctx *sta_ctx = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7219 | WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7220 | int idx = 0; |
| 7221 | int length = 0, buf = 0; |
| 7222 | |
Naveen Rawat | c45d162 | 2016-07-05 12:20:09 -0700 | [diff] [blame] | 7223 | for (idx = 0; idx < MAX_PEERS; idx++) { |
Naveen Rawat | ac027cb | 2017-04-27 15:02:42 -0700 | [diff] [blame] | 7224 | if (HDD_WLAN_INVALID_STA_ID != |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 7225 | sta_ctx->conn_info.sta_id[idx]) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7226 | buf = snprintf |
| 7227 | ((extra + length), |
| 7228 | WE_MAX_STR_LEN - length, |
| 7229 | "\n%d .%02x:%02x:%02x:%02x:%02x:%02x\n", |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 7230 | sta_ctx->conn_info.sta_id[idx], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7231 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7232 | peer_macaddr[idx].bytes[0], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7233 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7234 | peer_macaddr[idx].bytes[1], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7235 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7236 | peer_macaddr[idx].bytes[2], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7237 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7238 | peer_macaddr[idx].bytes[3], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7239 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7240 | peer_macaddr[idx].bytes[4], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7241 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7242 | peer_macaddr[idx].bytes[5] |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7243 | ); |
| 7244 | length += buf; |
| 7245 | } |
| 7246 | } |
| 7247 | wrqu->data.length = strlen(extra) + 1; |
| 7248 | break; |
| 7249 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7250 | case WE_GET_PHYMODE: |
| 7251 | { |
| 7252 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7253 | struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7254 | eCsrPhyMode phymode; |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7255 | enum band_info current_band; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 7256 | struct sme_config_params *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7257 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7258 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 7259 | if (!sme_config) { |
| 7260 | hdd_err("Out of memory"); |
| 7261 | ret = -ENOMEM; |
| 7262 | break; |
| 7263 | } |
| 7264 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7265 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7266 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7267 | sme_config->csrConfig.channelBondingMode24GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7268 | ch_bond24 = true; |
| 7269 | |
| 7270 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7271 | sme_config->csrConfig.channelBondingMode5GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7272 | ch_bond5g = true; |
| 7273 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7274 | qdf_mem_free(sme_config); |
| 7275 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7276 | phymode = sme_get_phy_mode(mac_handle); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7277 | if ((QDF_STATUS_SUCCESS != |
Harprit Chhabada | 5dff30e | 2019-03-12 17:56:45 -0700 | [diff] [blame] | 7278 | ucfg_reg_get_band(hddctx->pdev, ¤t_band))) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7279 | hdd_err("Failed to get current band config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7280 | return -EIO; |
| 7281 | } |
| 7282 | |
| 7283 | switch (phymode) { |
| 7284 | case eCSR_DOT11_MODE_AUTO: |
| 7285 | snprintf(extra, WE_MAX_STR_LEN, "AUTO MODE"); |
| 7286 | break; |
| 7287 | case eCSR_DOT11_MODE_11n: |
| 7288 | case eCSR_DOT11_MODE_11n_ONLY: |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7289 | if (current_band == BAND_2G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7290 | if (ch_bond24) |
| 7291 | snprintf(extra, WE_MAX_STR_LEN, |
| 7292 | "11NGHT40"); |
| 7293 | else |
| 7294 | snprintf(extra, WE_MAX_STR_LEN, |
| 7295 | "11NGHT20"); |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7296 | } else if (current_band == BAND_5G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7297 | if (ch_bond5g) |
| 7298 | snprintf(extra, WE_MAX_STR_LEN, |
| 7299 | "11NAHT40"); |
| 7300 | else |
| 7301 | snprintf(extra, WE_MAX_STR_LEN, |
| 7302 | "11NAHT20"); |
| 7303 | } else { |
| 7304 | snprintf(extra, WE_MAX_STR_LEN, "11N"); |
| 7305 | } |
| 7306 | break; |
| 7307 | case eCSR_DOT11_MODE_abg: |
| 7308 | snprintf(extra, WE_MAX_STR_LEN, "11ABG"); |
| 7309 | break; |
| 7310 | case eCSR_DOT11_MODE_11a: |
| 7311 | snprintf(extra, WE_MAX_STR_LEN, "11A"); |
| 7312 | break; |
| 7313 | case eCSR_DOT11_MODE_11b: |
| 7314 | case eCSR_DOT11_MODE_11b_ONLY: |
| 7315 | snprintf(extra, WE_MAX_STR_LEN, "11B"); |
| 7316 | break; |
| 7317 | case eCSR_DOT11_MODE_11g: |
| 7318 | case eCSR_DOT11_MODE_11g_ONLY: |
| 7319 | snprintf(extra, WE_MAX_STR_LEN, "11G"); |
| 7320 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7321 | case eCSR_DOT11_MODE_11ac: |
| 7322 | case eCSR_DOT11_MODE_11ac_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7323 | status = |
| 7324 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7325 | &value); |
| 7326 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7327 | hdd_err("Failed to set channel_width"); |
| 7328 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7329 | snprintf(extra, WE_MAX_STR_LEN, |
| 7330 | "11ACVHT20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7331 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7332 | snprintf(extra, WE_MAX_STR_LEN, |
| 7333 | "11ACVHT40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7334 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7335 | snprintf(extra, WE_MAX_STR_LEN, |
| 7336 | "11ACVHT80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7337 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7338 | snprintf(extra, WE_MAX_STR_LEN, |
| 7339 | "11ACVHT160"); |
| 7340 | break; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7341 | case eCSR_DOT11_MODE_11ax: |
| 7342 | case eCSR_DOT11_MODE_11ax_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7343 | status = |
| 7344 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7345 | &value); |
| 7346 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7347 | hdd_err("Failed to set channel_width"); |
| 7348 | |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7349 | /* currently using vhtChannelWidth */ |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7350 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7351 | snprintf(extra, WE_MAX_STR_LEN, |
| 7352 | "11AX_HE_20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7353 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7354 | snprintf(extra, WE_MAX_STR_LEN, |
| 7355 | "11AX_HE_40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7356 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7357 | snprintf(extra, WE_MAX_STR_LEN, |
| 7358 | "11AX_HE_80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7359 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7360 | snprintf(extra, WE_MAX_STR_LEN, |
| 7361 | "11AX_HE_160"); |
| 7362 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7363 | } |
| 7364 | |
| 7365 | wrqu->data.length = strlen(extra) + 1; |
| 7366 | break; |
| 7367 | } |
| 7368 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7369 | case WE_GET_OEM_DATA_CAP: |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 7370 | return iw_get_oem_data_cap_wrapper(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7371 | case WE_GET_SNR: |
| 7372 | { |
| 7373 | int8_t s7snr = 0; |
| 7374 | int status = 0; |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7375 | struct hdd_context *hdd_ctx; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7376 | struct hdd_station_ctx *sta_ctx; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7377 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7378 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7379 | status = wlan_hdd_validate_context(hdd_ctx); |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7380 | if (status) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7381 | return status; |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7382 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7383 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | a8fef4e | 2019-03-11 14:38:49 -0700 | [diff] [blame] | 7384 | if (!hdd_ctx->config->enable_snr_monitoring || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7385 | eConnectionState_Associated != |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 7386 | sta_ctx->conn_info.conn_state) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7387 | hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d", |
Jeff Johnson | a8fef4e | 2019-03-11 14:38:49 -0700 | [diff] [blame] | 7388 | hdd_ctx->config->enable_snr_monitoring, |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 7389 | sta_ctx->conn_info.conn_state); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7390 | return -ENONET; |
| 7391 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7392 | wlan_hdd_get_snr(adapter, &s7snr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7393 | snprintf(extra, WE_MAX_STR_LEN, "snr=%d", s7snr); |
| 7394 | wrqu->data.length = strlen(extra) + 1; |
| 7395 | break; |
| 7396 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7397 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 7398 | case WE_GET_STA_CXN_INFO: |
| 7399 | ret = hdd_get_sta_cxn_info(hdd_ctx, adapter, extra); |
| 7400 | wrqu->data.length = strlen(extra) + 1; |
| 7401 | break; |
| 7402 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7403 | default: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7404 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7405 | break; |
| 7406 | } |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7407 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7408 | hdd_exit(); |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7409 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7410 | } |
| 7411 | |
| 7412 | static int iw_get_char_setnone(struct net_device *dev, |
| 7413 | struct iw_request_info *info, |
| 7414 | union iwreq_data *wrqu, char *extra) |
| 7415 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7416 | int errno; |
| 7417 | struct osif_vdev_sync *vdev_sync; |
| 7418 | |
| 7419 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 7420 | if (errno) |
| 7421 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7422 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7423 | errno = __iw_get_char_setnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7424 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7425 | osif_vdev_sync_op_stop(vdev_sync); |
| 7426 | |
| 7427 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7428 | } |
| 7429 | |
| 7430 | /** |
| 7431 | * iw_setnone_getnone() - Generic "action" private ioctl handler |
| 7432 | * @dev: device upon which the ioctl was received |
| 7433 | * @info: ioctl request information |
| 7434 | * @wrqu: ioctl request data |
| 7435 | * @extra: ioctl extra data |
| 7436 | * |
| 7437 | * Return: 0 on success, non-zero on error |
| 7438 | */ |
| 7439 | static int __iw_setnone_getnone(struct net_device *dev, |
| 7440 | struct iw_request_info *info, |
| 7441 | union iwreq_data *wrqu, char *extra) |
| 7442 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7443 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7444 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7445 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7446 | int ret; |
| 7447 | int sub_cmd; |
| 7448 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7449 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7450 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7451 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7452 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7453 | if (0 != ret) |
| 7454 | return ret; |
| 7455 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7456 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7457 | if (0 != ret) |
| 7458 | return ret; |
| 7459 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7460 | #ifdef CONFIG_COMPAT |
| 7461 | /* this ioctl is a special case where a sub-ioctl is used and both |
| 7462 | * the number of get and set args is 0. in this specific case the |
| 7463 | * logic in iwpriv places the sub_cmd in the data.flags portion of |
| 7464 | * the iwreq. unfortunately the location of this field will be |
| 7465 | * different between 32-bit and 64-bit userspace, and the standard |
| 7466 | * compat support in the kernel does not handle this case. so we |
| 7467 | * need to explicitly handle it here. |
| 7468 | */ |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 7469 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7470 | struct compat_iw_point *compat_iw_point = |
| 7471 | (struct compat_iw_point *)&wrqu->data; |
| 7472 | sub_cmd = compat_iw_point->flags; |
| 7473 | } else { |
| 7474 | sub_cmd = wrqu->data.flags; |
| 7475 | } |
| 7476 | #else |
| 7477 | sub_cmd = wrqu->data.flags; |
| 7478 | #endif |
| 7479 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7480 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7481 | switch (sub_cmd) { |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7482 | case WE_GET_FW_PROFILE_DATA: |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7483 | ret = wma_cli_set_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7484 | WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, |
| 7485 | 0, DBG_CMD); |
| 7486 | break; |
| 7487 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7488 | case WE_IBSS_GET_PEER_INFO_ALL: |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7489 | hdd_wlan_get_ibss_peer_info_all(adapter); |
| 7490 | break; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7491 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7492 | case WE_SET_REASSOC_TRIGGER: |
| 7493 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7494 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7495 | tSirMacAddr bssid; |
Jeff Johnson | 29c7867 | 2019-02-26 21:05:53 -0800 | [diff] [blame] | 7496 | uint32_t roam_id = INVALID_ROAM_ID; |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7497 | uint8_t operating_ch = |
Jeff Johnson | 8626e93 | 2019-02-27 18:35:22 -0800 | [diff] [blame] | 7498 | adapter->session.station.conn_info.channel; |
Jeff Johnson | 9ff1695 | 2019-02-26 20:58:44 -0800 | [diff] [blame] | 7499 | tCsrRoamModifyProfileFields mod_fields; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7500 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7501 | sme_get_modify_profile_fields(mac_handle, adapter->vdev_id, |
Jeff Johnson | 9ff1695 | 2019-02-26 20:58:44 -0800 | [diff] [blame] | 7502 | &mod_fields); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7503 | if (roaming_offload_enabled(hdd_ctx)) { |
| 7504 | qdf_mem_copy(bssid, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 7505 | &adapter->session.station.conn_info.bssid, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7506 | sizeof(bssid)); |
Naveen Rawat | 664a7cb | 2017-01-19 17:58:14 -0800 | [diff] [blame] | 7507 | hdd_wma_send_fastreassoc_cmd(adapter, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7508 | bssid, operating_ch); |
| 7509 | } else { |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7510 | sme_roam_reassoc(mac_handle, adapter->vdev_id, |
Jeff Johnson | 29c7867 | 2019-02-26 21:05:53 -0800 | [diff] [blame] | 7511 | NULL, mod_fields, &roam_id, 1); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7512 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7513 | return 0; |
| 7514 | } |
| 7515 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7516 | case WE_STOP_OBSS_SCAN: |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7517 | /* |
| 7518 | * 1.OBSS Scan is mandatory while operating in 2.4GHz |
| 7519 | * 2.OBSS scan is stopped by Firmware during the disassociation |
| 7520 | * 3.OBSS stop comamnd is added for debugging purpose |
| 7521 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7522 | if (!mac_handle) { |
| 7523 | hdd_err("mac_handle context is NULL"); |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7524 | return -EINVAL; |
| 7525 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7526 | sme_ht40_stop_obss_scan(mac_handle, adapter->vdev_id); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7527 | break; |
| 7528 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7529 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7530 | hdd_err("unknown ioctl %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7531 | break; |
| 7532 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7533 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7534 | return ret; |
| 7535 | } |
| 7536 | |
| 7537 | static int iw_setnone_getnone(struct net_device *dev, |
| 7538 | struct iw_request_info *info, |
| 7539 | union iwreq_data *wrqu, char *extra) |
| 7540 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7541 | int errno; |
| 7542 | struct osif_vdev_sync *vdev_sync; |
| 7543 | |
| 7544 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 7545 | if (errno) |
| 7546 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7547 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7548 | errno = __iw_setnone_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7549 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7550 | osif_vdev_sync_op_stop(vdev_sync); |
| 7551 | |
| 7552 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7553 | } |
| 7554 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7555 | #ifdef MPC_UT_FRAMEWORK |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7556 | static void |
| 7557 | hdd_policy_mgr_set_hw_mode_ut(struct hdd_context *hdd_ctx, |
| 7558 | struct hdd_adapter *adapter, int cmd) |
| 7559 | { |
| 7560 | enum hw_mode_ss_config mac0_ss; |
| 7561 | enum hw_mode_bandwidth mac0_bw; |
| 7562 | enum hw_mode_ss_config mac1_ss; |
| 7563 | enum hw_mode_bandwidth mac1_bw; |
| 7564 | enum hw_mode_mac_band_cap mac0_band_cap; |
| 7565 | enum hw_mode_dbs_capab dbs; |
| 7566 | |
| 7567 | switch (cmd) { |
| 7568 | case 0: |
| 7569 | hdd_debug("set hw mode for single mac"); |
| 7570 | mac0_ss = HW_MODE_SS_2x2; |
| 7571 | mac0_bw = HW_MODE_80_MHZ; |
| 7572 | mac1_ss = HW_MODE_SS_0x0; |
| 7573 | mac1_bw = HW_MODE_BW_NONE; |
| 7574 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7575 | dbs = HW_MODE_DBS_NONE; |
| 7576 | break; |
| 7577 | case 1: |
| 7578 | hdd_debug("set hw mode for dual mac"); |
| 7579 | mac0_ss = HW_MODE_SS_1x1; |
| 7580 | mac0_bw = HW_MODE_80_MHZ; |
| 7581 | mac1_ss = HW_MODE_SS_1x1; |
| 7582 | mac1_bw = HW_MODE_40_MHZ; |
| 7583 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7584 | dbs = HW_MODE_DBS; |
| 7585 | break; |
| 7586 | case 2: |
| 7587 | hdd_debug("set hw mode for 2x2 5g + 1x1 2g"); |
| 7588 | mac0_ss = HW_MODE_SS_2x2; |
| 7589 | mac0_bw = HW_MODE_80_MHZ; |
| 7590 | mac1_ss = HW_MODE_SS_1x1; |
| 7591 | mac1_bw = HW_MODE_40_MHZ; |
| 7592 | mac0_band_cap = HW_MODE_MAC_BAND_5G; |
| 7593 | dbs = HW_MODE_DBS; |
| 7594 | break; |
| 7595 | case 3: |
| 7596 | hdd_debug("set hw mode for 2x2 2g + 1x1 5g"); |
| 7597 | mac0_ss = HW_MODE_SS_2x2; |
| 7598 | mac0_bw = HW_MODE_40_MHZ; |
| 7599 | mac1_ss = HW_MODE_SS_1x1; |
| 7600 | mac1_bw = HW_MODE_40_MHZ; |
| 7601 | mac0_band_cap = HW_MODE_MAC_BAND_2G; |
| 7602 | dbs = HW_MODE_DBS; |
| 7603 | break; |
| 7604 | default: |
| 7605 | hdd_err("unknown cmd %d", cmd); |
| 7606 | return; |
| 7607 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7608 | policy_mgr_pdev_set_hw_mode(hdd_ctx->psoc, adapter->vdev_id, |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7609 | mac0_ss, mac0_bw, mac1_ss, mac1_bw, |
| 7610 | mac0_band_cap, dbs, HW_MODE_AGILE_DFS_NONE, |
| 7611 | HW_MODE_SBS_NONE, |
| 7612 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
| 7613 | } |
| 7614 | |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7615 | 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] | 7616 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7617 | { |
Jeff Johnson | ac8b0de | 2017-02-10 09:22:22 -0800 | [diff] [blame] | 7618 | switch (sub_cmd) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7619 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7620 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7621 | hdd_debug("<iwpriv wlan0 pm_clist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7622 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7623 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7624 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7625 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7626 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7627 | return 0; |
| 7628 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7629 | policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7630 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7631 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7632 | } |
| 7633 | break; |
| 7634 | |
| 7635 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7636 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7637 | hdd_debug("<iwpriv wlan0 pm_dlist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7638 | if ((apps_args[0] < 0) || (apps_args[1] < 0)) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7639 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7640 | return 0; |
| 7641 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7642 | policy_mgr_decr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7643 | apps_args[0], apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7644 | } |
| 7645 | break; |
| 7646 | |
| 7647 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7648 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7649 | hdd_debug("<iwpriv wlan0 pm_ulist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7650 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7651 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7652 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7653 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7654 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7655 | return 0; |
| 7656 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7657 | policy_mgr_update_connection_info_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7658 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7659 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7660 | } |
| 7661 | break; |
| 7662 | |
| 7663 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7664 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7665 | hdd_debug("<iwpriv wlan0 pm_dbs> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7666 | if (apps_args[0] == 0) |
| 7667 | wma_set_dbs_capability_ut(0); |
| 7668 | else |
| 7669 | wma_set_dbs_capability_ut(1); |
| 7670 | |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7671 | if (apps_args[1] >= PM_THROUGHPUT && |
| 7672 | apps_args[1] <= PM_LATENCY) { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7673 | hdd_debug("setting system pref to [%d]\n", |
| 7674 | apps_args[1]); |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 7675 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, |
| 7676 | apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7677 | } |
| 7678 | } |
| 7679 | break; |
| 7680 | |
| 7681 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7682 | { |
| 7683 | uint8_t pcl[QDF_MAX_NUM_CHAN] = {0}; |
| 7684 | uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0}; |
| 7685 | uint32_t pcl_len = 0, i = 0; |
| 7686 | |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7687 | hdd_debug("<iwpriv wlan0 pm_pcl> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7688 | |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7689 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7690 | hdd_err("Invalid input param received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7691 | return 0; |
| 7692 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7693 | policy_mgr_get_pcl(hdd_ctx->psoc, apps_args[0], |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7694 | pcl, &pcl_len, |
| 7695 | weight_list, QDF_ARRAY_SIZE(weight_list)); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7696 | hdd_debug("PCL list for role[%d] is {", apps_args[0]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7697 | for (i = 0 ; i < pcl_len; i++) |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7698 | hdd_debug(" %d, ", pcl[i]); |
| 7699 | hdd_debug("}--------->\n"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7700 | } |
| 7701 | break; |
| 7702 | |
| 7703 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7704 | { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7705 | hdd_debug("pm_set_hw_mode cmd %d", apps_args[0]); |
| 7706 | 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] | 7707 | } |
| 7708 | break; |
| 7709 | |
| 7710 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7711 | { |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7712 | hdd_debug("<iwpriv wlan0 pm_query_action> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7713 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7714 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7715 | return 0; |
| 7716 | } |
Tushnim Bhattacharyya | dfbce70 | 2018-03-27 12:46:48 -0700 | [diff] [blame] | 7717 | policy_mgr_current_connections_update( |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7718 | hdd_ctx->psoc, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7719 | adapter->vdev_id, apps_args[0], |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 7720 | POLICY_MGR_UPDATE_REASON_UT); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7721 | } |
| 7722 | break; |
| 7723 | |
| 7724 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7725 | { |
| 7726 | bool allow; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7727 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 7728 | hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7729 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7730 | (apps_args[2] < 0)) { |
| 7731 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7732 | return 0; |
| 7733 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7734 | allow = policy_mgr_allow_concurrency(hdd_ctx->psoc, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7735 | apps_args[0], apps_args[1], apps_args[2]); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7736 | hdd_debug("allow %d {0 = don't allow, 1 = allow}", allow); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7737 | } |
| 7738 | break; |
| 7739 | |
| 7740 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7741 | { |
| 7742 | clean_report(hdd_ctx); |
| 7743 | if (apps_args[0] == 1) { |
| 7744 | wlan_hdd_one_connection_scenario(hdd_ctx); |
| 7745 | } else if (apps_args[0] == 2) { |
| 7746 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7747 | 6, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7748 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7749 | 36, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7750 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7751 | 6, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7752 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7753 | 36, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7754 | } else if (apps_args[0] == 3) { |
| 7755 | /* MCC on same band with 2x2 same mac*/ |
| 7756 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7757 | 6, 11, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7758 | /* MCC on diff band with 2x2 same mac*/ |
| 7759 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7760 | 6, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7761 | /* MCC on diff band with 1x1 diff mac */ |
| 7762 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7763 | 36, 6, POLICY_MGR_ONE_ONE, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7764 | /* MCC on diff band with 1x1 same mac */ |
| 7765 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7766 | 36, 6, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7767 | /* SCC on same band with 2x2 same mac */ |
| 7768 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7769 | 36, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7770 | /* SCC on same band with 1x1 same mac */ |
| 7771 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7772 | 36, 36, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7773 | /* MCC on same band with 2x2 same mac */ |
| 7774 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7775 | 36, 149, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7776 | /* MCC on same band with 1x1 same mac */ |
| 7777 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7778 | 36, 149, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7779 | } |
| 7780 | print_report(hdd_ctx); |
| 7781 | } |
| 7782 | break; |
| 7783 | } |
| 7784 | return 0; |
| 7785 | } |
| 7786 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7787 | 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] | 7788 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7789 | { |
| 7790 | return 0; |
| 7791 | } |
| 7792 | #endif |
| 7793 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7794 | /** |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7795 | * hdd_ch_avoid_unit_cmd - unit test ch avoidance |
| 7796 | * @hdd_ctx: hdd_context |
| 7797 | * @num_args: input args number |
| 7798 | * @apps_args: args data ptr |
| 7799 | * |
| 7800 | * This is to inject a ch avoid event to do unit test SAP chan avoidance. |
| 7801 | * |
| 7802 | * Return: void |
| 7803 | */ |
| 7804 | #if WLAN_DEBUG |
| 7805 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7806 | int num_args, int *apps_args) |
| 7807 | { |
| 7808 | struct ch_avoid_ind_type ch_avoid; |
| 7809 | int cnt = 0, i; |
| 7810 | |
| 7811 | if (num_args < 2 || num_args > CH_AVOID_MAX_RANGE * 2 || |
| 7812 | num_args % 2 != 0) |
| 7813 | return; |
| 7814 | hdd_info("simulate ch avoid num_args %d", num_args); |
| 7815 | for (i = 0; i < num_args && i < CH_AVOID_MAX_RANGE * 2; i++) { |
| 7816 | ch_avoid.avoid_freq_range[cnt].start_freq = |
| 7817 | apps_args[i]; |
| 7818 | ch_avoid.avoid_freq_range[cnt].end_freq = |
| 7819 | apps_args[++i]; |
| 7820 | |
| 7821 | hdd_info("simulate ch avoid [%d %d]", |
| 7822 | ch_avoid.avoid_freq_range[cnt].start_freq, |
| 7823 | ch_avoid.avoid_freq_range[cnt].end_freq); |
| 7824 | cnt++; |
| 7825 | } |
| 7826 | ch_avoid.ch_avoid_range_cnt = cnt; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7827 | ucfg_reg_unit_simulate_ch_avoid(hdd_ctx->psoc, &ch_avoid); |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7828 | } |
| 7829 | #else |
| 7830 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7831 | int num_args, int *apps_args) |
| 7832 | { |
| 7833 | } |
| 7834 | #endif |
| 7835 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7836 | * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7837 | * @dev: device upon which the ioctl was received |
| 7838 | * @info: ioctl request information |
| 7839 | * @wrqu: ioctl request data |
| 7840 | * @extra: ioctl extra data |
| 7841 | * |
| 7842 | * This is an SSR-protected generic handler for private ioctls which |
| 7843 | * take multiple arguments. Note that this implementation is also |
| 7844 | * somewhat unique in that it is shared by both STA-mode and SAP-mode |
| 7845 | * interfaces. |
| 7846 | * |
| 7847 | * Return: 0 on success, non-zero on error |
| 7848 | */ |
| 7849 | static int __iw_set_var_ints_getnone(struct net_device *dev, |
| 7850 | struct iw_request_info *info, |
| 7851 | union iwreq_data *wrqu, char *extra) |
| 7852 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7853 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7854 | mac_handle_t mac_handle; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7855 | 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] | 7856 | int sub_cmd; |
| 7857 | int *apps_args = (int *) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7858 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7859 | int ret, num_args; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7860 | void *soc = NULL; |
| 7861 | struct cdp_pdev *pdev = NULL; |
| 7862 | struct cdp_vdev *vdev = NULL; |
| 7863 | struct cdp_txrx_stats_req req = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7864 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7865 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7866 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7867 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7868 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7869 | if (0 != ret) |
| 7870 | return ret; |
| 7871 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7872 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7873 | if (0 != ret) |
| 7874 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7875 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7876 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7877 | sub_cmd = wrqu->data.flags; |
| 7878 | num_args = wrqu->data.length; |
| 7879 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7880 | hdd_debug("Received length %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7881 | |
| 7882 | switch (sub_cmd) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7883 | case WE_IBSS_GET_PEER_INFO: |
| 7884 | { |
| 7885 | pr_info("Station ID = %d\n", apps_args[0]); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7886 | hdd_wlan_get_ibss_peer_info(adapter, apps_args[0]); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7887 | } |
| 7888 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7889 | |
| 7890 | case WE_P2P_NOA_CMD: |
| 7891 | { |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7892 | struct p2p_app_set_ps p2p_noa; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7893 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7894 | if (adapter->device_mode != QDF_P2P_GO_MODE) { |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7895 | hdd_err("Setting NoA is not allowed in Device mode %s(%d)", |
Dustin Brown | 458027c | 2018-10-19 12:26:27 -0700 | [diff] [blame] | 7896 | qdf_opmode_str(adapter->device_mode), |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7897 | adapter->device_mode); |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7898 | return -EINVAL; |
| 7899 | } |
| 7900 | |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7901 | p2p_noa.opp_ps = apps_args[0]; |
Jeff Johnson | cc9c7bb | 2019-03-23 09:28:41 -0700 | [diff] [blame] | 7902 | p2p_noa.ct_window = apps_args[1]; |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7903 | p2p_noa.duration = apps_args[2]; |
| 7904 | p2p_noa.interval = apps_args[3]; |
| 7905 | p2p_noa.count = apps_args[4]; |
| 7906 | p2p_noa.single_noa_duration = apps_args[5]; |
Jeff Johnson | cc9c7bb | 2019-03-23 09:28:41 -0700 | [diff] [blame] | 7907 | p2p_noa.ps_selection = apps_args[6]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7908 | |
Jeff Johnson | cc9c7bb | 2019-03-23 09:28:41 -0700 | [diff] [blame] | 7909 | hdd_debug("P2P_NOA_ATTR:opp ps %d ct window %d duration %d interval %d count %d single noa duration %d ps selection %x", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7910 | apps_args[0], apps_args[1], apps_args[2], |
| 7911 | apps_args[3], apps_args[4], |
| 7912 | apps_args[5], apps_args[6]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7913 | |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7914 | hdd_set_p2p_ps(dev, &p2p_noa); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7915 | |
| 7916 | } |
| 7917 | break; |
| 7918 | |
| 7919 | case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD: |
| 7920 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7921 | hdd_debug("SELECTIVE_MODULE_LOG %d arg1 %d arg2", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7922 | apps_args[0], apps_args[1]); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 7923 | qdf_trace_enable(apps_args[0], apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7924 | } |
| 7925 | break; |
| 7926 | |
| 7927 | case WE_MTRACE_DUMP_CMD: |
| 7928 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7929 | 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] | 7930 | apps_args[0], apps_args[1], |
| 7931 | apps_args[2], apps_args[3]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7932 | qdf_trace_dump_all((void *)mac_handle, apps_args[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7933 | apps_args[1], apps_args[2], |
| 7934 | apps_args[3]); |
| 7935 | |
| 7936 | } |
| 7937 | break; |
| 7938 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7939 | case WE_POLICY_MANAGER_CINFO_CMD: |
| 7940 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7941 | struct policy_mgr_conc_connection_info *conn_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7942 | uint32_t i = 0, len = 0; |
| 7943 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7944 | hdd_info("<iwpriv wlan0 pm_cinfo> is called"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7945 | conn_info = policy_mgr_get_conn_info(&len); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7946 | pr_info("+--------------------------+\n"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7947 | for (i = 0; i < len; i++) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7948 | pr_info("|table_index[%d]\t\t\n", i); |
| 7949 | pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id); |
| 7950 | pr_info("|\t|chan - %-10d|\n", conn_info->chan); |
| 7951 | pr_info("|\t|bw - %-10d|\n", conn_info->bw); |
| 7952 | pr_info("|\t|mode - %-10d|\n", conn_info->mode); |
| 7953 | pr_info("|\t|mac - %-10d|\n", conn_info->mac); |
| 7954 | pr_info("|\t|in_use - %-10d|\n", conn_info->in_use); |
| 7955 | pr_info("+--------------------------+\n"); |
| 7956 | conn_info++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7957 | } |
| 7958 | } |
| 7959 | break; |
| 7960 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7961 | case WE_UNIT_TEST_CMD: |
| 7962 | { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7963 | QDF_STATUS status; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7964 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7965 | if ((apps_args[0] < WLAN_MODULE_ID_MIN) || |
| 7966 | (apps_args[0] >= WLAN_MODULE_ID_MAX)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7967 | hdd_err("Invalid MODULE ID %d", apps_args[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7968 | return -EINVAL; |
| 7969 | } |
Sourav Mohapatra | ea7210b | 2018-11-16 16:58:52 +0530 | [diff] [blame] | 7970 | if ((apps_args[1] > (WMA_MAX_NUM_ARGS)) || |
Anurag Chouhan | 7756418 | 2016-09-03 16:38:01 +0530 | [diff] [blame] | 7971 | (apps_args[1] < 0)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7972 | hdd_err("Too Many/Few args %d", apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7973 | return -EINVAL; |
| 7974 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7975 | status = sme_send_unit_test_cmd(adapter->vdev_id, |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7976 | apps_args[0], |
| 7977 | apps_args[1], |
| 7978 | &apps_args[2]); |
| 7979 | if (QDF_STATUS_SUCCESS != status) { |
Jeff Johnson | 21d63bb | 2017-10-07 17:45:33 -0700 | [diff] [blame] | 7980 | hdd_err("sme_send_unit_test_cmd returned %d", status); |
| 7981 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7982 | } |
| 7983 | } |
| 7984 | break; |
| 7985 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 7986 | case WE_LED_FLASHING_PARAM: |
| 7987 | { |
| 7988 | int i; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7989 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7990 | if (num_args != 4) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7991 | hdd_err("gpio_control: 4 parameters are required"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7992 | return -EINVAL; |
| 7993 | } |
| 7994 | for (i = 0; i < num_args; i++) { |
| 7995 | if (apps_args[i] >= 0x7fffffff) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7996 | hdd_err("gpio_control: parameter should be less than 0x7fffffff"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7997 | return -EINVAL; |
| 7998 | } |
| 7999 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8000 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8001 | 0, apps_args[0], apps_args[1]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8002 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8003 | 1, apps_args[2], apps_args[3]); |
| 8004 | } |
| 8005 | break; |
| 8006 | #endif |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 8007 | case WE_SET_PKTLOG: |
| 8008 | { |
| 8009 | int ret; |
| 8010 | |
| 8011 | if (num_args < 1 || num_args > 2) { |
| 8012 | hdd_err("pktlog: either 1 or 2 parameters are required"); |
| 8013 | return -EINVAL; |
| 8014 | } |
| 8015 | |
| 8016 | ret = hdd_process_pktlog_command(hdd_ctx, apps_args[0], |
| 8017 | apps_args[1]); |
| 8018 | if (ret) |
| 8019 | return ret; |
| 8020 | break; |
| 8021 | } |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8022 | case WE_MAC_PWR_DEBUG_CMD: |
| 8023 | { |
| 8024 | struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args; |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8025 | int i, j; |
| 8026 | |
| 8027 | if (num_args < 3) { |
| 8028 | hdd_err("number of arguments can't be null %d", |
| 8029 | num_args); |
| 8030 | return -EINVAL; |
| 8031 | } |
| 8032 | if (num_args - 3 != apps_args[2]) { |
| 8033 | hdd_err("arg list of size %d doesn't match num_args %d", |
| 8034 | num_args-3, apps_args[2]); |
| 8035 | return -EINVAL; |
| 8036 | } |
| 8037 | if ((apps_args[1] < WLAN_MODULE_ID_MIN) || |
| 8038 | (apps_args[1] >= WLAN_MODULE_ID_MAX)) { |
| 8039 | hdd_err("Invalid MODULE ID %d", apps_args[1]); |
| 8040 | return -EINVAL; |
| 8041 | } |
| 8042 | if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) { |
| 8043 | hdd_err("Too Many args %d", apps_args[2]); |
| 8044 | return -EINVAL; |
| 8045 | } |
| 8046 | mac_pwr_dbg_args.pdev_id = apps_args[0]; |
| 8047 | mac_pwr_dbg_args.module_id = apps_args[1]; |
| 8048 | mac_pwr_dbg_args.num_args = apps_args[2]; |
| 8049 | |
| 8050 | for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++) |
| 8051 | mac_pwr_dbg_args.args[i] = apps_args[j]; |
| 8052 | |
| 8053 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8054 | sme_process_mac_pwr_dbg_cmd(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8055 | adapter->vdev_id, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8056 | &mac_pwr_dbg_args)) { |
| 8057 | return -EINVAL; |
| 8058 | } |
| 8059 | } |
| 8060 | break; |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 8061 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 8062 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 8063 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 8064 | case WE_POLICY_MANAGER_DBS_CMD: |
| 8065 | case WE_POLICY_MANAGER_PCL_CMD: |
| 8066 | case WE_POLICY_SET_HW_MODE_CMD: |
| 8067 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 8068 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 8069 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 8070 | { |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 8071 | if (!hdd_ctx->config->is_unit_test_framework_enabled) { |
| 8072 | hdd_warn_rl("UT framework is disabled"); |
| 8073 | return -EINVAL; |
| 8074 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8075 | iw_get_policy_manager_ut_ops(hdd_ctx, adapter, |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 8076 | sub_cmd, apps_args); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 8077 | } |
| 8078 | break; |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 8079 | case WE_SET_CHAN_AVOID: |
| 8080 | { |
| 8081 | hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args); |
| 8082 | } |
| 8083 | break; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8084 | case WE_SET_TXRX_STATS: |
| 8085 | { |
| 8086 | ret = cds_get_datapath_handles(&soc, &pdev, &vdev, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8087 | adapter->vdev_id); |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8088 | |
| 8089 | if (ret != 0) { |
| 8090 | hdd_err("Invalid handles"); |
| 8091 | break; |
| 8092 | } |
| 8093 | |
| 8094 | req.stats = apps_args[0]; |
| 8095 | /* default value of secondary parameter is 0(mac_id) */ |
| 8096 | req.mac_id = apps_args[1]; |
| 8097 | |
| 8098 | hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", |
| 8099 | req.stats, req.mac_id); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8100 | if (apps_args[0] == CDP_TXRX_STATS_28) { |
Jeff Johnson | 457c242 | 2019-02-27 13:56:04 -0800 | [diff] [blame] | 8101 | if (sta_ctx->conn_info.is_authenticated) { |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8102 | hdd_debug("ap mac addr: %pM", |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 8103 | (void *)&sta_ctx->conn_info.bssid); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8104 | req.peer_addr = |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 8105 | (char *)&sta_ctx->conn_info.bssid; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8106 | } |
| 8107 | } |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8108 | ret = cdp_txrx_stats_request(soc, vdev, &req); |
| 8109 | break; |
| 8110 | } |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8111 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 8112 | case WE_MOTION_DET_CONFIG_PARAM: |
| 8113 | { |
| 8114 | struct sme_motion_det_cfg motion_det_cfg; |
| 8115 | |
| 8116 | if (num_args != 15) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8117 | hdd_err_rl("mt_config: Invalid no of args"); |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8118 | return -EINVAL; |
| 8119 | } |
| 8120 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8121 | motion_det_cfg.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8122 | motion_det_cfg.time_t1 = apps_args[0]; |
| 8123 | motion_det_cfg.time_t2 = apps_args[1]; |
| 8124 | motion_det_cfg.n1 = apps_args[2]; |
| 8125 | motion_det_cfg.n2 = apps_args[3]; |
| 8126 | motion_det_cfg.time_t1_gap = apps_args[4]; |
| 8127 | motion_det_cfg.time_t2_gap = apps_args[5]; |
| 8128 | motion_det_cfg.coarse_K = apps_args[6]; |
| 8129 | motion_det_cfg.fine_K = apps_args[7]; |
| 8130 | motion_det_cfg.coarse_Q = apps_args[8]; |
| 8131 | motion_det_cfg.fine_Q = apps_args[9]; |
| 8132 | motion_det_cfg.md_coarse_thr_high = apps_args[10]; |
| 8133 | motion_det_cfg.md_fine_thr_high = apps_args[11]; |
| 8134 | motion_det_cfg.md_coarse_thr_low = apps_args[12]; |
| 8135 | motion_det_cfg.md_fine_thr_low = apps_args[13]; |
| 8136 | adapter->motion_detection_mode = apps_args[14]; |
| 8137 | sme_motion_det_config(hdd_ctx->mac_handle, &motion_det_cfg); |
| 8138 | } |
| 8139 | break; |
| 8140 | case WE_MOTION_DET_BASE_LINE_CONFIG_PARAM: |
| 8141 | { |
| 8142 | struct sme_motion_det_base_line_cfg motion_det_base_line_cfg; |
| 8143 | |
| 8144 | if (num_args != 4) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8145 | hdd_err_rl("mt_bl_config: Invalid no of args"); |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8146 | return -EINVAL; |
| 8147 | } |
| 8148 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8149 | motion_det_base_line_cfg.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8150 | motion_det_base_line_cfg.bl_time_t = apps_args[0]; |
| 8151 | motion_det_base_line_cfg.bl_packet_gap = apps_args[1]; |
| 8152 | motion_det_base_line_cfg.bl_n = apps_args[2]; |
| 8153 | motion_det_base_line_cfg.bl_num_meas = apps_args[3]; |
| 8154 | sme_motion_det_base_line_config(hdd_ctx->mac_handle, |
| 8155 | &motion_det_base_line_cfg); |
| 8156 | } |
| 8157 | break; |
| 8158 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 8159 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 8160 | case WE_SET_THERMAL_THROTTLE_CFG: |
| 8161 | { |
| 8162 | QDF_STATUS status; |
| 8163 | |
| 8164 | if (num_args != 7) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8165 | hdd_err_rl("set_thermal_cfg: Invalid no of args"); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 8166 | return -EINVAL; |
| 8167 | } |
| 8168 | |
| 8169 | /* Check for valid inputs */ |
| 8170 | if (apps_args[0] < 0 || apps_args[0] > 1 || apps_args[1] < 0 || |
| 8171 | apps_args[2] < 0 || apps_args[2] > 100 || |
| 8172 | apps_args[3] < 0 || apps_args[3] > 3 || apps_args[4] < 0 || |
| 8173 | apps_args[5] < 0 || apps_args[6] < 0 || |
| 8174 | apps_args[5] <= apps_args[4]) |
| 8175 | return -EINVAL; |
| 8176 | |
| 8177 | status = sme_set_thermal_throttle_cfg(hdd_ctx->mac_handle, |
| 8178 | apps_args[0], |
| 8179 | apps_args[1], |
| 8180 | apps_args[2], |
| 8181 | apps_args[3], |
| 8182 | apps_args[6]); |
| 8183 | if (QDF_IS_STATUS_ERROR(status)) |
| 8184 | return qdf_status_to_os_return(status); |
| 8185 | |
| 8186 | if (!apps_args[6]) { |
| 8187 | status = sme_set_thermal_mgmt(hdd_ctx->mac_handle, |
| 8188 | apps_args[4], |
| 8189 | apps_args[5]); |
| 8190 | if (QDF_IS_STATUS_ERROR(status)) |
| 8191 | return qdf_status_to_os_return(status); |
| 8192 | } |
| 8193 | break; |
| 8194 | } |
| 8195 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8196 | default: |
| 8197 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8198 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8199 | } |
| 8200 | break; |
| 8201 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8202 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8203 | return 0; |
| 8204 | } |
| 8205 | |
| 8206 | /** |
| 8207 | * iw_hdd_set_var_ints_getnone() - set var ints getnone callback |
| 8208 | * @dev: pointer to net_device structure |
| 8209 | * @info: pointer to iw_request_info structure |
| 8210 | * @wrqu: pointer to iwreq_data |
| 8211 | * @extra; extra |
| 8212 | * |
| 8213 | * Return: 0 on success, error number otherwise |
| 8214 | * |
| 8215 | */ |
| 8216 | static int iw_hdd_set_var_ints_getnone(struct net_device *dev, |
| 8217 | struct iw_request_info *info, |
| 8218 | union iwreq_data *wrqu, char *extra) |
| 8219 | { |
| 8220 | union iwreq_data u_priv_wrqu; |
| 8221 | int apps_args[MAX_VAR_ARGS] = {0}; |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8222 | int errno, num_args; |
| 8223 | struct osif_vdev_sync *vdev_sync; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8224 | |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 8225 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8226 | hdd_err("permission check failed"); |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 8227 | return -EPERM; |
| 8228 | } |
| 8229 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8230 | /* Helper function to get iwreq_data with compat handling. */ |
| 8231 | if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) |
| 8232 | return -EINVAL; |
| 8233 | |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 8234 | if (!u_priv_wrqu.data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8235 | hdd_err("NULL data pointer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8236 | return -EINVAL; |
| 8237 | } |
| 8238 | |
| 8239 | num_args = u_priv_wrqu.data.length; |
| 8240 | if (num_args > MAX_VAR_ARGS) |
| 8241 | num_args = MAX_VAR_ARGS; |
| 8242 | |
| 8243 | if (copy_from_user(apps_args, u_priv_wrqu.data.pointer, |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8244 | sizeof(int) * num_args)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8245 | hdd_err("failed to copy data from user buffer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8246 | return -EFAULT; |
| 8247 | } |
| 8248 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8249 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8250 | if (errno) |
| 8251 | return errno; |
| 8252 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8253 | errno = __iw_set_var_ints_getnone(dev, info, &u_priv_wrqu, |
| 8254 | (char *)&apps_args); |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8255 | |
| 8256 | osif_vdev_sync_op_stop(vdev_sync); |
| 8257 | |
| 8258 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8259 | } |
| 8260 | |
| 8261 | /** |
| 8262 | * iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 8263 | * @dev: device upon which the ioctl was received |
| 8264 | * @info: ioctl request information |
| 8265 | * @wrqu: ioctl request data |
| 8266 | * @extra: ioctl extra data |
| 8267 | * |
| 8268 | * This is a generic handler for private ioctls which take multiple |
| 8269 | * arguments. Note that this implementation is also somewhat unique |
| 8270 | * in that it is shared by both STA-mode and SAP-mode interfaces. |
| 8271 | * |
| 8272 | * Return: 0 on success, non-zero on error |
| 8273 | */ |
| 8274 | int iw_set_var_ints_getnone(struct net_device *dev, |
| 8275 | struct iw_request_info *info, |
| 8276 | union iwreq_data *wrqu, char *extra) |
| 8277 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8278 | int errno; |
| 8279 | struct osif_vdev_sync *vdev_sync; |
| 8280 | |
| 8281 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8282 | if (errno) |
| 8283 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8284 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8285 | errno = __iw_set_var_ints_getnone(dev, info, wrqu, extra); |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8286 | |
| 8287 | osif_vdev_sync_op_stop(vdev_sync); |
| 8288 | |
| 8289 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8290 | } |
| 8291 | |
| 8292 | /** |
| 8293 | * iw_add_tspec - Add TSpec private ioctl handler |
| 8294 | * @dev: device upon which the ioctl was received |
| 8295 | * @info: ioctl request information |
| 8296 | * @wrqu: ioctl request data |
| 8297 | * @extra: ioctl extra data |
| 8298 | * |
| 8299 | * Return: 0 on success, non-zero on error |
| 8300 | */ |
| 8301 | static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8302 | union iwreq_data *wrqu, char *extra) |
| 8303 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8304 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8305 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8306 | hdd_wlan_wmm_status_e *wmm_status = (hdd_wlan_wmm_status_e *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8307 | int params[HDD_WLAN_WMM_PARAM_COUNT]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8308 | struct sme_qos_wmmtspecinfo tspec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8309 | uint32_t handle; |
| 8310 | struct iw_point s_priv_data; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8311 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8312 | int ret; |
| 8313 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8314 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8315 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8316 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8317 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8318 | if (0 != ret) |
| 8319 | return ret; |
| 8320 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8321 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8322 | if (0 != ret) |
| 8323 | return ret; |
| 8324 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8325 | /* make sure the application is sufficiently priviledged */ |
| 8326 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8327 | /* this ioctl wants to return status to user space it must be */ |
| 8328 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8329 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8330 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8331 | |
| 8332 | /* we must be associated in order to add a tspec */ |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 8333 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8334 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8335 | return 0; |
| 8336 | } |
| 8337 | /* since we are defined to be a "get" ioctl, and since the number */ |
| 8338 | /* of params exceeds the number of params that wireless extensions */ |
| 8339 | /* will pass down in the iwreq_data, we must copy the "set" params. */ |
| 8340 | /* We must handle the compat for iwreq_data in 32U/64K environment. */ |
| 8341 | |
| 8342 | /* helper function to get iwreq_data with compat handling. */ |
| 8343 | if (hdd_priv_get_data(&s_priv_data, wrqu)) { |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8344 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8345 | return 0; |
| 8346 | } |
| 8347 | /* make sure all params are correctly passed to function */ |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 8348 | if ((!s_priv_data.pointer) || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8349 | (HDD_WLAN_WMM_PARAM_COUNT != s_priv_data.length)) { |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8350 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8351 | return 0; |
| 8352 | } |
| 8353 | /* from user space ourselves */ |
| 8354 | if (copy_from_user(¶ms, s_priv_data.pointer, sizeof(params))) { |
| 8355 | /* hmmm, can't get them */ |
| 8356 | return -EIO; |
| 8357 | } |
| 8358 | /* clear the tspec */ |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8359 | memset(&tspec, 0, sizeof(tspec)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8360 | |
| 8361 | /* validate the handle */ |
| 8362 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8363 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8364 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8365 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8366 | return 0; |
| 8367 | } |
| 8368 | /* validate the TID */ |
| 8369 | if (params[HDD_WLAN_WMM_PARAM_TID] > 7) { |
| 8370 | /* out of range */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8371 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8372 | return 0; |
| 8373 | } |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8374 | tspec.ts_info.tid = params[HDD_WLAN_WMM_PARAM_TID]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8375 | |
| 8376 | /* validate the direction */ |
| 8377 | switch (params[HDD_WLAN_WMM_PARAM_DIRECTION]) { |
| 8378 | case HDD_WLAN_WMM_DIRECTION_UPSTREAM: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8379 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_UPLINK; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8380 | break; |
| 8381 | |
| 8382 | case HDD_WLAN_WMM_DIRECTION_DOWNSTREAM: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8383 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_DOWNLINK; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8384 | break; |
| 8385 | |
| 8386 | case HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8387 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_BOTH; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8388 | break; |
| 8389 | |
| 8390 | default: |
| 8391 | /* unknown */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8392 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8393 | return 0; |
| 8394 | } |
| 8395 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8396 | tspec.ts_info.psb = params[HDD_WLAN_WMM_PARAM_APSD]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8397 | |
| 8398 | /* validate the user priority */ |
| 8399 | if (params[HDD_WLAN_WMM_PARAM_USER_PRIORITY] >= SME_QOS_WMM_UP_MAX) { |
| 8400 | /* out of range */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8401 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8402 | return 0; |
| 8403 | } |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8404 | tspec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY]; |
| 8405 | 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] | 8406 | hdd_err("***ts_info.up out of bounds***"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8407 | return 0; |
| 8408 | } |
| 8409 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8410 | hdd_debug("TS_INFO PSB %d UP %d !!!", |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8411 | tspec.ts_info.psb, tspec.ts_info.up); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8412 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8413 | tspec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE]; |
| 8414 | tspec.maximum_msdu_size = params[HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE]; |
| 8415 | tspec.min_data_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE]; |
| 8416 | tspec.mean_data_rate = params[HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE]; |
| 8417 | tspec.peak_data_rate = params[HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE]; |
| 8418 | tspec.max_burst_size = params[HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE]; |
| 8419 | tspec.min_phy_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE]; |
| 8420 | tspec.surplus_bw_allowance = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8421 | params[HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8422 | tspec.min_service_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8423 | params[HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8424 | tspec.max_service_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8425 | params[HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8426 | tspec.suspension_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8427 | params[HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8428 | tspec.inactivity_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8429 | params[HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL]; |
| 8430 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8431 | tspec.ts_info.burst_size_defn = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8432 | params[HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN]; |
| 8433 | |
| 8434 | /* validate the ts info ack policy */ |
| 8435 | switch (params[HDD_WLAN_WMM_PARAM_ACK_POLICY]) { |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8436 | case TS_INFO_ACK_POLICY_NORMAL_ACK: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8437 | tspec.ts_info.ack_policy = SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8438 | break; |
| 8439 | |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8440 | case TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8441 | tspec.ts_info.ack_policy = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8442 | SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK; |
| 8443 | break; |
| 8444 | |
| 8445 | default: |
| 8446 | /* unknown */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8447 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8448 | return 0; |
| 8449 | } |
| 8450 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8451 | *wmm_status = hdd_wmm_addts(adapter, handle, &tspec); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8452 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8453 | return 0; |
| 8454 | } |
| 8455 | |
| 8456 | static int iw_add_tspec(struct net_device *dev, |
| 8457 | struct iw_request_info *info, |
| 8458 | union iwreq_data *wrqu, char *extra) |
| 8459 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8460 | int errno; |
| 8461 | struct osif_vdev_sync *vdev_sync; |
| 8462 | |
| 8463 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8464 | if (errno) |
| 8465 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8466 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8467 | errno = __iw_add_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8468 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8469 | osif_vdev_sync_op_stop(vdev_sync); |
| 8470 | |
| 8471 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8472 | } |
| 8473 | |
| 8474 | /** |
| 8475 | * iw_del_tspec - Delete TSpec private ioctl handler |
| 8476 | * @dev: device upon which the ioctl was received |
| 8477 | * @info: ioctl request information |
| 8478 | * @wrqu: ioctl request data |
| 8479 | * @extra: ioctl extra data |
| 8480 | * |
| 8481 | * Return: 0 on success, non-zero on error |
| 8482 | */ |
| 8483 | static int __iw_del_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8484 | union iwreq_data *wrqu, char *extra) |
| 8485 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8486 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8487 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8488 | int *params = (int *)extra; |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8489 | hdd_wlan_wmm_status_e *wmm_status = (hdd_wlan_wmm_status_e *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8490 | uint32_t handle; |
| 8491 | int ret; |
| 8492 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8493 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8494 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8495 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8496 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8497 | if (0 != ret) |
| 8498 | return ret; |
| 8499 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8500 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8501 | if (0 != ret) |
| 8502 | return ret; |
| 8503 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8504 | /* make sure the application is sufficiently priviledged */ |
| 8505 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8506 | /* this ioctl wants to return status to user space it must be */ |
| 8507 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8508 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8509 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8510 | |
| 8511 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8512 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8513 | /* is no need to copy the params from user space */ |
| 8514 | |
| 8515 | /* validate the handle */ |
| 8516 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8517 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8518 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8519 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8520 | return 0; |
| 8521 | } |
| 8522 | |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8523 | *wmm_status = hdd_wmm_delts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8524 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8525 | return 0; |
| 8526 | } |
| 8527 | |
| 8528 | static int iw_del_tspec(struct net_device *dev, |
| 8529 | struct iw_request_info *info, |
| 8530 | union iwreq_data *wrqu, char *extra) |
| 8531 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8532 | int errno; |
| 8533 | struct osif_vdev_sync *vdev_sync; |
| 8534 | |
| 8535 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8536 | if (errno) |
| 8537 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8538 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8539 | errno = __iw_del_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8540 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8541 | osif_vdev_sync_op_stop(vdev_sync); |
| 8542 | |
| 8543 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8544 | } |
| 8545 | |
| 8546 | /** |
| 8547 | * iw_get_tspec - Get TSpec private ioctl handler |
| 8548 | * @dev: device upon which the ioctl was received |
| 8549 | * @info: ioctl request information |
| 8550 | * @wrqu: ioctl request data |
| 8551 | * @extra: ioctl extra data |
| 8552 | * |
| 8553 | * Return: 0 on success, non-zero on error |
| 8554 | */ |
| 8555 | static int __iw_get_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8556 | union iwreq_data *wrqu, char *extra) |
| 8557 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8558 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8559 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8560 | int *params = (int *)extra; |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8561 | hdd_wlan_wmm_status_e *wmm_status = (hdd_wlan_wmm_status_e *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8562 | uint32_t handle; |
| 8563 | int ret; |
| 8564 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8565 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8566 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8567 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8568 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8569 | if (0 != ret) |
| 8570 | return ret; |
| 8571 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8572 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8573 | if (0 != ret) |
| 8574 | return ret; |
| 8575 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8576 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8577 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8578 | /* is no need to copy the params from user space */ |
| 8579 | |
| 8580 | /* validate the handle */ |
| 8581 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8582 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8583 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8584 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8585 | return 0; |
| 8586 | } |
| 8587 | |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8588 | *wmm_status = hdd_wmm_checkts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8589 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8590 | return 0; |
| 8591 | } |
| 8592 | |
| 8593 | static int iw_get_tspec(struct net_device *dev, |
| 8594 | struct iw_request_info *info, |
| 8595 | union iwreq_data *wrqu, char *extra) |
| 8596 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8597 | int errno; |
| 8598 | struct osif_vdev_sync *vdev_sync; |
| 8599 | |
| 8600 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8601 | if (errno) |
| 8602 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8603 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8604 | errno = __iw_get_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8605 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8606 | osif_vdev_sync_op_stop(vdev_sync); |
| 8607 | |
| 8608 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8609 | } |
| 8610 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8611 | /** |
| 8612 | * iw_set_fties - Set FT IEs private ioctl handler |
| 8613 | * @dev: device upon which the ioctl was received |
| 8614 | * @info: ioctl request information |
| 8615 | * @wrqu: ioctl request data |
| 8616 | * @extra: ioctl extra data |
| 8617 | * |
| 8618 | * Each time the supplicant has the auth_request or reassoc request |
| 8619 | * IEs ready they are pushed to the driver. The driver will in turn |
| 8620 | * use it to send out the auth req and reassoc req for 11r FT Assoc. |
| 8621 | * |
| 8622 | * Return: 0 on success, non-zero on error |
| 8623 | */ |
| 8624 | static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info, |
| 8625 | union iwreq_data *wrqu, char *extra) |
| 8626 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8627 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8628 | 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] | 8629 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8630 | int ret; |
| 8631 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8632 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8633 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8634 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8635 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8636 | if (0 != ret) |
| 8637 | return ret; |
| 8638 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8639 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8640 | if (0 != ret) |
| 8641 | return ret; |
| 8642 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8643 | if (!wrqu->data.length) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8644 | hdd_err("called with 0 length IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8645 | return -EINVAL; |
| 8646 | } |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 8647 | if (!wrqu->data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8648 | hdd_err("called with NULL IE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8649 | return -EINVAL; |
| 8650 | } |
| 8651 | /* Added for debug on reception of Re-assoc Req. */ |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 8652 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8653 | hdd_debug("Called with Ie of length = %d when not associated", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8654 | wrqu->data.length); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8655 | hdd_debug("Should be Re-assoc Req IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8656 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8657 | hdd_debug("called with Ie of length = %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8658 | |
| 8659 | /* Pass the received FT IEs to SME */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8660 | sme_set_ft_ies(hdd_ctx->mac_handle, adapter->vdev_id, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8661 | extra, wrqu->data.length); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8662 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8663 | return 0; |
| 8664 | } |
| 8665 | |
| 8666 | static int iw_set_fties(struct net_device *dev, |
| 8667 | struct iw_request_info *info, |
| 8668 | union iwreq_data *wrqu, char *extra) |
| 8669 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8670 | int errno; |
| 8671 | struct osif_vdev_sync *vdev_sync; |
| 8672 | |
| 8673 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8674 | if (errno) |
| 8675 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8676 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8677 | errno = __iw_set_fties(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8678 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8679 | osif_vdev_sync_op_stop(vdev_sync); |
| 8680 | |
| 8681 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8682 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8683 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8684 | /** |
| 8685 | * iw_set_dynamic_mcbc_filter() - Set Dynamic MCBC Filter ioctl handler |
| 8686 | * @dev: device upon which the ioctl was received |
| 8687 | * @info: ioctl request information |
| 8688 | * @wrqu: ioctl request data |
| 8689 | * @extra: ioctl extra data |
| 8690 | * |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8691 | * This IOCTL is OBSOLETE as of Jan 30, 2017. We are leaving it here for the |
| 8692 | * time being to provide guidance in migrating to standard APIs. |
| 8693 | * |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8694 | * Return: 0 on success, non-zero on error |
| 8695 | */ |
| 8696 | static int iw_set_dynamic_mcbc_filter(struct net_device *dev, |
| 8697 | struct iw_request_info *info, |
| 8698 | union iwreq_data *wrqu, |
| 8699 | char *extra) |
| 8700 | { |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8701 | hdd_err("\n" |
| 8702 | "setMCBCFilter is obsolete. Use the following instead:\n" |
| 8703 | "Configure multicast filtering via the ‘ip’ command.\n" |
| 8704 | "\tip maddr add 11:22:33:44:55:66 dev wlan0 # allow traffic to address\n" |
| 8705 | "\tip maddr del 11:22:33:44:55:66 dev wlan0 # undo allow\n" |
| 8706 | "Configure broadcast filtering via ini item, 'g_enable_non_arp_bc_hw_filter.'\n" |
| 8707 | "\tg_enable_non_arp_bc_hw_filter=1 # drop all non-ARP broadcast traffic\n" |
| 8708 | "\tg_enable_non_arp_bc_hw_filter=0 # allow all broadcast traffic"); |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 8709 | return -EINVAL; |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8710 | } |
| 8711 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8712 | /** |
| 8713 | * iw_set_host_offload - Set host offload ioctl handler |
| 8714 | * @dev: device upon which the ioctl was received |
| 8715 | * @info: ioctl request information |
| 8716 | * @wrqu: ioctl request data |
| 8717 | * @extra: ioctl extra data |
| 8718 | * |
| 8719 | * Return: 0 on success, non-zero on error |
| 8720 | */ |
| 8721 | static int __iw_set_host_offload(struct net_device *dev, |
| 8722 | struct iw_request_info *info, |
| 8723 | union iwreq_data *wrqu, char *extra) |
| 8724 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8725 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8726 | struct host_offload_req *user_request = |
| 8727 | (struct host_offload_req *) extra; |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8728 | struct sir_host_offload_req offload_request; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8729 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8730 | int ret; |
| 8731 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8732 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8733 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8734 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8735 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8736 | if (0 != ret) |
| 8737 | return ret; |
| 8738 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8739 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8740 | if (0 != ret) |
| 8741 | return ret; |
| 8742 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8743 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8744 | hdd_err("dev is not in CONNECTED state, ignore!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8745 | return -EINVAL; |
| 8746 | } |
| 8747 | |
| 8748 | /* Debug display of request components. */ |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8749 | switch (user_request->offloadType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8750 | case WLAN_IPV4_ARP_REPLY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8751 | hdd_debug("Host offload request: ARP reply"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8752 | switch (user_request->enableOrDisable) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8753 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8754 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8755 | break; |
| 8756 | case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8757 | hdd_debug(" BC Filtering enable"); |
Jeff Johnson | 00052dd | 2018-04-29 19:19:06 -0700 | [diff] [blame] | 8758 | /* fallthrough */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8759 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8760 | hdd_debug(" ARP offload enable"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8761 | hdd_debug(" IP address: %pI4", |
| 8762 | user_request->params.hostIpv4Addr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8763 | } |
| 8764 | break; |
| 8765 | |
| 8766 | case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8767 | hdd_debug("Host offload request: neighbor discovery"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8768 | switch (user_request->enableOrDisable) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8769 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8770 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8771 | break; |
| 8772 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8773 | hdd_debug(" enable"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8774 | hdd_debug(" IP address: %pI6c", |
| 8775 | user_request->params.hostIpv6Addr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8776 | } |
| 8777 | } |
| 8778 | |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8779 | qdf_mem_zero(&offload_request, sizeof(offload_request)); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8780 | offload_request.offloadType = user_request->offloadType; |
| 8781 | offload_request.enableOrDisable = user_request->enableOrDisable; |
| 8782 | qdf_mem_copy(&offload_request.params, &user_request->params, |
| 8783 | sizeof(user_request->params)); |
| 8784 | qdf_mem_copy(&offload_request.bssid, &user_request->bssId.bytes, |
Hanumanth Reddy Pothula | 8fcade5 | 2017-12-01 13:49:40 +0530 | [diff] [blame] | 8785 | QDF_MAC_ADDR_SIZE); |
| 8786 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8787 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8788 | sme_set_host_offload(hdd_ctx->mac_handle, |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8789 | adapter->vdev_id, &offload_request)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8790 | hdd_err("Failure to execute host offload request"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8791 | return -EINVAL; |
| 8792 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8793 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8794 | return 0; |
| 8795 | } |
| 8796 | |
| 8797 | static int iw_set_host_offload(struct net_device *dev, |
| 8798 | struct iw_request_info *info, |
| 8799 | union iwreq_data *wrqu, char *extra) |
| 8800 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8801 | int errno; |
| 8802 | struct osif_vdev_sync *vdev_sync; |
| 8803 | |
| 8804 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8805 | if (errno) |
| 8806 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8807 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8808 | errno = __iw_set_host_offload(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8809 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8810 | osif_vdev_sync_op_stop(vdev_sync); |
| 8811 | |
| 8812 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8813 | } |
| 8814 | |
| 8815 | /** |
| 8816 | * iw_set_keepalive_params - Set keepalive params ioctl handler |
| 8817 | * @dev: device upon which the ioctl was received |
| 8818 | * @info: ioctl request information |
| 8819 | * @wrqu: ioctl request data |
| 8820 | * @extra: ioctl extra data |
| 8821 | * |
| 8822 | * Return: 0 on success, non-zero on error |
| 8823 | */ |
| 8824 | static int __iw_set_keepalive_params(struct net_device *dev, |
| 8825 | struct iw_request_info *info, |
| 8826 | union iwreq_data *wrqu, char *extra) |
| 8827 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8828 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 8829 | struct keep_alive_req *request = (struct keep_alive_req *)extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8830 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8831 | int ret; |
| 8832 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8833 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8834 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8835 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8836 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8837 | if (0 != ret) |
| 8838 | return ret; |
| 8839 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8840 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8841 | if (0 != ret) |
| 8842 | return ret; |
| 8843 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8844 | if (wrqu->data.length != sizeof(*request)) { |
| 8845 | hdd_err("Invalid length %d", wrqu->data.length); |
| 8846 | return -EINVAL; |
| 8847 | } |
| 8848 | |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8849 | if (request->timePeriod > cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8850 | hdd_err("Value of timePeriod %d exceed Max limit %d", |
| 8851 | request->timePeriod, |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8852 | cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8853 | return -EINVAL; |
| 8854 | } |
| 8855 | |
| 8856 | /* Debug display of request components. */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8857 | hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu", |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 8858 | request->timePeriod, sizeof(struct keep_alive_req)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8859 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8860 | switch (request->packetType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8861 | case WLAN_KEEP_ALIVE_NULL_PKT: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8862 | hdd_debug("Keep Alive Request: Tx NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8863 | break; |
| 8864 | |
| 8865 | case WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8866 | hdd_debug("Keep Alive Request: Tx UnSolicited ARP RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8867 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8868 | hdd_debug("Host IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8869 | request->hostIpv4Addr[0], request->hostIpv4Addr[1], |
| 8870 | request->hostIpv4Addr[2], request->hostIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8871 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8872 | hdd_debug("Dest IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8873 | request->destIpv4Addr[0], request->destIpv4Addr[1], |
| 8874 | request->destIpv4Addr[2], request->destIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8875 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8876 | hdd_debug("Dest MAC address: "MAC_ADDRESS_STR, |
Srinivas Girigowda | 9c330a9 | 2015-11-24 12:28:25 -0800 | [diff] [blame] | 8877 | MAC_ADDR_ARRAY(request->dest_macaddr.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8878 | break; |
| 8879 | } |
| 8880 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8881 | hdd_debug("Keep alive period %d", request->timePeriod); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8882 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8883 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8884 | sme_set_keep_alive(hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8885 | adapter->vdev_id, request)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8886 | hdd_err("Failure to execute Keep Alive"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8887 | return -EINVAL; |
| 8888 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8889 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8890 | return 0; |
| 8891 | } |
| 8892 | |
| 8893 | static int iw_set_keepalive_params(struct net_device *dev, |
| 8894 | struct iw_request_info *info, |
| 8895 | union iwreq_data *wrqu, |
| 8896 | char *extra) |
| 8897 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8898 | int errno; |
| 8899 | struct osif_vdev_sync *vdev_sync; |
| 8900 | |
| 8901 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8902 | if (errno) |
| 8903 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8904 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8905 | errno = __iw_set_keepalive_params(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8906 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8907 | osif_vdev_sync_op_stop(vdev_sync); |
| 8908 | |
| 8909 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8910 | } |
| 8911 | |
| 8912 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 8913 | /** |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8914 | * validate_packet_filter_params_size() - Validate the size of the params rcvd |
| 8915 | * @priv_data: Pointer to the priv data from user space |
| 8916 | * @request: Pointer to the struct containing the copied data from user space |
| 8917 | * |
| 8918 | * Return: False on invalid length, true otherwise |
| 8919 | */ |
| 8920 | static bool validate_packet_filter_params_size(struct pkt_filter_cfg *request, |
| 8921 | uint16_t length) |
| 8922 | { |
| 8923 | int max_params_size, rcvd_params_size; |
| 8924 | |
| 8925 | max_params_size = HDD_MAX_CMP_PER_PACKET_FILTER * |
| 8926 | sizeof(struct pkt_filter_param_cfg); |
| 8927 | |
| 8928 | if (length < sizeof(struct pkt_filter_cfg) - max_params_size) { |
| 8929 | hdd_err("Less than minimum number of arguments needed"); |
| 8930 | return false; |
| 8931 | } |
| 8932 | |
| 8933 | rcvd_params_size = request->num_params * |
| 8934 | sizeof(struct pkt_filter_param_cfg); |
| 8935 | |
| 8936 | if (length != sizeof(struct pkt_filter_cfg) - |
| 8937 | max_params_size + rcvd_params_size) { |
| 8938 | hdd_err("Arguments do not match the number of params provided"); |
| 8939 | return false; |
| 8940 | } |
| 8941 | |
| 8942 | return true; |
| 8943 | } |
| 8944 | |
| 8945 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8946 | * __iw_set_packet_filter_params() - set packet filter parameters in target |
| 8947 | * @dev: Pointer to netdev |
| 8948 | * @info: Pointer to iw request info |
| 8949 | * @wrqu: Pointer to data |
| 8950 | * @extra: Pointer to extra data |
| 8951 | * |
| 8952 | * Return: 0 on success, non-zero on error |
| 8953 | */ |
| 8954 | static int __iw_set_packet_filter_params(struct net_device *dev, |
| 8955 | struct iw_request_info *info, |
| 8956 | union iwreq_data *wrqu, char *extra) |
| 8957 | { |
| 8958 | int ret; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8959 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8960 | struct iw_point priv_data; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8961 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8962 | struct pkt_filter_cfg *request = NULL; |
| 8963 | |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8964 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8965 | hdd_err("permission check failed"); |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8966 | return -EPERM; |
| 8967 | } |
| 8968 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8969 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8970 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8971 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8972 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8973 | if (0 != ret) |
| 8974 | return ret; |
| 8975 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8976 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8977 | if (0 != ret) |
| 8978 | return ret; |
| 8979 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8980 | if (hdd_priv_get_data(&priv_data, wrqu)) { |
| 8981 | hdd_err("failed to get priv data"); |
| 8982 | return -EINVAL; |
| 8983 | } |
| 8984 | |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 8985 | if ((!priv_data.pointer) || (0 == priv_data.length)) { |
Jeff Johnson | 36e74c4 | 2017-09-18 08:15:42 -0700 | [diff] [blame] | 8986 | hdd_err("invalid priv data %pK or invalid priv data length %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8987 | priv_data.pointer, priv_data.length); |
| 8988 | return -EINVAL; |
| 8989 | } |
| 8990 | |
Arun Khandavalli | 75d246b | 2017-08-07 19:46:06 +0530 | [diff] [blame] | 8991 | if (adapter->device_mode != QDF_STA_MODE) { |
| 8992 | hdd_err("Packet filter not supported for this mode :%d", |
| 8993 | adapter->device_mode); |
| 8994 | return -ENOTSUPP; |
| 8995 | } |
| 8996 | |
Mukul Sharma | be846bb | 2017-05-09 17:41:52 +0530 | [diff] [blame] | 8997 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
| 8998 | hdd_err("Packet filter not supported in disconnected state"); |
| 8999 | return -ENOTSUPP; |
| 9000 | } |
| 9001 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9002 | /* copy data using copy_from_user */ |
| 9003 | request = mem_alloc_copy_from_user_helper(priv_data.pointer, |
| 9004 | priv_data.length); |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 9005 | |
Jeff Johnson | d36fa33 | 2019-03-18 13:42:25 -0700 | [diff] [blame] | 9006 | if (!request) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9007 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
| 9008 | return -ENOMEM; |
| 9009 | } |
| 9010 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 9011 | if (!validate_packet_filter_params_size(request, priv_data.length)) { |
| 9012 | hdd_err("Invalid priv data length %d", priv_data.length); |
| 9013 | qdf_mem_free(request); |
| 9014 | return -EINVAL; |
| 9015 | } |
| 9016 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 9017 | if (request->filter_action == HDD_RCV_FILTER_SET) |
| 9018 | hdd_ctx->user_configured_pkt_filter_rules |= |
| 9019 | 1 << request->filter_id; |
| 9020 | else if (request->filter_action == HDD_RCV_FILTER_CLEAR) |
| 9021 | hdd_ctx->user_configured_pkt_filter_rules &= |
| 9022 | ~(1 << request->filter_id); |
| 9023 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9024 | ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9025 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 9026 | qdf_mem_free(request); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 9027 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9028 | return ret; |
| 9029 | } |
| 9030 | |
| 9031 | /** |
| 9032 | * iw_set_packet_filter_params() - set packet filter parameters in target |
| 9033 | * @dev: Pointer to netdev |
| 9034 | * @info: Pointer to iw request info |
| 9035 | * @wrqu: Pointer to data |
| 9036 | * @extra: Pointer to extra data |
| 9037 | * |
| 9038 | * Return: 0 on success, non-zero on error |
| 9039 | */ |
| 9040 | static int iw_set_packet_filter_params(struct net_device *dev, |
| 9041 | struct iw_request_info *info, |
| 9042 | union iwreq_data *wrqu, char *extra) |
| 9043 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9044 | int errno; |
| 9045 | struct osif_vdev_sync *vdev_sync; |
| 9046 | |
| 9047 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9048 | if (errno) |
| 9049 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9050 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9051 | errno = __iw_set_packet_filter_params(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9052 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9053 | osif_vdev_sync_op_stop(vdev_sync); |
| 9054 | |
| 9055 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9056 | } |
| 9057 | #endif |
| 9058 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9059 | #ifdef QCA_SUPPORT_CP_STATS |
| 9060 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
| 9061 | { |
| 9062 | return wlan_hdd_get_station_stats(adapter); |
| 9063 | } |
| 9064 | #else /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9065 | struct hdd_statistics_priv { |
| 9066 | tCsrSummaryStatsInfo summary_stats; |
| 9067 | tCsrGlobalClassAStatsInfo class_a_stats; |
| 9068 | tCsrGlobalClassDStatsInfo class_d_stats; |
| 9069 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9070 | |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9071 | /** |
| 9072 | * hdd_statistics_cb() - "Get statistics" callback function |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9073 | * @stats: statistics payload |
| 9074 | * @context: opaque context originally passed to SME. HDD always passes |
| 9075 | * a cookie for the request context |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9076 | * |
| 9077 | * Return: None |
| 9078 | */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9079 | static void hdd_statistics_cb(void *stats, void *context) |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9080 | { |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9081 | struct osif_request *request; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9082 | struct hdd_statistics_priv *priv; |
| 9083 | tCsrSummaryStatsInfo *summary_stats; |
| 9084 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 9085 | tCsrGlobalClassDStatsInfo *class_d_stats; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9086 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9087 | request = osif_request_get(context); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9088 | if (!request) { |
| 9089 | hdd_err("Obsolete request"); |
| 9090 | return; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9091 | } |
| 9092 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9093 | priv = osif_request_priv(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9094 | |
| 9095 | summary_stats = (tCsrSummaryStatsInfo *)stats; |
| 9096 | priv->summary_stats = *summary_stats; |
| 9097 | |
| 9098 | class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); |
| 9099 | priv->class_a_stats = *class_a_stats; |
| 9100 | |
| 9101 | class_d_stats = (tCsrGlobalClassDStatsInfo *)(class_a_stats + 1); |
| 9102 | priv->class_d_stats = *class_d_stats; |
| 9103 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9104 | osif_request_complete(request); |
| 9105 | osif_request_put(request); |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9106 | } |
| 9107 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9108 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9109 | { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9110 | int ret = 0; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9111 | void *cookie; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9112 | QDF_STATUS status; |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9113 | struct osif_request *request; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9114 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9115 | struct hdd_statistics_priv *priv; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9116 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9117 | static const struct osif_request_params params = { |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9118 | .priv_size = sizeof(*priv), |
| 9119 | .timeout_ms = WLAN_WAIT_TIME_STATS, |
| 9120 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9121 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9122 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9123 | request = osif_request_alloc(¶ms); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9124 | if (!request) { |
| 9125 | hdd_warn("request allocation failed"); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9126 | return -EINVAL; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9127 | } |
| 9128 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9129 | cookie = osif_request_cookie(request); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 9130 | status = sme_get_statistics(hdd_ctx->mac_handle, eCSR_HDD, |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9131 | SME_SUMMARY_STATS | |
| 9132 | SME_GLOBAL_CLASSA_STATS | |
| 9133 | SME_GLOBAL_CLASSD_STATS, |
| 9134 | hdd_statistics_cb, |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 9135 | sta_ctx->conn_info.sta_id[0], |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9136 | cookie, adapter->vdev_id); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9137 | |
| 9138 | if (QDF_STATUS_SUCCESS != status) { |
| 9139 | hdd_warn("Unable to retrieve SME statistics"); |
| 9140 | goto put_request; |
| 9141 | } |
| 9142 | |
| 9143 | /* request was sent -- wait for the response */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9144 | ret = osif_request_wait_for_response(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9145 | if (ret) { |
| 9146 | hdd_err("Failed to wait for statistics, errno %d", ret); |
| 9147 | goto put_request; |
| 9148 | } |
| 9149 | |
| 9150 | /* update the adapter cache with the fresh results */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9151 | priv = osif_request_priv(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9152 | adapter->hdd_stats.summary_stat = priv->summary_stats; |
| 9153 | adapter->hdd_stats.class_a_stat = priv->class_a_stats; |
| 9154 | adapter->hdd_stats.class_d_stat = priv->class_d_stats; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9155 | |
| 9156 | put_request: |
| 9157 | /* |
| 9158 | * either we never sent a request, we sent a request and |
| 9159 | * received a response or we sent a request and timed out. |
| 9160 | * regardless we are done with the request. |
| 9161 | */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9162 | osif_request_put(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9163 | return ret; |
| 9164 | } |
| 9165 | #endif /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9166 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9167 | static int __iw_get_statistics(struct net_device *dev, |
| 9168 | struct iw_request_info *info, |
| 9169 | union iwreq_data *wrqu, char *extra) |
| 9170 | { |
| 9171 | int ret; |
| 9172 | char *p; |
| 9173 | int tlen; |
| 9174 | struct hdd_station_ctx *sta_ctx; |
| 9175 | tCsrSummaryStatsInfo *summary_stats; |
| 9176 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 9177 | tCsrGlobalClassDStatsInfo *class_d_stats; |
| 9178 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 9179 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9180 | |
| 9181 | hdd_enter_dev(dev); |
| 9182 | |
| 9183 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9184 | if (0 != ret) |
| 9185 | return ret; |
| 9186 | |
| 9187 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9188 | if (0 != ret) |
| 9189 | return ret; |
| 9190 | |
| 9191 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 9192 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9193 | wrqu->data.length = 0; |
| 9194 | return 0; |
| 9195 | } |
| 9196 | |
| 9197 | hdd_get_wlan_stats(adapter); |
| 9198 | |
| 9199 | summary_stats = &(adapter->hdd_stats.summary_stat); |
| 9200 | class_a_stats = &(adapter->hdd_stats.class_a_stat); |
| 9201 | class_d_stats = &(adapter->hdd_stats.class_d_stat); |
| 9202 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9203 | p = extra; |
| 9204 | tlen = 0; |
| 9205 | |
| 9206 | FILL_TLV(p, WLAN_STATS_RETRY_CNT, |
| 9207 | sizeof(summary_stats->retry_cnt), |
| 9208 | &(summary_stats->retry_cnt[0]), tlen); |
| 9209 | |
| 9210 | FILL_TLV(p, WLAN_STATS_MUL_RETRY_CNT, |
| 9211 | sizeof(summary_stats->multiple_retry_cnt), |
| 9212 | &(summary_stats->multiple_retry_cnt[0]), tlen); |
| 9213 | |
| 9214 | FILL_TLV(p, WLAN_STATS_TX_FRM_CNT, |
| 9215 | sizeof(summary_stats->tx_frm_cnt), |
| 9216 | &(summary_stats->tx_frm_cnt[0]), tlen); |
| 9217 | |
| 9218 | FILL_TLV(p, WLAN_STATS_RX_FRM_CNT, |
| 9219 | sizeof(summary_stats->rx_frm_cnt), |
| 9220 | &(summary_stats->rx_frm_cnt), tlen); |
| 9221 | |
| 9222 | FILL_TLV(p, WLAN_STATS_FRM_DUP_CNT, |
| 9223 | sizeof(summary_stats->frm_dup_cnt), |
| 9224 | &(summary_stats->frm_dup_cnt), tlen); |
| 9225 | |
| 9226 | FILL_TLV(p, WLAN_STATS_FAIL_CNT, |
| 9227 | sizeof(summary_stats->fail_cnt), |
| 9228 | &(summary_stats->fail_cnt[0]), tlen); |
| 9229 | |
| 9230 | FILL_TLV(p, WLAN_STATS_RTS_FAIL_CNT, |
| 9231 | sizeof(summary_stats->rts_fail_cnt), |
| 9232 | &(summary_stats->rts_fail_cnt), tlen); |
| 9233 | |
| 9234 | FILL_TLV(p, WLAN_STATS_ACK_FAIL_CNT, |
| 9235 | sizeof(summary_stats->ack_fail_cnt), |
| 9236 | &(summary_stats->ack_fail_cnt), tlen); |
| 9237 | |
| 9238 | FILL_TLV(p, WLAN_STATS_RTS_SUC_CNT, |
| 9239 | sizeof(summary_stats->rts_succ_cnt), |
| 9240 | &(summary_stats->rts_succ_cnt), tlen); |
| 9241 | |
| 9242 | FILL_TLV(p, WLAN_STATS_RX_DISCARD_CNT, |
| 9243 | sizeof(summary_stats->rx_discard_cnt), |
| 9244 | &(summary_stats->rx_discard_cnt), tlen); |
| 9245 | |
| 9246 | FILL_TLV(p, WLAN_STATS_RX_ERROR_CNT, |
| 9247 | sizeof(summary_stats->rx_error_cnt), |
| 9248 | &(summary_stats->rx_error_cnt), tlen); |
| 9249 | |
| 9250 | FILL_TLV(p, WLAN_STATS_TX_BYTE_CNT, |
| 9251 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 9252 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 9253 | |
| 9254 | FILL_TLV(p, WLAN_STATS_RX_BYTE_CNT, |
| 9255 | sizeof(class_d_stats->rx_byte_cnt), |
| 9256 | &(class_d_stats->rx_byte_cnt), tlen); |
| 9257 | |
| 9258 | FILL_TLV(p, WLAN_STATS_RX_RATE, |
| 9259 | sizeof(class_d_stats->rx_rate), |
| 9260 | &(class_d_stats->rx_rate), tlen); |
| 9261 | |
| 9262 | /* Transmit rate, in units of 500 kbit/sec */ |
| 9263 | FILL_TLV(p, WLAN_STATS_TX_RATE, |
| 9264 | sizeof(class_a_stats->tx_rate), |
| 9265 | &(class_a_stats->tx_rate), tlen); |
| 9266 | |
| 9267 | FILL_TLV(p, WLAN_STATS_RX_UC_BYTE_CNT, |
| 9268 | sizeof(class_d_stats->rx_uc_byte_cnt[0]), |
| 9269 | &(class_d_stats->rx_uc_byte_cnt[0]), tlen); |
| 9270 | FILL_TLV(p, WLAN_STATS_RX_MC_BYTE_CNT, |
| 9271 | sizeof(class_d_stats->rx_mc_byte_cnt), |
| 9272 | &(class_d_stats->rx_mc_byte_cnt), tlen); |
| 9273 | FILL_TLV(p, WLAN_STATS_RX_BC_BYTE_CNT, |
| 9274 | sizeof(class_d_stats->rx_bc_byte_cnt), |
| 9275 | &(class_d_stats->rx_bc_byte_cnt), tlen); |
| 9276 | FILL_TLV(p, WLAN_STATS_TX_UC_BYTE_CNT, |
| 9277 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 9278 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 9279 | FILL_TLV(p, WLAN_STATS_TX_MC_BYTE_CNT, |
| 9280 | sizeof(class_d_stats->tx_mc_byte_cnt), |
| 9281 | &(class_d_stats->tx_mc_byte_cnt), tlen); |
| 9282 | FILL_TLV(p, WLAN_STATS_TX_BC_BYTE_CNT, |
| 9283 | sizeof(class_d_stats->tx_bc_byte_cnt), |
| 9284 | &(class_d_stats->tx_bc_byte_cnt), tlen); |
| 9285 | |
| 9286 | wrqu->data.length = tlen; |
| 9287 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 9288 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9289 | |
| 9290 | return 0; |
| 9291 | } |
| 9292 | |
| 9293 | static int iw_get_statistics(struct net_device *dev, |
| 9294 | struct iw_request_info *info, |
| 9295 | union iwreq_data *wrqu, char *extra) |
| 9296 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9297 | int errno; |
| 9298 | struct osif_vdev_sync *vdev_sync; |
| 9299 | |
| 9300 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9301 | if (errno) |
| 9302 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9303 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9304 | errno = __iw_get_statistics(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9305 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9306 | osif_vdev_sync_op_stop(vdev_sync); |
| 9307 | |
| 9308 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9309 | } |
| 9310 | |
| 9311 | #ifdef FEATURE_WLAN_SCAN_PNO |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9312 | /*Max Len for PNO notification*/ |
| 9313 | #define MAX_PNO_NOTIFY_LEN 100 |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9314 | static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev, |
| 9315 | struct scan_event *event, void *args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9316 | { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9317 | struct vdev_osif_priv *osif_priv; |
| 9318 | struct wireless_dev *wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9319 | union iwreq_data wrqu; |
| 9320 | char buf[MAX_PNO_NOTIFY_LEN + 1]; |
| 9321 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9322 | wlan_vdev_obj_lock(vdev); |
| 9323 | osif_priv = wlan_vdev_get_ospriv(vdev); |
| 9324 | wlan_vdev_obj_unlock(vdev); |
| 9325 | if (!osif_priv) { |
| 9326 | hdd_err("osif_priv is null"); |
| 9327 | return; |
| 9328 | } |
| 9329 | |
| 9330 | wdev = osif_priv->wdev; |
| 9331 | if (!wdev) { |
| 9332 | hdd_err("wdev is null"); |
| 9333 | return; |
| 9334 | } |
| 9335 | |
| 9336 | hdd_debug("A preferred network was found"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9337 | |
| 9338 | /* create the event */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9339 | qdf_mem_zero(&wrqu, sizeof(wrqu)); |
| 9340 | qdf_mem_zero(buf, sizeof(buf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9341 | |
| 9342 | snprintf(buf, MAX_PNO_NOTIFY_LEN, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9343 | "QCOM: Found preferred network:"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9344 | |
| 9345 | wrqu.data.pointer = buf; |
| 9346 | wrqu.data.length = strlen(buf); |
| 9347 | |
| 9348 | /* send the event */ |
| 9349 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9350 | wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9351 | } |
| 9352 | |
| 9353 | /** |
| 9354 | * __iw_set_pno() - Preferred Network Offload ioctl handler |
| 9355 | * @dev: device upon which the ioctl was received |
| 9356 | * @info: ioctl request information |
| 9357 | * @wrqu: ioctl request data |
| 9358 | * @extra: ioctl extra data |
| 9359 | * |
| 9360 | * This function parses a Preferred Network Offload command |
| 9361 | * Input is string based and expected to be of the form: |
| 9362 | * |
| 9363 | * <enable(1) | disable(0)> |
| 9364 | * when enabling: |
| 9365 | * <number of networks> |
| 9366 | * for each network: |
| 9367 | * <ssid_len> <ssid> <authentication> <encryption> |
| 9368 | * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9369 | * <scan_time (seconds)> |
| 9370 | * <scan_repeat_count (0 means indefinite)> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9371 | * <suspend mode> |
| 9372 | * |
| 9373 | * e.g: |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9374 | * 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] | 9375 | * |
| 9376 | * this translates into: |
| 9377 | * ----------------------------- |
| 9378 | * enable PNO |
| 9379 | * 2 networks |
| 9380 | * Network 1: |
| 9381 | * test - with authentication type 0 and encryption type 0, |
| 9382 | * search on 3 channels: 1 6 and 11, |
| 9383 | * SSID bcast type is unknown (directed probe will be sent if |
| 9384 | * AP not found) and must meet -40dBm RSSI |
| 9385 | * Network 2: |
| 9386 | * test2 - with authentication type 4 and encryption type 4, |
| 9387 | * search on 6 channels 1, 2, 3, 4, 5 and 6 |
| 9388 | * bcast type is non-bcast (directed probe will be sent) |
| 9389 | * and must not meet any RSSI threshold |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9390 | * scan every 5 seconds 2 times |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9391 | * enable on suspend |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9392 | */ |
| 9393 | static int __iw_set_pno(struct net_device *dev, |
| 9394 | struct iw_request_info *info, |
| 9395 | union iwreq_data *wrqu, char *extra) |
| 9396 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9397 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9398 | struct hdd_context *hdd_ctx; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9399 | uint8_t value; |
| 9400 | struct wlan_objmgr_vdev *vdev; |
| 9401 | struct wlan_objmgr_psoc *psoc; |
| 9402 | int ret = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9403 | int offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9404 | char *ptr, *data; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9405 | uint8_t i, j, params; |
| 9406 | QDF_STATUS status; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9407 | size_t len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9408 | |
| 9409 | /* request is a large struct, so we make it static to avoid |
| 9410 | * stack overflow. This API is only invoked via ioctl, so it |
| 9411 | * is serialized by the kernel rtnl_lock and hence does not |
| 9412 | * need to be reentrant |
| 9413 | */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9414 | static struct pno_scan_req_params req; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9415 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9416 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9417 | |
| 9418 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9419 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9420 | if (ret) |
| 9421 | return ret; |
| 9422 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9423 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9424 | if (0 != ret) |
| 9425 | return ret; |
| 9426 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9427 | vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->pdev, |
| 9428 | dev->dev_addr, |
| 9429 | WLAN_LEGACY_MAC_ID); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9430 | if (!vdev) { |
| 9431 | hdd_err("vdev object is NULL"); |
| 9432 | return -EIO; |
| 9433 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9434 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9435 | /* making sure argument string ends with '\0' */ |
| 9436 | len = (wrqu->data.length + 1); |
| 9437 | data = qdf_mem_malloc(len); |
| 9438 | if (!data) { |
| 9439 | hdd_err("fail to allocate memory %zu", len); |
| 9440 | return -EINVAL; |
| 9441 | } |
| 9442 | qdf_mem_copy(data, extra, (len-1)); |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9443 | ptr = data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9444 | |
Hanumanth Reddy Pothula | 3048c93 | 2018-05-15 12:43:39 +0530 | [diff] [blame] | 9445 | hdd_debug("PNO data len %d data %s", wrqu->data.length, data); |
| 9446 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9447 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9448 | hdd_err("PNO enable input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9449 | ret = -EINVAL; |
| 9450 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9451 | } |
| 9452 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9453 | if (!value) { |
| 9454 | status = ucfg_scan_pno_stop(vdev); |
| 9455 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9456 | hdd_err("Failed to disabled PNO"); |
| 9457 | ret = -EINVAL; |
| 9458 | } else { |
| 9459 | hdd_debug("PNO scan disabled"); |
| 9460 | } |
| 9461 | goto exit; |
| 9462 | } |
| 9463 | |
| 9464 | if (ucfg_scan_get_pno_in_progress(vdev)) { |
| 9465 | hdd_debug("pno is already in progress"); |
| 9466 | ret = -EBUSY; |
| 9467 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9468 | } |
| 9469 | |
| 9470 | ptr += offset; |
| 9471 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9472 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9473 | hdd_err("PNO count input not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9474 | ret = -EINVAL; |
| 9475 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9476 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9477 | req.networks_cnt = value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9478 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9479 | hdd_debug("PNO enable networks count %d offset %d", |
| 9480 | req.networks_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9481 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9482 | if ((0 == req.networks_cnt) || |
| 9483 | (req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9484 | hdd_err("Network count %d invalid", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9485 | req.networks_cnt); |
| 9486 | ret = -EINVAL; |
| 9487 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9488 | } |
| 9489 | |
| 9490 | ptr += offset; |
| 9491 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9492 | for (i = 0; i < req.networks_cnt; i++) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9493 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9494 | req.networks_list[i].ssid.length = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9495 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9496 | params = sscanf(ptr, " %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9497 | &(req.networks_list[i].ssid.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9498 | &offset); |
| 9499 | |
| 9500 | if (1 != params) { |
| 9501 | hdd_err("PNO ssid length input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9502 | ret = -EINVAL; |
| 9503 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9504 | } |
| 9505 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9506 | if ((0 == req.networks_list[i].ssid.length) || |
| 9507 | (req.networks_list[i].ssid.length > 32)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9508 | hdd_err("SSID Len %d is not correct for network %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9509 | req.networks_list[i].ssid.length, i); |
| 9510 | ret = -EINVAL; |
| 9511 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9512 | } |
| 9513 | |
| 9514 | /* Advance to SSID */ |
| 9515 | ptr += offset; |
| 9516 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9517 | memcpy(req.networks_list[i].ssid.ssid, ptr, |
| 9518 | req.networks_list[i].ssid.length); |
| 9519 | ptr += req.networks_list[i].ssid.length; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9520 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9521 | params = sscanf(ptr, " %u %u %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9522 | &(req.networks_list[i].authentication), |
| 9523 | &(req.networks_list[i].encryption), |
| 9524 | &(req.networks_list[i].channel_cnt), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9525 | &offset); |
| 9526 | |
| 9527 | if (3 != params) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9528 | hdd_err("Incorrect cmd %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9529 | ret = -EINVAL; |
| 9530 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9531 | } |
| 9532 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9533 | 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] | 9534 | req.networks_list[i].ssid.length, |
| 9535 | req.networks_list[i].ssid.length, |
| 9536 | req.networks_list[i].ssid.ssid, |
| 9537 | req.networks_list[i].authentication, |
| 9538 | req.networks_list[i].encryption, |
| 9539 | req.networks_list[i].channel_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9540 | |
| 9541 | /* Advance to channel list */ |
| 9542 | ptr += offset; |
| 9543 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9544 | if (SCAN_PNO_MAX_NETW_CHANNELS_EX < |
| 9545 | req.networks_list[i].channel_cnt) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9546 | hdd_err("Incorrect number of channels"); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9547 | ret = -EINVAL; |
| 9548 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9549 | } |
| 9550 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9551 | if (0 != req.networks_list[i].channel_cnt) { |
| 9552 | for (j = 0; j < req.networks_list[i].channel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9553 | j++) { |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9554 | if (1 != sscanf(ptr, " %hhu %n", &value, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9555 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9556 | hdd_err("PNO network channel is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9557 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9558 | ret = -EINVAL; |
| 9559 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9560 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9561 | if (!IS_CHANNEL_VALID(value)) { |
| 9562 | hdd_err("invalid channel: %hhu", value); |
| 9563 | ret = -EINVAL; |
| 9564 | goto exit; |
| 9565 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9566 | req.networks_list[i].channels[j] = |
| 9567 | cds_chan_to_freq(value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9568 | /* Advance to next channel number */ |
| 9569 | ptr += offset; |
| 9570 | } |
| 9571 | } |
| 9572 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9573 | if (1 != sscanf(ptr, " %u %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9574 | &(req.networks_list[i].bc_new_type), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9575 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9576 | hdd_err("PNO broadcast network type is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9577 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9578 | ret = -EINVAL; |
| 9579 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9580 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9581 | if (req.networks_list[i].bc_new_type > 2) { |
| 9582 | hdd_err("invalid bcast nw type: %u", |
| 9583 | req.networks_list[i].bc_new_type); |
| 9584 | ret = -EINVAL; |
| 9585 | goto exit; |
| 9586 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9587 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9588 | hdd_debug("PNO bcastNetwType %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9589 | req.networks_list[i].bc_new_type, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9590 | |
| 9591 | /* Advance to rssi Threshold */ |
| 9592 | ptr += offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9593 | if (1 != sscanf(ptr, " %d %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9594 | &(req.networks_list[i].rssi_thresh), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9595 | &offset)) { |
| 9596 | hdd_err("PNO rssi threshold input is not valid %s", |
| 9597 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9598 | ret = -EINVAL; |
| 9599 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9600 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9601 | hdd_debug("PNO rssi %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9602 | req.networks_list[i].rssi_thresh, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9603 | /* Advance to next network */ |
| 9604 | ptr += offset; |
| 9605 | } /* For ucNetworkCount */ |
| 9606 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9607 | req.fast_scan_period = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9608 | if (sscanf(ptr, " %u %n", &(req.fast_scan_period), &offset) > 0) { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9609 | req.fast_scan_period *= MSEC_PER_SEC; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9610 | ptr += offset; |
| 9611 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9612 | if (req.fast_scan_period == 0) { |
| 9613 | hdd_err("invalid fast scan period %u", |
| 9614 | req.fast_scan_period); |
| 9615 | ret = -EINVAL; |
| 9616 | goto exit; |
| 9617 | } |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9618 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9619 | req.fast_scan_max_cycles = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9620 | if (sscanf(ptr, " %hhu %n", &value, |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9621 | &offset) > 0) |
| 9622 | ptr += offset; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9623 | req.fast_scan_max_cycles = value; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9624 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9625 | wlan_pdev_obj_lock(hdd_ctx->pdev); |
| 9626 | psoc = wlan_pdev_get_psoc(hdd_ctx->pdev); |
| 9627 | wlan_pdev_obj_unlock(hdd_ctx->pdev); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9628 | ucfg_scan_register_pno_cb(psoc, |
| 9629 | found_pref_network_cb, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9630 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9631 | ucfg_scan_get_pno_def_params(vdev, &req); |
| 9632 | status = ucfg_scan_pno_start(vdev, &req); |
| 9633 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9634 | hdd_err("Failed to enable PNO"); |
| 9635 | ret = -EINVAL; |
| 9636 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9637 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9638 | exit: |
| 9639 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9640 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9641 | qdf_mem_free(data); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9642 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9643 | } |
| 9644 | |
| 9645 | static int iw_set_pno(struct net_device *dev, |
| 9646 | struct iw_request_info *info, |
| 9647 | union iwreq_data *wrqu, char *extra) |
| 9648 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9649 | int errno; |
| 9650 | struct osif_vdev_sync *vdev_sync; |
| 9651 | |
| 9652 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9653 | if (errno) |
| 9654 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9655 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9656 | errno = __iw_set_pno(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9657 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9658 | osif_vdev_sync_op_stop(vdev_sync); |
| 9659 | |
| 9660 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9661 | } |
| 9662 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 9663 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9664 | static int __iw_set_band_config(struct net_device *dev, |
| 9665 | struct iw_request_info *info, |
| 9666 | union iwreq_data *wrqu, char *extra) |
| 9667 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9668 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9669 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9670 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9671 | int *value = (int *)extra; |
| 9672 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9673 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9674 | |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9675 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9676 | hdd_err("permission check failed"); |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9677 | return -EPERM; |
| 9678 | } |
| 9679 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9680 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9681 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9682 | if (0 != ret) |
| 9683 | return ret; |
| 9684 | |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 9685 | return hdd_reg_set_band(dev, value[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9686 | } |
| 9687 | |
| 9688 | static int iw_set_band_config(struct net_device *dev, |
| 9689 | struct iw_request_info *info, |
| 9690 | union iwreq_data *wrqu, char *extra) |
| 9691 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9692 | int errno; |
| 9693 | struct osif_vdev_sync *vdev_sync; |
| 9694 | |
| 9695 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9696 | if (errno) |
| 9697 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9698 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9699 | errno = __iw_set_band_config(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9700 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9701 | osif_vdev_sync_op_stop(vdev_sync); |
| 9702 | |
| 9703 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9704 | } |
| 9705 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9706 | static int printk_adapter(void *priv, const char *fmt, ...) |
| 9707 | { |
| 9708 | int ret; |
| 9709 | va_list args; |
| 9710 | |
| 9711 | va_start(args, fmt); |
| 9712 | ret = vprintk(fmt, args); |
| 9713 | ret += printk("\n"); |
| 9714 | va_end(args); |
| 9715 | |
| 9716 | return ret; |
| 9717 | } |
| 9718 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9719 | static void hdd_ioctl_log_buffer(int log_id, uint32_t count) |
| 9720 | { |
| 9721 | qdf_abstract_print *print = &printk_adapter; |
| 9722 | |
| 9723 | switch (log_id) { |
| 9724 | case HTC_CREDIT_HISTORY_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9725 | cds_print_htc_credit_history(count, print, NULL); |
| 9726 | break; |
| 9727 | case COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9728 | wma_print_wmi_cmd_log(count, print, NULL); |
| 9729 | break; |
| 9730 | case COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9731 | wma_print_wmi_cmd_tx_cmp_log(count, print, NULL); |
| 9732 | break; |
| 9733 | case MGMT_COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9734 | wma_print_wmi_mgmt_cmd_log(count, print, NULL); |
| 9735 | break; |
| 9736 | case MGMT_COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9737 | wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL); |
| 9738 | break; |
| 9739 | case EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9740 | wma_print_wmi_event_log(count, print, NULL); |
| 9741 | break; |
| 9742 | case RX_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9743 | wma_print_wmi_rx_event_log(count, print, NULL); |
| 9744 | break; |
| 9745 | case MGMT_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9746 | wma_print_wmi_mgmt_event_log(count, print, NULL); |
| 9747 | break; |
| 9748 | default: |
| 9749 | print(NULL, "Invalid Log Id %d", log_id); |
| 9750 | break; |
| 9751 | } |
| 9752 | } |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9753 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9754 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
| 9755 | int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2) |
| 9756 | { |
| 9757 | struct hdd_context *hdd_ctx; |
| 9758 | int ret; |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9759 | bool crash_inject; |
| 9760 | QDF_STATUS status; |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9761 | |
| 9762 | hdd_debug("WE_SET_FW_CRASH_INJECT: %d %d", |
| 9763 | v1, v2); |
| 9764 | pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n", |
| 9765 | v1, v2); |
| 9766 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9767 | |
Vignesh Viswanathan | a1f3a1a | 2018-10-04 13:10:46 +0530 | [diff] [blame] | 9768 | status = ucfg_mlme_get_crash_inject(hdd_ctx->psoc, &crash_inject); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9769 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9770 | hdd_err("Failed to get crash inject ini config"); |
| 9771 | return 0; |
| 9772 | } |
| 9773 | |
| 9774 | if (!crash_inject) { |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9775 | hdd_err("Crash Inject ini disabled, Ignore Crash Inject"); |
| 9776 | return 0; |
| 9777 | } |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9778 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9779 | if (v1 == 3) { |
| 9780 | cds_trigger_recovery(QDF_REASON_UNSPECIFIED); |
| 9781 | return 0; |
| 9782 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9783 | ret = wma_cli_set2_command(adapter->vdev_id, |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9784 | GEN_PARAM_CRASH_INJECT, |
| 9785 | v1, v2, GEN_CMD); |
| 9786 | return ret; |
| 9787 | } |
| 9788 | #endif |
| 9789 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9790 | #ifdef CONFIG_DP_TRACE |
| 9791 | void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) |
| 9792 | { |
| 9793 | hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d", |
| 9794 | cmd_type, count); |
| 9795 | if (cmd_type == DUMP_DP_TRACE) |
| 9796 | qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID); |
| 9797 | else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE) |
| 9798 | qdf_dp_trace_enable_live_mode(); |
| 9799 | else if (cmd_type == CLEAR_DP_TRACE_BUFFER) |
| 9800 | qdf_dp_trace_clear_buffer(); |
| 9801 | else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE) |
| 9802 | qdf_dp_trace_disable_live_mode(); |
| 9803 | } |
| 9804 | #endif |
| 9805 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9806 | static int __iw_set_two_ints_getnone(struct net_device *dev, |
| 9807 | struct iw_request_info *info, |
| 9808 | union iwreq_data *wrqu, char *extra) |
| 9809 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9810 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9811 | int *value = (int *)extra; |
| 9812 | int sub_cmd = value[0]; |
| 9813 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9814 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9815 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9816 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9817 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9818 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 9819 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9820 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9821 | if (0 != ret) |
| 9822 | return ret; |
| 9823 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9824 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9825 | if (0 != ret) |
| 9826 | return ret; |
| 9827 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9828 | switch (sub_cmd) { |
| 9829 | case WE_SET_SMPS_PARAM: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9830 | hdd_debug("WE_SET_SMPS_PARAM val %d %d", value[1], value[2]); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9831 | ret = wma_cli_set_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9832 | WMI_STA_SMPS_PARAM_CMDID, |
| 9833 | value[1] << WMA_SMPS_PARAM_VALUE_S |
| 9834 | | value[2], |
| 9835 | VDEV_CMD); |
| 9836 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9837 | case WE_SET_FW_CRASH_INJECT: |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9838 | ret = hdd_crash_inject(adapter, value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9839 | break; |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9840 | case WE_ENABLE_FW_PROFILE: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9841 | hdd_err("WE_ENABLE_FW_PROFILE: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9842 | value[1], value[2]); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9843 | ret = wma_cli_set2_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9844 | WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, |
| 9845 | value[1], value[2], DBG_CMD); |
| 9846 | break; |
| 9847 | case WE_SET_FW_PROFILE_HIST_INTVL: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9848 | hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9849 | value[1], value[2]); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9850 | ret = wma_cli_set2_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9851 | WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, |
| 9852 | value[1], value[2], DBG_CMD); |
| 9853 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9854 | case WE_SET_DUAL_MAC_FW_MODE_CONFIG: |
| 9855 | hdd_debug("Ioctl to set dual fw mode config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9856 | status = |
| 9857 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 9858 | &dual_mac_feature); |
| 9859 | if (status != QDF_STATUS_SUCCESS) |
| 9860 | hdd_err("can't get dual mac feature val, use def"); |
| 9861 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9862 | hdd_err("Dual mac feature is disabled from INI"); |
| 9863 | return -EPERM; |
| 9864 | } |
| 9865 | hdd_debug("%d %d", value[1], value[2]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 9866 | policy_mgr_set_dual_mac_fw_mode_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 9867 | value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9868 | break; |
| 9869 | case WE_DUMP_DP_TRACE_LEVEL: |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9870 | hdd_set_dump_dp_trace(value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9871 | break; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9872 | case WE_SET_MON_MODE_CHAN: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9873 | ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9874 | break; |
Rajeev Kumar | 15b40a2 | 2018-04-12 11:45:24 -0700 | [diff] [blame] | 9875 | case WE_SET_WLAN_SUSPEND: |
Dustin Brown | 5409643 | 2017-02-23 13:00:44 -0800 | [diff] [blame] | 9876 | ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, |
| 9877 | value[1], value[2]); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9878 | break; |
| 9879 | case WE_SET_WLAN_RESUME: |
Dustin Brown | bc81a47 | 2016-10-26 16:56:59 -0700 | [diff] [blame] | 9880 | ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9881 | break; |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9882 | case WE_LOG_BUFFER: { |
| 9883 | int log_id = value[1]; |
| 9884 | uint32_t count = value[2] < 0 ? 0 : value[2]; |
| 9885 | |
| 9886 | hdd_ioctl_log_buffer(log_id, count); |
| 9887 | |
| 9888 | break; |
| 9889 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 9890 | case WE_SET_BA_AGEING_TIMEOUT: |
| 9891 | { |
| 9892 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 9893 | |
| 9894 | if (!soc) { |
| 9895 | hdd_err("Invalid handles"); |
| 9896 | break; |
| 9897 | } |
| 9898 | cdp_set_ba_timeout(soc, value[1], value[2]); |
| 9899 | break; |
| 9900 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9901 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9902 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9903 | break; |
| 9904 | } |
| 9905 | |
| 9906 | return ret; |
| 9907 | } |
| 9908 | |
| 9909 | static int iw_set_two_ints_getnone(struct net_device *dev, |
| 9910 | struct iw_request_info *info, |
| 9911 | union iwreq_data *wrqu, char *extra) |
| 9912 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9913 | int errno; |
| 9914 | struct osif_vdev_sync *vdev_sync; |
| 9915 | |
| 9916 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9917 | if (errno) |
| 9918 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9919 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9920 | errno = __iw_set_two_ints_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9921 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9922 | osif_vdev_sync_op_stop(vdev_sync); |
| 9923 | |
| 9924 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9925 | } |
| 9926 | |
| 9927 | /* Define the Wireless Extensions to the Linux Network Device structure */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9928 | |
| 9929 | static const iw_handler we_private[] = { |
| 9930 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9931 | [WLAN_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_setint_getnone, |
| 9932 | [WLAN_PRIV_SET_NONE_GET_INT - SIOCIWFIRSTPRIV] = iw_setnone_getint, |
| 9933 | [WLAN_PRIV_SET_CHAR_GET_NONE - SIOCIWFIRSTPRIV] = iw_setchar_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9934 | [WLAN_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9935 | iw_set_three_ints_getnone, |
| 9936 | [WLAN_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] = iw_get_char_setnone, |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9937 | [WLAN_PRIV_SET_NONE_GET_NONE - SIOCIWFIRSTPRIV] = iw_setnone_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9938 | [WLAN_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9939 | iw_hdd_set_var_ints_getnone, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9940 | [WLAN_PRIV_SET_NONE_GET_THREE_INT - SIOCIWFIRSTPRIV] = |
| 9941 | iw_setnone_get_threeint, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9942 | #ifdef WLAN_FEATURE_FIPS |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 9943 | [WLAN_PRIV_FIPS_TEST - SIOCIWFIRSTPRIV] = hdd_fips_test, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9944 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9945 | [WLAN_PRIV_ADD_TSPEC - SIOCIWFIRSTPRIV] = iw_add_tspec, |
| 9946 | [WLAN_PRIV_DEL_TSPEC - SIOCIWFIRSTPRIV] = iw_del_tspec, |
| 9947 | [WLAN_PRIV_GET_TSPEC - SIOCIWFIRSTPRIV] = iw_get_tspec, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9948 | [WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9949 | [WLAN_PRIV_SET_HOST_OFFLOAD - SIOCIWFIRSTPRIV] = iw_set_host_offload, |
| 9950 | [WLAN_GET_WLAN_STATISTICS - SIOCIWFIRSTPRIV] = iw_get_statistics, |
| 9951 | [WLAN_SET_KEEPALIVE_PARAMS - SIOCIWFIRSTPRIV] = |
| 9952 | iw_set_keepalive_params, |
| 9953 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 9954 | [WLAN_SET_PACKET_FILTER_PARAMS - SIOCIWFIRSTPRIV] = |
| 9955 | iw_set_packet_filter_params, |
| 9956 | #endif |
| 9957 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9958 | [WLAN_SET_PNO - SIOCIWFIRSTPRIV] = iw_set_pno, |
| 9959 | #endif |
| 9960 | [WLAN_SET_BAND_CONFIG - SIOCIWFIRSTPRIV] = iw_set_band_config, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 9961 | [WLAN_PRIV_SET_MCBC_FILTER - SIOCIWFIRSTPRIV] = |
| 9962 | iw_set_dynamic_mcbc_filter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9963 | [WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 9964 | #ifdef FEATURE_WLM_STATS |
| 9965 | [WLAN_GET_WLM_STATS - SIOCIWFIRSTPRIV] = iw_get_wlm_stats, |
| 9966 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9967 | [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9968 | iw_set_two_ints_getnone, |
| 9969 | [WLAN_SET_DOT11P_CHANNEL_SCHED - SIOCIWFIRSTPRIV] = |
| 9970 | iw_set_dot11p_channel_sched, |
| 9971 | }; |
| 9972 | |
| 9973 | /*Maximum command length can be only 15 */ |
| 9974 | static const struct iw_priv_args we_private_args[] = { |
| 9975 | |
| 9976 | /* handlers for main ioctl */ |
| 9977 | {WLAN_PRIV_SET_INT_GET_NONE, |
| 9978 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9979 | 0, |
| 9980 | ""}, |
| 9981 | |
| 9982 | /* handlers for sub-ioctl */ |
| 9983 | {WE_SET_11D_STATE, |
| 9984 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9985 | 0, |
| 9986 | "set11Dstate"}, |
| 9987 | |
| 9988 | {WE_WOWL, |
| 9989 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9990 | 0, |
| 9991 | "wowl"}, |
| 9992 | |
| 9993 | {WE_SET_POWER, |
| 9994 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9995 | 0, |
| 9996 | "setPower"}, |
| 9997 | |
| 9998 | {WE_SET_MAX_ASSOC, |
| 9999 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10000 | 0, |
| 10001 | "setMaxAssoc"}, |
| 10002 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10003 | {WE_SET_SCAN_DISABLE, |
| 10004 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10005 | 0, |
| 10006 | "scan_disable"}, |
| 10007 | |
| 10008 | {WE_SET_DATA_INACTIVITY_TO, |
| 10009 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10010 | 0, |
| 10011 | "inactivityTO"}, |
| 10012 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 10013 | {WE_SET_WOW_DATA_INACTIVITY_TO, |
| 10014 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10015 | 0, |
| 10016 | "wow_ito"}, |
| 10017 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10018 | {WE_SET_MAX_TX_POWER, |
| 10019 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10020 | 0, |
| 10021 | "setMaxTxPower"}, |
| 10022 | |
| 10023 | {WE_SET_TX_POWER, |
| 10024 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10025 | 0, |
| 10026 | "setTxPower"}, |
| 10027 | |
| 10028 | {WE_SET_MC_RATE, |
| 10029 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10030 | 0, |
| 10031 | "setMcRate"}, |
| 10032 | |
| 10033 | {WE_SET_MAX_TX_POWER_2_4, |
| 10034 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10035 | 0, |
| 10036 | "setTxMaxPower2G"}, |
| 10037 | |
| 10038 | {WE_SET_MAX_TX_POWER_5_0, |
| 10039 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10040 | 0, |
| 10041 | "setTxMaxPower5G"}, |
| 10042 | |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 10043 | #ifndef REMOVE_PKT_LOG |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10044 | {WE_SET_PKTLOG, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 10045 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10046 | 0, |
| 10047 | "pktlog"}, |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 10048 | #endif |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10049 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10050 | /* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA |
| 10051 | * as well to keep same syntax as in SAP. Now onwards, STA |
Jeff Johnson | 3bb7c73 | 2017-01-12 08:40:17 -0800 | [diff] [blame] | 10052 | * will support both |
| 10053 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10054 | {WE_SET_MAX_TX_POWER, |
| 10055 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10056 | 0, |
| 10057 | "setTxMaxPower"}, |
| 10058 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 10059 | #ifdef HASTINGS_BT_WAR |
| 10060 | {WE_SET_HASTINGS_BT_WAR, |
| 10061 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10062 | 0, |
| 10063 | "hastings_bt_war"}, |
| 10064 | #endif |
| 10065 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10066 | {WE_SET_TM_LEVEL, |
| 10067 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10068 | 0, |
| 10069 | "setTmLevel"}, |
| 10070 | |
| 10071 | {WE_SET_PHYMODE, |
| 10072 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10073 | 0, |
| 10074 | "setphymode"}, |
| 10075 | |
| 10076 | {WE_SET_NSS, |
| 10077 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10078 | 0, |
| 10079 | "nss"}, |
| 10080 | |
| 10081 | {WE_SET_LDPC, |
| 10082 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10083 | 0, |
| 10084 | "ldpc"}, |
| 10085 | |
| 10086 | {WE_SET_TX_STBC, |
| 10087 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10088 | 0, |
| 10089 | "tx_stbc"}, |
| 10090 | |
| 10091 | {WE_SET_RX_STBC, |
| 10092 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10093 | 0, |
| 10094 | "rx_stbc"}, |
| 10095 | |
| 10096 | {WE_SET_SHORT_GI, |
| 10097 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10098 | 0, |
| 10099 | "shortgi"}, |
| 10100 | |
| 10101 | {WE_SET_RTSCTS, |
| 10102 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10103 | 0, |
| 10104 | "enablertscts"}, |
| 10105 | |
| 10106 | {WE_SET_CHWIDTH, |
| 10107 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10108 | 0, |
| 10109 | "chwidth"}, |
| 10110 | |
| 10111 | {WE_SET_ANI_EN_DIS, |
| 10112 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10113 | 0, |
| 10114 | "anienable"}, |
| 10115 | |
| 10116 | {WE_SET_ANI_POLL_PERIOD, |
| 10117 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10118 | 0, |
| 10119 | "aniplen"}, |
| 10120 | |
| 10121 | {WE_SET_ANI_LISTEN_PERIOD, |
| 10122 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10123 | 0, |
| 10124 | "anilislen"}, |
| 10125 | |
| 10126 | {WE_SET_ANI_OFDM_LEVEL, |
| 10127 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10128 | 0, |
| 10129 | "aniofdmlvl"}, |
| 10130 | |
| 10131 | {WE_SET_ANI_CCK_LEVEL, |
| 10132 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10133 | 0, |
| 10134 | "aniccklvl"}, |
| 10135 | |
| 10136 | {WE_SET_DYNAMIC_BW, |
| 10137 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10138 | 0, |
| 10139 | "cwmenable"}, |
| 10140 | |
| 10141 | {WE_SET_CTS_CBW, |
| 10142 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10143 | 0, |
| 10144 | "cts_cbw" }, |
| 10145 | |
| 10146 | {WE_SET_GTX_HT_MCS, |
| 10147 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10148 | 0, |
| 10149 | "gtxHTMcs"}, |
| 10150 | |
| 10151 | {WE_SET_GTX_VHT_MCS, |
| 10152 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10153 | 0, |
| 10154 | "gtxVHTMcs"}, |
| 10155 | |
| 10156 | {WE_SET_GTX_USRCFG, |
| 10157 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10158 | 0, |
| 10159 | "gtxUsrCfg"}, |
| 10160 | |
| 10161 | {WE_SET_GTX_THRE, |
| 10162 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10163 | 0, |
| 10164 | "gtxThre"}, |
| 10165 | |
| 10166 | {WE_SET_GTX_MARGIN, |
| 10167 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10168 | 0, |
| 10169 | "gtxMargin"}, |
| 10170 | |
| 10171 | {WE_SET_GTX_STEP, |
| 10172 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10173 | 0, |
| 10174 | "gtxStep"}, |
| 10175 | |
| 10176 | {WE_SET_GTX_MINTPC, |
| 10177 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10178 | 0, |
| 10179 | "gtxMinTpc"}, |
| 10180 | |
| 10181 | {WE_SET_GTX_BWMASK, |
| 10182 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10183 | 0, |
| 10184 | "gtxBWMask"}, |
| 10185 | |
| 10186 | {WE_SET_TX_CHAINMASK, |
| 10187 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10188 | 0, |
| 10189 | "txchainmask"}, |
| 10190 | |
| 10191 | {WE_SET_RX_CHAINMASK, |
| 10192 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10193 | 0, |
| 10194 | "rxchainmask"}, |
| 10195 | |
| 10196 | {WE_SET_11N_RATE, |
| 10197 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10198 | 0, |
| 10199 | "set11NRates"}, |
| 10200 | |
| 10201 | {WE_SET_VHT_RATE, |
| 10202 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10203 | 0, |
| 10204 | "set11ACRates"}, |
| 10205 | |
| 10206 | {WE_SET_AMPDU, |
| 10207 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10208 | 0, |
| 10209 | "ampdu"}, |
| 10210 | |
| 10211 | {WE_SET_AMSDU, |
| 10212 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10213 | 0, |
| 10214 | "amsdu"}, |
| 10215 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10216 | {WE_SET_TXPOW_2G, |
| 10217 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10218 | 0, |
| 10219 | "txpow2g"}, |
| 10220 | |
| 10221 | {WE_SET_TXPOW_5G, |
| 10222 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10223 | 0, |
| 10224 | "txpow5g"}, |
| 10225 | |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 10226 | #ifdef FEATURE_FW_LOG_PARSING |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10227 | /* Sub-cmds DBGLOG specific commands */ |
| 10228 | {WE_DBGLOG_LOG_LEVEL, |
| 10229 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10230 | 0, |
| 10231 | "dl_loglevel"}, |
| 10232 | |
| 10233 | {WE_DBGLOG_VAP_ENABLE, |
| 10234 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10235 | 0, |
| 10236 | "dl_vapon"}, |
| 10237 | |
| 10238 | {WE_DBGLOG_VAP_DISABLE, |
| 10239 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10240 | 0, |
| 10241 | "dl_vapoff"}, |
| 10242 | |
| 10243 | {WE_DBGLOG_MODULE_ENABLE, |
| 10244 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10245 | 0, |
| 10246 | "dl_modon"}, |
| 10247 | |
| 10248 | {WE_DBGLOG_MODULE_DISABLE, |
| 10249 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10250 | 0, |
| 10251 | "dl_modoff"}, |
| 10252 | |
| 10253 | {WE_DBGLOG_MOD_LOG_LEVEL, |
| 10254 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10255 | 0, |
| 10256 | "dl_mod_loglevel"}, |
| 10257 | |
| 10258 | {WE_DBGLOG_TYPE, |
| 10259 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10260 | 0, |
| 10261 | "dl_type"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10262 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10263 | {WE_DBGLOG_REPORT_ENABLE, |
| 10264 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10265 | 0, |
| 10266 | "dl_report"}, |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 10267 | #endif /* FEATURE_FW_LOG_PARSING */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10268 | |
| 10269 | {WE_SET_TXRX_FWSTATS, |
| 10270 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10271 | 0, |
| 10272 | "txrx_fw_stats"}, |
| 10273 | |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 10274 | {WE_SET_TXRX_STATS, |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 10275 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 10276 | 0, |
| 10277 | "txrx_stats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10278 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 10279 | {WE_SET_THERMAL_THROTTLE_CFG, |
| 10280 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10281 | 0, |
| 10282 | "set_thermal_cfg"}, |
| 10283 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 10284 | {WE_SET_BTCOEX_MODE, |
| 10285 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10286 | 0, "set_btc_mode" }, |
| 10287 | {WE_SET_BTCOEX_RSSI_THRESHOLD, |
| 10288 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10289 | 0, "set_btc_rssi" }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10290 | {WE_TXRX_FWSTATS_RESET, |
| 10291 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10292 | 0, |
| 10293 | "txrx_fw_st_rst"}, |
| 10294 | |
| 10295 | {WE_PPS_PAID_MATCH, |
| 10296 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10297 | 0, "paid_match"}, |
| 10298 | |
| 10299 | {WE_PPS_GID_MATCH, |
| 10300 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10301 | 0, "gid_match"}, |
| 10302 | |
| 10303 | {WE_PPS_EARLY_TIM_CLEAR, |
| 10304 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10305 | 0, "tim_clear"}, |
| 10306 | |
| 10307 | {WE_PPS_EARLY_DTIM_CLEAR, |
| 10308 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10309 | 0, "dtim_clear"}, |
| 10310 | |
| 10311 | {WE_PPS_EOF_PAD_DELIM, |
| 10312 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10313 | 0, "eof_delim"}, |
| 10314 | |
| 10315 | {WE_PPS_MACADDR_MISMATCH, |
| 10316 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10317 | 0, "mac_match"}, |
| 10318 | |
| 10319 | {WE_PPS_DELIM_CRC_FAIL, |
| 10320 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10321 | 0, "delim_fail"}, |
| 10322 | |
| 10323 | {WE_PPS_GID_NSTS_ZERO, |
| 10324 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10325 | 0, "nsts_zero"}, |
| 10326 | |
| 10327 | {WE_PPS_RSSI_CHECK, |
| 10328 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10329 | 0, "rssi_chk"}, |
| 10330 | |
| 10331 | {WE_PPS_5G_EBT, |
| 10332 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10333 | 0, "5g_ebt"}, |
| 10334 | |
| 10335 | {WE_SET_HTSMPS, |
| 10336 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10337 | 0, "htsmps"}, |
| 10338 | |
| 10339 | {WE_SET_QPOWER_MAX_PSPOLL_COUNT, |
| 10340 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10341 | 0, "set_qpspollcnt"}, |
| 10342 | |
| 10343 | {WE_SET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 10344 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10345 | 0, "set_qtxwake"}, |
| 10346 | |
| 10347 | {WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 10348 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10349 | 0, "set_qwakeintv"}, |
| 10350 | |
| 10351 | {WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 10352 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10353 | 0, "set_qnodatapoll"}, |
| 10354 | |
| 10355 | /* handlers for MCC time quota and latency sub ioctls */ |
| 10356 | {WE_MCC_CONFIG_LATENCY, |
| 10357 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10358 | 0, "setMccLatency"}, |
| 10359 | |
| 10360 | {WE_MCC_CONFIG_QUOTA, |
| 10361 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10362 | 0, "setMccQuota"}, |
| 10363 | |
| 10364 | {WE_SET_DEBUG_LOG, |
| 10365 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10366 | 0, "setDbgLvl"}, |
| 10367 | |
| 10368 | /* handlers for early_rx power save */ |
| 10369 | {WE_SET_EARLY_RX_ADJUST_ENABLE, |
| 10370 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10371 | 0, "erx_enable"}, |
| 10372 | |
| 10373 | {WE_SET_EARLY_RX_TGT_BMISS_NUM, |
| 10374 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10375 | 0, "erx_bmiss_val"}, |
| 10376 | |
| 10377 | {WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 10378 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10379 | 0, "erx_bmiss_smpl"}, |
| 10380 | |
| 10381 | {WE_SET_EARLY_RX_SLOP_STEP, |
| 10382 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10383 | 0, "erx_slop_step"}, |
| 10384 | |
| 10385 | {WE_SET_EARLY_RX_INIT_SLOP, |
| 10386 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10387 | 0, "erx_init_slop"}, |
| 10388 | |
| 10389 | {WE_SET_EARLY_RX_ADJUST_PAUSE, |
| 10390 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10391 | 0, "erx_adj_pause"}, |
| 10392 | |
| 10393 | {WE_SET_EARLY_RX_DRIFT_SAMPLE, |
| 10394 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10395 | 0, "erx_dri_sample"}, |
| 10396 | |
| 10397 | {WE_DUMP_STATS, |
| 10398 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10399 | 0, "dumpStats"}, |
| 10400 | |
| 10401 | {WE_CLEAR_STATS, |
| 10402 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10403 | 0, "clearStats"}, |
| 10404 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10405 | {WE_START_FW_PROFILE, |
| 10406 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10407 | 0, "startProfile"}, |
| 10408 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 10409 | {WE_SET_CHANNEL, |
| 10410 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10411 | 0, "setChanChange" }, |
| 10412 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 10413 | {WE_SET_CONC_SYSTEM_PREF, |
| 10414 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10415 | 0, "setConcSysPref" }, |
| 10416 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 10417 | {WE_SET_PDEV_RESET, |
| 10418 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10419 | 0, "pdev_reset" }, |
| 10420 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10421 | {WE_SET_MODULATED_DTIM, |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 10422 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10423 | 0, "setModDTIM" }, |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10424 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10425 | {WLAN_PRIV_SET_NONE_GET_INT, |
| 10426 | 0, |
| 10427 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10428 | ""}, |
| 10429 | |
| 10430 | /* handlers for sub-ioctl */ |
| 10431 | {WE_GET_11D_STATE, |
| 10432 | 0, |
| 10433 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10434 | "get11Dstate"}, |
| 10435 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10436 | {WE_GET_WLAN_DBG, |
| 10437 | 0, |
| 10438 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10439 | "getwlandbg"}, |
| 10440 | |
| 10441 | {WE_GET_MAX_ASSOC, |
| 10442 | 0, |
| 10443 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10444 | "getMaxAssoc"}, |
| 10445 | |
| 10446 | {WE_GET_SAP_AUTO_CHANNEL_SELECTION, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10447 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10448 | "getAutoChannel"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10449 | |
| 10450 | {WE_GET_CONCURRENCY_MODE, |
| 10451 | 0, |
| 10452 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10453 | "getconcurrency"}, |
| 10454 | |
| 10455 | {WE_GET_NSS, |
| 10456 | 0, |
| 10457 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10458 | "get_nss"}, |
| 10459 | |
| 10460 | {WE_GET_LDPC, |
| 10461 | 0, |
| 10462 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10463 | "get_ldpc"}, |
| 10464 | |
| 10465 | {WE_GET_TX_STBC, |
| 10466 | 0, |
| 10467 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10468 | "get_tx_stbc"}, |
| 10469 | |
| 10470 | {WE_GET_RX_STBC, |
| 10471 | 0, |
| 10472 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10473 | "get_rx_stbc"}, |
| 10474 | |
| 10475 | {WE_GET_SHORT_GI, |
| 10476 | 0, |
| 10477 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10478 | "get_shortgi"}, |
| 10479 | |
| 10480 | {WE_GET_RTSCTS, |
| 10481 | 0, |
| 10482 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10483 | "get_rtscts"}, |
| 10484 | |
| 10485 | {WE_GET_CHWIDTH, |
| 10486 | 0, |
| 10487 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10488 | "get_chwidth"}, |
| 10489 | |
| 10490 | {WE_GET_ANI_EN_DIS, |
| 10491 | 0, |
| 10492 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10493 | "get_anienable"}, |
| 10494 | |
| 10495 | {WE_GET_ANI_POLL_PERIOD, |
| 10496 | 0, |
| 10497 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10498 | "get_aniplen"}, |
| 10499 | |
| 10500 | {WE_GET_ANI_LISTEN_PERIOD, |
| 10501 | 0, |
| 10502 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10503 | "get_anilislen"}, |
| 10504 | |
| 10505 | {WE_GET_ANI_OFDM_LEVEL, |
| 10506 | 0, |
| 10507 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10508 | "get_aniofdmlvl"}, |
| 10509 | |
| 10510 | {WE_GET_ANI_CCK_LEVEL, |
| 10511 | 0, |
| 10512 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10513 | "get_aniccklvl"}, |
| 10514 | |
| 10515 | {WE_GET_DYNAMIC_BW, |
| 10516 | 0, |
| 10517 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10518 | "get_cwmenable"}, |
| 10519 | |
| 10520 | {WE_GET_GTX_HT_MCS, |
| 10521 | 0, |
| 10522 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10523 | "get_gtxHTMcs"}, |
| 10524 | |
| 10525 | {WE_GET_GTX_VHT_MCS, |
| 10526 | 0, |
| 10527 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10528 | "get_gtxVHTMcs"}, |
| 10529 | |
| 10530 | {WE_GET_GTX_USRCFG, |
| 10531 | 0, |
| 10532 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10533 | "get_gtxUsrCfg"}, |
| 10534 | |
| 10535 | {WE_GET_GTX_THRE, |
| 10536 | 0, |
| 10537 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10538 | "get_gtxThre"}, |
| 10539 | |
| 10540 | {WE_GET_GTX_MARGIN, |
| 10541 | 0, |
| 10542 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10543 | "get_gtxMargin"}, |
| 10544 | |
| 10545 | {WE_GET_GTX_STEP, |
| 10546 | 0, |
| 10547 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10548 | "get_gtxStep"}, |
| 10549 | |
| 10550 | {WE_GET_GTX_MINTPC, |
| 10551 | 0, |
| 10552 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10553 | "get_gtxMinTpc"}, |
| 10554 | |
| 10555 | {WE_GET_GTX_BWMASK, |
| 10556 | 0, |
| 10557 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10558 | "get_gtxBWMask"}, |
| 10559 | |
| 10560 | {WE_GET_TX_CHAINMASK, |
| 10561 | 0, |
| 10562 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10563 | "get_txchainmask"}, |
| 10564 | |
| 10565 | {WE_GET_RX_CHAINMASK, |
| 10566 | 0, |
| 10567 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10568 | "get_rxchainmask"}, |
| 10569 | |
| 10570 | {WE_GET_11N_RATE, |
| 10571 | 0, |
| 10572 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10573 | "get_11nrate"}, |
| 10574 | |
| 10575 | {WE_GET_AMPDU, |
| 10576 | 0, |
| 10577 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10578 | "get_ampdu"}, |
| 10579 | |
| 10580 | {WE_GET_AMSDU, |
| 10581 | 0, |
| 10582 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10583 | "get_amsdu"}, |
| 10584 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10585 | {WE_GET_TXPOW_2G, |
| 10586 | 0, |
| 10587 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10588 | "get_txpow2g"}, |
| 10589 | |
| 10590 | {WE_GET_TXPOW_5G, |
| 10591 | 0, |
| 10592 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10593 | "get_txpow5g"}, |
| 10594 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10595 | {WE_GET_PPS_PAID_MATCH, |
| 10596 | 0, |
| 10597 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10598 | "get_paid_match"}, |
| 10599 | |
| 10600 | {WE_GET_PPS_GID_MATCH, |
| 10601 | 0, |
| 10602 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10603 | "get_gid_match"}, |
| 10604 | |
| 10605 | {WE_GET_PPS_EARLY_TIM_CLEAR, |
| 10606 | 0, |
| 10607 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10608 | "get_tim_clear"}, |
| 10609 | |
| 10610 | {WE_GET_PPS_EARLY_DTIM_CLEAR, |
| 10611 | 0, |
| 10612 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10613 | "get_dtim_clear"}, |
| 10614 | |
| 10615 | {WE_GET_PPS_EOF_PAD_DELIM, |
| 10616 | 0, |
| 10617 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10618 | "get_eof_delim"}, |
| 10619 | |
| 10620 | {WE_GET_PPS_MACADDR_MISMATCH, |
| 10621 | 0, |
| 10622 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10623 | "get_mac_match"}, |
| 10624 | |
| 10625 | {WE_GET_PPS_DELIM_CRC_FAIL, |
| 10626 | 0, |
| 10627 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10628 | "get_delim_fail"}, |
| 10629 | |
| 10630 | {WE_GET_PPS_GID_NSTS_ZERO, |
| 10631 | 0, |
| 10632 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10633 | "get_nsts_zero"}, |
| 10634 | |
| 10635 | {WE_GET_PPS_RSSI_CHECK, |
| 10636 | 0, |
| 10637 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10638 | "get_rssi_chk"}, |
| 10639 | |
| 10640 | {WE_GET_QPOWER_MAX_PSPOLL_COUNT, |
| 10641 | 0, |
| 10642 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10643 | "get_qpspollcnt"}, |
| 10644 | |
| 10645 | {WE_GET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 10646 | 0, |
| 10647 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10648 | "get_qtxwake"}, |
| 10649 | |
| 10650 | {WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 10651 | 0, |
| 10652 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10653 | "get_qwakeintv"}, |
| 10654 | |
| 10655 | {WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 10656 | 0, |
| 10657 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10658 | "get_qnodatapoll"}, |
| 10659 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10660 | {WE_CAP_TSF, |
| 10661 | 0, |
| 10662 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10663 | "cap_tsf"}, |
| 10664 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10665 | {WE_GET_TEMPERATURE, |
| 10666 | 0, |
| 10667 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10668 | "get_temp"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10669 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10670 | {WE_GET_DCM, |
| 10671 | 0, |
| 10672 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10673 | "get_dcm"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10674 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10675 | {WE_GET_RANGE_EXT, |
| 10676 | 0, |
| 10677 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10678 | "get_range_ext"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10679 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10680 | /* handlers for main ioctl */ |
| 10681 | {WLAN_PRIV_SET_CHAR_GET_NONE, |
| 10682 | IW_PRIV_TYPE_CHAR | 512, |
| 10683 | 0, |
| 10684 | ""}, |
| 10685 | |
| 10686 | /* handlers for sub-ioctl */ |
| 10687 | {WE_WOWL_ADD_PTRN, |
| 10688 | IW_PRIV_TYPE_CHAR | 512, |
| 10689 | 0, |
| 10690 | "wowlAddPtrn"}, |
| 10691 | |
| 10692 | {WE_WOWL_DEL_PTRN, |
| 10693 | IW_PRIV_TYPE_CHAR | 512, |
| 10694 | 0, |
| 10695 | "wowlDelPtrn"}, |
| 10696 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10697 | /* handlers for sub-ioctl */ |
| 10698 | {WE_NEIGHBOR_REPORT_REQUEST, |
| 10699 | IW_PRIV_TYPE_CHAR | 512, |
| 10700 | 0, |
| 10701 | "neighbor"}, |
Deepak Dhamdhere | 641bf32 | 2016-01-06 15:19:03 -0800 | [diff] [blame] | 10702 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10703 | {WE_SET_AP_WPS_IE, |
| 10704 | IW_PRIV_TYPE_CHAR | 512, |
| 10705 | 0, |
| 10706 | "set_ap_wps_ie"}, |
| 10707 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 10708 | #ifdef WLAN_UNIT_TEST |
| 10709 | {WE_UNIT_TEST, |
| 10710 | IW_PRIV_TYPE_CHAR | 512, |
| 10711 | 0, |
| 10712 | "unit_test"}, |
| 10713 | #endif |
| 10714 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10715 | /* handlers for main ioctl */ |
| 10716 | {WLAN_PRIV_SET_THREE_INT_GET_NONE, |
| 10717 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10718 | 0, |
| 10719 | ""}, |
| 10720 | |
| 10721 | /* handlers for sub-ioctl */ |
| 10722 | {WE_SET_WLAN_DBG, |
| 10723 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10724 | 0, |
| 10725 | "setwlandbg"}, |
| 10726 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10727 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10728 | /* handlers for sub-ioctl */ |
| 10729 | {WE_SET_DP_TRACE, |
| 10730 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10731 | 0, |
| 10732 | "set_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10733 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10734 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 10735 | {WE_SET_FW_TEST, |
| 10736 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10737 | 0, "fw_test"}, |
| 10738 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10739 | /* handlers for main ioctl */ |
| 10740 | {WLAN_PRIV_SET_NONE_GET_THREE_INT, |
| 10741 | 0, |
| 10742 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10743 | ""}, |
| 10744 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10745 | {WE_GET_TSF, |
| 10746 | 0, |
| 10747 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10748 | "get_tsf"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10749 | |
| 10750 | {WE_SET_DUAL_MAC_SCAN_CONFIG, |
| 10751 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10752 | 0, |
| 10753 | "set_scan_cfg"}, |
| 10754 | |
| 10755 | /* handlers for main ioctl */ |
| 10756 | {WLAN_PRIV_GET_CHAR_SET_NONE, |
| 10757 | 0, |
| 10758 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10759 | ""}, |
| 10760 | |
| 10761 | /* handlers for sub-ioctl */ |
| 10762 | {WE_WLAN_VERSION, |
| 10763 | 0, |
| 10764 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10765 | "version"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10766 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10767 | {WE_GET_STATS, |
| 10768 | 0, |
| 10769 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10770 | "getStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10771 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 10772 | {WE_GET_SUSPEND_RESUME_STATS, |
| 10773 | 0, |
| 10774 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10775 | "getSuspendStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10776 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10777 | {WE_LIST_FW_PROFILE, |
| 10778 | 0, |
| 10779 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10780 | "listProfile"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10781 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10782 | {WE_GET_STATES, |
| 10783 | 0, |
| 10784 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10785 | "getHostStates"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10786 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10787 | {WE_GET_CFG, |
| 10788 | 0, |
| 10789 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10790 | "getConfig"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10791 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10792 | {WE_GET_RSSI, |
| 10793 | 0, |
| 10794 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10795 | "getRSSI"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10796 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10797 | {WE_GET_WMM_STATUS, |
| 10798 | 0, |
| 10799 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10800 | "getWmmStatus"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10801 | |
| 10802 | {WE_GET_CHANNEL_LIST, |
| 10803 | 0, |
| 10804 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10805 | "getChannelList"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10806 | #ifdef FEATURE_WLAN_TDLS |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10807 | {WE_GET_TDLS_PEERS, |
| 10808 | 0, |
| 10809 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10810 | "getTdlsPeers"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10811 | #endif |
| 10812 | #ifdef WLAN_FEATURE_11W |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10813 | {WE_GET_11W_INFO, |
| 10814 | 0, |
| 10815 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10816 | "getPMFInfo"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10817 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10818 | {WE_GET_STA_CXN_INFO, |
| 10819 | 0, |
| 10820 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10821 | "get_cxn_info" }, |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 10822 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10823 | {WE_GET_IBSS_STA_INFO, |
| 10824 | 0, |
| 10825 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10826 | "getIbssSTAs"}, |
| 10827 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10828 | {WE_GET_PHYMODE, |
| 10829 | 0, |
| 10830 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10831 | "getphymode"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10832 | #if defined(FEATURE_OEM_DATA_SUPPORT) || defined(WIFI_POS_CONVERGED) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10833 | {WE_GET_OEM_DATA_CAP, |
| 10834 | 0, |
| 10835 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10836 | "getOemDataCap"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10837 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10838 | {WE_GET_SNR, |
| 10839 | 0, |
| 10840 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10841 | "getSNR"}, |
| 10842 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 10843 | {WE_GET_BA_AGEING_TIMEOUT, |
| 10844 | 0, |
| 10845 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10846 | "get_ba_timeout"}, |
| 10847 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10848 | /* handlers for main ioctl */ |
| 10849 | {WLAN_PRIV_SET_NONE_GET_NONE, |
| 10850 | 0, |
| 10851 | 0, |
| 10852 | ""}, |
| 10853 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10854 | /* handlers for sub-ioctl */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10855 | {WE_IBSS_GET_PEER_INFO_ALL, |
| 10856 | 0, |
| 10857 | 0, |
| 10858 | "ibssPeerInfoAll"}, |
| 10859 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10860 | {WE_GET_FW_PROFILE_DATA, |
| 10861 | 0, |
| 10862 | 0, |
| 10863 | "getProfileData"}, |
| 10864 | |
| 10865 | {WE_SET_REASSOC_TRIGGER, |
| 10866 | 0, |
| 10867 | 0, |
| 10868 | "reassoc"}, |
| 10869 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 10870 | {WE_STOP_OBSS_SCAN, |
| 10871 | 0, |
| 10872 | 0, |
| 10873 | "stop_obss_scan"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10874 | /* handlers for main ioctl */ |
| 10875 | {WLAN_PRIV_SET_VAR_INT_GET_NONE, |
| 10876 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10877 | 0, |
| 10878 | ""}, |
| 10879 | |
| 10880 | /* handlers for sub-ioctl */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10881 | {WE_IBSS_GET_PEER_INFO, |
| 10882 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10883 | 0, |
| 10884 | "ibssPeerInfo"}, |
| 10885 | |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10886 | #ifdef TRACE_RECORD |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10887 | /* handlers for sub-ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10888 | {WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD, |
| 10889 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10890 | 0, |
| 10891 | "setdumplog"}, |
| 10892 | |
| 10893 | {WE_MTRACE_DUMP_CMD, |
| 10894 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10895 | 0, |
| 10896 | "dumplog"}, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10897 | #endif |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 10898 | |
| 10899 | {WE_POLICY_MANAGER_CINFO_CMD, |
| 10900 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10901 | 0, |
| 10902 | "pm_cinfo"}, |
| 10903 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10904 | #ifdef MPC_UT_FRAMEWORK |
| 10905 | {WE_POLICY_MANAGER_CLIST_CMD, |
| 10906 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10907 | 0, |
| 10908 | "pm_clist"}, |
| 10909 | |
| 10910 | {WE_POLICY_MANAGER_DLIST_CMD, |
| 10911 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10912 | 0, |
| 10913 | "pm_dlist"}, |
| 10914 | |
| 10915 | {WE_POLICY_MANAGER_DBS_CMD, |
| 10916 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10917 | 0, |
| 10918 | "pm_dbs"}, |
| 10919 | |
| 10920 | {WE_POLICY_MANAGER_PCL_CMD, |
| 10921 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10922 | 0, |
| 10923 | "pm_pcl"}, |
| 10924 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10925 | {WE_POLICY_MANAGER_ULIST_CMD, |
| 10926 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10927 | 0, |
| 10928 | "pm_ulist"}, |
| 10929 | |
| 10930 | {WE_POLICY_MANAGER_QUERY_ACTION_CMD, |
| 10931 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10932 | 0, |
| 10933 | "pm_query_action"}, |
| 10934 | |
| 10935 | {WE_POLICY_MANAGER_QUERY_ALLOW_CMD, |
| 10936 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10937 | 0, |
| 10938 | "pm_query_allow"}, |
| 10939 | |
| 10940 | {WE_POLICY_MANAGER_SCENARIO_CMD, |
| 10941 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10942 | 0, |
| 10943 | "pm_run_scenario"}, |
| 10944 | |
| 10945 | {WE_POLICY_SET_HW_MODE_CMD, |
| 10946 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10947 | 0, |
| 10948 | "pm_set_hw_mode"}, |
| 10949 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10950 | {WE_UNIT_TEST_CMD, |
| 10951 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10952 | 0, |
| 10953 | "setUnitTestCmd"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10954 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10955 | {WE_MAC_PWR_DEBUG_CMD, |
| 10956 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10957 | 0, |
| 10958 | "halPwrDebug"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10959 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 10960 | {WE_LED_FLASHING_PARAM, |
| 10961 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10962 | 0, |
| 10963 | "gpio_control"}, |
| 10964 | #endif |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 10965 | #ifdef WLAN_DEBUG |
| 10966 | {WE_SET_CHAN_AVOID, |
| 10967 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10968 | 0, |
| 10969 | "ch_avoid"}, |
| 10970 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10971 | /* handlers for main ioctl */ |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 10972 | {WLAN_PRIV_FIPS_TEST, |
| 10973 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10974 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10975 | "fips_test"}, |
| 10976 | |
| 10977 | /* handlers for main ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10978 | {WLAN_PRIV_ADD_TSPEC, |
| 10979 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
| 10980 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10981 | "addTspec"}, |
| 10982 | |
| 10983 | /* handlers for main ioctl */ |
| 10984 | {WLAN_PRIV_DEL_TSPEC, |
| 10985 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10986 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10987 | "delTspec"}, |
| 10988 | |
| 10989 | /* handlers for main ioctl */ |
| 10990 | {WLAN_PRIV_GET_TSPEC, |
| 10991 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10992 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10993 | "getTspec"}, |
| 10994 | |
| 10995 | /* handlers for main ioctl - host offload */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10996 | {WLAN_PRIV_SET_HOST_OFFLOAD, |
| 10997 | IW_PRIV_TYPE_BYTE | sizeof(struct host_offload_req), |
| 10998 | 0, |
| 10999 | "setHostOffload"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11000 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11001 | {WLAN_GET_WLAN_STATISTICS, |
| 11002 | 0, |
| 11003 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 11004 | "getWlanStats"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11005 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11006 | {WLAN_SET_KEEPALIVE_PARAMS, |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 11007 | IW_PRIV_TYPE_BYTE | sizeof(struct keep_alive_req) | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11008 | IW_PRIV_SIZE_FIXED, |
| 11009 | 0, |
| 11010 | "setKeepAlive"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11011 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11012 | {WLAN_SET_PACKET_FILTER_PARAMS, |
| 11013 | IW_PRIV_TYPE_BYTE | |
| 11014 | sizeof(struct pkt_filter_cfg), |
| 11015 | 0, |
| 11016 | "setPktFilter"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11017 | #endif |
| 11018 | #ifdef FEATURE_WLAN_SCAN_PNO |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11019 | {WLAN_SET_PNO, |
| 11020 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11021 | 0, |
| 11022 | "setpno"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11023 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11024 | {WLAN_SET_BAND_CONFIG, |
| 11025 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11026 | 0, |
| 11027 | "SETBAND"}, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 11028 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11029 | {WLAN_PRIV_SET_MCBC_FILTER, |
| 11030 | 0, |
| 11031 | 0, |
| 11032 | "setMCBCFilter"}, |
| 11033 | |
| 11034 | {WLAN_GET_LINK_SPEED, |
| 11035 | IW_PRIV_TYPE_CHAR | 18, |
| 11036 | IW_PRIV_TYPE_CHAR | 5, |
| 11037 | "getLinkSpeed"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11038 | |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 11039 | #ifdef FEATURE_WLM_STATS |
| 11040 | {WLAN_GET_WLM_STATS, |
| 11041 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11042 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11043 | "get_wlm_stats"}, |
| 11044 | #endif |
| 11045 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11046 | /* handlers for main ioctl */ |
| 11047 | {WLAN_PRIV_SET_TWO_INT_GET_NONE, |
| 11048 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 11049 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11050 | ""}, |
| 11051 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11052 | {WE_SET_SMPS_PARAM, |
| 11053 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11054 | 0, "set_smps_param"}, |
| 11055 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11056 | {WLAN_SET_DOT11P_CHANNEL_SCHED, |
| 11057 | IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11058 | 0, "set_dot11p" }, |
| 11059 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 11060 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11061 | {WE_SET_FW_CRASH_INJECT, |
| 11062 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11063 | 0, "crash_inject"}, |
| 11064 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 11065 | #endif |
Rachit Kankane | b103562 | 2018-01-24 18:41:35 +0530 | [diff] [blame] | 11066 | #if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY) |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 11067 | {WE_LOG_BUFFER, |
| 11068 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11069 | 0, "log_buffer"}, |
| 11070 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11071 | #endif |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 11072 | {WE_SET_BA_AGEING_TIMEOUT, |
| 11073 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11074 | 0, "set_ba_timeout"}, |
| 11075 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11076 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 11077 | {WE_SET_WLAN_SUSPEND, |
| 11078 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11079 | 0, "wlan_suspend"}, |
| 11080 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11081 | {WE_SET_WLAN_RESUME, |
| 11082 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11083 | 0, "wlan_resume"}, |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11084 | #endif |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 11085 | {WE_ENABLE_FW_PROFILE, |
| 11086 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11087 | 0, "enableProfile"}, |
| 11088 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 11089 | {WE_SET_FW_PROFILE_HIST_INTVL, |
| 11090 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11091 | 0, "set_hist_intvl"}, |
| 11092 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11093 | {WE_SET_DUAL_MAC_FW_MODE_CONFIG, |
| 11094 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11095 | 0, "set_fw_mode_cfg"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 11096 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11097 | {WE_DUMP_DP_TRACE_LEVEL, |
| 11098 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11099 | 0, "dump_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 11100 | #endif |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 11101 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 11102 | {WE_SET_MON_MODE_CHAN, |
| 11103 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11104 | 0, "setMonChan"}, |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 11105 | #endif |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 11106 | {WE_GET_ROAM_SYNCH_DELAY, |
| 11107 | 0, |
| 11108 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11109 | "hostroamdelay"}, |
| 11110 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 11111 | {WE_SET_11AX_RATE, |
| 11112 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11113 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11114 | "set_11ax_rate"}, |
| 11115 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 11116 | {WE_SET_DCM, |
| 11117 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11118 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11119 | "enable_dcm"}, |
| 11120 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 11121 | {WE_SET_RANGE_EXT, |
| 11122 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11123 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11124 | "range_ext"}, |
| 11125 | |
Naveen Rawat | c921c7b | 2017-06-13 17:29:51 -0700 | [diff] [blame] | 11126 | {WLAN_PRIV_SET_FTIES, |
| 11127 | IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, |
| 11128 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11129 | "set_ft_ies"}, |
| 11130 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11131 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 11132 | {WE_MOTION_DET_START_STOP, |
| 11133 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11134 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11135 | "mt_start"}, |
| 11136 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11137 | {WE_MOTION_DET_BASE_LINE_START_STOP, |
| 11138 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11139 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11140 | "mt_bl_start"}, |
| 11141 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11142 | {WE_MOTION_DET_CONFIG_PARAM, |
| 11143 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 11144 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11145 | "mt_config"}, |
| 11146 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11147 | {WE_MOTION_DET_BASE_LINE_CONFIG_PARAM, |
| 11148 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 11149 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11150 | "mt_bl_config"}, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11151 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11152 | }; |
| 11153 | |
| 11154 | const struct iw_handler_def we_handler_def = { |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 11155 | .num_standard = 0, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 11156 | .num_private = QDF_ARRAY_SIZE(we_private), |
| 11157 | .num_private_args = QDF_ARRAY_SIZE(we_private_args), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11158 | |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 11159 | .standard = NULL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11160 | .private = (iw_handler *) we_private, |
| 11161 | .private_args = we_private_args, |
| 11162 | .get_wireless_stats = NULL, |
| 11163 | }; |
| 11164 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11165 | void hdd_register_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11166 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11167 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11168 | |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 11169 | dev->wireless_handlers = &we_handler_def; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11170 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 11171 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11172 | } |
| 11173 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11174 | void hdd_unregister_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11175 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11176 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11177 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11178 | rtnl_lock(); |
| 11179 | dev->wireless_handlers = NULL; |
| 11180 | rtnl_unlock(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11181 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11182 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11183 | } |