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 | 6fb7a75 | 2018-11-30 11:33:57 -0800 | [diff] [blame] | 70 | #include "qdf_hashtable_test.h" |
Dustin Brown | 9c49a33 | 2019-03-05 11:27:38 -0800 | [diff] [blame^] | 71 | #include "qdf_periodic_work_test.h" |
Dustin Brown | d315c45 | 2018-11-27 11:28:48 -0800 | [diff] [blame] | 72 | #include "qdf_talloc_test.h" |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 73 | #include "qdf_str.h" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 74 | #include "qdf_trace.h" |
Dustin Brown | ebb16d1 | 2018-11-29 17:52:07 -0800 | [diff] [blame] | 75 | #include "qdf_types_test.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 76 | #include "wlan_hdd_assoc.h" |
| 77 | #include "wlan_hdd_ioctl.h" |
| 78 | #include "wlan_hdd_scan.h" |
| 79 | #include "sme_power_save_api.h" |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 80 | #include "wlan_policy_mgr_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | #include "wlan_hdd_conc_ut.h" |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 82 | #include "wlan_hdd_fips.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 83 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | #include "wlan_hdd_ocb.h" |
| 85 | #include "wlan_hdd_napi.h" |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 86 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 87 | #include "wlan_hdd_nan_datapath.h" |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 88 | #include "wlan_hdd_stats.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 89 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 90 | #include "wlan_hdd_driver_ops.h" |
| 91 | #include "hif.h" |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 92 | #include "pld_common.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 93 | #endif |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 94 | #include "wlan_hdd_lro.h" |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 95 | #include "cds_utils.h" |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 96 | #include "wlan_osif_request_manager.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 97 | #include "os_if_wifi_pos.h" |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 98 | #include <cdp_txrx_stats.h> |
| 99 | #include <cds_api.h> |
Dustin Brown | 6099ddc | 2018-07-06 14:32:53 -0700 | [diff] [blame] | 100 | #include "wlan_dsc_test.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 101 | #include <wlan_osif_priv.h> |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 102 | #include "wlan_hdd_regulatory.h" |
| 103 | #include "wlan_reg_ucfg_api.h" |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 104 | #include "wlan_hdd_packet_filter_api.h" |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 105 | #include "wlan_cp_stats_mc_ucfg_api.h" |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 106 | #include "wlan_mlme_ucfg_api.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 107 | #include "cfg_mlme_sta.h" |
Arif Hussain | 43e0971 | 2018-09-18 19:31:57 -0700 | [diff] [blame] | 108 | #include "wlan_mlme_public_struct.h" |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 109 | #include "cfg_ucfg_api.h" |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 110 | #include "wlan_policy_mgr_ucfg.h" |
Harprit Chhabada | bec6de4 | 2018-09-10 10:21:15 -0700 | [diff] [blame] | 111 | #include "wlan_mlme_public_struct.h" |
| 112 | #include "cfg_ucfg_api.h" |
| 113 | #include "cfg_mlme_threshold.h" |
Wu Gao | 66454f1 | 2018-09-26 19:55:41 +0800 | [diff] [blame] | 114 | #include "wlan_pmo_cfg.h" |
| 115 | #include "wlan_pmo_ucfg_api.h" |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 116 | #include "dp_txrx.h" |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 117 | #include "wlan_fwol_ucfg_api.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 118 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 119 | /* Private ioctls and their sub-ioctls */ |
| 120 | #define WLAN_PRIV_SET_INT_GET_NONE (SIOCIWFIRSTPRIV + 0) |
| 121 | #define WE_SET_11D_STATE 1 |
| 122 | #define WE_WOWL 2 |
| 123 | #define WE_SET_POWER 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 124 | /* |
| 125 | * <ioctl> |
| 126 | * setMaxAssoc - Sets the maximum number of associated stations |
| 127 | * |
| 128 | * @INPUT: 1 to 32 |
| 129 | * |
| 130 | * @OUTPUT: None |
| 131 | * |
| 132 | * This IOTCL sets the maximum number of associated stations |
| 133 | * |
| 134 | * @E.g: iwpriv wlan0 setMaxAssoc <value> |
| 135 | * |
| 136 | * Supported Feature: STA |
| 137 | * |
| 138 | * Usage: Internal/External |
| 139 | * |
| 140 | * </ioctl> |
| 141 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 142 | #define WE_SET_MAX_ASSOC 4 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 143 | /* |
| 144 | * <ioctl> |
Jeff Johnson | f2cf659 | 2018-05-06 16:27:44 -0700 | [diff] [blame] | 145 | * scan_disable - Disable scan |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 146 | * |
| 147 | * @INPUT: set_value |
| 148 | * |
| 149 | * @OUTPUT: None |
| 150 | * |
| 151 | * This IOCTL is used to set disable scan |
| 152 | * |
| 153 | * @E.g: iwpriv wlan0 scan_disable 1 |
| 154 | * |
| 155 | * Supported Feature: Scan |
| 156 | * |
| 157 | * Usage: Internal/External |
| 158 | * |
| 159 | * </ioctl> |
| 160 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 161 | #define WE_SET_SCAN_DISABLE 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 162 | /* |
| 163 | * <ioctl> |
| 164 | * inactivityTO - sets the timeout value for inactivity data while |
| 165 | * in power save mode |
| 166 | * |
| 167 | * @INPUT: int1…..int255 |
| 168 | * |
| 169 | * @OUTPUT: None |
| 170 | * |
| 171 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 172 | * |
| 173 | * @E.g: iwpriv wlan0 inactivityTO 20 |
| 174 | * |
| 175 | * Supported Feature: STA |
| 176 | * |
| 177 | * Usage: Internal/External |
| 178 | * |
| 179 | * </ioctl> |
| 180 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 181 | #define WE_SET_DATA_INACTIVITY_TO 6 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 182 | /* |
| 183 | * <ioctl> |
| 184 | * setMaxTxPower - Dynamically sets the maximum transmission power |
| 185 | * |
| 186 | * @INPUT: Transmission power in dBm |
| 187 | * |
| 188 | * @OUTPUT: None |
| 189 | * |
| 190 | * This IOCTL dynamically sets the maximum transmission power |
| 191 | * This setting does not persist over reboots |
| 192 | * |
| 193 | * @E.g: iwpriv wlan0 setMaxTxPower <value in db) |
| 194 | * |
| 195 | * Supported Feature: STA |
| 196 | * |
| 197 | * Usage: Internal/External |
| 198 | * |
| 199 | * </ioctl> |
| 200 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 201 | #define WE_SET_MAX_TX_POWER 7 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 202 | |
| 203 | #ifdef HASTINGS_BT_WAR |
| 204 | /* Temporary WAR for Hastings 1.1 only */ |
| 205 | #define WE_SET_HASTINGS_BT_WAR 8 |
| 206 | #endif |
| 207 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | #define WE_SET_TM_LEVEL 9 |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 209 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 210 | /* |
| 211 | * <ioctl> |
| 212 | * setphymode - Set the phymode dynamically |
| 213 | * |
| 214 | * @INPUT: 0 IEEE80211_MODE_AUTO to 22 IEEE80211_MODE_11AGN |
| 215 | * |
| 216 | * @OUTPUT: None |
| 217 | * |
| 218 | * This IOCTL sets the phymode dynamically |
| 219 | * |
| 220 | * @E.g: iwpriv wlan0 setphymode 10 |
| 221 | * |
| 222 | * Supported Feature: STA |
| 223 | * |
| 224 | * Usage: Internal/External |
| 225 | * |
| 226 | * </ioctl> |
| 227 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 228 | #define WE_SET_PHYMODE 10 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 229 | /* |
| 230 | * <ioctl> |
| 231 | * nss - Set the number of spatial streams |
| 232 | * |
| 233 | * @INPUT: int1…..int3 |
| 234 | * |
| 235 | * @OUTPUT: None |
| 236 | * |
| 237 | * This IOCTL sets the number of spatial streams. Supported values are 1 and 2 |
| 238 | * |
| 239 | * @E.g: iwpriv wlan0 nss 2 |
| 240 | * |
| 241 | * Supported Feature: STA |
| 242 | * |
| 243 | * Usage: Internal/External |
| 244 | * |
| 245 | * </ioctl> |
| 246 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 247 | #define WE_SET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 248 | /* |
| 249 | * <ioctl> |
| 250 | * ldpc - Enables or disables LDPC |
| 251 | * |
| 252 | * @INPUT: 0 – Disable, 1 - Enable |
| 253 | * |
| 254 | * @OUTPUT: None |
| 255 | * |
| 256 | * This IOCTL enables or disables LDPC |
| 257 | * |
| 258 | * @E.g: iwpriv wlan0 ldpc 1 |
| 259 | * |
| 260 | * Supported Feature: STA |
| 261 | * |
| 262 | * Usage: Internal/External |
| 263 | * |
| 264 | * </ioctl> |
| 265 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 266 | #define WE_SET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 267 | /* |
| 268 | * <ioctl> |
| 269 | * tx_stbc - Enables or disables tx_stbc |
| 270 | * |
| 271 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 272 | * |
| 273 | * @OUTPUT: None |
| 274 | * |
| 275 | * This IOTCL used to enables or disables tx_stbc |
| 276 | * |
| 277 | * @E.g: iwpriv wlan0 tx_stbc <value> |
| 278 | * |
| 279 | * Supported Feature: STA |
| 280 | * |
| 281 | * Usage: Internal/External |
| 282 | * |
| 283 | * </ioctl> |
| 284 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 285 | #define WE_SET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 286 | /* |
| 287 | * <ioctl> |
| 288 | * rx_stbc - Set the rx_stbc parameter |
| 289 | * |
| 290 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 291 | * |
| 292 | * @OUTPUT: None |
| 293 | * |
| 294 | * This IOTCL used to set rx_stbc parameter |
| 295 | * |
| 296 | * @E.g: iwpriv wlan0 rx_stbc <value> |
| 297 | * |
| 298 | * Supported Feature: STA |
| 299 | * |
| 300 | * Usage: Internal/External |
| 301 | * |
| 302 | * </ioctl> |
| 303 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 304 | #define WE_SET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 305 | /* |
| 306 | * <ioctl> |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 307 | * shortgi - Sets the short-guard interval |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 308 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 309 | * @INPUT: Fixed Rate: 0 - 400ns, 1 - 800ns, 2 - 1600ns, 3 - 3200us |
| 310 | * Auto Rate: 8 - 400ns, 9 - 800ns, 10 - 1600ns, 11 - 3200us |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 311 | * |
| 312 | * @OUTPUT: None |
| 313 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 314 | * This IOCTL sets the short-guard interval. |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 315 | * |
| 316 | * @E.g: iwpriv wlan0 shortgi <value> |
| 317 | * |
| 318 | * Supported Feature: STA |
| 319 | * |
| 320 | * Usage: Internal/External |
| 321 | * |
| 322 | * </ioctl> |
| 323 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 324 | #define WE_SET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 325 | /* |
| 326 | * <ioctl> |
| 327 | * enablertscts - enables or disables rts/cts. |
| 328 | * |
| 329 | * @INPUT: 1-Enable , 0-Disable |
| 330 | * |
| 331 | * @OUTPUT: None |
| 332 | * |
| 333 | * This IOCTL enables or disables rts/cts. |
| 334 | * |
| 335 | * @E.g: iwpriv wlan0 enablertscts <value> |
| 336 | * |
| 337 | * Supported Feature: STA |
| 338 | * |
| 339 | * Usage: Internal/External |
| 340 | * |
| 341 | * </ioctl> |
| 342 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 343 | #define WE_SET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 344 | /* |
| 345 | * <ioctl> |
| 346 | * chwidth - Set the channel bandwidth |
| 347 | * |
| 348 | * @INPUT: 0-20mhz to 3-160mhz |
| 349 | * |
| 350 | * @OUTPUT: None |
| 351 | * |
| 352 | * This IOTCL used to set the channel bandwidth |
| 353 | * |
| 354 | * @E.g: iwpriv wlan0 chwidth 1 |
| 355 | * |
| 356 | * Supported Feature: STA |
| 357 | * |
| 358 | * Usage: Internal/External |
| 359 | * |
| 360 | * </ioctl> |
| 361 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 362 | #define WE_SET_CHWIDTH 17 |
| 363 | #define WE_SET_ANI_EN_DIS 18 |
| 364 | #define WE_SET_ANI_POLL_PERIOD 19 |
| 365 | #define WE_SET_ANI_LISTEN_PERIOD 20 |
| 366 | #define WE_SET_ANI_OFDM_LEVEL 21 |
| 367 | #define WE_SET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 368 | /* |
| 369 | * <ioctl> |
| 370 | * cwmenable - Enables or disables the dynamic channel bandwidth |
| 371 | * |
| 372 | * @INPUT: 0-Disable, 1-Enable |
| 373 | * |
| 374 | * @OUTPUT: None |
| 375 | * |
| 376 | * This IOTCL used to enables or disables the dynamic channel bandwidth |
| 377 | * |
| 378 | * @E.g: iwpriv wlan0 cwmenable <value> |
| 379 | * |
| 380 | * Supported Feature: STA |
| 381 | * |
| 382 | * Usage: Internal/External |
| 383 | * |
| 384 | * </ioctl> |
| 385 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 386 | #define WE_SET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 387 | /* |
| 388 | * <ioctl> |
| 389 | * txchainmask - This IOCTL sets the current Tx chain mask |
| 390 | * |
| 391 | * @INPUT: Mask Value |
| 392 | * |
| 393 | * @OUTPUT: None |
| 394 | * |
| 395 | * This IOCTL sets the current Tx chain mask |
| 396 | * |
| 397 | * @E.g: iwpriv wlan0 txchainmask 1 |
| 398 | * |
| 399 | * Supported Feature: STA |
| 400 | * |
| 401 | * Usage: Internal/External |
| 402 | * |
| 403 | * </ioctl> |
| 404 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 405 | #define WE_SET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 406 | /* |
| 407 | * <ioctl> |
| 408 | * rxchainmask - Sets the current Rx chain mask |
| 409 | * |
| 410 | * @INPUT: Mask Value |
| 411 | * |
| 412 | * @OUTPUT: None |
| 413 | * |
| 414 | * This IOCTL sets the current Rx chain mask. This command is the |
| 415 | * equivalent to setting in gSetRxChainmask1x1 in WCNSS_qcom_cfg.ini. |
| 416 | * |
| 417 | * @E.g: iwpriv wlan0 rxchainmask <value> |
| 418 | * |
| 419 | * Supported Feature: STA |
| 420 | * |
| 421 | * Usage: Internal/External |
| 422 | * |
| 423 | * </ioctl> |
| 424 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 425 | #define WE_SET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 426 | /* |
| 427 | * <ioctl> |
| 428 | * set11NRates - Fixes the Tx data rate of the 11N mode. |
| 429 | * |
| 430 | * @INPUT: 0x1b to 0x8f |
| 431 | * |
| 432 | * @OUTPUT: None |
| 433 | * |
| 434 | * This IOCTL fixes the Tx data rate of the 11N mode. |
| 435 | * |
| 436 | * @E.g: iwpriv wlan0 set11NRates 0x85 |
| 437 | * |
| 438 | * Supported Feature: STA |
| 439 | * |
| 440 | * Usage: Internal/External |
| 441 | * |
| 442 | * </ioctl> |
| 443 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 444 | #define WE_SET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 445 | /* |
| 446 | * <ioctl> |
| 447 | * ampdu - Set the the maximum subframe of ampdu |
| 448 | * |
| 449 | * @INPUT: int 1 to int 63 |
| 450 | * |
| 451 | * @OUTPUT: None |
| 452 | * |
| 453 | * This IOCTL sets the maximum subframe of ampdu. |
| 454 | * |
| 455 | * @E.g: iwpriv wlan0 ampdu 9 |
| 456 | * |
| 457 | * Supported Feature: STA |
| 458 | * |
| 459 | * Usage: Internal/External |
| 460 | * |
| 461 | * </ioctl> |
| 462 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 463 | #define WE_SET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 464 | /* |
| 465 | * <ioctl> |
| 466 | * amsdu - Sets the maximum subframe of amsdu. |
| 467 | * |
| 468 | * @INPUT: int 1 to int 31 |
| 469 | * |
| 470 | * @OUTPUT: None |
| 471 | * |
| 472 | * This IOCTL sets the maximum subframe of amsdu. |
| 473 | * |
| 474 | * @E.g: iwpriv wlan0 amsdu 9 |
| 475 | * |
| 476 | * Supported Feature: STA |
| 477 | * |
| 478 | * Usage: Internal/External |
| 479 | * |
| 480 | * </ioctl> |
| 481 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 482 | #define WE_SET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 483 | /* |
| 484 | * <ioctl> |
| 485 | * txpow2g - current 2 GHz Tx power setting |
| 486 | * |
| 487 | * @INPUT: Tx power in dBm |
| 488 | * |
| 489 | * @OUTPUT: None |
| 490 | * |
| 491 | * This IOTCL used to set 2 ghz tx power |
| 492 | * |
| 493 | * @E.g: iwpriv wlan0 txpow2g |
| 494 | * |
| 495 | * Supported Feature: STA |
| 496 | * |
| 497 | * Usage: Internal/External |
| 498 | * |
| 499 | * </ioctl> |
| 500 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 501 | #define WE_SET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 502 | /* |
| 503 | * <ioctl> |
| 504 | * txpow5g - Current 5 GHz tx power setting |
| 505 | * |
| 506 | * @INPUT: Tx power in dBm |
| 507 | * |
| 508 | * @OUTPUT: None |
| 509 | * |
| 510 | * This IOTCL used to set the 5 ghz txpower |
| 511 | * |
| 512 | * @E.g: iwpriv wlan0 txpow5g |
| 513 | * |
| 514 | * Supported Feature: STA |
| 515 | * |
| 516 | * Usage: Internal/External |
| 517 | * |
| 518 | * </ioctl> |
| 519 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 520 | #define WE_SET_TXPOW_5G 30 |
| 521 | /* Private ioctl for firmware debug log */ |
| 522 | #define WE_DBGLOG_LOG_LEVEL 31 |
| 523 | #define WE_DBGLOG_VAP_ENABLE 32 |
| 524 | #define WE_DBGLOG_VAP_DISABLE 33 |
| 525 | #define WE_DBGLOG_MODULE_ENABLE 34 |
| 526 | #define WE_DBGLOG_MODULE_DISABLE 35 |
| 527 | #define WE_DBGLOG_MOD_LOG_LEVEL 36 |
| 528 | #define WE_DBGLOG_TYPE 37 |
| 529 | #define WE_SET_TXRX_FWSTATS 38 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 530 | /* |
| 531 | * <ioctl> |
| 532 | * set11ACRates - Fixes the Tx data rate of 11AC |
| 533 | * |
| 534 | * @INPUT: 0x1 to 0x9 |
| 535 | * |
| 536 | * @OUTPUT: None |
| 537 | * |
| 538 | * This IOCTL fixes the Tx data rate of 11AC. |
| 539 | * |
| 540 | * @E.g: iwpriv wlan0 set11ACRates 0x9 |
| 541 | * |
| 542 | * Supported Feature: STA |
| 543 | * |
| 544 | * Usage: Internal/External |
| 545 | * |
| 546 | * </ioctl> |
| 547 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 548 | #define WE_SET_VHT_RATE 39 |
| 549 | #define WE_DBGLOG_REPORT_ENABLE 40 |
| 550 | #define WE_TXRX_FWSTATS_RESET 41 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 551 | /* |
| 552 | * <ioctl> |
| 553 | * setTxMaxPower2G - Set the maximum transmit power for the 2.4-GHz band |
| 554 | * |
| 555 | * @INPUT: Transmission power in dBm |
| 556 | * |
| 557 | * @OUTPUT: None |
| 558 | * |
| 559 | * This IOCTL sets the maximum transmit power for the 2.4-GHz band |
| 560 | * This setting does not persist over reboots |
| 561 | * |
| 562 | * @E.g: iwpriv wlan0 setTxMaxPower2G 10 |
| 563 | * |
| 564 | * Supported Feature: STA |
| 565 | * |
| 566 | * Usage: Internal/External |
| 567 | * |
| 568 | * </ioctl> |
| 569 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 570 | #define WE_SET_MAX_TX_POWER_2_4 42 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 571 | /* |
| 572 | * <ioctl> |
| 573 | * setTxMaxPower5G - Set the maximum transmit power for the 5-GHz band |
| 574 | * |
| 575 | * @INPUT: Transmission power in dBm |
| 576 | * |
| 577 | * @OUTPUT: None |
| 578 | * |
| 579 | * This IOCTL sets the maximum transmit power for the 5-GHz band |
| 580 | * This setting does not persist over reboots |
| 581 | * |
| 582 | * @E.g: iwpriv wlan0 setTxMaxPower5G 10 |
| 583 | * |
| 584 | * Supported Feature: STA |
| 585 | * |
| 586 | * Usage: Internal/External |
| 587 | * |
| 588 | * </ioctl> |
| 589 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 590 | #define WE_SET_MAX_TX_POWER_5_0 43 |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 591 | #define WE_SET_PKTLOG 44 |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 592 | /* Private ioctl for packet power save */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 593 | #define WE_PPS_PAID_MATCH 45 |
| 594 | #define WE_PPS_GID_MATCH 46 |
| 595 | #define WE_PPS_EARLY_TIM_CLEAR 47 |
| 596 | #define WE_PPS_EARLY_DTIM_CLEAR 48 |
| 597 | #define WE_PPS_EOF_PAD_DELIM 49 |
| 598 | #define WE_PPS_MACADDR_MISMATCH 50 |
| 599 | #define WE_PPS_DELIM_CRC_FAIL 51 |
| 600 | #define WE_PPS_GID_NSTS_ZERO 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 601 | /* |
| 602 | * <ioctl> |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 603 | * rssi_chk - Check the rssi |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 604 | * |
| 605 | * @INPUT: One argument as input |
| 606 | * |
| 607 | * @OUTPUT: rssi |
| 608 | * wlan0 rssi_chk:56 |
| 609 | * |
| 610 | * This IOTCL used to chek rssi |
| 611 | * |
| 612 | * @E.g: iwpriv wlan0 rssi_chk <value> |
| 613 | * |
| 614 | * Supported Feature: STA |
| 615 | * |
| 616 | * Usage: Internal/External |
| 617 | * |
| 618 | * </ioctl> |
| 619 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 620 | #define WE_PPS_RSSI_CHECK 53 |
Agrawal Ashish | bafaff1 | 2016-12-27 17:43:08 +0530 | [diff] [blame] | 621 | /* |
| 622 | * <ioctl> |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 623 | * htsmps - Sets the htsmps |
| 624 | * |
| 625 | * @INPUT: Atleast one int argument |
| 626 | * |
| 627 | * @OUTPUT: None |
| 628 | * |
| 629 | * This IOTCL used to set htsmps |
| 630 | * |
| 631 | * @E.g: iwpriv wlan0 htsmps <value> |
| 632 | * |
| 633 | * Supported Feature: STA |
| 634 | * |
| 635 | * Usage: Internal/External |
| 636 | * |
| 637 | * </ioctl> |
| 638 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 639 | #define WE_SET_HTSMPS 55 |
| 640 | /* Private ioctl for QPower */ |
| 641 | #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 |
| 642 | #define WE_SET_QPOWER_MAX_TX_BEFORE_WAKE 57 |
| 643 | #define WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 58 |
| 644 | #define WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 645 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 646 | /* |
| 647 | * <ioctl> |
| 648 | * gtxHTMcs - Set the tx HTM value |
| 649 | * |
| 650 | * @INPUT: Atleast one int orgument |
| 651 | * |
| 652 | * @OUTPUT: None |
| 653 | * |
| 654 | * This IOTCL sets htm tx value |
| 655 | * |
| 656 | * @E.g: iwpriv wlan0 gtxHTMcs <value> |
| 657 | * |
| 658 | * Supported Feature: STA |
| 659 | * |
| 660 | * Usage: Internal/External |
| 661 | * |
| 662 | * </ioctl> |
| 663 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 664 | #define WE_SET_GTX_HT_MCS 62 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 665 | /* |
| 666 | * <ioctl> |
| 667 | * gtxVHTMcs - Set gtxVHTMcs value |
| 668 | * |
| 669 | * @INPUT: Atleast one int argument |
| 670 | * |
| 671 | * @OUTPUT: None |
| 672 | * |
| 673 | * This IOTCL used to set gtxVHTMcs value |
| 674 | * |
| 675 | * @E.g: iwpriv wlan0 gtxVHTMcs <value> |
| 676 | * |
| 677 | * Supported Feature: STA |
| 678 | * |
| 679 | * Usage: Internal/External |
| 680 | * |
| 681 | * </ioctl> |
| 682 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 683 | #define WE_SET_GTX_VHT_MCS 63 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 684 | /* |
| 685 | * <ioctl> |
| 686 | * gtxUsrCfg - Host request for GTX mask |
| 687 | * |
| 688 | * @INPUT: Atleast one int orgument |
| 689 | * |
| 690 | * @OUTPUT: None |
| 691 | * |
| 692 | * This IOTCL used send the host request for GTX mask |
| 693 | * |
| 694 | * @E.g: iwpriv wlan0 gtxUsrCfg <value> |
| 695 | * |
| 696 | * Supported Feature: STA |
| 697 | * |
| 698 | * Usage: Internal/External |
| 699 | * |
| 700 | * </ioctl> |
| 701 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 702 | #define WE_SET_GTX_USRCFG 64 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 703 | /* |
| 704 | * <ioctl> |
| 705 | * gtxThre - Set the tx threshold |
| 706 | * |
| 707 | * @INPUT: Atleast one int argument |
| 708 | * |
| 709 | * @OUTPUT: None |
| 710 | * |
| 711 | * This IOTCL used to set tx threshold |
| 712 | * |
| 713 | * @E.g: iwpriv wlan0 gtxThre <value> |
| 714 | * |
| 715 | * Supported Feature: STA |
| 716 | * |
| 717 | * Usage: Internal/External |
| 718 | * |
| 719 | * </ioctl> |
| 720 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 721 | #define WE_SET_GTX_THRE 65 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 722 | /* |
| 723 | * <ioctl> |
| 724 | * gtxMargin - Set the gtxMargin |
| 725 | * |
| 726 | * @INPUT: 1 to 32 |
| 727 | * |
| 728 | * @OUTPUT: None |
| 729 | * |
| 730 | * This IOTCL use dto set gtxMargin |
| 731 | * |
| 732 | * @E.g: iwpriv wlan0 gtxMargini <value> |
| 733 | * |
| 734 | * Supported Feature: STA |
| 735 | * |
| 736 | * Usage: Internal/External |
| 737 | * |
| 738 | * </ioctl> |
| 739 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 740 | #define WE_SET_GTX_MARGIN 66 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 741 | /* |
| 742 | * <ioctl> |
| 743 | * gtxStep - Set the gtxStep |
| 744 | * |
| 745 | * @INPUT: None |
| 746 | * |
| 747 | * @OUTPUT: None |
| 748 | * |
| 749 | * This IOTCL used to sets gtxStep |
| 750 | * |
| 751 | * @E.g: iwpriv wlan0 gtxStep <value> |
| 752 | * |
| 753 | * Supported Feature: STA |
| 754 | * |
| 755 | * Usage: Internal/External |
| 756 | * |
| 757 | * </ioctl> |
| 758 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 759 | #define WE_SET_GTX_STEP 67 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 760 | /* |
| 761 | * <ioctl> |
| 762 | * gtxMinTpc - Sets the gtxMinTpc |
| 763 | * |
| 764 | * @INPUT: Atleast one int argument |
| 765 | * |
| 766 | * @OUTPUT: None |
| 767 | * |
| 768 | * This IOTCL sets the tx MinTpc |
| 769 | * |
| 770 | * @E.g: iwpriv wlan0 gtxMinTpc <value> |
| 771 | * |
| 772 | * Supported Feature: STA |
| 773 | * |
| 774 | * Usage: Internal/External |
| 775 | * |
| 776 | * </ioctl> |
| 777 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 778 | #define WE_SET_GTX_MINTPC 68 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 779 | /* |
| 780 | * <ioctl> |
| 781 | * gtxBWMask - Sets the BW mask (20/40/80/160 Mhz) |
| 782 | * |
| 783 | * @INPUT: Mask value |
| 784 | * |
| 785 | * @OUTPUT: None |
| 786 | * |
| 787 | * This IOTCL used to set gtxBWMask |
| 788 | * |
| 789 | * @E.g: iwpriv wlan0 gtxBWMask <value> |
| 790 | * |
| 791 | * Supported Feature: STA |
| 792 | * |
| 793 | * Usage: Internal/External |
| 794 | * |
| 795 | * </ioctl> |
| 796 | */ |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 797 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 798 | #define WE_SET_GTX_BWMASK 69 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 799 | /* |
| 800 | * <ioctl> |
| 801 | * setMccLatency - Sets the MCC latency value during STA-P2P concurrency |
| 802 | * |
| 803 | * @INPUT: set_value |
| 804 | * |
| 805 | * @OUTPUT: None |
| 806 | * |
| 807 | * This IOCTL is used to set the MCC latency value in milliseconds |
| 808 | * during STA-P2P concurrency. |
| 809 | * |
| 810 | * If 0ms latency is provided, then FW will set to a default. |
| 811 | * Otherwise, latency must be at least 30ms. |
| 812 | * |
| 813 | * @E.g: iwpriv wlan0 setMccLatency 40 |
| 814 | * |
| 815 | * |
| 816 | * Supported Feature: Concurrency |
| 817 | * |
| 818 | * Usage: Internal/External |
| 819 | * |
| 820 | * </ioctl> |
| 821 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 822 | #define WE_MCC_CONFIG_LATENCY 70 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 823 | |
| 824 | /* |
| 825 | * <ioctl> |
| 826 | * setMccQuota- Set the quota for P2P cases |
| 827 | * |
| 828 | * @INPUT: set_value [0,100] |
| 829 | * |
| 830 | * @OUTPUT: None |
| 831 | * |
| 832 | * This IOCTL is used to set the quota in milliseconds for P2P_GO/STA. |
| 833 | * |
| 834 | * Currently used to set time quota for 2 MCC vdevs/adapters using |
| 835 | * (operating channel, quota) for each mode. |
| 836 | * The info is provided run time using iwpriv command: |
| 837 | * iwpriv <wlan0 | p2p0> setMccQuota <quota in ms>. |
| 838 | * Note: the quota provided in command is for the same mode in cmd. |
| 839 | * HDD checks if MCC mode is active, gets the second mode and its |
| 840 | * operating chan. |
| 841 | * Quota for the 2nd role is calculated as 100 - quota of first mode. |
| 842 | * |
| 843 | * @E.g: iwpriv wlan0 setMccQuota 50 |
| 844 | * iwpriv p2p0 setMccQuota 50 |
| 845 | * |
| 846 | * Supported Feature: Concurrency |
| 847 | * |
| 848 | * Usage: Internal/External |
| 849 | * |
| 850 | * </ioctl> |
| 851 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 852 | #define WE_MCC_CONFIG_QUOTA 71 |
| 853 | /* Private IOCTL for debug connection issues */ |
| 854 | #define WE_SET_DEBUG_LOG 72 |
| 855 | #ifdef WE_SET_TX_POWER |
| 856 | #undef WE_SET_TX_POWER |
| 857 | #endif |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 858 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 859 | /* |
| 860 | * <ioctl> |
| 861 | * setTxPower - Set the current transmit power |
| 862 | * |
| 863 | * @INPUT: Transmission power in dBm |
| 864 | * |
| 865 | * @OUTPUT: None |
| 866 | * |
| 867 | * This IOCTL sets the current transmit power. |
| 868 | * This setting does not persist over reboots. |
| 869 | * |
| 870 | * @E.g: iwpriv wlan0 setTxPower 10 |
| 871 | * |
| 872 | * Supported Feature: STA |
| 873 | * |
| 874 | * Usage: Internal/External |
| 875 | * |
| 876 | * </ioctl> |
| 877 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 878 | #define WE_SET_TX_POWER 74 |
| 879 | /* Private ioctl for earlyrx power save feature */ |
| 880 | #define WE_SET_EARLY_RX_ADJUST_ENABLE 75 |
| 881 | #define WE_SET_EARLY_RX_TGT_BMISS_NUM 76 |
| 882 | #define WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE 77 |
| 883 | #define WE_SET_EARLY_RX_SLOP_STEP 78 |
| 884 | #define WE_SET_EARLY_RX_INIT_SLOP 79 |
| 885 | #define WE_SET_EARLY_RX_ADJUST_PAUSE 80 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 886 | /* |
| 887 | * <ioctl> |
| 888 | * setMcRate - Set the data rate for multicast data |
| 889 | * |
| 890 | * @INPUT: 1 to 32 |
| 891 | * |
| 892 | * @OUTPUT: None |
| 893 | * |
| 894 | * This IOCTL sets the data rate for multicast data. Note that this command |
| 895 | * is allowed only in STA, IBSS, or QCMobileAP mode |
| 896 | * |
| 897 | * @E.g: iwpriv wlan0 setMcRate <value> |
| 898 | * |
| 899 | * Supported Feature: STA |
| 900 | * |
| 901 | * Usage: Internal/External |
| 902 | * |
| 903 | * </ioctl> |
| 904 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 905 | #define WE_SET_MC_RATE 81 |
| 906 | #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 |
| 907 | /* Private ioctl for packet power save */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 908 | /* |
| 909 | * <ioctl> |
| 910 | * 5g_ebt - Sets the 5g_ebt |
| 911 | * |
| 912 | * @INPUT: <value> |
| 913 | * |
| 914 | * @OUTPUT: None |
| 915 | * |
| 916 | * This IOTCL used to set 5g_ebt |
| 917 | * |
| 918 | * @E.g: iwpriv wlan0 5g_ebt <value> |
| 919 | * |
| 920 | * Supported Feature: STA |
| 921 | * |
| 922 | * Usage: Internal/External |
| 923 | * |
| 924 | * </ioctl> |
| 925 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 926 | #define WE_PPS_5G_EBT 83 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 927 | /* |
| 928 | * <ioctl> |
| 929 | * cts_cbw - Set CTS channel BW for dynamic BW adjustment |
| 930 | * |
| 931 | * @INPUT: 20 t0 160 |
| 932 | * |
| 933 | * @OUTPUT: None |
| 934 | * |
| 935 | * This IOTCL used to set CTS channel BW for dynamic BW adjustment |
| 936 | * |
| 937 | * @E.g: iwpriv wlan0 cts_cbw <value> |
| 938 | * |
| 939 | * Supported Feature: STA |
| 940 | * |
| 941 | * Usage: Internal/External |
| 942 | * |
| 943 | * </ioctl> |
| 944 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 945 | #define WE_SET_CTS_CBW 84 |
| 946 | #define WE_DUMP_STATS 85 |
| 947 | #define WE_CLEAR_STATS 86 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 948 | /* Private sub ioctl for starting/stopping the profiling */ |
| 949 | #define WE_START_FW_PROFILE 87 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 950 | |
Abhishek Singh | 3c50701 | 2016-12-01 11:15:42 +0530 | [diff] [blame] | 951 | /* |
| 952 | * <ioctl> |
| 953 | * setChanChange - Initiate channel change |
| 954 | * |
| 955 | * @INPUT: channel number to switch to. |
| 956 | * |
| 957 | * @OUTPUT: None |
| 958 | * |
| 959 | * This IOCTL is used to initiate a channel change. |
| 960 | * If called on STA/CLI interface it will send the |
| 961 | * ECSA action frame to the connected SAP/GO asking to |
| 962 | * initiate the ECSA, if supported. |
| 963 | * If called on SAP/GO interface it will initiate |
| 964 | * ECSA and ask connected peers to move to new channel. |
| 965 | * |
| 966 | * @E.g: iwpriv wlan0 setChanChange <channel> |
| 967 | * iwpriv wlan0 setChanChange 1 |
| 968 | * |
| 969 | * Supported Feature: ECSA |
| 970 | * |
| 971 | * Usage: Internal/External |
| 972 | * |
| 973 | * </ioctl> |
| 974 | */ |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 975 | #define WE_SET_CHANNEL 88 |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 976 | #define WE_SET_CONC_SYSTEM_PREF 89 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 977 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 978 | /* |
| 979 | * <ioctl> |
| 980 | * set_11ax_rate - set 11ax rates to FW |
| 981 | * |
| 982 | * @INPUT: rate code |
| 983 | * |
| 984 | * @OUTPUT: None |
| 985 | * |
| 986 | * This IOCTL fixes the Tx data rate of 11AX. |
| 987 | * |
| 988 | * @E.g: iwpriv wlan0 set_11ax_rate <rate code> |
| 989 | * |
| 990 | * Supported Feature: STA/SAP |
| 991 | * |
| 992 | * Usage: Internal |
| 993 | * |
| 994 | * </ioctl> |
| 995 | */ |
| 996 | #define WE_SET_11AX_RATE 91 |
| 997 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 998 | /* |
| 999 | * <ioctl> |
| 1000 | * enable_dcm - enable Dual Carrier Modulation(DCM) |
| 1001 | * |
| 1002 | * @INPUT: 0/1 |
| 1003 | * |
| 1004 | * @OUTPUT: None |
| 1005 | * |
| 1006 | * This IOCTL enables/disables DCM. |
| 1007 | * |
| 1008 | * @E.g: iwpriv wlan0 enable_dcm <0/1> |
| 1009 | * |
| 1010 | * Supported Feature: STA/SAP |
| 1011 | * |
| 1012 | * Usage: Internal |
| 1013 | * |
| 1014 | * </ioctl> |
| 1015 | */ |
| 1016 | #define WE_SET_DCM 92 |
| 1017 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1018 | /* |
| 1019 | * <ioctl> |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1020 | * range_ext - enable Range extension |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1021 | * |
| 1022 | * @INPUT: 0/1 |
| 1023 | * |
| 1024 | * @OUTPUT: None |
| 1025 | * |
| 1026 | * This IOCTL enables/disables Range extension. |
| 1027 | * |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1028 | * @E.g: iwpriv wlan0 range_ext <1/0> |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1029 | * |
| 1030 | * Supported Feature: STA/SAP |
| 1031 | * |
| 1032 | * Usage: Internal |
| 1033 | * |
| 1034 | * </ioctl> |
| 1035 | */ |
| 1036 | #define WE_SET_RANGE_EXT 93 |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1037 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1038 | /* |
| 1039 | * <ioctl> |
| 1040 | * wow_ito - sets the timeout value for inactivity data while |
| 1041 | * in power save mode during wow |
| 1042 | * |
| 1043 | * @INPUT: int |
| 1044 | * |
| 1045 | * @OUTPUT: None |
| 1046 | * |
| 1047 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 1048 | * |
| 1049 | * @E.g: iwpriv wlan0 wow_ito 20 |
| 1050 | * |
| 1051 | * Supported Feature: STA |
| 1052 | * |
| 1053 | * Usage: External |
| 1054 | * |
| 1055 | * </ioctl> |
Jeff Johnson | dcf84ce | 2017-10-05 09:26:24 -0700 | [diff] [blame] | 1056 | */ |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1057 | #define WE_SET_WOW_DATA_INACTIVITY_TO 94 |
| 1058 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 1059 | /* |
| 1060 | * <ioctl> |
| 1061 | * pdev_reset - reset the pdev |
| 1062 | * |
| 1063 | * @INPUT: Reset command to initiate: |
| 1064 | * TX_FLUSH = 1 |
| 1065 | * WARM_RESET = 2 |
| 1066 | * COLD_RESET = 3 |
| 1067 | * WARM_RESET_RESTORE_CAL = 4 |
| 1068 | * COLD_RESET_RESTORE_CAL = 5 |
| 1069 | * |
| 1070 | * @OUTPUT: None |
| 1071 | * |
| 1072 | * This IOCTL is used to reset the pdev. The primary use is |
| 1073 | * for internal testing. It is not expected that this will |
| 1074 | * be used on a production device. |
| 1075 | * |
| 1076 | * @E.g: iwpriv wlan0 pdev_reset <command> |
| 1077 | * iwpriv wlan0 pdev_reset 1 |
| 1078 | * |
| 1079 | * Supported Feature: None |
| 1080 | * |
| 1081 | * Usage: Internal |
| 1082 | * |
| 1083 | * </ioctl> |
| 1084 | */ |
| 1085 | #define WE_SET_PDEV_RESET 95 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1086 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1087 | /* |
| 1088 | * setModDTIM - Change Modulated DTIM |
| 1089 | * |
| 1090 | * @INPUT: set_value. |
| 1091 | * |
| 1092 | * @OUTPUT: None |
| 1093 | * |
| 1094 | * This IOCTL is used to change modulated DTIM |
| 1095 | * value without WIFI OFF/ON. |
| 1096 | * |
| 1097 | * @E.g: iwpriv wlan0 setModDTIM <value> |
| 1098 | * iwpriv wlan0 setModDTIM 2 |
| 1099 | * |
| 1100 | * Supported Feature: N/A |
| 1101 | * |
| 1102 | * Usage: Internal/External |
| 1103 | * |
| 1104 | * </ioctl> |
| 1105 | */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 1106 | #define WE_SET_MODULATED_DTIM 96 |
| 1107 | |
| 1108 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 1109 | #define WE_MOTION_DET_START_STOP 97 |
| 1110 | #define WE_MOTION_DET_BASE_LINE_START_STOP 98 |
| 1111 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1112 | |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1113 | /* |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1114 | * set_btc_mode Set BTCoexMode |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1115 | * |
| 1116 | * @INPUT: set_value. |
| 1117 | * |
| 1118 | * @OUTPUT: None |
| 1119 | * |
| 1120 | * This IOCTL is used to set the BT COex operating mode |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1121 | * Allowed values are 0(TDD), 1(FDD), 2(Hybrid) |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1122 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1123 | * @E.g: iwpriv wlan0 set_btc_mode <value> |
| 1124 | * iwpriv wlan0 set_btc_mode 2 |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1125 | * |
| 1126 | * Supported Feature: N/A |
| 1127 | * |
| 1128 | * Usage: Internal/External |
| 1129 | * |
| 1130 | * </ioctl> |
| 1131 | */ |
| 1132 | #define WE_SET_BTCOEX_MODE 99 |
| 1133 | |
| 1134 | /* |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1135 | * set_btc_rssi- Set WLAN low RSSI threshold for BTCOex |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1136 | * |
| 1137 | * @INPUT: set_value. |
| 1138 | * |
| 1139 | * @OUTPUT: None |
| 1140 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1141 | * This IOCTL is used to modify the threshold at which |
| 1142 | * the COex mode changes from TDD to Hybrid mode |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1143 | * Allowed values are from -100 to 0 |
| 1144 | * |
Krishna Reddy | 64c14da | 2019-02-12 20:23:12 +0530 | [diff] [blame] | 1145 | * @E.g: iwpriv wlan0 set_btc_rssi <value> |
| 1146 | * iwpriv wlan0 set_btc_rssi -70 |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 1147 | * |
| 1148 | * Supported Feature: N/A |
| 1149 | * |
| 1150 | * Usage: Internal/External |
| 1151 | * |
| 1152 | * </ioctl> |
| 1153 | */ |
| 1154 | #define WE_SET_BTCOEX_RSSI_THRESHOLD 100 |
| 1155 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1156 | /* Private ioctls and their sub-ioctls */ |
| 1157 | #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) |
| 1158 | #define WE_GET_11D_STATE 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | #define WE_GET_WLAN_DBG 4 |
| 1160 | #define WE_GET_MAX_ASSOC 6 |
| 1161 | /* 7 is unused */ |
| 1162 | #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 1163 | |
| 1164 | /* |
| 1165 | * <ioctl> |
| 1166 | * getconcurrency - Get concurrency mode |
| 1167 | * |
| 1168 | * @INPUT: None |
| 1169 | * |
| 1170 | * @OUTPUT: It shows concurrency value |
| 1171 | * Bit 0:STA 1:SAP 2:P2P_Client 3:P2P_GO |
| 1172 | * 4:FTM 5:IBSS 6:Monitor 7:P2P_Device |
| 1173 | * 8:OCB 9:EPPING 10:QVIT 11:NDI |
| 1174 | * |
| 1175 | * This IOCTL is used to retrieve concurrency mode. |
| 1176 | * |
| 1177 | * @E.g: iwpriv wlan0 getconcurrency |
| 1178 | * wlan0 getconcurrency:5 |
| 1179 | * Above value shows STA+P2P_Client |
| 1180 | * |
| 1181 | * Supported Feature: Concurrency |
| 1182 | * |
| 1183 | * Usage: Internal/External |
| 1184 | * |
| 1185 | * </ioctl> |
| 1186 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1187 | #define WE_GET_CONCURRENCY_MODE 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1188 | /* |
| 1189 | * <ioctl> |
| 1190 | * get_nss - Get the number of spatial STBC streams (NSS) |
| 1191 | * |
| 1192 | * @INPUT: None |
| 1193 | * |
| 1194 | * @OUTPUT: NSS |
| 1195 | * wlan0 get_nss:2 |
| 1196 | * |
| 1197 | * This IOTCL used to get the number of spatial STBC streams |
| 1198 | * |
| 1199 | * @E.g: iwpriv wlan0 get_nss |
| 1200 | * |
| 1201 | * Supported Feature: STA |
| 1202 | * |
| 1203 | * Usage: Internal/External |
| 1204 | * |
| 1205 | * </ioctl> |
| 1206 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1207 | #define WE_GET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1208 | /* |
| 1209 | * <ioctl> |
| 1210 | * get_ldpc - This IOCTL gets the low density parity check (LDPC) |
| 1211 | * |
| 1212 | * @INPUT: None |
| 1213 | * |
| 1214 | * @OUTPUT: ldpc |
| 1215 | * wlan0 get_ldpc:1 |
| 1216 | * |
| 1217 | * This IOTCL used to gets the low density parity check (LDPC) |
| 1218 | * |
| 1219 | * @E.g: iwpriv wlan0 get_ldpc |
| 1220 | * |
| 1221 | * Supported Feature: STA |
| 1222 | * |
| 1223 | * Usage: Internal/External |
| 1224 | * |
| 1225 | * </ioctl> |
| 1226 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1227 | #define WE_GET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1228 | /* |
| 1229 | * <ioctl> |
| 1230 | * get_tx_stbc - Get the value of the current Tx space time block code (STBC) |
| 1231 | * |
| 1232 | * @INPUT: None |
| 1233 | * |
| 1234 | * @OUTPUT: TXSTBC |
| 1235 | * wlan0 get_tx_stbc:1 |
| 1236 | * |
| 1237 | * This IOTCL get the value of the current Tx space time block code (STBC) |
| 1238 | * |
| 1239 | * @E.g: iwpriv wlan0 get_tx_stbc |
| 1240 | * |
| 1241 | * Supported Feature: STA |
| 1242 | * |
| 1243 | * Usage: Internal/External |
| 1244 | * |
| 1245 | * </ioctl> |
| 1246 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1247 | #define WE_GET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1248 | /* |
| 1249 | * <ioctl> |
| 1250 | * get_rx_stbc - Gets the value of the current Rx STBC |
| 1251 | * |
| 1252 | * @INPUT: None |
| 1253 | * |
| 1254 | * @OUTPUT: Rx STBC |
| 1255 | * wlan0 get_rx_stbc:1 |
| 1256 | * |
| 1257 | * This IOTCL used to get the value of the current Rx STBC |
| 1258 | * |
| 1259 | * @E.g: iwpriv wlan0 get_rx_stbc |
| 1260 | * |
| 1261 | * Supported Feature: STA |
| 1262 | * |
| 1263 | * Usage: Internal/External |
| 1264 | * |
| 1265 | * </ioctl> |
| 1266 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1267 | #define WE_GET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1268 | /* |
| 1269 | * <ioctl> |
| 1270 | * get_shortgi - Get the value of the current short GI setting |
| 1271 | * |
| 1272 | * @INPUT: None |
| 1273 | * |
| 1274 | * @OUTPUT: Enable/disable of shortgi |
| 1275 | * wlan0 get_shortgi:1 |
| 1276 | * |
| 1277 | * This IOCTL gets the value of the current short GI setting |
| 1278 | * |
| 1279 | * @E.g: iwpriv wlan0 get_shortgi |
| 1280 | * |
| 1281 | * Supported Feature: STA |
| 1282 | * |
| 1283 | * Usage: Internal/External |
| 1284 | * |
| 1285 | * </ioctl> |
| 1286 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1287 | #define WE_GET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1288 | /* |
| 1289 | * <ioctl> |
| 1290 | * get_rtscts - Get the value of the current RTS/CTS setting. |
| 1291 | * |
| 1292 | * @INPUT: None |
| 1293 | * |
| 1294 | * @OUTPUT: Enable/disable of RTS/CTS |
| 1295 | * wlan0 get_rtscts:33 |
| 1296 | * |
| 1297 | * This IOTCL get the value of the current RTS/CTS setting. |
| 1298 | * |
| 1299 | * @E.g: iwpriv wlan0 get_rtscts |
| 1300 | * |
| 1301 | * Supported Feature: STA |
| 1302 | * |
| 1303 | * Usage: Internal/External |
| 1304 | * |
| 1305 | * </ioctl> |
| 1306 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1307 | #define WE_GET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1308 | /* |
| 1309 | * <ioctl> |
| 1310 | * get_chwidth - Get the current channel width setting |
| 1311 | * |
| 1312 | * @INPUT: None |
| 1313 | * |
| 1314 | * @OUTPUT: channel width |
| 1315 | * wlan0 get_chwidth:0 |
| 1316 | * |
| 1317 | * This IOTCL get the current channel width setting. |
| 1318 | * |
| 1319 | * @E.g: iwpriv wlan0 get_chwidth |
| 1320 | * |
| 1321 | * Supported Feature: STA |
| 1322 | * |
| 1323 | * Usage: Internal/External |
| 1324 | * |
| 1325 | * </ioctl> |
| 1326 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1327 | #define WE_GET_CHWIDTH 17 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1328 | /* |
| 1329 | * <ioctl> |
| 1330 | * get_anienable - Get the anienable |
| 1331 | * |
| 1332 | * @INPUT: None |
| 1333 | * |
| 1334 | * @OUTPUT: |
| 1335 | * wlan0 get_anienable:0 |
| 1336 | * |
| 1337 | * This IOTCL get the anienable |
| 1338 | * |
| 1339 | * @E.g: iwpriv wlan0 get_anienable |
| 1340 | * |
| 1341 | * Supported Feature: STA |
| 1342 | * |
| 1343 | * Usage: Internal/External |
| 1344 | * |
| 1345 | * </ioctl> |
| 1346 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1347 | #define WE_GET_ANI_EN_DIS 18 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1348 | /* |
| 1349 | * <ioctl> |
| 1350 | * get_aniplen - Get the aniplen |
| 1351 | * |
| 1352 | * @INPUT: None |
| 1353 | * |
| 1354 | * @OUTPUT: |
| 1355 | * wlan0 get_aniplen:0 |
| 1356 | * |
| 1357 | * This IOTCL get the aniplen |
| 1358 | * |
| 1359 | * @E.g: iwpriv wlan0 get_aniplen |
| 1360 | * |
| 1361 | * Supported Feature: STA |
| 1362 | * |
| 1363 | * Usage: Internal/External |
| 1364 | * |
| 1365 | * </ioctl> |
| 1366 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1367 | #define WE_GET_ANI_POLL_PERIOD 19 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1368 | /* |
| 1369 | * <ioctl> |
| 1370 | * get_anilislen- Get the anilislen |
| 1371 | * |
| 1372 | * @INPUT: None |
| 1373 | * |
| 1374 | * @OUTPUT: |
| 1375 | * wlan0 get_anilislen:0 |
| 1376 | * |
| 1377 | * This IOTCL used to get anilislen |
| 1378 | * |
| 1379 | * @E.g: iwpriv wlan0 get_anilislen |
| 1380 | * |
| 1381 | * Supported Feature: STA |
| 1382 | * |
| 1383 | * Usage: Internal/External |
| 1384 | * |
| 1385 | * </ioctl> |
| 1386 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1387 | #define WE_GET_ANI_LISTEN_PERIOD 20 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1388 | /* |
| 1389 | * <ioctl> |
| 1390 | * get_aniofdmlvl - Get the OFDM level |
| 1391 | * |
| 1392 | * @INPUT: None |
| 1393 | * |
| 1394 | * @OUTPUT: OFDM |
| 1395 | * wlan0 get_aniofdmlvl:0 |
| 1396 | * |
| 1397 | * This IOTCL used to get ofdm level |
| 1398 | * |
| 1399 | * @E.g: iwpriv wlan0 get_aniofdmlvl |
| 1400 | * |
| 1401 | * Supported Feature: STA |
| 1402 | * |
| 1403 | * Usage: Internal/External |
| 1404 | * |
| 1405 | * </ioctl> |
| 1406 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1407 | #define WE_GET_ANI_OFDM_LEVEL 21 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1408 | /* |
| 1409 | * <ioctl> |
| 1410 | * get_aniccklvl - Get the cck level |
| 1411 | * |
| 1412 | * @INPUT: None |
| 1413 | * |
| 1414 | * @OUTPUT: |
| 1415 | * wlan0 get_aniccklvl:0 |
| 1416 | * |
| 1417 | * This IOTCL used to get cck level |
| 1418 | * |
| 1419 | * @E.g: iwpriv wlan0 get_aniccklvl |
| 1420 | * |
| 1421 | * Supported Feature: STA |
| 1422 | * |
| 1423 | * Usage: Internal/External |
| 1424 | * |
| 1425 | * </ioctl> |
| 1426 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1427 | #define WE_GET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1428 | /* |
| 1429 | * <ioctl> |
| 1430 | * get_cwmenable - Get the value of the dynamic channel bandwidth setting |
| 1431 | * |
| 1432 | * @INPUT: None |
| 1433 | * |
| 1434 | * @OUTPUT: Enable/disable dynamic channel bandwidth |
| 1435 | * wlan0 get_cwmenable:0 |
| 1436 | * |
| 1437 | * This IOTCL get the value of the dynamic channel bandwidth setting |
| 1438 | * |
| 1439 | * @E.g: iwpriv wlan0 get_cwmenable |
| 1440 | * |
| 1441 | * Supported Feature: STA |
| 1442 | * |
| 1443 | * Usage: Internal/External |
| 1444 | * |
| 1445 | * </ioctl> |
| 1446 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1447 | #define WE_GET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1448 | /* |
| 1449 | * <ioctl> |
| 1450 | * get_txchainmask - Get the txchainmask that was set |
| 1451 | * |
| 1452 | * @INPUT: None |
| 1453 | * |
| 1454 | * @OUTPUT: txchainmask |
| 1455 | * wlan0 get_txchainmask:1 |
| 1456 | * |
| 1457 | * This IOCTL gets the txchainmask that was set |
| 1458 | * This command is useful if it was previously set |
| 1459 | * |
| 1460 | * @E.g: iwpriv wlan0 get_txchainmask |
| 1461 | * |
| 1462 | * Supported Feature: STA |
| 1463 | * |
| 1464 | * Usage: Internal/External |
| 1465 | * |
| 1466 | * </ioctl> |
| 1467 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1468 | #define WE_GET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1469 | /* |
| 1470 | * <ioctl> |
| 1471 | * get_rxchainmask - Get the rxchainmask that was set |
| 1472 | * |
| 1473 | * @INPUT: None |
| 1474 | * |
| 1475 | * @OUTPUT: rxchainmask |
| 1476 | * wlan0 get_rxchainmask:1 |
| 1477 | * |
| 1478 | * This IOCTL gets the rxchainmask that was set |
| 1479 | * This command is useful only if it was previously set. |
| 1480 | * |
| 1481 | * @E.g: iwpriv wlan0 get_rxchainmask |
| 1482 | * |
| 1483 | * Supported Feature: STA |
| 1484 | * |
| 1485 | * Usage: Internal/External |
| 1486 | * |
| 1487 | * </ioctl> |
| 1488 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1489 | #define WE_GET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1490 | /* |
| 1491 | * <ioctl> |
| 1492 | * get_11nrate - Get the fixed Tx data rate |
| 1493 | * |
| 1494 | * @INPUT: None |
| 1495 | * |
| 1496 | * @OUTPUT: Using this command does not return the same value as set |
| 1497 | * wlan0 get_11nrate:0 |
| 1498 | * |
| 1499 | * This IOCTL gets the fixed Tx data rate |
| 1500 | * This command is useful only if setting the fixed Tx rate. |
| 1501 | * |
| 1502 | * @E.g: iwpriv wlan0 get_11nrate |
| 1503 | * |
| 1504 | * Supported Feature: STA |
| 1505 | * |
| 1506 | * Usage: Internal/External |
| 1507 | * |
| 1508 | * </ioctl> |
| 1509 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1510 | #define WE_GET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1511 | /* |
| 1512 | * <ioctl> |
| 1513 | * get_ampdu - Get the maximum subframe of ampdu |
| 1514 | * |
| 1515 | * @INPUT: None |
| 1516 | * |
| 1517 | * @OUTPUT: Maximum subframe of ampdu |
| 1518 | * wlan0 get_ampdu:1 |
| 1519 | * |
| 1520 | * This IOCTL gets the maximum subframe of ampdu |
| 1521 | * This command is useful only if setting ampdu. |
| 1522 | * |
| 1523 | * @E.g: iwpriv wlan0 get_ampdu |
| 1524 | * |
| 1525 | * Supported Feature: STA |
| 1526 | * |
| 1527 | * Usage: Internal/External |
| 1528 | * |
| 1529 | * </ioctl> |
| 1530 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1531 | #define WE_GET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1532 | /* |
| 1533 | * <ioctl> |
| 1534 | * get_amsdu - Get the maximum subframe of amsdu |
| 1535 | * |
| 1536 | * @INPUT: None |
| 1537 | * |
| 1538 | * @OUTPUT: Maximum subframe of amsdu |
| 1539 | * wlan0 get_amsdu:1 |
| 1540 | * |
| 1541 | * This IOCTL gets the maximum subframe of amsdu. |
| 1542 | * This command is useful only if setting amsdu |
| 1543 | * |
| 1544 | * @E.g: iwpriv wlan0 get_amsdu |
| 1545 | * |
| 1546 | * Supported Feature: STA |
| 1547 | * |
| 1548 | * Usage: Internal/External |
| 1549 | * |
| 1550 | * </ioctl> |
| 1551 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1552 | #define WE_GET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1553 | /* |
| 1554 | * <ioctl> |
| 1555 | * get_txpow2g - Get the current 2 GHz Tx power setting |
| 1556 | * |
| 1557 | * @INPUT: None |
| 1558 | * |
| 1559 | * @OUTPUT: Tx Power in dbm |
| 1560 | * wlan0 get_txpow2g:0 |
| 1561 | * |
| 1562 | * This IOCTL gets the current 2 GHz Tx power setting |
| 1563 | * This command is useful if setting Tx power |
| 1564 | * |
| 1565 | * @E.g: iwpriv wlan0 get_txpow2g |
| 1566 | * |
| 1567 | * Supported Feature: STA |
| 1568 | * |
| 1569 | * Usage: Internal/External |
| 1570 | * |
| 1571 | * </ioctl> |
| 1572 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1573 | #define WE_GET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1574 | /* |
| 1575 | * <ioctl> |
| 1576 | * get_txpow5g - Get the current 5 GHz Tx power setting |
| 1577 | * |
| 1578 | * @INPUT: None |
| 1579 | * |
| 1580 | * @OUTPUT: Tx Power in dbm |
| 1581 | * wlan0 get_txpow5g:0 |
| 1582 | * |
| 1583 | * This IOCTL gets the current 5 GHz Tx power setting |
| 1584 | * This command is useful if setting Tx power |
| 1585 | * |
| 1586 | * @E.g: iwpriv wlan0 get_txpow5g |
| 1587 | * |
| 1588 | * Supported Feature: STA |
| 1589 | * |
| 1590 | * Usage: Internal/External |
| 1591 | * |
| 1592 | * </ioctl> |
| 1593 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1594 | #define WE_GET_TXPOW_5G 30 |
Rajeev Kumar | 1bcfd63 | 2015-12-07 11:38:51 -0800 | [diff] [blame] | 1595 | /* 31 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1596 | #define WE_GET_PPS_PAID_MATCH 32 |
| 1597 | #define WE_GET_PPS_GID_MATCH 33 |
| 1598 | #define WE_GET_PPS_EARLY_TIM_CLEAR 34 |
| 1599 | #define WE_GET_PPS_EARLY_DTIM_CLEAR 35 |
| 1600 | #define WE_GET_PPS_EOF_PAD_DELIM 36 |
| 1601 | #define WE_GET_PPS_MACADDR_MISMATCH 37 |
| 1602 | #define WE_GET_PPS_DELIM_CRC_FAIL 38 |
| 1603 | #define WE_GET_PPS_GID_NSTS_ZERO 39 |
| 1604 | #define WE_GET_PPS_RSSI_CHECK 40 |
| 1605 | /* Private ioctl for QPower */ |
| 1606 | #define WE_GET_QPOWER_MAX_PSPOLL_COUNT 41 |
| 1607 | #define WE_GET_QPOWER_MAX_TX_BEFORE_WAKE 42 |
| 1608 | #define WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 43 |
| 1609 | #define WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 44 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1610 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1611 | /* |
| 1612 | * <ioctl> |
| 1613 | * get_gtxHTMcs - Get the tx HTM |
| 1614 | * |
| 1615 | * @INPUT: None |
| 1616 | * |
| 1617 | * @OUTPUT: HTM |
| 1618 | * wlan0 get_gtxHTMcs:32896 |
| 1619 | * |
| 1620 | * This IOTCL used to get HTM |
| 1621 | * |
| 1622 | * @E.g: iwpriv wlan0 get_gtxHTMcs |
| 1623 | * |
| 1624 | * Supported Feature: STA |
| 1625 | * |
| 1626 | * Usage: Internal/External |
| 1627 | * |
| 1628 | * </ioctl> |
| 1629 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1630 | #define WE_GET_GTX_HT_MCS 47 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1631 | /* |
| 1632 | * <ioctl> |
| 1633 | * get_gtxVHTMcs - Get the VHTM |
| 1634 | * |
| 1635 | * @INPUT: None |
| 1636 | * |
| 1637 | * @OUTPUT: VHTM |
| 1638 | * wlan0 get_gtxVHTMcs:524800 |
| 1639 | * |
| 1640 | * This IOTCL used to get the VHTM |
| 1641 | * |
| 1642 | * @E.g: iwpriv wlan0 get_gtxVHTMcs |
| 1643 | * |
| 1644 | * Supported Feature: STA |
| 1645 | * |
| 1646 | * Usage: Internal/External |
| 1647 | * |
| 1648 | * </ioctl> |
| 1649 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1650 | #define WE_GET_GTX_VHT_MCS 48 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1651 | /* |
| 1652 | * <ioctl> |
| 1653 | * get_gtxUsrCfg - Get the tx cfg |
| 1654 | * |
| 1655 | * @INPUT: None |
| 1656 | * |
| 1657 | * @OUTPUT: TXCFG |
| 1658 | * wlan0 get_gtxUsrCfg:32 |
| 1659 | * |
| 1660 | * This IOTCL used to get the tx cfg |
| 1661 | * |
| 1662 | * @E.g: iwpriv wlan0 get_gtxUsrCfg |
| 1663 | * |
| 1664 | * Supported Feature: STA |
| 1665 | * |
| 1666 | * Usage: Internal/External |
| 1667 | * |
| 1668 | * </ioctl> |
| 1669 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1670 | #define WE_GET_GTX_USRCFG 49 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1671 | /* |
| 1672 | * <ioctl> |
| 1673 | * get_gtxThre - Get the tx threshold |
| 1674 | * |
| 1675 | * @INPUT: None |
| 1676 | * |
| 1677 | * @OUTPUT: Threshold |
| 1678 | * wlan0 get_gtxThre:3 |
| 1679 | * |
| 1680 | * This IOCTL is used to get tx threshold |
| 1681 | * |
| 1682 | * @E.g: iwpriv wlan0 get_gtxThre |
| 1683 | * |
| 1684 | * Supported Feature: STA |
| 1685 | * |
| 1686 | * Usage: Internal/External |
| 1687 | * |
| 1688 | * </ioctl> |
| 1689 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1690 | #define WE_GET_GTX_THRE 50 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1691 | /* |
| 1692 | * <ioctl> |
| 1693 | * get_gtxMargin - Get the tx margin |
| 1694 | * |
| 1695 | * @INPUT: None |
| 1696 | * |
| 1697 | * @OUTPUT: GTXMARGIN |
| 1698 | * wlan0 get_gtxMargin:2 |
| 1699 | * |
| 1700 | * This IOCTL is used to set tx margin |
| 1701 | * |
| 1702 | * @E.g: iwpriv wlan0 get_gtxMargin |
| 1703 | * |
| 1704 | * Supported Feature: STA |
| 1705 | * |
| 1706 | * Usage: Internal/External |
| 1707 | * |
| 1708 | * </ioctl> |
| 1709 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1710 | #define WE_GET_GTX_MARGIN 51 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1711 | /* |
| 1712 | * <ioctl> |
| 1713 | * get_gtxStep - Get the tx step |
| 1714 | * |
| 1715 | * @INPUT: None |
| 1716 | * |
| 1717 | * @OUTPUT: GTXSTEP |
| 1718 | * wlan0 get_gtxStep:0 |
| 1719 | * |
| 1720 | * This IOCTL is used to get the gtx step |
| 1721 | * |
| 1722 | * @E.g: iwpriv wlan0 get_gtxStep |
| 1723 | * |
| 1724 | * Supported Feature: STA |
| 1725 | * |
| 1726 | * Usage: Internal/External |
| 1727 | * |
| 1728 | * </ioctl> |
| 1729 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1730 | #define WE_GET_GTX_STEP 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1731 | /* |
| 1732 | * <ioctl> |
| 1733 | * get_gtxMinTpc - Get the tx miminum tpc |
| 1734 | * |
| 1735 | * @INPUT: None |
| 1736 | * |
| 1737 | * @OUTPUT: TPC |
| 1738 | * wlan0 get_gtxMinTpc:0 |
| 1739 | * |
| 1740 | * This IOCTL is used to get tx miminum tpc |
| 1741 | * |
| 1742 | * @E.g: iwpriv wlan0 get_gtxMinTpc |
| 1743 | * |
| 1744 | * Supported Feature: STA |
| 1745 | * |
| 1746 | * Usage: Internal/External |
| 1747 | * |
| 1748 | * </ioctl> |
| 1749 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1750 | #define WE_GET_GTX_MINTPC 53 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1751 | /* |
| 1752 | * <ioctl> |
| 1753 | * get_gtxBWMask - Get the tx BW MASK |
| 1754 | * |
| 1755 | * @INPUT: None |
| 1756 | * |
| 1757 | * @OUTPUT: MASK |
| 1758 | * wlan0 get_gtxBWMask:15 |
| 1759 | * |
| 1760 | * This IOCTL is used get gtx bw mask |
| 1761 | * |
| 1762 | * @E.g: iwpriv wlan0 get_gtxBWMask |
| 1763 | * |
| 1764 | * Supported Feature: STA |
| 1765 | * |
| 1766 | * Usage: Internal/External |
| 1767 | * |
| 1768 | * </ioctl> |
| 1769 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1770 | #define WE_GET_GTX_BWMASK 54 |
| 1771 | #define WE_GET_TEMPERATURE 56 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1772 | #define WE_CAP_TSF 58 |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 1773 | #define WE_GET_ROAM_SYNCH_DELAY 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1774 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1775 | /* |
| 1776 | * <ioctl> |
| 1777 | * get_dcm - Get dcm enablement value |
| 1778 | * |
| 1779 | * @INPUT: None |
| 1780 | * |
| 1781 | * @OUTPUT: 0/1 |
| 1782 | * wlan0 get_dcm |
| 1783 | * |
| 1784 | * This IOCTL is used get dcm value |
| 1785 | * |
| 1786 | * Supported Feature: STA/SAP |
| 1787 | * |
| 1788 | * Usage: Internal |
| 1789 | * |
| 1790 | * </ioctl> |
| 1791 | */ |
| 1792 | #define WE_GET_DCM 60 |
| 1793 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1794 | /* |
| 1795 | * <ioctl> |
| 1796 | * get_dcm - Get range extension enablement value |
| 1797 | * |
| 1798 | * @INPUT: None |
| 1799 | * |
| 1800 | * @OUTPUT: 0/1 |
| 1801 | * wlan0 get_range_ext |
| 1802 | * |
| 1803 | * This IOCTL is used get range_extension value |
| 1804 | * |
| 1805 | * Supported Feature: STA/SAP |
| 1806 | * |
| 1807 | * Usage: Internal |
| 1808 | * |
| 1809 | * </ioctl> |
| 1810 | */ |
| 1811 | #define WE_GET_RANGE_EXT 61 |
| 1812 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1813 | /* Private ioctls and their sub-ioctls */ |
| 1814 | #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) |
| 1815 | |
| 1816 | /* Private ioctls and their sub-ioctls */ |
| 1817 | #define WLAN_PRIV_SET_CHAR_GET_NONE (SIOCIWFIRSTPRIV + 3) |
| 1818 | #define WE_WOWL_ADD_PTRN 1 |
| 1819 | #define WE_WOWL_DEL_PTRN 2 |
Sreelakshmi Konamki | ded64d7 | 2017-02-23 10:39:26 +0530 | [diff] [blame] | 1820 | /* |
| 1821 | * <ioctl> |
| 1822 | * neighbor - Send neighbor report request |
| 1823 | * |
| 1824 | * @INPUT: string |
| 1825 | * |
| 1826 | * @OUTPUT: None |
| 1827 | * |
| 1828 | * This IOCTL create a Neighbor report request and send it to peer |
| 1829 | * |
| 1830 | * @E.g: iwpriv wlan0 neighbor "SSID" |
| 1831 | * |
| 1832 | * Supported Feature: 11k |
| 1833 | * |
| 1834 | * Usage: Internal/External |
| 1835 | * |
| 1836 | * </ioctl> |
| 1837 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1838 | #define WE_NEIGHBOR_REPORT_REQUEST 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1839 | /* |
| 1840 | * <ioctl> |
| 1841 | * set_ap_wps_ie - Set the P2P IE of the probe response |
| 1842 | * |
| 1843 | * @INPUT: string |
| 1844 | * |
| 1845 | * @OUTPUT: None |
| 1846 | * |
| 1847 | * This IOCTL sets the P2P IE of the probe response |
| 1848 | * |
| 1849 | * @E.g: iwpriv wlan0 set_ap_wps_ie abcd |
| 1850 | * |
| 1851 | * Supported Feature: STA |
| 1852 | * |
| 1853 | * Usage: Internal/External |
| 1854 | * |
| 1855 | * </ioctl> |
| 1856 | */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 1857 | #define WE_SET_AP_WPS_IE 4 |
Jeff Johnson | 0fcc94e | 2019-03-06 19:48:17 -0800 | [diff] [blame] | 1858 | |
| 1859 | /* 5 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1860 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 1861 | /* |
| 1862 | * <ioctl> |
| 1863 | * unit_test - execute component-level unit tests |
| 1864 | * |
| 1865 | * @INPUT: string - the name of the component to test. |
| 1866 | * All tests are executed if unspecified |
| 1867 | * @OUTPUT: None |
| 1868 | * |
| 1869 | * Usage: Internal only |
| 1870 | * </ioctl> |
| 1871 | */ |
| 1872 | #define WE_UNIT_TEST 6 |
| 1873 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1874 | /* Private ioctls and their sub-ioctls */ |
| 1875 | #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) |
| 1876 | #define WE_SET_WLAN_DBG 1 |
| 1877 | #define WE_SET_DP_TRACE 2 |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 1878 | #define WE_SET_FW_TEST 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1879 | |
| 1880 | /* Private ioctls and their sub-ioctls */ |
| 1881 | #define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5) |
| 1882 | #define WE_WLAN_VERSION 1 |
| 1883 | #define WE_GET_STATS 2 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1884 | /* |
| 1885 | * <ioctl> |
| 1886 | * getConfig - gets the values of all configurations listed in WCNSS |
| 1887 | * |
| 1888 | * @INPUT: None |
| 1889 | * |
| 1890 | * @OUTPUT: Current configuration to the sys log |
| 1891 | * wlan0 getConfig: WLAN configuration written to system log |
| 1892 | * |
| 1893 | * This IOCTL gets the values of all configurations listed in WCNSS |
| 1894 | * |
| 1895 | * @E.g: iwpriv wlan0 getConfig |
| 1896 | * |
| 1897 | * Supported Feature: STA |
| 1898 | * |
| 1899 | * Usage: Internal/External |
| 1900 | * |
| 1901 | * </ioctl> |
| 1902 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1903 | #define WE_GET_CFG 3 |
| 1904 | #define WE_GET_WMM_STATUS 4 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1905 | /* |
| 1906 | * <ioctl> |
| 1907 | * getChannelList - Get the available channel list while in QCMobileAP |
| 1908 | * |
| 1909 | * @INPUT: None |
| 1910 | * |
| 1911 | * @OUTPUT: Channel list |
| 1912 | * wlan0 getChannelList:36 US 1..165 |
| 1913 | * |
| 1914 | * This IOCTL gets the available channel list while in QCMobileAP |
| 1915 | * |
| 1916 | * @E.g: iwpriv wlan0 getChannelList |
| 1917 | * |
| 1918 | * Supported Feature: STA |
| 1919 | * |
| 1920 | * Usage: Internal/External |
| 1921 | * |
| 1922 | * </ioctl> |
| 1923 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1924 | #define WE_GET_CHANNEL_LIST 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1925 | /* |
| 1926 | * <ioctl> |
| 1927 | * getRSSI - Get the Received Signal Strength Indicator |
| 1928 | * |
| 1929 | * @INPUT: None |
| 1930 | * |
| 1931 | * @OUTPUT: RSSI |
| 1932 | * wlan0 getRSSI:rsssi=-32 |
| 1933 | * |
| 1934 | * This IOCTL gets the Received Signal Strength Indicator (RSSI) |
| 1935 | * |
| 1936 | * @E.g: iwpriv wlan0 getRSSI |
| 1937 | * |
| 1938 | * Supported Feature: STA |
| 1939 | * |
| 1940 | * Usage: Internal/External |
| 1941 | * |
| 1942 | * </ioctl> |
| 1943 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1944 | #define WE_GET_RSSI 6 |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1945 | |
| 1946 | /* |
| 1947 | * <ioctl> |
| 1948 | * getSuspendStats - Get suspend/resume stats |
| 1949 | * |
| 1950 | * @INPUT: None |
| 1951 | * |
| 1952 | * @OUTPUT: character string containing formatted suspend/resume stats |
| 1953 | * |
| 1954 | * This ioctl is used to get suspend/resume stats formatted for display. |
| 1955 | * Currently it includes suspend/resume counts, wow wake up reasons, and |
| 1956 | * suspend fail reasons. |
| 1957 | * |
| 1958 | * @E.g: iwpriv wlan0 getSuspendStats |
| 1959 | * iwpriv wlan0 getSuspendStats |
| 1960 | * |
| 1961 | * Supported Feature: suspend/resume |
| 1962 | * |
| 1963 | * Usage: Internal |
| 1964 | * |
| 1965 | * </ioctl> |
| 1966 | */ |
| 1967 | #define WE_GET_SUSPEND_RESUME_STATS 7 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1968 | #ifdef FEATURE_WLAN_TDLS |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 1969 | /* |
| 1970 | * <ioctl> |
| 1971 | * getTdlsPeers - Get all TDLS peers. |
| 1972 | * |
| 1973 | * @INPUT: None |
| 1974 | * |
| 1975 | * @OUTPUT: Returns the MAC address of all the TDLS peers |
| 1976 | * wlan0 getTdlsPeers: |
| 1977 | * MAC Id cap up RSSI |
| 1978 | * --------------------------------- |
| 1979 | * 00:0a:f5:0e:bd:18 2 Y Y -44 |
| 1980 | * 00:0a:f5:bf:0e:12 0 N N 0 |
| 1981 | * |
| 1982 | * This IOCTL is used to get all TDLS peers. |
| 1983 | * |
| 1984 | * @E.g: iwpriv wlan0 getTdlsPeers |
| 1985 | * |
| 1986 | * Supported Feature: TDLS |
| 1987 | * |
| 1988 | * Usage: Internal/External |
| 1989 | * |
| 1990 | * </ioctl> |
| 1991 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1992 | #define WE_GET_TDLS_PEERS 8 |
| 1993 | #endif |
| 1994 | #ifdef WLAN_FEATURE_11W |
Abhishek Singh | 2f81049 | 2016-12-01 11:39:39 +0530 | [diff] [blame] | 1995 | /* |
| 1996 | * <ioctl> |
| 1997 | * getPMFInfo - get the PMF info of the connected session |
| 1998 | * |
| 1999 | * @INPUT: None |
| 2000 | * |
| 2001 | * @OUTPUT: |
| 2002 | * wlan0 getPMFInfo: |
| 2003 | * BSSID E4:F4:C6:0A:E0:36, Is PMF Assoc? 0 |
| 2004 | * Number of Unprotected Disassocs 0 |
| 2005 | * Number of Unprotected Deauths 0 |
| 2006 | * |
| 2007 | * This IOCTL is used to get the PMF stats/status of the current |
| 2008 | * connection. |
| 2009 | * |
| 2010 | * @e.g:iwpriv wlan0 getPMFInfo |
| 2011 | * |
| 2012 | * Supported Feature: PMF |
| 2013 | * |
| 2014 | * Usage: Internal/External |
| 2015 | * |
| 2016 | * </ioctl> |
| 2017 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2018 | #define WE_GET_11W_INFO 9 |
| 2019 | #endif |
| 2020 | #define WE_GET_STATES 10 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2021 | /* |
| 2022 | * <ioctl> |
| 2023 | * getIbssSTAs - get ibss sta info |
| 2024 | * |
| 2025 | * @INPUT: None |
| 2026 | * |
| 2027 | * @OUTPUT: Give the MAC of the IBSS STA |
| 2028 | * wlan0 getIbssSTAs: |
| 2029 | * 1 .8c:fd:f0:01:9c:bf |
| 2030 | * |
| 2031 | * This IOCTL is used to get ibss sta info |
| 2032 | * |
| 2033 | * @E.g: iwpriv wlan0 getIbssSTAs |
| 2034 | * |
| 2035 | * Supported Feature: IBSS |
| 2036 | * |
| 2037 | * Usage: Internal/External |
| 2038 | * |
| 2039 | * </ioctl> |
| 2040 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2041 | #define WE_GET_IBSS_STA_INFO 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2042 | /* |
| 2043 | * <ioctl> |
| 2044 | * getphymode - Get the current phymode. |
| 2045 | * |
| 2046 | * @INPUT: None |
| 2047 | * |
| 2048 | * @OUTPUT: In phymode |
| 2049 | * wlan0 getphymode:AUTO MODE |
| 2050 | * |
| 2051 | * This IOCTL used to gets the current phymode. |
| 2052 | * |
| 2053 | * @E.g: iwpriv wlan0 getphymode |
| 2054 | * |
| 2055 | * Supported Feature: STA |
| 2056 | * |
| 2057 | * Usage: Internal/External |
| 2058 | * |
| 2059 | * </ioctl> |
| 2060 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2061 | #define WE_GET_PHYMODE 12 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2062 | |
| 2063 | /* |
| 2064 | * <ioctl> |
| 2065 | * getOemDataCap - Get the oem data caps. |
| 2066 | * |
| 2067 | * @INPUT: None |
| 2068 | * |
| 2069 | * @OUTPUT: oem data capability |
| 2070 | * |
| 2071 | * This IOCTL used to gets the current oem data cap. |
| 2072 | * |
| 2073 | * @E.g: iwpriv wlan0 getOemDataCap |
| 2074 | * |
| 2075 | * Usage: Internal/External |
| 2076 | * |
| 2077 | * </ioctl> |
| 2078 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2079 | #define WE_GET_OEM_DATA_CAP 13 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2080 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2081 | /* |
| 2082 | * <ioctl> |
| 2083 | * getSNR - Enable SNR Monitoring |
| 2084 | * |
| 2085 | * @INPUT: None |
| 2086 | * |
| 2087 | * @OUTPUT: Signal strength/ratio |
| 2088 | * wlan0 getSNR:1 |
| 2089 | * |
| 2090 | * This IOCTL is used to get ibss sta info |
| 2091 | * |
| 2092 | * @E.g: iwpriv wlan0 getSNR |
| 2093 | * |
| 2094 | * Supported Feature: STA |
| 2095 | * |
| 2096 | * Usage: Internal/External |
| 2097 | * |
| 2098 | * </ioctl> |
| 2099 | */ |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2100 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2101 | #define WE_GET_SNR 14 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2102 | #define WE_LIST_FW_PROFILE 15 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2103 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2104 | /* |
| 2105 | * <ioctl> |
| 2106 | * |
| 2107 | * get_ba_timeout - to get timeout for each AC |
| 2108 | * |
| 2109 | * @INPUT: None |
| 2110 | * |
| 2111 | * @OUTPUT: displays timeout value for each access class |
| 2112 | * |
| 2113 | * @E.g.: iwpriv wlan0 get_ba_timeout |
| 2114 | * |
| 2115 | * Usage: Internal |
| 2116 | * |
| 2117 | * </ioctl> |
| 2118 | */ |
| 2119 | #define WE_GET_BA_AGEING_TIMEOUT 16 |
| 2120 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 2121 | /* |
| 2122 | * <ioctl> |
| 2123 | * |
| 2124 | * sta_cxn_info - STA connection information |
| 2125 | * |
| 2126 | * @INPUT: none |
| 2127 | * |
| 2128 | * @OUTPUT: STA's connection information |
| 2129 | * |
| 2130 | * This IOCTL is used to get connection's information. |
| 2131 | * |
| 2132 | * @E.g: iwpriv wlan0 get_cxn_info |
| 2133 | * |
| 2134 | * Usage: Internal |
| 2135 | * |
| 2136 | * </ioctl> |
| 2137 | */ |
| 2138 | #define WE_GET_STA_CXN_INFO 17 |
| 2139 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2140 | /* Private ioctls and their sub-ioctls */ |
| 2141 | #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) |
Selvaraj, Sridhar | f793983 | 2017-03-25 16:59:50 +0530 | [diff] [blame] | 2142 | |
| 2143 | /* |
| 2144 | * <ioctl> |
| 2145 | * reassoc - Trigger STA re-association to the connected AP |
| 2146 | * |
| 2147 | * @INPUT: None |
| 2148 | * |
| 2149 | * @OUTPUT: None |
| 2150 | * |
| 2151 | * This IOCTL is used to trigger STA reassociation to the connected AP. |
| 2152 | * |
| 2153 | * @E.g: iwpriv wlan0 reassoc |
| 2154 | * |
| 2155 | * Supported Feature: Roaming |
| 2156 | * |
| 2157 | * Usage: Internal |
| 2158 | * |
| 2159 | * </ioctl> |
| 2160 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2161 | #define WE_SET_REASSOC_TRIGGER 8 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2162 | /* |
| 2163 | * <ioctl> |
| 2164 | * ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI |
| 2165 | * |
| 2166 | * @INPUT: None |
| 2167 | * |
| 2168 | * @OUTPUT: print ibss peer in info logs |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 2169 | * peer_info->numIBSSPeers = 1 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2170 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2171 | * |
| 2172 | * This IOCTL is used to rint the ibss peers's MAC, rate and RSSI |
| 2173 | * in info logs |
| 2174 | * |
| 2175 | * @E.g: iwpriv wlan0 ibssPeerInfoAll |
| 2176 | * |
| 2177 | * Supported Feature: IBSS |
| 2178 | * |
| 2179 | * Usage: Internal/External |
| 2180 | * |
| 2181 | * </ioctl> |
| 2182 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2183 | #define WE_IBSS_GET_PEER_INFO_ALL 10 |
Rajeev Kumar | f4390fa | 2016-12-22 13:17:33 -0800 | [diff] [blame] | 2184 | /* Sub ioctls 11 to 16 are not used */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2185 | #define WE_GET_FW_PROFILE_DATA 18 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 2186 | /* |
| 2187 | * <ioctl> |
| 2188 | * stop_obss_scan - Stop obss scan |
| 2189 | * |
| 2190 | * @INPUT: None |
| 2191 | * |
| 2192 | * @OUTPUT: None |
| 2193 | * |
| 2194 | * This IOCTL is used to stop obss scan |
| 2195 | * |
| 2196 | * @E.g: iwpriv wlan0 stop_obss_scan |
| 2197 | * |
| 2198 | * Supported Feature: Scan |
| 2199 | * |
| 2200 | * Usage: Internal/External |
| 2201 | * |
| 2202 | * </ioctl> |
| 2203 | */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2204 | #define WE_STOP_OBSS_SCAN 19 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2205 | |
| 2206 | /* Private ioctls and their sub-ioctls */ |
| 2207 | #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) |
| 2208 | |
| 2209 | #define WE_P2P_NOA_CMD 2 |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2210 | /* subcommands 3 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2211 | |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2212 | #define WE_MAC_PWR_DEBUG_CMD 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2213 | |
Kabilan Kannan | 6894e6a | 2017-11-09 14:37:55 -0800 | [diff] [blame] | 2214 | /* subcommand 5 is unused */ |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 2215 | |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2216 | /* |
| 2217 | * <ioctl> |
| 2218 | * ibssPeerInfo - Print the ibss peers's MAC, rate and RSSI |
| 2219 | * |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 2220 | * @INPUT: sta_id |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2221 | * |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 2222 | * @OUTPUT: print ibss peer corresponding to sta_id in info logs |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2223 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2224 | * |
| 2225 | * This IOCTL is used to print the specific ibss peers's MAC, |
| 2226 | * rate and RSSI in info logs |
| 2227 | * |
| 2228 | * @E.g: iwpriv wlan0 ibssPeerInfo <sta_id> |
| 2229 | * iwpriv wlan0 ibssPeerInfo 0 |
| 2230 | * |
| 2231 | * Supported Feature: IBSS |
| 2232 | * |
| 2233 | * Usage: Internal/External |
| 2234 | * |
| 2235 | * </ioctl> |
| 2236 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2237 | #define WE_IBSS_GET_PEER_INFO 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2238 | #define WE_UNIT_TEST_CMD 7 |
| 2239 | |
| 2240 | #define WE_MTRACE_DUMP_CMD 8 |
| 2241 | #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 |
| 2242 | |
| 2243 | |
| 2244 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 2245 | #define WE_LED_FLASHING_PARAM 10 |
| 2246 | #endif |
| 2247 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2248 | /* |
| 2249 | * <ioctl> |
| 2250 | * pm_clist - Increments the index value of the concurrent connection list |
| 2251 | * and update with the input parameters provided. |
| 2252 | * |
| 2253 | * @INPUT: Following 8 arguments: |
| 2254 | * @vdev_id: vdev id |
| 2255 | * @tx_streams: TX streams |
| 2256 | * @rx_streams: RX streams |
| 2257 | * @chain_mask: Chain mask |
| 2258 | * @type: vdev_type |
| 2259 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2260 | * @sub_type: vdev_subtype |
| 2261 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2262 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2263 | * @channel: Channel |
| 2264 | * @mac: Mac id |
| 2265 | * |
| 2266 | * @OUTPUT: None |
| 2267 | * |
| 2268 | * This IOCTL is used to increments the index value of the concurrent connection |
| 2269 | * list and update with the input parameters provided. |
| 2270 | * |
| 2271 | * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type |
| 2272 | * sub_type channel mac |
| 2273 | * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1 |
| 2274 | * |
| 2275 | * Supported Feature: DBS |
| 2276 | * |
| 2277 | * Usage: Internal/External |
| 2278 | * |
| 2279 | * </ioctl> |
| 2280 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2281 | #define WE_POLICY_MANAGER_CLIST_CMD 11 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2282 | |
| 2283 | /* |
| 2284 | * <ioctl> |
| 2285 | * pm_dlist - Delete the index from the concurrent connection list that is |
| 2286 | * present in the given vdev_id. |
| 2287 | * |
| 2288 | * @INPUT: delete_all, vdev_id |
| 2289 | * @delete_all: delete all indices |
| 2290 | * @vdev_id: vdev id |
| 2291 | * |
| 2292 | * @OUTPUT: None |
| 2293 | * |
| 2294 | * This IOCTL is used to delete the index from the concurrent connection list |
| 2295 | * that is present in the given vdev_id. |
| 2296 | * |
| 2297 | * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id |
| 2298 | * iwpriv wlan0 pm_dlist 0 1 |
| 2299 | * |
| 2300 | * Supported Feature: DBS |
| 2301 | * |
| 2302 | * Usage: Internal/External |
| 2303 | * |
| 2304 | * </ioctl> |
| 2305 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2306 | #define WE_POLICY_MANAGER_DLIST_CMD 12 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2307 | |
| 2308 | /* |
| 2309 | * <ioctl> |
| 2310 | * pm_dbs - Set dbs capability and system preference |
| 2311 | * |
| 2312 | * @INPUT: dbs, system_pref |
| 2313 | * @dbs: Value of DBS capability to be set |
| 2314 | * @system_pref: System preference |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2315 | * 0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2316 | * |
| 2317 | * @OUTPUT: None |
| 2318 | * |
| 2319 | * This IOCTL is used to set dbs capability and system preference. |
| 2320 | * |
| 2321 | * @E.g: iwpriv wlan0 pm_dbs dbs system_pref |
| 2322 | * iwpriv wlan0 pm_dbs 1 0 |
| 2323 | * |
| 2324 | * Supported Feature: DBS |
| 2325 | * |
| 2326 | * Usage: Internal/External |
| 2327 | * |
| 2328 | * </ioctl> |
| 2329 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2330 | #define WE_POLICY_MANAGER_DBS_CMD 13 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2331 | |
| 2332 | /* |
| 2333 | * <ioctl> |
| 2334 | * pm_pcl - Set pcl for concurrency mode. |
| 2335 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2336 | * @INPUT: policy_mgr_con_mode |
| 2337 | * @policy_mgr_con_mode: concurrency mode for PCL table |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2338 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2339 | * |
| 2340 | * @OUTPUT: None |
| 2341 | * |
| 2342 | * This IOCTL is used to set pcl for concurrency mode. |
| 2343 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2344 | * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2345 | * iwpriv wlan0 pm_pcl 0 |
| 2346 | * |
| 2347 | * Supported Feature: DBS |
| 2348 | * |
| 2349 | * Usage: Internal/External |
| 2350 | * |
| 2351 | * </ioctl> |
| 2352 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2353 | #define WE_POLICY_MANAGER_PCL_CMD 14 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2354 | |
| 2355 | /* |
| 2356 | * <ioctl> |
| 2357 | * pm_cinfo - Shows the concurrent connection list. |
| 2358 | * |
| 2359 | * @INPUT: None |
| 2360 | * |
| 2361 | * @OUTPUT: None |
| 2362 | * |
| 2363 | * This IOCTL is used to show the concurrent connection list. |
| 2364 | * |
| 2365 | * @E.g: iwpriv wlan0 pm_cinfo |
| 2366 | * |
| 2367 | * Supported Feature: DBS |
| 2368 | * |
| 2369 | * Usage: Internal/External |
| 2370 | * |
| 2371 | * </ioctl> |
| 2372 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2373 | #define WE_POLICY_MANAGER_CINFO_CMD 15 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2374 | |
| 2375 | /* |
| 2376 | * <ioctl> |
| 2377 | * pm_ulist - Updates the index value of the concurrent connection list |
| 2378 | * with the input parameters provided. |
| 2379 | * |
| 2380 | * @INPUT: Following 8 arguments: |
| 2381 | * @vdev_id: vdev id |
| 2382 | * @tx_streams: TX streams |
| 2383 | * @rx_streams: RX streams |
| 2384 | * @chain_mask: Chain mask |
| 2385 | * @type: vdev_type |
| 2386 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2387 | * @sub_type: vdev_subtype |
| 2388 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2389 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2390 | * @channel: Channel |
| 2391 | * @mac: Mac id |
| 2392 | * |
| 2393 | * @OUTPUT: None |
| 2394 | * |
| 2395 | * This IOCTL is used to updates the index value of the concurrent |
| 2396 | * connection list with the input parameters provided. |
| 2397 | * |
| 2398 | * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type |
| 2399 | * sub_type channel mac |
| 2400 | * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1 |
| 2401 | * |
| 2402 | * Supported Feature: DBS |
| 2403 | * |
| 2404 | * Usage: Internal/External |
| 2405 | * |
| 2406 | * </ioctl> |
| 2407 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2408 | #define WE_POLICY_MANAGER_ULIST_CMD 16 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2409 | |
| 2410 | /* |
| 2411 | * <ioctl> |
| 2412 | * pm_query_action - Initiate actions needed on current connections as |
| 2413 | * per the channel provided. |
| 2414 | * |
| 2415 | * @INPUT: channel |
| 2416 | * @channel: Channel on which new connection will be. |
| 2417 | * |
| 2418 | * @OUTPUT: None |
| 2419 | * |
| 2420 | * This IOCTL is used to initiate actions needed on current connections |
| 2421 | * as per the channel provided. |
| 2422 | * |
| 2423 | * @E.g: iwpriv wlan0 pm_query_action channel |
| 2424 | * iwpriv wlan0 pm_query_action 6 |
| 2425 | * |
| 2426 | * Supported Feature: DBS |
| 2427 | * |
| 2428 | * Usage: Internal/External |
| 2429 | * |
| 2430 | * </ioctl> |
| 2431 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2432 | #define WE_POLICY_MANAGER_QUERY_ACTION_CMD 17 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2433 | |
| 2434 | /* |
| 2435 | * <ioctl> |
| 2436 | * pm_query_allow - Checks for allowed concurrency combination |
| 2437 | * |
| 2438 | * @INPUT: mode, channel, bandwidth |
| 2439 | * @mode: new connection mode |
| 2440 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2441 | * @channel: channel on which new connection is coming up |
| 2442 | * @bandwidth: Bandwidth requested by the connection |
| 2443 | * 0:None 1:5MHz 2:10MHz 3:20MHz |
| 2444 | * 4:40MHz 5:80MHz 6:80+80MHz 7:160MHz |
| 2445 | * |
| 2446 | * @OUTPUT: None |
| 2447 | * |
| 2448 | * This IOCTL is used to checks for allowed concurrency combination. |
| 2449 | * |
| 2450 | * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth |
| 2451 | * iwpriv wlan0 pm_query_allow 0 6 4 |
| 2452 | * |
| 2453 | * Supported Feature: DBS |
| 2454 | * |
| 2455 | * Usage: Internal/External |
| 2456 | * |
| 2457 | * </ioctl> |
| 2458 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2459 | #define WE_POLICY_MANAGER_QUERY_ALLOW_CMD 18 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2460 | |
| 2461 | /* |
| 2462 | * <ioctl> |
| 2463 | * pm_run_scenario - Create scenario with number of connections provided. |
| 2464 | * |
| 2465 | * @INPUT: num_of_conn |
| 2466 | * @num_of_conn: the number of connections (values: 1~3) |
| 2467 | * |
| 2468 | * @OUTPUT: None |
| 2469 | * |
| 2470 | * This IOCTL is used to create scenario with the number of connections |
| 2471 | * provided. |
| 2472 | * |
| 2473 | * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn |
| 2474 | * iwpriv wlan0 pm_run_scenario 1 |
| 2475 | * |
| 2476 | * Supported Feature: DBS |
| 2477 | * |
| 2478 | * Usage: Internal/External |
| 2479 | * |
| 2480 | * </ioctl> |
| 2481 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2482 | #define WE_POLICY_MANAGER_SCENARIO_CMD 19 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2483 | |
| 2484 | /* |
| 2485 | * <ioctl> |
| 2486 | * pm_set_hw_mode - Set hardware for single/dual mac. |
| 2487 | * |
| 2488 | * @INPUT: hw_mode |
| 2489 | * 0:single mac 1:dual mac |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 2490 | * 2: 2x2 5g + 1x1 2g dbs mode |
| 2491 | * 3: 2x2 2g + 1x1 5g dbs mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2492 | * |
| 2493 | * @OUTPUT: None |
| 2494 | * |
| 2495 | * This IOCTL is used to set hardware for single/dual mac. |
| 2496 | * |
| 2497 | * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode |
| 2498 | * iwpriv wlan0 pm_set_hw_mode 1 |
| 2499 | * |
| 2500 | * Supported Feature: DBS |
| 2501 | * |
| 2502 | * Usage: Internal/External |
| 2503 | * |
| 2504 | * </ioctl> |
| 2505 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2506 | #define WE_POLICY_SET_HW_MODE_CMD 20 |
| 2507 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2508 | /* |
| 2509 | * <ioctl> |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 2510 | * ch_avoid - unit test SAP channel avoidance |
| 2511 | * |
| 2512 | * @INPUT: chan avoid ranges |
| 2513 | * |
| 2514 | * @OUTPUT: none |
| 2515 | * |
| 2516 | * This IOCTL is used to fake a channel avoidance event. |
| 2517 | * To test SAP/GO chan switch during chan avoid event process. |
| 2518 | * |
| 2519 | * @E.g: iwpriv wlan0 ch_avoid 2452 2462 |
| 2520 | * |
| 2521 | * Supported Feature: SAP chan avoidance. |
| 2522 | * |
| 2523 | * Usage: Internal |
| 2524 | * |
| 2525 | * </ioctl> |
| 2526 | */ |
| 2527 | #define WE_SET_CHAN_AVOID 21 |
| 2528 | |
| 2529 | /* |
| 2530 | * <ioctl> |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2531 | * set_scan_cfg - Set dual MAC scan config parameters. |
| 2532 | * |
| 2533 | * @INPUT: dbs, dbs_plus_agile_scan, single_mac_scan_with_dbs |
| 2534 | * @dbs: Value of DBS bit |
| 2535 | * @dbs_plus_agile_scan: Value of DBS plus agile scan bit |
| 2536 | * @single_mac_scan_with_dbs: Value of Single MAC scan with DBS |
| 2537 | * |
| 2538 | * @OUTPUT: None |
| 2539 | * |
| 2540 | * This IOCTL is used to set the dual MAC scan config. |
| 2541 | * |
| 2542 | * @E.g: iwpriv wlan0 set_scan_cfg dbs dbs_plus_agile_scan |
| 2543 | * single_mac_scan_with_dbs |
| 2544 | * iwpriv wlan0 set_scan_cfg 1 0 1 |
| 2545 | * |
| 2546 | * Supported Feature: DBS |
| 2547 | * |
| 2548 | * Usage: Internal/External |
| 2549 | * |
| 2550 | * </ioctl> |
| 2551 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2552 | #define WE_SET_DUAL_MAC_SCAN_CONFIG 21 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2553 | |
| 2554 | /* |
| 2555 | * <ioctl> |
| 2556 | * set_fw_mode_cfg - Sets the dual mac FW mode config |
| 2557 | * |
| 2558 | * @INPUT: dbs, dfs |
| 2559 | * @dbs: DBS bit |
| 2560 | * @dfs: Agile DFS bit |
| 2561 | * |
| 2562 | * @OUTPUT: None |
| 2563 | * |
| 2564 | * This IOCTL is used to set the dual mac FW mode config. |
| 2565 | * |
| 2566 | * @E.g: iwpriv wlan0 set_fw_mode_cfg dbs dfs |
| 2567 | * iwpriv wlan0 set_fw_mode_cfg 1 1 |
| 2568 | * |
| 2569 | * Supported Feature: DBS |
| 2570 | * |
| 2571 | * Usage: Internal/External |
| 2572 | * |
| 2573 | * </ioctl> |
| 2574 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2575 | #define WE_SET_DUAL_MAC_FW_MODE_CONFIG 22 |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 2576 | #define WE_SET_MON_MODE_CHAN 23 |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 2577 | /* |
| 2578 | * <ioctl> |
| 2579 | * txrx_stats - TXRX statistics query |
| 2580 | * |
| 2581 | * @INPUT: query category, mac id (default mac id is 0) |
| 2582 | * |
| 2583 | * @OUTPUT: TXRX statistics result |
| 2584 | * |
| 2585 | * This IOCTL is used to get TXRX statistics counters. |
| 2586 | * |
| 2587 | * @E.g: iwpriv wlan0 txrx_stats 21 0 |
| 2588 | * iwpriv wlan0 txrx_stats 21 1 |
| 2589 | * |
| 2590 | * Usage: Internal |
| 2591 | * |
| 2592 | * </ioctl> |
| 2593 | */ |
| 2594 | #define WE_SET_TXRX_STATS 24 |
| 2595 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2596 | |
| 2597 | #ifdef FEATURE_WLAN_TDLS |
| 2598 | #undef MAX_VAR_ARGS |
| 2599 | #define MAX_VAR_ARGS 11 |
| 2600 | #else |
| 2601 | #undef MAX_VAR_ARGS |
| 2602 | #define MAX_VAR_ARGS 9 |
| 2603 | #endif |
| 2604 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2605 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 2606 | #undef MAX_VAR_ARGS |
| 2607 | #define MAX_VAR_ARGS 15 |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2608 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2609 | #define WE_MOTION_DET_CONFIG_PARAM 25 |
| 2610 | #define WE_MOTION_DET_BASE_LINE_CONFIG_PARAM 26 |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 2611 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 2612 | #define WE_SET_THERMAL_THROTTLE_CFG 27 |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 2613 | /* |
| 2614 | * <ioctl> |
| 2615 | * fips_test - Perform a FIPS test |
| 2616 | * |
| 2617 | * @INPUT: Binary representation of the following packed structure |
| 2618 | * |
| 2619 | * @OUTPUT: Binary representation of the following packed structure |
| 2620 | * |
| 2621 | * This IOCTL is used to perform FIPS certification testing |
| 2622 | * |
| 2623 | * @E.g: iwpriv wlan0 fips_test <test vector> |
| 2624 | * |
| 2625 | * iwpriv wlan0 fips_test <tbd> |
| 2626 | * |
| 2627 | * Supported Feature: FIPS |
| 2628 | * |
| 2629 | * Usage: Internal |
| 2630 | * |
| 2631 | * </ioctl> |
| 2632 | */ |
| 2633 | #define WLAN_PRIV_FIPS_TEST (SIOCIWFIRSTPRIV + 8) |
| 2634 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2635 | /* Private ioctls (with no sub-ioctls) */ |
| 2636 | /* note that they must be odd so that they have "get" semantics */ |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2637 | /* |
| 2638 | * <ioctl> |
| 2639 | * addTspec - Add TSPEC for each AC |
| 2640 | * |
| 2641 | * @INPUT: 19 TSPEC params |
| 2642 | * @[arg0]: handle |
| 2643 | * @[arg1]: tid |
| 2644 | * @[arg2]: dir |
| 2645 | * @[arg3]: psb |
| 2646 | * @[arg4]: up |
| 2647 | * @[arg5]: nomMsduSize |
| 2648 | * @[arg6]: maxMsduSize |
| 2649 | * @[arg7]: minDataRate |
| 2650 | * @[arg8]: meanDataRate |
| 2651 | * @[arg9]: peakDataRate |
| 2652 | * @[arg10]: maxBurstSize |
| 2653 | * @[arg11]: minPhyRate |
| 2654 | * @[arg12]: sba |
| 2655 | * @[arg13]: minServiceIntv |
| 2656 | * @[arg14]: suspendIntv |
| 2657 | * @[arg15]: burstSizeDefn |
| 2658 | * @[arg16]: ackPolicy |
| 2659 | * @[arg17]: inactivityPeriod |
| 2660 | * @[arg18]: maxServiceIntv |
| 2661 | * |
| 2662 | * @OUTPUT: Success/Failure |
| 2663 | * |
| 2664 | * This IOCTL is used to add TSPEC for each AC. |
| 2665 | * |
| 2666 | * @E.g: iwpriv wlan0 addTspec <handle> <tid> <dir> <psb> <up> <nomMsduSize> |
| 2667 | * <maxMsduSize> <minDataRate> <meanDataRate> |
| 2668 | * <peakDataRate> <maxBurstSize> <minPhyRate> |
| 2669 | * <sba> <minServiceIntv> <suspendIntv> |
| 2670 | * <burstSizeDefn> <ackPolicy> <inactivityPeriod> |
| 2671 | * <maxServiceIntv> |
| 2672 | * iwpriv wlan0 addTspec 7001 6 2 1 6 0x80D0 0x80D0 0x14500 0x14500 0x14500 |
| 2673 | * 0 0x5B8D80 0x2001 20 2000 0 0 0 2000 |
| 2674 | * wlan0 addTspec:3 |
| 2675 | * |
| 2676 | * Supported Feature: WMM |
| 2677 | * |
| 2678 | * Usage: Internal/External |
| 2679 | * |
| 2680 | * </ioctl> |
| 2681 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2682 | #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2683 | /* |
| 2684 | * <ioctl> |
| 2685 | * delTspec - Delete TSPEC entry for each AC |
| 2686 | * |
| 2687 | * @INPUT: 1 TSPEC param |
| 2688 | * @[arg0]: handle |
| 2689 | * |
| 2690 | * @OUTPUT: Success/Failure |
| 2691 | * |
| 2692 | * This IOCTL is used to delete TSPEC entry for each AC. |
| 2693 | * |
| 2694 | * @E.g: iwpriv wlan0 delTspec <handle> |
| 2695 | * iwpriv wlan0 delTspec 7001 |
| 2696 | * wlan0 delTspec:16 |
| 2697 | * |
| 2698 | * Supported Feature: WMM |
| 2699 | * |
| 2700 | * Usage: Internal/External |
| 2701 | * |
| 2702 | * </ioctl> |
| 2703 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2704 | #define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2705 | /* |
| 2706 | * <ioctl> |
| 2707 | * getTspec - Get TSPEC entry for each AC |
| 2708 | * |
| 2709 | * @INPUT: 1 TSPEC param |
| 2710 | * @[arg0]: handle |
| 2711 | * |
| 2712 | * @OUTPUT: Success/Failure |
| 2713 | * |
| 2714 | * This IOCTL is used to get TSPEC entry for each AC. |
| 2715 | * |
| 2716 | * @E.g: iwpriv wlan0 getTspec <handle> |
| 2717 | * iwpriv wlan0 getTspec 7001 |
| 2718 | * wlan0 delTspec:18 |
| 2719 | * |
| 2720 | * Supported Feature: WMM |
| 2721 | * |
| 2722 | * Usage: Internal/External |
| 2723 | * |
| 2724 | * </ioctl> |
| 2725 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2726 | #define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13) |
| 2727 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2728 | /* (SIOCIWFIRSTPRIV + 10) is currently unused */ |
| 2729 | /* (SIOCIWFIRSTPRIV + 12) is currently unused */ |
| 2730 | /* (SIOCIWFIRSTPRIV + 14) is currently unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 2731 | #define WLAN_PRIV_SET_NONE_GET_THREE_INT (SIOCIWFIRSTPRIV + 15) |
| 2732 | #define WE_GET_TSF 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2733 | /* (SIOCIWFIRSTPRIV + 16) is currently unused */ |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 2734 | |
| 2735 | #ifdef FEATURE_WLM_STATS |
| 2736 | /* |
| 2737 | * <ioctl> |
| 2738 | * |
| 2739 | * get_wlm_stats - Get stats from FW for game latency |
| 2740 | * |
| 2741 | * @INPUT: BITMASK inform of decimal number |
| 2742 | * |
| 2743 | * @OUTPUT: HEX string given by FW |
| 2744 | * |
| 2745 | * This IOCTL is used to get game latency related STATS from FW |
| 2746 | * |
| 2747 | * @E.g.: iwpriv wlan0 get_wlm_stats 1 |
| 2748 | * |
| 2749 | * Usage: internal |
| 2750 | * |
| 2751 | * </ioctl> |
| 2752 | */ |
| 2753 | #define WLAN_GET_WLM_STATS (SIOCIWFIRSTPRIV + 17) |
| 2754 | #endif |
| 2755 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2756 | /* (SIOCIWFIRSTPRIV + 19) is currently unused */ |
| 2757 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2758 | #define WLAN_PRIV_SET_FTIES (SIOCIWFIRSTPRIV + 20) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2759 | |
| 2760 | /* Private ioctl for setting the host offload feature */ |
| 2761 | #define WLAN_PRIV_SET_HOST_OFFLOAD (SIOCIWFIRSTPRIV + 18) |
| 2762 | |
| 2763 | /* Private ioctl to get the statistics */ |
| 2764 | #define WLAN_GET_WLAN_STATISTICS (SIOCIWFIRSTPRIV + 21) |
| 2765 | |
| 2766 | /* Private ioctl to set the Keep Alive Params */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2767 | /* |
| 2768 | * <ioctl> |
| 2769 | * setKeepAlive - Set the keep alive feature |
| 2770 | * |
| 2771 | * @INPUT: 28 bytes of information in the order of packet type, time period |
| 2772 | * host IPv4 address, destination IPv4 address, destination MAC address, bssID |
| 2773 | * |
| 2774 | * @OUTPUT: None |
| 2775 | * |
| 2776 | * This IOCTL sets the keep alive feature to send either NULL |
| 2777 | * or unsolicited ARP response packets |
| 2778 | * |
| 2779 | * @E.g: iwpriv wlan0 setKeepAlive |
| 2780 | * |
| 2781 | * Supported Feature: STA |
| 2782 | * |
| 2783 | * Usage: Internal/External |
| 2784 | * |
| 2785 | * </ioctl> |
| 2786 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2787 | #define WLAN_SET_KEEPALIVE_PARAMS (SIOCIWFIRSTPRIV + 22) |
| 2788 | |
| 2789 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2790 | /* Private ioctl to set the packet filtering params */ |
| 2791 | #define WLAN_SET_PACKET_FILTER_PARAMS (SIOCIWFIRSTPRIV + 23) |
| 2792 | #endif |
| 2793 | |
| 2794 | |
| 2795 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2796 | /* Private ioctl to get the statistics */ |
| 2797 | #define WLAN_SET_PNO (SIOCIWFIRSTPRIV + 24) |
| 2798 | #endif |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2799 | /* |
| 2800 | * <ioctl> |
| 2801 | * SETBAND - Set the operational band |
| 2802 | * |
| 2803 | * @INPUT: 0 to Auto, 1 to 5 GHz and 2 to 2.4 GHz |
| 2804 | * |
| 2805 | * @OUTPUT: None |
| 2806 | * |
| 2807 | * This IOCTL Set the operational band If the new band is different from the |
| 2808 | * current operational band, it aborts the pending scan requests, flushes |
| 2809 | * the existing scan results, and then change * the band capability |
| 2810 | * |
| 2811 | * @E.g: iwpriv wlan0 SETBAND <value> |
| 2812 | * |
| 2813 | * Supported Feature: STA |
| 2814 | * |
| 2815 | * Usage: Internal/External |
| 2816 | * |
| 2817 | * </ioctl> |
| 2818 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2819 | #define WLAN_SET_BAND_CONFIG (SIOCIWFIRSTPRIV + 25) |
| 2820 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 2821 | #define WLAN_PRIV_SET_MCBC_FILTER (SIOCIWFIRSTPRIV + 26) |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 2822 | /* (SIOCIWFIRSTPRIV + 27) is currently unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2823 | |
| 2824 | /* Private ioctls and their sub-ioctls */ |
| 2825 | #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 2826 | #define WE_SET_SMPS_PARAM 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2827 | #define WE_SET_FW_CRASH_INJECT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2828 | #define WE_DUMP_DP_TRACE_LEVEL 3 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2829 | /* Private sub ioctl for enabling and setting histogram interval of profiling */ |
| 2830 | #define WE_ENABLE_FW_PROFILE 4 |
| 2831 | #define WE_SET_FW_PROFILE_HIST_INTVL 5 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2832 | |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 2833 | /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2834 | #define WE_SET_WLAN_SUSPEND 6 |
| 2835 | #define WE_SET_WLAN_RESUME 7 |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2836 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2837 | /* |
| 2838 | * <ioctl> |
| 2839 | * log_buffer - prints host/target related communication logs via dmesg |
| 2840 | * |
| 2841 | * @INPUT: Log Id, Count |
| 2842 | * |
| 2843 | * Log Id: |
| 2844 | * 0) HTC_CREDIT_HISTORY_LOG |
| 2845 | * 1) COMMAND_LOG, |
| 2846 | * 2) COMMAND_TX_CMP_LOG, |
| 2847 | * 3) MGMT_COMMAND_LOG, |
| 2848 | * 4) MGMT_COMMAND_TX_CMP_LOG, |
| 2849 | * 5) EVENT_LOG, |
| 2850 | * 6) RX_EVENT_LOG, |
| 2851 | * 7) MGMT_EVENT_LOG |
| 2852 | * |
| 2853 | * @OUTPUT: None |
| 2854 | * |
| 2855 | * @E.g: |
| 2856 | * # print up to 10 of the most recent records from HTC Credit History |
| 2857 | * iwpriv wlan0 log_buffer 0 10 |
| 2858 | * # print up to 3 of the most recent records from Event Log |
| 2859 | * iwpriv wlan0 log_buffer 5 3 |
| 2860 | * |
| 2861 | * Supported Feature: WLAN Trace |
| 2862 | * |
| 2863 | * Usage: Internal/External |
| 2864 | * |
| 2865 | * </ioctl> |
| 2866 | */ |
| 2867 | #define WE_LOG_BUFFER 8 |
| 2868 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 2869 | /* |
| 2870 | * <ioctl> |
| 2871 | * set_ba_timeout - sets Block ACK aging timeout value for each Access class |
| 2872 | * |
| 2873 | * @INPUT: Access Class [0:BK, 1:BE, 2:VI, 3:VO], Timeout value |
| 2874 | * |
| 2875 | * @OUTPUT: None |
| 2876 | * |
| 2877 | * @E.g.: |
| 2878 | * # to set duration of 2 seconds for BE |
| 2879 | * iwpriv wlan0 set_ba_timeout 1 2 |
| 2880 | * # to set duration of 3 seconds for VO |
| 2881 | * iwpriv wlan0 set_ba_timeout 3 3 |
| 2882 | * |
| 2883 | * Usage: Internal |
| 2884 | * |
| 2885 | * </ioctl> |
| 2886 | */ |
| 2887 | #define WE_SET_BA_AGEING_TIMEOUT 9 |
| 2888 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2889 | enum host_target_comm_log { |
| 2890 | HTC_CREDIT_HISTORY_LOG = 0, |
| 2891 | COMMAND_LOG, |
| 2892 | COMMAND_TX_CMP_LOG, |
| 2893 | MGMT_COMMAND_LOG, |
| 2894 | MGMT_COMMAND_TX_CMP_LOG, |
| 2895 | EVENT_LOG, |
| 2896 | RX_EVENT_LOG, |
| 2897 | MGMT_EVENT_LOG |
| 2898 | }; |
| 2899 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2900 | /* (SIOCIWFIRSTPRIV + 29) is currently unused */ |
| 2901 | |
| 2902 | /* 802.11p IOCTL */ |
| 2903 | #define WLAN_SET_DOT11P_CHANNEL_SCHED (SIOCIWFIRSTPRIV + 30) |
| 2904 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2905 | /* |
| 2906 | * <ioctl> |
| 2907 | * getLinkSpeed - Gets the current link speed in Mbps |
| 2908 | * |
| 2909 | * @INPUT: None |
| 2910 | * |
| 2911 | * @OUTPUT: linkspeed in mbps |
| 2912 | * wlan0 getLinkSpeed:7 |
| 2913 | * |
| 2914 | * This IOCTL is used get the current link speed in Mbps |
| 2915 | * |
| 2916 | * @E.g: iwpriv wlan0 getLinkSpeed |
| 2917 | * |
| 2918 | * Supported Feature: STA |
| 2919 | * |
| 2920 | * Usage: Internal/External |
| 2921 | * |
| 2922 | * </ioctl> |
| 2923 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2924 | #define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 2925 | |
| 2926 | #define WLAN_STATS_INVALID 0 |
| 2927 | #define WLAN_STATS_RETRY_CNT 1 |
| 2928 | #define WLAN_STATS_MUL_RETRY_CNT 2 |
| 2929 | #define WLAN_STATS_TX_FRM_CNT 3 |
| 2930 | #define WLAN_STATS_RX_FRM_CNT 4 |
| 2931 | #define WLAN_STATS_FRM_DUP_CNT 5 |
| 2932 | #define WLAN_STATS_FAIL_CNT 6 |
| 2933 | #define WLAN_STATS_RTS_FAIL_CNT 7 |
| 2934 | #define WLAN_STATS_ACK_FAIL_CNT 8 |
| 2935 | #define WLAN_STATS_RTS_SUC_CNT 9 |
| 2936 | #define WLAN_STATS_RX_DISCARD_CNT 10 |
| 2937 | #define WLAN_STATS_RX_ERROR_CNT 11 |
| 2938 | #define WLAN_STATS_TX_BYTE_CNT 12 |
| 2939 | |
| 2940 | #define WLAN_STATS_RX_BYTE_CNT 13 |
| 2941 | #define WLAN_STATS_RX_RATE 14 |
| 2942 | #define WLAN_STATS_TX_RATE 15 |
| 2943 | |
| 2944 | #define WLAN_STATS_RX_UC_BYTE_CNT 16 |
| 2945 | #define WLAN_STATS_RX_MC_BYTE_CNT 17 |
| 2946 | #define WLAN_STATS_RX_BC_BYTE_CNT 18 |
| 2947 | #define WLAN_STATS_TX_UC_BYTE_CNT 19 |
| 2948 | #define WLAN_STATS_TX_MC_BYTE_CNT 20 |
| 2949 | #define WLAN_STATS_TX_BC_BYTE_CNT 21 |
| 2950 | |
| 2951 | #define FILL_TLV(__p, __type, __size, __val, __tlen) do { \ |
| 2952 | if ((__tlen + __size + 2) < WE_MAX_STR_LEN) { \ |
| 2953 | *__p++ = __type; \ |
| 2954 | *__p++ = __size; \ |
| 2955 | memcpy(__p, __val, __size); \ |
| 2956 | __p += __size; \ |
| 2957 | __tlen += __size + 2; \ |
| 2958 | } else { \ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2959 | hdd_err("FILL_TLV Failed!!!"); \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2960 | } \ |
| 2961 | } while (0) |
| 2962 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2963 | #define TX_PER_TRACKING_DEFAULT_RATIO 5 |
| 2964 | #define TX_PER_TRACKING_MAX_RATIO 10 |
| 2965 | #define TX_PER_TRACKING_DEFAULT_WATERMARK 5 |
| 2966 | |
| 2967 | #define WLAN_ADAPTER 0 |
| 2968 | #define P2P_ADAPTER 1 |
| 2969 | |
| 2970 | /** |
| 2971 | * mem_alloc_copy_from_user_helper - copy from user helper |
| 2972 | * @wrqu_data: wireless extensions request data |
| 2973 | * @len: length of @wrqu_data |
| 2974 | * |
| 2975 | * Helper function to allocate buffer and copy user data. |
| 2976 | * |
| 2977 | * Return: On success return a pointer to a kernel buffer containing a |
| 2978 | * copy of the userspace data (with an additional NUL character |
| 2979 | * appended for safety). On failure return %NULL. |
| 2980 | */ |
| 2981 | void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len) |
| 2982 | { |
| 2983 | u8 *ptr = NULL; |
| 2984 | |
| 2985 | /* in order to protect the code, an extra byte is post |
| 2986 | * appended to the buffer and the null termination is added. |
| 2987 | * However, when allocating (len+1) byte of memory, we need to |
| 2988 | * make sure that there is no uint overflow when doing |
| 2989 | * addition. In theory check len < UINT_MAX protects the uint |
| 2990 | * overflow. For wlan private ioctl, the buffer size is much |
| 2991 | * less than UINT_MAX, as a good guess, now, it is assumed |
| 2992 | * that the private command buffer size is no greater than 4K |
| 2993 | * (4096 bytes). So we use 4096 as the upper boundary for now. |
| 2994 | */ |
| 2995 | if (len > MAX_USER_COMMAND_SIZE) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 2996 | hdd_err("Invalid length: %zu max: %u", |
| 2997 | len, MAX_USER_COMMAND_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2998 | return NULL; |
| 2999 | } |
| 3000 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 3001 | ptr = qdf_mem_malloc(len + 1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3002 | if (NULL == ptr) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3003 | hdd_err("unable to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3004 | return NULL; |
| 3005 | } |
| 3006 | |
| 3007 | if (copy_from_user(ptr, wrqu_data, len)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3008 | hdd_err("failed to copy data to user buffer"); |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 3009 | qdf_mem_free(ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3010 | return NULL; |
| 3011 | } |
| 3012 | ptr[len] = '\0'; |
| 3013 | return ptr; |
| 3014 | } |
| 3015 | |
| 3016 | /** |
| 3017 | * hdd_priv_get_data() - Get pointer to ioctl private data |
| 3018 | * @p_priv_data: pointer to iw_point struct to be filled |
| 3019 | * @wrqu: Pointer to IOCTL Data received from userspace |
| 3020 | * |
| 3021 | * Helper function to get compatible struct iw_point passed to ioctl |
| 3022 | * |
| 3023 | * Return - 0 if p_priv_data successfully filled, error otherwise |
| 3024 | */ |
| 3025 | int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) |
| 3026 | { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3027 | if ((NULL == p_priv_data) || (NULL == wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3028 | return -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3029 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3030 | #ifdef CONFIG_COMPAT |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 3031 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3032 | struct compat_iw_point *p_compat_priv_data; |
| 3033 | |
| 3034 | /* Compat task: |
| 3035 | * typecast to compat structure and copy the members. |
| 3036 | */ |
| 3037 | p_compat_priv_data = (struct compat_iw_point *)&wrqu->data; |
| 3038 | |
| 3039 | p_priv_data->pointer = compat_ptr(p_compat_priv_data->pointer); |
| 3040 | p_priv_data->length = p_compat_priv_data->length; |
| 3041 | p_priv_data->flags = p_compat_priv_data->flags; |
| 3042 | } else { |
| 3043 | #endif /* #ifdef CONFIG_COMPAT */ |
| 3044 | |
| 3045 | /* Non compat task: directly copy the structure. */ |
| 3046 | memcpy(p_priv_data, &wrqu->data, sizeof(struct iw_point)); |
| 3047 | |
| 3048 | #ifdef CONFIG_COMPAT |
| 3049 | } |
| 3050 | #endif /* #ifdef CONFIG_COMPAT */ |
| 3051 | |
| 3052 | return 0; |
| 3053 | } |
| 3054 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3055 | static int hdd_check_wext_control(enum hdd_wext_control wext_control, |
| 3056 | struct iw_request_info *info) |
| 3057 | { |
| 3058 | switch (wext_control) { |
| 3059 | default: |
| 3060 | case hdd_wext_disabled: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 3061 | hdd_err_rl("Rejecting disabled ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3062 | return -ENOTSUPP; |
| 3063 | case hdd_wext_deprecated: |
Jeff Johnson | b135c66 | 2018-10-12 12:24:07 -0700 | [diff] [blame] | 3064 | hdd_warn_rl("Using deprecated ioctl %x", info->cmd); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3065 | return 0; |
| 3066 | case hdd_wext_enabled: |
| 3067 | return 0; |
| 3068 | } |
| 3069 | } |
| 3070 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 3071 | int hdd_check_private_wext_control(struct hdd_context *hdd_ctx, |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3072 | struct iw_request_info *info) |
| 3073 | { |
| 3074 | return hdd_check_wext_control(hdd_ctx->config->private_wext_control, |
| 3075 | info); |
| 3076 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3077 | |
| 3078 | /** |
| 3079 | * hdd_wlan_get_stats() - Get txrx stats in SAP mode |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3080 | * @adapter: Pointer to the hdd adapter. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3081 | * @length: Size of the data copied |
| 3082 | * @buffer: Pointer to char buffer. |
| 3083 | * @buf_len: Length of the char buffer. |
| 3084 | * |
| 3085 | * This function called when the "iwpriv wlan0 get_stats" command is given. |
| 3086 | * It used to collect the txrx stats when the device is configured in SAP mode. |
| 3087 | * |
| 3088 | * Return - none |
| 3089 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3090 | void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3091 | char *buffer, uint16_t buf_len) |
| 3092 | { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3093 | struct hdd_tx_rx_stats *stats = &adapter->hdd_stats.tx_rx_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3094 | uint32_t len = 0; |
| 3095 | uint32_t total_rx_pkt = 0, total_rx_dropped = 0; |
| 3096 | uint32_t total_rx_delv = 0, total_rx_refused = 0; |
| 3097 | int i = 0; |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3098 | struct hdd_context *hdd_ctx = adapter->hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3099 | |
| 3100 | for (; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3101 | total_rx_pkt += stats->rx_packets[i]; |
| 3102 | total_rx_dropped += stats->rx_dropped[i]; |
| 3103 | total_rx_delv += stats->rx_delivered[i]; |
| 3104 | total_rx_refused += stats->rx_refused[i]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3105 | } |
| 3106 | |
| 3107 | len = scnprintf(buffer, buf_len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3108 | "\nTransmit[%lu] - " |
| 3109 | "called %u, dropped %u orphan %u," |
| 3110 | "\n[dropped] BK %u, BE %u, VI %u, VO %u" |
| 3111 | "\n[classified] BK %u, BE %u, VI %u, VO %u" |
| 3112 | "\n\nReceive[%lu] - " |
Manjunathappa Prakash | f39d237 | 2019-02-25 18:18:57 -0800 | [diff] [blame] | 3113 | "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] | 3114 | "GRO - agg %u non-agg %u flushes(%u %u) disabled(conc %u low-tput %u)\n", |
| 3115 | qdf_system_ticks(), |
| 3116 | stats->tx_called, |
| 3117 | stats->tx_dropped, |
| 3118 | stats->tx_orphaned, |
| 3119 | stats->tx_dropped_ac[SME_AC_BK], |
| 3120 | stats->tx_dropped_ac[SME_AC_BE], |
| 3121 | stats->tx_dropped_ac[SME_AC_VI], |
| 3122 | stats->tx_dropped_ac[SME_AC_VO], |
| 3123 | stats->tx_classified_ac[SME_AC_BK], |
| 3124 | stats->tx_classified_ac[SME_AC_BE], |
| 3125 | stats->tx_classified_ac[SME_AC_VI], |
| 3126 | stats->tx_classified_ac[SME_AC_VO], |
| 3127 | qdf_system_ticks(), |
Manjunathappa Prakash | f39d237 | 2019-02-25 18:18:57 -0800 | [diff] [blame] | 3128 | total_rx_pkt, total_rx_dropped, |
| 3129 | qdf_atomic_read(&stats->rx_usolict_arp_n_mcast_drp), |
| 3130 | total_rx_delv, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3131 | total_rx_refused, |
| 3132 | stats->rx_aggregated, stats->rx_non_aggregated, |
| 3133 | stats->rx_gro_flushes, |
| 3134 | stats->rx_gro_force_flushes, |
| 3135 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_concurrency), |
| 3136 | qdf_atomic_read(&hdd_ctx->disable_rx_ol_in_low_tput)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3137 | |
| 3138 | for (i = 0; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3139 | if (stats->rx_packets[i] == 0) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3140 | continue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3141 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 8141877 | 2018-10-30 14:14:46 -0700 | [diff] [blame] | 3142 | "Rx CPU[%d]:" |
| 3143 | "packets %u, dropped %u, delivered %u, refused %u\n", |
| 3144 | i, stats->rx_packets[i], stats->rx_dropped[i], |
| 3145 | stats->rx_delivered[i], stats->rx_refused[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3146 | } |
| 3147 | |
| 3148 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3149 | "\nTX_FLOW" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3150 | "\nCurrent status: %s" |
| 3151 | "\ntx-flow timer start count %u" |
| 3152 | "\npause count %u, unpause count %u", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3153 | (stats->is_txflow_paused == true ? "PAUSED" : "UNPAUSED"), |
| 3154 | stats->txflow_timer_cnt, |
| 3155 | stats->txflow_pause_cnt, |
| 3156 | stats->txflow_unpause_cnt); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3157 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 3158 | len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3159 | adapter->vdev_id, &buffer[len], (buf_len - len)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3160 | *length = len + 1; |
| 3161 | } |
| 3162 | |
| 3163 | /** |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3164 | * wlan_hdd_write_suspend_resume_stats() - Writes suspend/resume stats to buffer |
| 3165 | * @hdd_ctx: The Hdd context owning the stats to be written |
| 3166 | * @buffer: The char buffer to write to |
| 3167 | * @max_len: The maximum number of chars to write |
| 3168 | * |
| 3169 | * This assumes hdd_ctx has already been validated, and buffer is not NULL. |
| 3170 | * |
| 3171 | * Return - length of written content, negative number on error |
| 3172 | */ |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3173 | #ifdef QCA_SUPPORT_CP_STATS |
| 3174 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
| 3175 | char *buffer, uint16_t max_len) |
| 3176 | { |
| 3177 | int ret; |
| 3178 | QDF_STATUS status; |
| 3179 | struct suspend_resume_stats *sr_stats; |
| 3180 | |
| 3181 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3182 | ret = scnprintf(buffer, max_len, |
| 3183 | "\n" |
| 3184 | "Suspends: %u\n" |
| 3185 | "Resumes: %u\n" |
| 3186 | "\n" |
| 3187 | "Suspend Fail Reasons\n" |
| 3188 | "\tIPA: %u\n" |
| 3189 | "\tRadar: %u\n" |
| 3190 | "\tRoam: %u\n" |
| 3191 | "\tScan: %u\n" |
| 3192 | "\tInitial Wakeup: %u\n" |
| 3193 | "\n", |
| 3194 | sr_stats->suspends, sr_stats->resumes, |
| 3195 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3196 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3197 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3198 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3199 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]); |
| 3200 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3201 | status = ucfg_mc_cp_stats_write_wow_stats(hdd_ctx->psoc, |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3202 | &buffer[ret], max_len - ret, |
| 3203 | &ret); |
| 3204 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3205 | hdd_err("Failed to get WoW stats"); |
| 3206 | return qdf_status_to_os_return(status); |
| 3207 | } |
| 3208 | |
| 3209 | return ret; |
| 3210 | } |
| 3211 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3212 | 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] | 3213 | char *buffer, uint16_t max_len) |
| 3214 | { |
| 3215 | QDF_STATUS status; |
| 3216 | struct suspend_resume_stats *sr_stats; |
| 3217 | struct sir_wake_lock_stats wow_stats; |
| 3218 | |
| 3219 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3220 | |
| 3221 | status = wma_get_wakelock_stats(&wow_stats); |
| 3222 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3223 | hdd_err("Failed to get WoW stats"); |
| 3224 | return qdf_status_to_os_return(status); |
| 3225 | } |
| 3226 | |
| 3227 | return scnprintf(buffer, max_len, |
| 3228 | "\n" |
| 3229 | "Suspends: %u\n" |
| 3230 | "Resumes: %u\n" |
| 3231 | "\n" |
| 3232 | "Suspend Fail Reasons\n" |
| 3233 | "\tIPA: %u\n" |
| 3234 | "\tRadar: %u\n" |
| 3235 | "\tRoam: %u\n" |
| 3236 | "\tScan: %u\n" |
| 3237 | "\tInitial Wakeup: %u\n" |
| 3238 | "\n" |
| 3239 | "WoW Wake Reasons\n" |
| 3240 | "\tunicast: %u\n" |
| 3241 | "\tbroadcast: %u\n" |
| 3242 | "\tIPv4 multicast: %u\n" |
| 3243 | "\tIPv6 multicast: %u\n" |
| 3244 | "\tIPv6 multicast RA: %u\n" |
| 3245 | "\tIPv6 multicast NS: %u\n" |
| 3246 | "\tIPv6 multicast NA: %u\n" |
| 3247 | "\tICMPv4: %u\n" |
| 3248 | "\tICMPv6: %u\n" |
| 3249 | "\tRSSI Breach: %u\n" |
| 3250 | "\tLow RSSI: %u\n" |
| 3251 | "\tG-Scan: %u\n" |
| 3252 | "\tPNO Complete: %u\n" |
| 3253 | "\tPNO Match: %u\n", |
| 3254 | sr_stats->suspends, |
| 3255 | sr_stats->resumes, |
| 3256 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3257 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3258 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3259 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3260 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP], |
| 3261 | wow_stats.wow_ucast_wake_up_count, |
| 3262 | wow_stats.wow_bcast_wake_up_count, |
| 3263 | wow_stats.wow_ipv4_mcast_wake_up_count, |
| 3264 | wow_stats.wow_ipv6_mcast_wake_up_count, |
| 3265 | wow_stats.wow_ipv6_mcast_ra_stats, |
| 3266 | wow_stats.wow_ipv6_mcast_ns_stats, |
| 3267 | wow_stats.wow_ipv6_mcast_na_stats, |
| 3268 | wow_stats.wow_icmpv4_count, |
| 3269 | wow_stats.wow_icmpv6_count, |
| 3270 | wow_stats.wow_rssi_breach_wake_up_count, |
| 3271 | wow_stats.wow_low_rssi_wake_up_count, |
| 3272 | wow_stats.wow_gscan_wake_up_count, |
| 3273 | wow_stats.wow_pno_complete_wake_up_count, |
| 3274 | wow_stats.wow_pno_match_wake_up_count); |
| 3275 | } |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3276 | #endif |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3277 | /** |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3278 | * hdd_wlan_list_fw_profile() - Get fw profiling points |
| 3279 | * @length: Size of the data copied |
| 3280 | * @buffer: Pointer to char buffer. |
| 3281 | * @buf_len: Length of the char buffer. |
| 3282 | * |
| 3283 | * This function called when the "iwpriv wlan0 listProfile" command is given. |
| 3284 | * It is used to get the supported profiling points in FW. |
| 3285 | * |
| 3286 | * Return - none |
| 3287 | */ |
| 3288 | void hdd_wlan_list_fw_profile(uint16_t *length, |
| 3289 | char *buffer, uint16_t buf_len) |
| 3290 | { |
| 3291 | uint32_t len = 0; |
| 3292 | |
| 3293 | len = scnprintf(buffer, buf_len, |
| 3294 | "PROF_CPU_IDLE: %u\n" |
| 3295 | "PROF_PPDU_PROC: %u\n" |
| 3296 | "PROF_PPDU_POST: %u\n" |
| 3297 | "PROF_HTT_TX_INPUT: %u\n" |
| 3298 | "PROF_MSDU_ENQ: %u\n" |
| 3299 | "PROF_PPDU_POST_HAL: %u\n" |
| 3300 | "PROF_COMPUTE_TX_TIME: %u\n", |
| 3301 | PROF_CPU_IDLE, |
| 3302 | PROF_PPDU_PROC, |
| 3303 | PROF_PPDU_POST, |
| 3304 | PROF_HTT_TX_INPUT, |
| 3305 | PROF_MSDU_ENQ, |
| 3306 | PROF_PPDU_POST_HAL, |
| 3307 | PROF_COMPUTE_TX_TIME); |
| 3308 | |
| 3309 | *length = len + 1; |
| 3310 | } |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3311 | |
| 3312 | #define HDD_DUMP_STAT_HELP(STAT_ID) \ |
| 3313 | hdd_nofl_info("%u -- %s", STAT_ID, (# STAT_ID)) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3314 | /** |
| 3315 | * hdd_display_stats_help() - print statistics help |
| 3316 | * |
| 3317 | * Return: none |
| 3318 | */ |
Jeff Johnson | a06efaa | 2018-04-18 09:43:21 -0700 | [diff] [blame] | 3319 | static void hdd_display_stats_help(void) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3320 | { |
Nirav Shah | e6194ac | 2018-07-13 11:04:41 +0530 | [diff] [blame] | 3321 | hdd_nofl_info("iwpriv wlan0 dumpStats [option] - dump statistics"); |
| 3322 | hdd_nofl_info("iwpriv wlan0 clearStats [option] - clear statistics"); |
| 3323 | hdd_nofl_info("options:"); |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3324 | HDD_DUMP_STAT_HELP(CDP_TXRX_PATH_STATS); |
| 3325 | HDD_DUMP_STAT_HELP(CDP_TXRX_HIST_STATS); |
| 3326 | HDD_DUMP_STAT_HELP(CDP_TXRX_TSO_STATS); |
| 3327 | HDD_DUMP_STAT_HELP(CDP_HDD_NETIF_OPER_HISTORY); |
| 3328 | HDD_DUMP_STAT_HELP(CDP_DUMP_TX_FLOW_POOL_INFO); |
| 3329 | HDD_DUMP_STAT_HELP(CDP_TXRX_DESC_STATS); |
| 3330 | HDD_DUMP_STAT_HELP(CDP_HIF_STATS); |
| 3331 | HDD_DUMP_STAT_HELP(CDP_NAPI_STATS); |
| 3332 | HDD_DUMP_STAT_HELP(CDP_DP_NAPI_STATS); |
| 3333 | HDD_DUMP_STAT_HELP(CDP_DP_RX_THREAD_STATS); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3334 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3335 | |
| 3336 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3337 | * hdd_wlan_dump_stats() - display dump Stats |
| 3338 | * @adapter: adapter handle |
| 3339 | * @value: value from user |
| 3340 | * |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3341 | * Return: 0 => success, error code on failure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3342 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3343 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3344 | { |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3345 | int ret = 0; |
| 3346 | QDF_STATUS status; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3347 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3348 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 3349 | hdd_debug("%d", value); |
| 3350 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3351 | switch (value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3352 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3353 | wlan_hdd_display_tx_rx_histogram(hdd_ctx); |
| 3354 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3355 | case CDP_HDD_NETIF_OPER_HISTORY: |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 3356 | wlan_hdd_display_netif_queue_history |
| 3357 | (hdd_ctx, |
| 3358 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3359 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3360 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 3361 | hdd_display_hif_stats(); |
| 3362 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3363 | case CDP_LRO_STATS: |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3364 | hdd_lro_display_stats(hdd_ctx); |
Alok Kumar | f28ca24 | 2018-05-07 17:51:38 +0530 | [diff] [blame] | 3365 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3366 | case CDP_NAPI_STATS: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3367 | if (hdd_display_napi_stats()) { |
| 3368 | hdd_err("error displaying napi stats"); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3369 | ret = -EFAULT; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3370 | } |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3371 | break; |
Mohit Khanna | c964965 | 2018-11-28 18:10:28 -0800 | [diff] [blame] | 3372 | case CDP_DP_RX_THREAD_STATS: |
| 3373 | dp_txrx_ext_dump_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 3374 | CDP_DP_RX_THREAD_STATS); |
| 3375 | break; |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3376 | case CDP_DISCONNECT_STATS: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3377 | sme_display_disconnect_stats(hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3378 | adapter->vdev_id); |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3379 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3380 | default: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3381 | status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3382 | value, |
| 3383 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3384 | if (status == QDF_STATUS_E_INVAL) { |
| 3385 | hdd_display_stats_help(); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 3386 | ret = -EINVAL; |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3387 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3388 | break; |
| 3389 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3390 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3391 | } |
| 3392 | |
| 3393 | /** |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3394 | * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3395 | * @adapter: Adapter upon which the IBSS client is active |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 3396 | * @sta_id: Station index of the IBSS peer |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3397 | * |
| 3398 | * Return: QDF_STATUS_STATUS if the peer was found and displayed, |
| 3399 | * otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3400 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3401 | 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] | 3402 | uint8_t sta_id) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3403 | { |
| 3404 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3405 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | 93107ad | 2019-02-26 08:14:46 -0800 | [diff] [blame] | 3406 | 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] | 3407 | tSirPeerInfoRspParams *peer_info = &sta_ctx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3408 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3409 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3410 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3411 | hdd_get_ibss_peer_info_cb, |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 3412 | false, sta_id); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3413 | |
| 3414 | if (QDF_STATUS_SUCCESS == status) { |
| 3415 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3416 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3417 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3418 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3419 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3420 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3421 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3422 | return QDF_STATUS_E_FAILURE; |
| 3423 | } |
| 3424 | |
| 3425 | /** Print the peer info */ |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3426 | hdd_debug("peer_info->numIBSSPeers = %d ", peer_info->numPeers); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3427 | { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3428 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3429 | uint32_t tx_rate = peer_info->peerInfoParams[0].txRate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3430 | |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3431 | qdf_mem_copy(mac_addr, peer_info->peerInfoParams[0]. |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3432 | mac_addr, sizeof(mac_addr)); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3433 | hdd_debug("PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3434 | mac_addr, (int)tx_rate, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3435 | (int)peer_info->peerInfoParams[0].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3436 | } |
| 3437 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3438 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3439 | } |
| 3440 | |
| 3441 | return status; |
| 3442 | } |
| 3443 | |
| 3444 | /** |
| 3445 | * hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3446 | * @adapter: Adapter upon which the IBSS clients are active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3447 | * |
| 3448 | * Return: QDF_STATUS_STATUS if the peer information was retrieved and |
| 3449 | * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3450 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3451 | 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] | 3452 | { |
| 3453 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3454 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | 93107ad | 2019-02-26 08:14:46 -0800 | [diff] [blame] | 3455 | 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] | 3456 | tSirPeerInfoRspParams *peer_info = &sta_ctx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3457 | int i; |
| 3458 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3459 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3460 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3461 | hdd_get_ibss_peer_info_cb, |
| 3462 | true, 0xFF); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3463 | |
| 3464 | if (QDF_STATUS_SUCCESS == status) { |
| 3465 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3466 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3467 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3468 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3469 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3470 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3471 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3472 | return QDF_STATUS_E_FAILURE; |
| 3473 | } |
| 3474 | |
| 3475 | /** Print the peer info */ |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3476 | hdd_debug("peer_info->numIBSSPeers = %d ", |
| 3477 | (int)peer_info->numPeers); |
| 3478 | for (i = 0; i < peer_info->numPeers; i++) { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3479 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3480 | uint32_t tx_rate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3481 | |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3482 | tx_rate = peer_info->peerInfoParams[i].txRate; |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3483 | qdf_mem_copy(mac_addr, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3484 | peer_info->peerInfoParams[i].mac_addr, |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3485 | sizeof(mac_addr)); |
| 3486 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3487 | hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3488 | mac_addr, (int)tx_rate, |
Jeff Johnson | 52f19d5 | 2019-02-26 08:35:38 -0800 | [diff] [blame] | 3489 | (int)peer_info->peerInfoParams[i].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3490 | } |
| 3491 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3492 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3493 | } |
| 3494 | |
| 3495 | return status; |
| 3496 | } |
| 3497 | |
| 3498 | /** |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3499 | * hdd_get_ldpc() - Get adapter LDPC |
| 3500 | * @adapter: adapter being queried |
| 3501 | * @value: where to store the value |
| 3502 | * |
| 3503 | * Return: 0 on success, negative errno on failure |
| 3504 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3505 | int hdd_get_ldpc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3506 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3507 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3508 | int ret; |
| 3509 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3510 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3511 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3512 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING); |
| 3513 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3514 | hdd_err("Failed to get LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3515 | } else { |
| 3516 | *value = ret; |
| 3517 | ret = 0; |
| 3518 | } |
| 3519 | return ret; |
| 3520 | } |
| 3521 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3522 | int hdd_set_ldpc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3523 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3524 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3525 | int ret; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3526 | QDF_STATUS status; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3527 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3528 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3529 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3530 | hdd_debug("%d", value); |
Jeff Johnson | 1ca0476 | 2018-10-25 10:24:39 -0700 | [diff] [blame] | 3531 | |
| 3532 | if (!mac_handle) { |
| 3533 | hdd_err("NULL Mac handle"); |
| 3534 | return -EINVAL; |
| 3535 | } |
| 3536 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3537 | 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] | 3538 | if (QDF_STATUS_SUCCESS != status) { |
| 3539 | hdd_err("Failed to get HT capability info"); |
| 3540 | return -EIO; |
| 3541 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3542 | |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3543 | ht_cap_info.adv_coding_cap = value; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3544 | 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] | 3545 | if (QDF_STATUS_SUCCESS != status) { |
| 3546 | hdd_err("Failed to set HT capability info"); |
| 3547 | return -EIO; |
| 3548 | } |
Vignesh Viswanathan | ecd4de7 | 2018-11-22 13:02:20 +0530 | [diff] [blame] | 3549 | 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] | 3550 | if (QDF_IS_STATUS_ERROR(status)) { |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3551 | hdd_err("Failed to set VHT LDPC capability info"); |
| 3552 | return -EIO; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3553 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3554 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3555 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING, |
| 3556 | value); |
| 3557 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3558 | hdd_err("Failed to set LDPC value"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3559 | 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] | 3560 | if (ret) |
| 3561 | hdd_err("Failed to set HE LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3562 | |
| 3563 | return ret; |
| 3564 | } |
| 3565 | |
| 3566 | /** |
| 3567 | * hdd_get_tx_stbc() - Get adapter TX STBC |
| 3568 | * @adapter: adapter being queried |
| 3569 | * @value: where to store the value |
| 3570 | * |
| 3571 | * Return: 0 on success, negative errno on failure |
| 3572 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3573 | int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3574 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3575 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3576 | int ret; |
| 3577 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3578 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3579 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3580 | WNI_CFG_HT_CAP_INFO_TX_STBC); |
| 3581 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3582 | hdd_err("Failed to get TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3583 | } else { |
| 3584 | *value = ret; |
| 3585 | ret = 0; |
| 3586 | } |
| 3587 | |
| 3588 | return ret; |
| 3589 | } |
| 3590 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3591 | int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3592 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3593 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3594 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3595 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3596 | QDF_STATUS status; |
| 3597 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3598 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3599 | hdd_debug("%d", value); |
Jeff Johnson | 57ff4fa | 2018-10-25 10:29:47 -0700 | [diff] [blame] | 3600 | |
| 3601 | if (!mac_handle) { |
| 3602 | hdd_err("NULL Mac handle"); |
| 3603 | return -EINVAL; |
| 3604 | } |
| 3605 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3606 | if (value) { |
| 3607 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3608 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3609 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3610 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3611 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3612 | return -EIO; |
| 3613 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3614 | if (!ht_cap_info.tx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3615 | hdd_err("TX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3616 | return -EINVAL; |
| 3617 | } |
| 3618 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3619 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3620 | WNI_CFG_HT_CAP_INFO_TX_STBC, |
| 3621 | value); |
| 3622 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3623 | hdd_err("Failed to set TX STBC value"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3624 | 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] | 3625 | if (ret) |
| 3626 | hdd_err("Failed to set HE TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3627 | |
| 3628 | return ret; |
| 3629 | } |
| 3630 | |
| 3631 | /** |
| 3632 | * hdd_get_rx_stbc() - Get adapter RX STBC |
| 3633 | * @adapter: adapter being queried |
| 3634 | * @value: where to store the value |
| 3635 | * |
| 3636 | * Return: 0 on success, negative errno on failure |
| 3637 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3638 | int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3639 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3640 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3641 | int ret; |
| 3642 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3643 | hdd_enter(); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3644 | ret = sme_get_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3645 | WNI_CFG_HT_CAP_INFO_RX_STBC); |
| 3646 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3647 | hdd_err("Failed to get RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3648 | } else { |
| 3649 | *value = ret; |
| 3650 | ret = 0; |
| 3651 | } |
| 3652 | |
| 3653 | return ret; |
| 3654 | } |
| 3655 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3656 | int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3657 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3658 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3659 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3660 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3661 | QDF_STATUS status; |
| 3662 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3663 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3664 | hdd_debug("%d", value); |
Jeff Johnson | b664585 | 2018-10-25 10:35:41 -0700 | [diff] [blame] | 3665 | |
| 3666 | if (!mac_handle) { |
| 3667 | hdd_err("NULL Mac handle"); |
| 3668 | return -EINVAL; |
| 3669 | } |
| 3670 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3671 | if (value) { |
| 3672 | /* make sure HT capabilities allow this */ |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 3673 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3674 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3675 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3676 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3677 | return -EIO; |
| 3678 | } |
Vignesh Viswanathan | 7818250 | 2018-08-06 15:13:30 +0530 | [diff] [blame] | 3679 | if (!ht_cap_info.rx_stbc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3680 | hdd_warn("RX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3681 | return -EINVAL; |
| 3682 | } |
| 3683 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3684 | ret = sme_update_ht_config(mac_handle, adapter->vdev_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3685 | WNI_CFG_HT_CAP_INFO_RX_STBC, |
| 3686 | value); |
| 3687 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3688 | hdd_err("Failed to set RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3689 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3690 | 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] | 3691 | if (ret) |
| 3692 | hdd_err("Failed to set HE RX STBC value"); |
| 3693 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3694 | return ret; |
| 3695 | } |
| 3696 | |
| 3697 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3698 | * iw_get_linkspeed() - Get current link speed ioctl |
| 3699 | * @dev: device upon which the ioctl was received |
| 3700 | * @info: ioctl request information |
| 3701 | * @wrqu: ioctl request data |
| 3702 | * @extra: extra ioctl buffer |
| 3703 | * |
| 3704 | * Return: 0 on success, non-zero on error |
| 3705 | */ |
| 3706 | static int __iw_get_linkspeed(struct net_device *dev, |
| 3707 | struct iw_request_info *info, |
| 3708 | union iwreq_data *wrqu, char *extra) |
| 3709 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3710 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 21451ae | 2019-03-10 21:54:04 -0700 | [diff] [blame] | 3711 | char *out_link_speed = (char *)extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3712 | int len = sizeof(uint32_t) + 1; |
| 3713 | uint32_t link_speed = 0; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3714 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3715 | int ret; |
| 3716 | int rc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3717 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 3718 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 3719 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3720 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3721 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 3722 | if (0 != ret) |
| 3723 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3724 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3725 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 3726 | if (0 != ret) |
| 3727 | return ret; |
| 3728 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3729 | ret = wlan_hdd_get_link_speed(adapter, &link_speed); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3730 | if (0 != ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3731 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3732 | |
| 3733 | wrqu->data.length = len; |
| 3734 | /* return the linkspeed as a string */ |
Jeff Johnson | 21451ae | 2019-03-10 21:54:04 -0700 | [diff] [blame] | 3735 | rc = snprintf(out_link_speed, len, "%u", link_speed); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3736 | if ((rc < 0) || (rc >= len)) { |
| 3737 | /* encoding or length error? */ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3738 | hdd_err("Unable to encode link speed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3739 | return -EIO; |
| 3740 | } |
| 3741 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 3742 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3743 | /* a value is being successfully returned */ |
| 3744 | return 0; |
| 3745 | } |
| 3746 | |
| 3747 | static int iw_get_linkspeed(struct net_device *dev, |
| 3748 | struct iw_request_info *info, |
| 3749 | union iwreq_data *wrqu, char *extra) |
| 3750 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3751 | int errno; |
| 3752 | struct osif_vdev_sync *vdev_sync; |
| 3753 | |
| 3754 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 3755 | if (errno) |
| 3756 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3757 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3758 | errno = __iw_get_linkspeed(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3759 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 3760 | osif_vdev_sync_op_stop(vdev_sync); |
| 3761 | |
| 3762 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3763 | } |
| 3764 | |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3765 | #ifdef FEATURE_WLM_STATS |
| 3766 | static void wlan_get_wlm_stats_cb(void *cookie, const char *data) |
| 3767 | { |
| 3768 | struct osif_request *request; |
| 3769 | char *priv; |
| 3770 | |
| 3771 | request = osif_request_get(cookie); |
| 3772 | if (!request) { |
| 3773 | hdd_err("Obsolete request"); |
| 3774 | return; |
| 3775 | } |
| 3776 | priv = osif_request_priv(request); |
| 3777 | strlcpy(priv, data, WE_MAX_STR_LEN); |
| 3778 | osif_request_complete(request); |
| 3779 | osif_request_put(request); |
| 3780 | } |
| 3781 | |
| 3782 | static int wlan_get_wlm_stats(struct hdd_adapter *adapter, uint32_t bitmask, |
| 3783 | char *response) |
| 3784 | { |
| 3785 | struct osif_request *request; |
| 3786 | void *cookie; |
| 3787 | int errno; |
| 3788 | char *priv; |
| 3789 | static const struct osif_request_params params = { |
| 3790 | .priv_size = WE_MAX_STR_LEN, |
| 3791 | .timeout_ms = 2000, |
| 3792 | }; |
| 3793 | |
| 3794 | if (!adapter) { |
| 3795 | hdd_err("NULL argument"); |
| 3796 | return -EINVAL; |
| 3797 | } |
| 3798 | request = osif_request_alloc(¶ms); |
| 3799 | if (!request) { |
| 3800 | hdd_err("Request allocation failure"); |
| 3801 | return -ENOMEM; |
| 3802 | } |
| 3803 | cookie = osif_request_cookie(request); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 3804 | errno = wma_wlm_stats_req(adapter->vdev_id, bitmask, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3805 | params.priv_size, |
| 3806 | wlan_get_wlm_stats_cb, cookie); |
| 3807 | if (errno) { |
| 3808 | hdd_err("Request failed be sent, %d", errno); |
| 3809 | goto cleanup; |
| 3810 | } |
| 3811 | errno = osif_request_wait_for_response(request); |
| 3812 | if (errno) { |
| 3813 | hdd_err("Timeout happened, can't complete the req"); |
| 3814 | goto cleanup; |
| 3815 | } |
| 3816 | priv = osif_request_priv(request); |
| 3817 | strlcpy(response, priv, params.priv_size); |
| 3818 | |
| 3819 | cleanup: |
| 3820 | osif_request_put(request); |
| 3821 | |
| 3822 | return errno; |
| 3823 | } |
| 3824 | |
| 3825 | /* |
| 3826 | * Due to a limitation in iwpriv the "get_wlm_stats" ioctl is defined |
| 3827 | * to take as input a variable-length string as opposed to taking a |
| 3828 | * single integer "bitmask" value. Hence we must have a buffer large |
| 3829 | * enough to hold a string representing the largest possible |
| 3830 | * value. MAX_INT = 2,147,483,647 which can be fit in 10 chars. |
| 3831 | * Round up to 12 to hold the trailing NUL and be a multiple of 4. |
| 3832 | */ |
| 3833 | #define WLM_USER_DATA_SIZE 12 |
| 3834 | |
| 3835 | static int __iw_get_wlm_stats(struct net_device *dev, |
| 3836 | struct iw_request_info *info, |
| 3837 | union iwreq_data *wrqu, char *extra) |
| 3838 | { |
| 3839 | struct iw_point priv_data; |
| 3840 | char user_data[WLM_USER_DATA_SIZE] = {0}; |
| 3841 | uint32_t bitmask = 0; |
| 3842 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 3843 | struct hdd_context *hdd_ctx; |
| 3844 | int errno; |
| 3845 | |
| 3846 | hdd_enter_dev(dev); |
| 3847 | |
| 3848 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 3849 | errno = wlan_hdd_validate_context(hdd_ctx); |
| 3850 | if (errno) |
| 3851 | return errno; |
| 3852 | |
| 3853 | if (!capable(CAP_NET_ADMIN)) { |
| 3854 | hdd_err("permission check failed"); |
| 3855 | return -EPERM; |
| 3856 | } |
| 3857 | |
| 3858 | /* |
| 3859 | * Since this is GETTER iwpriv ioctl, driver needs to |
| 3860 | * copy SET data from user space to kernel space. |
| 3861 | * Helper function to get iwreq_data with compat handling. |
| 3862 | */ |
| 3863 | if (hdd_priv_get_data(&priv_data, wrqu)) |
| 3864 | return -EINVAL; |
| 3865 | |
| 3866 | /* |
| 3867 | * priv_data.pointer should be pointing to data given |
| 3868 | * to iwpriv command. |
| 3869 | * |
| 3870 | * For example "iwpriv wlan0 get_wlm_stats 1234" |
| 3871 | * |
| 3872 | * priv_data.pointer should be pointing to "1234" |
| 3873 | * priv_data.length should be zero as this GETTER iwpriv ioctl |
| 3874 | */ |
| 3875 | if (!priv_data.pointer) { |
| 3876 | hdd_err("NULL data pointer"); |
| 3877 | return -EINVAL; |
| 3878 | } |
| 3879 | |
| 3880 | /* |
| 3881 | * ideally driver should have used priv_data.length to copy |
| 3882 | * data from priv_data.pointer but this iwpriv IOCTL has been |
| 3883 | * declared as GETTER in nature which makes length field zero |
| 3884 | * for input arguments but priv_data.pointer still points to |
| 3885 | * user's input argument (just doesn't pass the length of the |
| 3886 | * argument) |
| 3887 | */ |
| 3888 | if (copy_from_user(user_data, priv_data.pointer, |
| 3889 | sizeof(user_data) - 1)) { |
| 3890 | hdd_err("failed to copy data from user buffer"); |
| 3891 | return -EFAULT; |
| 3892 | } |
| 3893 | |
| 3894 | /* |
| 3895 | * user data is given in ascii, convert ascii to integer |
| 3896 | */ |
| 3897 | if (kstrtou32(user_data, 0, &bitmask)) { |
| 3898 | hdd_err("failed to parse input %s", user_data); |
| 3899 | return -EFAULT; |
| 3900 | } |
| 3901 | |
| 3902 | if (wlan_get_wlm_stats(adapter, bitmask, extra)) { |
| 3903 | hdd_err("returning failure"); |
| 3904 | return -EFAULT; |
| 3905 | } |
| 3906 | wrqu->data.length = strlen(extra) + 1; |
| 3907 | |
| 3908 | return 0; |
| 3909 | } |
| 3910 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3911 | static int iw_get_wlm_stats(struct net_device *net_dev, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3912 | struct iw_request_info *info, |
| 3913 | union iwreq_data *wrqu, char *extra) |
| 3914 | { |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3915 | struct osif_vdev_sync *vdev_sync; |
| 3916 | int errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3917 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3918 | errno = osif_vdev_sync_op_start(net_dev, &vdev_sync); |
| 3919 | if (errno) |
| 3920 | return errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3921 | |
Dustin Brown | 96b98dd | 2019-03-06 12:39:37 -0800 | [diff] [blame] | 3922 | errno = __iw_get_wlm_stats(net_dev, info, wrqu, extra); |
| 3923 | |
| 3924 | osif_vdev_sync_op_stop(vdev_sync); |
| 3925 | |
| 3926 | return errno; |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 3927 | } |
| 3928 | #endif /* FEATURE_WLM_STATS */ |
| 3929 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3930 | int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3931 | { |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3932 | struct net_device *net = adapter->dev; |
| 3933 | struct hdd_context *phddctx = WLAN_HDD_GET_CTX(adapter); |
| 3934 | mac_handle_t mac_handle = phddctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3935 | bool band_24 = false, band_5g = false; |
| 3936 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 3937 | struct sme_config_params *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3938 | uint32_t chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3939 | uint8_t vhtchanwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3940 | eCsrPhyMode phymode = -EIO, old_phymode; |
Srinivas Girigowda | 2fb677c | 2017-03-25 15:35:34 -0700 | [diff] [blame] | 3941 | enum hdd_dot11_mode hdd_dot11mode = phddctx->config->dot11Mode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3942 | enum band_info curr_band = BAND_ALL; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3943 | int retval = 0; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3944 | uint8_t band_capability; |
| 3945 | QDF_STATUS status; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3946 | uint32_t channel_bonding_mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3947 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3948 | if (!mac_handle) |
| 3949 | return -EINVAL; |
| 3950 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3951 | old_phymode = sme_get_phy_mode(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3952 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3953 | ucfg_mlme_get_channel_bonding_24ghz(phddctx->psoc, |
| 3954 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3955 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3956 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3957 | ch_bond24 = true; |
| 3958 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3959 | ucfg_mlme_get_channel_bonding_5ghz(phddctx->psoc, |
| 3960 | &channel_bonding_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3961 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 3962 | sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3963 | ch_bond5g = true; |
| 3964 | |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3965 | status = wlan_mlme_get_band_capability(phddctx->psoc, &band_capability); |
| 3966 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3967 | hdd_err("Failed to get MLME Band capability"); |
| 3968 | return -EIO; |
| 3969 | } |
| 3970 | |
| 3971 | if (band_capability == BAND_ALL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3972 | band_24 = band_5g = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3973 | else if (band_capability == BAND_2G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3974 | band_24 = true; |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 3975 | else if (band_capability == BAND_5G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3976 | band_5g = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3977 | |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 3978 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, &vhtchanwidth); |
| 3979 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 3980 | hdd_err("Failed to get channel_width"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3981 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3982 | 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] | 3983 | ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth); |
| 3984 | |
| 3985 | switch (new_phymode) { |
| 3986 | case IEEE80211_MODE_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3987 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3988 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3989 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3990 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3991 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3992 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3993 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3994 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3995 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3996 | return -EIO; |
| 3997 | } |
| 3998 | break; |
| 3999 | case IEEE80211_MODE_11A: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4000 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11a); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4001 | 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] | 4002 | phymode = eCSR_DOT11_MODE_11a; |
| 4003 | hdd_dot11mode = eHDD_DOT11_MODE_11a; |
| 4004 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4005 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4006 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4007 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4008 | return -EIO; |
| 4009 | } |
| 4010 | break; |
| 4011 | case IEEE80211_MODE_11B: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4012 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11b); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4013 | 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] | 4014 | phymode = eCSR_DOT11_MODE_11b; |
| 4015 | hdd_dot11mode = eHDD_DOT11_MODE_11b; |
| 4016 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4017 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4018 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4019 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4020 | return -EIO; |
| 4021 | } |
| 4022 | break; |
| 4023 | case IEEE80211_MODE_11G: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4024 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11g); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4025 | 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] | 4026 | phymode = eCSR_DOT11_MODE_11g; |
| 4027 | hdd_dot11mode = eHDD_DOT11_MODE_11g; |
| 4028 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4029 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4030 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4031 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4032 | return -EIO; |
| 4033 | } |
| 4034 | break; |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 4035 | /* 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] | 4036 | * so setting phymode as eCSR_DOT11_MODE_11n and updating the band |
| 4037 | * and channel bonding in configuration to reflect MODE_11NA/MODE_11NG |
| 4038 | */ |
| 4039 | case IEEE80211_MODE_11NA_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4040 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4041 | 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] | 4042 | phymode = eCSR_DOT11_MODE_11n; |
| 4043 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4044 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4045 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4046 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4047 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4048 | return -EIO; |
| 4049 | } |
| 4050 | break; |
| 4051 | case IEEE80211_MODE_11NA_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4052 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4053 | 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] | 4054 | phymode = eCSR_DOT11_MODE_11n; |
| 4055 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4056 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4057 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4058 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4059 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4060 | return -EIO; |
| 4061 | } |
| 4062 | break; |
| 4063 | case IEEE80211_MODE_11NG_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4064 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4065 | 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] | 4066 | phymode = eCSR_DOT11_MODE_11n; |
| 4067 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4068 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4069 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4070 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4071 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4072 | return -EIO; |
| 4073 | } |
| 4074 | break; |
| 4075 | case IEEE80211_MODE_11NG_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4076 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4077 | 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] | 4078 | phymode = eCSR_DOT11_MODE_11n; |
| 4079 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4080 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4081 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4082 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4083 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4084 | return -EIO; |
| 4085 | } |
| 4086 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4087 | case IEEE80211_MODE_11AC_VHT20: |
| 4088 | case IEEE80211_MODE_11AC_VHT40: |
| 4089 | case IEEE80211_MODE_11AC_VHT80: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4090 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11ac); |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 4091 | phymode = eCSR_DOT11_MODE_11ac; |
| 4092 | hdd_dot11mode = eHDD_DOT11_MODE_11ac; |
| 4093 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 4094 | if (band_5g && band_24) { |
| 4095 | curr_band = BAND_ALL; |
| 4096 | break; |
| 4097 | } else if (band_5g) { |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4098 | curr_band = BAND_5G; |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 4099 | break; |
| 4100 | } else if (new_phymode != IEEE80211_MODE_11AC_VHT80) { |
| 4101 | curr_band = BAND_2G; |
| 4102 | break; |
| 4103 | } |
| 4104 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
| 4105 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4106 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4107 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4108 | return -EIO; |
| 4109 | } |
| 4110 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4111 | case IEEE80211_MODE_2G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4112 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4113 | 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] | 4114 | phymode = eCSR_DOT11_MODE_AUTO; |
| 4115 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 4116 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4117 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4118 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4119 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4120 | return -EIO; |
| 4121 | } |
| 4122 | break; |
| 4123 | case IEEE80211_MODE_5G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4124 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4125 | 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] | 4126 | phymode = eCSR_DOT11_MODE_AUTO; |
| 4127 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 4128 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 4129 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4130 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4131 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4132 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4133 | return -EIO; |
| 4134 | } |
| 4135 | break; |
| 4136 | case IEEE80211_MODE_11AGN: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4137 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 4138 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4139 | phymode = eCSR_DOT11_MODE_11n; |
| 4140 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 4141 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4142 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4143 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4144 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4145 | return -EIO; |
| 4146 | } |
| 4147 | break; |
| 4148 | default: |
| 4149 | return -EIO; |
| 4150 | } |
| 4151 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4152 | switch (new_phymode) { |
| 4153 | case IEEE80211_MODE_11AC_VHT20: |
| 4154 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4155 | vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 4156 | break; |
| 4157 | case IEEE80211_MODE_11AC_VHT40: |
| 4158 | vhtchanwidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 4159 | break; |
| 4160 | case IEEE80211_MODE_11AC_VHT80: |
| 4161 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 4162 | break; |
| 4163 | default: |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4164 | status = ucfg_mlme_get_vht_channel_width(phddctx->psoc, |
| 4165 | &vhtchanwidth); |
| 4166 | if (!QDF_IS_STATUS_SUCCESS(status)) |
Jeff Johnson | 9516c11 | 2018-10-24 12:23:58 -0700 | [diff] [blame] | 4167 | hdd_err("Failed to get channel_width"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4168 | break; |
| 4169 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4170 | |
| 4171 | if (phymode != -EIO) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4172 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4173 | if (!sme_config) { |
| 4174 | hdd_err("Failed to allocate memory for sme_config"); |
| 4175 | return -ENOMEM; |
| 4176 | } |
| 4177 | qdf_mem_zero(sme_config, sizeof(*sme_config)); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4178 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4179 | sme_config->csrConfig.phyMode = phymode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4180 | #ifdef QCA_HT_2040_COEX |
| 4181 | if (phymode == eCSR_DOT11_MODE_11n && |
| 4182 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4183 | sme_config->csrConfig.obssEnabled = false; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4184 | status = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4185 | adapter->vdev_id, |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4186 | eHT_CHAN_HT20, false); |
| 4187 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4188 | hdd_err("Failed to disable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4189 | retval = -EIO; |
| 4190 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4191 | } |
| 4192 | } else if (phymode == eCSR_DOT11_MODE_11n && |
| 4193 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4194 | sme_config->csrConfig.obssEnabled = true; |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4195 | status = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4196 | adapter->vdev_id, |
Jeff Johnson | c171324 | 2018-10-23 13:45:42 -0700 | [diff] [blame] | 4197 | eHT_CHAN_HT20, true); |
| 4198 | if (status == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4199 | hdd_err("Failed to enable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4200 | retval = -EIO; |
| 4201 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4202 | } |
| 4203 | } |
| 4204 | #endif |
Vignesh Viswanathan | f97cc11 | 2018-10-03 19:17:07 +0530 | [diff] [blame] | 4205 | status = ucfg_mlme_set_band_capability(phddctx->psoc, |
| 4206 | curr_band); |
| 4207 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4208 | hdd_err("failed to set MLME band capability"); |
| 4209 | goto free; |
| 4210 | } |
| 4211 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4212 | if (curr_band == BAND_2G) { |
| 4213 | status = ucfg_mlme_set_11h_enabled(phddctx->psoc, 0); |
| 4214 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
| 4215 | hdd_err("Failed to set 11h_enable flag"); |
| 4216 | goto free; |
| 4217 | } |
| 4218 | } |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4219 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4220 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
Jeff Johnson | 3d72577 | 2018-04-28 17:20:56 -0700 | [diff] [blame] | 4221 | else if (curr_band == BAND_5G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4222 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4223 | else { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4224 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
| 4225 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4226 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4227 | sme_update_config(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4228 | |
| 4229 | phddctx->config->dot11Mode = hdd_dot11mode; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4230 | ucfg_mlme_set_channel_bonding_24ghz( |
| 4231 | phddctx->psoc, |
| 4232 | sme_config->csrConfig.channelBondingMode24GHz); |
| 4233 | ucfg_mlme_set_channel_bonding_5ghz( |
| 4234 | phddctx->psoc, |
| 4235 | sme_config->csrConfig.channelBondingMode5GHz); |
Krunal Soni | df0f874 | 2016-09-26 14:56:31 -0700 | [diff] [blame] | 4236 | if (hdd_update_config_cfg(phddctx) == false) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4237 | hdd_err("could not update config_dat"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4238 | retval = -EIO; |
| 4239 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4240 | } |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4241 | |
| 4242 | if (band_5g) { |
| 4243 | struct ieee80211_supported_band *band; |
| 4244 | |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4245 | ucfg_mlme_get_channel_bonding_5ghz( |
| 4246 | phddctx->psoc, &channel_bonding_mode); |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4247 | band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; |
Wu Gao | ed616a1 | 2019-01-16 15:19:21 +0800 | [diff] [blame] | 4248 | if (channel_bonding_mode) |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 4249 | band->ht_cap.cap |= |
| 4250 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4251 | else |
| 4252 | band->ht_cap.cap &= |
| 4253 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 4254 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4255 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4256 | 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] | 4257 | phymode, chwidth, curr_band, vhtchanwidth); |
| 4258 | } |
| 4259 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4260 | free: |
| 4261 | if (sme_config) |
| 4262 | qdf_mem_free(sme_config); |
| 4263 | return retval; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4264 | } |
| 4265 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4266 | static int hdd_validate_pdev_reset(int value) |
| 4267 | { |
| 4268 | if ((value < 1) || (value > 5)) { |
| 4269 | hdd_warn(" Invalid value %d: Use any one of the below values\n" |
| 4270 | " TX_FLUSH = 1\n" |
| 4271 | " WARM_RESET = 2\n" |
| 4272 | " COLD_RESET = 3\n" |
| 4273 | " WARM_RESET_RESTORE_CAL = 4\n" |
| 4274 | " COLD_RESET_RESTORE_CAL = 5", value); |
| 4275 | |
| 4276 | return -EINVAL; |
| 4277 | } |
| 4278 | |
| 4279 | return 0; |
| 4280 | } |
| 4281 | |
| 4282 | static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value) |
| 4283 | { |
| 4284 | int ret; |
| 4285 | |
| 4286 | hdd_debug("%d", value); |
| 4287 | |
| 4288 | ret = hdd_validate_pdev_reset(value); |
| 4289 | if (ret) |
| 4290 | return ret; |
| 4291 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4292 | ret = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4293 | WMI_PDEV_PARAM_PDEV_RESET, |
| 4294 | value, PDEV_CMD); |
| 4295 | |
| 4296 | return ret; |
| 4297 | } |
| 4298 | |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4299 | static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width) |
| 4300 | { |
| 4301 | int errno; |
| 4302 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4303 | uint32_t bonding_mode; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 4304 | struct sme_config_params *sme_config; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4305 | mac_handle_t mac_handle; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4306 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4307 | mac_handle = hdd_ctx->mac_handle; |
| 4308 | if (!mac_handle) |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4309 | return -EINVAL; |
| 4310 | |
| 4311 | /* updating channel bonding only on 5Ghz */ |
| 4312 | hdd_debug("WMI_VDEV_PARAM_CHWIDTH val %d", ch_width); |
| 4313 | |
| 4314 | switch (ch_width) { |
| 4315 | case eHT_CHANNEL_WIDTH_20MHZ: |
| 4316 | bonding_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4317 | break; |
| 4318 | |
| 4319 | case eHT_CHANNEL_WIDTH_40MHZ: |
| 4320 | case eHT_CHANNEL_WIDTH_80MHZ: |
Kiran Kumar Lokere | 9df090b | 2019-02-07 18:48:22 -0800 | [diff] [blame] | 4321 | bonding_mode = 1; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4322 | break; |
| 4323 | |
| 4324 | default: |
| 4325 | hdd_err("Invalid channel width 0->20 1->40 2->80"); |
| 4326 | return -EINVAL; |
| 4327 | } |
| 4328 | |
| 4329 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4330 | if (!sme_config) { |
| 4331 | hdd_err("failed to allocate memory for sme_config"); |
| 4332 | return -ENOMEM; |
| 4333 | } |
| 4334 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4335 | errno = wma_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_CHWIDTH, |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4336 | ch_width, VDEV_CMD); |
| 4337 | if (errno) |
| 4338 | goto free_config; |
| 4339 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4340 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4341 | sme_config->csrConfig.channelBondingMode5GHz = bonding_mode; |
Kiran Kumar Lokere | 9df090b | 2019-02-07 18:48:22 -0800 | [diff] [blame] | 4342 | sme_config->csrConfig.channelBondingMode24GHz = bonding_mode; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4343 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4344 | |
| 4345 | free_config: |
| 4346 | qdf_mem_free(sme_config); |
| 4347 | |
| 4348 | return errno; |
| 4349 | } |
| 4350 | |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4351 | 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] | 4352 | { |
Jeff Johnson | deab857 | 2018-11-13 15:29:53 -0800 | [diff] [blame] | 4353 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4354 | bool enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4355 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4356 | QDF_STATUS status; |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4357 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4358 | if (!mac_handle) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4359 | return -EINVAL; |
| 4360 | |
| 4361 | switch (state_11d) { |
| 4362 | case ENABLE_11D: |
| 4363 | enable_11d = true; |
| 4364 | break; |
| 4365 | case DISABLE_11D: |
| 4366 | enable_11d = false; |
| 4367 | break; |
| 4368 | default: |
| 4369 | return -EINVAL; |
| 4370 | } |
| 4371 | |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 4372 | status = ucfg_mlme_set_11d_enabled(hdd_ctx->psoc, enable_11d); |
| 4373 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 4374 | hdd_err("Invalid 11d_enable flag"); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4375 | |
Dustin Brown | ea82d56 | 2018-05-23 12:07:16 -0700 | [diff] [blame] | 4376 | hdd_debug("11D state=%d", enable_11d); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4377 | |
| 4378 | return 0; |
| 4379 | } |
| 4380 | |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4381 | static int hdd_we_set_power(struct hdd_adapter *adapter, int value) |
| 4382 | { |
| 4383 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4384 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4385 | |
| 4386 | if (!mac_handle) |
| 4387 | return -EINVAL; |
| 4388 | |
| 4389 | switch (value) { |
| 4390 | case 1: |
| 4391 | /* Enable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4392 | sme_save_usr_ps_cfg(mac_handle, true); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4393 | sme_ps_enable_disable(mac_handle, adapter->vdev_id, |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4394 | SME_PS_ENABLE); |
| 4395 | return 0; |
| 4396 | case 2: |
| 4397 | /* Disable PowerSave */ |
Kiran Kumar Lokere | ceeed83 | 2018-12-05 18:36:01 -0800 | [diff] [blame] | 4398 | sme_save_usr_ps_cfg(mac_handle, false); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4399 | sme_ps_enable_disable(mac_handle, adapter->vdev_id, |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4400 | SME_PS_DISABLE); |
| 4401 | return 0; |
| 4402 | case 3: |
| 4403 | /* Enable UASPD */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4404 | sme_ps_uapsd_enable(mac_handle, adapter->vdev_id); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4405 | return 0; |
| 4406 | case 4: |
| 4407 | /* Disable UASPD */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4408 | sme_ps_uapsd_disable(mac_handle, adapter->vdev_id); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 4409 | return 0; |
| 4410 | default: |
| 4411 | hdd_err("Invalid value %d", value); |
| 4412 | return -EINVAL; |
| 4413 | } |
| 4414 | } |
| 4415 | |
Jeff Johnson | eb4368a | 2018-10-19 13:02:52 -0700 | [diff] [blame] | 4416 | static int hdd_we_set_max_assoc(struct hdd_adapter *adapter, int value) |
| 4417 | { |
| 4418 | struct hdd_context *hdd_ctx; |
| 4419 | QDF_STATUS status; |
| 4420 | |
| 4421 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4422 | status = ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, value); |
| 4423 | if (QDF_IS_STATUS_ERROR(status)) |
| 4424 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4425 | |
| 4426 | return qdf_status_to_os_return(status); |
| 4427 | } |
| 4428 | |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4429 | static int hdd_we_set_data_inactivity_timeout(struct hdd_adapter *adapter, |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4430 | int inactivity_timeout) |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4431 | { |
| 4432 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4433 | QDF_STATUS status; |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4434 | |
Arif Hussain | 41cbc1e | 2018-11-15 05:54:45 -0800 | [diff] [blame] | 4435 | status = ucfg_mlme_set_ps_data_inactivity_timeout(hdd_ctx->psoc, |
| 4436 | inactivity_timeout); |
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 | return qdf_status_to_os_return(status); |
Jeff Johnson | 693722c | 2018-10-19 13:11:16 -0700 | [diff] [blame] | 4439 | } |
| 4440 | |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4441 | static int hdd_we_set_wow_data_inactivity_timeout(struct hdd_adapter *adapter, |
| 4442 | int value) |
| 4443 | { |
| 4444 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4445 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4446 | |
| 4447 | if (!mac_handle) |
| 4448 | return -EINVAL; |
| 4449 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4450 | if (!cfg_in_range(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT, value)) { |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4451 | hdd_err_rl("Invalid value %d", value); |
| 4452 | return -EINVAL; |
| 4453 | } |
| 4454 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4455 | 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] | 4456 | |
Wu Gao | a796d71 | 2019-01-07 14:15:32 +0800 | [diff] [blame] | 4457 | return 0; |
Jeff Johnson | 9451194 | 2018-10-19 13:15:22 -0700 | [diff] [blame] | 4458 | } |
| 4459 | |
Jeff Johnson | 5d4a6d1 | 2018-10-19 13:23:28 -0700 | [diff] [blame] | 4460 | static int hdd_we_set_tx_power(struct hdd_adapter *adapter, int value) |
| 4461 | { |
| 4462 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4463 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4464 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4465 | QDF_STATUS status; |
| 4466 | |
| 4467 | if (!mac_handle) |
| 4468 | return -EINVAL; |
| 4469 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4470 | status = sme_set_tx_power(mac_handle, adapter->vdev_id, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 4471 | sta_ctx->conn_info.bssid, |
Jeff Johnson | 5d4a6d1 | 2018-10-19 13:23:28 -0700 | [diff] [blame] | 4472 | adapter->device_mode, value); |
| 4473 | |
| 4474 | if (QDF_IS_STATUS_ERROR(status)) |
| 4475 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4476 | |
| 4477 | return qdf_status_to_os_return(status); |
| 4478 | } |
| 4479 | |
Jeff Johnson | 5e15ef5 | 2018-10-19 15:29:56 -0700 | [diff] [blame] | 4480 | static int hdd_we_set_max_tx_power(struct hdd_adapter *adapter, int value) |
| 4481 | { |
| 4482 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4483 | struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 4484 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4485 | QDF_STATUS status; |
| 4486 | |
| 4487 | if (!mac_handle) |
| 4488 | return -EINVAL; |
| 4489 | |
| 4490 | status = sme_set_max_tx_power(mac_handle, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 4491 | sta_ctx->conn_info.bssid, |
| 4492 | sta_ctx->conn_info.bssid, |
Jeff Johnson | 5e15ef5 | 2018-10-19 15:29:56 -0700 | [diff] [blame] | 4493 | value); |
| 4494 | |
| 4495 | if (QDF_IS_STATUS_ERROR(status)) |
| 4496 | hdd_err("cfg set failed, value %d status %d", value, status); |
| 4497 | |
| 4498 | return qdf_status_to_os_return(status); |
| 4499 | } |
| 4500 | |
Jeff Johnson | f3892b5 | 2018-10-23 11:32:04 -0700 | [diff] [blame] | 4501 | static int hdd_we_set_max_tx_power_2_4(struct hdd_adapter *adapter, int power) |
| 4502 | { |
| 4503 | QDF_STATUS status; |
| 4504 | |
| 4505 | hdd_debug("power %d dBm", power); |
| 4506 | status = sme_set_max_tx_power_per_band(BAND_2G, power); |
| 4507 | if (QDF_IS_STATUS_ERROR(status)) |
| 4508 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4509 | |
| 4510 | return qdf_status_to_os_return(status); |
| 4511 | } |
| 4512 | |
Jeff Johnson | 175004c | 2018-10-23 12:03:16 -0700 | [diff] [blame] | 4513 | static int hdd_we_set_max_tx_power_5_0(struct hdd_adapter *adapter, int power) |
| 4514 | { |
| 4515 | QDF_STATUS status; |
| 4516 | |
| 4517 | hdd_debug("power %d dBm", power); |
| 4518 | status = sme_set_max_tx_power_per_band(BAND_5G, power); |
| 4519 | if (QDF_IS_STATUS_ERROR(status)) |
| 4520 | hdd_err("cfg set failed, value %d status %d", power, status); |
| 4521 | |
| 4522 | return qdf_status_to_os_return(status); |
| 4523 | } |
| 4524 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 4525 | #ifdef HASTINGS_BT_WAR |
| 4526 | |
| 4527 | /* |
| 4528 | * replicate logic: |
| 4529 | * iwpriv wlan0 setUnitTestCmd 19 2 23 1 => enable WAR |
| 4530 | * iwpriv wlan0 setUnitTestCmd 19 2 23 0 => disable WAR |
| 4531 | */ |
| 4532 | |
| 4533 | #define HASTINGS_WAR_FW_PARAM_ID 23 |
| 4534 | |
| 4535 | static int hdd_hastings_bt_war_set_fw(struct hdd_context *hdd_ctx, |
| 4536 | uint32_t value) |
| 4537 | { |
| 4538 | uint32_t vdev_id = 0; /* not used */ |
| 4539 | uint32_t module_id = WLAN_MODULE_WAL; |
| 4540 | uint32_t arg_count = 2; |
| 4541 | uint32_t arg[2] = {HASTINGS_WAR_FW_PARAM_ID, value}; |
| 4542 | QDF_STATUS status; |
| 4543 | |
| 4544 | status = wma_form_unit_test_cmd_and_send(vdev_id, module_id, |
| 4545 | arg_count, arg); |
| 4546 | |
| 4547 | return qdf_status_to_os_return(status); |
| 4548 | } |
| 4549 | |
| 4550 | int hdd_hastings_bt_war_enable_fw(struct hdd_context *hdd_ctx) |
| 4551 | { |
| 4552 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 1); |
| 4553 | } |
| 4554 | |
| 4555 | int hdd_hastings_bt_war_disable_fw(struct hdd_context *hdd_ctx) |
| 4556 | { |
| 4557 | return hdd_hastings_bt_war_set_fw(hdd_ctx, 0); |
| 4558 | } |
| 4559 | |
| 4560 | /* value to restore the config when the WAR is disabled */ |
| 4561 | static uint32_t iface_change_wait_time_checkpoint; |
| 4562 | static void checkpoint_iface_change_wait_time(struct hdd_context *hdd_ctx) |
| 4563 | { |
| 4564 | struct hdd_config *config = hdd_ctx->config; |
| 4565 | |
| 4566 | /* did we already checkpoint a value ? */ |
| 4567 | if (iface_change_wait_time_checkpoint) |
| 4568 | return; |
| 4569 | |
| 4570 | /* checkpoint current value */ |
| 4571 | iface_change_wait_time_checkpoint = config->iface_change_wait_time; |
| 4572 | |
| 4573 | /* was the timer enabled when we checkpointed? */ |
| 4574 | if (iface_change_wait_time_checkpoint) |
| 4575 | return; |
| 4576 | |
| 4577 | /* WAR was enabled at boot, use default when disable */ |
| 4578 | iface_change_wait_time_checkpoint = |
| 4579 | cfg_default(CFG_INTERFACE_CHANGE_WAIT); |
| 4580 | } |
| 4581 | |
| 4582 | static int hdd_hastings_war_enable(struct hdd_context *hdd_ctx) |
| 4583 | { |
| 4584 | struct hdd_config *config = hdd_ctx->config; |
| 4585 | |
| 4586 | config->iface_change_wait_time = 0; |
| 4587 | |
| 4588 | return hdd_hastings_bt_war_enable_fw(hdd_ctx); |
| 4589 | } |
| 4590 | |
| 4591 | static int hdd_hastings_war_disable(struct hdd_context *hdd_ctx) |
| 4592 | { |
| 4593 | struct hdd_config *config = hdd_ctx->config; |
| 4594 | |
| 4595 | config->iface_change_wait_time = iface_change_wait_time_checkpoint; |
| 4596 | |
| 4597 | return hdd_hastings_bt_war_disable_fw(hdd_ctx); |
| 4598 | } |
| 4599 | |
| 4600 | static int hdd_we_set_hastings_bt_war(struct hdd_adapter *adapter, int enable) |
| 4601 | { |
| 4602 | int errno; |
| 4603 | struct hdd_context *hdd_ctx; |
| 4604 | |
| 4605 | errno = hdd_validate_adapter(adapter); |
| 4606 | if (errno) |
| 4607 | return errno; |
| 4608 | |
| 4609 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4610 | checkpoint_iface_change_wait_time(hdd_ctx); |
| 4611 | |
| 4612 | return enable ? |
| 4613 | hdd_hastings_war_enable(hdd_ctx) : |
| 4614 | hdd_hastings_war_disable(hdd_ctx); |
| 4615 | } |
| 4616 | #endif |
| 4617 | |
Jeff Johnson | 5bee39b | 2018-10-23 12:34:38 -0700 | [diff] [blame] | 4618 | static int hdd_we_set_tm_level(struct hdd_adapter *adapter, int level) |
| 4619 | { |
| 4620 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4621 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4622 | QDF_STATUS status; |
| 4623 | |
| 4624 | if (!mac_handle) |
| 4625 | return -EINVAL; |
| 4626 | |
| 4627 | hdd_debug("Thermal Mitigation Level %d", level); |
| 4628 | status = sme_set_thermal_level(mac_handle, level); |
| 4629 | if (QDF_IS_STATUS_ERROR(status)) |
| 4630 | hdd_err("cfg set failed, value %d status %d", level, status); |
| 4631 | |
| 4632 | return qdf_status_to_os_return(status); |
| 4633 | } |
| 4634 | |
Jeff Johnson | 3891264 | 2018-10-24 15:01:40 -0700 | [diff] [blame] | 4635 | static int hdd_we_set_nss(struct hdd_adapter *adapter, int nss) |
| 4636 | { |
| 4637 | QDF_STATUS status; |
| 4638 | |
| 4639 | hdd_debug("NSS %d", nss); |
| 4640 | |
| 4641 | if ((nss > 2) || (nss <= 0)) { |
| 4642 | hdd_err("Invalid NSS: %d", nss); |
| 4643 | return -EINVAL; |
| 4644 | } |
| 4645 | |
| 4646 | status = hdd_update_nss(adapter, nss); |
| 4647 | if (QDF_IS_STATUS_ERROR(status)) |
| 4648 | hdd_err("cfg set failed, value %d status %d", nss, status); |
| 4649 | |
| 4650 | return qdf_status_to_os_return(status); |
| 4651 | } |
| 4652 | |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4653 | static int hdd_we_set_short_gi(struct hdd_adapter *adapter, int sgi) |
| 4654 | { |
| 4655 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
| 4656 | int errno; |
| 4657 | |
| 4658 | hdd_debug("Short GI %d", sgi); |
| 4659 | |
| 4660 | if (!mac_handle) { |
| 4661 | hdd_err("NULL Mac handle"); |
| 4662 | return -EINVAL; |
| 4663 | } |
| 4664 | |
| 4665 | if (sgi & HDD_AUTO_RATE_SGI) |
| 4666 | errno = sme_set_auto_rate_he_sgi(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4667 | adapter->vdev_id, |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4668 | sgi); |
| 4669 | else |
| 4670 | errno = sme_update_ht_config(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4671 | adapter->vdev_id, |
Jeff Johnson | ce996b3 | 2018-10-25 10:52:40 -0700 | [diff] [blame] | 4672 | WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, |
| 4673 | sgi); |
| 4674 | if (errno) |
| 4675 | hdd_err("cfg set failed, value %d status %d", sgi, errno); |
| 4676 | |
| 4677 | return errno; |
| 4678 | } |
| 4679 | |
Jeff Johnson | 71d8038 | 2018-10-25 15:45:01 -0700 | [diff] [blame] | 4680 | static int hdd_we_set_rtscts(struct hdd_adapter *adapter, int rtscts) |
| 4681 | { |
| 4682 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4683 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4684 | uint32_t value; |
| 4685 | uint32_t rts_threshold_val; |
| 4686 | QDF_STATUS status; |
| 4687 | int errno; |
| 4688 | |
| 4689 | hdd_debug("RTSCTS %d", rtscts); |
| 4690 | |
| 4691 | if (!mac_handle) { |
| 4692 | hdd_err("NULL Mac handle"); |
| 4693 | return -EINVAL; |
| 4694 | } |
| 4695 | |
| 4696 | status = ucfg_mlme_get_rts_threshold(hdd_ctx->psoc, |
| 4697 | &rts_threshold_val); |
| 4698 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4699 | hdd_err("Get rts threshold failed, status %d", status); |
| 4700 | return -EINVAL; |
| 4701 | } |
| 4702 | |
| 4703 | if ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_RTSCTS_ENABLE) { |
| 4704 | value = rts_threshold_val; |
| 4705 | } else if (((rtscts & HDD_RTSCTS_EN_MASK) == 0) || |
| 4706 | ((rtscts & HDD_RTSCTS_EN_MASK) == HDD_CTS_ENABLE)) { |
| 4707 | value = cfg_max(CFG_RTS_THRESHOLD); |
| 4708 | } else { |
| 4709 | hdd_err_rl("Invalid value %d", rtscts); |
| 4710 | return -EINVAL; |
| 4711 | } |
| 4712 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4713 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 71d8038 | 2018-10-25 15:45:01 -0700 | [diff] [blame] | 4714 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 4715 | rtscts, VDEV_CMD); |
| 4716 | if (errno) { |
| 4717 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4718 | return errno; |
| 4719 | } |
| 4720 | |
| 4721 | status = ucfg_mlme_set_rts_threshold(hdd_ctx->psoc, value); |
| 4722 | if (QDF_IS_STATUS_ERROR(status)) { |
| 4723 | hdd_err("Set rts threshold failed, status %d", status); |
| 4724 | return -EINVAL; |
| 4725 | } |
| 4726 | |
| 4727 | return 0; |
| 4728 | } |
| 4729 | |
Jeff Johnson | 50b1588 | 2018-10-26 10:27:37 -0700 | [diff] [blame] | 4730 | static int hdd_we_set_11n_rate(struct hdd_adapter *adapter, int rate_code) |
| 4731 | { |
| 4732 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4733 | int errno; |
| 4734 | |
| 4735 | hdd_debug("Rate code %d", rate_code); |
| 4736 | |
| 4737 | if (rate_code != 0xff) { |
| 4738 | rix = RC_2_RATE_IDX(rate_code); |
| 4739 | if (rate_code & 0x80) { |
| 4740 | preamble = WMI_RATE_PREAMBLE_HT; |
| 4741 | nss = HT_RC_2_STREAMS(rate_code) - 1; |
| 4742 | } else { |
| 4743 | nss = 0; |
| 4744 | rix = RC_2_RATE_IDX(rate_code); |
| 4745 | if (rate_code & 0x10) { |
| 4746 | preamble = WMI_RATE_PREAMBLE_CCK; |
| 4747 | if (rix != 0x3) |
| 4748 | /* Enable Short preamble |
| 4749 | * always for CCK except 1mbps |
| 4750 | */ |
| 4751 | rix |= 0x4; |
| 4752 | } else { |
| 4753 | preamble = WMI_RATE_PREAMBLE_OFDM; |
| 4754 | } |
| 4755 | } |
| 4756 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4757 | } |
| 4758 | |
| 4759 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4760 | rate_code, rix, preamble, nss); |
| 4761 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4762 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 50b1588 | 2018-10-26 10:27:37 -0700 | [diff] [blame] | 4763 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4764 | rate_code, VDEV_CMD); |
| 4765 | if (errno) |
| 4766 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4767 | |
| 4768 | return errno; |
| 4769 | } |
| 4770 | |
Jeff Johnson | bd2c991 | 2018-10-26 12:34:36 -0700 | [diff] [blame] | 4771 | static int hdd_we_set_vht_rate(struct hdd_adapter *adapter, int rate_code) |
| 4772 | { |
| 4773 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4774 | int errno; |
| 4775 | |
| 4776 | hdd_debug("Rate code %d", rate_code); |
| 4777 | |
| 4778 | if (rate_code != 0xff) { |
| 4779 | rix = RC_2_RATE_IDX_11AC(rate_code); |
| 4780 | preamble = WMI_RATE_PREAMBLE_VHT; |
| 4781 | nss = HT_RC_2_STREAMS_11AC(rate_code) - 1; |
| 4782 | rate_code = hdd_assemble_rate_code(preamble, nss, rix); |
| 4783 | } |
| 4784 | |
| 4785 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
| 4786 | rate_code, rix, preamble, nss); |
| 4787 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4788 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | bd2c991 | 2018-10-26 12:34:36 -0700 | [diff] [blame] | 4789 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4790 | rate_code, VDEV_CMD); |
| 4791 | if (errno) |
| 4792 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4793 | |
| 4794 | return errno; |
| 4795 | } |
| 4796 | |
Jeff Johnson | 7c43350 | 2018-11-12 15:00:52 -0800 | [diff] [blame] | 4797 | static int hdd_we_set_ampdu(struct hdd_adapter *adapter, int ampdu) |
| 4798 | { |
| 4799 | hdd_debug("AMPDU %d", ampdu); |
| 4800 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4801 | return wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | 7c43350 | 2018-11-12 15:00:52 -0800 | [diff] [blame] | 4802 | GEN_VDEV_PARAM_AMPDU, |
| 4803 | ampdu, GEN_CMD); |
| 4804 | } |
| 4805 | |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4806 | static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) |
| 4807 | { |
| 4808 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4809 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
| 4810 | int errno; |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4811 | QDF_STATUS status; |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4812 | |
| 4813 | hdd_debug("AMSDU %d", amsdu); |
| 4814 | |
| 4815 | if (!mac_handle) { |
| 4816 | hdd_err("NULL Mac handle"); |
| 4817 | return -EINVAL; |
| 4818 | } |
| 4819 | |
| 4820 | if (amsdu > 1) |
| 4821 | sme_set_amsdu(mac_handle, true); |
| 4822 | else |
| 4823 | sme_set_amsdu(mac_handle, false); |
| 4824 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4825 | errno = wma_cli_set_command(adapter->vdev_id, |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4826 | GEN_VDEV_PARAM_AMSDU, |
| 4827 | amsdu, GEN_CMD); |
| 4828 | if (errno) { |
| 4829 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4830 | return errno; |
| 4831 | } |
| 4832 | |
Vignesh Viswanathan | ddc89e5 | 2018-11-02 18:43:42 +0530 | [diff] [blame] | 4833 | status = ucfg_mlme_set_max_amsdu_num(hdd_ctx->psoc, |
| 4834 | amsdu); |
| 4835 | if (QDF_IS_STATUS_ERROR(status)) |
| 4836 | hdd_err("Failed to set Max AMSDU Num to cfg"); |
Jeff Johnson | fc6480b | 2018-10-26 12:52:35 -0700 | [diff] [blame] | 4837 | |
| 4838 | return 0; |
| 4839 | } |
| 4840 | |
Jeff Johnson | cb598fd | 2018-10-29 10:09:07 -0700 | [diff] [blame] | 4841 | static int hdd_we_clear_stats(struct hdd_adapter *adapter, int option) |
| 4842 | { |
| 4843 | hdd_debug("option %d", option); |
| 4844 | |
| 4845 | switch (option) { |
| 4846 | case CDP_HDD_STATS: |
| 4847 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
| 4848 | memset(&adapter->hdd_stats, 0, sizeof(adapter->hdd_stats)); |
| 4849 | break; |
| 4850 | case CDP_TXRX_HIST_STATS: |
| 4851 | wlan_hdd_clear_tx_rx_histogram(adapter->hdd_ctx); |
| 4852 | break; |
| 4853 | case CDP_HDD_NETIF_OPER_HISTORY: |
| 4854 | wlan_hdd_clear_netif_queue_history(adapter->hdd_ctx); |
| 4855 | break; |
| 4856 | case CDP_HIF_STATS: |
| 4857 | hdd_clear_hif_stats(); |
| 4858 | break; |
| 4859 | case CDP_NAPI_STATS: |
| 4860 | hdd_clear_napi_stats(); |
| 4861 | break; |
| 4862 | default: |
| 4863 | cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 4864 | option); |
| 4865 | } |
| 4866 | |
| 4867 | return 0; |
| 4868 | } |
| 4869 | |
Jeff Johnson | 1a05fda | 2018-11-01 07:53:00 -0700 | [diff] [blame] | 4870 | static int hdd_we_set_green_tx_param(struct hdd_adapter *adapter, |
| 4871 | green_tx_param id, |
| 4872 | const char *id_string, |
| 4873 | int value) |
| 4874 | { |
| 4875 | int errno; |
| 4876 | |
| 4877 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4878 | errno = wma_cli_set_command(adapter->vdev_id, id, value, GTX_CMD); |
Jeff Johnson | 1a05fda | 2018-11-01 07:53:00 -0700 | [diff] [blame] | 4879 | if (errno) |
| 4880 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4881 | |
| 4882 | return errno; |
| 4883 | } |
| 4884 | |
| 4885 | #define hdd_we_set_green_tx_param(adapter, id, value) \ |
| 4886 | hdd_we_set_green_tx_param(adapter, id, #id, value) |
| 4887 | |
| 4888 | static int hdd_we_set_gtx_ht_mcs(struct hdd_adapter *adapter, int value) |
| 4889 | { |
| 4890 | return hdd_we_set_green_tx_param(adapter, |
| 4891 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 4892 | value); |
| 4893 | } |
| 4894 | |
| 4895 | static int hdd_we_set_gtx_vht_mcs(struct hdd_adapter *adapter, int value) |
| 4896 | { |
| 4897 | return hdd_we_set_green_tx_param(adapter, |
| 4898 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 4899 | value); |
| 4900 | } |
| 4901 | |
| 4902 | static int hdd_we_set_gtx_usrcfg(struct hdd_adapter *adapter, int value) |
| 4903 | { |
| 4904 | return hdd_we_set_green_tx_param(adapter, |
| 4905 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 4906 | value); |
| 4907 | } |
| 4908 | |
| 4909 | static int hdd_we_set_gtx_thre(struct hdd_adapter *adapter, int value) |
| 4910 | { |
| 4911 | return hdd_we_set_green_tx_param(adapter, |
| 4912 | WMI_VDEV_PARAM_GTX_THRE, |
| 4913 | value); |
| 4914 | } |
| 4915 | |
| 4916 | static int hdd_we_set_gtx_margin(struct hdd_adapter *adapter, int value) |
| 4917 | { |
| 4918 | return hdd_we_set_green_tx_param(adapter, |
| 4919 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 4920 | value); |
| 4921 | } |
| 4922 | |
| 4923 | static int hdd_we_set_gtx_step(struct hdd_adapter *adapter, int value) |
| 4924 | { |
| 4925 | return hdd_we_set_green_tx_param(adapter, |
| 4926 | WMI_VDEV_PARAM_GTX_STEP, |
| 4927 | value); |
| 4928 | } |
| 4929 | |
| 4930 | static int hdd_we_set_gtx_mintpc(struct hdd_adapter *adapter, int value) |
| 4931 | { |
| 4932 | return hdd_we_set_green_tx_param(adapter, |
| 4933 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 4934 | value); |
| 4935 | } |
| 4936 | |
| 4937 | static int hdd_we_set_gtx_bwmask(struct hdd_adapter *adapter, int value) |
| 4938 | { |
| 4939 | return hdd_we_set_green_tx_param(adapter, |
| 4940 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 4941 | value); |
| 4942 | } |
| 4943 | |
Jeff Johnson | d0477f2 | 2018-10-29 12:26:25 -0700 | [diff] [blame] | 4944 | static int hdd_we_packet_power_save(struct hdd_adapter *adapter, |
| 4945 | packet_power_save id, |
| 4946 | const char *id_string, |
| 4947 | int value) |
| 4948 | { |
| 4949 | int errno; |
| 4950 | |
| 4951 | if (adapter->device_mode != QDF_STA_MODE) { |
| 4952 | hdd_err_rl("Not supported in mode %d", adapter->device_mode); |
| 4953 | return -EINVAL; |
| 4954 | } |
| 4955 | |
| 4956 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 4957 | errno = wma_cli_set_command(adapter->vdev_id, id, value, PPS_CMD); |
Jeff Johnson | d0477f2 | 2018-10-29 12:26:25 -0700 | [diff] [blame] | 4958 | if (errno) |
| 4959 | hdd_err("Failed to set firmware, errno %d", errno); |
| 4960 | |
| 4961 | return errno; |
| 4962 | } |
| 4963 | |
| 4964 | #define hdd_we_packet_power_save(adapter, id, value) \ |
| 4965 | hdd_we_packet_power_save(adapter, id, #id, value) |
| 4966 | |
| 4967 | static int hdd_we_pps_paid_match(struct hdd_adapter *adapter, int value) |
| 4968 | { |
| 4969 | return hdd_we_packet_power_save(adapter, |
| 4970 | WMI_VDEV_PPS_PAID_MATCH, |
| 4971 | value); |
| 4972 | } |
| 4973 | |
| 4974 | static int hdd_we_pps_gid_match(struct hdd_adapter *adapter, int value) |
| 4975 | { |
| 4976 | return hdd_we_packet_power_save(adapter, |
| 4977 | WMI_VDEV_PPS_GID_MATCH, |
| 4978 | value); |
| 4979 | } |
| 4980 | |
| 4981 | static int hdd_we_pps_early_tim_clear(struct hdd_adapter *adapter, int value) |
| 4982 | { |
| 4983 | return hdd_we_packet_power_save(adapter, |
| 4984 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 4985 | value); |
| 4986 | } |
| 4987 | |
| 4988 | static int hdd_we_pps_early_dtim_clear(struct hdd_adapter *adapter, int value) |
| 4989 | { |
| 4990 | return hdd_we_packet_power_save(adapter, |
| 4991 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 4992 | value); |
| 4993 | } |
| 4994 | |
| 4995 | static int hdd_we_pps_eof_pad_delim(struct hdd_adapter *adapter, int value) |
| 4996 | { |
| 4997 | return hdd_we_packet_power_save(adapter, |
| 4998 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 4999 | value); |
| 5000 | } |
| 5001 | |
| 5002 | static int hdd_we_pps_macaddr_mismatch(struct hdd_adapter *adapter, int value) |
| 5003 | { |
| 5004 | return hdd_we_packet_power_save(adapter, |
| 5005 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 5006 | value); |
| 5007 | } |
| 5008 | |
| 5009 | static int hdd_we_pps_delim_crc_fail(struct hdd_adapter *adapter, int value) |
| 5010 | { |
| 5011 | return hdd_we_packet_power_save(adapter, |
| 5012 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 5013 | value); |
| 5014 | } |
| 5015 | |
| 5016 | static int hdd_we_pps_gid_nsts_zero(struct hdd_adapter *adapter, int value) |
| 5017 | { |
| 5018 | return hdd_we_packet_power_save(adapter, |
| 5019 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 5020 | value); |
| 5021 | } |
| 5022 | |
| 5023 | static int hdd_we_pps_rssi_check(struct hdd_adapter *adapter, int value) |
| 5024 | { |
| 5025 | return hdd_we_packet_power_save(adapter, |
| 5026 | WMI_VDEV_PPS_RSSI_CHECK, |
| 5027 | value); |
| 5028 | } |
| 5029 | |
| 5030 | static int hdd_we_pps_5g_ebt(struct hdd_adapter *adapter, int value) |
| 5031 | { |
| 5032 | return hdd_we_packet_power_save(adapter, |
| 5033 | WMI_VDEV_PPS_5G_EBT, |
| 5034 | value); |
| 5035 | } |
| 5036 | |
Jeff Johnson | cc7776d | 2018-11-02 14:10:38 -0700 | [diff] [blame] | 5037 | static int hdd_we_set_qpower(struct hdd_adapter *adapter, |
| 5038 | enum wmi_sta_powersave_param id, |
| 5039 | const char *id_string, |
| 5040 | int value) |
| 5041 | { |
| 5042 | int errno; |
| 5043 | |
| 5044 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5045 | errno = wma_cli_set_command(adapter->vdev_id, id, value, QPOWER_CMD); |
Jeff Johnson | cc7776d | 2018-11-02 14:10:38 -0700 | [diff] [blame] | 5046 | if (errno) |
| 5047 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5048 | |
| 5049 | return errno; |
| 5050 | } |
| 5051 | |
| 5052 | #define hdd_we_set_qpower(adapter, id, value) \ |
| 5053 | hdd_we_set_qpower(adapter, id, #id, value) |
| 5054 | |
| 5055 | static int |
| 5056 | hdd_we_set_qpower_max_pspoll_count(struct hdd_adapter *adapter, int value) |
| 5057 | { |
| 5058 | enum wmi_sta_powersave_param id = |
| 5059 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT; |
| 5060 | |
| 5061 | return hdd_we_set_qpower(adapter, id, value); |
| 5062 | } |
| 5063 | |
| 5064 | static int |
| 5065 | hdd_we_set_qpower_max_tx_before_wake(struct hdd_adapter *adapter, int value) |
| 5066 | { |
| 5067 | enum wmi_sta_powersave_param id = |
| 5068 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE; |
| 5069 | |
| 5070 | return hdd_we_set_qpower(adapter, id, value); |
| 5071 | } |
| 5072 | |
| 5073 | static int |
| 5074 | hdd_we_set_qpower_spec_pspoll_wake_interval(struct hdd_adapter *adapter, |
| 5075 | int value) |
| 5076 | { |
| 5077 | enum wmi_sta_powersave_param id = |
| 5078 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL; |
| 5079 | |
| 5080 | return hdd_we_set_qpower(adapter, id, value); |
| 5081 | } |
| 5082 | |
| 5083 | static int |
| 5084 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll(struct hdd_adapter *adapter, |
| 5085 | int value) |
| 5086 | { |
| 5087 | enum wmi_sta_powersave_param id = |
| 5088 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL; |
| 5089 | |
| 5090 | return hdd_we_set_qpower(adapter, id, value); |
| 5091 | } |
| 5092 | |
Jeff Johnson | 5d0e8cd | 2018-11-07 08:17:05 -0800 | [diff] [blame] | 5093 | static int hdd_we_set_pdev(struct hdd_adapter *adapter, |
| 5094 | WMI_PDEV_PARAM id, |
| 5095 | const char *id_string, |
| 5096 | int value) |
| 5097 | { |
| 5098 | int errno; |
| 5099 | |
| 5100 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5101 | errno = wma_cli_set_command(adapter->vdev_id, id, value, PDEV_CMD); |
Jeff Johnson | 5d0e8cd | 2018-11-07 08:17:05 -0800 | [diff] [blame] | 5102 | if (errno) |
| 5103 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5104 | |
| 5105 | return errno; |
| 5106 | } |
| 5107 | |
| 5108 | #define hdd_we_set_pdev(adapter, id, value) \ |
| 5109 | hdd_we_set_pdev(adapter, id, #id, value) |
| 5110 | |
| 5111 | static int hdd_we_set_ani_en_dis(struct hdd_adapter *adapter, int value) |
| 5112 | { |
| 5113 | return hdd_we_set_pdev(adapter, |
| 5114 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 5115 | value); |
| 5116 | } |
| 5117 | |
| 5118 | static int hdd_we_set_ani_poll_period(struct hdd_adapter *adapter, int value) |
| 5119 | { |
| 5120 | return hdd_we_set_pdev(adapter, |
| 5121 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 5122 | value); |
| 5123 | } |
| 5124 | |
| 5125 | static int hdd_we_set_ani_listen_period(struct hdd_adapter *adapter, int value) |
| 5126 | { |
| 5127 | return hdd_we_set_pdev(adapter, |
| 5128 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 5129 | value); |
| 5130 | } |
| 5131 | |
| 5132 | static int hdd_we_set_ani_ofdm_level(struct hdd_adapter *adapter, int value) |
| 5133 | { |
| 5134 | return hdd_we_set_pdev(adapter, |
| 5135 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 5136 | value); |
| 5137 | } |
| 5138 | |
| 5139 | static int hdd_we_set_ani_cck_level(struct hdd_adapter *adapter, int value) |
| 5140 | { |
| 5141 | return hdd_we_set_pdev(adapter, |
| 5142 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 5143 | value); |
| 5144 | } |
| 5145 | |
| 5146 | static int hdd_we_set_dynamic_bw(struct hdd_adapter *adapter, int value) |
| 5147 | { |
| 5148 | return hdd_we_set_pdev(adapter, |
| 5149 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 5150 | value); |
| 5151 | } |
| 5152 | |
| 5153 | static int hdd_we_set_cts_cbw(struct hdd_adapter *adapter, int value) |
| 5154 | { |
| 5155 | return hdd_we_set_pdev(adapter, |
| 5156 | WMI_PDEV_PARAM_CTS_CBW, |
| 5157 | value); |
| 5158 | } |
| 5159 | |
| 5160 | static int hdd_we_set_tx_chainmask(struct hdd_adapter *adapter, int value) |
| 5161 | { |
| 5162 | int errno; |
| 5163 | |
| 5164 | errno = hdd_we_set_pdev(adapter, |
| 5165 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 5166 | value); |
| 5167 | if (errno) |
| 5168 | return errno; |
| 5169 | |
| 5170 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 5171 | } |
| 5172 | |
| 5173 | static int hdd_we_set_rx_chainmask(struct hdd_adapter *adapter, int value) |
| 5174 | { |
| 5175 | int errno; |
| 5176 | |
| 5177 | errno = hdd_we_set_pdev(adapter, |
| 5178 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 5179 | value); |
| 5180 | if (errno) |
| 5181 | return errno; |
| 5182 | |
| 5183 | return hdd_set_antenna_mode(adapter, adapter->hdd_ctx, value); |
| 5184 | } |
| 5185 | |
| 5186 | static int hdd_we_set_txpow_2g(struct hdd_adapter *adapter, int value) |
| 5187 | { |
| 5188 | return hdd_we_set_pdev(adapter, |
| 5189 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 5190 | value); |
| 5191 | } |
| 5192 | |
| 5193 | static int hdd_we_set_txpow_5g(struct hdd_adapter *adapter, int value) |
| 5194 | { |
| 5195 | return hdd_we_set_pdev(adapter, |
| 5196 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 5197 | value); |
| 5198 | } |
| 5199 | |
Jeff Johnson | 2e38127 | 2018-11-10 09:33:39 -0800 | [diff] [blame] | 5200 | static int hdd_we_set_vdev(struct hdd_adapter *adapter, |
| 5201 | int id, |
| 5202 | const char *id_string, |
| 5203 | int value) |
| 5204 | { |
| 5205 | int errno; |
| 5206 | |
| 5207 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5208 | errno = wma_cli_set_command(adapter->vdev_id, id, value, VDEV_CMD); |
Jeff Johnson | 2e38127 | 2018-11-10 09:33:39 -0800 | [diff] [blame] | 5209 | if (errno) |
| 5210 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5211 | |
| 5212 | return errno; |
| 5213 | } |
| 5214 | |
| 5215 | #define hdd_we_set_vdev(adapter, id, value) \ |
| 5216 | hdd_we_set_vdev(adapter, id, #id, value) |
| 5217 | |
| 5218 | static int hdd_we_set_txrx_fwstats(struct hdd_adapter *adapter, int value) |
| 5219 | { |
| 5220 | return hdd_we_set_vdev(adapter, |
| 5221 | WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID, |
| 5222 | value); |
| 5223 | } |
| 5224 | |
| 5225 | static int hdd_we_txrx_fwstats_reset(struct hdd_adapter *adapter, int value) |
| 5226 | { |
| 5227 | return hdd_we_set_vdev(adapter, |
| 5228 | WMA_VDEV_TXRX_FWSTATS_RESET_CMDID, |
| 5229 | value); |
| 5230 | } |
| 5231 | |
| 5232 | static int hdd_we_set_htsmps(struct hdd_adapter *adapter, int value) |
| 5233 | { |
| 5234 | return hdd_we_set_vdev(adapter, |
| 5235 | WMI_STA_SMPS_FORCE_MODE_CMDID, |
| 5236 | value); |
| 5237 | } |
| 5238 | |
| 5239 | static int hdd_we_set_early_rx_adjust_enable(struct hdd_adapter *adapter, |
| 5240 | int value) |
| 5241 | { |
| 5242 | if ((value != 0) && (value != 1)) |
| 5243 | return -EINVAL; |
| 5244 | |
| 5245 | return hdd_we_set_vdev(adapter, |
| 5246 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, |
| 5247 | value); |
| 5248 | } |
| 5249 | |
| 5250 | static int hdd_we_set_early_rx_tgt_bmiss_num(struct hdd_adapter *adapter, |
| 5251 | int value) |
| 5252 | { |
| 5253 | return hdd_we_set_vdev(adapter, |
| 5254 | WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, |
| 5255 | value); |
| 5256 | } |
| 5257 | |
| 5258 | static int hdd_we_set_early_rx_bmiss_sample_cycle(struct hdd_adapter *adapter, |
| 5259 | int value) |
| 5260 | { |
| 5261 | return hdd_we_set_vdev(adapter, |
| 5262 | WMI_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 5263 | value); |
| 5264 | } |
| 5265 | |
| 5266 | static int hdd_we_set_early_rx_slop_step(struct hdd_adapter *adapter, int value) |
| 5267 | { |
| 5268 | return hdd_we_set_vdev(adapter, |
| 5269 | WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP, |
| 5270 | value); |
| 5271 | } |
| 5272 | |
| 5273 | static int hdd_we_set_early_rx_init_slop(struct hdd_adapter *adapter, int value) |
| 5274 | { |
| 5275 | return hdd_we_set_vdev(adapter, |
| 5276 | WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP, |
| 5277 | value); |
| 5278 | } |
| 5279 | |
| 5280 | static int hdd_we_set_early_rx_adjust_pause(struct hdd_adapter *adapter, |
| 5281 | int value) |
| 5282 | { |
| 5283 | if ((value != 0) && (value != 1)) |
| 5284 | return -EINVAL; |
| 5285 | |
| 5286 | return hdd_we_set_vdev(adapter, |
| 5287 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, |
| 5288 | value); |
| 5289 | } |
| 5290 | |
| 5291 | static int hdd_we_set_early_rx_drift_sample(struct hdd_adapter *adapter, |
| 5292 | int value) |
| 5293 | { |
| 5294 | return hdd_we_set_vdev(adapter, |
| 5295 | WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE, |
| 5296 | value); |
| 5297 | } |
| 5298 | |
| 5299 | static int hdd_we_set_dcm(struct hdd_adapter *adapter, int value) |
| 5300 | { |
| 5301 | return hdd_we_set_vdev(adapter, |
| 5302 | WMI_VDEV_PARAM_HE_DCM, |
| 5303 | value); |
| 5304 | } |
| 5305 | |
| 5306 | static int hdd_we_set_range_ext(struct hdd_adapter *adapter, int value) |
| 5307 | { |
| 5308 | return hdd_we_set_vdev(adapter, |
| 5309 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5310 | value); |
| 5311 | } |
| 5312 | |
Jeff Johnson | 22e57f1 | 2018-11-10 16:02:00 -0800 | [diff] [blame] | 5313 | static int hdd_we_set_dbg(struct hdd_adapter *adapter, |
| 5314 | int id, |
| 5315 | const char *id_string, |
| 5316 | int value) |
| 5317 | { |
| 5318 | int errno; |
| 5319 | |
| 5320 | hdd_debug("%s %d", id_string, value); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5321 | errno = wma_cli_set_command(adapter->vdev_id, id, value, DBG_CMD); |
Jeff Johnson | 22e57f1 | 2018-11-10 16:02:00 -0800 | [diff] [blame] | 5322 | if (errno) |
| 5323 | hdd_err("Failed to set firmware, errno %d", errno); |
| 5324 | |
| 5325 | return errno; |
| 5326 | } |
| 5327 | |
| 5328 | #define hdd_we_set_dbg(adapter, id, value) \ |
| 5329 | hdd_we_set_dbg(adapter, id, #id, value) |
| 5330 | |
| 5331 | static int hdd_we_dbglog_log_level(struct hdd_adapter *adapter, int value) |
| 5332 | { |
| 5333 | return hdd_we_set_dbg(adapter, |
| 5334 | WMI_DBGLOG_LOG_LEVEL, |
| 5335 | value); |
| 5336 | } |
| 5337 | |
| 5338 | static int hdd_we_dbglog_vap_enable(struct hdd_adapter *adapter, int value) |
| 5339 | { |
| 5340 | return hdd_we_set_dbg(adapter, |
| 5341 | WMI_DBGLOG_VAP_ENABLE, |
| 5342 | value); |
| 5343 | } |
| 5344 | |
| 5345 | static int hdd_we_dbglog_vap_disable(struct hdd_adapter *adapter, int value) |
| 5346 | { |
| 5347 | return hdd_we_set_dbg(adapter, |
| 5348 | WMI_DBGLOG_VAP_DISABLE, |
| 5349 | value); |
| 5350 | } |
| 5351 | |
| 5352 | static int hdd_we_dbglog_module_enable(struct hdd_adapter *adapter, int value) |
| 5353 | { |
| 5354 | return hdd_we_set_dbg(adapter, |
| 5355 | WMI_DBGLOG_MODULE_ENABLE, |
| 5356 | value); |
| 5357 | } |
| 5358 | |
| 5359 | static int hdd_we_dbglog_module_disable(struct hdd_adapter *adapter, int value) |
| 5360 | { |
| 5361 | return hdd_we_set_dbg(adapter, |
| 5362 | WMI_DBGLOG_MODULE_DISABLE, |
| 5363 | value); |
| 5364 | } |
| 5365 | |
| 5366 | static int hdd_we_dbglog_mod_log_level(struct hdd_adapter *adapter, int value) |
| 5367 | { |
| 5368 | return hdd_we_set_dbg(adapter, |
| 5369 | WMI_DBGLOG_MOD_LOG_LEVEL, |
| 5370 | value); |
| 5371 | } |
| 5372 | |
| 5373 | static int hdd_we_dbglog_type(struct hdd_adapter *adapter, int value) |
| 5374 | { |
| 5375 | return hdd_we_set_dbg(adapter, |
| 5376 | WMI_DBGLOG_TYPE, |
| 5377 | value); |
| 5378 | } |
| 5379 | |
| 5380 | static int hdd_we_dbglog_report_enable(struct hdd_adapter *adapter, int value) |
| 5381 | { |
| 5382 | return hdd_we_set_dbg(adapter, |
| 5383 | WMI_DBGLOG_REPORT_ENABLE, |
| 5384 | value); |
| 5385 | } |
| 5386 | |
| 5387 | static int hdd_we_start_fw_profile(struct hdd_adapter *adapter, int value) |
| 5388 | { |
| 5389 | return hdd_we_set_dbg(adapter, |
| 5390 | WMI_WLAN_PROFILE_TRIGGER_CMDID, |
| 5391 | value); |
| 5392 | } |
| 5393 | |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5394 | static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel) |
| 5395 | { |
| 5396 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5397 | QDF_STATUS status; |
| 5398 | |
| 5399 | hdd_debug("Set Channel %d Session ID %d mode %d", channel, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5400 | adapter->vdev_id, adapter->device_mode); |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5401 | |
| 5402 | if (!hdd_ctx->mac_handle) |
| 5403 | return -EINVAL; |
| 5404 | |
| 5405 | switch (adapter->device_mode) { |
| 5406 | case QDF_STA_MODE: |
| 5407 | case QDF_P2P_CLIENT_MODE: |
| 5408 | /* supported */ |
| 5409 | break; |
| 5410 | default: |
| 5411 | hdd_err("change channel not supported for device mode %d", |
| 5412 | adapter->device_mode); |
| 5413 | return -EINVAL; |
| 5414 | } |
| 5415 | |
| 5416 | status = sme_ext_change_channel(hdd_ctx->mac_handle, channel, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5417 | adapter->vdev_id); |
Jeff Johnson | 274a1d6 | 2018-11-12 20:31:51 -0800 | [diff] [blame] | 5418 | if (status != QDF_STATUS_SUCCESS) |
| 5419 | hdd_err("Error in change channel status %d", status); |
| 5420 | |
| 5421 | return qdf_status_to_os_return(status); |
| 5422 | } |
| 5423 | |
Jeff Johnson | 0e07ca1 | 2018-11-12 21:04:45 -0800 | [diff] [blame] | 5424 | static int hdd_we_mcc_config_latency(struct hdd_adapter *adapter, int latency) |
| 5425 | { |
| 5426 | hdd_debug("MCC latency %d", latency); |
| 5427 | |
| 5428 | wlan_hdd_set_mcc_latency(adapter, latency); |
| 5429 | |
| 5430 | return 0; |
| 5431 | } |
| 5432 | |
| 5433 | static int hdd_we_mcc_config_quota(struct hdd_adapter *adapter, int quota) |
| 5434 | { |
| 5435 | hdd_debug("MCC quota %dms", quota); |
| 5436 | |
| 5437 | return wlan_hdd_set_mcc_p2p_quota(adapter, quota); |
| 5438 | } |
| 5439 | |
Jeff Johnson | 33ec198 | 2018-11-12 21:40:33 -0800 | [diff] [blame] | 5440 | static int hdd_we_set_debug_log(struct hdd_adapter *adapter, int value) |
| 5441 | { |
| 5442 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5443 | |
| 5444 | if (!hdd_ctx->mac_handle) |
| 5445 | return -EINVAL; |
| 5446 | |
| 5447 | sme_update_connect_debug(hdd_ctx->mac_handle, value); |
| 5448 | |
| 5449 | return 0; |
| 5450 | } |
| 5451 | |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5452 | static int hdd_we_set_scan_disable(struct hdd_adapter *adapter, int value) |
| 5453 | { |
| 5454 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5455 | |
| 5456 | hdd_debug("%d", value); |
| 5457 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5458 | if (!hdd_ctx->psoc) |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5459 | return -EINVAL; |
| 5460 | |
Abhishek Singh | 935e477 | 2018-11-21 14:14:10 +0530 | [diff] [blame] | 5461 | if (value) |
| 5462 | ucfg_scan_psoc_set_disable(hdd_ctx->psoc, REASON_USER_SPACE); |
| 5463 | else |
| 5464 | ucfg_scan_psoc_set_enable(hdd_ctx->psoc, REASON_USER_SPACE); |
Jeff Johnson | e50951c | 2018-11-13 12:20:23 -0800 | [diff] [blame] | 5465 | |
| 5466 | return 0; |
| 5467 | } |
| 5468 | |
Jeff Johnson | d3f1efd | 2018-11-13 13:26:19 -0800 | [diff] [blame] | 5469 | static int hdd_we_set_conc_system_pref(struct hdd_adapter *adapter, |
| 5470 | int preference) |
| 5471 | { |
| 5472 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5473 | |
| 5474 | hdd_debug("%d", preference); |
| 5475 | |
| 5476 | if (!hdd_ctx->psoc) |
| 5477 | return -EINVAL; |
| 5478 | |
| 5479 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, preference); |
| 5480 | |
| 5481 | return 0; |
| 5482 | } |
| 5483 | |
Jeff Johnson | 74696bb | 2018-11-13 13:30:36 -0800 | [diff] [blame] | 5484 | static int hdd_we_set_11ax_rate(struct hdd_adapter *adapter, int rate) |
| 5485 | { |
| 5486 | return hdd_set_11ax_rate(adapter, rate, NULL); |
| 5487 | } |
| 5488 | |
Jeff Johnson | b43ec12 | 2018-11-13 14:17:08 -0800 | [diff] [blame] | 5489 | static int hdd_we_set_modulated_dtim(struct hdd_adapter *adapter, int value) |
| 5490 | { |
| 5491 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5492 | |
| 5493 | hdd_debug("%d", value); |
| 5494 | |
| 5495 | if (!hdd_ctx->psoc) |
| 5496 | return -EINVAL; |
| 5497 | |
| 5498 | if ((value < cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM)) || |
| 5499 | (value > cfg_max(CFG_PMO_ENABLE_MODULATED_DTIM))) { |
| 5500 | hdd_err("Invalid value %d", value); |
| 5501 | return -EINVAL; |
| 5502 | } |
| 5503 | |
| 5504 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, value); |
| 5505 | |
| 5506 | return 0; |
| 5507 | } |
| 5508 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5509 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5510 | /** |
| 5511 | * hdd_we_motion_det_start_stop - start/stop motion detection |
| 5512 | * @adapter: hdd adapter |
| 5513 | * @value: start/stop value to set |
| 5514 | * |
| 5515 | * Return: 0 on success, error on failure |
| 5516 | */ |
| 5517 | static int hdd_we_motion_det_start_stop(struct hdd_adapter *adapter, int value) |
| 5518 | { |
| 5519 | struct sme_motion_det_en motion_det; |
| 5520 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5521 | |
| 5522 | if (value < 0 || value > 1) { |
| 5523 | hdd_err("Invalid value %d in mt_start", value); |
| 5524 | return -EINVAL; |
| 5525 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5526 | motion_det.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5527 | motion_det.enable = value; |
| 5528 | |
| 5529 | if (!value) |
| 5530 | adapter->motion_detection_mode = 0; |
| 5531 | |
| 5532 | sme_motion_det_enable(hdd_ctx->mac_handle, &motion_det); |
| 5533 | |
| 5534 | return 0; |
| 5535 | } |
| 5536 | |
| 5537 | /** |
| 5538 | * hdd_we_motion_det_base_line_start_stop - start/stop md baselining |
| 5539 | * @adapter: hdd adapter |
| 5540 | * @value: start/stop value to set |
| 5541 | * |
| 5542 | * Return: 0 on success, error on failure |
| 5543 | */ |
| 5544 | static int hdd_we_motion_det_base_line_start_stop(struct hdd_adapter *adapter, |
| 5545 | int value) |
| 5546 | { |
| 5547 | struct sme_motion_det_base_line_en motion_det_base_line; |
| 5548 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 5549 | |
| 5550 | if (value < 0 || value > 1) { |
| 5551 | hdd_err("Invalid value %d in mt_bl_start", value); |
| 5552 | return -EINVAL; |
| 5553 | } |
| 5554 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 5555 | motion_det_base_line.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5556 | motion_det_base_line.enable = value; |
| 5557 | sme_motion_det_base_line_enable(hdd_ctx->mac_handle, |
| 5558 | &motion_det_base_line); |
| 5559 | |
| 5560 | return 0; |
| 5561 | } |
| 5562 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
| 5563 | |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 5564 | int wlan_hdd_set_btcoex_mode(struct hdd_adapter *adapter, int value) |
| 5565 | { |
| 5566 | struct coex_config_params coex_cfg_params = {0}; |
| 5567 | |
| 5568 | coex_cfg_params.config_type = WMI_COEX_CONFIG_BTC_MODE; |
| 5569 | coex_cfg_params.config_arg1 = value; |
| 5570 | coex_cfg_params.vdev_id = adapter->vdev_id; |
| 5571 | |
| 5572 | if (value < cfg_min(CFG_BTC_MODE) || value > cfg_max(CFG_BTC_MODE)) { |
| 5573 | hdd_err_rl("Invalid value %d", value); |
| 5574 | return -EINVAL; |
| 5575 | } |
| 5576 | |
| 5577 | if (QDF_IS_STATUS_ERROR(sme_send_coex_config_cmd(&coex_cfg_params))) { |
| 5578 | hdd_err_rl("Failed to send coex BTC mode"); |
| 5579 | return -EINVAL; |
| 5580 | } |
| 5581 | |
| 5582 | return 0; |
| 5583 | } |
| 5584 | |
| 5585 | int wlan_hdd_set_btcoex_rssi_threshold(struct hdd_adapter *adapter, int value) |
| 5586 | { |
| 5587 | struct coex_config_params coex_cfg_params = {0}; |
| 5588 | |
| 5589 | coex_cfg_params.config_type = WMI_COEX_CONFIG_BT_LOW_RSSI_THRESHOLD; |
| 5590 | coex_cfg_params.config_arg1 = value; |
| 5591 | coex_cfg_params.vdev_id = adapter->vdev_id; |
| 5592 | |
| 5593 | if (value < cfg_min(CFG_WLAN_LOW_RSSI_THRESHOLD) || |
| 5594 | value > cfg_max(CFG_WLAN_LOW_RSSI_THRESHOLD)) { |
| 5595 | hdd_err_rl("Invalid value %d", value); |
| 5596 | return -EINVAL; |
| 5597 | } |
| 5598 | |
| 5599 | if (QDF_IS_STATUS_ERROR(sme_send_coex_config_cmd(&coex_cfg_params))) { |
| 5600 | hdd_err_rl("Failed to send coex BTC RSSI Threshold"); |
| 5601 | return -EINVAL; |
| 5602 | } |
| 5603 | return 0; |
| 5604 | } |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5605 | typedef int (*setint_getnone_fn)(struct hdd_adapter *adapter, int value); |
| 5606 | static const setint_getnone_fn setint_getnone_cb[] = { |
| 5607 | [WE_SET_11D_STATE] = hdd_we_set_11d_state, |
| 5608 | [WE_SET_POWER] = hdd_we_set_power, |
| 5609 | [WE_SET_MAX_ASSOC] = hdd_we_set_max_assoc, |
| 5610 | [WE_SET_DATA_INACTIVITY_TO] = hdd_we_set_data_inactivity_timeout, |
| 5611 | [WE_SET_WOW_DATA_INACTIVITY_TO] = |
| 5612 | hdd_we_set_wow_data_inactivity_timeout, |
| 5613 | [WE_SET_MC_RATE] = wlan_hdd_set_mc_rate, |
| 5614 | [WE_SET_TX_POWER] = hdd_we_set_tx_power, |
| 5615 | [WE_SET_MAX_TX_POWER] = hdd_we_set_max_tx_power, |
| 5616 | [WE_SET_MAX_TX_POWER_2_4] = hdd_we_set_max_tx_power_2_4, |
| 5617 | [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] | 5618 | #ifdef HASTINGS_BT_WAR |
| 5619 | [WE_SET_HASTINGS_BT_WAR] = hdd_we_set_hastings_bt_war, |
| 5620 | #endif |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5621 | [WE_SET_TM_LEVEL] = hdd_we_set_tm_level, |
| 5622 | [WE_SET_PHYMODE] = wlan_hdd_update_phymode, |
| 5623 | [WE_SET_NSS] = hdd_we_set_nss, |
| 5624 | [WE_SET_GTX_HT_MCS] = hdd_we_set_gtx_ht_mcs, |
| 5625 | [WE_SET_GTX_VHT_MCS] = hdd_we_set_gtx_vht_mcs, |
| 5626 | [WE_SET_GTX_USRCFG] = hdd_we_set_gtx_usrcfg, |
| 5627 | [WE_SET_GTX_THRE] = hdd_we_set_gtx_thre, |
| 5628 | [WE_SET_GTX_MARGIN] = hdd_we_set_gtx_margin, |
| 5629 | [WE_SET_GTX_STEP] = hdd_we_set_gtx_step, |
| 5630 | [WE_SET_GTX_MINTPC] = hdd_we_set_gtx_mintpc, |
| 5631 | [WE_SET_GTX_BWMASK] = hdd_we_set_gtx_bwmask, |
| 5632 | [WE_SET_LDPC] = hdd_set_ldpc, |
| 5633 | [WE_SET_TX_STBC] = hdd_set_tx_stbc, |
| 5634 | [WE_SET_RX_STBC] = hdd_set_rx_stbc, |
| 5635 | [WE_SET_SHORT_GI] = hdd_we_set_short_gi, |
| 5636 | [WE_SET_RTSCTS] = hdd_we_set_rtscts, |
| 5637 | [WE_SET_CHWIDTH] = hdd_we_set_ch_width, |
| 5638 | [WE_SET_ANI_EN_DIS] = hdd_we_set_ani_en_dis, |
| 5639 | [WE_SET_ANI_POLL_PERIOD] = hdd_we_set_ani_poll_period, |
| 5640 | [WE_SET_ANI_LISTEN_PERIOD] = hdd_we_set_ani_listen_period, |
| 5641 | [WE_SET_ANI_OFDM_LEVEL] = hdd_we_set_ani_ofdm_level, |
| 5642 | [WE_SET_ANI_CCK_LEVEL] = hdd_we_set_ani_cck_level, |
| 5643 | [WE_SET_DYNAMIC_BW] = hdd_we_set_dynamic_bw, |
| 5644 | [WE_SET_CTS_CBW] = hdd_we_set_cts_cbw, |
| 5645 | [WE_SET_11N_RATE] = hdd_we_set_11n_rate, |
| 5646 | [WE_SET_VHT_RATE] = hdd_we_set_vht_rate, |
| 5647 | [WE_SET_AMPDU] = hdd_we_set_ampdu, |
| 5648 | [WE_SET_AMSDU] = hdd_we_set_amsdu, |
| 5649 | [WE_SET_TX_CHAINMASK] = hdd_we_set_tx_chainmask, |
| 5650 | [WE_SET_RX_CHAINMASK] = hdd_we_set_rx_chainmask, |
| 5651 | [WE_SET_TXPOW_2G] = hdd_we_set_txpow_2g, |
| 5652 | [WE_SET_TXPOW_5G] = hdd_we_set_txpow_5g, |
| 5653 | [WE_DBGLOG_LOG_LEVEL] = hdd_we_dbglog_log_level, |
| 5654 | [WE_DBGLOG_VAP_ENABLE] = hdd_we_dbglog_vap_enable, |
| 5655 | [WE_DBGLOG_VAP_DISABLE] = hdd_we_dbglog_vap_disable, |
| 5656 | [WE_DBGLOG_MODULE_ENABLE] = hdd_we_dbglog_module_enable, |
| 5657 | [WE_DBGLOG_MODULE_DISABLE] = hdd_we_dbglog_module_disable, |
| 5658 | [WE_DBGLOG_MOD_LOG_LEVEL] = hdd_we_dbglog_mod_log_level, |
| 5659 | [WE_DBGLOG_TYPE] = hdd_we_dbglog_type, |
| 5660 | [WE_DBGLOG_REPORT_ENABLE] = hdd_we_dbglog_report_enable, |
| 5661 | [WE_SET_TXRX_FWSTATS] = hdd_we_set_txrx_fwstats, |
| 5662 | [WE_TXRX_FWSTATS_RESET] = hdd_we_txrx_fwstats_reset, |
| 5663 | [WE_DUMP_STATS] = hdd_wlan_dump_stats, |
| 5664 | [WE_CLEAR_STATS] = hdd_we_clear_stats, |
| 5665 | [WE_PPS_PAID_MATCH] = hdd_we_pps_paid_match, |
| 5666 | [WE_PPS_GID_MATCH] = hdd_we_pps_gid_match, |
| 5667 | [WE_PPS_EARLY_TIM_CLEAR] = hdd_we_pps_early_tim_clear, |
| 5668 | [WE_PPS_EARLY_DTIM_CLEAR] = hdd_we_pps_early_dtim_clear, |
| 5669 | [WE_PPS_EOF_PAD_DELIM] = hdd_we_pps_eof_pad_delim, |
| 5670 | [WE_PPS_MACADDR_MISMATCH] = hdd_we_pps_macaddr_mismatch, |
| 5671 | [WE_PPS_DELIM_CRC_FAIL] = hdd_we_pps_delim_crc_fail, |
| 5672 | [WE_PPS_GID_NSTS_ZERO] = hdd_we_pps_gid_nsts_zero, |
| 5673 | [WE_PPS_RSSI_CHECK] = hdd_we_pps_rssi_check, |
| 5674 | [WE_PPS_5G_EBT] = hdd_we_pps_5g_ebt, |
| 5675 | [WE_SET_HTSMPS] = hdd_we_set_htsmps, |
| 5676 | [WE_SET_QPOWER_MAX_PSPOLL_COUNT] = hdd_we_set_qpower_max_pspoll_count, |
| 5677 | [WE_SET_QPOWER_MAX_TX_BEFORE_WAKE] = |
| 5678 | hdd_we_set_qpower_max_tx_before_wake, |
| 5679 | [WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL] = |
| 5680 | hdd_we_set_qpower_spec_pspoll_wake_interval, |
| 5681 | [WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL] = |
| 5682 | hdd_we_set_qpower_spec_max_spec_nodata_pspoll, |
| 5683 | [WE_MCC_CONFIG_LATENCY] = hdd_we_mcc_config_latency, |
| 5684 | [WE_MCC_CONFIG_QUOTA] = hdd_we_mcc_config_quota, |
| 5685 | [WE_SET_DEBUG_LOG] = hdd_we_set_debug_log, |
| 5686 | [WE_SET_EARLY_RX_ADJUST_ENABLE] = hdd_we_set_early_rx_adjust_enable, |
| 5687 | [WE_SET_EARLY_RX_TGT_BMISS_NUM] = hdd_we_set_early_rx_tgt_bmiss_num, |
| 5688 | [WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE] = |
| 5689 | hdd_we_set_early_rx_bmiss_sample_cycle, |
| 5690 | [WE_SET_EARLY_RX_SLOP_STEP] = hdd_we_set_early_rx_slop_step, |
| 5691 | [WE_SET_EARLY_RX_INIT_SLOP] = hdd_we_set_early_rx_init_slop, |
| 5692 | [WE_SET_EARLY_RX_ADJUST_PAUSE] = hdd_we_set_early_rx_adjust_pause, |
| 5693 | [WE_SET_EARLY_RX_DRIFT_SAMPLE] = hdd_we_set_early_rx_drift_sample, |
| 5694 | [WE_SET_SCAN_DISABLE] = hdd_we_set_scan_disable, |
| 5695 | [WE_START_FW_PROFILE] = hdd_we_start_fw_profile, |
| 5696 | [WE_SET_CHANNEL] = hdd_we_set_channel, |
| 5697 | [WE_SET_CONC_SYSTEM_PREF] = hdd_we_set_conc_system_pref, |
| 5698 | [WE_SET_11AX_RATE] = hdd_we_set_11ax_rate, |
| 5699 | [WE_SET_DCM] = hdd_we_set_dcm, |
| 5700 | [WE_SET_RANGE_EXT] = hdd_we_set_range_ext, |
| 5701 | [WE_SET_PDEV_RESET] = hdd_handle_pdev_reset, |
| 5702 | [WE_SET_MODULATED_DTIM] = hdd_we_set_modulated_dtim, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 5703 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 5704 | [WE_MOTION_DET_START_STOP] = hdd_we_motion_det_start_stop, |
| 5705 | [WE_MOTION_DET_BASE_LINE_START_STOP] = |
| 5706 | hdd_we_motion_det_base_line_start_stop, |
| 5707 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 5708 | [WE_SET_BTCOEX_MODE] = wlan_hdd_set_btcoex_mode, |
| 5709 | [WE_SET_BTCOEX_RSSI_THRESHOLD] = wlan_hdd_set_btcoex_rssi_threshold, |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5710 | }; |
| 5711 | |
| 5712 | static setint_getnone_fn hdd_get_setint_getnone_cb(int param) |
| 5713 | { |
| 5714 | if (param < 0) |
| 5715 | return NULL; |
| 5716 | |
| 5717 | if (param >= QDF_ARRAY_SIZE(setint_getnone_cb)) |
| 5718 | return NULL; |
| 5719 | |
| 5720 | return setint_getnone_cb[param]; |
| 5721 | } |
| 5722 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5723 | /** |
| 5724 | * iw_setint_getnone() - Generic "set integer" private ioctl handler |
| 5725 | * @dev: device upon which the ioctl was received |
| 5726 | * @info: ioctl request information |
| 5727 | * @wrqu: ioctl request data |
| 5728 | * @extra: ioctl extra data |
| 5729 | * |
| 5730 | * Return: 0 on success, non-zero on error |
| 5731 | */ |
| 5732 | static int __iw_setint_getnone(struct net_device *dev, |
| 5733 | struct iw_request_info *info, |
| 5734 | union iwreq_data *wrqu, char *extra) |
| 5735 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5736 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5737 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5738 | setint_getnone_fn cb; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5739 | int *value = (int *)extra; |
| 5740 | int sub_cmd = value[0]; |
| 5741 | int set_value = value[1]; |
| 5742 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5743 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5744 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5745 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5746 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5747 | ret = wlan_hdd_validate_context(hdd_ctx); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5748 | if (ret) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5749 | return ret; |
| 5750 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5751 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
Jeff Johnson | daf2e6a | 2018-10-19 12:46:35 -0700 | [diff] [blame] | 5752 | if (ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5753 | return ret; |
| 5754 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5755 | cb = hdd_get_setint_getnone_cb(sub_cmd); |
| 5756 | if (!cb) { |
Rajeev Kumar | d056536 | 2018-03-01 12:02:01 -0800 | [diff] [blame] | 5757 | hdd_debug("Invalid sub command %d", sub_cmd); |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5758 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5759 | } |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5760 | |
Jeff Johnson | 3ba2732 | 2018-11-13 17:58:28 -0800 | [diff] [blame] | 5761 | ret = cb(adapter, set_value); |
| 5762 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5763 | hdd_exit(); |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5764 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5765 | return ret; |
| 5766 | } |
| 5767 | |
| 5768 | static int iw_setint_getnone(struct net_device *dev, |
| 5769 | struct iw_request_info *info, |
| 5770 | union iwreq_data *wrqu, |
| 5771 | char *extra) |
| 5772 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5773 | int errno; |
| 5774 | struct osif_vdev_sync *vdev_sync; |
| 5775 | |
| 5776 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 5777 | if (errno) |
| 5778 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5779 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5780 | errno = __iw_setint_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5781 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5782 | osif_vdev_sync_op_stop(vdev_sync); |
| 5783 | |
| 5784 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5785 | } |
| 5786 | |
| 5787 | /** |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5788 | * __iw_setnone_get_threeint() - return three value to up layer. |
| 5789 | * |
| 5790 | * @dev: pointer of net_device of this wireless card |
| 5791 | * @info: meta data about Request sent |
| 5792 | * @wrqu: include request info |
| 5793 | * @extra: buf used for in/Output |
| 5794 | * |
| 5795 | * Return: execute result |
| 5796 | */ |
| 5797 | static int __iw_setnone_get_threeint(struct net_device *dev, |
| 5798 | struct iw_request_info *info, |
| 5799 | union iwreq_data *wrqu, char *extra) |
| 5800 | { |
| 5801 | int ret = 0; /* success */ |
| 5802 | uint32_t *value = (int *)extra; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 5803 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5804 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5805 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5806 | hdd_enter_dev(dev); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5807 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5808 | if (0 != ret) |
| 5809 | return ret; |
| 5810 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5811 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5812 | if (0 != ret) |
| 5813 | return ret; |
| 5814 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5815 | hdd_debug("param = %d", value[0]); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5816 | switch (value[0]) { |
| 5817 | case WE_GET_TSF: |
| 5818 | ret = hdd_indicate_tsf(adapter, value, 3); |
| 5819 | break; |
| 5820 | default: |
| 5821 | hdd_err("Invalid IOCTL get_value command %d", value[0]); |
| 5822 | break; |
| 5823 | } |
| 5824 | return ret; |
| 5825 | } |
| 5826 | |
| 5827 | /** |
| 5828 | * iw_setnone_get_threeint() - return three value to up layer. |
| 5829 | * |
| 5830 | * @dev: pointer of net_device of this wireless card |
| 5831 | * @info: meta data about Request sent |
| 5832 | * @wrqu: include request info |
| 5833 | * @extra: buf used for in/Output |
| 5834 | * |
| 5835 | * Return: execute result |
| 5836 | */ |
| 5837 | static int iw_setnone_get_threeint(struct net_device *dev, |
| 5838 | struct iw_request_info *info, |
| 5839 | union iwreq_data *wrqu, char *extra) |
| 5840 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5841 | int errno; |
| 5842 | struct osif_vdev_sync *vdev_sync; |
| 5843 | |
| 5844 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 5845 | if (errno) |
| 5846 | return errno; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5847 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5848 | errno = __iw_setnone_get_threeint(dev, info, wrqu, extra); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5849 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 5850 | osif_vdev_sync_op_stop(vdev_sync); |
| 5851 | |
| 5852 | return errno; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5853 | } |
| 5854 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5855 | #ifdef WLAN_UNIT_TEST |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5856 | typedef uint32_t (*hdd_ut_callback)(void); |
| 5857 | |
| 5858 | struct hdd_ut_entry { |
| 5859 | const hdd_ut_callback callback; |
| 5860 | const char *name; |
| 5861 | }; |
| 5862 | |
| 5863 | struct hdd_ut_entry hdd_ut_entries[] = { |
| 5864 | { .name = "dsc", .callback = dsc_unit_test }, |
Dustin Brown | 9c49a33 | 2019-03-05 11:27:38 -0800 | [diff] [blame^] | 5865 | { .name = "qdf_ht", .callback = qdf_ht_unit_test }, |
| 5866 | { .name = "qdf_periodic_work", |
| 5867 | .callback = qdf_periodic_work_unit_test }, |
| 5868 | { .name = "qdf_talloc", .callback = qdf_talloc_unit_test }, |
| 5869 | { .name = "qdf_types", .callback = qdf_types_unit_test }, |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5870 | }; |
| 5871 | |
| 5872 | #define hdd_for_each_ut_entry(cursor) \ |
| 5873 | for (cursor = hdd_ut_entries; \ |
| 5874 | cursor < hdd_ut_entries + ARRAY_SIZE(hdd_ut_entries); \ |
| 5875 | cursor++) |
| 5876 | |
| 5877 | static struct hdd_ut_entry *hdd_ut_lookup(const char *name) |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5878 | { |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5879 | struct hdd_ut_entry *entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5880 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5881 | hdd_for_each_ut_entry(entry) { |
| 5882 | if (qdf_str_eq(entry->name, name)) |
| 5883 | return entry; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5884 | } |
| 5885 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5886 | return NULL; |
| 5887 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5888 | |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5889 | static uint32_t hdd_ut_single(const struct hdd_ut_entry *entry) |
| 5890 | { |
| 5891 | uint32_t errors; |
| 5892 | |
| 5893 | hdd_nofl_info("START: '%s'", entry->name); |
| 5894 | |
| 5895 | errors = entry->callback(); |
| 5896 | if (errors) |
| 5897 | hdd_nofl_err("FAIL: '%s' with %u errors", entry->name, errors); |
| 5898 | else |
| 5899 | hdd_nofl_info("PASS: '%s'", entry->name); |
| 5900 | |
| 5901 | return errors; |
| 5902 | } |
| 5903 | |
| 5904 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *name) |
| 5905 | { |
| 5906 | struct hdd_ut_entry *entry; |
| 5907 | uint32_t errors = 0; |
| 5908 | |
| 5909 | hdd_nofl_info("Unit tests begin"); |
| 5910 | |
| 5911 | if (!name || !name[0] || qdf_str_eq(name, "all")) { |
| 5912 | hdd_for_each_ut_entry(entry) |
| 5913 | errors += hdd_ut_single(entry); |
| 5914 | } else { |
| 5915 | entry = hdd_ut_lookup(name); |
| 5916 | if (entry) |
| 5917 | errors += hdd_ut_single(entry); |
| 5918 | else |
| 5919 | hdd_nofl_err("Unit test '%s' not found", name); |
| 5920 | } |
| 5921 | |
| 5922 | hdd_nofl_info("Unit tests complete"); |
| 5923 | |
| 5924 | return errors ? -EPERM : 0; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5925 | } |
| 5926 | #else |
Dustin Brown | 7d038e5 | 2018-11-29 14:28:13 -0800 | [diff] [blame] | 5927 | 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] | 5928 | { |
| 5929 | return -EOPNOTSUPP; |
| 5930 | } |
| 5931 | #endif /* WLAN_UNIT_TEST */ |
| 5932 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5933 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5934 | * iw_setchar_getnone() - Generic "set string" private ioctl handler |
| 5935 | * @dev: device upon which the ioctl was received |
| 5936 | * @info: ioctl request information |
| 5937 | * @wrqu: ioctl request data |
| 5938 | * @extra: ioctl extra data |
| 5939 | * |
| 5940 | * Return: 0 on success, non-zero on error |
| 5941 | */ |
| 5942 | static int __iw_setchar_getnone(struct net_device *dev, |
| 5943 | struct iw_request_info *info, |
| 5944 | union iwreq_data *wrqu, char *extra) |
| 5945 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5946 | int sub_cmd; |
| 5947 | int ret; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5948 | char *str_arg = NULL; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5949 | struct hdd_adapter *adapter = (netdev_priv(dev)); |
| 5950 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5951 | struct iw_point s_priv_data; |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 5952 | bool neighbor_report_req_support = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5953 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5954 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 5955 | |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5956 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5957 | hdd_err("permission check failed"); |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5958 | return -EPERM; |
| 5959 | } |
| 5960 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5961 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5962 | if (0 != ret) |
| 5963 | return ret; |
| 5964 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5965 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5966 | if (0 != ret) |
| 5967 | return ret; |
| 5968 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5969 | /* helper function to get iwreq_data with compat handling. */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5970 | if (hdd_priv_get_data(&s_priv_data, wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5971 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5972 | |
| 5973 | /* make sure all params are correctly passed to function */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5974 | if ((NULL == s_priv_data.pointer) || (0 == s_priv_data.length)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5975 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5976 | |
| 5977 | sub_cmd = s_priv_data.flags; |
| 5978 | |
| 5979 | /* ODD number is used for set, copy data using copy_from_user */ |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5980 | str_arg = mem_alloc_copy_from_user_helper(s_priv_data.pointer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5981 | s_priv_data.length); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5982 | if (!str_arg) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5983 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5984 | return -ENOMEM; |
| 5985 | } |
| 5986 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5987 | hdd_debug("Received length: %d data: %s", |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5988 | s_priv_data.length, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5989 | |
| 5990 | switch (sub_cmd) { |
| 5991 | case WE_WOWL_ADD_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5992 | hdd_debug("ADD_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 5993 | if (!hdd_add_wowl_ptrn(adapter, str_arg)) |
| 5994 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5995 | break; |
| 5996 | case WE_WOWL_DEL_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5997 | hdd_debug("DEL_PTRN"); |
Visweswara Tanuku | 16214ff | 2018-12-14 12:12:58 +0530 | [diff] [blame] | 5998 | if (!hdd_del_wowl_ptrn(adapter, str_arg)) |
| 5999 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6000 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6001 | case WE_NEIGHBOR_REPORT_REQUEST: |
| 6002 | { |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6003 | tRrmNeighborReq request; |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6004 | tRrmNeighborRspCallbackInfo callback; |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 6005 | bool rrm_enabled = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6006 | |
Yeshwanth Sriram Guntuka | 334aa8d | 2018-08-20 16:49:15 +0530 | [diff] [blame] | 6007 | ucfg_wlan_mlme_get_rrm_enabled(hdd_ctx->psoc, |
| 6008 | &rrm_enabled); |
| 6009 | |
| 6010 | if (rrm_enabled) { |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6011 | request.neighbor_report_offload = false; |
| 6012 | request.no_ssid = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6013 | (s_priv_data.length - 1) ? false : true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6014 | hdd_debug("Neighbor Request ssid present %d", |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6015 | request.no_ssid); |
| 6016 | if (!request.no_ssid) { |
| 6017 | request.ssid.length = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6018 | (s_priv_data.length - 1) > |
| 6019 | 32 ? 32 : (s_priv_data.length - 1); |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6020 | qdf_mem_copy(request.ssid.ssId, |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6021 | str_arg, |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6022 | request.ssid.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6023 | } |
| 6024 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6025 | /* |
| 6026 | * If 11k offload is supported by FW and enabled |
| 6027 | * in the ini, set the offload to true |
| 6028 | */ |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 6029 | if (QDF_IS_STATUS_ERROR( |
| 6030 | ucfg_fwol_is_neighbor_report_req_supported( |
| 6031 | hdd_ctx->psoc, &neighbor_report_req_support))) |
| 6032 | hdd_err("Neighbor report req bit get fail"); |
| 6033 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6034 | if (hdd_ctx->config->is_11k_offload_supported && |
Manikandan Mohan | 06d38d8 | 2018-11-26 18:36:58 -0800 | [diff] [blame] | 6035 | neighbor_report_req_support) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6036 | hdd_debug("Neighbor report offloaded to FW"); |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6037 | request.neighbor_report_offload = true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6038 | } |
| 6039 | |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6040 | callback.neighborRspCallback = NULL; |
| 6041 | callback.neighborRspCallbackContext = NULL; |
| 6042 | callback.timeout = 5000; /* 5 seconds */ |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 6043 | sme_neighbor_report_request( |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6044 | hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6045 | adapter->vdev_id, |
Jeff Johnson | 84b3433 | 2019-03-09 18:21:35 -0800 | [diff] [blame] | 6046 | &request, |
Jeff Johnson | 09bb9cf | 2019-03-09 18:15:40 -0800 | [diff] [blame] | 6047 | &callback); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6048 | } else { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6049 | hdd_err("Ignoring neighbor request as RRM not enabled"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6050 | ret = -EINVAL; |
| 6051 | } |
| 6052 | } |
| 6053 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6054 | case WE_SET_AP_WPS_IE: |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 6055 | hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6056 | break; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6057 | case WE_UNIT_TEST: |
| 6058 | ret = hdd_we_unit_test(hdd_ctx, str_arg); |
| 6059 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6060 | default: |
| 6061 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6062 | hdd_err("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6063 | ret = -EINVAL; |
| 6064 | break; |
| 6065 | } |
| 6066 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6067 | |
| 6068 | qdf_mem_free(str_arg); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6069 | hdd_exit(); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 6070 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6071 | return ret; |
| 6072 | } |
| 6073 | |
| 6074 | static int iw_setchar_getnone(struct net_device *dev, |
| 6075 | struct iw_request_info *info, |
| 6076 | union iwreq_data *wrqu, char *extra) |
| 6077 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6078 | int errno; |
| 6079 | struct osif_vdev_sync *vdev_sync; |
| 6080 | |
| 6081 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6082 | if (errno) |
| 6083 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6084 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6085 | errno = __iw_setchar_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6086 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6087 | osif_vdev_sync_op_stop(vdev_sync); |
| 6088 | |
| 6089 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6090 | } |
| 6091 | |
| 6092 | /** |
| 6093 | * iw_setnone_getint() - Generic "get integer" private ioctl handler |
| 6094 | * @dev: device upon which the ioctl was received |
| 6095 | * @info: ioctl request information |
| 6096 | * @wrqu: ioctl request data |
| 6097 | * @extra: ioctl extra data |
| 6098 | * |
| 6099 | * Return: 0 on success, non-zero on error |
| 6100 | */ |
| 6101 | static int __iw_setnone_getint(struct net_device *dev, |
| 6102 | struct iw_request_info *info, |
| 6103 | union iwreq_data *wrqu, char *extra) |
| 6104 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6105 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6106 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6107 | int *value = (int *)extra; |
| 6108 | int ret; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 6109 | struct sme_config_params *sme_config; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6110 | struct hdd_context *hdd_ctx; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6111 | QDF_STATUS status; |
| 6112 | bool bval = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6113 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6114 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6115 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6116 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6117 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6118 | if (0 != ret) |
| 6119 | return ret; |
| 6120 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6121 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6122 | if (0 != ret) |
| 6123 | return ret; |
| 6124 | |
Rajeev Kumar | 1117fcf | 2018-02-15 16:25:19 -0800 | [diff] [blame] | 6125 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 6126 | if (!sme_config) { |
| 6127 | hdd_err("failed to allocate memory for sme_config"); |
| 6128 | return -ENOMEM; |
| 6129 | } |
| 6130 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6131 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6132 | switch (value[0]) { |
| 6133 | case WE_GET_11D_STATE: |
| 6134 | { |
Abhinav Kumar | d4d6eb7 | 2018-12-04 20:30:37 +0530 | [diff] [blame] | 6135 | status = ucfg_mlme_is_11d_enabled(hdd_ctx->psoc, &bval); |
| 6136 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 6137 | hdd_err("Invalid 11d_enable flag"); |
| 6138 | *value = bval; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6139 | hdd_debug("11D state=%d!!", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6140 | |
| 6141 | break; |
| 6142 | } |
| 6143 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6144 | case WE_GET_WLAN_DBG: |
| 6145 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6146 | qdf_trace_display(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6147 | *value = 0; |
| 6148 | break; |
| 6149 | } |
| 6150 | case WE_GET_MAX_ASSOC: |
| 6151 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6152 | if (ucfg_mlme_set_assoc_sta_limit(hdd_ctx->psoc, *value) != |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 6153 | QDF_STATUS_SUCCESS) { |
| 6154 | hdd_err("CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6155 | ret = -EIO; |
| 6156 | } |
Bala Venkatesh | 2fde2c6 | 2018-09-11 20:33:24 +0530 | [diff] [blame] | 6157 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6158 | break; |
| 6159 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6160 | |
| 6161 | case WE_GET_CONCURRENCY_MODE: |
| 6162 | { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6163 | *value = policy_mgr_get_concurrency_mode(hdd_ctx->psoc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6164 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6165 | hdd_debug("concurrency mode=%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6166 | break; |
| 6167 | } |
| 6168 | |
| 6169 | case WE_GET_NSS: |
| 6170 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6171 | sme_get_config_param(mac_handle, sme_config); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6172 | status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval); |
| 6173 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 6174 | hdd_err("unable to get vht_enable2x2"); |
| 6175 | *value = (bval == 0) ? 1 : 2; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6176 | if (policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc)) |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 6177 | *value = *value - 1; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6178 | hdd_debug("GET_NSS: Current NSS:%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6179 | break; |
| 6180 | } |
| 6181 | |
| 6182 | case WE_GET_GTX_HT_MCS: |
| 6183 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6184 | hdd_debug("GET WMI_VDEV_PARAM_GTX_HT_MCS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6185 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6186 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 6187 | GTX_CMD); |
| 6188 | break; |
| 6189 | } |
| 6190 | |
| 6191 | case WE_GET_GTX_VHT_MCS: |
| 6192 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6193 | hdd_debug("GET WMI_VDEV_PARAM_GTX_VHT_MCS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6194 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6195 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 6196 | GTX_CMD); |
| 6197 | break; |
| 6198 | } |
| 6199 | |
| 6200 | case WE_GET_GTX_USRCFG: |
| 6201 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6202 | hdd_debug("GET WMI_VDEV_PARAM_GTX_USR_CFG"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6203 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6204 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 6205 | GTX_CMD); |
| 6206 | break; |
| 6207 | } |
| 6208 | |
| 6209 | case WE_GET_GTX_THRE: |
| 6210 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6211 | hdd_debug("GET WMI_VDEV_PARAM_GTX_THRE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6212 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6213 | WMI_VDEV_PARAM_GTX_THRE, |
| 6214 | GTX_CMD); |
| 6215 | break; |
| 6216 | } |
| 6217 | |
| 6218 | case WE_GET_GTX_MARGIN: |
| 6219 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6220 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MARGIN"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6221 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6222 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 6223 | GTX_CMD); |
| 6224 | break; |
| 6225 | } |
| 6226 | |
| 6227 | case WE_GET_GTX_STEP: |
| 6228 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6229 | hdd_debug("GET WMI_VDEV_PARAM_GTX_STEP"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6230 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6231 | WMI_VDEV_PARAM_GTX_STEP, |
| 6232 | GTX_CMD); |
| 6233 | break; |
| 6234 | } |
| 6235 | |
| 6236 | case WE_GET_GTX_MINTPC: |
| 6237 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6238 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MINTPC"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6239 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6240 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 6241 | GTX_CMD); |
| 6242 | break; |
| 6243 | } |
| 6244 | |
| 6245 | case WE_GET_GTX_BWMASK: |
| 6246 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6247 | hdd_debug("GET WMI_VDEV_PARAM_GTX_BW_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6248 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6249 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 6250 | GTX_CMD); |
| 6251 | break; |
| 6252 | } |
| 6253 | |
| 6254 | case WE_GET_LDPC: |
| 6255 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6256 | ret = hdd_get_ldpc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6257 | break; |
| 6258 | } |
| 6259 | |
| 6260 | case WE_GET_TX_STBC: |
| 6261 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6262 | ret = hdd_get_tx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6263 | break; |
| 6264 | } |
| 6265 | |
| 6266 | case WE_GET_RX_STBC: |
| 6267 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6268 | ret = hdd_get_rx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6269 | break; |
| 6270 | } |
| 6271 | |
| 6272 | case WE_GET_SHORT_GI: |
| 6273 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6274 | hdd_debug("GET WMI_VDEV_PARAM_SGI"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6275 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | a5c5aad | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 6276 | WMI_VDEV_PARAM_SGI, |
| 6277 | VDEV_CMD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6278 | break; |
| 6279 | } |
| 6280 | |
| 6281 | case WE_GET_RTSCTS: |
| 6282 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6283 | hdd_debug("GET WMI_VDEV_PARAM_ENABLE_RTSCTS"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6284 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6285 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 6286 | VDEV_CMD); |
| 6287 | break; |
| 6288 | } |
| 6289 | |
| 6290 | case WE_GET_CHWIDTH: |
| 6291 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6292 | hdd_debug("GET WMI_VDEV_PARAM_CHWIDTH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6293 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6294 | WMI_VDEV_PARAM_CHWIDTH, |
| 6295 | VDEV_CMD); |
| 6296 | break; |
| 6297 | } |
| 6298 | |
| 6299 | case WE_GET_ANI_EN_DIS: |
| 6300 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6301 | hdd_debug("GET WMI_PDEV_PARAM_ANI_ENABLE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6302 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6303 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 6304 | PDEV_CMD); |
| 6305 | break; |
| 6306 | } |
| 6307 | |
| 6308 | case WE_GET_ANI_POLL_PERIOD: |
| 6309 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6310 | hdd_debug("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6311 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6312 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 6313 | PDEV_CMD); |
| 6314 | break; |
| 6315 | } |
| 6316 | |
| 6317 | case WE_GET_ANI_LISTEN_PERIOD: |
| 6318 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6319 | hdd_debug("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6320 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6321 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 6322 | PDEV_CMD); |
| 6323 | break; |
| 6324 | } |
| 6325 | |
| 6326 | case WE_GET_ANI_OFDM_LEVEL: |
| 6327 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6328 | hdd_debug("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6329 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6330 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 6331 | PDEV_CMD); |
| 6332 | break; |
| 6333 | } |
| 6334 | |
| 6335 | case WE_GET_ANI_CCK_LEVEL: |
| 6336 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6337 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6338 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6339 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 6340 | PDEV_CMD); |
| 6341 | break; |
| 6342 | } |
| 6343 | |
| 6344 | case WE_GET_DYNAMIC_BW: |
| 6345 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6346 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6347 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6348 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 6349 | PDEV_CMD); |
| 6350 | break; |
| 6351 | } |
| 6352 | |
| 6353 | case WE_GET_11N_RATE: |
| 6354 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6355 | hdd_debug("GET WMI_VDEV_PARAM_FIXED_RATE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6356 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6357 | WMI_VDEV_PARAM_FIXED_RATE, |
| 6358 | VDEV_CMD); |
| 6359 | break; |
| 6360 | } |
| 6361 | |
| 6362 | case WE_GET_AMPDU: |
| 6363 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6364 | hdd_debug("GET AMPDU"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6365 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6366 | GEN_VDEV_PARAM_AMPDU, |
| 6367 | GEN_CMD); |
| 6368 | break; |
| 6369 | } |
| 6370 | |
| 6371 | case WE_GET_AMSDU: |
| 6372 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6373 | hdd_debug("GET AMSDU"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6374 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6375 | GEN_VDEV_PARAM_AMSDU, |
| 6376 | GEN_CMD); |
| 6377 | break; |
| 6378 | } |
| 6379 | |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6380 | case WE_GET_ROAM_SYNCH_DELAY: |
| 6381 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6382 | hdd_debug("GET ROAM SYNCH DELAY"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6383 | *value = wma_cli_get_command(adapter->vdev_id, |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 6384 | GEN_VDEV_ROAM_SYNCH_DELAY, |
| 6385 | GEN_CMD); |
| 6386 | break; |
| 6387 | } |
| 6388 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6389 | case WE_GET_TX_CHAINMASK: |
| 6390 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6391 | hdd_debug("GET WMI_PDEV_PARAM_TX_CHAIN_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6392 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6393 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 6394 | PDEV_CMD); |
| 6395 | break; |
| 6396 | } |
| 6397 | |
| 6398 | case WE_GET_RX_CHAINMASK: |
| 6399 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6400 | hdd_debug("GET WMI_PDEV_PARAM_RX_CHAIN_MASK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6401 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6402 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 6403 | PDEV_CMD); |
| 6404 | break; |
| 6405 | } |
| 6406 | |
| 6407 | case WE_GET_TXPOW_2G: |
| 6408 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6409 | uint8_t txpow2g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6410 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6411 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6412 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6413 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 6414 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6415 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow2g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6416 | hdd_debug("2G tx_power %d", txpow2g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6417 | break; |
| 6418 | } |
| 6419 | |
| 6420 | case WE_GET_TXPOW_5G: |
| 6421 | { |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6422 | uint8_t txpow5g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6423 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6424 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6425 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6426 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 6427 | PDEV_CMD); |
Wu Gao | 5f76408 | 2019-01-04 15:54:38 +0800 | [diff] [blame] | 6428 | ucfg_mlme_get_current_tx_power_level(hdd_ctx->psoc, &txpow5g); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6429 | hdd_debug("5G tx_power %d", txpow5g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6430 | break; |
| 6431 | } |
| 6432 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6433 | case WE_GET_PPS_PAID_MATCH: |
| 6434 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6435 | hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6436 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6437 | WMI_VDEV_PPS_PAID_MATCH, |
| 6438 | PPS_CMD); |
| 6439 | break; |
| 6440 | } |
| 6441 | |
| 6442 | case WE_GET_PPS_GID_MATCH: |
| 6443 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6444 | hdd_debug("GET WMI_VDEV_PPS_GID_MATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6445 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6446 | WMI_VDEV_PPS_GID_MATCH, |
| 6447 | PPS_CMD); |
| 6448 | break; |
| 6449 | } |
| 6450 | |
| 6451 | case WE_GET_PPS_EARLY_TIM_CLEAR: |
| 6452 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6453 | hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6454 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6455 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 6456 | PPS_CMD); |
| 6457 | break; |
| 6458 | } |
| 6459 | |
| 6460 | case WE_GET_PPS_EARLY_DTIM_CLEAR: |
| 6461 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6462 | hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6463 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6464 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 6465 | PPS_CMD); |
| 6466 | break; |
| 6467 | } |
| 6468 | |
| 6469 | case WE_GET_PPS_EOF_PAD_DELIM: |
| 6470 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6471 | hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6472 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6473 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 6474 | PPS_CMD); |
| 6475 | break; |
| 6476 | } |
| 6477 | |
| 6478 | case WE_GET_PPS_MACADDR_MISMATCH: |
| 6479 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6480 | hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6481 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6482 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 6483 | PPS_CMD); |
| 6484 | break; |
| 6485 | } |
| 6486 | |
| 6487 | case WE_GET_PPS_DELIM_CRC_FAIL: |
| 6488 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6489 | hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6490 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6491 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 6492 | PPS_CMD); |
| 6493 | break; |
| 6494 | } |
| 6495 | |
| 6496 | case WE_GET_PPS_GID_NSTS_ZERO: |
| 6497 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6498 | hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6499 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6500 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 6501 | PPS_CMD); |
| 6502 | break; |
| 6503 | } |
| 6504 | |
| 6505 | case WE_GET_PPS_RSSI_CHECK: |
| 6506 | { |
| 6507 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6508 | hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6509 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6510 | WMI_VDEV_PPS_RSSI_CHECK, |
| 6511 | PPS_CMD); |
| 6512 | break; |
| 6513 | } |
| 6514 | |
| 6515 | case WE_GET_QPOWER_MAX_PSPOLL_COUNT: |
| 6516 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6517 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6518 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6519 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 6520 | QPOWER_CMD); |
| 6521 | break; |
| 6522 | } |
| 6523 | |
| 6524 | case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 6525 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6526 | hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6527 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6528 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 6529 | QPOWER_CMD); |
| 6530 | break; |
| 6531 | } |
| 6532 | |
| 6533 | case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 6534 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6535 | hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6536 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6537 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 6538 | QPOWER_CMD); |
| 6539 | break; |
| 6540 | } |
| 6541 | |
| 6542 | case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 6543 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6544 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6545 | *value = wma_cli_get_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6546 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 6547 | QPOWER_CMD); |
| 6548 | break; |
| 6549 | } |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6550 | case WE_CAP_TSF: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6551 | ret = hdd_capture_tsf(adapter, (uint32_t *)value, 1); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 6552 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6553 | case WE_GET_TEMPERATURE: |
| 6554 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6555 | hdd_debug("WE_GET_TEMPERATURE"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6556 | ret = wlan_hdd_get_temperature(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6557 | break; |
| 6558 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6559 | case WE_GET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6560 | hdd_debug("GET WMI_VDEV_PARAM_HE_DCM"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6561 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 6562 | WMI_VDEV_PARAM_HE_DCM, |
| 6563 | VDEV_CMD); |
| 6564 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6565 | case WE_GET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6566 | hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT"); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6567 | *value = wma_cli_get_command(adapter->vdev_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 6568 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 6569 | VDEV_CMD); |
| 6570 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6571 | default: |
| 6572 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6573 | hdd_err("Invalid IOCTL get_value command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6574 | value[0]); |
| 6575 | break; |
| 6576 | } |
| 6577 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6578 | hdd_exit(); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 6579 | qdf_mem_free(sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6580 | return ret; |
| 6581 | } |
| 6582 | |
| 6583 | static int iw_setnone_getint(struct net_device *dev, |
| 6584 | struct iw_request_info *info, |
| 6585 | union iwreq_data *wrqu, char *extra) |
| 6586 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6587 | int errno; |
| 6588 | struct osif_vdev_sync *vdev_sync; |
| 6589 | |
| 6590 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6591 | if (errno) |
| 6592 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6593 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6594 | errno = __iw_setnone_getint(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6595 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6596 | osif_vdev_sync_op_stop(vdev_sync); |
| 6597 | |
| 6598 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6599 | } |
| 6600 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6601 | static int hdd_set_fwtest(int argc, int cmd, int value) |
| 6602 | { |
| 6603 | struct set_fwtest_params *fw_test; |
| 6604 | |
| 6605 | /* check for max number of arguments */ |
| 6606 | if (argc > (WMA_MAX_NUM_ARGS) || |
| 6607 | argc != HDD_FWTEST_PARAMS) { |
| 6608 | hdd_err("Too Many args %d", argc); |
| 6609 | return -EINVAL; |
| 6610 | } |
| 6611 | /* |
| 6612 | * check if number of arguments are 3 then, check |
| 6613 | * then set the default value for sounding interval. |
| 6614 | */ |
| 6615 | if (HDD_FWTEST_PARAMS == argc) { |
| 6616 | if (HDD_FWTEST_SU_PARAM_ID == cmd && 0 == value) |
| 6617 | value = HDD_FWTEST_SU_DEFAULT_VALUE; |
| 6618 | if (HDD_FWTEST_MU_PARAM_ID == cmd && 0 == value) |
| 6619 | value = HDD_FWTEST_MU_DEFAULT_VALUE; |
| 6620 | } |
| 6621 | /* check sounding interval value should not exceed to max */ |
| 6622 | if (value > HDD_FWTEST_MAX_VALUE) { |
| 6623 | hdd_err("Invalid arguments value should not exceed max: %d", |
| 6624 | value); |
| 6625 | return -EINVAL; |
| 6626 | } |
| 6627 | fw_test = qdf_mem_malloc(sizeof(*fw_test)); |
| 6628 | if (NULL == fw_test) { |
| 6629 | hdd_err("qdf_mem_malloc failed for fw_test"); |
| 6630 | return -ENOMEM; |
| 6631 | } |
| 6632 | fw_test->arg = cmd; |
| 6633 | fw_test->value = value; |
| 6634 | if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) { |
| 6635 | qdf_mem_free(fw_test); |
| 6636 | hdd_err("Not able to post FW_TEST_CMD message to WMA"); |
| 6637 | return -EINVAL; |
| 6638 | } |
| 6639 | return 0; |
| 6640 | } |
| 6641 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6642 | /** |
| 6643 | * iw_set_three_ints_getnone() - Generic "set 3 params" private ioctl handler |
| 6644 | * @dev: device upon which the ioctl was received |
| 6645 | * @info: ioctl request information |
| 6646 | * @wrqu: ioctl request data |
| 6647 | * @extra: ioctl extra data |
| 6648 | * |
| 6649 | * Return: 0 on success, non-zero on error |
| 6650 | */ |
| 6651 | static int __iw_set_three_ints_getnone(struct net_device *dev, |
| 6652 | struct iw_request_info *info, |
| 6653 | union iwreq_data *wrqu, char *extra) |
| 6654 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6655 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6656 | int *value = (int *)extra; |
| 6657 | int sub_cmd = value[0]; |
| 6658 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6659 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6660 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6661 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6662 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6663 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6664 | |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6665 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6666 | hdd_err("permission check failed"); |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6667 | return -EPERM; |
| 6668 | } |
| 6669 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6670 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6671 | if (0 != ret) |
| 6672 | return ret; |
| 6673 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6674 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6675 | if (0 != ret) |
| 6676 | return ret; |
| 6677 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6678 | switch (sub_cmd) { |
| 6679 | |
| 6680 | case WE_SET_WLAN_DBG: |
Dustin Brown | 36e2e5c | 2017-05-16 15:41:37 -0700 | [diff] [blame] | 6681 | qdf_print_set_category_verbose(qdf_get_pidx(), value[1], |
| 6682 | value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6683 | break; |
| 6684 | case WE_SET_DP_TRACE: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6685 | qdf_dp_trace_set_value(value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6686 | break; |
Himanshu Agarwal | ad4c039 | 2018-05-08 16:53:36 +0530 | [diff] [blame] | 6687 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6688 | case WE_SET_DUAL_MAC_SCAN_CONFIG: |
| 6689 | hdd_debug("Ioctl to set dual mac scan config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 6690 | status = |
| 6691 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 6692 | &dual_mac_feature); |
| 6693 | if (status != QDF_STATUS_SUCCESS) |
| 6694 | hdd_err("can't get dual mac feature val, use def"); |
| 6695 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6696 | hdd_err("Dual mac feature is disabled from INI"); |
| 6697 | return -EPERM; |
| 6698 | } |
| 6699 | hdd_debug("%d %d %d", value[1], value[2], value[3]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6700 | policy_mgr_set_dual_mac_scan_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6701 | value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6702 | break; |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6703 | case WE_SET_FW_TEST: |
| 6704 | { |
| 6705 | ret = hdd_set_fwtest(value[1], value[2], value[3]); |
| 6706 | if (ret) { |
| 6707 | hdd_err("Not able to set fwtest %d", ret); |
| 6708 | return ret; |
| 6709 | } |
| 6710 | } |
| 6711 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6712 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6713 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6714 | break; |
| 6715 | |
| 6716 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6717 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6718 | return ret; |
| 6719 | } |
| 6720 | |
| 6721 | int iw_set_three_ints_getnone(struct net_device *dev, |
| 6722 | struct iw_request_info *info, |
| 6723 | union iwreq_data *wrqu, char *extra) |
| 6724 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6725 | int errno; |
| 6726 | struct osif_vdev_sync *vdev_sync; |
| 6727 | |
| 6728 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 6729 | if (errno) |
| 6730 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6731 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6732 | errno = __iw_set_three_ints_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6733 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 6734 | osif_vdev_sync_op_stop(vdev_sync); |
| 6735 | |
| 6736 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6737 | } |
| 6738 | |
| 6739 | /** |
| 6740 | * hdd_connection_state_string() - Get connection state string |
| 6741 | * @connection_state: enum to be converted to a string |
| 6742 | * |
| 6743 | * Return: the string equivalent of @connection_state |
| 6744 | */ |
| 6745 | static const char * |
| 6746 | hdd_connection_state_string(eConnectionState connection_state) |
| 6747 | { |
| 6748 | switch (connection_state) { |
| 6749 | CASE_RETURN_STRING(eConnectionState_NotConnected); |
| 6750 | CASE_RETURN_STRING(eConnectionState_Connecting); |
| 6751 | CASE_RETURN_STRING(eConnectionState_Associated); |
| 6752 | CASE_RETURN_STRING(eConnectionState_IbssDisconnected); |
| 6753 | CASE_RETURN_STRING(eConnectionState_IbssConnected); |
| 6754 | CASE_RETURN_STRING(eConnectionState_Disconnecting); |
| 6755 | default: |
| 6756 | return "UNKNOWN"; |
| 6757 | } |
| 6758 | } |
| 6759 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6760 | #if defined(FEATURE_OEM_DATA_SUPPORT) |
| 6761 | /** |
| 6762 | * iw_get_oem_data_cap_wrapper() - wrapper function to call legacy or new |
| 6763 | * wifi_pos api to get oem data caps |
| 6764 | * @dev: net device upon which the request was received |
| 6765 | * @info: ioctl request information |
| 6766 | * @wrqu: ioctl request data |
| 6767 | * @extra: ioctl data payload |
| 6768 | * |
| 6769 | * Return: 0 for success, negative errno value on failure |
| 6770 | */ |
| 6771 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6772 | struct iw_request_info *info, |
| 6773 | union iwreq_data *wrqu, char *extra) |
| 6774 | { |
| 6775 | return iw_get_oem_data_cap(dev, info, wrqu, extra); |
| 6776 | } |
| 6777 | #elif defined(WIFI_POS_CONVERGED) |
| 6778 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6779 | struct iw_request_info *info, |
| 6780 | union iwreq_data *wrqu, char *extra) |
| 6781 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6782 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6783 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6784 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 6785 | return os_if_wifi_pos_populate_caps(hdd_ctx->psoc, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6786 | (struct wifi_pos_driver_caps *)extra); |
| 6787 | } |
| 6788 | #else |
| 6789 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6790 | struct iw_request_info *info, |
| 6791 | union iwreq_data *wrqu, char *extra) |
| 6792 | { |
| 6793 | return -ENOTSUPP; |
| 6794 | } |
| 6795 | #endif |
| 6796 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 6797 | #ifdef WLAN_UNIT_TEST |
| 6798 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6799 | struct hdd_adapter *adapter, |
| 6800 | char *extra) |
| 6801 | { |
| 6802 | QDF_STATUS status; |
| 6803 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6804 | 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] | 6805 | extra, WE_MAX_STR_LEN); |
| 6806 | if (status != QDF_STATUS_SUCCESS) |
| 6807 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6808 | "\nNo active connection"); |
| 6809 | |
| 6810 | return 0; |
| 6811 | } |
| 6812 | #else |
| 6813 | static int hdd_get_sta_cxn_info(struct hdd_context *hdd_ctx, |
| 6814 | struct hdd_adapter *adapter, |
| 6815 | char *extra) |
| 6816 | { |
| 6817 | qdf_scnprintf(extra, WE_MAX_STR_LEN, |
| 6818 | "\nNot supported"); |
| 6819 | return -ENOTSUPP; |
| 6820 | } |
| 6821 | #endif |
| 6822 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6823 | /** |
| 6824 | * iw_get_char_setnone() - Generic "get string" private ioctl handler |
| 6825 | * @dev: device upon which the ioctl was received |
| 6826 | * @info: ioctl request information |
| 6827 | * @wrqu: ioctl request data |
| 6828 | * @extra: ioctl extra data |
| 6829 | * |
| 6830 | * Return: 0 on success, non-zero on error |
| 6831 | */ |
| 6832 | static int __iw_get_char_setnone(struct net_device *dev, |
| 6833 | struct iw_request_info *info, |
| 6834 | union iwreq_data *wrqu, char *extra) |
| 6835 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6836 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6837 | int sub_cmd = wrqu->data.flags; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6838 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6839 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6840 | int ret; |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 6841 | QDF_STATUS status; |
| 6842 | uint8_t value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6843 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6844 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6845 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6846 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6847 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6848 | if (0 != ret) |
| 6849 | return ret; |
| 6850 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6851 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6852 | if (0 != ret) |
| 6853 | return ret; |
| 6854 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6855 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6856 | switch (sub_cmd) { |
| 6857 | case WE_WLAN_VERSION: |
| 6858 | { |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 6859 | wrqu->data.length = hdd_wlan_get_version(hdd_ctx, |
| 6860 | WE_MAX_STR_LEN, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6861 | break; |
| 6862 | } |
| 6863 | |
| 6864 | case WE_GET_STATS: |
| 6865 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6866 | hdd_wlan_get_stats(adapter, &(wrqu->data.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6867 | extra, WE_MAX_STR_LEN); |
| 6868 | break; |
| 6869 | } |
| 6870 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6871 | case WE_GET_SUSPEND_RESUME_STATS: |
| 6872 | { |
| 6873 | ret = wlan_hdd_write_suspend_resume_stats(hdd_ctx, extra, |
| 6874 | WE_MAX_STR_LEN); |
| 6875 | if (ret >= 0) { |
| 6876 | wrqu->data.length = ret; |
| 6877 | ret = 0; |
| 6878 | } |
| 6879 | |
| 6880 | break; |
| 6881 | } |
| 6882 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6883 | case WE_LIST_FW_PROFILE: |
| 6884 | hdd_wlan_list_fw_profile(&(wrqu->data.length), |
| 6885 | extra, WE_MAX_STR_LEN); |
| 6886 | break; |
| 6887 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6888 | /* The case prints the current state of the HDD, SME, CSR, PE, |
| 6889 | * TL it can be extended for WDI Global State as well. And |
| 6890 | * currently it only checks P2P_CLIENT adapter. P2P_DEVICE |
| 6891 | * and P2P_GO have not been added as of now. |
| 6892 | */ |
| 6893 | case WE_GET_STATES: |
| 6894 | { |
| 6895 | int buf = 0, len = 0; |
| 6896 | int adapter_num = 0; |
| 6897 | int count = 0, check = 1; |
| 6898 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6899 | struct hdd_station_ctx *sta_ctx = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6900 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6901 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6902 | struct hdd_adapter *useAdapter = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6903 | |
| 6904 | /* Print wlan0 or p2p0 states based on the adapter_num |
| 6905 | * by using the correct adapter |
| 6906 | */ |
| 6907 | while (adapter_num < 2) { |
| 6908 | if (WLAN_ADAPTER == adapter_num) { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6909 | useAdapter = adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6910 | buf = |
| 6911 | scnprintf(extra + len, |
| 6912 | WE_MAX_STR_LEN - len, |
| 6913 | "\n\n wlan0 States:-"); |
| 6914 | len += buf; |
| 6915 | } else if (P2P_ADAPTER == adapter_num) { |
| 6916 | buf = |
| 6917 | scnprintf(extra + len, |
| 6918 | WE_MAX_STR_LEN - len, |
| 6919 | "\n\n p2p0 States:-"); |
| 6920 | len += buf; |
| 6921 | |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6922 | if (!hdd_ctx) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6923 | buf = |
| 6924 | scnprintf(extra + len, |
| 6925 | WE_MAX_STR_LEN - |
| 6926 | len, |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6927 | "\n hdd_ctx is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6928 | len += buf; |
| 6929 | break; |
| 6930 | } |
| 6931 | |
| 6932 | /* Printing p2p0 states only in the |
| 6933 | * case when the device is configured |
| 6934 | * as a p2p_client |
| 6935 | */ |
| 6936 | useAdapter = |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6937 | hdd_get_adapter(hdd_ctx, |
Krunal Soni | f07bb38 | 2016-03-10 13:02:11 -0800 | [diff] [blame] | 6938 | QDF_P2P_CLIENT_MODE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6939 | if (!useAdapter) { |
| 6940 | buf = |
| 6941 | scnprintf(extra + len, |
| 6942 | WE_MAX_STR_LEN - |
| 6943 | len, |
| 6944 | "\n Device not configured as P2P_CLIENT."); |
| 6945 | len += buf; |
| 6946 | break; |
| 6947 | } |
| 6948 | } |
| 6949 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6950 | if (!mac_handle) { |
Jeff Johnson | 2a8a64f | 2018-04-28 12:31:36 -0700 | [diff] [blame] | 6951 | buf = scnprintf(extra + len, |
| 6952 | WE_MAX_STR_LEN - len, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6953 | "\n mac_handle is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6954 | len += buf; |
| 6955 | break; |
| 6956 | } |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6957 | sta_ctx = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6958 | WLAN_HDD_GET_STATION_CTX_PTR(useAdapter); |
| 6959 | |
| 6960 | |
| 6961 | buf = |
| 6962 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
| 6963 | "\n HDD Conn State - %s " |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6964 | "\n\n SME State:" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6965 | "\n Neighbour Roam State - %s" |
| 6966 | "\n CSR State - %s" |
| 6967 | "\n CSR Substate - %s", |
| 6968 | hdd_connection_state_string |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 6969 | (sta_ctx->conn_info.conn_state), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6970 | mac_trace_get_neighbour_roam_state |
| 6971 | (sme_get_neighbor_roam_state |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6972 | (mac_handle, useAdapter->vdev_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6973 | mac_trace_getcsr_roam_state |
| 6974 | (sme_get_current_roam_state |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6975 | (mac_handle, useAdapter->vdev_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6976 | mac_trace_getcsr_roam_sub_state |
| 6977 | (sme_get_current_roam_sub_state |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 6978 | (mac_handle, useAdapter->vdev_id)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6979 | ); |
| 6980 | len += buf; |
| 6981 | adapter_num++; |
| 6982 | } |
| 6983 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6984 | if (mac_handle) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6985 | /* Printing Lim State starting with global lim states */ |
| 6986 | buf = |
| 6987 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6988 | "\n\n LIM STATES:-" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6989 | "\n Global Sme State - %s " |
| 6990 | "\n Global mlm State - %s " "\n", |
| 6991 | mac_trace_get_lim_sme_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6992 | (sme_get_lim_sme_state(mac_handle)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6993 | mac_trace_get_lim_mlm_state |
Jeff Johnson | 71d465a | 2018-12-05 11:13:30 -0800 | [diff] [blame] | 6994 | (sme_get_lim_mlm_state(mac_handle)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6995 | ); |
| 6996 | len += buf; |
| 6997 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6998 | while (check < 3 && count < 255) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6999 | if (sme_is_lim_session_valid(mac_handle, count)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7000 | buf = |
| 7001 | scnprintf(extra + len, |
| 7002 | WE_MAX_STR_LEN - |
| 7003 | len, |
| 7004 | "\n Lim Valid Session %d:-" |
| 7005 | "\n PE Sme State - %s " |
| 7006 | "\n PE Mlm State - %s " |
| 7007 | "\n", check, |
| 7008 | mac_trace_get_lim_sme_state |
| 7009 | (sme_get_lim_sme_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7010 | (mac_handle, count)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7011 | mac_trace_get_lim_mlm_state |
| 7012 | (sme_get_lim_mlm_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7013 | (mac_handle, count)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7014 | ); |
| 7015 | |
| 7016 | len += buf; |
| 7017 | check++; |
| 7018 | } |
| 7019 | count++; |
| 7020 | } |
| 7021 | } |
| 7022 | |
| 7023 | wrqu->data.length = strlen(extra) + 1; |
| 7024 | break; |
| 7025 | } |
| 7026 | |
| 7027 | case WE_GET_CFG: |
| 7028 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7029 | hdd_debug("Printing CLD global INI Config"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7030 | hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(adapter), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7031 | extra, |
| 7032 | QCSAP_IOCTL_MAX_STR_LEN); |
| 7033 | wrqu->data.length = strlen(extra) + 1; |
| 7034 | break; |
| 7035 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7036 | case WE_GET_RSSI: |
| 7037 | { |
| 7038 | int8_t s7Rssi = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7039 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7040 | wlan_hdd_get_rssi(adapter, &s7Rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7041 | snprintf(extra, WE_MAX_STR_LEN, "rssi=%d", s7Rssi); |
| 7042 | wrqu->data.length = strlen(extra) + 1; |
| 7043 | break; |
| 7044 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7045 | |
| 7046 | case WE_GET_WMM_STATUS: |
| 7047 | { |
| 7048 | snprintf(extra, WE_MAX_STR_LEN, |
| 7049 | "\nDir: 0=up, 1=down, 3=both\n" |
| 7050 | "|------------------------|\n" |
| 7051 | "|AC | ACM |Admitted| Dir |\n" |
| 7052 | "|------------------------|\n" |
| 7053 | "|VO | %d | %3s | %d |\n" |
| 7054 | "|VI | %d | %3s | %d |\n" |
| 7055 | "|BE | %d | %3s | %d |\n" |
| 7056 | "|BK | %d | %3s | %d |\n" |
| 7057 | "|------------------------|\n", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7058 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7059 | ac_status[SME_AC_VO].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7060 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7061 | ac_status[SME_AC_VO]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7062 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7063 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7064 | ac_status[SME_AC_VO].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7065 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7066 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7067 | ac_status[SME_AC_VI].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7068 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7069 | ac_status[SME_AC_VI]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7070 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7071 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7072 | ac_status[SME_AC_VI].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7073 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7074 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7075 | ac_status[SME_AC_BE].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7076 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7077 | ac_status[SME_AC_BE]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7078 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7079 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7080 | ac_status[SME_AC_BE].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7081 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7082 | adapter->hdd_wmm_status. |
Jeff Johnson | 30ac84f | 2019-03-09 13:57:57 -0800 | [diff] [blame] | 7083 | ac_status[SME_AC_BK].is_access_required, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7084 | adapter->hdd_wmm_status. |
Jeff Johnson | 12e1233 | 2019-03-08 23:29:23 -0800 | [diff] [blame] | 7085 | ac_status[SME_AC_BK]. |
Jeff Johnson | a554897 | 2019-03-09 14:22:18 -0800 | [diff] [blame] | 7086 | is_access_allowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 7087 | adapter->hdd_wmm_status. |
Jeff Johnson | 64d94dd | 2019-03-09 14:31:14 -0800 | [diff] [blame] | 7088 | ac_status[SME_AC_BK].tspec. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7089 | ts_info.direction); |
| 7090 | |
| 7091 | wrqu->data.length = strlen(extra) + 1; |
| 7092 | break; |
| 7093 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 7094 | |
| 7095 | case WE_GET_BA_AGEING_TIMEOUT: |
| 7096 | { |
| 7097 | uint8_t ac_cat = 4; |
Srinivas Girigowda | 3105e4d | 2019-02-12 10:06:15 -0800 | [diff] [blame] | 7098 | uint32_t duration[WME_AC_MAX], i; |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 7099 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 7100 | |
| 7101 | if (!soc) { |
| 7102 | hdd_err("Invalid SOC handle"); |
| 7103 | break; |
| 7104 | } |
| 7105 | |
| 7106 | for (i = 0; i < ac_cat; i++) |
| 7107 | cdp_get_ba_timeout(soc, i, &duration[i]); |
| 7108 | |
| 7109 | snprintf(extra, WE_MAX_STR_LEN, |
| 7110 | "\n|------------------------------|\n" |
| 7111 | "|AC | BA aging timeout duration |\n" |
| 7112 | "|--------------------------------|\n" |
| 7113 | "|VO | %d |\n" |
| 7114 | "|VI | %d |\n" |
| 7115 | "|BE | %d |\n" |
| 7116 | "|BK | %d |\n" |
| 7117 | "|--------------------------------|\n", |
| 7118 | duration[3], duration[2], duration[1], duration[0]); |
| 7119 | |
| 7120 | wrqu->data.length = strlen(extra) + 1; |
| 7121 | break; |
| 7122 | } |
| 7123 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7124 | case WE_GET_CHANNEL_LIST: |
| 7125 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7126 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7127 | uint8_t i, len; |
| 7128 | char *buf; |
Wu Gao | aa15514 | 2019-01-14 15:09:26 +0800 | [diff] [blame] | 7129 | uint8_t ubuf[CFG_COUNTRY_CODE_LEN]; |
| 7130 | uint8_t ubuf_len = CFG_COUNTRY_CODE_LEN; |
Srinivas Girigowda | c231df6 | 2017-03-24 18:27:57 -0700 | [diff] [blame] | 7131 | struct channel_list_info channel_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7132 | |
| 7133 | memset(&channel_list, 0, sizeof(channel_list)); |
Agrawal Ashish | 6c9bca7 | 2016-09-04 13:37:59 +0530 | [diff] [blame] | 7134 | status = iw_get_channel_list(dev, info, wrqu, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7135 | (char *)&channel_list); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7136 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7137 | hdd_err("GetChannelList Failed!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7138 | return -EINVAL; |
| 7139 | } |
| 7140 | buf = extra; |
| 7141 | /* |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 7142 | * Maximum channels = CFG_VALID_CHANNEL_LIST_LEN. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7143 | * Maximum buffer needed = 5 * number of channels. |
| 7144 | * Check ifsufficient buffer is available and then |
| 7145 | * proceed to fill the buffer. |
| 7146 | */ |
| 7147 | if (WE_MAX_STR_LEN < |
Wu Gao | 0821b0d | 2019-01-11 17:31:11 +0800 | [diff] [blame] | 7148 | (5 * CFG_VALID_CHANNEL_LIST_LEN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7149 | hdd_err("Insufficient Buffer to populate channel list"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7150 | return -EINVAL; |
| 7151 | } |
| 7152 | len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", |
| 7153 | channel_list.num_channels); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7154 | if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, |
| 7155 | ubuf, |
| 7156 | &ubuf_len)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7157 | /* Printing Country code in getChannelList */ |
| 7158 | for (i = 0; i < (ubuf_len - 1); i++) |
| 7159 | len += scnprintf(buf + len, |
| 7160 | WE_MAX_STR_LEN - len, |
| 7161 | "%c", ubuf[i]); |
| 7162 | } |
| 7163 | for (i = 0; i < channel_list.num_channels; i++) { |
| 7164 | len += |
| 7165 | scnprintf(buf + len, WE_MAX_STR_LEN - len, |
| 7166 | " %u", channel_list.channels[i]); |
| 7167 | } |
| 7168 | wrqu->data.length = strlen(extra) + 1; |
| 7169 | |
| 7170 | break; |
| 7171 | } |
| 7172 | #ifdef FEATURE_WLAN_TDLS |
| 7173 | case WE_GET_TDLS_PEERS: |
| 7174 | { |
| 7175 | wrqu->data.length = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7176 | wlan_hdd_tdls_get_all_peers(adapter, extra, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7177 | WE_MAX_STR_LEN) + 1; |
| 7178 | break; |
| 7179 | } |
| 7180 | #endif |
| 7181 | #ifdef WLAN_FEATURE_11W |
| 7182 | case WE_GET_11W_INFO: |
| 7183 | { |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7184 | struct csr_roam_profile *roam_profile = |
| 7185 | hdd_roam_profile(adapter); |
| 7186 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7187 | hdd_debug("WE_GET_11W_ENABLED = %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7188 | roam_profile->MFPEnabled); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7189 | |
| 7190 | snprintf(extra, WE_MAX_STR_LEN, |
| 7191 | "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d" |
| 7192 | "\n Number of Unprotected Disassocs %d" |
| 7193 | "\n Number of Unprotected Deauths %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 7194 | roam_profile->BSSIDs.bssid->bytes[0], |
| 7195 | roam_profile->BSSIDs.bssid->bytes[1], |
| 7196 | roam_profile->BSSIDs.bssid->bytes[2], |
| 7197 | roam_profile->BSSIDs.bssid->bytes[3], |
| 7198 | roam_profile->BSSIDs.bssid->bytes[4], |
| 7199 | roam_profile->BSSIDs.bssid->bytes[5], |
| 7200 | roam_profile->MFPEnabled, |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 7201 | adapter->hdd_stats.hdd_pmf_stats. |
| 7202 | num_unprot_disassoc_rx, |
| 7203 | adapter->hdd_stats.hdd_pmf_stats. |
| 7204 | num_unprot_deauth_rx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7205 | |
| 7206 | wrqu->data.length = strlen(extra) + 1; |
| 7207 | break; |
| 7208 | } |
| 7209 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7210 | case WE_GET_IBSS_STA_INFO: |
| 7211 | { |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7212 | struct hdd_station_ctx *sta_ctx = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7213 | WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7214 | int idx = 0; |
| 7215 | int length = 0, buf = 0; |
| 7216 | |
Naveen Rawat | c45d162 | 2016-07-05 12:20:09 -0700 | [diff] [blame] | 7217 | for (idx = 0; idx < MAX_PEERS; idx++) { |
Naveen Rawat | ac027cb | 2017-04-27 15:02:42 -0700 | [diff] [blame] | 7218 | if (HDD_WLAN_INVALID_STA_ID != |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 7219 | sta_ctx->conn_info.sta_id[idx]) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7220 | buf = snprintf |
| 7221 | ((extra + length), |
| 7222 | WE_MAX_STR_LEN - length, |
| 7223 | "\n%d .%02x:%02x:%02x:%02x:%02x:%02x\n", |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 7224 | sta_ctx->conn_info.sta_id[idx], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7225 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7226 | peer_macaddr[idx].bytes[0], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7227 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7228 | peer_macaddr[idx].bytes[1], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7229 | sta_ctx->conn_info. |
Jeff Johnson | 5ec1abf | 2019-02-27 14:48:24 -0800 | [diff] [blame] | 7230 | peer_macaddr[idx].bytes[2], |
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[3], |
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[4], |
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[5] |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7237 | ); |
| 7238 | length += buf; |
| 7239 | } |
| 7240 | } |
| 7241 | wrqu->data.length = strlen(extra) + 1; |
| 7242 | break; |
| 7243 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7244 | case WE_GET_PHYMODE: |
| 7245 | { |
| 7246 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7247 | struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7248 | eCsrPhyMode phymode; |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7249 | enum band_info current_band; |
Jeff Johnson | 46b4f0e | 2019-03-08 10:48:35 -0800 | [diff] [blame] | 7250 | struct sme_config_params *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7251 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7252 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 7253 | if (!sme_config) { |
| 7254 | hdd_err("Out of memory"); |
| 7255 | ret = -ENOMEM; |
| 7256 | break; |
| 7257 | } |
| 7258 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7259 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7260 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7261 | sme_config->csrConfig.channelBondingMode24GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7262 | ch_bond24 = true; |
| 7263 | |
| 7264 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7265 | sme_config->csrConfig.channelBondingMode5GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7266 | ch_bond5g = true; |
| 7267 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 7268 | qdf_mem_free(sme_config); |
| 7269 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7270 | phymode = sme_get_phy_mode(mac_handle); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7271 | if ((QDF_STATUS_SUCCESS != |
Harprit Chhabada | 5dff30e | 2019-03-12 17:56:45 -0700 | [diff] [blame] | 7272 | ucfg_reg_get_band(hddctx->pdev, ¤t_band))) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7273 | hdd_err("Failed to get current band config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7274 | return -EIO; |
| 7275 | } |
| 7276 | |
| 7277 | switch (phymode) { |
| 7278 | case eCSR_DOT11_MODE_AUTO: |
| 7279 | snprintf(extra, WE_MAX_STR_LEN, "AUTO MODE"); |
| 7280 | break; |
| 7281 | case eCSR_DOT11_MODE_11n: |
| 7282 | case eCSR_DOT11_MODE_11n_ONLY: |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7283 | if (current_band == BAND_2G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7284 | if (ch_bond24) |
| 7285 | snprintf(extra, WE_MAX_STR_LEN, |
| 7286 | "11NGHT40"); |
| 7287 | else |
| 7288 | snprintf(extra, WE_MAX_STR_LEN, |
| 7289 | "11NGHT20"); |
Jeff Johnson | dbae017 | 2019-03-09 17:01:56 -0800 | [diff] [blame] | 7290 | } else if (current_band == BAND_5G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7291 | if (ch_bond5g) |
| 7292 | snprintf(extra, WE_MAX_STR_LEN, |
| 7293 | "11NAHT40"); |
| 7294 | else |
| 7295 | snprintf(extra, WE_MAX_STR_LEN, |
| 7296 | "11NAHT20"); |
| 7297 | } else { |
| 7298 | snprintf(extra, WE_MAX_STR_LEN, "11N"); |
| 7299 | } |
| 7300 | break; |
| 7301 | case eCSR_DOT11_MODE_abg: |
| 7302 | snprintf(extra, WE_MAX_STR_LEN, "11ABG"); |
| 7303 | break; |
| 7304 | case eCSR_DOT11_MODE_11a: |
| 7305 | snprintf(extra, WE_MAX_STR_LEN, "11A"); |
| 7306 | break; |
| 7307 | case eCSR_DOT11_MODE_11b: |
| 7308 | case eCSR_DOT11_MODE_11b_ONLY: |
| 7309 | snprintf(extra, WE_MAX_STR_LEN, "11B"); |
| 7310 | break; |
| 7311 | case eCSR_DOT11_MODE_11g: |
| 7312 | case eCSR_DOT11_MODE_11g_ONLY: |
| 7313 | snprintf(extra, WE_MAX_STR_LEN, "11G"); |
| 7314 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7315 | case eCSR_DOT11_MODE_11ac: |
| 7316 | case eCSR_DOT11_MODE_11ac_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7317 | status = |
| 7318 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7319 | &value); |
| 7320 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7321 | hdd_err("Failed to set channel_width"); |
| 7322 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7323 | snprintf(extra, WE_MAX_STR_LEN, |
| 7324 | "11ACVHT20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7325 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7326 | snprintf(extra, WE_MAX_STR_LEN, |
| 7327 | "11ACVHT40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7328 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7329 | snprintf(extra, WE_MAX_STR_LEN, |
| 7330 | "11ACVHT80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7331 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7332 | snprintf(extra, WE_MAX_STR_LEN, |
| 7333 | "11ACVHT160"); |
| 7334 | break; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7335 | case eCSR_DOT11_MODE_11ax: |
| 7336 | case eCSR_DOT11_MODE_11ax_ONLY: |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7337 | status = |
| 7338 | ucfg_mlme_get_vht_channel_width(hddctx->psoc, |
| 7339 | &value); |
| 7340 | if (!QDF_IS_STATUS_SUCCESS(status)) |
| 7341 | hdd_err("Failed to set channel_width"); |
| 7342 | |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7343 | /* currently using vhtChannelWidth */ |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7344 | if (value == eHT_CHANNEL_WIDTH_20MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7345 | snprintf(extra, WE_MAX_STR_LEN, |
| 7346 | "11AX_HE_20"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7347 | else if (value == eHT_CHANNEL_WIDTH_40MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7348 | snprintf(extra, WE_MAX_STR_LEN, |
| 7349 | "11AX_HE_40"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7350 | else if (value == eHT_CHANNEL_WIDTH_80MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7351 | snprintf(extra, WE_MAX_STR_LEN, |
| 7352 | "11AX_HE_80"); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 7353 | else if (value == eHT_CHANNEL_WIDTH_160MHZ) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 7354 | snprintf(extra, WE_MAX_STR_LEN, |
| 7355 | "11AX_HE_160"); |
| 7356 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7357 | } |
| 7358 | |
| 7359 | wrqu->data.length = strlen(extra) + 1; |
| 7360 | break; |
| 7361 | } |
| 7362 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7363 | case WE_GET_OEM_DATA_CAP: |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 7364 | return iw_get_oem_data_cap_wrapper(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7365 | case WE_GET_SNR: |
| 7366 | { |
| 7367 | int8_t s7snr = 0; |
| 7368 | int status = 0; |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7369 | struct hdd_context *hdd_ctx; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7370 | struct hdd_station_ctx *sta_ctx; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7371 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7372 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7373 | status = wlan_hdd_validate_context(hdd_ctx); |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7374 | if (status) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7375 | return status; |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 7376 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7377 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7378 | if (0 == hdd_ctx->config->fEnableSNRMonitoring || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7379 | eConnectionState_Associated != |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 7380 | sta_ctx->conn_info.conn_state) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7381 | hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d", |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 7382 | hdd_ctx->config->fEnableSNRMonitoring, |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 7383 | sta_ctx->conn_info.conn_state); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7384 | return -ENONET; |
| 7385 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7386 | wlan_hdd_get_snr(adapter, &s7snr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7387 | snprintf(extra, WE_MAX_STR_LEN, "snr=%d", s7snr); |
| 7388 | wrqu->data.length = strlen(extra) + 1; |
| 7389 | break; |
| 7390 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7391 | |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 7392 | case WE_GET_STA_CXN_INFO: |
| 7393 | ret = hdd_get_sta_cxn_info(hdd_ctx, adapter, extra); |
| 7394 | wrqu->data.length = strlen(extra) + 1; |
| 7395 | break; |
| 7396 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7397 | default: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7398 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7399 | break; |
| 7400 | } |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7401 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7402 | hdd_exit(); |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 7403 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7404 | } |
| 7405 | |
| 7406 | static int iw_get_char_setnone(struct net_device *dev, |
| 7407 | struct iw_request_info *info, |
| 7408 | union iwreq_data *wrqu, char *extra) |
| 7409 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7410 | int errno; |
| 7411 | struct osif_vdev_sync *vdev_sync; |
| 7412 | |
| 7413 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 7414 | if (errno) |
| 7415 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7416 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7417 | errno = __iw_get_char_setnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7418 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7419 | osif_vdev_sync_op_stop(vdev_sync); |
| 7420 | |
| 7421 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7422 | } |
| 7423 | |
| 7424 | /** |
| 7425 | * iw_setnone_getnone() - Generic "action" private ioctl handler |
| 7426 | * @dev: device upon which the ioctl was received |
| 7427 | * @info: ioctl request information |
| 7428 | * @wrqu: ioctl request data |
| 7429 | * @extra: ioctl extra data |
| 7430 | * |
| 7431 | * Return: 0 on success, non-zero on error |
| 7432 | */ |
| 7433 | static int __iw_setnone_getnone(struct net_device *dev, |
| 7434 | struct iw_request_info *info, |
| 7435 | union iwreq_data *wrqu, char *extra) |
| 7436 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7437 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7438 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7439 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7440 | int ret; |
| 7441 | int sub_cmd; |
| 7442 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7443 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7444 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7445 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7446 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7447 | if (0 != ret) |
| 7448 | return ret; |
| 7449 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7450 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7451 | if (0 != ret) |
| 7452 | return ret; |
| 7453 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7454 | #ifdef CONFIG_COMPAT |
| 7455 | /* this ioctl is a special case where a sub-ioctl is used and both |
| 7456 | * the number of get and set args is 0. in this specific case the |
| 7457 | * logic in iwpriv places the sub_cmd in the data.flags portion of |
| 7458 | * the iwreq. unfortunately the location of this field will be |
| 7459 | * different between 32-bit and 64-bit userspace, and the standard |
| 7460 | * compat support in the kernel does not handle this case. so we |
| 7461 | * need to explicitly handle it here. |
| 7462 | */ |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 7463 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7464 | struct compat_iw_point *compat_iw_point = |
| 7465 | (struct compat_iw_point *)&wrqu->data; |
| 7466 | sub_cmd = compat_iw_point->flags; |
| 7467 | } else { |
| 7468 | sub_cmd = wrqu->data.flags; |
| 7469 | } |
| 7470 | #else |
| 7471 | sub_cmd = wrqu->data.flags; |
| 7472 | #endif |
| 7473 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7474 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7475 | switch (sub_cmd) { |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7476 | case WE_GET_FW_PROFILE_DATA: |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7477 | ret = wma_cli_set_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 7478 | WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, |
| 7479 | 0, DBG_CMD); |
| 7480 | break; |
| 7481 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7482 | case WE_IBSS_GET_PEER_INFO_ALL: |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7483 | hdd_wlan_get_ibss_peer_info_all(adapter); |
| 7484 | break; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7485 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7486 | case WE_SET_REASSOC_TRIGGER: |
| 7487 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 7488 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7489 | tSirMacAddr bssid; |
Jeff Johnson | 29c7867 | 2019-02-26 21:05:53 -0800 | [diff] [blame] | 7490 | uint32_t roam_id = INVALID_ROAM_ID; |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7491 | uint8_t operating_ch = |
Jeff Johnson | 8626e93 | 2019-02-27 18:35:22 -0800 | [diff] [blame] | 7492 | adapter->session.station.conn_info.channel; |
Jeff Johnson | 9ff1695 | 2019-02-26 20:58:44 -0800 | [diff] [blame] | 7493 | tCsrRoamModifyProfileFields mod_fields; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7494 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7495 | sme_get_modify_profile_fields(mac_handle, adapter->vdev_id, |
Jeff Johnson | 9ff1695 | 2019-02-26 20:58:44 -0800 | [diff] [blame] | 7496 | &mod_fields); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7497 | if (roaming_offload_enabled(hdd_ctx)) { |
| 7498 | qdf_mem_copy(bssid, |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 7499 | &adapter->session.station.conn_info.bssid, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7500 | sizeof(bssid)); |
Naveen Rawat | 664a7cb | 2017-01-19 17:58:14 -0800 | [diff] [blame] | 7501 | hdd_wma_send_fastreassoc_cmd(adapter, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7502 | bssid, operating_ch); |
| 7503 | } else { |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7504 | sme_roam_reassoc(mac_handle, adapter->vdev_id, |
Jeff Johnson | 29c7867 | 2019-02-26 21:05:53 -0800 | [diff] [blame] | 7505 | NULL, mod_fields, &roam_id, 1); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 7506 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7507 | return 0; |
| 7508 | } |
| 7509 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7510 | case WE_STOP_OBSS_SCAN: |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7511 | /* |
| 7512 | * 1.OBSS Scan is mandatory while operating in 2.4GHz |
| 7513 | * 2.OBSS scan is stopped by Firmware during the disassociation |
| 7514 | * 3.OBSS stop comamnd is added for debugging purpose |
| 7515 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7516 | if (!mac_handle) { |
| 7517 | hdd_err("mac_handle context is NULL"); |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 7518 | return -EINVAL; |
| 7519 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7520 | sme_ht40_stop_obss_scan(mac_handle, adapter->vdev_id); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7521 | break; |
| 7522 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7523 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7524 | hdd_err("unknown ioctl %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7525 | break; |
| 7526 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7527 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7528 | return ret; |
| 7529 | } |
| 7530 | |
| 7531 | static int iw_setnone_getnone(struct net_device *dev, |
| 7532 | struct iw_request_info *info, |
| 7533 | union iwreq_data *wrqu, char *extra) |
| 7534 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7535 | int errno; |
| 7536 | struct osif_vdev_sync *vdev_sync; |
| 7537 | |
| 7538 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 7539 | if (errno) |
| 7540 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7541 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7542 | errno = __iw_setnone_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7543 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 7544 | osif_vdev_sync_op_stop(vdev_sync); |
| 7545 | |
| 7546 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7547 | } |
| 7548 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7549 | #ifdef MPC_UT_FRAMEWORK |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7550 | static void |
| 7551 | hdd_policy_mgr_set_hw_mode_ut(struct hdd_context *hdd_ctx, |
| 7552 | struct hdd_adapter *adapter, int cmd) |
| 7553 | { |
| 7554 | enum hw_mode_ss_config mac0_ss; |
| 7555 | enum hw_mode_bandwidth mac0_bw; |
| 7556 | enum hw_mode_ss_config mac1_ss; |
| 7557 | enum hw_mode_bandwidth mac1_bw; |
| 7558 | enum hw_mode_mac_band_cap mac0_band_cap; |
| 7559 | enum hw_mode_dbs_capab dbs; |
| 7560 | |
| 7561 | switch (cmd) { |
| 7562 | case 0: |
| 7563 | hdd_debug("set hw mode for single mac"); |
| 7564 | mac0_ss = HW_MODE_SS_2x2; |
| 7565 | mac0_bw = HW_MODE_80_MHZ; |
| 7566 | mac1_ss = HW_MODE_SS_0x0; |
| 7567 | mac1_bw = HW_MODE_BW_NONE; |
| 7568 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7569 | dbs = HW_MODE_DBS_NONE; |
| 7570 | break; |
| 7571 | case 1: |
| 7572 | hdd_debug("set hw mode for dual mac"); |
| 7573 | mac0_ss = HW_MODE_SS_1x1; |
| 7574 | mac0_bw = HW_MODE_80_MHZ; |
| 7575 | mac1_ss = HW_MODE_SS_1x1; |
| 7576 | mac1_bw = HW_MODE_40_MHZ; |
| 7577 | mac0_band_cap = HW_MODE_MAC_BAND_NONE; |
| 7578 | dbs = HW_MODE_DBS; |
| 7579 | break; |
| 7580 | case 2: |
| 7581 | hdd_debug("set hw mode for 2x2 5g + 1x1 2g"); |
| 7582 | mac0_ss = HW_MODE_SS_2x2; |
| 7583 | mac0_bw = HW_MODE_80_MHZ; |
| 7584 | mac1_ss = HW_MODE_SS_1x1; |
| 7585 | mac1_bw = HW_MODE_40_MHZ; |
| 7586 | mac0_band_cap = HW_MODE_MAC_BAND_5G; |
| 7587 | dbs = HW_MODE_DBS; |
| 7588 | break; |
| 7589 | case 3: |
| 7590 | hdd_debug("set hw mode for 2x2 2g + 1x1 5g"); |
| 7591 | mac0_ss = HW_MODE_SS_2x2; |
| 7592 | mac0_bw = HW_MODE_40_MHZ; |
| 7593 | mac1_ss = HW_MODE_SS_1x1; |
| 7594 | mac1_bw = HW_MODE_40_MHZ; |
| 7595 | mac0_band_cap = HW_MODE_MAC_BAND_2G; |
| 7596 | dbs = HW_MODE_DBS; |
| 7597 | break; |
| 7598 | default: |
| 7599 | hdd_err("unknown cmd %d", cmd); |
| 7600 | return; |
| 7601 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7602 | policy_mgr_pdev_set_hw_mode(hdd_ctx->psoc, adapter->vdev_id, |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7603 | mac0_ss, mac0_bw, mac1_ss, mac1_bw, |
| 7604 | mac0_band_cap, dbs, HW_MODE_AGILE_DFS_NONE, |
| 7605 | HW_MODE_SBS_NONE, |
| 7606 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
| 7607 | } |
| 7608 | |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7609 | 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] | 7610 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7611 | { |
Jeff Johnson | ac8b0de | 2017-02-10 09:22:22 -0800 | [diff] [blame] | 7612 | switch (sub_cmd) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7613 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7614 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7615 | hdd_debug("<iwpriv wlan0 pm_clist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7616 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7617 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7618 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7619 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7620 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7621 | return 0; |
| 7622 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7623 | policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7624 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7625 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7626 | } |
| 7627 | break; |
| 7628 | |
| 7629 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7630 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7631 | hdd_debug("<iwpriv wlan0 pm_dlist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7632 | if ((apps_args[0] < 0) || (apps_args[1] < 0)) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7633 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7634 | return 0; |
| 7635 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7636 | policy_mgr_decr_connection_count_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7637 | apps_args[0], apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7638 | } |
| 7639 | break; |
| 7640 | |
| 7641 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7642 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7643 | hdd_debug("<iwpriv wlan0 pm_ulist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7644 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7645 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 7646 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 7647 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 7648 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7649 | return 0; |
| 7650 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7651 | policy_mgr_update_connection_info_utfw(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7652 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 7653 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7654 | } |
| 7655 | break; |
| 7656 | |
| 7657 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7658 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7659 | hdd_debug("<iwpriv wlan0 pm_dbs> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7660 | if (apps_args[0] == 0) |
| 7661 | wma_set_dbs_capability_ut(0); |
| 7662 | else |
| 7663 | wma_set_dbs_capability_ut(1); |
| 7664 | |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7665 | if (apps_args[1] >= PM_THROUGHPUT && |
| 7666 | apps_args[1] <= PM_LATENCY) { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7667 | hdd_debug("setting system pref to [%d]\n", |
| 7668 | apps_args[1]); |
Krunal Soni | e71838d | 2018-09-27 10:45:05 -0700 | [diff] [blame] | 7669 | ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, |
| 7670 | apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7671 | } |
| 7672 | } |
| 7673 | break; |
| 7674 | |
| 7675 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7676 | { |
| 7677 | uint8_t pcl[QDF_MAX_NUM_CHAN] = {0}; |
| 7678 | uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0}; |
| 7679 | uint32_t pcl_len = 0, i = 0; |
| 7680 | |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7681 | hdd_debug("<iwpriv wlan0 pm_pcl> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7682 | |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7683 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7684 | hdd_err("Invalid input param received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7685 | return 0; |
| 7686 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7687 | policy_mgr_get_pcl(hdd_ctx->psoc, apps_args[0], |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7688 | pcl, &pcl_len, |
| 7689 | weight_list, QDF_ARRAY_SIZE(weight_list)); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7690 | hdd_debug("PCL list for role[%d] is {", apps_args[0]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7691 | for (i = 0 ; i < pcl_len; i++) |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7692 | hdd_debug(" %d, ", pcl[i]); |
| 7693 | hdd_debug("}--------->\n"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7694 | } |
| 7695 | break; |
| 7696 | |
| 7697 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7698 | { |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7699 | hdd_debug("pm_set_hw_mode cmd %d", apps_args[0]); |
| 7700 | 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] | 7701 | } |
| 7702 | break; |
| 7703 | |
| 7704 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7705 | { |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 7706 | hdd_debug("<iwpriv wlan0 pm_query_action> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7707 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7708 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7709 | return 0; |
| 7710 | } |
Tushnim Bhattacharyya | dfbce70 | 2018-03-27 12:46:48 -0700 | [diff] [blame] | 7711 | policy_mgr_current_connections_update( |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7712 | hdd_ctx->psoc, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7713 | adapter->vdev_id, apps_args[0], |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 7714 | POLICY_MGR_UPDATE_REASON_UT); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7715 | } |
| 7716 | break; |
| 7717 | |
| 7718 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7719 | { |
| 7720 | bool allow; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7721 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 7722 | hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7723 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 7724 | (apps_args[2] < 0)) { |
| 7725 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 7726 | return 0; |
| 7727 | } |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7728 | allow = policy_mgr_allow_concurrency(hdd_ctx->psoc, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7729 | apps_args[0], apps_args[1], apps_args[2]); |
Liangwei Dong | 509c347 | 2018-05-30 07:05:59 -0400 | [diff] [blame] | 7730 | hdd_debug("allow %d {0 = don't allow, 1 = allow}", allow); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7731 | } |
| 7732 | break; |
| 7733 | |
| 7734 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7735 | { |
| 7736 | clean_report(hdd_ctx); |
| 7737 | if (apps_args[0] == 1) { |
| 7738 | wlan_hdd_one_connection_scenario(hdd_ctx); |
| 7739 | } else if (apps_args[0] == 2) { |
| 7740 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7741 | 6, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7742 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7743 | 36, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7744 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7745 | 6, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7746 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7747 | 36, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7748 | } else if (apps_args[0] == 3) { |
| 7749 | /* MCC on same band with 2x2 same mac*/ |
| 7750 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7751 | 6, 11, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7752 | /* MCC on diff band with 2x2 same mac*/ |
| 7753 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7754 | 6, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7755 | /* MCC on diff band with 1x1 diff mac */ |
| 7756 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7757 | 36, 6, POLICY_MGR_ONE_ONE, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7758 | /* MCC on diff band with 1x1 same mac */ |
| 7759 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7760 | 36, 6, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7761 | /* SCC on same band with 2x2 same mac */ |
| 7762 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7763 | 36, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7764 | /* SCC on same 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, 36, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7767 | /* MCC 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, 149, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7770 | /* MCC 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, 149, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7773 | } |
| 7774 | print_report(hdd_ctx); |
| 7775 | } |
| 7776 | break; |
| 7777 | } |
| 7778 | return 0; |
| 7779 | } |
| 7780 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7781 | 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] | 7782 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7783 | { |
| 7784 | return 0; |
| 7785 | } |
| 7786 | #endif |
| 7787 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7788 | /** |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7789 | * hdd_ch_avoid_unit_cmd - unit test ch avoidance |
| 7790 | * @hdd_ctx: hdd_context |
| 7791 | * @num_args: input args number |
| 7792 | * @apps_args: args data ptr |
| 7793 | * |
| 7794 | * This is to inject a ch avoid event to do unit test SAP chan avoidance. |
| 7795 | * |
| 7796 | * Return: void |
| 7797 | */ |
| 7798 | #if WLAN_DEBUG |
| 7799 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7800 | int num_args, int *apps_args) |
| 7801 | { |
| 7802 | struct ch_avoid_ind_type ch_avoid; |
| 7803 | int cnt = 0, i; |
| 7804 | |
| 7805 | if (num_args < 2 || num_args > CH_AVOID_MAX_RANGE * 2 || |
| 7806 | num_args % 2 != 0) |
| 7807 | return; |
| 7808 | hdd_info("simulate ch avoid num_args %d", num_args); |
| 7809 | for (i = 0; i < num_args && i < CH_AVOID_MAX_RANGE * 2; i++) { |
| 7810 | ch_avoid.avoid_freq_range[cnt].start_freq = |
| 7811 | apps_args[i]; |
| 7812 | ch_avoid.avoid_freq_range[cnt].end_freq = |
| 7813 | apps_args[++i]; |
| 7814 | |
| 7815 | hdd_info("simulate ch avoid [%d %d]", |
| 7816 | ch_avoid.avoid_freq_range[cnt].start_freq, |
| 7817 | ch_avoid.avoid_freq_range[cnt].end_freq); |
| 7818 | cnt++; |
| 7819 | } |
| 7820 | ch_avoid.ch_avoid_range_cnt = cnt; |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 7821 | ucfg_reg_unit_simulate_ch_avoid(hdd_ctx->psoc, &ch_avoid); |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7822 | } |
| 7823 | #else |
| 7824 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7825 | int num_args, int *apps_args) |
| 7826 | { |
| 7827 | } |
| 7828 | #endif |
| 7829 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7830 | * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7831 | * @dev: device upon which the ioctl was received |
| 7832 | * @info: ioctl request information |
| 7833 | * @wrqu: ioctl request data |
| 7834 | * @extra: ioctl extra data |
| 7835 | * |
| 7836 | * This is an SSR-protected generic handler for private ioctls which |
| 7837 | * take multiple arguments. Note that this implementation is also |
| 7838 | * somewhat unique in that it is shared by both STA-mode and SAP-mode |
| 7839 | * interfaces. |
| 7840 | * |
| 7841 | * Return: 0 on success, non-zero on error |
| 7842 | */ |
| 7843 | static int __iw_set_var_ints_getnone(struct net_device *dev, |
| 7844 | struct iw_request_info *info, |
| 7845 | union iwreq_data *wrqu, char *extra) |
| 7846 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7847 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7848 | mac_handle_t mac_handle; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7849 | 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] | 7850 | int sub_cmd; |
| 7851 | int *apps_args = (int *) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7852 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7853 | int ret, num_args; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7854 | void *soc = NULL; |
| 7855 | struct cdp_pdev *pdev = NULL; |
| 7856 | struct cdp_vdev *vdev = NULL; |
| 7857 | struct cdp_txrx_stats_req req = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7858 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7859 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7860 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7861 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7862 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7863 | if (0 != ret) |
| 7864 | return ret; |
| 7865 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7866 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7867 | if (0 != ret) |
| 7868 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7869 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7870 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7871 | sub_cmd = wrqu->data.flags; |
| 7872 | num_args = wrqu->data.length; |
| 7873 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7874 | hdd_debug("Received length %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7875 | |
| 7876 | switch (sub_cmd) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7877 | case WE_IBSS_GET_PEER_INFO: |
| 7878 | { |
| 7879 | pr_info("Station ID = %d\n", apps_args[0]); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7880 | hdd_wlan_get_ibss_peer_info(adapter, apps_args[0]); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7881 | } |
| 7882 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7883 | |
| 7884 | case WE_P2P_NOA_CMD: |
| 7885 | { |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7886 | struct p2p_app_set_ps p2p_noa; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7887 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7888 | if (adapter->device_mode != QDF_P2P_GO_MODE) { |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7889 | hdd_err("Setting NoA is not allowed in Device mode %s(%d)", |
Dustin Brown | 458027c | 2018-10-19 12:26:27 -0700 | [diff] [blame] | 7890 | qdf_opmode_str(adapter->device_mode), |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7891 | adapter->device_mode); |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7892 | return -EINVAL; |
| 7893 | } |
| 7894 | |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7895 | p2p_noa.opp_ps = apps_args[0]; |
| 7896 | p2p_noa.ctWindow = apps_args[1]; |
| 7897 | p2p_noa.duration = apps_args[2]; |
| 7898 | p2p_noa.interval = apps_args[3]; |
| 7899 | p2p_noa.count = apps_args[4]; |
| 7900 | p2p_noa.single_noa_duration = apps_args[5]; |
| 7901 | p2p_noa.psSelection = apps_args[6]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7902 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7903 | hdd_debug("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7904 | apps_args[0], apps_args[1], apps_args[2], |
| 7905 | apps_args[3], apps_args[4], |
| 7906 | apps_args[5], apps_args[6]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7907 | |
Jeff Johnson | 156cd08 | 2019-03-10 21:49:54 -0700 | [diff] [blame] | 7908 | hdd_set_p2p_ps(dev, &p2p_noa); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7909 | |
| 7910 | } |
| 7911 | break; |
| 7912 | |
| 7913 | case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD: |
| 7914 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7915 | hdd_debug("SELECTIVE_MODULE_LOG %d arg1 %d arg2", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7916 | apps_args[0], apps_args[1]); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 7917 | qdf_trace_enable(apps_args[0], apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7918 | } |
| 7919 | break; |
| 7920 | |
| 7921 | case WE_MTRACE_DUMP_CMD: |
| 7922 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7923 | 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] | 7924 | apps_args[0], apps_args[1], |
| 7925 | apps_args[2], apps_args[3]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7926 | qdf_trace_dump_all((void *)mac_handle, apps_args[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7927 | apps_args[1], apps_args[2], |
| 7928 | apps_args[3]); |
| 7929 | |
| 7930 | } |
| 7931 | break; |
| 7932 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7933 | case WE_POLICY_MANAGER_CINFO_CMD: |
| 7934 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7935 | struct policy_mgr_conc_connection_info *conn_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7936 | uint32_t i = 0, len = 0; |
| 7937 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7938 | hdd_info("<iwpriv wlan0 pm_cinfo> is called"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7939 | conn_info = policy_mgr_get_conn_info(&len); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7940 | pr_info("+--------------------------+\n"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7941 | for (i = 0; i < len; i++) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7942 | pr_info("|table_index[%d]\t\t\n", i); |
| 7943 | pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id); |
| 7944 | pr_info("|\t|chan - %-10d|\n", conn_info->chan); |
| 7945 | pr_info("|\t|bw - %-10d|\n", conn_info->bw); |
| 7946 | pr_info("|\t|mode - %-10d|\n", conn_info->mode); |
| 7947 | pr_info("|\t|mac - %-10d|\n", conn_info->mac); |
| 7948 | pr_info("|\t|in_use - %-10d|\n", conn_info->in_use); |
| 7949 | pr_info("+--------------------------+\n"); |
| 7950 | conn_info++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7951 | } |
| 7952 | } |
| 7953 | break; |
| 7954 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7955 | case WE_UNIT_TEST_CMD: |
| 7956 | { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7957 | QDF_STATUS status; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7958 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7959 | if ((apps_args[0] < WLAN_MODULE_ID_MIN) || |
| 7960 | (apps_args[0] >= WLAN_MODULE_ID_MAX)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7961 | hdd_err("Invalid MODULE ID %d", apps_args[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7962 | return -EINVAL; |
| 7963 | } |
Sourav Mohapatra | ea7210b | 2018-11-16 16:58:52 +0530 | [diff] [blame] | 7964 | if ((apps_args[1] > (WMA_MAX_NUM_ARGS)) || |
Anurag Chouhan | 7756418 | 2016-09-03 16:38:01 +0530 | [diff] [blame] | 7965 | (apps_args[1] < 0)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7966 | hdd_err("Too Many/Few args %d", apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7967 | return -EINVAL; |
| 7968 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 7969 | status = sme_send_unit_test_cmd(adapter->vdev_id, |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7970 | apps_args[0], |
| 7971 | apps_args[1], |
| 7972 | &apps_args[2]); |
| 7973 | if (QDF_STATUS_SUCCESS != status) { |
Jeff Johnson | 21d63bb | 2017-10-07 17:45:33 -0700 | [diff] [blame] | 7974 | hdd_err("sme_send_unit_test_cmd returned %d", status); |
| 7975 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7976 | } |
| 7977 | } |
| 7978 | break; |
| 7979 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 7980 | case WE_LED_FLASHING_PARAM: |
| 7981 | { |
| 7982 | int i; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7983 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7984 | if (num_args != 4) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7985 | hdd_err("gpio_control: 4 parameters are required"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7986 | return -EINVAL; |
| 7987 | } |
| 7988 | for (i = 0; i < num_args; i++) { |
| 7989 | if (apps_args[i] >= 0x7fffffff) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7990 | hdd_err("gpio_control: parameter should be less than 0x7fffffff"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7991 | return -EINVAL; |
| 7992 | } |
| 7993 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7994 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7995 | 0, apps_args[0], apps_args[1]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7996 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7997 | 1, apps_args[2], apps_args[3]); |
| 7998 | } |
| 7999 | break; |
| 8000 | #endif |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 8001 | case WE_SET_PKTLOG: |
| 8002 | { |
| 8003 | int ret; |
| 8004 | |
| 8005 | if (num_args < 1 || num_args > 2) { |
| 8006 | hdd_err("pktlog: either 1 or 2 parameters are required"); |
| 8007 | return -EINVAL; |
| 8008 | } |
| 8009 | |
| 8010 | ret = hdd_process_pktlog_command(hdd_ctx, apps_args[0], |
| 8011 | apps_args[1]); |
| 8012 | if (ret) |
| 8013 | return ret; |
| 8014 | break; |
| 8015 | } |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8016 | case WE_MAC_PWR_DEBUG_CMD: |
| 8017 | { |
| 8018 | struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args; |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8019 | int i, j; |
| 8020 | |
| 8021 | if (num_args < 3) { |
| 8022 | hdd_err("number of arguments can't be null %d", |
| 8023 | num_args); |
| 8024 | return -EINVAL; |
| 8025 | } |
| 8026 | if (num_args - 3 != apps_args[2]) { |
| 8027 | hdd_err("arg list of size %d doesn't match num_args %d", |
| 8028 | num_args-3, apps_args[2]); |
| 8029 | return -EINVAL; |
| 8030 | } |
| 8031 | if ((apps_args[1] < WLAN_MODULE_ID_MIN) || |
| 8032 | (apps_args[1] >= WLAN_MODULE_ID_MAX)) { |
| 8033 | hdd_err("Invalid MODULE ID %d", apps_args[1]); |
| 8034 | return -EINVAL; |
| 8035 | } |
| 8036 | if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) { |
| 8037 | hdd_err("Too Many args %d", apps_args[2]); |
| 8038 | return -EINVAL; |
| 8039 | } |
| 8040 | mac_pwr_dbg_args.pdev_id = apps_args[0]; |
| 8041 | mac_pwr_dbg_args.module_id = apps_args[1]; |
| 8042 | mac_pwr_dbg_args.num_args = apps_args[2]; |
| 8043 | |
| 8044 | for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++) |
| 8045 | mac_pwr_dbg_args.args[i] = apps_args[j]; |
| 8046 | |
| 8047 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8048 | sme_process_mac_pwr_dbg_cmd(mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8049 | adapter->vdev_id, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 8050 | &mac_pwr_dbg_args)) { |
| 8051 | return -EINVAL; |
| 8052 | } |
| 8053 | } |
| 8054 | break; |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 8055 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 8056 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 8057 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 8058 | case WE_POLICY_MANAGER_DBS_CMD: |
| 8059 | case WE_POLICY_MANAGER_PCL_CMD: |
| 8060 | case WE_POLICY_SET_HW_MODE_CMD: |
| 8061 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 8062 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 8063 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 8064 | { |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 8065 | if (!hdd_ctx->config->is_unit_test_framework_enabled) { |
| 8066 | hdd_warn_rl("UT framework is disabled"); |
| 8067 | return -EINVAL; |
| 8068 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8069 | iw_get_policy_manager_ut_ops(hdd_ctx, adapter, |
Krunal Soni | 3de6853 | 2018-09-05 12:16:58 -0700 | [diff] [blame] | 8070 | sub_cmd, apps_args); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 8071 | } |
| 8072 | break; |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 8073 | case WE_SET_CHAN_AVOID: |
| 8074 | { |
| 8075 | hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args); |
| 8076 | } |
| 8077 | break; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8078 | case WE_SET_TXRX_STATS: |
| 8079 | { |
| 8080 | ret = cds_get_datapath_handles(&soc, &pdev, &vdev, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8081 | adapter->vdev_id); |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8082 | |
| 8083 | if (ret != 0) { |
| 8084 | hdd_err("Invalid handles"); |
| 8085 | break; |
| 8086 | } |
| 8087 | |
| 8088 | req.stats = apps_args[0]; |
| 8089 | /* default value of secondary parameter is 0(mac_id) */ |
| 8090 | req.mac_id = apps_args[1]; |
| 8091 | |
| 8092 | hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", |
| 8093 | req.stats, req.mac_id); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8094 | if (apps_args[0] == CDP_TXRX_STATS_28) { |
Jeff Johnson | 457c242 | 2019-02-27 13:56:04 -0800 | [diff] [blame] | 8095 | if (sta_ctx->conn_info.is_authenticated) { |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8096 | hdd_debug("ap mac addr: %pM", |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 8097 | (void *)&sta_ctx->conn_info.bssid); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8098 | req.peer_addr = |
Jeff Johnson | e04b699 | 2019-02-27 14:06:55 -0800 | [diff] [blame] | 8099 | (char *)&sta_ctx->conn_info.bssid; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 8100 | } |
| 8101 | } |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 8102 | ret = cdp_txrx_stats_request(soc, vdev, &req); |
| 8103 | break; |
| 8104 | } |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8105 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 8106 | case WE_MOTION_DET_CONFIG_PARAM: |
| 8107 | { |
| 8108 | struct sme_motion_det_cfg motion_det_cfg; |
| 8109 | |
| 8110 | if (num_args != 15) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8111 | hdd_err_rl("mt_config: Invalid no of args"); |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8112 | return -EINVAL; |
| 8113 | } |
| 8114 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8115 | motion_det_cfg.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8116 | motion_det_cfg.time_t1 = apps_args[0]; |
| 8117 | motion_det_cfg.time_t2 = apps_args[1]; |
| 8118 | motion_det_cfg.n1 = apps_args[2]; |
| 8119 | motion_det_cfg.n2 = apps_args[3]; |
| 8120 | motion_det_cfg.time_t1_gap = apps_args[4]; |
| 8121 | motion_det_cfg.time_t2_gap = apps_args[5]; |
| 8122 | motion_det_cfg.coarse_K = apps_args[6]; |
| 8123 | motion_det_cfg.fine_K = apps_args[7]; |
| 8124 | motion_det_cfg.coarse_Q = apps_args[8]; |
| 8125 | motion_det_cfg.fine_Q = apps_args[9]; |
| 8126 | motion_det_cfg.md_coarse_thr_high = apps_args[10]; |
| 8127 | motion_det_cfg.md_fine_thr_high = apps_args[11]; |
| 8128 | motion_det_cfg.md_coarse_thr_low = apps_args[12]; |
| 8129 | motion_det_cfg.md_fine_thr_low = apps_args[13]; |
| 8130 | adapter->motion_detection_mode = apps_args[14]; |
| 8131 | sme_motion_det_config(hdd_ctx->mac_handle, &motion_det_cfg); |
| 8132 | } |
| 8133 | break; |
| 8134 | case WE_MOTION_DET_BASE_LINE_CONFIG_PARAM: |
| 8135 | { |
| 8136 | struct sme_motion_det_base_line_cfg motion_det_base_line_cfg; |
| 8137 | |
| 8138 | if (num_args != 4) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8139 | hdd_err_rl("mt_bl_config: Invalid no of args"); |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8140 | return -EINVAL; |
| 8141 | } |
| 8142 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8143 | motion_det_base_line_cfg.vdev_id = adapter->vdev_id; |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 8144 | motion_det_base_line_cfg.bl_time_t = apps_args[0]; |
| 8145 | motion_det_base_line_cfg.bl_packet_gap = apps_args[1]; |
| 8146 | motion_det_base_line_cfg.bl_n = apps_args[2]; |
| 8147 | motion_det_base_line_cfg.bl_num_meas = apps_args[3]; |
| 8148 | sme_motion_det_base_line_config(hdd_ctx->mac_handle, |
| 8149 | &motion_det_base_line_cfg); |
| 8150 | } |
| 8151 | break; |
| 8152 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 8153 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 8154 | case WE_SET_THERMAL_THROTTLE_CFG: |
| 8155 | { |
| 8156 | QDF_STATUS status; |
| 8157 | |
| 8158 | if (num_args != 7) { |
Visweswara Tanuku | 6488a1c | 2019-02-13 14:15:26 +0530 | [diff] [blame] | 8159 | hdd_err_rl("set_thermal_cfg: Invalid no of args"); |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 8160 | return -EINVAL; |
| 8161 | } |
| 8162 | |
| 8163 | /* Check for valid inputs */ |
| 8164 | if (apps_args[0] < 0 || apps_args[0] > 1 || apps_args[1] < 0 || |
| 8165 | apps_args[2] < 0 || apps_args[2] > 100 || |
| 8166 | apps_args[3] < 0 || apps_args[3] > 3 || apps_args[4] < 0 || |
| 8167 | apps_args[5] < 0 || apps_args[6] < 0 || |
| 8168 | apps_args[5] <= apps_args[4]) |
| 8169 | return -EINVAL; |
| 8170 | |
| 8171 | status = sme_set_thermal_throttle_cfg(hdd_ctx->mac_handle, |
| 8172 | apps_args[0], |
| 8173 | apps_args[1], |
| 8174 | apps_args[2], |
| 8175 | apps_args[3], |
| 8176 | apps_args[6]); |
| 8177 | if (QDF_IS_STATUS_ERROR(status)) |
| 8178 | return qdf_status_to_os_return(status); |
| 8179 | |
| 8180 | if (!apps_args[6]) { |
| 8181 | status = sme_set_thermal_mgmt(hdd_ctx->mac_handle, |
| 8182 | apps_args[4], |
| 8183 | apps_args[5]); |
| 8184 | if (QDF_IS_STATUS_ERROR(status)) |
| 8185 | return qdf_status_to_os_return(status); |
| 8186 | } |
| 8187 | break; |
| 8188 | } |
| 8189 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8190 | default: |
| 8191 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8192 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8193 | } |
| 8194 | break; |
| 8195 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8196 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8197 | return 0; |
| 8198 | } |
| 8199 | |
| 8200 | /** |
| 8201 | * iw_hdd_set_var_ints_getnone() - set var ints getnone callback |
| 8202 | * @dev: pointer to net_device structure |
| 8203 | * @info: pointer to iw_request_info structure |
| 8204 | * @wrqu: pointer to iwreq_data |
| 8205 | * @extra; extra |
| 8206 | * |
| 8207 | * Return: 0 on success, error number otherwise |
| 8208 | * |
| 8209 | */ |
| 8210 | static int iw_hdd_set_var_ints_getnone(struct net_device *dev, |
| 8211 | struct iw_request_info *info, |
| 8212 | union iwreq_data *wrqu, char *extra) |
| 8213 | { |
| 8214 | union iwreq_data u_priv_wrqu; |
| 8215 | int apps_args[MAX_VAR_ARGS] = {0}; |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8216 | int errno, num_args; |
| 8217 | struct osif_vdev_sync *vdev_sync; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8218 | |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 8219 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8220 | hdd_err("permission check failed"); |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 8221 | return -EPERM; |
| 8222 | } |
| 8223 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8224 | /* Helper function to get iwreq_data with compat handling. */ |
| 8225 | if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) |
| 8226 | return -EINVAL; |
| 8227 | |
| 8228 | if (NULL == u_priv_wrqu.data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8229 | hdd_err("NULL data pointer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8230 | return -EINVAL; |
| 8231 | } |
| 8232 | |
| 8233 | num_args = u_priv_wrqu.data.length; |
| 8234 | if (num_args > MAX_VAR_ARGS) |
| 8235 | num_args = MAX_VAR_ARGS; |
| 8236 | |
| 8237 | if (copy_from_user(apps_args, u_priv_wrqu.data.pointer, |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8238 | sizeof(int) * num_args)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8239 | hdd_err("failed to copy data from user buffer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8240 | return -EFAULT; |
| 8241 | } |
| 8242 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8243 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8244 | if (errno) |
| 8245 | return errno; |
| 8246 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8247 | errno = __iw_set_var_ints_getnone(dev, info, &u_priv_wrqu, |
| 8248 | (char *)&apps_args); |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8249 | |
| 8250 | osif_vdev_sync_op_stop(vdev_sync); |
| 8251 | |
| 8252 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8253 | } |
| 8254 | |
| 8255 | /** |
| 8256 | * iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 8257 | * @dev: device upon which the ioctl was received |
| 8258 | * @info: ioctl request information |
| 8259 | * @wrqu: ioctl request data |
| 8260 | * @extra: ioctl extra data |
| 8261 | * |
| 8262 | * This is a generic handler for private ioctls which take multiple |
| 8263 | * arguments. Note that this implementation is also somewhat unique |
| 8264 | * in that it is shared by both STA-mode and SAP-mode interfaces. |
| 8265 | * |
| 8266 | * Return: 0 on success, non-zero on error |
| 8267 | */ |
| 8268 | int iw_set_var_ints_getnone(struct net_device *dev, |
| 8269 | struct iw_request_info *info, |
| 8270 | union iwreq_data *wrqu, char *extra) |
| 8271 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8272 | int errno; |
| 8273 | struct osif_vdev_sync *vdev_sync; |
| 8274 | |
| 8275 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8276 | if (errno) |
| 8277 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8278 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8279 | errno = __iw_set_var_ints_getnone(dev, info, wrqu, extra); |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8280 | |
| 8281 | osif_vdev_sync_op_stop(vdev_sync); |
| 8282 | |
| 8283 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8284 | } |
| 8285 | |
| 8286 | /** |
| 8287 | * iw_add_tspec - Add TSpec private ioctl handler |
| 8288 | * @dev: device upon which the ioctl was received |
| 8289 | * @info: ioctl request information |
| 8290 | * @wrqu: ioctl request data |
| 8291 | * @extra: ioctl extra data |
| 8292 | * |
| 8293 | * Return: 0 on success, non-zero on error |
| 8294 | */ |
| 8295 | static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8296 | union iwreq_data *wrqu, char *extra) |
| 8297 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8298 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8299 | 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] | 8300 | 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] | 8301 | int params[HDD_WLAN_WMM_PARAM_COUNT]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8302 | struct sme_qos_wmmtspecinfo tspec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8303 | uint32_t handle; |
| 8304 | struct iw_point s_priv_data; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8305 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8306 | int ret; |
| 8307 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8308 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8309 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8310 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8311 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8312 | if (0 != ret) |
| 8313 | return ret; |
| 8314 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8315 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8316 | if (0 != ret) |
| 8317 | return ret; |
| 8318 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8319 | /* make sure the application is sufficiently priviledged */ |
| 8320 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8321 | /* this ioctl wants to return status to user space it must be */ |
| 8322 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8323 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8324 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8325 | |
| 8326 | /* we must be associated in order to add a tspec */ |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 8327 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8328 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8329 | return 0; |
| 8330 | } |
| 8331 | /* since we are defined to be a "get" ioctl, and since the number */ |
| 8332 | /* of params exceeds the number of params that wireless extensions */ |
| 8333 | /* will pass down in the iwreq_data, we must copy the "set" params. */ |
| 8334 | /* We must handle the compat for iwreq_data in 32U/64K environment. */ |
| 8335 | |
| 8336 | /* helper function to get iwreq_data with compat handling. */ |
| 8337 | if (hdd_priv_get_data(&s_priv_data, wrqu)) { |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8338 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8339 | return 0; |
| 8340 | } |
| 8341 | /* make sure all params are correctly passed to function */ |
| 8342 | if ((NULL == s_priv_data.pointer) || |
| 8343 | (HDD_WLAN_WMM_PARAM_COUNT != s_priv_data.length)) { |
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 | /* from user space ourselves */ |
| 8348 | if (copy_from_user(¶ms, s_priv_data.pointer, sizeof(params))) { |
| 8349 | /* hmmm, can't get them */ |
| 8350 | return -EIO; |
| 8351 | } |
| 8352 | /* clear the tspec */ |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8353 | memset(&tspec, 0, sizeof(tspec)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8354 | |
| 8355 | /* validate the handle */ |
| 8356 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8357 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8358 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8359 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8360 | return 0; |
| 8361 | } |
| 8362 | /* validate the TID */ |
| 8363 | if (params[HDD_WLAN_WMM_PARAM_TID] > 7) { |
| 8364 | /* out of range */ |
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 | } |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8368 | tspec.ts_info.tid = params[HDD_WLAN_WMM_PARAM_TID]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8369 | |
| 8370 | /* validate the direction */ |
| 8371 | switch (params[HDD_WLAN_WMM_PARAM_DIRECTION]) { |
| 8372 | case HDD_WLAN_WMM_DIRECTION_UPSTREAM: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8373 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_UPLINK; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8374 | break; |
| 8375 | |
| 8376 | case HDD_WLAN_WMM_DIRECTION_DOWNSTREAM: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8377 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_DOWNLINK; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8378 | break; |
| 8379 | |
| 8380 | case HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8381 | tspec.ts_info.direction = SME_QOS_WMM_TS_DIR_BOTH; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8382 | break; |
| 8383 | |
| 8384 | default: |
| 8385 | /* unknown */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8386 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8387 | return 0; |
| 8388 | } |
| 8389 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8390 | tspec.ts_info.psb = params[HDD_WLAN_WMM_PARAM_APSD]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8391 | |
| 8392 | /* validate the user priority */ |
| 8393 | if (params[HDD_WLAN_WMM_PARAM_USER_PRIORITY] >= SME_QOS_WMM_UP_MAX) { |
| 8394 | /* out of range */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8395 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8396 | return 0; |
| 8397 | } |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8398 | tspec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY]; |
| 8399 | 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] | 8400 | hdd_err("***ts_info.up out of bounds***"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8401 | return 0; |
| 8402 | } |
| 8403 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8404 | hdd_debug("TS_INFO PSB %d UP %d !!!", |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8405 | tspec.ts_info.psb, tspec.ts_info.up); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8406 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8407 | tspec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE]; |
| 8408 | tspec.maximum_msdu_size = params[HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE]; |
| 8409 | tspec.min_data_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE]; |
| 8410 | tspec.mean_data_rate = params[HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE]; |
| 8411 | tspec.peak_data_rate = params[HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE]; |
| 8412 | tspec.max_burst_size = params[HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE]; |
| 8413 | tspec.min_phy_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE]; |
| 8414 | tspec.surplus_bw_allowance = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8415 | params[HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8416 | tspec.min_service_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8417 | params[HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8418 | tspec.max_service_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8419 | params[HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8420 | tspec.suspension_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8421 | params[HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL]; |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8422 | tspec.inactivity_interval = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8423 | params[HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL]; |
| 8424 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8425 | tspec.ts_info.burst_size_defn = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8426 | params[HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN]; |
| 8427 | |
| 8428 | /* validate the ts info ack policy */ |
| 8429 | switch (params[HDD_WLAN_WMM_PARAM_ACK_POLICY]) { |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8430 | case TS_INFO_ACK_POLICY_NORMAL_ACK: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8431 | 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] | 8432 | break; |
| 8433 | |
Abhinav Kumar | ab57671 | 2018-11-05 14:32:49 +0530 | [diff] [blame] | 8434 | case TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK: |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8435 | tspec.ts_info.ack_policy = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8436 | SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK; |
| 8437 | break; |
| 8438 | |
| 8439 | default: |
| 8440 | /* unknown */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8441 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8442 | return 0; |
| 8443 | } |
| 8444 | |
Jeff Johnson | c3f37e3 | 2019-03-09 18:03:22 -0800 | [diff] [blame] | 8445 | *wmm_status = hdd_wmm_addts(adapter, handle, &tspec); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8446 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8447 | return 0; |
| 8448 | } |
| 8449 | |
| 8450 | static int iw_add_tspec(struct net_device *dev, |
| 8451 | struct iw_request_info *info, |
| 8452 | union iwreq_data *wrqu, char *extra) |
| 8453 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8454 | int errno; |
| 8455 | struct osif_vdev_sync *vdev_sync; |
| 8456 | |
| 8457 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8458 | if (errno) |
| 8459 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8460 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8461 | errno = __iw_add_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8462 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8463 | osif_vdev_sync_op_stop(vdev_sync); |
| 8464 | |
| 8465 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8466 | } |
| 8467 | |
| 8468 | /** |
| 8469 | * iw_del_tspec - Delete TSpec private ioctl handler |
| 8470 | * @dev: device upon which the ioctl was received |
| 8471 | * @info: ioctl request information |
| 8472 | * @wrqu: ioctl request data |
| 8473 | * @extra: ioctl extra data |
| 8474 | * |
| 8475 | * Return: 0 on success, non-zero on error |
| 8476 | */ |
| 8477 | static int __iw_del_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8478 | union iwreq_data *wrqu, char *extra) |
| 8479 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8480 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8481 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8482 | int *params = (int *)extra; |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8483 | 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] | 8484 | uint32_t handle; |
| 8485 | int ret; |
| 8486 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8487 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8488 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8489 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8490 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8491 | if (0 != ret) |
| 8492 | return ret; |
| 8493 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8494 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8495 | if (0 != ret) |
| 8496 | return ret; |
| 8497 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8498 | /* make sure the application is sufficiently priviledged */ |
| 8499 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 8500 | /* this ioctl wants to return status to user space it must be */ |
| 8501 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8502 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8503 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8504 | |
| 8505 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8506 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8507 | /* is no need to copy the params from user space */ |
| 8508 | |
| 8509 | /* validate the handle */ |
| 8510 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8511 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8512 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8513 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8514 | return 0; |
| 8515 | } |
| 8516 | |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8517 | *wmm_status = hdd_wmm_delts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8518 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8519 | return 0; |
| 8520 | } |
| 8521 | |
| 8522 | static int iw_del_tspec(struct net_device *dev, |
| 8523 | struct iw_request_info *info, |
| 8524 | union iwreq_data *wrqu, char *extra) |
| 8525 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8526 | int errno; |
| 8527 | struct osif_vdev_sync *vdev_sync; |
| 8528 | |
| 8529 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8530 | if (errno) |
| 8531 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8532 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8533 | errno = __iw_del_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8534 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8535 | osif_vdev_sync_op_stop(vdev_sync); |
| 8536 | |
| 8537 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8538 | } |
| 8539 | |
| 8540 | /** |
| 8541 | * iw_get_tspec - Get TSpec private ioctl handler |
| 8542 | * @dev: device upon which the ioctl was received |
| 8543 | * @info: ioctl request information |
| 8544 | * @wrqu: ioctl request data |
| 8545 | * @extra: ioctl extra data |
| 8546 | * |
| 8547 | * Return: 0 on success, non-zero on error |
| 8548 | */ |
| 8549 | static int __iw_get_tspec(struct net_device *dev, struct iw_request_info *info, |
| 8550 | union iwreq_data *wrqu, char *extra) |
| 8551 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8552 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8553 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8554 | int *params = (int *)extra; |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8555 | 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] | 8556 | uint32_t handle; |
| 8557 | int ret; |
| 8558 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8559 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8560 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8561 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8562 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8563 | if (0 != ret) |
| 8564 | return ret; |
| 8565 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8566 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8567 | if (0 != ret) |
| 8568 | return ret; |
| 8569 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8570 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 8571 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 8572 | /* is no need to copy the params from user space */ |
| 8573 | |
| 8574 | /* validate the handle */ |
| 8575 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 8576 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 8577 | /* that one is reserved */ |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8578 | *wmm_status = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8579 | return 0; |
| 8580 | } |
| 8581 | |
Jeff Johnson | b7c419b | 2019-03-09 17:15:47 -0800 | [diff] [blame] | 8582 | *wmm_status = hdd_wmm_checkts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8583 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8584 | return 0; |
| 8585 | } |
| 8586 | |
| 8587 | static int iw_get_tspec(struct net_device *dev, |
| 8588 | struct iw_request_info *info, |
| 8589 | union iwreq_data *wrqu, char *extra) |
| 8590 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8591 | int errno; |
| 8592 | struct osif_vdev_sync *vdev_sync; |
| 8593 | |
| 8594 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8595 | if (errno) |
| 8596 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8597 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8598 | errno = __iw_get_tspec(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8599 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8600 | osif_vdev_sync_op_stop(vdev_sync); |
| 8601 | |
| 8602 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8603 | } |
| 8604 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8605 | /** |
| 8606 | * iw_set_fties - Set FT IEs private ioctl handler |
| 8607 | * @dev: device upon which the ioctl was received |
| 8608 | * @info: ioctl request information |
| 8609 | * @wrqu: ioctl request data |
| 8610 | * @extra: ioctl extra data |
| 8611 | * |
| 8612 | * Each time the supplicant has the auth_request or reassoc request |
| 8613 | * IEs ready they are pushed to the driver. The driver will in turn |
| 8614 | * use it to send out the auth req and reassoc req for 11r FT Assoc. |
| 8615 | * |
| 8616 | * Return: 0 on success, non-zero on error |
| 8617 | */ |
| 8618 | static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info, |
| 8619 | union iwreq_data *wrqu, char *extra) |
| 8620 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8621 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 8622 | 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] | 8623 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8624 | int ret; |
| 8625 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8626 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8627 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8628 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8629 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8630 | if (0 != ret) |
| 8631 | return ret; |
| 8632 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8633 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8634 | if (0 != ret) |
| 8635 | return ret; |
| 8636 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8637 | if (!wrqu->data.length) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8638 | hdd_err("called with 0 length IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8639 | return -EINVAL; |
| 8640 | } |
| 8641 | if (wrqu->data.pointer == NULL) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8642 | hdd_err("called with NULL IE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8643 | return -EINVAL; |
| 8644 | } |
| 8645 | /* Added for debug on reception of Re-assoc Req. */ |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 8646 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8647 | hdd_debug("Called with Ie of length = %d when not associated", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8648 | wrqu->data.length); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8649 | hdd_debug("Should be Re-assoc Req IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8650 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8651 | hdd_debug("called with Ie of length = %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8652 | |
| 8653 | /* Pass the received FT IEs to SME */ |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8654 | sme_set_ft_ies(hdd_ctx->mac_handle, adapter->vdev_id, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8655 | extra, wrqu->data.length); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8656 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8657 | return 0; |
| 8658 | } |
| 8659 | |
| 8660 | static int iw_set_fties(struct net_device *dev, |
| 8661 | struct iw_request_info *info, |
| 8662 | union iwreq_data *wrqu, char *extra) |
| 8663 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8664 | int errno; |
| 8665 | struct osif_vdev_sync *vdev_sync; |
| 8666 | |
| 8667 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8668 | if (errno) |
| 8669 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8670 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8671 | errno = __iw_set_fties(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8672 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8673 | osif_vdev_sync_op_stop(vdev_sync); |
| 8674 | |
| 8675 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8676 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8677 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8678 | /** |
| 8679 | * iw_set_dynamic_mcbc_filter() - Set Dynamic MCBC Filter ioctl handler |
| 8680 | * @dev: device upon which the ioctl was received |
| 8681 | * @info: ioctl request information |
| 8682 | * @wrqu: ioctl request data |
| 8683 | * @extra: ioctl extra data |
| 8684 | * |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8685 | * This IOCTL is OBSOLETE as of Jan 30, 2017. We are leaving it here for the |
| 8686 | * time being to provide guidance in migrating to standard APIs. |
| 8687 | * |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8688 | * Return: 0 on success, non-zero on error |
| 8689 | */ |
| 8690 | static int iw_set_dynamic_mcbc_filter(struct net_device *dev, |
| 8691 | struct iw_request_info *info, |
| 8692 | union iwreq_data *wrqu, |
| 8693 | char *extra) |
| 8694 | { |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 8695 | hdd_err("\n" |
| 8696 | "setMCBCFilter is obsolete. Use the following instead:\n" |
| 8697 | "Configure multicast filtering via the ‘ip’ command.\n" |
| 8698 | "\tip maddr add 11:22:33:44:55:66 dev wlan0 # allow traffic to address\n" |
| 8699 | "\tip maddr del 11:22:33:44:55:66 dev wlan0 # undo allow\n" |
| 8700 | "Configure broadcast filtering via ini item, 'g_enable_non_arp_bc_hw_filter.'\n" |
| 8701 | "\tg_enable_non_arp_bc_hw_filter=1 # drop all non-ARP broadcast traffic\n" |
| 8702 | "\tg_enable_non_arp_bc_hw_filter=0 # allow all broadcast traffic"); |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 8703 | return -EINVAL; |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 8704 | } |
| 8705 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8706 | /** |
| 8707 | * iw_set_host_offload - Set host offload ioctl handler |
| 8708 | * @dev: device upon which the ioctl was received |
| 8709 | * @info: ioctl request information |
| 8710 | * @wrqu: ioctl request data |
| 8711 | * @extra: ioctl extra data |
| 8712 | * |
| 8713 | * Return: 0 on success, non-zero on error |
| 8714 | */ |
| 8715 | static int __iw_set_host_offload(struct net_device *dev, |
| 8716 | struct iw_request_info *info, |
| 8717 | union iwreq_data *wrqu, char *extra) |
| 8718 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8719 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8720 | struct host_offload_req *user_request = |
| 8721 | (struct host_offload_req *) extra; |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8722 | struct sir_host_offload_req offload_request; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8723 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8724 | int ret; |
| 8725 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8726 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8727 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8728 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8729 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8730 | if (0 != ret) |
| 8731 | return ret; |
| 8732 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8733 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8734 | if (0 != ret) |
| 8735 | return ret; |
| 8736 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8737 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8738 | hdd_err("dev is not in CONNECTED state, ignore!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8739 | return -EINVAL; |
| 8740 | } |
| 8741 | |
| 8742 | /* Debug display of request components. */ |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8743 | switch (user_request->offloadType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8744 | case WLAN_IPV4_ARP_REPLY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8745 | hdd_debug("Host offload request: ARP reply"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8746 | switch (user_request->enableOrDisable) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8747 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8748 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8749 | break; |
| 8750 | case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8751 | hdd_debug(" BC Filtering enable"); |
Jeff Johnson | 00052dd | 2018-04-29 19:19:06 -0700 | [diff] [blame] | 8752 | /* fallthrough */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8753 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8754 | hdd_debug(" ARP offload enable"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8755 | hdd_debug(" IP address: %pI4", |
| 8756 | user_request->params.hostIpv4Addr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8757 | } |
| 8758 | break; |
| 8759 | |
| 8760 | case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8761 | hdd_debug("Host offload request: neighbor discovery"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8762 | switch (user_request->enableOrDisable) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8763 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8764 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8765 | break; |
| 8766 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8767 | hdd_debug(" enable"); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8768 | hdd_debug(" IP address: %pI6c", |
| 8769 | user_request->params.hostIpv6Addr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8770 | } |
| 8771 | } |
| 8772 | |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8773 | qdf_mem_zero(&offload_request, sizeof(offload_request)); |
Jeff Johnson | 18a8ebd | 2019-03-09 17:38:30 -0800 | [diff] [blame] | 8774 | offload_request.offloadType = user_request->offloadType; |
| 8775 | offload_request.enableOrDisable = user_request->enableOrDisable; |
| 8776 | qdf_mem_copy(&offload_request.params, &user_request->params, |
| 8777 | sizeof(user_request->params)); |
| 8778 | qdf_mem_copy(&offload_request.bssid, &user_request->bssId.bytes, |
Hanumanth Reddy Pothula | 8fcade5 | 2017-12-01 13:49:40 +0530 | [diff] [blame] | 8779 | QDF_MAC_ADDR_SIZE); |
| 8780 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8781 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8782 | sme_set_host_offload(hdd_ctx->mac_handle, |
Jeff Johnson | fdc68da | 2019-03-09 17:27:13 -0800 | [diff] [blame] | 8783 | adapter->vdev_id, &offload_request)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8784 | hdd_err("Failure to execute host offload request"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8785 | return -EINVAL; |
| 8786 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8787 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8788 | return 0; |
| 8789 | } |
| 8790 | |
| 8791 | static int iw_set_host_offload(struct net_device *dev, |
| 8792 | struct iw_request_info *info, |
| 8793 | union iwreq_data *wrqu, char *extra) |
| 8794 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8795 | int errno; |
| 8796 | struct osif_vdev_sync *vdev_sync; |
| 8797 | |
| 8798 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8799 | if (errno) |
| 8800 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8801 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8802 | errno = __iw_set_host_offload(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8803 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8804 | osif_vdev_sync_op_stop(vdev_sync); |
| 8805 | |
| 8806 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8807 | } |
| 8808 | |
| 8809 | /** |
| 8810 | * iw_set_keepalive_params - Set keepalive params ioctl handler |
| 8811 | * @dev: device upon which the ioctl was received |
| 8812 | * @info: ioctl request information |
| 8813 | * @wrqu: ioctl request data |
| 8814 | * @extra: ioctl extra data |
| 8815 | * |
| 8816 | * Return: 0 on success, non-zero on error |
| 8817 | */ |
| 8818 | static int __iw_set_keepalive_params(struct net_device *dev, |
| 8819 | struct iw_request_info *info, |
| 8820 | union iwreq_data *wrqu, char *extra) |
| 8821 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8822 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 8823 | struct keep_alive_req *request = (struct keep_alive_req *)extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8824 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8825 | int ret; |
| 8826 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8827 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8828 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8829 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8830 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8831 | if (0 != ret) |
| 8832 | return ret; |
| 8833 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8834 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8835 | if (0 != ret) |
| 8836 | return ret; |
| 8837 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8838 | if (wrqu->data.length != sizeof(*request)) { |
| 8839 | hdd_err("Invalid length %d", wrqu->data.length); |
| 8840 | return -EINVAL; |
| 8841 | } |
| 8842 | |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8843 | if (request->timePeriod > cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8844 | hdd_err("Value of timePeriod %d exceed Max limit %d", |
| 8845 | request->timePeriod, |
Wu Gao | 9381621 | 2018-08-31 16:49:54 +0800 | [diff] [blame] | 8846 | cfg_max(CFG_INFRA_STA_KEEP_ALIVE_PERIOD)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8847 | return -EINVAL; |
| 8848 | } |
| 8849 | |
| 8850 | /* Debug display of request components. */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8851 | hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu", |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 8852 | request->timePeriod, sizeof(struct keep_alive_req)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8853 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8854 | switch (request->packetType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8855 | case WLAN_KEEP_ALIVE_NULL_PKT: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8856 | hdd_debug("Keep Alive Request: Tx NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8857 | break; |
| 8858 | |
| 8859 | case WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8860 | hdd_debug("Keep Alive Request: Tx UnSolicited ARP RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8861 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8862 | hdd_debug("Host IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8863 | request->hostIpv4Addr[0], request->hostIpv4Addr[1], |
| 8864 | request->hostIpv4Addr[2], request->hostIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8865 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8866 | hdd_debug("Dest IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8867 | request->destIpv4Addr[0], request->destIpv4Addr[1], |
| 8868 | request->destIpv4Addr[2], request->destIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8869 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8870 | hdd_debug("Dest MAC address: "MAC_ADDRESS_STR, |
Srinivas Girigowda | 9c330a9 | 2015-11-24 12:28:25 -0800 | [diff] [blame] | 8871 | MAC_ADDR_ARRAY(request->dest_macaddr.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8872 | break; |
| 8873 | } |
| 8874 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8875 | hdd_debug("Keep alive period %d", request->timePeriod); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8876 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8877 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8878 | sme_set_keep_alive(hdd_ctx->mac_handle, |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 8879 | adapter->vdev_id, request)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8880 | hdd_err("Failure to execute Keep Alive"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8881 | return -EINVAL; |
| 8882 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8883 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8884 | return 0; |
| 8885 | } |
| 8886 | |
| 8887 | static int iw_set_keepalive_params(struct net_device *dev, |
| 8888 | struct iw_request_info *info, |
| 8889 | union iwreq_data *wrqu, |
| 8890 | char *extra) |
| 8891 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8892 | int errno; |
| 8893 | struct osif_vdev_sync *vdev_sync; |
| 8894 | |
| 8895 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 8896 | if (errno) |
| 8897 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8898 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8899 | errno = __iw_set_keepalive_params(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8900 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 8901 | osif_vdev_sync_op_stop(vdev_sync); |
| 8902 | |
| 8903 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8904 | } |
| 8905 | |
| 8906 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 8907 | /** |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8908 | * validate_packet_filter_params_size() - Validate the size of the params rcvd |
| 8909 | * @priv_data: Pointer to the priv data from user space |
| 8910 | * @request: Pointer to the struct containing the copied data from user space |
| 8911 | * |
| 8912 | * Return: False on invalid length, true otherwise |
| 8913 | */ |
| 8914 | static bool validate_packet_filter_params_size(struct pkt_filter_cfg *request, |
| 8915 | uint16_t length) |
| 8916 | { |
| 8917 | int max_params_size, rcvd_params_size; |
| 8918 | |
| 8919 | max_params_size = HDD_MAX_CMP_PER_PACKET_FILTER * |
| 8920 | sizeof(struct pkt_filter_param_cfg); |
| 8921 | |
| 8922 | if (length < sizeof(struct pkt_filter_cfg) - max_params_size) { |
| 8923 | hdd_err("Less than minimum number of arguments needed"); |
| 8924 | return false; |
| 8925 | } |
| 8926 | |
| 8927 | rcvd_params_size = request->num_params * |
| 8928 | sizeof(struct pkt_filter_param_cfg); |
| 8929 | |
| 8930 | if (length != sizeof(struct pkt_filter_cfg) - |
| 8931 | max_params_size + rcvd_params_size) { |
| 8932 | hdd_err("Arguments do not match the number of params provided"); |
| 8933 | return false; |
| 8934 | } |
| 8935 | |
| 8936 | return true; |
| 8937 | } |
| 8938 | |
| 8939 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8940 | * __iw_set_packet_filter_params() - set packet filter parameters in target |
| 8941 | * @dev: Pointer to netdev |
| 8942 | * @info: Pointer to iw request info |
| 8943 | * @wrqu: Pointer to data |
| 8944 | * @extra: Pointer to extra data |
| 8945 | * |
| 8946 | * Return: 0 on success, non-zero on error |
| 8947 | */ |
| 8948 | static int __iw_set_packet_filter_params(struct net_device *dev, |
| 8949 | struct iw_request_info *info, |
| 8950 | union iwreq_data *wrqu, char *extra) |
| 8951 | { |
| 8952 | int ret; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8953 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8954 | struct iw_point priv_data; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8955 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8956 | struct pkt_filter_cfg *request = NULL; |
| 8957 | |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8958 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8959 | hdd_err("permission check failed"); |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8960 | return -EPERM; |
| 8961 | } |
| 8962 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8963 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8964 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8965 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8966 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8967 | if (0 != ret) |
| 8968 | return ret; |
| 8969 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8970 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8971 | if (0 != ret) |
| 8972 | return ret; |
| 8973 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8974 | if (hdd_priv_get_data(&priv_data, wrqu)) { |
| 8975 | hdd_err("failed to get priv data"); |
| 8976 | return -EINVAL; |
| 8977 | } |
| 8978 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8979 | if ((NULL == priv_data.pointer) || (0 == priv_data.length)) { |
Jeff Johnson | 36e74c4 | 2017-09-18 08:15:42 -0700 | [diff] [blame] | 8980 | hdd_err("invalid priv data %pK or invalid priv data length %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8981 | priv_data.pointer, priv_data.length); |
| 8982 | return -EINVAL; |
| 8983 | } |
| 8984 | |
Arun Khandavalli | 75d246b | 2017-08-07 19:46:06 +0530 | [diff] [blame] | 8985 | if (adapter->device_mode != QDF_STA_MODE) { |
| 8986 | hdd_err("Packet filter not supported for this mode :%d", |
| 8987 | adapter->device_mode); |
| 8988 | return -ENOTSUPP; |
| 8989 | } |
| 8990 | |
Mukul Sharma | be846bb | 2017-05-09 17:41:52 +0530 | [diff] [blame] | 8991 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
| 8992 | hdd_err("Packet filter not supported in disconnected state"); |
| 8993 | return -ENOTSUPP; |
| 8994 | } |
| 8995 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8996 | /* copy data using copy_from_user */ |
| 8997 | request = mem_alloc_copy_from_user_helper(priv_data.pointer, |
| 8998 | priv_data.length); |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8999 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9000 | if (NULL == request) { |
| 9001 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
| 9002 | return -ENOMEM; |
| 9003 | } |
| 9004 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 9005 | if (!validate_packet_filter_params_size(request, priv_data.length)) { |
| 9006 | hdd_err("Invalid priv data length %d", priv_data.length); |
| 9007 | qdf_mem_free(request); |
| 9008 | return -EINVAL; |
| 9009 | } |
| 9010 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 9011 | if (request->filter_action == HDD_RCV_FILTER_SET) |
| 9012 | hdd_ctx->user_configured_pkt_filter_rules |= |
| 9013 | 1 << request->filter_id; |
| 9014 | else if (request->filter_action == HDD_RCV_FILTER_CLEAR) |
| 9015 | hdd_ctx->user_configured_pkt_filter_rules &= |
| 9016 | ~(1 << request->filter_id); |
| 9017 | |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9018 | ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9019 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 9020 | qdf_mem_free(request); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 9021 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9022 | return ret; |
| 9023 | } |
| 9024 | |
| 9025 | /** |
| 9026 | * iw_set_packet_filter_params() - set packet filter parameters in target |
| 9027 | * @dev: Pointer to netdev |
| 9028 | * @info: Pointer to iw request info |
| 9029 | * @wrqu: Pointer to data |
| 9030 | * @extra: Pointer to extra data |
| 9031 | * |
| 9032 | * Return: 0 on success, non-zero on error |
| 9033 | */ |
| 9034 | static int iw_set_packet_filter_params(struct net_device *dev, |
| 9035 | struct iw_request_info *info, |
| 9036 | union iwreq_data *wrqu, char *extra) |
| 9037 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9038 | int errno; |
| 9039 | struct osif_vdev_sync *vdev_sync; |
| 9040 | |
| 9041 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9042 | if (errno) |
| 9043 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9044 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9045 | errno = __iw_set_packet_filter_params(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9046 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9047 | osif_vdev_sync_op_stop(vdev_sync); |
| 9048 | |
| 9049 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9050 | } |
| 9051 | #endif |
| 9052 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9053 | #ifdef QCA_SUPPORT_CP_STATS |
| 9054 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
| 9055 | { |
| 9056 | return wlan_hdd_get_station_stats(adapter); |
| 9057 | } |
| 9058 | #else /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9059 | struct hdd_statistics_priv { |
| 9060 | tCsrSummaryStatsInfo summary_stats; |
| 9061 | tCsrGlobalClassAStatsInfo class_a_stats; |
| 9062 | tCsrGlobalClassDStatsInfo class_d_stats; |
| 9063 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9064 | |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9065 | /** |
| 9066 | * hdd_statistics_cb() - "Get statistics" callback function |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9067 | * @stats: statistics payload |
| 9068 | * @context: opaque context originally passed to SME. HDD always passes |
| 9069 | * a cookie for the request context |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9070 | * |
| 9071 | * Return: None |
| 9072 | */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9073 | static void hdd_statistics_cb(void *stats, void *context) |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9074 | { |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9075 | struct osif_request *request; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9076 | struct hdd_statistics_priv *priv; |
| 9077 | tCsrSummaryStatsInfo *summary_stats; |
| 9078 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 9079 | tCsrGlobalClassDStatsInfo *class_d_stats; |
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 | request = osif_request_get(context); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9082 | if (!request) { |
| 9083 | hdd_err("Obsolete request"); |
| 9084 | return; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9085 | } |
| 9086 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9087 | priv = osif_request_priv(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9088 | |
| 9089 | summary_stats = (tCsrSummaryStatsInfo *)stats; |
| 9090 | priv->summary_stats = *summary_stats; |
| 9091 | |
| 9092 | class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); |
| 9093 | priv->class_a_stats = *class_a_stats; |
| 9094 | |
| 9095 | class_d_stats = (tCsrGlobalClassDStatsInfo *)(class_a_stats + 1); |
| 9096 | priv->class_d_stats = *class_d_stats; |
| 9097 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9098 | osif_request_complete(request); |
| 9099 | osif_request_put(request); |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 9100 | } |
| 9101 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9102 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9103 | { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9104 | int ret = 0; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9105 | void *cookie; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9106 | QDF_STATUS status; |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9107 | struct osif_request *request; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9108 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9109 | struct hdd_statistics_priv *priv; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9110 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9111 | static const struct osif_request_params params = { |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9112 | .priv_size = sizeof(*priv), |
| 9113 | .timeout_ms = WLAN_WAIT_TIME_STATS, |
| 9114 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9115 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9116 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9117 | request = osif_request_alloc(¶ms); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9118 | if (!request) { |
| 9119 | hdd_warn("request allocation failed"); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9120 | return -EINVAL; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9121 | } |
| 9122 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9123 | cookie = osif_request_cookie(request); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 9124 | status = sme_get_statistics(hdd_ctx->mac_handle, eCSR_HDD, |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9125 | SME_SUMMARY_STATS | |
| 9126 | SME_GLOBAL_CLASSA_STATS | |
| 9127 | SME_GLOBAL_CLASSD_STATS, |
| 9128 | hdd_statistics_cb, |
Jeff Johnson | 0a082d9 | 2019-03-04 12:25:49 -0800 | [diff] [blame] | 9129 | sta_ctx->conn_info.sta_id[0], |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9130 | cookie, adapter->vdev_id); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9131 | |
| 9132 | if (QDF_STATUS_SUCCESS != status) { |
| 9133 | hdd_warn("Unable to retrieve SME statistics"); |
| 9134 | goto put_request; |
| 9135 | } |
| 9136 | |
| 9137 | /* request was sent -- wait for the response */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9138 | ret = osif_request_wait_for_response(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9139 | if (ret) { |
| 9140 | hdd_err("Failed to wait for statistics, errno %d", ret); |
| 9141 | goto put_request; |
| 9142 | } |
| 9143 | |
| 9144 | /* update the adapter cache with the fresh results */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9145 | priv = osif_request_priv(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9146 | adapter->hdd_stats.summary_stat = priv->summary_stats; |
| 9147 | adapter->hdd_stats.class_a_stat = priv->class_a_stats; |
| 9148 | adapter->hdd_stats.class_d_stat = priv->class_d_stats; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9149 | |
| 9150 | put_request: |
| 9151 | /* |
| 9152 | * either we never sent a request, we sent a request and |
| 9153 | * received a response or we sent a request and timed out. |
| 9154 | * regardless we are done with the request. |
| 9155 | */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 9156 | osif_request_put(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9157 | return ret; |
| 9158 | } |
| 9159 | #endif /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9160 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9161 | static int __iw_get_statistics(struct net_device *dev, |
| 9162 | struct iw_request_info *info, |
| 9163 | union iwreq_data *wrqu, char *extra) |
| 9164 | { |
| 9165 | int ret; |
| 9166 | char *p; |
| 9167 | int tlen; |
| 9168 | struct hdd_station_ctx *sta_ctx; |
| 9169 | tCsrSummaryStatsInfo *summary_stats; |
| 9170 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 9171 | tCsrGlobalClassDStatsInfo *class_d_stats; |
| 9172 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 9173 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9174 | |
| 9175 | hdd_enter_dev(dev); |
| 9176 | |
| 9177 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9178 | if (0 != ret) |
| 9179 | return ret; |
| 9180 | |
| 9181 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9182 | if (0 != ret) |
| 9183 | return ret; |
| 9184 | |
| 9185 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | e795151 | 2019-02-27 10:02:51 -0800 | [diff] [blame] | 9186 | if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 9187 | wrqu->data.length = 0; |
| 9188 | return 0; |
| 9189 | } |
| 9190 | |
| 9191 | hdd_get_wlan_stats(adapter); |
| 9192 | |
| 9193 | summary_stats = &(adapter->hdd_stats.summary_stat); |
| 9194 | class_a_stats = &(adapter->hdd_stats.class_a_stat); |
| 9195 | class_d_stats = &(adapter->hdd_stats.class_d_stat); |
| 9196 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 9197 | p = extra; |
| 9198 | tlen = 0; |
| 9199 | |
| 9200 | FILL_TLV(p, WLAN_STATS_RETRY_CNT, |
| 9201 | sizeof(summary_stats->retry_cnt), |
| 9202 | &(summary_stats->retry_cnt[0]), tlen); |
| 9203 | |
| 9204 | FILL_TLV(p, WLAN_STATS_MUL_RETRY_CNT, |
| 9205 | sizeof(summary_stats->multiple_retry_cnt), |
| 9206 | &(summary_stats->multiple_retry_cnt[0]), tlen); |
| 9207 | |
| 9208 | FILL_TLV(p, WLAN_STATS_TX_FRM_CNT, |
| 9209 | sizeof(summary_stats->tx_frm_cnt), |
| 9210 | &(summary_stats->tx_frm_cnt[0]), tlen); |
| 9211 | |
| 9212 | FILL_TLV(p, WLAN_STATS_RX_FRM_CNT, |
| 9213 | sizeof(summary_stats->rx_frm_cnt), |
| 9214 | &(summary_stats->rx_frm_cnt), tlen); |
| 9215 | |
| 9216 | FILL_TLV(p, WLAN_STATS_FRM_DUP_CNT, |
| 9217 | sizeof(summary_stats->frm_dup_cnt), |
| 9218 | &(summary_stats->frm_dup_cnt), tlen); |
| 9219 | |
| 9220 | FILL_TLV(p, WLAN_STATS_FAIL_CNT, |
| 9221 | sizeof(summary_stats->fail_cnt), |
| 9222 | &(summary_stats->fail_cnt[0]), tlen); |
| 9223 | |
| 9224 | FILL_TLV(p, WLAN_STATS_RTS_FAIL_CNT, |
| 9225 | sizeof(summary_stats->rts_fail_cnt), |
| 9226 | &(summary_stats->rts_fail_cnt), tlen); |
| 9227 | |
| 9228 | FILL_TLV(p, WLAN_STATS_ACK_FAIL_CNT, |
| 9229 | sizeof(summary_stats->ack_fail_cnt), |
| 9230 | &(summary_stats->ack_fail_cnt), tlen); |
| 9231 | |
| 9232 | FILL_TLV(p, WLAN_STATS_RTS_SUC_CNT, |
| 9233 | sizeof(summary_stats->rts_succ_cnt), |
| 9234 | &(summary_stats->rts_succ_cnt), tlen); |
| 9235 | |
| 9236 | FILL_TLV(p, WLAN_STATS_RX_DISCARD_CNT, |
| 9237 | sizeof(summary_stats->rx_discard_cnt), |
| 9238 | &(summary_stats->rx_discard_cnt), tlen); |
| 9239 | |
| 9240 | FILL_TLV(p, WLAN_STATS_RX_ERROR_CNT, |
| 9241 | sizeof(summary_stats->rx_error_cnt), |
| 9242 | &(summary_stats->rx_error_cnt), tlen); |
| 9243 | |
| 9244 | FILL_TLV(p, WLAN_STATS_TX_BYTE_CNT, |
| 9245 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 9246 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 9247 | |
| 9248 | FILL_TLV(p, WLAN_STATS_RX_BYTE_CNT, |
| 9249 | sizeof(class_d_stats->rx_byte_cnt), |
| 9250 | &(class_d_stats->rx_byte_cnt), tlen); |
| 9251 | |
| 9252 | FILL_TLV(p, WLAN_STATS_RX_RATE, |
| 9253 | sizeof(class_d_stats->rx_rate), |
| 9254 | &(class_d_stats->rx_rate), tlen); |
| 9255 | |
| 9256 | /* Transmit rate, in units of 500 kbit/sec */ |
| 9257 | FILL_TLV(p, WLAN_STATS_TX_RATE, |
| 9258 | sizeof(class_a_stats->tx_rate), |
| 9259 | &(class_a_stats->tx_rate), tlen); |
| 9260 | |
| 9261 | FILL_TLV(p, WLAN_STATS_RX_UC_BYTE_CNT, |
| 9262 | sizeof(class_d_stats->rx_uc_byte_cnt[0]), |
| 9263 | &(class_d_stats->rx_uc_byte_cnt[0]), tlen); |
| 9264 | FILL_TLV(p, WLAN_STATS_RX_MC_BYTE_CNT, |
| 9265 | sizeof(class_d_stats->rx_mc_byte_cnt), |
| 9266 | &(class_d_stats->rx_mc_byte_cnt), tlen); |
| 9267 | FILL_TLV(p, WLAN_STATS_RX_BC_BYTE_CNT, |
| 9268 | sizeof(class_d_stats->rx_bc_byte_cnt), |
| 9269 | &(class_d_stats->rx_bc_byte_cnt), tlen); |
| 9270 | FILL_TLV(p, WLAN_STATS_TX_UC_BYTE_CNT, |
| 9271 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 9272 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 9273 | FILL_TLV(p, WLAN_STATS_TX_MC_BYTE_CNT, |
| 9274 | sizeof(class_d_stats->tx_mc_byte_cnt), |
| 9275 | &(class_d_stats->tx_mc_byte_cnt), tlen); |
| 9276 | FILL_TLV(p, WLAN_STATS_TX_BC_BYTE_CNT, |
| 9277 | sizeof(class_d_stats->tx_bc_byte_cnt), |
| 9278 | &(class_d_stats->tx_bc_byte_cnt), tlen); |
| 9279 | |
| 9280 | wrqu->data.length = tlen; |
| 9281 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 9282 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9283 | |
| 9284 | return 0; |
| 9285 | } |
| 9286 | |
| 9287 | static int iw_get_statistics(struct net_device *dev, |
| 9288 | struct iw_request_info *info, |
| 9289 | union iwreq_data *wrqu, char *extra) |
| 9290 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9291 | int errno; |
| 9292 | struct osif_vdev_sync *vdev_sync; |
| 9293 | |
| 9294 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9295 | if (errno) |
| 9296 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9297 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9298 | errno = __iw_get_statistics(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9299 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9300 | osif_vdev_sync_op_stop(vdev_sync); |
| 9301 | |
| 9302 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9303 | } |
| 9304 | |
| 9305 | #ifdef FEATURE_WLAN_SCAN_PNO |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9306 | /*Max Len for PNO notification*/ |
| 9307 | #define MAX_PNO_NOTIFY_LEN 100 |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9308 | static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev, |
| 9309 | struct scan_event *event, void *args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9310 | { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9311 | struct vdev_osif_priv *osif_priv; |
| 9312 | struct wireless_dev *wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9313 | union iwreq_data wrqu; |
| 9314 | char buf[MAX_PNO_NOTIFY_LEN + 1]; |
| 9315 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9316 | wlan_vdev_obj_lock(vdev); |
| 9317 | osif_priv = wlan_vdev_get_ospriv(vdev); |
| 9318 | wlan_vdev_obj_unlock(vdev); |
| 9319 | if (!osif_priv) { |
| 9320 | hdd_err("osif_priv is null"); |
| 9321 | return; |
| 9322 | } |
| 9323 | |
| 9324 | wdev = osif_priv->wdev; |
| 9325 | if (!wdev) { |
| 9326 | hdd_err("wdev is null"); |
| 9327 | return; |
| 9328 | } |
| 9329 | |
| 9330 | hdd_debug("A preferred network was found"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9331 | |
| 9332 | /* create the event */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9333 | qdf_mem_zero(&wrqu, sizeof(wrqu)); |
| 9334 | qdf_mem_zero(buf, sizeof(buf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9335 | |
| 9336 | snprintf(buf, MAX_PNO_NOTIFY_LEN, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9337 | "QCOM: Found preferred network:"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9338 | |
| 9339 | wrqu.data.pointer = buf; |
| 9340 | wrqu.data.length = strlen(buf); |
| 9341 | |
| 9342 | /* send the event */ |
| 9343 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9344 | wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9345 | } |
| 9346 | |
| 9347 | /** |
| 9348 | * __iw_set_pno() - Preferred Network Offload ioctl handler |
| 9349 | * @dev: device upon which the ioctl was received |
| 9350 | * @info: ioctl request information |
| 9351 | * @wrqu: ioctl request data |
| 9352 | * @extra: ioctl extra data |
| 9353 | * |
| 9354 | * This function parses a Preferred Network Offload command |
| 9355 | * Input is string based and expected to be of the form: |
| 9356 | * |
| 9357 | * <enable(1) | disable(0)> |
| 9358 | * when enabling: |
| 9359 | * <number of networks> |
| 9360 | * for each network: |
| 9361 | * <ssid_len> <ssid> <authentication> <encryption> |
| 9362 | * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9363 | * <scan_time (seconds)> |
| 9364 | * <scan_repeat_count (0 means indefinite)> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9365 | * <suspend mode> |
| 9366 | * |
| 9367 | * e.g: |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9368 | * 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] | 9369 | * |
| 9370 | * this translates into: |
| 9371 | * ----------------------------- |
| 9372 | * enable PNO |
| 9373 | * 2 networks |
| 9374 | * Network 1: |
| 9375 | * test - with authentication type 0 and encryption type 0, |
| 9376 | * search on 3 channels: 1 6 and 11, |
| 9377 | * SSID bcast type is unknown (directed probe will be sent if |
| 9378 | * AP not found) and must meet -40dBm RSSI |
| 9379 | * Network 2: |
| 9380 | * test2 - with authentication type 4 and encryption type 4, |
| 9381 | * search on 6 channels 1, 2, 3, 4, 5 and 6 |
| 9382 | * bcast type is non-bcast (directed probe will be sent) |
| 9383 | * and must not meet any RSSI threshold |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9384 | * scan every 5 seconds 2 times |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9385 | * enable on suspend |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9386 | */ |
| 9387 | static int __iw_set_pno(struct net_device *dev, |
| 9388 | struct iw_request_info *info, |
| 9389 | union iwreq_data *wrqu, char *extra) |
| 9390 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9391 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9392 | struct hdd_context *hdd_ctx; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9393 | uint8_t value; |
| 9394 | struct wlan_objmgr_vdev *vdev; |
| 9395 | struct wlan_objmgr_psoc *psoc; |
| 9396 | int ret = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9397 | int offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9398 | char *ptr, *data; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9399 | uint8_t i, j, params; |
| 9400 | QDF_STATUS status; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9401 | size_t len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9402 | |
| 9403 | /* request is a large struct, so we make it static to avoid |
| 9404 | * stack overflow. This API is only invoked via ioctl, so it |
| 9405 | * is serialized by the kernel rtnl_lock and hence does not |
| 9406 | * need to be reentrant |
| 9407 | */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9408 | static struct pno_scan_req_params req; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9409 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9410 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9411 | |
| 9412 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9413 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9414 | if (ret) |
| 9415 | return ret; |
| 9416 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9417 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9418 | if (0 != ret) |
| 9419 | return ret; |
| 9420 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9421 | vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->pdev, |
| 9422 | dev->dev_addr, |
| 9423 | WLAN_LEGACY_MAC_ID); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9424 | if (!vdev) { |
| 9425 | hdd_err("vdev object is NULL"); |
| 9426 | return -EIO; |
| 9427 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9428 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9429 | /* making sure argument string ends with '\0' */ |
| 9430 | len = (wrqu->data.length + 1); |
| 9431 | data = qdf_mem_malloc(len); |
| 9432 | if (!data) { |
| 9433 | hdd_err("fail to allocate memory %zu", len); |
| 9434 | return -EINVAL; |
| 9435 | } |
| 9436 | qdf_mem_copy(data, extra, (len-1)); |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9437 | ptr = data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9438 | |
Hanumanth Reddy Pothula | 3048c93 | 2018-05-15 12:43:39 +0530 | [diff] [blame] | 9439 | hdd_debug("PNO data len %d data %s", wrqu->data.length, data); |
| 9440 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9441 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9442 | hdd_err("PNO enable input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9443 | ret = -EINVAL; |
| 9444 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9445 | } |
| 9446 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9447 | if (!value) { |
| 9448 | status = ucfg_scan_pno_stop(vdev); |
| 9449 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9450 | hdd_err("Failed to disabled PNO"); |
| 9451 | ret = -EINVAL; |
| 9452 | } else { |
| 9453 | hdd_debug("PNO scan disabled"); |
| 9454 | } |
| 9455 | goto exit; |
| 9456 | } |
| 9457 | |
| 9458 | if (ucfg_scan_get_pno_in_progress(vdev)) { |
| 9459 | hdd_debug("pno is already in progress"); |
| 9460 | ret = -EBUSY; |
| 9461 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9462 | } |
| 9463 | |
| 9464 | ptr += offset; |
| 9465 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9466 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9467 | hdd_err("PNO count input not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9468 | ret = -EINVAL; |
| 9469 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9470 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9471 | req.networks_cnt = value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9472 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9473 | hdd_debug("PNO enable networks count %d offset %d", |
| 9474 | req.networks_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9475 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9476 | if ((0 == req.networks_cnt) || |
| 9477 | (req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9478 | hdd_err("Network count %d invalid", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9479 | req.networks_cnt); |
| 9480 | ret = -EINVAL; |
| 9481 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9482 | } |
| 9483 | |
| 9484 | ptr += offset; |
| 9485 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9486 | for (i = 0; i < req.networks_cnt; i++) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9487 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9488 | req.networks_list[i].ssid.length = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9489 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9490 | params = sscanf(ptr, " %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9491 | &(req.networks_list[i].ssid.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9492 | &offset); |
| 9493 | |
| 9494 | if (1 != params) { |
| 9495 | hdd_err("PNO ssid length input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9496 | ret = -EINVAL; |
| 9497 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9498 | } |
| 9499 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9500 | if ((0 == req.networks_list[i].ssid.length) || |
| 9501 | (req.networks_list[i].ssid.length > 32)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9502 | hdd_err("SSID Len %d is not correct for network %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9503 | req.networks_list[i].ssid.length, i); |
| 9504 | ret = -EINVAL; |
| 9505 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9506 | } |
| 9507 | |
| 9508 | /* Advance to SSID */ |
| 9509 | ptr += offset; |
| 9510 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9511 | memcpy(req.networks_list[i].ssid.ssid, ptr, |
| 9512 | req.networks_list[i].ssid.length); |
| 9513 | ptr += req.networks_list[i].ssid.length; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9514 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9515 | params = sscanf(ptr, " %u %u %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9516 | &(req.networks_list[i].authentication), |
| 9517 | &(req.networks_list[i].encryption), |
| 9518 | &(req.networks_list[i].channel_cnt), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9519 | &offset); |
| 9520 | |
| 9521 | if (3 != params) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9522 | hdd_err("Incorrect cmd %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9523 | ret = -EINVAL; |
| 9524 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9525 | } |
| 9526 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9527 | 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] | 9528 | req.networks_list[i].ssid.length, |
| 9529 | req.networks_list[i].ssid.length, |
| 9530 | req.networks_list[i].ssid.ssid, |
| 9531 | req.networks_list[i].authentication, |
| 9532 | req.networks_list[i].encryption, |
| 9533 | req.networks_list[i].channel_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9534 | |
| 9535 | /* Advance to channel list */ |
| 9536 | ptr += offset; |
| 9537 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9538 | if (SCAN_PNO_MAX_NETW_CHANNELS_EX < |
| 9539 | req.networks_list[i].channel_cnt) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9540 | hdd_err("Incorrect number of channels"); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9541 | ret = -EINVAL; |
| 9542 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9543 | } |
| 9544 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9545 | if (0 != req.networks_list[i].channel_cnt) { |
| 9546 | for (j = 0; j < req.networks_list[i].channel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9547 | j++) { |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9548 | if (1 != sscanf(ptr, " %hhu %n", &value, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9549 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9550 | hdd_err("PNO network channel is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9551 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9552 | ret = -EINVAL; |
| 9553 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9554 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9555 | if (!IS_CHANNEL_VALID(value)) { |
| 9556 | hdd_err("invalid channel: %hhu", value); |
| 9557 | ret = -EINVAL; |
| 9558 | goto exit; |
| 9559 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9560 | req.networks_list[i].channels[j] = |
| 9561 | cds_chan_to_freq(value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9562 | /* Advance to next channel number */ |
| 9563 | ptr += offset; |
| 9564 | } |
| 9565 | } |
| 9566 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9567 | if (1 != sscanf(ptr, " %u %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9568 | &(req.networks_list[i].bc_new_type), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9569 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9570 | hdd_err("PNO broadcast network type is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9571 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9572 | ret = -EINVAL; |
| 9573 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9574 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9575 | if (req.networks_list[i].bc_new_type > 2) { |
| 9576 | hdd_err("invalid bcast nw type: %u", |
| 9577 | req.networks_list[i].bc_new_type); |
| 9578 | ret = -EINVAL; |
| 9579 | goto exit; |
| 9580 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9581 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9582 | hdd_debug("PNO bcastNetwType %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9583 | req.networks_list[i].bc_new_type, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9584 | |
| 9585 | /* Advance to rssi Threshold */ |
| 9586 | ptr += offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9587 | if (1 != sscanf(ptr, " %d %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9588 | &(req.networks_list[i].rssi_thresh), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9589 | &offset)) { |
| 9590 | hdd_err("PNO rssi threshold input is not valid %s", |
| 9591 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9592 | ret = -EINVAL; |
| 9593 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9594 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9595 | hdd_debug("PNO rssi %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9596 | req.networks_list[i].rssi_thresh, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9597 | /* Advance to next network */ |
| 9598 | ptr += offset; |
| 9599 | } /* For ucNetworkCount */ |
| 9600 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9601 | req.fast_scan_period = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9602 | if (sscanf(ptr, " %u %n", &(req.fast_scan_period), &offset) > 0) { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9603 | req.fast_scan_period *= MSEC_PER_SEC; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9604 | ptr += offset; |
| 9605 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9606 | if (req.fast_scan_period == 0) { |
| 9607 | hdd_err("invalid fast scan period %u", |
| 9608 | req.fast_scan_period); |
| 9609 | ret = -EINVAL; |
| 9610 | goto exit; |
| 9611 | } |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9612 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9613 | req.fast_scan_max_cycles = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9614 | if (sscanf(ptr, " %hhu %n", &value, |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9615 | &offset) > 0) |
| 9616 | ptr += offset; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9617 | req.fast_scan_max_cycles = value; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 9618 | |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 9619 | wlan_pdev_obj_lock(hdd_ctx->pdev); |
| 9620 | psoc = wlan_pdev_get_psoc(hdd_ctx->pdev); |
| 9621 | wlan_pdev_obj_unlock(hdd_ctx->pdev); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9622 | ucfg_scan_register_pno_cb(psoc, |
| 9623 | found_pref_network_cb, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9624 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9625 | ucfg_scan_get_pno_def_params(vdev, &req); |
| 9626 | status = ucfg_scan_pno_start(vdev, &req); |
| 9627 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9628 | hdd_err("Failed to enable PNO"); |
| 9629 | ret = -EINVAL; |
| 9630 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9631 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9632 | exit: |
| 9633 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9634 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 9635 | qdf_mem_free(data); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 9636 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9637 | } |
| 9638 | |
| 9639 | static int iw_set_pno(struct net_device *dev, |
| 9640 | struct iw_request_info *info, |
| 9641 | union iwreq_data *wrqu, char *extra) |
| 9642 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9643 | int errno; |
| 9644 | struct osif_vdev_sync *vdev_sync; |
| 9645 | |
| 9646 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9647 | if (errno) |
| 9648 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9649 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9650 | errno = __iw_set_pno(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9651 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9652 | osif_vdev_sync_op_stop(vdev_sync); |
| 9653 | |
| 9654 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9655 | } |
| 9656 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 9657 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9658 | static int __iw_set_band_config(struct net_device *dev, |
| 9659 | struct iw_request_info *info, |
| 9660 | union iwreq_data *wrqu, char *extra) |
| 9661 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 9662 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 9663 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9664 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9665 | int *value = (int *)extra; |
| 9666 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9667 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9668 | |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9669 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9670 | hdd_err("permission check failed"); |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 9671 | return -EPERM; |
| 9672 | } |
| 9673 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9674 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 9675 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9676 | if (0 != ret) |
| 9677 | return ret; |
| 9678 | |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 9679 | return hdd_reg_set_band(dev, value[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9680 | } |
| 9681 | |
| 9682 | static int iw_set_band_config(struct net_device *dev, |
| 9683 | struct iw_request_info *info, |
| 9684 | union iwreq_data *wrqu, char *extra) |
| 9685 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9686 | int errno; |
| 9687 | struct osif_vdev_sync *vdev_sync; |
| 9688 | |
| 9689 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9690 | if (errno) |
| 9691 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9692 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9693 | errno = __iw_set_band_config(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9694 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9695 | osif_vdev_sync_op_stop(vdev_sync); |
| 9696 | |
| 9697 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9698 | } |
| 9699 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9700 | static int printk_adapter(void *priv, const char *fmt, ...) |
| 9701 | { |
| 9702 | int ret; |
| 9703 | va_list args; |
| 9704 | |
| 9705 | va_start(args, fmt); |
| 9706 | ret = vprintk(fmt, args); |
| 9707 | ret += printk("\n"); |
| 9708 | va_end(args); |
| 9709 | |
| 9710 | return ret; |
| 9711 | } |
| 9712 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9713 | static void hdd_ioctl_log_buffer(int log_id, uint32_t count) |
| 9714 | { |
| 9715 | qdf_abstract_print *print = &printk_adapter; |
| 9716 | |
| 9717 | switch (log_id) { |
| 9718 | case HTC_CREDIT_HISTORY_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9719 | cds_print_htc_credit_history(count, print, NULL); |
| 9720 | break; |
| 9721 | case COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9722 | wma_print_wmi_cmd_log(count, print, NULL); |
| 9723 | break; |
| 9724 | case COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9725 | wma_print_wmi_cmd_tx_cmp_log(count, print, NULL); |
| 9726 | break; |
| 9727 | case MGMT_COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9728 | wma_print_wmi_mgmt_cmd_log(count, print, NULL); |
| 9729 | break; |
| 9730 | case MGMT_COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9731 | wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL); |
| 9732 | break; |
| 9733 | case EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9734 | wma_print_wmi_event_log(count, print, NULL); |
| 9735 | break; |
| 9736 | case RX_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9737 | wma_print_wmi_rx_event_log(count, print, NULL); |
| 9738 | break; |
| 9739 | case MGMT_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9740 | wma_print_wmi_mgmt_event_log(count, print, NULL); |
| 9741 | break; |
| 9742 | default: |
| 9743 | print(NULL, "Invalid Log Id %d", log_id); |
| 9744 | break; |
| 9745 | } |
| 9746 | } |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9747 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9748 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
| 9749 | int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2) |
| 9750 | { |
| 9751 | struct hdd_context *hdd_ctx; |
| 9752 | int ret; |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9753 | bool crash_inject; |
| 9754 | QDF_STATUS status; |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9755 | |
| 9756 | hdd_debug("WE_SET_FW_CRASH_INJECT: %d %d", |
| 9757 | v1, v2); |
| 9758 | pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n", |
| 9759 | v1, v2); |
| 9760 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9761 | |
Vignesh Viswanathan | a1f3a1a | 2018-10-04 13:10:46 +0530 | [diff] [blame] | 9762 | status = ucfg_mlme_get_crash_inject(hdd_ctx->psoc, &crash_inject); |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9763 | if (QDF_IS_STATUS_ERROR(status)) { |
| 9764 | hdd_err("Failed to get crash inject ini config"); |
| 9765 | return 0; |
| 9766 | } |
| 9767 | |
| 9768 | if (!crash_inject) { |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9769 | hdd_err("Crash Inject ini disabled, Ignore Crash Inject"); |
| 9770 | return 0; |
| 9771 | } |
Vignesh Viswanathan | a851d75 | 2018-10-03 19:44:38 +0530 | [diff] [blame] | 9772 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9773 | if (v1 == 3) { |
| 9774 | cds_trigger_recovery(QDF_REASON_UNSPECIFIED); |
| 9775 | return 0; |
| 9776 | } |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9777 | ret = wma_cli_set2_command(adapter->vdev_id, |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9778 | GEN_PARAM_CRASH_INJECT, |
| 9779 | v1, v2, GEN_CMD); |
| 9780 | return ret; |
| 9781 | } |
| 9782 | #endif |
| 9783 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9784 | #ifdef CONFIG_DP_TRACE |
| 9785 | void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) |
| 9786 | { |
| 9787 | hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d", |
| 9788 | cmd_type, count); |
| 9789 | if (cmd_type == DUMP_DP_TRACE) |
| 9790 | qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID); |
| 9791 | else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE) |
| 9792 | qdf_dp_trace_enable_live_mode(); |
| 9793 | else if (cmd_type == CLEAR_DP_TRACE_BUFFER) |
| 9794 | qdf_dp_trace_clear_buffer(); |
| 9795 | else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE) |
| 9796 | qdf_dp_trace_disable_live_mode(); |
| 9797 | } |
| 9798 | #endif |
| 9799 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9800 | static int __iw_set_two_ints_getnone(struct net_device *dev, |
| 9801 | struct iw_request_info *info, |
| 9802 | union iwreq_data *wrqu, char *extra) |
| 9803 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9804 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9805 | int *value = (int *)extra; |
| 9806 | int sub_cmd = value[0]; |
| 9807 | int ret; |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9808 | uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9809 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9810 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9811 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 9812 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 9813 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9814 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 9815 | if (0 != ret) |
| 9816 | return ret; |
| 9817 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 9818 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 9819 | if (0 != ret) |
| 9820 | return ret; |
| 9821 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9822 | switch (sub_cmd) { |
| 9823 | case WE_SET_SMPS_PARAM: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 9824 | 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] | 9825 | ret = wma_cli_set_command(adapter->vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9826 | WMI_STA_SMPS_PARAM_CMDID, |
| 9827 | value[1] << WMA_SMPS_PARAM_VALUE_S |
| 9828 | | value[2], |
| 9829 | VDEV_CMD); |
| 9830 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9831 | case WE_SET_FW_CRASH_INJECT: |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 9832 | ret = hdd_crash_inject(adapter, value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9833 | break; |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9834 | case WE_ENABLE_FW_PROFILE: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9835 | hdd_err("WE_ENABLE_FW_PROFILE: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9836 | value[1], value[2]); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9837 | ret = wma_cli_set2_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9838 | WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, |
| 9839 | value[1], value[2], DBG_CMD); |
| 9840 | break; |
| 9841 | case WE_SET_FW_PROFILE_HIST_INTVL: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9842 | hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9843 | value[1], value[2]); |
Jeff Johnson | c5b56bb | 2019-02-04 14:08:48 -0800 | [diff] [blame] | 9844 | ret = wma_cli_set2_command(adapter->vdev_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9845 | WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, |
| 9846 | value[1], value[2], DBG_CMD); |
| 9847 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9848 | case WE_SET_DUAL_MAC_FW_MODE_CONFIG: |
| 9849 | hdd_debug("Ioctl to set dual fw mode config"); |
Krunal Soni | df29bc4 | 2018-11-15 13:26:29 -0800 | [diff] [blame] | 9850 | status = |
| 9851 | ucfg_policy_mgr_get_dual_mac_feature(hdd_ctx->psoc, |
| 9852 | &dual_mac_feature); |
| 9853 | if (status != QDF_STATUS_SUCCESS) |
| 9854 | hdd_err("can't get dual mac feature val, use def"); |
| 9855 | if (dual_mac_feature == DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9856 | hdd_err("Dual mac feature is disabled from INI"); |
| 9857 | return -EPERM; |
| 9858 | } |
| 9859 | hdd_debug("%d %d", value[1], value[2]); |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 9860 | policy_mgr_set_dual_mac_fw_mode_config(hdd_ctx->psoc, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 9861 | value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9862 | break; |
| 9863 | case WE_DUMP_DP_TRACE_LEVEL: |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9864 | hdd_set_dump_dp_trace(value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9865 | break; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9866 | case WE_SET_MON_MODE_CHAN: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 9867 | ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 9868 | break; |
Rajeev Kumar | 15b40a2 | 2018-04-12 11:45:24 -0700 | [diff] [blame] | 9869 | case WE_SET_WLAN_SUSPEND: |
Dustin Brown | 5409643 | 2017-02-23 13:00:44 -0800 | [diff] [blame] | 9870 | ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, |
| 9871 | value[1], value[2]); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9872 | break; |
| 9873 | case WE_SET_WLAN_RESUME: |
Dustin Brown | bc81a47 | 2016-10-26 16:56:59 -0700 | [diff] [blame] | 9874 | ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 9875 | break; |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 9876 | case WE_LOG_BUFFER: { |
| 9877 | int log_id = value[1]; |
| 9878 | uint32_t count = value[2] < 0 ? 0 : value[2]; |
| 9879 | |
| 9880 | hdd_ioctl_log_buffer(log_id, count); |
| 9881 | |
| 9882 | break; |
| 9883 | } |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 9884 | case WE_SET_BA_AGEING_TIMEOUT: |
| 9885 | { |
| 9886 | void *soc = cds_get_context(QDF_MODULE_ID_SOC); |
| 9887 | |
| 9888 | if (!soc) { |
| 9889 | hdd_err("Invalid handles"); |
| 9890 | break; |
| 9891 | } |
| 9892 | cdp_set_ba_timeout(soc, value[1], value[2]); |
| 9893 | break; |
| 9894 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9895 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 9896 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9897 | break; |
| 9898 | } |
| 9899 | |
| 9900 | return ret; |
| 9901 | } |
| 9902 | |
| 9903 | static int iw_set_two_ints_getnone(struct net_device *dev, |
| 9904 | struct iw_request_info *info, |
| 9905 | union iwreq_data *wrqu, char *extra) |
| 9906 | { |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9907 | int errno; |
| 9908 | struct osif_vdev_sync *vdev_sync; |
| 9909 | |
| 9910 | errno = osif_vdev_sync_op_start(dev, &vdev_sync); |
| 9911 | if (errno) |
| 9912 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9913 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9914 | errno = __iw_set_two_ints_getnone(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9915 | |
Dustin Brown | 389e507 | 2018-11-08 17:10:01 +0530 | [diff] [blame] | 9916 | osif_vdev_sync_op_stop(vdev_sync); |
| 9917 | |
| 9918 | return errno; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9919 | } |
| 9920 | |
| 9921 | /* Define the Wireless Extensions to the Linux Network Device structure */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9922 | |
| 9923 | static const iw_handler we_private[] = { |
| 9924 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9925 | [WLAN_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_setint_getnone, |
| 9926 | [WLAN_PRIV_SET_NONE_GET_INT - SIOCIWFIRSTPRIV] = iw_setnone_getint, |
| 9927 | [WLAN_PRIV_SET_CHAR_GET_NONE - SIOCIWFIRSTPRIV] = iw_setchar_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9928 | [WLAN_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9929 | iw_set_three_ints_getnone, |
| 9930 | [WLAN_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] = iw_get_char_setnone, |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9931 | [WLAN_PRIV_SET_NONE_GET_NONE - SIOCIWFIRSTPRIV] = iw_setnone_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9932 | [WLAN_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9933 | iw_hdd_set_var_ints_getnone, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9934 | [WLAN_PRIV_SET_NONE_GET_THREE_INT - SIOCIWFIRSTPRIV] = |
| 9935 | iw_setnone_get_threeint, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9936 | #ifdef WLAN_FEATURE_FIPS |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 9937 | [WLAN_PRIV_FIPS_TEST - SIOCIWFIRSTPRIV] = hdd_fips_test, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9938 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9939 | [WLAN_PRIV_ADD_TSPEC - SIOCIWFIRSTPRIV] = iw_add_tspec, |
| 9940 | [WLAN_PRIV_DEL_TSPEC - SIOCIWFIRSTPRIV] = iw_del_tspec, |
| 9941 | [WLAN_PRIV_GET_TSPEC - SIOCIWFIRSTPRIV] = iw_get_tspec, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9942 | [WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9943 | [WLAN_PRIV_SET_HOST_OFFLOAD - SIOCIWFIRSTPRIV] = iw_set_host_offload, |
| 9944 | [WLAN_GET_WLAN_STATISTICS - SIOCIWFIRSTPRIV] = iw_get_statistics, |
| 9945 | [WLAN_SET_KEEPALIVE_PARAMS - SIOCIWFIRSTPRIV] = |
| 9946 | iw_set_keepalive_params, |
| 9947 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 9948 | [WLAN_SET_PACKET_FILTER_PARAMS - SIOCIWFIRSTPRIV] = |
| 9949 | iw_set_packet_filter_params, |
| 9950 | #endif |
| 9951 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9952 | [WLAN_SET_PNO - SIOCIWFIRSTPRIV] = iw_set_pno, |
| 9953 | #endif |
| 9954 | [WLAN_SET_BAND_CONFIG - SIOCIWFIRSTPRIV] = iw_set_band_config, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 9955 | [WLAN_PRIV_SET_MCBC_FILTER - SIOCIWFIRSTPRIV] = |
| 9956 | iw_set_dynamic_mcbc_filter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9957 | [WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed, |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 9958 | #ifdef FEATURE_WLM_STATS |
| 9959 | [WLAN_GET_WLM_STATS - SIOCIWFIRSTPRIV] = iw_get_wlm_stats, |
| 9960 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9961 | [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9962 | iw_set_two_ints_getnone, |
| 9963 | [WLAN_SET_DOT11P_CHANNEL_SCHED - SIOCIWFIRSTPRIV] = |
| 9964 | iw_set_dot11p_channel_sched, |
| 9965 | }; |
| 9966 | |
| 9967 | /*Maximum command length can be only 15 */ |
| 9968 | static const struct iw_priv_args we_private_args[] = { |
| 9969 | |
| 9970 | /* handlers for main ioctl */ |
| 9971 | {WLAN_PRIV_SET_INT_GET_NONE, |
| 9972 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9973 | 0, |
| 9974 | ""}, |
| 9975 | |
| 9976 | /* handlers for sub-ioctl */ |
| 9977 | {WE_SET_11D_STATE, |
| 9978 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9979 | 0, |
| 9980 | "set11Dstate"}, |
| 9981 | |
| 9982 | {WE_WOWL, |
| 9983 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9984 | 0, |
| 9985 | "wowl"}, |
| 9986 | |
| 9987 | {WE_SET_POWER, |
| 9988 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9989 | 0, |
| 9990 | "setPower"}, |
| 9991 | |
| 9992 | {WE_SET_MAX_ASSOC, |
| 9993 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9994 | 0, |
| 9995 | "setMaxAssoc"}, |
| 9996 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9997 | {WE_SET_SCAN_DISABLE, |
| 9998 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9999 | 0, |
| 10000 | "scan_disable"}, |
| 10001 | |
| 10002 | {WE_SET_DATA_INACTIVITY_TO, |
| 10003 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10004 | 0, |
| 10005 | "inactivityTO"}, |
| 10006 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 10007 | {WE_SET_WOW_DATA_INACTIVITY_TO, |
| 10008 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10009 | 0, |
| 10010 | "wow_ito"}, |
| 10011 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10012 | {WE_SET_MAX_TX_POWER, |
| 10013 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10014 | 0, |
| 10015 | "setMaxTxPower"}, |
| 10016 | |
| 10017 | {WE_SET_TX_POWER, |
| 10018 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10019 | 0, |
| 10020 | "setTxPower"}, |
| 10021 | |
| 10022 | {WE_SET_MC_RATE, |
| 10023 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10024 | 0, |
| 10025 | "setMcRate"}, |
| 10026 | |
| 10027 | {WE_SET_MAX_TX_POWER_2_4, |
| 10028 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10029 | 0, |
| 10030 | "setTxMaxPower2G"}, |
| 10031 | |
| 10032 | {WE_SET_MAX_TX_POWER_5_0, |
| 10033 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10034 | 0, |
| 10035 | "setTxMaxPower5G"}, |
| 10036 | |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 10037 | #ifndef REMOVE_PKT_LOG |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10038 | {WE_SET_PKTLOG, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 10039 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10040 | 0, |
| 10041 | "pktlog"}, |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 10042 | #endif |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 10043 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10044 | /* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA |
| 10045 | * as well to keep same syntax as in SAP. Now onwards, STA |
Jeff Johnson | 3bb7c73 | 2017-01-12 08:40:17 -0800 | [diff] [blame] | 10046 | * will support both |
| 10047 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10048 | {WE_SET_MAX_TX_POWER, |
| 10049 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10050 | 0, |
| 10051 | "setTxMaxPower"}, |
| 10052 | |
Jeff Johnson | 0187c62 | 2019-01-04 06:39:44 -0800 | [diff] [blame] | 10053 | #ifdef HASTINGS_BT_WAR |
| 10054 | {WE_SET_HASTINGS_BT_WAR, |
| 10055 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10056 | 0, |
| 10057 | "hastings_bt_war"}, |
| 10058 | #endif |
| 10059 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10060 | {WE_SET_TM_LEVEL, |
| 10061 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10062 | 0, |
| 10063 | "setTmLevel"}, |
| 10064 | |
| 10065 | {WE_SET_PHYMODE, |
| 10066 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10067 | 0, |
| 10068 | "setphymode"}, |
| 10069 | |
| 10070 | {WE_SET_NSS, |
| 10071 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10072 | 0, |
| 10073 | "nss"}, |
| 10074 | |
| 10075 | {WE_SET_LDPC, |
| 10076 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10077 | 0, |
| 10078 | "ldpc"}, |
| 10079 | |
| 10080 | {WE_SET_TX_STBC, |
| 10081 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10082 | 0, |
| 10083 | "tx_stbc"}, |
| 10084 | |
| 10085 | {WE_SET_RX_STBC, |
| 10086 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10087 | 0, |
| 10088 | "rx_stbc"}, |
| 10089 | |
| 10090 | {WE_SET_SHORT_GI, |
| 10091 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10092 | 0, |
| 10093 | "shortgi"}, |
| 10094 | |
| 10095 | {WE_SET_RTSCTS, |
| 10096 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10097 | 0, |
| 10098 | "enablertscts"}, |
| 10099 | |
| 10100 | {WE_SET_CHWIDTH, |
| 10101 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10102 | 0, |
| 10103 | "chwidth"}, |
| 10104 | |
| 10105 | {WE_SET_ANI_EN_DIS, |
| 10106 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10107 | 0, |
| 10108 | "anienable"}, |
| 10109 | |
| 10110 | {WE_SET_ANI_POLL_PERIOD, |
| 10111 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10112 | 0, |
| 10113 | "aniplen"}, |
| 10114 | |
| 10115 | {WE_SET_ANI_LISTEN_PERIOD, |
| 10116 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10117 | 0, |
| 10118 | "anilislen"}, |
| 10119 | |
| 10120 | {WE_SET_ANI_OFDM_LEVEL, |
| 10121 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10122 | 0, |
| 10123 | "aniofdmlvl"}, |
| 10124 | |
| 10125 | {WE_SET_ANI_CCK_LEVEL, |
| 10126 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10127 | 0, |
| 10128 | "aniccklvl"}, |
| 10129 | |
| 10130 | {WE_SET_DYNAMIC_BW, |
| 10131 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10132 | 0, |
| 10133 | "cwmenable"}, |
| 10134 | |
| 10135 | {WE_SET_CTS_CBW, |
| 10136 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10137 | 0, |
| 10138 | "cts_cbw" }, |
| 10139 | |
| 10140 | {WE_SET_GTX_HT_MCS, |
| 10141 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10142 | 0, |
| 10143 | "gtxHTMcs"}, |
| 10144 | |
| 10145 | {WE_SET_GTX_VHT_MCS, |
| 10146 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10147 | 0, |
| 10148 | "gtxVHTMcs"}, |
| 10149 | |
| 10150 | {WE_SET_GTX_USRCFG, |
| 10151 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10152 | 0, |
| 10153 | "gtxUsrCfg"}, |
| 10154 | |
| 10155 | {WE_SET_GTX_THRE, |
| 10156 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10157 | 0, |
| 10158 | "gtxThre"}, |
| 10159 | |
| 10160 | {WE_SET_GTX_MARGIN, |
| 10161 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10162 | 0, |
| 10163 | "gtxMargin"}, |
| 10164 | |
| 10165 | {WE_SET_GTX_STEP, |
| 10166 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10167 | 0, |
| 10168 | "gtxStep"}, |
| 10169 | |
| 10170 | {WE_SET_GTX_MINTPC, |
| 10171 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10172 | 0, |
| 10173 | "gtxMinTpc"}, |
| 10174 | |
| 10175 | {WE_SET_GTX_BWMASK, |
| 10176 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10177 | 0, |
| 10178 | "gtxBWMask"}, |
| 10179 | |
| 10180 | {WE_SET_TX_CHAINMASK, |
| 10181 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10182 | 0, |
| 10183 | "txchainmask"}, |
| 10184 | |
| 10185 | {WE_SET_RX_CHAINMASK, |
| 10186 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10187 | 0, |
| 10188 | "rxchainmask"}, |
| 10189 | |
| 10190 | {WE_SET_11N_RATE, |
| 10191 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10192 | 0, |
| 10193 | "set11NRates"}, |
| 10194 | |
| 10195 | {WE_SET_VHT_RATE, |
| 10196 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10197 | 0, |
| 10198 | "set11ACRates"}, |
| 10199 | |
| 10200 | {WE_SET_AMPDU, |
| 10201 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10202 | 0, |
| 10203 | "ampdu"}, |
| 10204 | |
| 10205 | {WE_SET_AMSDU, |
| 10206 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10207 | 0, |
| 10208 | "amsdu"}, |
| 10209 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10210 | {WE_SET_TXPOW_2G, |
| 10211 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10212 | 0, |
| 10213 | "txpow2g"}, |
| 10214 | |
| 10215 | {WE_SET_TXPOW_5G, |
| 10216 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10217 | 0, |
| 10218 | "txpow5g"}, |
| 10219 | |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 10220 | #ifdef FEATURE_FW_LOG_PARSING |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10221 | /* Sub-cmds DBGLOG specific commands */ |
| 10222 | {WE_DBGLOG_LOG_LEVEL, |
| 10223 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10224 | 0, |
| 10225 | "dl_loglevel"}, |
| 10226 | |
| 10227 | {WE_DBGLOG_VAP_ENABLE, |
| 10228 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10229 | 0, |
| 10230 | "dl_vapon"}, |
| 10231 | |
| 10232 | {WE_DBGLOG_VAP_DISABLE, |
| 10233 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10234 | 0, |
| 10235 | "dl_vapoff"}, |
| 10236 | |
| 10237 | {WE_DBGLOG_MODULE_ENABLE, |
| 10238 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10239 | 0, |
| 10240 | "dl_modon"}, |
| 10241 | |
| 10242 | {WE_DBGLOG_MODULE_DISABLE, |
| 10243 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10244 | 0, |
| 10245 | "dl_modoff"}, |
| 10246 | |
| 10247 | {WE_DBGLOG_MOD_LOG_LEVEL, |
| 10248 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10249 | 0, |
| 10250 | "dl_mod_loglevel"}, |
| 10251 | |
| 10252 | {WE_DBGLOG_TYPE, |
| 10253 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10254 | 0, |
| 10255 | "dl_type"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10256 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10257 | {WE_DBGLOG_REPORT_ENABLE, |
| 10258 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10259 | 0, |
| 10260 | "dl_report"}, |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 10261 | #endif /* FEATURE_FW_LOG_PARSING */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10262 | |
| 10263 | {WE_SET_TXRX_FWSTATS, |
| 10264 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10265 | 0, |
| 10266 | "txrx_fw_stats"}, |
| 10267 | |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 10268 | {WE_SET_TXRX_STATS, |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 10269 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 10270 | 0, |
| 10271 | "txrx_stats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10272 | #ifdef FW_THERMAL_THROTTLE_SUPPORT |
| 10273 | {WE_SET_THERMAL_THROTTLE_CFG, |
| 10274 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10275 | 0, |
| 10276 | "set_thermal_cfg"}, |
| 10277 | #endif /* FW_THERMAL_THROTTLE_SUPPORT */ |
Krishna Reddy | a50d09f | 2019-02-04 14:55:06 +0530 | [diff] [blame] | 10278 | {WE_SET_BTCOEX_MODE, |
| 10279 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10280 | 0, "set_btc_mode" }, |
| 10281 | {WE_SET_BTCOEX_RSSI_THRESHOLD, |
| 10282 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10283 | 0, "set_btc_rssi" }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10284 | {WE_TXRX_FWSTATS_RESET, |
| 10285 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10286 | 0, |
| 10287 | "txrx_fw_st_rst"}, |
| 10288 | |
| 10289 | {WE_PPS_PAID_MATCH, |
| 10290 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10291 | 0, "paid_match"}, |
| 10292 | |
| 10293 | {WE_PPS_GID_MATCH, |
| 10294 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10295 | 0, "gid_match"}, |
| 10296 | |
| 10297 | {WE_PPS_EARLY_TIM_CLEAR, |
| 10298 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10299 | 0, "tim_clear"}, |
| 10300 | |
| 10301 | {WE_PPS_EARLY_DTIM_CLEAR, |
| 10302 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10303 | 0, "dtim_clear"}, |
| 10304 | |
| 10305 | {WE_PPS_EOF_PAD_DELIM, |
| 10306 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10307 | 0, "eof_delim"}, |
| 10308 | |
| 10309 | {WE_PPS_MACADDR_MISMATCH, |
| 10310 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10311 | 0, "mac_match"}, |
| 10312 | |
| 10313 | {WE_PPS_DELIM_CRC_FAIL, |
| 10314 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10315 | 0, "delim_fail"}, |
| 10316 | |
| 10317 | {WE_PPS_GID_NSTS_ZERO, |
| 10318 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10319 | 0, "nsts_zero"}, |
| 10320 | |
| 10321 | {WE_PPS_RSSI_CHECK, |
| 10322 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10323 | 0, "rssi_chk"}, |
| 10324 | |
| 10325 | {WE_PPS_5G_EBT, |
| 10326 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10327 | 0, "5g_ebt"}, |
| 10328 | |
| 10329 | {WE_SET_HTSMPS, |
| 10330 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10331 | 0, "htsmps"}, |
| 10332 | |
| 10333 | {WE_SET_QPOWER_MAX_PSPOLL_COUNT, |
| 10334 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10335 | 0, "set_qpspollcnt"}, |
| 10336 | |
| 10337 | {WE_SET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 10338 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10339 | 0, "set_qtxwake"}, |
| 10340 | |
| 10341 | {WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 10342 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10343 | 0, "set_qwakeintv"}, |
| 10344 | |
| 10345 | {WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 10346 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10347 | 0, "set_qnodatapoll"}, |
| 10348 | |
| 10349 | /* handlers for MCC time quota and latency sub ioctls */ |
| 10350 | {WE_MCC_CONFIG_LATENCY, |
| 10351 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10352 | 0, "setMccLatency"}, |
| 10353 | |
| 10354 | {WE_MCC_CONFIG_QUOTA, |
| 10355 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10356 | 0, "setMccQuota"}, |
| 10357 | |
| 10358 | {WE_SET_DEBUG_LOG, |
| 10359 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10360 | 0, "setDbgLvl"}, |
| 10361 | |
| 10362 | /* handlers for early_rx power save */ |
| 10363 | {WE_SET_EARLY_RX_ADJUST_ENABLE, |
| 10364 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10365 | 0, "erx_enable"}, |
| 10366 | |
| 10367 | {WE_SET_EARLY_RX_TGT_BMISS_NUM, |
| 10368 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10369 | 0, "erx_bmiss_val"}, |
| 10370 | |
| 10371 | {WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 10372 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10373 | 0, "erx_bmiss_smpl"}, |
| 10374 | |
| 10375 | {WE_SET_EARLY_RX_SLOP_STEP, |
| 10376 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10377 | 0, "erx_slop_step"}, |
| 10378 | |
| 10379 | {WE_SET_EARLY_RX_INIT_SLOP, |
| 10380 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10381 | 0, "erx_init_slop"}, |
| 10382 | |
| 10383 | {WE_SET_EARLY_RX_ADJUST_PAUSE, |
| 10384 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10385 | 0, "erx_adj_pause"}, |
| 10386 | |
| 10387 | {WE_SET_EARLY_RX_DRIFT_SAMPLE, |
| 10388 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10389 | 0, "erx_dri_sample"}, |
| 10390 | |
| 10391 | {WE_DUMP_STATS, |
| 10392 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10393 | 0, "dumpStats"}, |
| 10394 | |
| 10395 | {WE_CLEAR_STATS, |
| 10396 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10397 | 0, "clearStats"}, |
| 10398 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10399 | {WE_START_FW_PROFILE, |
| 10400 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10401 | 0, "startProfile"}, |
| 10402 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 10403 | {WE_SET_CHANNEL, |
| 10404 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10405 | 0, "setChanChange" }, |
| 10406 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 10407 | {WE_SET_CONC_SYSTEM_PREF, |
| 10408 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10409 | 0, "setConcSysPref" }, |
| 10410 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 10411 | {WE_SET_PDEV_RESET, |
| 10412 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10413 | 0, "pdev_reset" }, |
| 10414 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10415 | {WE_SET_MODULATED_DTIM, |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 10416 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10417 | 0, "setModDTIM" }, |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 10418 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10419 | {WLAN_PRIV_SET_NONE_GET_INT, |
| 10420 | 0, |
| 10421 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10422 | ""}, |
| 10423 | |
| 10424 | /* handlers for sub-ioctl */ |
| 10425 | {WE_GET_11D_STATE, |
| 10426 | 0, |
| 10427 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10428 | "get11Dstate"}, |
| 10429 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10430 | {WE_GET_WLAN_DBG, |
| 10431 | 0, |
| 10432 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10433 | "getwlandbg"}, |
| 10434 | |
| 10435 | {WE_GET_MAX_ASSOC, |
| 10436 | 0, |
| 10437 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10438 | "getMaxAssoc"}, |
| 10439 | |
| 10440 | {WE_GET_SAP_AUTO_CHANNEL_SELECTION, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10441 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10442 | "getAutoChannel"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10443 | |
| 10444 | {WE_GET_CONCURRENCY_MODE, |
| 10445 | 0, |
| 10446 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10447 | "getconcurrency"}, |
| 10448 | |
| 10449 | {WE_GET_NSS, |
| 10450 | 0, |
| 10451 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10452 | "get_nss"}, |
| 10453 | |
| 10454 | {WE_GET_LDPC, |
| 10455 | 0, |
| 10456 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10457 | "get_ldpc"}, |
| 10458 | |
| 10459 | {WE_GET_TX_STBC, |
| 10460 | 0, |
| 10461 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10462 | "get_tx_stbc"}, |
| 10463 | |
| 10464 | {WE_GET_RX_STBC, |
| 10465 | 0, |
| 10466 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10467 | "get_rx_stbc"}, |
| 10468 | |
| 10469 | {WE_GET_SHORT_GI, |
| 10470 | 0, |
| 10471 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10472 | "get_shortgi"}, |
| 10473 | |
| 10474 | {WE_GET_RTSCTS, |
| 10475 | 0, |
| 10476 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10477 | "get_rtscts"}, |
| 10478 | |
| 10479 | {WE_GET_CHWIDTH, |
| 10480 | 0, |
| 10481 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10482 | "get_chwidth"}, |
| 10483 | |
| 10484 | {WE_GET_ANI_EN_DIS, |
| 10485 | 0, |
| 10486 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10487 | "get_anienable"}, |
| 10488 | |
| 10489 | {WE_GET_ANI_POLL_PERIOD, |
| 10490 | 0, |
| 10491 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10492 | "get_aniplen"}, |
| 10493 | |
| 10494 | {WE_GET_ANI_LISTEN_PERIOD, |
| 10495 | 0, |
| 10496 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10497 | "get_anilislen"}, |
| 10498 | |
| 10499 | {WE_GET_ANI_OFDM_LEVEL, |
| 10500 | 0, |
| 10501 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10502 | "get_aniofdmlvl"}, |
| 10503 | |
| 10504 | {WE_GET_ANI_CCK_LEVEL, |
| 10505 | 0, |
| 10506 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10507 | "get_aniccklvl"}, |
| 10508 | |
| 10509 | {WE_GET_DYNAMIC_BW, |
| 10510 | 0, |
| 10511 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10512 | "get_cwmenable"}, |
| 10513 | |
| 10514 | {WE_GET_GTX_HT_MCS, |
| 10515 | 0, |
| 10516 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10517 | "get_gtxHTMcs"}, |
| 10518 | |
| 10519 | {WE_GET_GTX_VHT_MCS, |
| 10520 | 0, |
| 10521 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10522 | "get_gtxVHTMcs"}, |
| 10523 | |
| 10524 | {WE_GET_GTX_USRCFG, |
| 10525 | 0, |
| 10526 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10527 | "get_gtxUsrCfg"}, |
| 10528 | |
| 10529 | {WE_GET_GTX_THRE, |
| 10530 | 0, |
| 10531 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10532 | "get_gtxThre"}, |
| 10533 | |
| 10534 | {WE_GET_GTX_MARGIN, |
| 10535 | 0, |
| 10536 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10537 | "get_gtxMargin"}, |
| 10538 | |
| 10539 | {WE_GET_GTX_STEP, |
| 10540 | 0, |
| 10541 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10542 | "get_gtxStep"}, |
| 10543 | |
| 10544 | {WE_GET_GTX_MINTPC, |
| 10545 | 0, |
| 10546 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10547 | "get_gtxMinTpc"}, |
| 10548 | |
| 10549 | {WE_GET_GTX_BWMASK, |
| 10550 | 0, |
| 10551 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10552 | "get_gtxBWMask"}, |
| 10553 | |
| 10554 | {WE_GET_TX_CHAINMASK, |
| 10555 | 0, |
| 10556 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10557 | "get_txchainmask"}, |
| 10558 | |
| 10559 | {WE_GET_RX_CHAINMASK, |
| 10560 | 0, |
| 10561 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10562 | "get_rxchainmask"}, |
| 10563 | |
| 10564 | {WE_GET_11N_RATE, |
| 10565 | 0, |
| 10566 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10567 | "get_11nrate"}, |
| 10568 | |
| 10569 | {WE_GET_AMPDU, |
| 10570 | 0, |
| 10571 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10572 | "get_ampdu"}, |
| 10573 | |
| 10574 | {WE_GET_AMSDU, |
| 10575 | 0, |
| 10576 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10577 | "get_amsdu"}, |
| 10578 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10579 | {WE_GET_TXPOW_2G, |
| 10580 | 0, |
| 10581 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10582 | "get_txpow2g"}, |
| 10583 | |
| 10584 | {WE_GET_TXPOW_5G, |
| 10585 | 0, |
| 10586 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10587 | "get_txpow5g"}, |
| 10588 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10589 | {WE_GET_PPS_PAID_MATCH, |
| 10590 | 0, |
| 10591 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10592 | "get_paid_match"}, |
| 10593 | |
| 10594 | {WE_GET_PPS_GID_MATCH, |
| 10595 | 0, |
| 10596 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10597 | "get_gid_match"}, |
| 10598 | |
| 10599 | {WE_GET_PPS_EARLY_TIM_CLEAR, |
| 10600 | 0, |
| 10601 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10602 | "get_tim_clear"}, |
| 10603 | |
| 10604 | {WE_GET_PPS_EARLY_DTIM_CLEAR, |
| 10605 | 0, |
| 10606 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10607 | "get_dtim_clear"}, |
| 10608 | |
| 10609 | {WE_GET_PPS_EOF_PAD_DELIM, |
| 10610 | 0, |
| 10611 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10612 | "get_eof_delim"}, |
| 10613 | |
| 10614 | {WE_GET_PPS_MACADDR_MISMATCH, |
| 10615 | 0, |
| 10616 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10617 | "get_mac_match"}, |
| 10618 | |
| 10619 | {WE_GET_PPS_DELIM_CRC_FAIL, |
| 10620 | 0, |
| 10621 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10622 | "get_delim_fail"}, |
| 10623 | |
| 10624 | {WE_GET_PPS_GID_NSTS_ZERO, |
| 10625 | 0, |
| 10626 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10627 | "get_nsts_zero"}, |
| 10628 | |
| 10629 | {WE_GET_PPS_RSSI_CHECK, |
| 10630 | 0, |
| 10631 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10632 | "get_rssi_chk"}, |
| 10633 | |
| 10634 | {WE_GET_QPOWER_MAX_PSPOLL_COUNT, |
| 10635 | 0, |
| 10636 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10637 | "get_qpspollcnt"}, |
| 10638 | |
| 10639 | {WE_GET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 10640 | 0, |
| 10641 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10642 | "get_qtxwake"}, |
| 10643 | |
| 10644 | {WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 10645 | 0, |
| 10646 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10647 | "get_qwakeintv"}, |
| 10648 | |
| 10649 | {WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 10650 | 0, |
| 10651 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10652 | "get_qnodatapoll"}, |
| 10653 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10654 | {WE_CAP_TSF, |
| 10655 | 0, |
| 10656 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10657 | "cap_tsf"}, |
| 10658 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10659 | {WE_GET_TEMPERATURE, |
| 10660 | 0, |
| 10661 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10662 | "get_temp"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10663 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10664 | {WE_GET_DCM, |
| 10665 | 0, |
| 10666 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10667 | "get_dcm"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10668 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10669 | {WE_GET_RANGE_EXT, |
| 10670 | 0, |
| 10671 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10672 | "get_range_ext"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10673 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10674 | /* handlers for main ioctl */ |
| 10675 | {WLAN_PRIV_SET_CHAR_GET_NONE, |
| 10676 | IW_PRIV_TYPE_CHAR | 512, |
| 10677 | 0, |
| 10678 | ""}, |
| 10679 | |
| 10680 | /* handlers for sub-ioctl */ |
| 10681 | {WE_WOWL_ADD_PTRN, |
| 10682 | IW_PRIV_TYPE_CHAR | 512, |
| 10683 | 0, |
| 10684 | "wowlAddPtrn"}, |
| 10685 | |
| 10686 | {WE_WOWL_DEL_PTRN, |
| 10687 | IW_PRIV_TYPE_CHAR | 512, |
| 10688 | 0, |
| 10689 | "wowlDelPtrn"}, |
| 10690 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10691 | /* handlers for sub-ioctl */ |
| 10692 | {WE_NEIGHBOR_REPORT_REQUEST, |
| 10693 | IW_PRIV_TYPE_CHAR | 512, |
| 10694 | 0, |
| 10695 | "neighbor"}, |
Deepak Dhamdhere | 641bf32 | 2016-01-06 15:19:03 -0800 | [diff] [blame] | 10696 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10697 | {WE_SET_AP_WPS_IE, |
| 10698 | IW_PRIV_TYPE_CHAR | 512, |
| 10699 | 0, |
| 10700 | "set_ap_wps_ie"}, |
| 10701 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 10702 | #ifdef WLAN_UNIT_TEST |
| 10703 | {WE_UNIT_TEST, |
| 10704 | IW_PRIV_TYPE_CHAR | 512, |
| 10705 | 0, |
| 10706 | "unit_test"}, |
| 10707 | #endif |
| 10708 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10709 | /* handlers for main ioctl */ |
| 10710 | {WLAN_PRIV_SET_THREE_INT_GET_NONE, |
| 10711 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10712 | 0, |
| 10713 | ""}, |
| 10714 | |
| 10715 | /* handlers for sub-ioctl */ |
| 10716 | {WE_SET_WLAN_DBG, |
| 10717 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10718 | 0, |
| 10719 | "setwlandbg"}, |
| 10720 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10721 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10722 | /* handlers for sub-ioctl */ |
| 10723 | {WE_SET_DP_TRACE, |
| 10724 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10725 | 0, |
| 10726 | "set_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10727 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10728 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 10729 | {WE_SET_FW_TEST, |
| 10730 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10731 | 0, "fw_test"}, |
| 10732 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10733 | /* handlers for main ioctl */ |
| 10734 | {WLAN_PRIV_SET_NONE_GET_THREE_INT, |
| 10735 | 0, |
| 10736 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10737 | ""}, |
| 10738 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 10739 | {WE_GET_TSF, |
| 10740 | 0, |
| 10741 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10742 | "get_tsf"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10743 | |
| 10744 | {WE_SET_DUAL_MAC_SCAN_CONFIG, |
| 10745 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 10746 | 0, |
| 10747 | "set_scan_cfg"}, |
| 10748 | |
| 10749 | /* handlers for main ioctl */ |
| 10750 | {WLAN_PRIV_GET_CHAR_SET_NONE, |
| 10751 | 0, |
| 10752 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10753 | ""}, |
| 10754 | |
| 10755 | /* handlers for sub-ioctl */ |
| 10756 | {WE_WLAN_VERSION, |
| 10757 | 0, |
| 10758 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10759 | "version"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10760 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10761 | {WE_GET_STATS, |
| 10762 | 0, |
| 10763 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10764 | "getStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10765 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 10766 | {WE_GET_SUSPEND_RESUME_STATS, |
| 10767 | 0, |
| 10768 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10769 | "getSuspendStats"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10770 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10771 | {WE_LIST_FW_PROFILE, |
| 10772 | 0, |
| 10773 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10774 | "listProfile"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10775 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10776 | {WE_GET_STATES, |
| 10777 | 0, |
| 10778 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10779 | "getHostStates"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10780 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10781 | {WE_GET_CFG, |
| 10782 | 0, |
| 10783 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10784 | "getConfig"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10785 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10786 | {WE_GET_RSSI, |
| 10787 | 0, |
| 10788 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10789 | "getRSSI"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10790 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10791 | {WE_GET_WMM_STATUS, |
| 10792 | 0, |
| 10793 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10794 | "getWmmStatus"}, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10795 | |
| 10796 | {WE_GET_CHANNEL_LIST, |
| 10797 | 0, |
| 10798 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10799 | "getChannelList"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10800 | #ifdef FEATURE_WLAN_TDLS |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10801 | {WE_GET_TDLS_PEERS, |
| 10802 | 0, |
| 10803 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10804 | "getTdlsPeers"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10805 | #endif |
| 10806 | #ifdef WLAN_FEATURE_11W |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10807 | {WE_GET_11W_INFO, |
| 10808 | 0, |
| 10809 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10810 | "getPMFInfo"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10811 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10812 | {WE_GET_STA_CXN_INFO, |
| 10813 | 0, |
| 10814 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10815 | "get_cxn_info" }, |
Krunal Soni | 5e48378 | 2018-10-25 15:42:44 -0700 | [diff] [blame] | 10816 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10817 | {WE_GET_IBSS_STA_INFO, |
| 10818 | 0, |
| 10819 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10820 | "getIbssSTAs"}, |
| 10821 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10822 | {WE_GET_PHYMODE, |
| 10823 | 0, |
| 10824 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10825 | "getphymode"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10826 | #if defined(FEATURE_OEM_DATA_SUPPORT) || defined(WIFI_POS_CONVERGED) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10827 | {WE_GET_OEM_DATA_CAP, |
| 10828 | 0, |
| 10829 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10830 | "getOemDataCap"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 10831 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10832 | {WE_GET_SNR, |
| 10833 | 0, |
| 10834 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10835 | "getSNR"}, |
| 10836 | |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 10837 | {WE_GET_BA_AGEING_TIMEOUT, |
| 10838 | 0, |
| 10839 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10840 | "get_ba_timeout"}, |
| 10841 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10842 | /* handlers for main ioctl */ |
| 10843 | {WLAN_PRIV_SET_NONE_GET_NONE, |
| 10844 | 0, |
| 10845 | 0, |
| 10846 | ""}, |
| 10847 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10848 | /* handlers for sub-ioctl */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10849 | {WE_IBSS_GET_PEER_INFO_ALL, |
| 10850 | 0, |
| 10851 | 0, |
| 10852 | "ibssPeerInfoAll"}, |
| 10853 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10854 | {WE_GET_FW_PROFILE_DATA, |
| 10855 | 0, |
| 10856 | 0, |
| 10857 | "getProfileData"}, |
| 10858 | |
| 10859 | {WE_SET_REASSOC_TRIGGER, |
| 10860 | 0, |
| 10861 | 0, |
| 10862 | "reassoc"}, |
| 10863 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 10864 | {WE_STOP_OBSS_SCAN, |
| 10865 | 0, |
| 10866 | 0, |
| 10867 | "stop_obss_scan"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10868 | /* handlers for main ioctl */ |
| 10869 | {WLAN_PRIV_SET_VAR_INT_GET_NONE, |
| 10870 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10871 | 0, |
| 10872 | ""}, |
| 10873 | |
| 10874 | /* handlers for sub-ioctl */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10875 | {WE_IBSS_GET_PEER_INFO, |
| 10876 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10877 | 0, |
| 10878 | "ibssPeerInfo"}, |
| 10879 | |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10880 | #ifdef TRACE_RECORD |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 10881 | /* handlers for sub-ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10882 | {WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD, |
| 10883 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10884 | 0, |
| 10885 | "setdumplog"}, |
| 10886 | |
| 10887 | {WE_MTRACE_DUMP_CMD, |
| 10888 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10889 | 0, |
| 10890 | "dumplog"}, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 10891 | #endif |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 10892 | |
| 10893 | {WE_POLICY_MANAGER_CINFO_CMD, |
| 10894 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10895 | 0, |
| 10896 | "pm_cinfo"}, |
| 10897 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10898 | #ifdef MPC_UT_FRAMEWORK |
| 10899 | {WE_POLICY_MANAGER_CLIST_CMD, |
| 10900 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10901 | 0, |
| 10902 | "pm_clist"}, |
| 10903 | |
| 10904 | {WE_POLICY_MANAGER_DLIST_CMD, |
| 10905 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10906 | 0, |
| 10907 | "pm_dlist"}, |
| 10908 | |
| 10909 | {WE_POLICY_MANAGER_DBS_CMD, |
| 10910 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10911 | 0, |
| 10912 | "pm_dbs"}, |
| 10913 | |
| 10914 | {WE_POLICY_MANAGER_PCL_CMD, |
| 10915 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10916 | 0, |
| 10917 | "pm_pcl"}, |
| 10918 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10919 | {WE_POLICY_MANAGER_ULIST_CMD, |
| 10920 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10921 | 0, |
| 10922 | "pm_ulist"}, |
| 10923 | |
| 10924 | {WE_POLICY_MANAGER_QUERY_ACTION_CMD, |
| 10925 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10926 | 0, |
| 10927 | "pm_query_action"}, |
| 10928 | |
| 10929 | {WE_POLICY_MANAGER_QUERY_ALLOW_CMD, |
| 10930 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10931 | 0, |
| 10932 | "pm_query_allow"}, |
| 10933 | |
| 10934 | {WE_POLICY_MANAGER_SCENARIO_CMD, |
| 10935 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10936 | 0, |
| 10937 | "pm_run_scenario"}, |
| 10938 | |
| 10939 | {WE_POLICY_SET_HW_MODE_CMD, |
| 10940 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10941 | 0, |
| 10942 | "pm_set_hw_mode"}, |
| 10943 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10944 | {WE_UNIT_TEST_CMD, |
| 10945 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10946 | 0, |
| 10947 | "setUnitTestCmd"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10948 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10949 | {WE_MAC_PWR_DEBUG_CMD, |
| 10950 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10951 | 0, |
| 10952 | "halPwrDebug"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10953 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 10954 | {WE_LED_FLASHING_PARAM, |
| 10955 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10956 | 0, |
| 10957 | "gpio_control"}, |
| 10958 | #endif |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 10959 | #ifdef WLAN_DEBUG |
| 10960 | {WE_SET_CHAN_AVOID, |
| 10961 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10962 | 0, |
| 10963 | "ch_avoid"}, |
| 10964 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10965 | /* handlers for main ioctl */ |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 10966 | {WLAN_PRIV_FIPS_TEST, |
| 10967 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10968 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10969 | "fips_test"}, |
| 10970 | |
| 10971 | /* handlers for main ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10972 | {WLAN_PRIV_ADD_TSPEC, |
| 10973 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
| 10974 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10975 | "addTspec"}, |
| 10976 | |
| 10977 | /* handlers for main ioctl */ |
| 10978 | {WLAN_PRIV_DEL_TSPEC, |
| 10979 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10980 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10981 | "delTspec"}, |
| 10982 | |
| 10983 | /* handlers for main ioctl */ |
| 10984 | {WLAN_PRIV_GET_TSPEC, |
| 10985 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10986 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10987 | "getTspec"}, |
| 10988 | |
| 10989 | /* handlers for main ioctl - host offload */ |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10990 | {WLAN_PRIV_SET_HOST_OFFLOAD, |
| 10991 | IW_PRIV_TYPE_BYTE | sizeof(struct host_offload_req), |
| 10992 | 0, |
| 10993 | "setHostOffload"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10994 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 10995 | {WLAN_GET_WLAN_STATISTICS, |
| 10996 | 0, |
| 10997 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10998 | "getWlanStats"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10999 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11000 | {WLAN_SET_KEEPALIVE_PARAMS, |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 11001 | IW_PRIV_TYPE_BYTE | sizeof(struct keep_alive_req) | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11002 | IW_PRIV_SIZE_FIXED, |
| 11003 | 0, |
| 11004 | "setKeepAlive"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11005 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11006 | {WLAN_SET_PACKET_FILTER_PARAMS, |
| 11007 | IW_PRIV_TYPE_BYTE | |
| 11008 | sizeof(struct pkt_filter_cfg), |
| 11009 | 0, |
| 11010 | "setPktFilter"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11011 | #endif |
| 11012 | #ifdef FEATURE_WLAN_SCAN_PNO |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11013 | {WLAN_SET_PNO, |
| 11014 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11015 | 0, |
| 11016 | "setpno"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11017 | #endif |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11018 | {WLAN_SET_BAND_CONFIG, |
| 11019 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11020 | 0, |
| 11021 | "SETBAND"}, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 11022 | |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11023 | {WLAN_PRIV_SET_MCBC_FILTER, |
| 11024 | 0, |
| 11025 | 0, |
| 11026 | "setMCBCFilter"}, |
| 11027 | |
| 11028 | {WLAN_GET_LINK_SPEED, |
| 11029 | IW_PRIV_TYPE_CHAR | 18, |
| 11030 | IW_PRIV_TYPE_CHAR | 5, |
| 11031 | "getLinkSpeed"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11032 | |
Krunal Soni | f9ba53d | 2019-01-03 21:44:41 -0800 | [diff] [blame] | 11033 | #ifdef FEATURE_WLM_STATS |
| 11034 | {WLAN_GET_WLM_STATS, |
| 11035 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11036 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 11037 | "get_wlm_stats"}, |
| 11038 | #endif |
| 11039 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11040 | /* handlers for main ioctl */ |
| 11041 | {WLAN_PRIV_SET_TWO_INT_GET_NONE, |
| 11042 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 11043 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11044 | ""}, |
| 11045 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11046 | {WE_SET_SMPS_PARAM, |
| 11047 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11048 | 0, "set_smps_param"}, |
| 11049 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11050 | {WLAN_SET_DOT11P_CHANNEL_SCHED, |
| 11051 | IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11052 | 0, "set_dot11p" }, |
| 11053 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 11054 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11055 | {WE_SET_FW_CRASH_INJECT, |
| 11056 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11057 | 0, "crash_inject"}, |
| 11058 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 11059 | #endif |
Rachit Kankane | b103562 | 2018-01-24 18:41:35 +0530 | [diff] [blame] | 11060 | #if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY) |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 11061 | {WE_LOG_BUFFER, |
| 11062 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11063 | 0, "log_buffer"}, |
| 11064 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11065 | #endif |
Krunal Soni | 6c3859f | 2018-06-01 19:57:40 -0700 | [diff] [blame] | 11066 | {WE_SET_BA_AGEING_TIMEOUT, |
| 11067 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11068 | 0, "set_ba_timeout"}, |
| 11069 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11070 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 11071 | {WE_SET_WLAN_SUSPEND, |
| 11072 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11073 | 0, "wlan_suspend"}, |
| 11074 | |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11075 | {WE_SET_WLAN_RESUME, |
| 11076 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11077 | 0, "wlan_resume"}, |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 11078 | #endif |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 11079 | {WE_ENABLE_FW_PROFILE, |
| 11080 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11081 | 0, "enableProfile"}, |
| 11082 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 11083 | {WE_SET_FW_PROFILE_HIST_INTVL, |
| 11084 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11085 | 0, "set_hist_intvl"}, |
| 11086 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11087 | {WE_SET_DUAL_MAC_FW_MODE_CONFIG, |
| 11088 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11089 | 0, "set_fw_mode_cfg"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 11090 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11091 | {WE_DUMP_DP_TRACE_LEVEL, |
| 11092 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11093 | 0, "dump_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 11094 | #endif |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 11095 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 11096 | {WE_SET_MON_MODE_CHAN, |
| 11097 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11098 | 0, "setMonChan"}, |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 11099 | #endif |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 11100 | {WE_GET_ROAM_SYNCH_DELAY, |
| 11101 | 0, |
| 11102 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11103 | "hostroamdelay"}, |
| 11104 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 11105 | {WE_SET_11AX_RATE, |
| 11106 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11107 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11108 | "set_11ax_rate"}, |
| 11109 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 11110 | {WE_SET_DCM, |
| 11111 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11112 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11113 | "enable_dcm"}, |
| 11114 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 11115 | {WE_SET_RANGE_EXT, |
| 11116 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11117 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11118 | "range_ext"}, |
| 11119 | |
Naveen Rawat | c921c7b | 2017-06-13 17:29:51 -0700 | [diff] [blame] | 11120 | {WLAN_PRIV_SET_FTIES, |
| 11121 | IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, |
| 11122 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11123 | "set_ft_ies"}, |
| 11124 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11125 | #ifdef WLAN_FEATURE_MOTION_DETECTION |
| 11126 | {WE_MOTION_DET_START_STOP, |
| 11127 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11128 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11129 | "mt_start"}, |
| 11130 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11131 | {WE_MOTION_DET_BASE_LINE_START_STOP, |
| 11132 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 11133 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11134 | "mt_bl_start"}, |
| 11135 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11136 | {WE_MOTION_DET_CONFIG_PARAM, |
| 11137 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 11138 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11139 | "mt_config"}, |
| 11140 | |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11141 | {WE_MOTION_DET_BASE_LINE_CONFIG_PARAM, |
| 11142 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 11143 | 0, |
Visweswara Tanuku | 025f586 | 2019-01-08 17:35:33 +0530 | [diff] [blame] | 11144 | "mt_bl_config"}, |
Visweswara Tanuku | 633976b | 2019-01-07 16:13:12 +0530 | [diff] [blame] | 11145 | #endif /* WLAN_FEATURE_MOTION_DETECTION */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11146 | }; |
| 11147 | |
| 11148 | const struct iw_handler_def we_handler_def = { |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 11149 | .num_standard = 0, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 11150 | .num_private = QDF_ARRAY_SIZE(we_private), |
| 11151 | .num_private_args = QDF_ARRAY_SIZE(we_private_args), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11152 | |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 11153 | .standard = NULL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11154 | .private = (iw_handler *) we_private, |
| 11155 | .private_args = we_private_args, |
| 11156 | .get_wireless_stats = NULL, |
| 11157 | }; |
| 11158 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11159 | void hdd_register_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11160 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11161 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11162 | |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 11163 | dev->wireless_handlers = &we_handler_def; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11164 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 11165 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11166 | } |
| 11167 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11168 | void hdd_unregister_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11169 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11170 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11171 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 11172 | rtnl_lock(); |
| 11173 | dev->wireless_handlers = NULL; |
| 11174 | rtnl_unlock(); |
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_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11177 | } |