Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | /** |
| 20 | * DOC: wlan_hdd_wext.c |
| 21 | * |
| 22 | * Linux Wireless Extensions Implementation |
| 23 | */ |
| 24 | |
| 25 | #include <linux/version.h> |
| 26 | #include <linux/module.h> |
| 27 | #include <linux/kernel.h> |
| 28 | #include <linux/init.h> |
| 29 | #include <linux/wireless.h> |
| 30 | #include <mac_trace.h> |
| 31 | #include <wlan_hdd_includes.h> |
| 32 | #include <cds_api.h> |
Rajeev Kumar | ea95edd | 2017-01-11 20:49:36 -0800 | [diff] [blame] | 33 | #include "scheduler_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 34 | #include <net/arp.h> |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 35 | #include <cdp_txrx_cmn.h> |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 36 | #include <cdp_txrx_stats.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 37 | #include "sir_params.h" |
| 38 | #include "csr_api.h" |
| 39 | #include "csr_inside_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 40 | #include "sme_rrm_internal.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | #include <ani_global.h> |
| 42 | #include "dot11f.h" |
| 43 | #include <wlan_hdd_wowl.h> |
| 44 | #include <wlan_hdd_cfg.h> |
| 45 | #include <wlan_hdd_wmm.h> |
| 46 | #include "utils_api.h" |
| 47 | #include "wlan_hdd_p2p.h" |
| 48 | #ifdef FEATURE_WLAN_TDLS |
| 49 | #include "wlan_hdd_tdls.h" |
| 50 | #endif |
| 51 | |
| 52 | #include "cds_ieee80211_common.h" |
| 53 | #include "ol_if_athvar.h" |
| 54 | #include "dbglog_host.h" |
| 55 | #include "wma.h" |
| 56 | |
| 57 | #include "wlan_hdd_power.h" |
| 58 | #include "qwlan_version.h" |
| 59 | #include "wlan_hdd_host_offload.h" |
| 60 | |
| 61 | #include <linux/wireless.h> |
| 62 | #include <net/cfg80211.h> |
| 63 | |
| 64 | #include "wlan_hdd_misc.h" |
| 65 | |
| 66 | #include "qc_sap_ioctl.h" |
| 67 | #include "sme_api.h" |
| 68 | #include "wma_types.h" |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 69 | #include "qdf_str.h" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 70 | #include "qdf_trace.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 71 | #include "wlan_hdd_assoc.h" |
| 72 | #include "wlan_hdd_ioctl.h" |
| 73 | #include "wlan_hdd_scan.h" |
| 74 | #include "sme_power_save_api.h" |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 75 | #include "wlan_policy_mgr_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 76 | #include "wlan_hdd_conc_ut.h" |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 77 | #include "wlan_hdd_fips.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 78 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | #include "wlan_hdd_ocb.h" |
| 80 | #include "wlan_hdd_napi.h" |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 81 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 82 | #include "wlan_hdd_nan_datapath.h" |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 83 | #include "wlan_hdd_stats.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 84 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 85 | #include "wlan_hdd_driver_ops.h" |
| 86 | #include "hif.h" |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 87 | #include "pld_common.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 88 | #endif |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 89 | #include "wlan_hdd_lro.h" |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 90 | #include "cds_utils.h" |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 91 | #include "wlan_osif_request_manager.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 92 | #include "os_if_wifi_pos.h" |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 93 | #include <cdp_txrx_stats.h> |
| 94 | #include <cds_api.h> |
Dustin Brown | 6099ddc | 2018-07-06 14:32:53 -0700 | [diff] [blame] | 95 | #include "wlan_dsc_test.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 96 | #include <wlan_osif_priv.h> |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 97 | #include "wlan_hdd_regulatory.h" |
| 98 | #include "wlan_reg_ucfg_api.h" |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 99 | #include "wlan_hdd_packet_filter_api.h" |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 100 | #include "wlan_cp_stats_mc_ucfg_api.h" |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 101 | #include "wlan_mlme_ucfg_api.h" |
| 102 | #include "wlan_mlme_public_struct.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 103 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 104 | #define HDD_FINISH_ULA_TIME_OUT 800 |
| 105 | #define HDD_SET_MCBC_FILTERS_TO_FW 1 |
| 106 | #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0 |
| 107 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 108 | /* Private ioctls and their sub-ioctls */ |
| 109 | #define WLAN_PRIV_SET_INT_GET_NONE (SIOCIWFIRSTPRIV + 0) |
| 110 | #define WE_SET_11D_STATE 1 |
| 111 | #define WE_WOWL 2 |
| 112 | #define WE_SET_POWER 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 113 | /* |
| 114 | * <ioctl> |
| 115 | * setMaxAssoc - Sets the maximum number of associated stations |
| 116 | * |
| 117 | * @INPUT: 1 to 32 |
| 118 | * |
| 119 | * @OUTPUT: None |
| 120 | * |
| 121 | * This IOTCL sets the maximum number of associated stations |
| 122 | * |
| 123 | * @E.g: iwpriv wlan0 setMaxAssoc <value> |
| 124 | * |
| 125 | * Supported Feature: STA |
| 126 | * |
| 127 | * Usage: Internal/External |
| 128 | * |
| 129 | * </ioctl> |
| 130 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 131 | #define WE_SET_MAX_ASSOC 4 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 132 | /* |
| 133 | * <ioctl> |
Jeff Johnson | f2cf659 | 2018-05-06 16:27:44 -0700 | [diff] [blame] | 134 | * scan_disable - Disable scan |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 135 | * |
| 136 | * @INPUT: set_value |
| 137 | * |
| 138 | * @OUTPUT: None |
| 139 | * |
| 140 | * This IOCTL is used to set disable scan |
| 141 | * |
| 142 | * @E.g: iwpriv wlan0 scan_disable 1 |
| 143 | * |
| 144 | * Supported Feature: Scan |
| 145 | * |
| 146 | * Usage: Internal/External |
| 147 | * |
| 148 | * </ioctl> |
| 149 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 150 | #define WE_SET_SCAN_DISABLE 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 151 | /* |
| 152 | * <ioctl> |
| 153 | * inactivityTO - sets the timeout value for inactivity data while |
| 154 | * in power save mode |
| 155 | * |
| 156 | * @INPUT: int1…..int255 |
| 157 | * |
| 158 | * @OUTPUT: None |
| 159 | * |
| 160 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 161 | * |
| 162 | * @E.g: iwpriv wlan0 inactivityTO 20 |
| 163 | * |
| 164 | * Supported Feature: STA |
| 165 | * |
| 166 | * Usage: Internal/External |
| 167 | * |
| 168 | * </ioctl> |
| 169 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 170 | #define WE_SET_DATA_INACTIVITY_TO 6 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 171 | /* |
| 172 | * <ioctl> |
| 173 | * setMaxTxPower - Dynamically sets the maximum transmission power |
| 174 | * |
| 175 | * @INPUT: Transmission power in dBm |
| 176 | * |
| 177 | * @OUTPUT: None |
| 178 | * |
| 179 | * This IOCTL dynamically sets the maximum transmission power |
| 180 | * This setting does not persist over reboots |
| 181 | * |
| 182 | * @E.g: iwpriv wlan0 setMaxTxPower <value in db) |
| 183 | * |
| 184 | * Supported Feature: STA |
| 185 | * |
| 186 | * Usage: Internal/External |
| 187 | * |
| 188 | * </ioctl> |
| 189 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 190 | #define WE_SET_MAX_TX_POWER 7 |
Jeff Johnson | fab9b25 | 2017-10-28 15:44:34 -0700 | [diff] [blame] | 191 | /* 8 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 192 | #define WE_SET_TM_LEVEL 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 193 | /* |
| 194 | * <ioctl> |
| 195 | * setphymode - Set the phymode dynamically |
| 196 | * |
| 197 | * @INPUT: 0 IEEE80211_MODE_AUTO to 22 IEEE80211_MODE_11AGN |
| 198 | * |
| 199 | * @OUTPUT: None |
| 200 | * |
| 201 | * This IOCTL sets the phymode dynamically |
| 202 | * |
| 203 | * @E.g: iwpriv wlan0 setphymode 10 |
| 204 | * |
| 205 | * Supported Feature: STA |
| 206 | * |
| 207 | * Usage: Internal/External |
| 208 | * |
| 209 | * </ioctl> |
| 210 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 211 | #define WE_SET_PHYMODE 10 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 212 | /* |
| 213 | * <ioctl> |
| 214 | * nss - Set the number of spatial streams |
| 215 | * |
| 216 | * @INPUT: int1…..int3 |
| 217 | * |
| 218 | * @OUTPUT: None |
| 219 | * |
| 220 | * This IOCTL sets the number of spatial streams. Supported values are 1 and 2 |
| 221 | * |
| 222 | * @E.g: iwpriv wlan0 nss 2 |
| 223 | * |
| 224 | * Supported Feature: STA |
| 225 | * |
| 226 | * Usage: Internal/External |
| 227 | * |
| 228 | * </ioctl> |
| 229 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 230 | #define WE_SET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 231 | /* |
| 232 | * <ioctl> |
| 233 | * ldpc - Enables or disables LDPC |
| 234 | * |
| 235 | * @INPUT: 0 – Disable, 1 - Enable |
| 236 | * |
| 237 | * @OUTPUT: None |
| 238 | * |
| 239 | * This IOCTL enables or disables LDPC |
| 240 | * |
| 241 | * @E.g: iwpriv wlan0 ldpc 1 |
| 242 | * |
| 243 | * Supported Feature: STA |
| 244 | * |
| 245 | * Usage: Internal/External |
| 246 | * |
| 247 | * </ioctl> |
| 248 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 249 | #define WE_SET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 250 | /* |
| 251 | * <ioctl> |
| 252 | * tx_stbc - Enables or disables tx_stbc |
| 253 | * |
| 254 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 255 | * |
| 256 | * @OUTPUT: None |
| 257 | * |
| 258 | * This IOTCL used to enables or disables tx_stbc |
| 259 | * |
| 260 | * @E.g: iwpriv wlan0 tx_stbc <value> |
| 261 | * |
| 262 | * Supported Feature: STA |
| 263 | * |
| 264 | * Usage: Internal/External |
| 265 | * |
| 266 | * </ioctl> |
| 267 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 268 | #define WE_SET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 269 | /* |
| 270 | * <ioctl> |
| 271 | * rx_stbc - Set the rx_stbc parameter |
| 272 | * |
| 273 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 274 | * |
| 275 | * @OUTPUT: None |
| 276 | * |
| 277 | * This IOTCL used to set rx_stbc parameter |
| 278 | * |
| 279 | * @E.g: iwpriv wlan0 rx_stbc <value> |
| 280 | * |
| 281 | * Supported Feature: STA |
| 282 | * |
| 283 | * Usage: Internal/External |
| 284 | * |
| 285 | * </ioctl> |
| 286 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 287 | #define WE_SET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 288 | /* |
| 289 | * <ioctl> |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 290 | * shortgi - Sets the short-guard interval |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 291 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 292 | * @INPUT: Fixed Rate: 0 - 400ns, 1 - 800ns, 2 - 1600ns, 3 - 3200us |
| 293 | * Auto Rate: 8 - 400ns, 9 - 800ns, 10 - 1600ns, 11 - 3200us |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 294 | * |
| 295 | * @OUTPUT: None |
| 296 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 297 | * This IOCTL sets the short-guard interval. |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 298 | * |
| 299 | * @E.g: iwpriv wlan0 shortgi <value> |
| 300 | * |
| 301 | * Supported Feature: STA |
| 302 | * |
| 303 | * Usage: Internal/External |
| 304 | * |
| 305 | * </ioctl> |
| 306 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 307 | #define WE_SET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 308 | /* |
| 309 | * <ioctl> |
| 310 | * enablertscts - enables or disables rts/cts. |
| 311 | * |
| 312 | * @INPUT: 1-Enable , 0-Disable |
| 313 | * |
| 314 | * @OUTPUT: None |
| 315 | * |
| 316 | * This IOCTL enables or disables rts/cts. |
| 317 | * |
| 318 | * @E.g: iwpriv wlan0 enablertscts <value> |
| 319 | * |
| 320 | * Supported Feature: STA |
| 321 | * |
| 322 | * Usage: Internal/External |
| 323 | * |
| 324 | * </ioctl> |
| 325 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 326 | #define WE_SET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 327 | /* |
| 328 | * <ioctl> |
| 329 | * chwidth - Set the channel bandwidth |
| 330 | * |
| 331 | * @INPUT: 0-20mhz to 3-160mhz |
| 332 | * |
| 333 | * @OUTPUT: None |
| 334 | * |
| 335 | * This IOTCL used to set the channel bandwidth |
| 336 | * |
| 337 | * @E.g: iwpriv wlan0 chwidth 1 |
| 338 | * |
| 339 | * Supported Feature: STA |
| 340 | * |
| 341 | * Usage: Internal/External |
| 342 | * |
| 343 | * </ioctl> |
| 344 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 345 | #define WE_SET_CHWIDTH 17 |
| 346 | #define WE_SET_ANI_EN_DIS 18 |
| 347 | #define WE_SET_ANI_POLL_PERIOD 19 |
| 348 | #define WE_SET_ANI_LISTEN_PERIOD 20 |
| 349 | #define WE_SET_ANI_OFDM_LEVEL 21 |
| 350 | #define WE_SET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 351 | /* |
| 352 | * <ioctl> |
| 353 | * cwmenable - Enables or disables the dynamic channel bandwidth |
| 354 | * |
| 355 | * @INPUT: 0-Disable, 1-Enable |
| 356 | * |
| 357 | * @OUTPUT: None |
| 358 | * |
| 359 | * This IOTCL used to enables or disables the dynamic channel bandwidth |
| 360 | * |
| 361 | * @E.g: iwpriv wlan0 cwmenable <value> |
| 362 | * |
| 363 | * Supported Feature: STA |
| 364 | * |
| 365 | * Usage: Internal/External |
| 366 | * |
| 367 | * </ioctl> |
| 368 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 369 | #define WE_SET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 370 | /* |
| 371 | * <ioctl> |
| 372 | * txchainmask - This IOCTL sets the current Tx chain mask |
| 373 | * |
| 374 | * @INPUT: Mask Value |
| 375 | * |
| 376 | * @OUTPUT: None |
| 377 | * |
| 378 | * This IOCTL sets the current Tx chain mask |
| 379 | * |
| 380 | * @E.g: iwpriv wlan0 txchainmask 1 |
| 381 | * |
| 382 | * Supported Feature: STA |
| 383 | * |
| 384 | * Usage: Internal/External |
| 385 | * |
| 386 | * </ioctl> |
| 387 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 388 | #define WE_SET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 389 | /* |
| 390 | * <ioctl> |
| 391 | * rxchainmask - Sets the current Rx chain mask |
| 392 | * |
| 393 | * @INPUT: Mask Value |
| 394 | * |
| 395 | * @OUTPUT: None |
| 396 | * |
| 397 | * This IOCTL sets the current Rx chain mask. This command is the |
| 398 | * equivalent to setting in gSetRxChainmask1x1 in WCNSS_qcom_cfg.ini. |
| 399 | * |
| 400 | * @E.g: iwpriv wlan0 rxchainmask <value> |
| 401 | * |
| 402 | * Supported Feature: STA |
| 403 | * |
| 404 | * Usage: Internal/External |
| 405 | * |
| 406 | * </ioctl> |
| 407 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | #define WE_SET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 409 | /* |
| 410 | * <ioctl> |
| 411 | * set11NRates - Fixes the Tx data rate of the 11N mode. |
| 412 | * |
| 413 | * @INPUT: 0x1b to 0x8f |
| 414 | * |
| 415 | * @OUTPUT: None |
| 416 | * |
| 417 | * This IOCTL fixes the Tx data rate of the 11N mode. |
| 418 | * |
| 419 | * @E.g: iwpriv wlan0 set11NRates 0x85 |
| 420 | * |
| 421 | * Supported Feature: STA |
| 422 | * |
| 423 | * Usage: Internal/External |
| 424 | * |
| 425 | * </ioctl> |
| 426 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 427 | #define WE_SET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 428 | /* |
| 429 | * <ioctl> |
| 430 | * ampdu - Set the the maximum subframe of ampdu |
| 431 | * |
| 432 | * @INPUT: int 1 to int 63 |
| 433 | * |
| 434 | * @OUTPUT: None |
| 435 | * |
| 436 | * This IOCTL sets the maximum subframe of ampdu. |
| 437 | * |
| 438 | * @E.g: iwpriv wlan0 ampdu 9 |
| 439 | * |
| 440 | * Supported Feature: STA |
| 441 | * |
| 442 | * Usage: Internal/External |
| 443 | * |
| 444 | * </ioctl> |
| 445 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 446 | #define WE_SET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 447 | /* |
| 448 | * <ioctl> |
| 449 | * amsdu - Sets the maximum subframe of amsdu. |
| 450 | * |
| 451 | * @INPUT: int 1 to int 31 |
| 452 | * |
| 453 | * @OUTPUT: None |
| 454 | * |
| 455 | * This IOCTL sets the maximum subframe of amsdu. |
| 456 | * |
| 457 | * @E.g: iwpriv wlan0 amsdu 9 |
| 458 | * |
| 459 | * Supported Feature: STA |
| 460 | * |
| 461 | * Usage: Internal/External |
| 462 | * |
| 463 | * </ioctl> |
| 464 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 465 | #define WE_SET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 466 | /* |
| 467 | * <ioctl> |
| 468 | * txpow2g - current 2 GHz Tx power setting |
| 469 | * |
| 470 | * @INPUT: Tx power in dBm |
| 471 | * |
| 472 | * @OUTPUT: None |
| 473 | * |
| 474 | * This IOTCL used to set 2 ghz tx power |
| 475 | * |
| 476 | * @E.g: iwpriv wlan0 txpow2g |
| 477 | * |
| 478 | * Supported Feature: STA |
| 479 | * |
| 480 | * Usage: Internal/External |
| 481 | * |
| 482 | * </ioctl> |
| 483 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 484 | #define WE_SET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 485 | /* |
| 486 | * <ioctl> |
| 487 | * txpow5g - Current 5 GHz tx power setting |
| 488 | * |
| 489 | * @INPUT: Tx power in dBm |
| 490 | * |
| 491 | * @OUTPUT: None |
| 492 | * |
| 493 | * This IOTCL used to set the 5 ghz txpower |
| 494 | * |
| 495 | * @E.g: iwpriv wlan0 txpow5g |
| 496 | * |
| 497 | * Supported Feature: STA |
| 498 | * |
| 499 | * Usage: Internal/External |
| 500 | * |
| 501 | * </ioctl> |
| 502 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 503 | #define WE_SET_TXPOW_5G 30 |
| 504 | /* Private ioctl for firmware debug log */ |
| 505 | #define WE_DBGLOG_LOG_LEVEL 31 |
| 506 | #define WE_DBGLOG_VAP_ENABLE 32 |
| 507 | #define WE_DBGLOG_VAP_DISABLE 33 |
| 508 | #define WE_DBGLOG_MODULE_ENABLE 34 |
| 509 | #define WE_DBGLOG_MODULE_DISABLE 35 |
| 510 | #define WE_DBGLOG_MOD_LOG_LEVEL 36 |
| 511 | #define WE_DBGLOG_TYPE 37 |
| 512 | #define WE_SET_TXRX_FWSTATS 38 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 513 | /* |
| 514 | * <ioctl> |
| 515 | * set11ACRates - Fixes the Tx data rate of 11AC |
| 516 | * |
| 517 | * @INPUT: 0x1 to 0x9 |
| 518 | * |
| 519 | * @OUTPUT: None |
| 520 | * |
| 521 | * This IOCTL fixes the Tx data rate of 11AC. |
| 522 | * |
| 523 | * @E.g: iwpriv wlan0 set11ACRates 0x9 |
| 524 | * |
| 525 | * Supported Feature: STA |
| 526 | * |
| 527 | * Usage: Internal/External |
| 528 | * |
| 529 | * </ioctl> |
| 530 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 531 | #define WE_SET_VHT_RATE 39 |
| 532 | #define WE_DBGLOG_REPORT_ENABLE 40 |
| 533 | #define WE_TXRX_FWSTATS_RESET 41 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 534 | /* |
| 535 | * <ioctl> |
| 536 | * setTxMaxPower2G - Set the maximum transmit power for the 2.4-GHz band |
| 537 | * |
| 538 | * @INPUT: Transmission power in dBm |
| 539 | * |
| 540 | * @OUTPUT: None |
| 541 | * |
| 542 | * This IOCTL sets the maximum transmit power for the 2.4-GHz band |
| 543 | * This setting does not persist over reboots |
| 544 | * |
| 545 | * @E.g: iwpriv wlan0 setTxMaxPower2G 10 |
| 546 | * |
| 547 | * Supported Feature: STA |
| 548 | * |
| 549 | * Usage: Internal/External |
| 550 | * |
| 551 | * </ioctl> |
| 552 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 553 | #define WE_SET_MAX_TX_POWER_2_4 42 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 554 | /* |
| 555 | * <ioctl> |
| 556 | * setTxMaxPower5G - Set the maximum transmit power for the 5-GHz band |
| 557 | * |
| 558 | * @INPUT: Transmission power in dBm |
| 559 | * |
| 560 | * @OUTPUT: None |
| 561 | * |
| 562 | * This IOCTL sets the maximum transmit power for the 5-GHz band |
| 563 | * This setting does not persist over reboots |
| 564 | * |
| 565 | * @E.g: iwpriv wlan0 setTxMaxPower5G 10 |
| 566 | * |
| 567 | * Supported Feature: STA |
| 568 | * |
| 569 | * Usage: Internal/External |
| 570 | * |
| 571 | * </ioctl> |
| 572 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 573 | #define WE_SET_MAX_TX_POWER_5_0 43 |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 574 | #define WE_SET_PKTLOG 44 |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 575 | /* Private ioctl for packet power save */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 576 | #define WE_PPS_PAID_MATCH 45 |
| 577 | #define WE_PPS_GID_MATCH 46 |
| 578 | #define WE_PPS_EARLY_TIM_CLEAR 47 |
| 579 | #define WE_PPS_EARLY_DTIM_CLEAR 48 |
| 580 | #define WE_PPS_EOF_PAD_DELIM 49 |
| 581 | #define WE_PPS_MACADDR_MISMATCH 50 |
| 582 | #define WE_PPS_DELIM_CRC_FAIL 51 |
| 583 | #define WE_PPS_GID_NSTS_ZERO 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 584 | /* |
| 585 | * <ioctl> |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 586 | * rssi_chk - Check the rssi |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 587 | * |
| 588 | * @INPUT: One argument as input |
| 589 | * |
| 590 | * @OUTPUT: rssi |
| 591 | * wlan0 rssi_chk:56 |
| 592 | * |
| 593 | * This IOTCL used to chek rssi |
| 594 | * |
| 595 | * @E.g: iwpriv wlan0 rssi_chk <value> |
| 596 | * |
| 597 | * Supported Feature: STA |
| 598 | * |
| 599 | * Usage: Internal/External |
| 600 | * |
| 601 | * </ioctl> |
| 602 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 603 | #define WE_PPS_RSSI_CHECK 53 |
Agrawal Ashish | bafaff1 | 2016-12-27 17:43:08 +0530 | [diff] [blame] | 604 | /* |
| 605 | * <ioctl> |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 606 | * htsmps - Sets the htsmps |
| 607 | * |
| 608 | * @INPUT: Atleast one int argument |
| 609 | * |
| 610 | * @OUTPUT: None |
| 611 | * |
| 612 | * This IOTCL used to set htsmps |
| 613 | * |
| 614 | * @E.g: iwpriv wlan0 htsmps <value> |
| 615 | * |
| 616 | * Supported Feature: STA |
| 617 | * |
| 618 | * Usage: Internal/External |
| 619 | * |
| 620 | * </ioctl> |
| 621 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 622 | #define WE_SET_HTSMPS 55 |
| 623 | /* Private ioctl for QPower */ |
| 624 | #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 |
| 625 | #define WE_SET_QPOWER_MAX_TX_BEFORE_WAKE 57 |
| 626 | #define WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 58 |
| 627 | #define WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 628 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 629 | /* |
| 630 | * <ioctl> |
| 631 | * gtxHTMcs - Set the tx HTM value |
| 632 | * |
| 633 | * @INPUT: Atleast one int orgument |
| 634 | * |
| 635 | * @OUTPUT: None |
| 636 | * |
| 637 | * This IOTCL sets htm tx value |
| 638 | * |
| 639 | * @E.g: iwpriv wlan0 gtxHTMcs <value> |
| 640 | * |
| 641 | * Supported Feature: STA |
| 642 | * |
| 643 | * Usage: Internal/External |
| 644 | * |
| 645 | * </ioctl> |
| 646 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 647 | #define WE_SET_GTX_HT_MCS 62 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 648 | /* |
| 649 | * <ioctl> |
| 650 | * gtxVHTMcs - Set gtxVHTMcs value |
| 651 | * |
| 652 | * @INPUT: Atleast one int argument |
| 653 | * |
| 654 | * @OUTPUT: None |
| 655 | * |
| 656 | * This IOTCL used to set gtxVHTMcs value |
| 657 | * |
| 658 | * @E.g: iwpriv wlan0 gtxVHTMcs <value> |
| 659 | * |
| 660 | * Supported Feature: STA |
| 661 | * |
| 662 | * Usage: Internal/External |
| 663 | * |
| 664 | * </ioctl> |
| 665 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 666 | #define WE_SET_GTX_VHT_MCS 63 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 667 | /* |
| 668 | * <ioctl> |
| 669 | * gtxUsrCfg - Host request for GTX mask |
| 670 | * |
| 671 | * @INPUT: Atleast one int orgument |
| 672 | * |
| 673 | * @OUTPUT: None |
| 674 | * |
| 675 | * This IOTCL used send the host request for GTX mask |
| 676 | * |
| 677 | * @E.g: iwpriv wlan0 gtxUsrCfg <value> |
| 678 | * |
| 679 | * Supported Feature: STA |
| 680 | * |
| 681 | * Usage: Internal/External |
| 682 | * |
| 683 | * </ioctl> |
| 684 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 685 | #define WE_SET_GTX_USRCFG 64 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 686 | /* |
| 687 | * <ioctl> |
| 688 | * gtxThre - Set the tx threshold |
| 689 | * |
| 690 | * @INPUT: Atleast one int argument |
| 691 | * |
| 692 | * @OUTPUT: None |
| 693 | * |
| 694 | * This IOTCL used to set tx threshold |
| 695 | * |
| 696 | * @E.g: iwpriv wlan0 gtxThre <value> |
| 697 | * |
| 698 | * Supported Feature: STA |
| 699 | * |
| 700 | * Usage: Internal/External |
| 701 | * |
| 702 | * </ioctl> |
| 703 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 704 | #define WE_SET_GTX_THRE 65 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 705 | /* |
| 706 | * <ioctl> |
| 707 | * gtxMargin - Set the gtxMargin |
| 708 | * |
| 709 | * @INPUT: 1 to 32 |
| 710 | * |
| 711 | * @OUTPUT: None |
| 712 | * |
| 713 | * This IOTCL use dto set gtxMargin |
| 714 | * |
| 715 | * @E.g: iwpriv wlan0 gtxMargini <value> |
| 716 | * |
| 717 | * Supported Feature: STA |
| 718 | * |
| 719 | * Usage: Internal/External |
| 720 | * |
| 721 | * </ioctl> |
| 722 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 723 | #define WE_SET_GTX_MARGIN 66 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 724 | /* |
| 725 | * <ioctl> |
| 726 | * gtxStep - Set the gtxStep |
| 727 | * |
| 728 | * @INPUT: None |
| 729 | * |
| 730 | * @OUTPUT: None |
| 731 | * |
| 732 | * This IOTCL used to sets gtxStep |
| 733 | * |
| 734 | * @E.g: iwpriv wlan0 gtxStep <value> |
| 735 | * |
| 736 | * Supported Feature: STA |
| 737 | * |
| 738 | * Usage: Internal/External |
| 739 | * |
| 740 | * </ioctl> |
| 741 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 742 | #define WE_SET_GTX_STEP 67 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 743 | /* |
| 744 | * <ioctl> |
| 745 | * gtxMinTpc - Sets the gtxMinTpc |
| 746 | * |
| 747 | * @INPUT: Atleast one int argument |
| 748 | * |
| 749 | * @OUTPUT: None |
| 750 | * |
| 751 | * This IOTCL sets the tx MinTpc |
| 752 | * |
| 753 | * @E.g: iwpriv wlan0 gtxMinTpc <value> |
| 754 | * |
| 755 | * Supported Feature: STA |
| 756 | * |
| 757 | * Usage: Internal/External |
| 758 | * |
| 759 | * </ioctl> |
| 760 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 761 | #define WE_SET_GTX_MINTPC 68 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 762 | /* |
| 763 | * <ioctl> |
| 764 | * gtxBWMask - Sets the BW mask (20/40/80/160 Mhz) |
| 765 | * |
| 766 | * @INPUT: Mask value |
| 767 | * |
| 768 | * @OUTPUT: None |
| 769 | * |
| 770 | * This IOTCL used to set gtxBWMask |
| 771 | * |
| 772 | * @E.g: iwpriv wlan0 gtxBWMask <value> |
| 773 | * |
| 774 | * Supported Feature: STA |
| 775 | * |
| 776 | * Usage: Internal/External |
| 777 | * |
| 778 | * </ioctl> |
| 779 | */ |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 780 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 781 | #define WE_SET_GTX_BWMASK 69 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 782 | /* |
| 783 | * <ioctl> |
| 784 | * setMccLatency - Sets the MCC latency value during STA-P2P concurrency |
| 785 | * |
| 786 | * @INPUT: set_value |
| 787 | * |
| 788 | * @OUTPUT: None |
| 789 | * |
| 790 | * This IOCTL is used to set the MCC latency value in milliseconds |
| 791 | * during STA-P2P concurrency. |
| 792 | * |
| 793 | * If 0ms latency is provided, then FW will set to a default. |
| 794 | * Otherwise, latency must be at least 30ms. |
| 795 | * |
| 796 | * @E.g: iwpriv wlan0 setMccLatency 40 |
| 797 | * |
| 798 | * |
| 799 | * Supported Feature: Concurrency |
| 800 | * |
| 801 | * Usage: Internal/External |
| 802 | * |
| 803 | * </ioctl> |
| 804 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 805 | #define WE_MCC_CONFIG_LATENCY 70 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 806 | |
| 807 | /* |
| 808 | * <ioctl> |
| 809 | * setMccQuota- Set the quota for P2P cases |
| 810 | * |
| 811 | * @INPUT: set_value [0,100] |
| 812 | * |
| 813 | * @OUTPUT: None |
| 814 | * |
| 815 | * This IOCTL is used to set the quota in milliseconds for P2P_GO/STA. |
| 816 | * |
| 817 | * Currently used to set time quota for 2 MCC vdevs/adapters using |
| 818 | * (operating channel, quota) for each mode. |
| 819 | * The info is provided run time using iwpriv command: |
| 820 | * iwpriv <wlan0 | p2p0> setMccQuota <quota in ms>. |
| 821 | * Note: the quota provided in command is for the same mode in cmd. |
| 822 | * HDD checks if MCC mode is active, gets the second mode and its |
| 823 | * operating chan. |
| 824 | * Quota for the 2nd role is calculated as 100 - quota of first mode. |
| 825 | * |
| 826 | * @E.g: iwpriv wlan0 setMccQuota 50 |
| 827 | * iwpriv p2p0 setMccQuota 50 |
| 828 | * |
| 829 | * Supported Feature: Concurrency |
| 830 | * |
| 831 | * Usage: Internal/External |
| 832 | * |
| 833 | * </ioctl> |
| 834 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 835 | #define WE_MCC_CONFIG_QUOTA 71 |
| 836 | /* Private IOCTL for debug connection issues */ |
| 837 | #define WE_SET_DEBUG_LOG 72 |
| 838 | #ifdef WE_SET_TX_POWER |
| 839 | #undef WE_SET_TX_POWER |
| 840 | #endif |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 841 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 842 | /* |
| 843 | * <ioctl> |
| 844 | * setTxPower - Set the current transmit power |
| 845 | * |
| 846 | * @INPUT: Transmission power in dBm |
| 847 | * |
| 848 | * @OUTPUT: None |
| 849 | * |
| 850 | * This IOCTL sets the current transmit power. |
| 851 | * This setting does not persist over reboots. |
| 852 | * |
| 853 | * @E.g: iwpriv wlan0 setTxPower 10 |
| 854 | * |
| 855 | * Supported Feature: STA |
| 856 | * |
| 857 | * Usage: Internal/External |
| 858 | * |
| 859 | * </ioctl> |
| 860 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 861 | #define WE_SET_TX_POWER 74 |
| 862 | /* Private ioctl for earlyrx power save feature */ |
| 863 | #define WE_SET_EARLY_RX_ADJUST_ENABLE 75 |
| 864 | #define WE_SET_EARLY_RX_TGT_BMISS_NUM 76 |
| 865 | #define WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE 77 |
| 866 | #define WE_SET_EARLY_RX_SLOP_STEP 78 |
| 867 | #define WE_SET_EARLY_RX_INIT_SLOP 79 |
| 868 | #define WE_SET_EARLY_RX_ADJUST_PAUSE 80 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 869 | /* |
| 870 | * <ioctl> |
| 871 | * setMcRate - Set the data rate for multicast data |
| 872 | * |
| 873 | * @INPUT: 1 to 32 |
| 874 | * |
| 875 | * @OUTPUT: None |
| 876 | * |
| 877 | * This IOCTL sets the data rate for multicast data. Note that this command |
| 878 | * is allowed only in STA, IBSS, or QCMobileAP mode |
| 879 | * |
| 880 | * @E.g: iwpriv wlan0 setMcRate <value> |
| 881 | * |
| 882 | * Supported Feature: STA |
| 883 | * |
| 884 | * Usage: Internal/External |
| 885 | * |
| 886 | * </ioctl> |
| 887 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 888 | #define WE_SET_MC_RATE 81 |
| 889 | #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 |
| 890 | /* Private ioctl for packet power save */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 891 | /* |
| 892 | * <ioctl> |
| 893 | * 5g_ebt - Sets the 5g_ebt |
| 894 | * |
| 895 | * @INPUT: <value> |
| 896 | * |
| 897 | * @OUTPUT: None |
| 898 | * |
| 899 | * This IOTCL used to set 5g_ebt |
| 900 | * |
| 901 | * @E.g: iwpriv wlan0 5g_ebt <value> |
| 902 | * |
| 903 | * Supported Feature: STA |
| 904 | * |
| 905 | * Usage: Internal/External |
| 906 | * |
| 907 | * </ioctl> |
| 908 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 909 | #define WE_PPS_5G_EBT 83 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 910 | /* |
| 911 | * <ioctl> |
| 912 | * cts_cbw - Set CTS channel BW for dynamic BW adjustment |
| 913 | * |
| 914 | * @INPUT: 20 t0 160 |
| 915 | * |
| 916 | * @OUTPUT: None |
| 917 | * |
| 918 | * This IOTCL used to set CTS channel BW for dynamic BW adjustment |
| 919 | * |
| 920 | * @E.g: iwpriv wlan0 cts_cbw <value> |
| 921 | * |
| 922 | * Supported Feature: STA |
| 923 | * |
| 924 | * Usage: Internal/External |
| 925 | * |
| 926 | * </ioctl> |
| 927 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 928 | #define WE_SET_CTS_CBW 84 |
| 929 | #define WE_DUMP_STATS 85 |
| 930 | #define WE_CLEAR_STATS 86 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 931 | /* Private sub ioctl for starting/stopping the profiling */ |
| 932 | #define WE_START_FW_PROFILE 87 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 933 | |
Abhishek Singh | 3c50701 | 2016-12-01 11:15:42 +0530 | [diff] [blame] | 934 | /* |
| 935 | * <ioctl> |
| 936 | * setChanChange - Initiate channel change |
| 937 | * |
| 938 | * @INPUT: channel number to switch to. |
| 939 | * |
| 940 | * @OUTPUT: None |
| 941 | * |
| 942 | * This IOCTL is used to initiate a channel change. |
| 943 | * If called on STA/CLI interface it will send the |
| 944 | * ECSA action frame to the connected SAP/GO asking to |
| 945 | * initiate the ECSA, if supported. |
| 946 | * If called on SAP/GO interface it will initiate |
| 947 | * ECSA and ask connected peers to move to new channel. |
| 948 | * |
| 949 | * @E.g: iwpriv wlan0 setChanChange <channel> |
| 950 | * iwpriv wlan0 setChanChange 1 |
| 951 | * |
| 952 | * Supported Feature: ECSA |
| 953 | * |
| 954 | * Usage: Internal/External |
| 955 | * |
| 956 | * </ioctl> |
| 957 | */ |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 958 | #define WE_SET_CHANNEL 88 |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 959 | #define WE_SET_CONC_SYSTEM_PREF 89 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 960 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 961 | /* |
| 962 | * <ioctl> |
| 963 | * set_11ax_rate - set 11ax rates to FW |
| 964 | * |
| 965 | * @INPUT: rate code |
| 966 | * |
| 967 | * @OUTPUT: None |
| 968 | * |
| 969 | * This IOCTL fixes the Tx data rate of 11AX. |
| 970 | * |
| 971 | * @E.g: iwpriv wlan0 set_11ax_rate <rate code> |
| 972 | * |
| 973 | * Supported Feature: STA/SAP |
| 974 | * |
| 975 | * Usage: Internal |
| 976 | * |
| 977 | * </ioctl> |
| 978 | */ |
| 979 | #define WE_SET_11AX_RATE 91 |
| 980 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 981 | /* |
| 982 | * <ioctl> |
| 983 | * enable_dcm - enable Dual Carrier Modulation(DCM) |
| 984 | * |
| 985 | * @INPUT: 0/1 |
| 986 | * |
| 987 | * @OUTPUT: None |
| 988 | * |
| 989 | * This IOCTL enables/disables DCM. |
| 990 | * |
| 991 | * @E.g: iwpriv wlan0 enable_dcm <0/1> |
| 992 | * |
| 993 | * Supported Feature: STA/SAP |
| 994 | * |
| 995 | * Usage: Internal |
| 996 | * |
| 997 | * </ioctl> |
| 998 | */ |
| 999 | #define WE_SET_DCM 92 |
| 1000 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1001 | /* |
| 1002 | * <ioctl> |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1003 | * range_ext - enable Range extension |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1004 | * |
| 1005 | * @INPUT: 0/1 |
| 1006 | * |
| 1007 | * @OUTPUT: None |
| 1008 | * |
| 1009 | * This IOCTL enables/disables Range extension. |
| 1010 | * |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1011 | * @E.g: iwpriv wlan0 range_ext <1/0> |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1012 | * |
| 1013 | * Supported Feature: STA/SAP |
| 1014 | * |
| 1015 | * Usage: Internal |
| 1016 | * |
| 1017 | * </ioctl> |
| 1018 | */ |
| 1019 | #define WE_SET_RANGE_EXT 93 |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1020 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1021 | /* |
| 1022 | * <ioctl> |
| 1023 | * wow_ito - sets the timeout value for inactivity data while |
| 1024 | * in power save mode during wow |
| 1025 | * |
| 1026 | * @INPUT: int |
| 1027 | * |
| 1028 | * @OUTPUT: None |
| 1029 | * |
| 1030 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 1031 | * |
| 1032 | * @E.g: iwpriv wlan0 wow_ito 20 |
| 1033 | * |
| 1034 | * Supported Feature: STA |
| 1035 | * |
| 1036 | * Usage: External |
| 1037 | * |
| 1038 | * </ioctl> |
Jeff Johnson | dcf84ce | 2017-10-05 09:26:24 -0700 | [diff] [blame] | 1039 | */ |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1040 | #define WE_SET_WOW_DATA_INACTIVITY_TO 94 |
| 1041 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 1042 | /* |
| 1043 | * <ioctl> |
| 1044 | * pdev_reset - reset the pdev |
| 1045 | * |
| 1046 | * @INPUT: Reset command to initiate: |
| 1047 | * TX_FLUSH = 1 |
| 1048 | * WARM_RESET = 2 |
| 1049 | * COLD_RESET = 3 |
| 1050 | * WARM_RESET_RESTORE_CAL = 4 |
| 1051 | * COLD_RESET_RESTORE_CAL = 5 |
| 1052 | * |
| 1053 | * @OUTPUT: None |
| 1054 | * |
| 1055 | * This IOCTL is used to reset the pdev. The primary use is |
| 1056 | * for internal testing. It is not expected that this will |
| 1057 | * be used on a production device. |
| 1058 | * |
| 1059 | * @E.g: iwpriv wlan0 pdev_reset <command> |
| 1060 | * iwpriv wlan0 pdev_reset 1 |
| 1061 | * |
| 1062 | * Supported Feature: None |
| 1063 | * |
| 1064 | * Usage: Internal |
| 1065 | * |
| 1066 | * </ioctl> |
| 1067 | */ |
| 1068 | #define WE_SET_PDEV_RESET 95 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1069 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1070 | /* |
| 1071 | * setModDTIM - Change Modulated DTIM |
| 1072 | * |
| 1073 | * @INPUT: set_value. |
| 1074 | * |
| 1075 | * @OUTPUT: None |
| 1076 | * |
| 1077 | * This IOCTL is used to change modulated DTIM |
| 1078 | * value without WIFI OFF/ON. |
| 1079 | * |
| 1080 | * @E.g: iwpriv wlan0 setModDTIM <value> |
| 1081 | * iwpriv wlan0 setModDTIM 2 |
| 1082 | * |
| 1083 | * Supported Feature: N/A |
| 1084 | * |
| 1085 | * Usage: Internal/External |
| 1086 | * |
| 1087 | * </ioctl> |
| 1088 | */ |
| 1089 | #define WE_SET_MODULATED_DTIM 96 |
| 1090 | |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 1091 | /* |
| 1092 | * <ioctl> |
| 1093 | * set_ppdu_dur - Sets the global ppdu duration |
| 1094 | * |
| 1095 | * @INPUT: Atleast one int argument |
| 1096 | * |
| 1097 | * @OUTPUT: None |
| 1098 | * |
| 1099 | * This IOTCL used to set global ppdu duration |
| 1100 | * |
| 1101 | * @E.g: iwpriv wlan0 set_ppdu_dur <value> |
| 1102 | * Valid values are 1 to 4000 |
| 1103 | * |
| 1104 | * Supported Feature: STA/SAP |
| 1105 | * |
| 1106 | * Usage: Internal |
| 1107 | * |
| 1108 | * </ioctl> |
| 1109 | */ |
| 1110 | #define WE_SET_PPDU_DUR 97 |
| 1111 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1112 | /* Private ioctls and their sub-ioctls */ |
| 1113 | #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) |
| 1114 | #define WE_GET_11D_STATE 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1115 | #define WE_GET_WLAN_DBG 4 |
| 1116 | #define WE_GET_MAX_ASSOC 6 |
| 1117 | /* 7 is unused */ |
| 1118 | #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 1119 | |
| 1120 | /* |
| 1121 | * <ioctl> |
| 1122 | * getconcurrency - Get concurrency mode |
| 1123 | * |
| 1124 | * @INPUT: None |
| 1125 | * |
| 1126 | * @OUTPUT: It shows concurrency value |
| 1127 | * Bit 0:STA 1:SAP 2:P2P_Client 3:P2P_GO |
| 1128 | * 4:FTM 5:IBSS 6:Monitor 7:P2P_Device |
| 1129 | * 8:OCB 9:EPPING 10:QVIT 11:NDI |
| 1130 | * |
| 1131 | * This IOCTL is used to retrieve concurrency mode. |
| 1132 | * |
| 1133 | * @E.g: iwpriv wlan0 getconcurrency |
| 1134 | * wlan0 getconcurrency:5 |
| 1135 | * Above value shows STA+P2P_Client |
| 1136 | * |
| 1137 | * Supported Feature: Concurrency |
| 1138 | * |
| 1139 | * Usage: Internal/External |
| 1140 | * |
| 1141 | * </ioctl> |
| 1142 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1143 | #define WE_GET_CONCURRENCY_MODE 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1144 | /* |
| 1145 | * <ioctl> |
| 1146 | * get_nss - Get the number of spatial STBC streams (NSS) |
| 1147 | * |
| 1148 | * @INPUT: None |
| 1149 | * |
| 1150 | * @OUTPUT: NSS |
| 1151 | * wlan0 get_nss:2 |
| 1152 | * |
| 1153 | * This IOTCL used to get the number of spatial STBC streams |
| 1154 | * |
| 1155 | * @E.g: iwpriv wlan0 get_nss |
| 1156 | * |
| 1157 | * Supported Feature: STA |
| 1158 | * |
| 1159 | * Usage: Internal/External |
| 1160 | * |
| 1161 | * </ioctl> |
| 1162 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1163 | #define WE_GET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1164 | /* |
| 1165 | * <ioctl> |
| 1166 | * get_ldpc - This IOCTL gets the low density parity check (LDPC) |
| 1167 | * |
| 1168 | * @INPUT: None |
| 1169 | * |
| 1170 | * @OUTPUT: ldpc |
| 1171 | * wlan0 get_ldpc:1 |
| 1172 | * |
| 1173 | * This IOTCL used to gets the low density parity check (LDPC) |
| 1174 | * |
| 1175 | * @E.g: iwpriv wlan0 get_ldpc |
| 1176 | * |
| 1177 | * Supported Feature: STA |
| 1178 | * |
| 1179 | * Usage: Internal/External |
| 1180 | * |
| 1181 | * </ioctl> |
| 1182 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1183 | #define WE_GET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1184 | /* |
| 1185 | * <ioctl> |
| 1186 | * get_tx_stbc - Get the value of the current Tx space time block code (STBC) |
| 1187 | * |
| 1188 | * @INPUT: None |
| 1189 | * |
| 1190 | * @OUTPUT: TXSTBC |
| 1191 | * wlan0 get_tx_stbc:1 |
| 1192 | * |
| 1193 | * This IOTCL get the value of the current Tx space time block code (STBC) |
| 1194 | * |
| 1195 | * @E.g: iwpriv wlan0 get_tx_stbc |
| 1196 | * |
| 1197 | * Supported Feature: STA |
| 1198 | * |
| 1199 | * Usage: Internal/External |
| 1200 | * |
| 1201 | * </ioctl> |
| 1202 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1203 | #define WE_GET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1204 | /* |
| 1205 | * <ioctl> |
| 1206 | * get_rx_stbc - Gets the value of the current Rx STBC |
| 1207 | * |
| 1208 | * @INPUT: None |
| 1209 | * |
| 1210 | * @OUTPUT: Rx STBC |
| 1211 | * wlan0 get_rx_stbc:1 |
| 1212 | * |
| 1213 | * This IOTCL used to get the value of the current Rx STBC |
| 1214 | * |
| 1215 | * @E.g: iwpriv wlan0 get_rx_stbc |
| 1216 | * |
| 1217 | * Supported Feature: STA |
| 1218 | * |
| 1219 | * Usage: Internal/External |
| 1220 | * |
| 1221 | * </ioctl> |
| 1222 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1223 | #define WE_GET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1224 | /* |
| 1225 | * <ioctl> |
| 1226 | * get_shortgi - Get the value of the current short GI setting |
| 1227 | * |
| 1228 | * @INPUT: None |
| 1229 | * |
| 1230 | * @OUTPUT: Enable/disable of shortgi |
| 1231 | * wlan0 get_shortgi:1 |
| 1232 | * |
| 1233 | * This IOCTL gets the value of the current short GI setting |
| 1234 | * |
| 1235 | * @E.g: iwpriv wlan0 get_shortgi |
| 1236 | * |
| 1237 | * Supported Feature: STA |
| 1238 | * |
| 1239 | * Usage: Internal/External |
| 1240 | * |
| 1241 | * </ioctl> |
| 1242 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1243 | #define WE_GET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1244 | /* |
| 1245 | * <ioctl> |
| 1246 | * get_rtscts - Get the value of the current RTS/CTS setting. |
| 1247 | * |
| 1248 | * @INPUT: None |
| 1249 | * |
| 1250 | * @OUTPUT: Enable/disable of RTS/CTS |
| 1251 | * wlan0 get_rtscts:33 |
| 1252 | * |
| 1253 | * This IOTCL get the value of the current RTS/CTS setting. |
| 1254 | * |
| 1255 | * @E.g: iwpriv wlan0 get_rtscts |
| 1256 | * |
| 1257 | * Supported Feature: STA |
| 1258 | * |
| 1259 | * Usage: Internal/External |
| 1260 | * |
| 1261 | * </ioctl> |
| 1262 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1263 | #define WE_GET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1264 | /* |
| 1265 | * <ioctl> |
| 1266 | * get_chwidth - Get the current channel width setting |
| 1267 | * |
| 1268 | * @INPUT: None |
| 1269 | * |
| 1270 | * @OUTPUT: channel width |
| 1271 | * wlan0 get_chwidth:0 |
| 1272 | * |
| 1273 | * This IOTCL get the current channel width setting. |
| 1274 | * |
| 1275 | * @E.g: iwpriv wlan0 get_chwidth |
| 1276 | * |
| 1277 | * Supported Feature: STA |
| 1278 | * |
| 1279 | * Usage: Internal/External |
| 1280 | * |
| 1281 | * </ioctl> |
| 1282 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1283 | #define WE_GET_CHWIDTH 17 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1284 | /* |
| 1285 | * <ioctl> |
| 1286 | * get_anienable - Get the anienable |
| 1287 | * |
| 1288 | * @INPUT: None |
| 1289 | * |
| 1290 | * @OUTPUT: |
| 1291 | * wlan0 get_anienable:0 |
| 1292 | * |
| 1293 | * This IOTCL get the anienable |
| 1294 | * |
| 1295 | * @E.g: iwpriv wlan0 get_anienable |
| 1296 | * |
| 1297 | * Supported Feature: STA |
| 1298 | * |
| 1299 | * Usage: Internal/External |
| 1300 | * |
| 1301 | * </ioctl> |
| 1302 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1303 | #define WE_GET_ANI_EN_DIS 18 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1304 | /* |
| 1305 | * <ioctl> |
| 1306 | * get_aniplen - Get the aniplen |
| 1307 | * |
| 1308 | * @INPUT: None |
| 1309 | * |
| 1310 | * @OUTPUT: |
| 1311 | * wlan0 get_aniplen:0 |
| 1312 | * |
| 1313 | * This IOTCL get the aniplen |
| 1314 | * |
| 1315 | * @E.g: iwpriv wlan0 get_aniplen |
| 1316 | * |
| 1317 | * Supported Feature: STA |
| 1318 | * |
| 1319 | * Usage: Internal/External |
| 1320 | * |
| 1321 | * </ioctl> |
| 1322 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1323 | #define WE_GET_ANI_POLL_PERIOD 19 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1324 | /* |
| 1325 | * <ioctl> |
| 1326 | * get_anilislen- Get the anilislen |
| 1327 | * |
| 1328 | * @INPUT: None |
| 1329 | * |
| 1330 | * @OUTPUT: |
| 1331 | * wlan0 get_anilislen:0 |
| 1332 | * |
| 1333 | * This IOTCL used to get anilislen |
| 1334 | * |
| 1335 | * @E.g: iwpriv wlan0 get_anilislen |
| 1336 | * |
| 1337 | * Supported Feature: STA |
| 1338 | * |
| 1339 | * Usage: Internal/External |
| 1340 | * |
| 1341 | * </ioctl> |
| 1342 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1343 | #define WE_GET_ANI_LISTEN_PERIOD 20 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1344 | /* |
| 1345 | * <ioctl> |
| 1346 | * get_aniofdmlvl - Get the OFDM level |
| 1347 | * |
| 1348 | * @INPUT: None |
| 1349 | * |
| 1350 | * @OUTPUT: OFDM |
| 1351 | * wlan0 get_aniofdmlvl:0 |
| 1352 | * |
| 1353 | * This IOTCL used to get ofdm level |
| 1354 | * |
| 1355 | * @E.g: iwpriv wlan0 get_aniofdmlvl |
| 1356 | * |
| 1357 | * Supported Feature: STA |
| 1358 | * |
| 1359 | * Usage: Internal/External |
| 1360 | * |
| 1361 | * </ioctl> |
| 1362 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1363 | #define WE_GET_ANI_OFDM_LEVEL 21 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1364 | /* |
| 1365 | * <ioctl> |
| 1366 | * get_aniccklvl - Get the cck level |
| 1367 | * |
| 1368 | * @INPUT: None |
| 1369 | * |
| 1370 | * @OUTPUT: |
| 1371 | * wlan0 get_aniccklvl:0 |
| 1372 | * |
| 1373 | * This IOTCL used to get cck level |
| 1374 | * |
| 1375 | * @E.g: iwpriv wlan0 get_aniccklvl |
| 1376 | * |
| 1377 | * Supported Feature: STA |
| 1378 | * |
| 1379 | * Usage: Internal/External |
| 1380 | * |
| 1381 | * </ioctl> |
| 1382 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1383 | #define WE_GET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1384 | /* |
| 1385 | * <ioctl> |
| 1386 | * get_cwmenable - Get the value of the dynamic channel bandwidth setting |
| 1387 | * |
| 1388 | * @INPUT: None |
| 1389 | * |
| 1390 | * @OUTPUT: Enable/disable dynamic channel bandwidth |
| 1391 | * wlan0 get_cwmenable:0 |
| 1392 | * |
| 1393 | * This IOTCL get the value of the dynamic channel bandwidth setting |
| 1394 | * |
| 1395 | * @E.g: iwpriv wlan0 get_cwmenable |
| 1396 | * |
| 1397 | * Supported Feature: STA |
| 1398 | * |
| 1399 | * Usage: Internal/External |
| 1400 | * |
| 1401 | * </ioctl> |
| 1402 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1403 | #define WE_GET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1404 | /* |
| 1405 | * <ioctl> |
| 1406 | * get_txchainmask - Get the txchainmask that was set |
| 1407 | * |
| 1408 | * @INPUT: None |
| 1409 | * |
| 1410 | * @OUTPUT: txchainmask |
| 1411 | * wlan0 get_txchainmask:1 |
| 1412 | * |
| 1413 | * This IOCTL gets the txchainmask that was set |
| 1414 | * This command is useful if it was previously set |
| 1415 | * |
| 1416 | * @E.g: iwpriv wlan0 get_txchainmask |
| 1417 | * |
| 1418 | * Supported Feature: STA |
| 1419 | * |
| 1420 | * Usage: Internal/External |
| 1421 | * |
| 1422 | * </ioctl> |
| 1423 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1424 | #define WE_GET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1425 | /* |
| 1426 | * <ioctl> |
| 1427 | * get_rxchainmask - Get the rxchainmask that was set |
| 1428 | * |
| 1429 | * @INPUT: None |
| 1430 | * |
| 1431 | * @OUTPUT: rxchainmask |
| 1432 | * wlan0 get_rxchainmask:1 |
| 1433 | * |
| 1434 | * This IOCTL gets the rxchainmask that was set |
| 1435 | * This command is useful only if it was previously set. |
| 1436 | * |
| 1437 | * @E.g: iwpriv wlan0 get_rxchainmask |
| 1438 | * |
| 1439 | * Supported Feature: STA |
| 1440 | * |
| 1441 | * Usage: Internal/External |
| 1442 | * |
| 1443 | * </ioctl> |
| 1444 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1445 | #define WE_GET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1446 | /* |
| 1447 | * <ioctl> |
| 1448 | * get_11nrate - Get the fixed Tx data rate |
| 1449 | * |
| 1450 | * @INPUT: None |
| 1451 | * |
| 1452 | * @OUTPUT: Using this command does not return the same value as set |
| 1453 | * wlan0 get_11nrate:0 |
| 1454 | * |
| 1455 | * This IOCTL gets the fixed Tx data rate |
| 1456 | * This command is useful only if setting the fixed Tx rate. |
| 1457 | * |
| 1458 | * @E.g: iwpriv wlan0 get_11nrate |
| 1459 | * |
| 1460 | * Supported Feature: STA |
| 1461 | * |
| 1462 | * Usage: Internal/External |
| 1463 | * |
| 1464 | * </ioctl> |
| 1465 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1466 | #define WE_GET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1467 | /* |
| 1468 | * <ioctl> |
| 1469 | * get_ampdu - Get the maximum subframe of ampdu |
| 1470 | * |
| 1471 | * @INPUT: None |
| 1472 | * |
| 1473 | * @OUTPUT: Maximum subframe of ampdu |
| 1474 | * wlan0 get_ampdu:1 |
| 1475 | * |
| 1476 | * This IOCTL gets the maximum subframe of ampdu |
| 1477 | * This command is useful only if setting ampdu. |
| 1478 | * |
| 1479 | * @E.g: iwpriv wlan0 get_ampdu |
| 1480 | * |
| 1481 | * Supported Feature: STA |
| 1482 | * |
| 1483 | * Usage: Internal/External |
| 1484 | * |
| 1485 | * </ioctl> |
| 1486 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1487 | #define WE_GET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1488 | /* |
| 1489 | * <ioctl> |
| 1490 | * get_amsdu - Get the maximum subframe of amsdu |
| 1491 | * |
| 1492 | * @INPUT: None |
| 1493 | * |
| 1494 | * @OUTPUT: Maximum subframe of amsdu |
| 1495 | * wlan0 get_amsdu:1 |
| 1496 | * |
| 1497 | * This IOCTL gets the maximum subframe of amsdu. |
| 1498 | * This command is useful only if setting amsdu |
| 1499 | * |
| 1500 | * @E.g: iwpriv wlan0 get_amsdu |
| 1501 | * |
| 1502 | * Supported Feature: STA |
| 1503 | * |
| 1504 | * Usage: Internal/External |
| 1505 | * |
| 1506 | * </ioctl> |
| 1507 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1508 | #define WE_GET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1509 | /* |
| 1510 | * <ioctl> |
| 1511 | * get_txpow2g - Get the current 2 GHz Tx power setting |
| 1512 | * |
| 1513 | * @INPUT: None |
| 1514 | * |
| 1515 | * @OUTPUT: Tx Power in dbm |
| 1516 | * wlan0 get_txpow2g:0 |
| 1517 | * |
| 1518 | * This IOCTL gets the current 2 GHz Tx power setting |
| 1519 | * This command is useful if setting Tx power |
| 1520 | * |
| 1521 | * @E.g: iwpriv wlan0 get_txpow2g |
| 1522 | * |
| 1523 | * Supported Feature: STA |
| 1524 | * |
| 1525 | * Usage: Internal/External |
| 1526 | * |
| 1527 | * </ioctl> |
| 1528 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1529 | #define WE_GET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1530 | /* |
| 1531 | * <ioctl> |
| 1532 | * get_txpow5g - Get the current 5 GHz Tx power setting |
| 1533 | * |
| 1534 | * @INPUT: None |
| 1535 | * |
| 1536 | * @OUTPUT: Tx Power in dbm |
| 1537 | * wlan0 get_txpow5g:0 |
| 1538 | * |
| 1539 | * This IOCTL gets the current 5 GHz Tx power setting |
| 1540 | * This command is useful if setting Tx power |
| 1541 | * |
| 1542 | * @E.g: iwpriv wlan0 get_txpow5g |
| 1543 | * |
| 1544 | * Supported Feature: STA |
| 1545 | * |
| 1546 | * Usage: Internal/External |
| 1547 | * |
| 1548 | * </ioctl> |
| 1549 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1550 | #define WE_GET_TXPOW_5G 30 |
Rajeev Kumar | 1bcfd63 | 2015-12-07 11:38:51 -0800 | [diff] [blame] | 1551 | /* 31 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1552 | #define WE_GET_PPS_PAID_MATCH 32 |
| 1553 | #define WE_GET_PPS_GID_MATCH 33 |
| 1554 | #define WE_GET_PPS_EARLY_TIM_CLEAR 34 |
| 1555 | #define WE_GET_PPS_EARLY_DTIM_CLEAR 35 |
| 1556 | #define WE_GET_PPS_EOF_PAD_DELIM 36 |
| 1557 | #define WE_GET_PPS_MACADDR_MISMATCH 37 |
| 1558 | #define WE_GET_PPS_DELIM_CRC_FAIL 38 |
| 1559 | #define WE_GET_PPS_GID_NSTS_ZERO 39 |
| 1560 | #define WE_GET_PPS_RSSI_CHECK 40 |
| 1561 | /* Private ioctl for QPower */ |
| 1562 | #define WE_GET_QPOWER_MAX_PSPOLL_COUNT 41 |
| 1563 | #define WE_GET_QPOWER_MAX_TX_BEFORE_WAKE 42 |
| 1564 | #define WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 43 |
| 1565 | #define WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 44 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1566 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1567 | /* |
| 1568 | * <ioctl> |
| 1569 | * get_gtxHTMcs - Get the tx HTM |
| 1570 | * |
| 1571 | * @INPUT: None |
| 1572 | * |
| 1573 | * @OUTPUT: HTM |
| 1574 | * wlan0 get_gtxHTMcs:32896 |
| 1575 | * |
| 1576 | * This IOTCL used to get HTM |
| 1577 | * |
| 1578 | * @E.g: iwpriv wlan0 get_gtxHTMcs |
| 1579 | * |
| 1580 | * Supported Feature: STA |
| 1581 | * |
| 1582 | * Usage: Internal/External |
| 1583 | * |
| 1584 | * </ioctl> |
| 1585 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1586 | #define WE_GET_GTX_HT_MCS 47 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1587 | /* |
| 1588 | * <ioctl> |
| 1589 | * get_gtxVHTMcs - Get the VHTM |
| 1590 | * |
| 1591 | * @INPUT: None |
| 1592 | * |
| 1593 | * @OUTPUT: VHTM |
| 1594 | * wlan0 get_gtxVHTMcs:524800 |
| 1595 | * |
| 1596 | * This IOTCL used to get the VHTM |
| 1597 | * |
| 1598 | * @E.g: iwpriv wlan0 get_gtxVHTMcs |
| 1599 | * |
| 1600 | * Supported Feature: STA |
| 1601 | * |
| 1602 | * Usage: Internal/External |
| 1603 | * |
| 1604 | * </ioctl> |
| 1605 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1606 | #define WE_GET_GTX_VHT_MCS 48 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1607 | /* |
| 1608 | * <ioctl> |
| 1609 | * get_gtxUsrCfg - Get the tx cfg |
| 1610 | * |
| 1611 | * @INPUT: None |
| 1612 | * |
| 1613 | * @OUTPUT: TXCFG |
| 1614 | * wlan0 get_gtxUsrCfg:32 |
| 1615 | * |
| 1616 | * This IOTCL used to get the tx cfg |
| 1617 | * |
| 1618 | * @E.g: iwpriv wlan0 get_gtxUsrCfg |
| 1619 | * |
| 1620 | * Supported Feature: STA |
| 1621 | * |
| 1622 | * Usage: Internal/External |
| 1623 | * |
| 1624 | * </ioctl> |
| 1625 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1626 | #define WE_GET_GTX_USRCFG 49 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1627 | /* |
| 1628 | * <ioctl> |
| 1629 | * get_gtxThre - Get the tx threshold |
| 1630 | * |
| 1631 | * @INPUT: None |
| 1632 | * |
| 1633 | * @OUTPUT: Threshold |
| 1634 | * wlan0 get_gtxThre:3 |
| 1635 | * |
| 1636 | * This IOCTL is used to get tx threshold |
| 1637 | * |
| 1638 | * @E.g: iwpriv wlan0 get_gtxThre |
| 1639 | * |
| 1640 | * Supported Feature: STA |
| 1641 | * |
| 1642 | * Usage: Internal/External |
| 1643 | * |
| 1644 | * </ioctl> |
| 1645 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1646 | #define WE_GET_GTX_THRE 50 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1647 | /* |
| 1648 | * <ioctl> |
| 1649 | * get_gtxMargin - Get the tx margin |
| 1650 | * |
| 1651 | * @INPUT: None |
| 1652 | * |
| 1653 | * @OUTPUT: GTXMARGIN |
| 1654 | * wlan0 get_gtxMargin:2 |
| 1655 | * |
| 1656 | * This IOCTL is used to set tx margin |
| 1657 | * |
| 1658 | * @E.g: iwpriv wlan0 get_gtxMargin |
| 1659 | * |
| 1660 | * Supported Feature: STA |
| 1661 | * |
| 1662 | * Usage: Internal/External |
| 1663 | * |
| 1664 | * </ioctl> |
| 1665 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1666 | #define WE_GET_GTX_MARGIN 51 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1667 | /* |
| 1668 | * <ioctl> |
| 1669 | * get_gtxStep - Get the tx step |
| 1670 | * |
| 1671 | * @INPUT: None |
| 1672 | * |
| 1673 | * @OUTPUT: GTXSTEP |
| 1674 | * wlan0 get_gtxStep:0 |
| 1675 | * |
| 1676 | * This IOCTL is used to get the gtx step |
| 1677 | * |
| 1678 | * @E.g: iwpriv wlan0 get_gtxStep |
| 1679 | * |
| 1680 | * Supported Feature: STA |
| 1681 | * |
| 1682 | * Usage: Internal/External |
| 1683 | * |
| 1684 | * </ioctl> |
| 1685 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1686 | #define WE_GET_GTX_STEP 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1687 | /* |
| 1688 | * <ioctl> |
| 1689 | * get_gtxMinTpc - Get the tx miminum tpc |
| 1690 | * |
| 1691 | * @INPUT: None |
| 1692 | * |
| 1693 | * @OUTPUT: TPC |
| 1694 | * wlan0 get_gtxMinTpc:0 |
| 1695 | * |
| 1696 | * This IOCTL is used to get tx miminum tpc |
| 1697 | * |
| 1698 | * @E.g: iwpriv wlan0 get_gtxMinTpc |
| 1699 | * |
| 1700 | * Supported Feature: STA |
| 1701 | * |
| 1702 | * Usage: Internal/External |
| 1703 | * |
| 1704 | * </ioctl> |
| 1705 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1706 | #define WE_GET_GTX_MINTPC 53 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1707 | /* |
| 1708 | * <ioctl> |
| 1709 | * get_gtxBWMask - Get the tx BW MASK |
| 1710 | * |
| 1711 | * @INPUT: None |
| 1712 | * |
| 1713 | * @OUTPUT: MASK |
| 1714 | * wlan0 get_gtxBWMask:15 |
| 1715 | * |
| 1716 | * This IOCTL is used get gtx bw mask |
| 1717 | * |
| 1718 | * @E.g: iwpriv wlan0 get_gtxBWMask |
| 1719 | * |
| 1720 | * Supported Feature: STA |
| 1721 | * |
| 1722 | * Usage: Internal/External |
| 1723 | * |
| 1724 | * </ioctl> |
| 1725 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1726 | #define WE_GET_GTX_BWMASK 54 |
| 1727 | #define WE_GET_TEMPERATURE 56 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1728 | #define WE_CAP_TSF 58 |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 1729 | #define WE_GET_ROAM_SYNCH_DELAY 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1730 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1731 | /* |
| 1732 | * <ioctl> |
| 1733 | * get_dcm - Get dcm enablement value |
| 1734 | * |
| 1735 | * @INPUT: None |
| 1736 | * |
| 1737 | * @OUTPUT: 0/1 |
| 1738 | * wlan0 get_dcm |
| 1739 | * |
| 1740 | * This IOCTL is used get dcm value |
| 1741 | * |
| 1742 | * Supported Feature: STA/SAP |
| 1743 | * |
| 1744 | * Usage: Internal |
| 1745 | * |
| 1746 | * </ioctl> |
| 1747 | */ |
| 1748 | #define WE_GET_DCM 60 |
| 1749 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1750 | /* |
| 1751 | * <ioctl> |
| 1752 | * get_dcm - Get range extension enablement value |
| 1753 | * |
| 1754 | * @INPUT: None |
| 1755 | * |
| 1756 | * @OUTPUT: 0/1 |
| 1757 | * wlan0 get_range_ext |
| 1758 | * |
| 1759 | * This IOCTL is used get range_extension value |
| 1760 | * |
| 1761 | * Supported Feature: STA/SAP |
| 1762 | * |
| 1763 | * Usage: Internal |
| 1764 | * |
| 1765 | * </ioctl> |
| 1766 | */ |
| 1767 | #define WE_GET_RANGE_EXT 61 |
| 1768 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1769 | /* Private ioctls and their sub-ioctls */ |
| 1770 | #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) |
| 1771 | |
| 1772 | /* Private ioctls and their sub-ioctls */ |
| 1773 | #define WLAN_PRIV_SET_CHAR_GET_NONE (SIOCIWFIRSTPRIV + 3) |
| 1774 | #define WE_WOWL_ADD_PTRN 1 |
| 1775 | #define WE_WOWL_DEL_PTRN 2 |
Sreelakshmi Konamki | ded64d7 | 2017-02-23 10:39:26 +0530 | [diff] [blame] | 1776 | /* |
| 1777 | * <ioctl> |
| 1778 | * neighbor - Send neighbor report request |
| 1779 | * |
| 1780 | * @INPUT: string |
| 1781 | * |
| 1782 | * @OUTPUT: None |
| 1783 | * |
| 1784 | * This IOCTL create a Neighbor report request and send it to peer |
| 1785 | * |
| 1786 | * @E.g: iwpriv wlan0 neighbor "SSID" |
| 1787 | * |
| 1788 | * Supported Feature: 11k |
| 1789 | * |
| 1790 | * Usage: Internal/External |
| 1791 | * |
| 1792 | * </ioctl> |
| 1793 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1794 | #define WE_NEIGHBOR_REPORT_REQUEST 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1795 | /* |
| 1796 | * <ioctl> |
| 1797 | * set_ap_wps_ie - Set the P2P IE of the probe response |
| 1798 | * |
| 1799 | * @INPUT: string |
| 1800 | * |
| 1801 | * @OUTPUT: None |
| 1802 | * |
| 1803 | * This IOCTL sets the P2P IE of the probe response |
| 1804 | * |
| 1805 | * @E.g: iwpriv wlan0 set_ap_wps_ie abcd |
| 1806 | * |
| 1807 | * Supported Feature: STA |
| 1808 | * |
| 1809 | * Usage: Internal/External |
| 1810 | * |
| 1811 | * </ioctl> |
| 1812 | */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 1813 | #define WE_SET_AP_WPS_IE 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1814 | #define WE_SET_CONFIG 5 |
| 1815 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 1816 | /* |
| 1817 | * <ioctl> |
| 1818 | * unit_test - execute component-level unit tests |
| 1819 | * |
| 1820 | * @INPUT: string - the name of the component to test. |
| 1821 | * All tests are executed if unspecified |
| 1822 | * @OUTPUT: None |
| 1823 | * |
| 1824 | * Usage: Internal only |
| 1825 | * </ioctl> |
| 1826 | */ |
| 1827 | #define WE_UNIT_TEST 6 |
| 1828 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1829 | /* Private ioctls and their sub-ioctls */ |
| 1830 | #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) |
| 1831 | #define WE_SET_WLAN_DBG 1 |
| 1832 | #define WE_SET_DP_TRACE 2 |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 1833 | #define WE_SET_FW_TEST 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1834 | |
| 1835 | /* Private ioctls and their sub-ioctls */ |
| 1836 | #define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5) |
| 1837 | #define WE_WLAN_VERSION 1 |
| 1838 | #define WE_GET_STATS 2 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1839 | /* |
| 1840 | * <ioctl> |
| 1841 | * getConfig - gets the values of all configurations listed in WCNSS |
| 1842 | * |
| 1843 | * @INPUT: None |
| 1844 | * |
| 1845 | * @OUTPUT: Current configuration to the sys log |
| 1846 | * wlan0 getConfig: WLAN configuration written to system log |
| 1847 | * |
| 1848 | * This IOCTL gets the values of all configurations listed in WCNSS |
| 1849 | * |
| 1850 | * @E.g: iwpriv wlan0 getConfig |
| 1851 | * |
| 1852 | * Supported Feature: STA |
| 1853 | * |
| 1854 | * Usage: Internal/External |
| 1855 | * |
| 1856 | * </ioctl> |
| 1857 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1858 | #define WE_GET_CFG 3 |
| 1859 | #define WE_GET_WMM_STATUS 4 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1860 | /* |
| 1861 | * <ioctl> |
| 1862 | * getChannelList - Get the available channel list while in QCMobileAP |
| 1863 | * |
| 1864 | * @INPUT: None |
| 1865 | * |
| 1866 | * @OUTPUT: Channel list |
| 1867 | * wlan0 getChannelList:36 US 1..165 |
| 1868 | * |
| 1869 | * This IOCTL gets the available channel list while in QCMobileAP |
| 1870 | * |
| 1871 | * @E.g: iwpriv wlan0 getChannelList |
| 1872 | * |
| 1873 | * Supported Feature: STA |
| 1874 | * |
| 1875 | * Usage: Internal/External |
| 1876 | * |
| 1877 | * </ioctl> |
| 1878 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1879 | #define WE_GET_CHANNEL_LIST 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1880 | /* |
| 1881 | * <ioctl> |
| 1882 | * getRSSI - Get the Received Signal Strength Indicator |
| 1883 | * |
| 1884 | * @INPUT: None |
| 1885 | * |
| 1886 | * @OUTPUT: RSSI |
| 1887 | * wlan0 getRSSI:rsssi=-32 |
| 1888 | * |
| 1889 | * This IOCTL gets the Received Signal Strength Indicator (RSSI) |
| 1890 | * |
| 1891 | * @E.g: iwpriv wlan0 getRSSI |
| 1892 | * |
| 1893 | * Supported Feature: STA |
| 1894 | * |
| 1895 | * Usage: Internal/External |
| 1896 | * |
| 1897 | * </ioctl> |
| 1898 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1899 | #define WE_GET_RSSI 6 |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1900 | |
| 1901 | /* |
| 1902 | * <ioctl> |
| 1903 | * getSuspendStats - Get suspend/resume stats |
| 1904 | * |
| 1905 | * @INPUT: None |
| 1906 | * |
| 1907 | * @OUTPUT: character string containing formatted suspend/resume stats |
| 1908 | * |
| 1909 | * This ioctl is used to get suspend/resume stats formatted for display. |
| 1910 | * Currently it includes suspend/resume counts, wow wake up reasons, and |
| 1911 | * suspend fail reasons. |
| 1912 | * |
| 1913 | * @E.g: iwpriv wlan0 getSuspendStats |
| 1914 | * iwpriv wlan0 getSuspendStats |
| 1915 | * |
| 1916 | * Supported Feature: suspend/resume |
| 1917 | * |
| 1918 | * Usage: Internal |
| 1919 | * |
| 1920 | * </ioctl> |
| 1921 | */ |
| 1922 | #define WE_GET_SUSPEND_RESUME_STATS 7 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1923 | #ifdef FEATURE_WLAN_TDLS |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 1924 | /* |
| 1925 | * <ioctl> |
| 1926 | * getTdlsPeers - Get all TDLS peers. |
| 1927 | * |
| 1928 | * @INPUT: None |
| 1929 | * |
| 1930 | * @OUTPUT: Returns the MAC address of all the TDLS peers |
| 1931 | * wlan0 getTdlsPeers: |
| 1932 | * MAC Id cap up RSSI |
| 1933 | * --------------------------------- |
| 1934 | * 00:0a:f5:0e:bd:18 2 Y Y -44 |
| 1935 | * 00:0a:f5:bf:0e:12 0 N N 0 |
| 1936 | * |
| 1937 | * This IOCTL is used to get all TDLS peers. |
| 1938 | * |
| 1939 | * @E.g: iwpriv wlan0 getTdlsPeers |
| 1940 | * |
| 1941 | * Supported Feature: TDLS |
| 1942 | * |
| 1943 | * Usage: Internal/External |
| 1944 | * |
| 1945 | * </ioctl> |
| 1946 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1947 | #define WE_GET_TDLS_PEERS 8 |
| 1948 | #endif |
| 1949 | #ifdef WLAN_FEATURE_11W |
Abhishek Singh | 2f81049 | 2016-12-01 11:39:39 +0530 | [diff] [blame] | 1950 | /* |
| 1951 | * <ioctl> |
| 1952 | * getPMFInfo - get the PMF info of the connected session |
| 1953 | * |
| 1954 | * @INPUT: None |
| 1955 | * |
| 1956 | * @OUTPUT: |
| 1957 | * wlan0 getPMFInfo: |
| 1958 | * BSSID E4:F4:C6:0A:E0:36, Is PMF Assoc? 0 |
| 1959 | * Number of Unprotected Disassocs 0 |
| 1960 | * Number of Unprotected Deauths 0 |
| 1961 | * |
| 1962 | * This IOCTL is used to get the PMF stats/status of the current |
| 1963 | * connection. |
| 1964 | * |
| 1965 | * @e.g:iwpriv wlan0 getPMFInfo |
| 1966 | * |
| 1967 | * Supported Feature: PMF |
| 1968 | * |
| 1969 | * Usage: Internal/External |
| 1970 | * |
| 1971 | * </ioctl> |
| 1972 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1973 | #define WE_GET_11W_INFO 9 |
| 1974 | #endif |
| 1975 | #define WE_GET_STATES 10 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 1976 | /* |
| 1977 | * <ioctl> |
| 1978 | * getIbssSTAs - get ibss sta info |
| 1979 | * |
| 1980 | * @INPUT: None |
| 1981 | * |
| 1982 | * @OUTPUT: Give the MAC of the IBSS STA |
| 1983 | * wlan0 getIbssSTAs: |
| 1984 | * 1 .8c:fd:f0:01:9c:bf |
| 1985 | * |
| 1986 | * This IOCTL is used to get ibss sta info |
| 1987 | * |
| 1988 | * @E.g: iwpriv wlan0 getIbssSTAs |
| 1989 | * |
| 1990 | * Supported Feature: IBSS |
| 1991 | * |
| 1992 | * Usage: Internal/External |
| 1993 | * |
| 1994 | * </ioctl> |
| 1995 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1996 | #define WE_GET_IBSS_STA_INFO 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1997 | /* |
| 1998 | * <ioctl> |
| 1999 | * getphymode - Get the current phymode. |
| 2000 | * |
| 2001 | * @INPUT: None |
| 2002 | * |
| 2003 | * @OUTPUT: In phymode |
| 2004 | * wlan0 getphymode:AUTO MODE |
| 2005 | * |
| 2006 | * This IOCTL used to gets the current phymode. |
| 2007 | * |
| 2008 | * @E.g: iwpriv wlan0 getphymode |
| 2009 | * |
| 2010 | * Supported Feature: STA |
| 2011 | * |
| 2012 | * Usage: Internal/External |
| 2013 | * |
| 2014 | * </ioctl> |
| 2015 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2016 | #define WE_GET_PHYMODE 12 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2017 | |
| 2018 | /* |
| 2019 | * <ioctl> |
| 2020 | * getOemDataCap - Get the oem data caps. |
| 2021 | * |
| 2022 | * @INPUT: None |
| 2023 | * |
| 2024 | * @OUTPUT: oem data capability |
| 2025 | * |
| 2026 | * This IOCTL used to gets the current oem data cap. |
| 2027 | * |
| 2028 | * @E.g: iwpriv wlan0 getOemDataCap |
| 2029 | * |
| 2030 | * Usage: Internal/External |
| 2031 | * |
| 2032 | * </ioctl> |
| 2033 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2034 | #define WE_GET_OEM_DATA_CAP 13 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2035 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2036 | /* |
| 2037 | * <ioctl> |
| 2038 | * getSNR - Enable SNR Monitoring |
| 2039 | * |
| 2040 | * @INPUT: None |
| 2041 | * |
| 2042 | * @OUTPUT: Signal strength/ratio |
| 2043 | * wlan0 getSNR:1 |
| 2044 | * |
| 2045 | * This IOCTL is used to get ibss sta info |
| 2046 | * |
| 2047 | * @E.g: iwpriv wlan0 getSNR |
| 2048 | * |
| 2049 | * Supported Feature: STA |
| 2050 | * |
| 2051 | * Usage: Internal/External |
| 2052 | * |
| 2053 | * </ioctl> |
| 2054 | */ |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2055 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2056 | #define WE_GET_SNR 14 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2057 | #define WE_LIST_FW_PROFILE 15 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2058 | |
| 2059 | /* Private ioctls and their sub-ioctls */ |
| 2060 | #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) |
Selvaraj, Sridhar | f793983 | 2017-03-25 16:59:50 +0530 | [diff] [blame] | 2061 | |
| 2062 | /* |
| 2063 | * <ioctl> |
| 2064 | * reassoc - Trigger STA re-association to the connected AP |
| 2065 | * |
| 2066 | * @INPUT: None |
| 2067 | * |
| 2068 | * @OUTPUT: None |
| 2069 | * |
| 2070 | * This IOCTL is used to trigger STA reassociation to the connected AP. |
| 2071 | * |
| 2072 | * @E.g: iwpriv wlan0 reassoc |
| 2073 | * |
| 2074 | * Supported Feature: Roaming |
| 2075 | * |
| 2076 | * Usage: Internal |
| 2077 | * |
| 2078 | * </ioctl> |
| 2079 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2080 | #define WE_SET_REASSOC_TRIGGER 8 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2081 | /* |
| 2082 | * <ioctl> |
| 2083 | * ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI |
| 2084 | * |
| 2085 | * @INPUT: None |
| 2086 | * |
| 2087 | * @OUTPUT: print ibss peer in info logs |
| 2088 | * pPeerInfo->numIBSSPeers = 1 |
| 2089 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2090 | * |
| 2091 | * This IOCTL is used to rint the ibss peers's MAC, rate and RSSI |
| 2092 | * in info logs |
| 2093 | * |
| 2094 | * @E.g: iwpriv wlan0 ibssPeerInfoAll |
| 2095 | * |
| 2096 | * Supported Feature: IBSS |
| 2097 | * |
| 2098 | * Usage: Internal/External |
| 2099 | * |
| 2100 | * </ioctl> |
| 2101 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2102 | #define WE_IBSS_GET_PEER_INFO_ALL 10 |
Rajeev Kumar | f4390fa | 2016-12-22 13:17:33 -0800 | [diff] [blame] | 2103 | /* Sub ioctls 11 to 16 are not used */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2104 | #define WE_GET_RECOVERY_STAT 17 |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2105 | #define WE_GET_FW_PROFILE_DATA 18 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 2106 | /* |
| 2107 | * <ioctl> |
| 2108 | * stop_obss_scan - Stop obss scan |
| 2109 | * |
| 2110 | * @INPUT: None |
| 2111 | * |
| 2112 | * @OUTPUT: None |
| 2113 | * |
| 2114 | * This IOCTL is used to stop obss scan |
| 2115 | * |
| 2116 | * @E.g: iwpriv wlan0 stop_obss_scan |
| 2117 | * |
| 2118 | * Supported Feature: Scan |
| 2119 | * |
| 2120 | * Usage: Internal/External |
| 2121 | * |
| 2122 | * </ioctl> |
| 2123 | */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2124 | #define WE_STOP_OBSS_SCAN 19 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2125 | |
| 2126 | /* Private ioctls and their sub-ioctls */ |
| 2127 | #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) |
| 2128 | |
| 2129 | #define WE_P2P_NOA_CMD 2 |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2130 | /* subcommands 3 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2131 | |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2132 | #define WE_MAC_PWR_DEBUG_CMD 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2133 | |
Kabilan Kannan | 6894e6a | 2017-11-09 14:37:55 -0800 | [diff] [blame] | 2134 | /* subcommand 5 is unused */ |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 2135 | |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2136 | /* |
| 2137 | * <ioctl> |
| 2138 | * ibssPeerInfo - Print the ibss peers's MAC, rate and RSSI |
| 2139 | * |
| 2140 | * @INPUT: staid |
| 2141 | * |
| 2142 | * @OUTPUT: print ibss peer corresponding to staid in info logs |
| 2143 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2144 | * |
| 2145 | * This IOCTL is used to print the specific ibss peers's MAC, |
| 2146 | * rate and RSSI in info logs |
| 2147 | * |
| 2148 | * @E.g: iwpriv wlan0 ibssPeerInfo <sta_id> |
| 2149 | * iwpriv wlan0 ibssPeerInfo 0 |
| 2150 | * |
| 2151 | * Supported Feature: IBSS |
| 2152 | * |
| 2153 | * Usage: Internal/External |
| 2154 | * |
| 2155 | * </ioctl> |
| 2156 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2157 | #define WE_IBSS_GET_PEER_INFO 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2158 | #define WE_UNIT_TEST_CMD 7 |
| 2159 | |
| 2160 | #define WE_MTRACE_DUMP_CMD 8 |
| 2161 | #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 |
| 2162 | |
| 2163 | |
| 2164 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 2165 | #define WE_LED_FLASHING_PARAM 10 |
| 2166 | #endif |
| 2167 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2168 | /* |
| 2169 | * <ioctl> |
| 2170 | * pm_clist - Increments the index value of the concurrent connection list |
| 2171 | * and update with the input parameters provided. |
| 2172 | * |
| 2173 | * @INPUT: Following 8 arguments: |
| 2174 | * @vdev_id: vdev id |
| 2175 | * @tx_streams: TX streams |
| 2176 | * @rx_streams: RX streams |
| 2177 | * @chain_mask: Chain mask |
| 2178 | * @type: vdev_type |
| 2179 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2180 | * @sub_type: vdev_subtype |
| 2181 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2182 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2183 | * @channel: Channel |
| 2184 | * @mac: Mac id |
| 2185 | * |
| 2186 | * @OUTPUT: None |
| 2187 | * |
| 2188 | * This IOCTL is used to increments the index value of the concurrent connection |
| 2189 | * list and update with the input parameters provided. |
| 2190 | * |
| 2191 | * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type |
| 2192 | * sub_type channel mac |
| 2193 | * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1 |
| 2194 | * |
| 2195 | * Supported Feature: DBS |
| 2196 | * |
| 2197 | * Usage: Internal/External |
| 2198 | * |
| 2199 | * </ioctl> |
| 2200 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2201 | #define WE_POLICY_MANAGER_CLIST_CMD 11 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2202 | |
| 2203 | /* |
| 2204 | * <ioctl> |
| 2205 | * pm_dlist - Delete the index from the concurrent connection list that is |
| 2206 | * present in the given vdev_id. |
| 2207 | * |
| 2208 | * @INPUT: delete_all, vdev_id |
| 2209 | * @delete_all: delete all indices |
| 2210 | * @vdev_id: vdev id |
| 2211 | * |
| 2212 | * @OUTPUT: None |
| 2213 | * |
| 2214 | * This IOCTL is used to delete the index from the concurrent connection list |
| 2215 | * that is present in the given vdev_id. |
| 2216 | * |
| 2217 | * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id |
| 2218 | * iwpriv wlan0 pm_dlist 0 1 |
| 2219 | * |
| 2220 | * Supported Feature: DBS |
| 2221 | * |
| 2222 | * Usage: Internal/External |
| 2223 | * |
| 2224 | * </ioctl> |
| 2225 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2226 | #define WE_POLICY_MANAGER_DLIST_CMD 12 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2227 | |
| 2228 | /* |
| 2229 | * <ioctl> |
| 2230 | * pm_dbs - Set dbs capability and system preference |
| 2231 | * |
| 2232 | * @INPUT: dbs, system_pref |
| 2233 | * @dbs: Value of DBS capability to be set |
| 2234 | * @system_pref: System preference |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2235 | * 0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2236 | * |
| 2237 | * @OUTPUT: None |
| 2238 | * |
| 2239 | * This IOCTL is used to set dbs capability and system preference. |
| 2240 | * |
| 2241 | * @E.g: iwpriv wlan0 pm_dbs dbs system_pref |
| 2242 | * iwpriv wlan0 pm_dbs 1 0 |
| 2243 | * |
| 2244 | * Supported Feature: DBS |
| 2245 | * |
| 2246 | * Usage: Internal/External |
| 2247 | * |
| 2248 | * </ioctl> |
| 2249 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2250 | #define WE_POLICY_MANAGER_DBS_CMD 13 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2251 | |
| 2252 | /* |
| 2253 | * <ioctl> |
| 2254 | * pm_pcl - Set pcl for concurrency mode. |
| 2255 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2256 | * @INPUT: policy_mgr_con_mode |
| 2257 | * @policy_mgr_con_mode: concurrency mode for PCL table |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2258 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2259 | * |
| 2260 | * @OUTPUT: None |
| 2261 | * |
| 2262 | * This IOCTL is used to set pcl for concurrency mode. |
| 2263 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2264 | * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2265 | * iwpriv wlan0 pm_pcl 0 |
| 2266 | * |
| 2267 | * Supported Feature: DBS |
| 2268 | * |
| 2269 | * Usage: Internal/External |
| 2270 | * |
| 2271 | * </ioctl> |
| 2272 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2273 | #define WE_POLICY_MANAGER_PCL_CMD 14 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2274 | |
| 2275 | /* |
| 2276 | * <ioctl> |
| 2277 | * pm_cinfo - Shows the concurrent connection list. |
| 2278 | * |
| 2279 | * @INPUT: None |
| 2280 | * |
| 2281 | * @OUTPUT: None |
| 2282 | * |
| 2283 | * This IOCTL is used to show the concurrent connection list. |
| 2284 | * |
| 2285 | * @E.g: iwpriv wlan0 pm_cinfo |
| 2286 | * |
| 2287 | * Supported Feature: DBS |
| 2288 | * |
| 2289 | * Usage: Internal/External |
| 2290 | * |
| 2291 | * </ioctl> |
| 2292 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2293 | #define WE_POLICY_MANAGER_CINFO_CMD 15 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2294 | |
| 2295 | /* |
| 2296 | * <ioctl> |
| 2297 | * pm_ulist - Updates the index value of the concurrent connection list |
| 2298 | * with the input parameters provided. |
| 2299 | * |
| 2300 | * @INPUT: Following 8 arguments: |
| 2301 | * @vdev_id: vdev id |
| 2302 | * @tx_streams: TX streams |
| 2303 | * @rx_streams: RX streams |
| 2304 | * @chain_mask: Chain mask |
| 2305 | * @type: vdev_type |
| 2306 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2307 | * @sub_type: vdev_subtype |
| 2308 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2309 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2310 | * @channel: Channel |
| 2311 | * @mac: Mac id |
| 2312 | * |
| 2313 | * @OUTPUT: None |
| 2314 | * |
| 2315 | * This IOCTL is used to updates the index value of the concurrent |
| 2316 | * connection list with the input parameters provided. |
| 2317 | * |
| 2318 | * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type |
| 2319 | * sub_type channel mac |
| 2320 | * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1 |
| 2321 | * |
| 2322 | * Supported Feature: DBS |
| 2323 | * |
| 2324 | * Usage: Internal/External |
| 2325 | * |
| 2326 | * </ioctl> |
| 2327 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2328 | #define WE_POLICY_MANAGER_ULIST_CMD 16 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2329 | |
| 2330 | /* |
| 2331 | * <ioctl> |
| 2332 | * pm_query_action - Initiate actions needed on current connections as |
| 2333 | * per the channel provided. |
| 2334 | * |
| 2335 | * @INPUT: channel |
| 2336 | * @channel: Channel on which new connection will be. |
| 2337 | * |
| 2338 | * @OUTPUT: None |
| 2339 | * |
| 2340 | * This IOCTL is used to initiate actions needed on current connections |
| 2341 | * as per the channel provided. |
| 2342 | * |
| 2343 | * @E.g: iwpriv wlan0 pm_query_action channel |
| 2344 | * iwpriv wlan0 pm_query_action 6 |
| 2345 | * |
| 2346 | * Supported Feature: DBS |
| 2347 | * |
| 2348 | * Usage: Internal/External |
| 2349 | * |
| 2350 | * </ioctl> |
| 2351 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2352 | #define WE_POLICY_MANAGER_QUERY_ACTION_CMD 17 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2353 | |
| 2354 | /* |
| 2355 | * <ioctl> |
| 2356 | * pm_query_allow - Checks for allowed concurrency combination |
| 2357 | * |
| 2358 | * @INPUT: mode, channel, bandwidth |
| 2359 | * @mode: new connection mode |
| 2360 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2361 | * @channel: channel on which new connection is coming up |
| 2362 | * @bandwidth: Bandwidth requested by the connection |
| 2363 | * 0:None 1:5MHz 2:10MHz 3:20MHz |
| 2364 | * 4:40MHz 5:80MHz 6:80+80MHz 7:160MHz |
| 2365 | * |
| 2366 | * @OUTPUT: None |
| 2367 | * |
| 2368 | * This IOCTL is used to checks for allowed concurrency combination. |
| 2369 | * |
| 2370 | * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth |
| 2371 | * iwpriv wlan0 pm_query_allow 0 6 4 |
| 2372 | * |
| 2373 | * Supported Feature: DBS |
| 2374 | * |
| 2375 | * Usage: Internal/External |
| 2376 | * |
| 2377 | * </ioctl> |
| 2378 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2379 | #define WE_POLICY_MANAGER_QUERY_ALLOW_CMD 18 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2380 | |
| 2381 | /* |
| 2382 | * <ioctl> |
| 2383 | * pm_run_scenario - Create scenario with number of connections provided. |
| 2384 | * |
| 2385 | * @INPUT: num_of_conn |
| 2386 | * @num_of_conn: the number of connections (values: 1~3) |
| 2387 | * |
| 2388 | * @OUTPUT: None |
| 2389 | * |
| 2390 | * This IOCTL is used to create scenario with the number of connections |
| 2391 | * provided. |
| 2392 | * |
| 2393 | * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn |
| 2394 | * iwpriv wlan0 pm_run_scenario 1 |
| 2395 | * |
| 2396 | * Supported Feature: DBS |
| 2397 | * |
| 2398 | * Usage: Internal/External |
| 2399 | * |
| 2400 | * </ioctl> |
| 2401 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2402 | #define WE_POLICY_MANAGER_SCENARIO_CMD 19 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2403 | |
| 2404 | /* |
| 2405 | * <ioctl> |
| 2406 | * pm_set_hw_mode - Set hardware for single/dual mac. |
| 2407 | * |
| 2408 | * @INPUT: hw_mode |
| 2409 | * 0:single mac 1:dual mac |
| 2410 | * |
| 2411 | * @OUTPUT: None |
| 2412 | * |
| 2413 | * This IOCTL is used to set hardware for single/dual mac. |
| 2414 | * |
| 2415 | * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode |
| 2416 | * iwpriv wlan0 pm_set_hw_mode 1 |
| 2417 | * |
| 2418 | * Supported Feature: DBS |
| 2419 | * |
| 2420 | * Usage: Internal/External |
| 2421 | * |
| 2422 | * </ioctl> |
| 2423 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2424 | #define WE_POLICY_SET_HW_MODE_CMD 20 |
| 2425 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2426 | /* |
| 2427 | * <ioctl> |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 2428 | * ch_avoid - unit test SAP channel avoidance |
| 2429 | * |
| 2430 | * @INPUT: chan avoid ranges |
| 2431 | * |
| 2432 | * @OUTPUT: none |
| 2433 | * |
| 2434 | * This IOCTL is used to fake a channel avoidance event. |
| 2435 | * To test SAP/GO chan switch during chan avoid event process. |
| 2436 | * |
| 2437 | * @E.g: iwpriv wlan0 ch_avoid 2452 2462 |
| 2438 | * |
| 2439 | * Supported Feature: SAP chan avoidance. |
| 2440 | * |
| 2441 | * Usage: Internal |
| 2442 | * |
| 2443 | * </ioctl> |
| 2444 | */ |
| 2445 | #define WE_SET_CHAN_AVOID 21 |
| 2446 | |
| 2447 | /* |
| 2448 | * <ioctl> |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2449 | * set_scan_cfg - Set dual MAC scan config parameters. |
| 2450 | * |
| 2451 | * @INPUT: dbs, dbs_plus_agile_scan, single_mac_scan_with_dbs |
| 2452 | * @dbs: Value of DBS bit |
| 2453 | * @dbs_plus_agile_scan: Value of DBS plus agile scan bit |
| 2454 | * @single_mac_scan_with_dbs: Value of Single MAC scan with DBS |
| 2455 | * |
| 2456 | * @OUTPUT: None |
| 2457 | * |
| 2458 | * This IOCTL is used to set the dual MAC scan config. |
| 2459 | * |
| 2460 | * @E.g: iwpriv wlan0 set_scan_cfg dbs dbs_plus_agile_scan |
| 2461 | * single_mac_scan_with_dbs |
| 2462 | * iwpriv wlan0 set_scan_cfg 1 0 1 |
| 2463 | * |
| 2464 | * Supported Feature: DBS |
| 2465 | * |
| 2466 | * Usage: Internal/External |
| 2467 | * |
| 2468 | * </ioctl> |
| 2469 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2470 | #define WE_SET_DUAL_MAC_SCAN_CONFIG 21 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2471 | |
| 2472 | /* |
| 2473 | * <ioctl> |
| 2474 | * set_fw_mode_cfg - Sets the dual mac FW mode config |
| 2475 | * |
| 2476 | * @INPUT: dbs, dfs |
| 2477 | * @dbs: DBS bit |
| 2478 | * @dfs: Agile DFS bit |
| 2479 | * |
| 2480 | * @OUTPUT: None |
| 2481 | * |
| 2482 | * This IOCTL is used to set the dual mac FW mode config. |
| 2483 | * |
| 2484 | * @E.g: iwpriv wlan0 set_fw_mode_cfg dbs dfs |
| 2485 | * iwpriv wlan0 set_fw_mode_cfg 1 1 |
| 2486 | * |
| 2487 | * Supported Feature: DBS |
| 2488 | * |
| 2489 | * Usage: Internal/External |
| 2490 | * |
| 2491 | * </ioctl> |
| 2492 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2493 | #define WE_SET_DUAL_MAC_FW_MODE_CONFIG 22 |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 2494 | #define WE_SET_MON_MODE_CHAN 23 |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 2495 | /* |
| 2496 | * <ioctl> |
| 2497 | * txrx_stats - TXRX statistics query |
| 2498 | * |
| 2499 | * @INPUT: query category, mac id (default mac id is 0) |
| 2500 | * |
| 2501 | * @OUTPUT: TXRX statistics result |
| 2502 | * |
| 2503 | * This IOCTL is used to get TXRX statistics counters. |
| 2504 | * |
| 2505 | * @E.g: iwpriv wlan0 txrx_stats 21 0 |
| 2506 | * iwpriv wlan0 txrx_stats 21 1 |
| 2507 | * |
| 2508 | * Usage: Internal |
| 2509 | * |
| 2510 | * </ioctl> |
| 2511 | */ |
| 2512 | #define WE_SET_TXRX_STATS 24 |
| 2513 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2514 | |
| 2515 | #ifdef FEATURE_WLAN_TDLS |
| 2516 | #undef MAX_VAR_ARGS |
| 2517 | #define MAX_VAR_ARGS 11 |
| 2518 | #else |
| 2519 | #undef MAX_VAR_ARGS |
| 2520 | #define MAX_VAR_ARGS 9 |
| 2521 | #endif |
| 2522 | |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 2523 | /* |
| 2524 | * <ioctl> |
| 2525 | * fips_test - Perform a FIPS test |
| 2526 | * |
| 2527 | * @INPUT: Binary representation of the following packed structure |
| 2528 | * |
| 2529 | * @OUTPUT: Binary representation of the following packed structure |
| 2530 | * |
| 2531 | * This IOCTL is used to perform FIPS certification testing |
| 2532 | * |
| 2533 | * @E.g: iwpriv wlan0 fips_test <test vector> |
| 2534 | * |
| 2535 | * iwpriv wlan0 fips_test <tbd> |
| 2536 | * |
| 2537 | * Supported Feature: FIPS |
| 2538 | * |
| 2539 | * Usage: Internal |
| 2540 | * |
| 2541 | * </ioctl> |
| 2542 | */ |
| 2543 | #define WLAN_PRIV_FIPS_TEST (SIOCIWFIRSTPRIV + 8) |
| 2544 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2545 | /* Private ioctls (with no sub-ioctls) */ |
| 2546 | /* note that they must be odd so that they have "get" semantics */ |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2547 | /* |
| 2548 | * <ioctl> |
| 2549 | * addTspec - Add TSPEC for each AC |
| 2550 | * |
| 2551 | * @INPUT: 19 TSPEC params |
| 2552 | * @[arg0]: handle |
| 2553 | * @[arg1]: tid |
| 2554 | * @[arg2]: dir |
| 2555 | * @[arg3]: psb |
| 2556 | * @[arg4]: up |
| 2557 | * @[arg5]: nomMsduSize |
| 2558 | * @[arg6]: maxMsduSize |
| 2559 | * @[arg7]: minDataRate |
| 2560 | * @[arg8]: meanDataRate |
| 2561 | * @[arg9]: peakDataRate |
| 2562 | * @[arg10]: maxBurstSize |
| 2563 | * @[arg11]: minPhyRate |
| 2564 | * @[arg12]: sba |
| 2565 | * @[arg13]: minServiceIntv |
| 2566 | * @[arg14]: suspendIntv |
| 2567 | * @[arg15]: burstSizeDefn |
| 2568 | * @[arg16]: ackPolicy |
| 2569 | * @[arg17]: inactivityPeriod |
| 2570 | * @[arg18]: maxServiceIntv |
| 2571 | * |
| 2572 | * @OUTPUT: Success/Failure |
| 2573 | * |
| 2574 | * This IOCTL is used to add TSPEC for each AC. |
| 2575 | * |
| 2576 | * @E.g: iwpriv wlan0 addTspec <handle> <tid> <dir> <psb> <up> <nomMsduSize> |
| 2577 | * <maxMsduSize> <minDataRate> <meanDataRate> |
| 2578 | * <peakDataRate> <maxBurstSize> <minPhyRate> |
| 2579 | * <sba> <minServiceIntv> <suspendIntv> |
| 2580 | * <burstSizeDefn> <ackPolicy> <inactivityPeriod> |
| 2581 | * <maxServiceIntv> |
| 2582 | * iwpriv wlan0 addTspec 7001 6 2 1 6 0x80D0 0x80D0 0x14500 0x14500 0x14500 |
| 2583 | * 0 0x5B8D80 0x2001 20 2000 0 0 0 2000 |
| 2584 | * wlan0 addTspec:3 |
| 2585 | * |
| 2586 | * Supported Feature: WMM |
| 2587 | * |
| 2588 | * Usage: Internal/External |
| 2589 | * |
| 2590 | * </ioctl> |
| 2591 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2592 | #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2593 | /* |
| 2594 | * <ioctl> |
| 2595 | * delTspec - Delete TSPEC entry for each AC |
| 2596 | * |
| 2597 | * @INPUT: 1 TSPEC param |
| 2598 | * @[arg0]: handle |
| 2599 | * |
| 2600 | * @OUTPUT: Success/Failure |
| 2601 | * |
| 2602 | * This IOCTL is used to delete TSPEC entry for each AC. |
| 2603 | * |
| 2604 | * @E.g: iwpriv wlan0 delTspec <handle> |
| 2605 | * iwpriv wlan0 delTspec 7001 |
| 2606 | * wlan0 delTspec:16 |
| 2607 | * |
| 2608 | * Supported Feature: WMM |
| 2609 | * |
| 2610 | * Usage: Internal/External |
| 2611 | * |
| 2612 | * </ioctl> |
| 2613 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2614 | #define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2615 | /* |
| 2616 | * <ioctl> |
| 2617 | * getTspec - Get TSPEC entry for each AC |
| 2618 | * |
| 2619 | * @INPUT: 1 TSPEC param |
| 2620 | * @[arg0]: handle |
| 2621 | * |
| 2622 | * @OUTPUT: Success/Failure |
| 2623 | * |
| 2624 | * This IOCTL is used to get TSPEC entry for each AC. |
| 2625 | * |
| 2626 | * @E.g: iwpriv wlan0 getTspec <handle> |
| 2627 | * iwpriv wlan0 getTspec 7001 |
| 2628 | * wlan0 delTspec:18 |
| 2629 | * |
| 2630 | * Supported Feature: WMM |
| 2631 | * |
| 2632 | * Usage: Internal/External |
| 2633 | * |
| 2634 | * </ioctl> |
| 2635 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2636 | #define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13) |
| 2637 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2638 | /* (SIOCIWFIRSTPRIV + 10) is currently unused */ |
| 2639 | /* (SIOCIWFIRSTPRIV + 12) is currently unused */ |
| 2640 | /* (SIOCIWFIRSTPRIV + 14) is currently unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 2641 | #define WLAN_PRIV_SET_NONE_GET_THREE_INT (SIOCIWFIRSTPRIV + 15) |
| 2642 | #define WE_GET_TSF 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2643 | /* (SIOCIWFIRSTPRIV + 16) is currently unused */ |
| 2644 | /* (SIOCIWFIRSTPRIV + 17) is currently unused */ |
| 2645 | /* (SIOCIWFIRSTPRIV + 19) is currently unused */ |
| 2646 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2647 | #define WLAN_PRIV_SET_FTIES (SIOCIWFIRSTPRIV + 20) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2648 | |
| 2649 | /* Private ioctl for setting the host offload feature */ |
| 2650 | #define WLAN_PRIV_SET_HOST_OFFLOAD (SIOCIWFIRSTPRIV + 18) |
| 2651 | |
| 2652 | /* Private ioctl to get the statistics */ |
| 2653 | #define WLAN_GET_WLAN_STATISTICS (SIOCIWFIRSTPRIV + 21) |
| 2654 | |
| 2655 | /* Private ioctl to set the Keep Alive Params */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2656 | /* |
| 2657 | * <ioctl> |
| 2658 | * setKeepAlive - Set the keep alive feature |
| 2659 | * |
| 2660 | * @INPUT: 28 bytes of information in the order of packet type, time period |
| 2661 | * host IPv4 address, destination IPv4 address, destination MAC address, bssID |
| 2662 | * |
| 2663 | * @OUTPUT: None |
| 2664 | * |
| 2665 | * This IOCTL sets the keep alive feature to send either NULL |
| 2666 | * or unsolicited ARP response packets |
| 2667 | * |
| 2668 | * @E.g: iwpriv wlan0 setKeepAlive |
| 2669 | * |
| 2670 | * Supported Feature: STA |
| 2671 | * |
| 2672 | * Usage: Internal/External |
| 2673 | * |
| 2674 | * </ioctl> |
| 2675 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2676 | #define WLAN_SET_KEEPALIVE_PARAMS (SIOCIWFIRSTPRIV + 22) |
| 2677 | |
| 2678 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2679 | /* Private ioctl to set the packet filtering params */ |
| 2680 | #define WLAN_SET_PACKET_FILTER_PARAMS (SIOCIWFIRSTPRIV + 23) |
| 2681 | #endif |
| 2682 | |
| 2683 | |
| 2684 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2685 | /* Private ioctl to get the statistics */ |
| 2686 | #define WLAN_SET_PNO (SIOCIWFIRSTPRIV + 24) |
| 2687 | #endif |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2688 | /* |
| 2689 | * <ioctl> |
| 2690 | * SETBAND - Set the operational band |
| 2691 | * |
| 2692 | * @INPUT: 0 to Auto, 1 to 5 GHz and 2 to 2.4 GHz |
| 2693 | * |
| 2694 | * @OUTPUT: None |
| 2695 | * |
| 2696 | * This IOCTL Set the operational band If the new band is different from the |
| 2697 | * current operational band, it aborts the pending scan requests, flushes |
| 2698 | * the existing scan results, and then change * the band capability |
| 2699 | * |
| 2700 | * @E.g: iwpriv wlan0 SETBAND <value> |
| 2701 | * |
| 2702 | * Supported Feature: STA |
| 2703 | * |
| 2704 | * Usage: Internal/External |
| 2705 | * |
| 2706 | * </ioctl> |
| 2707 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2708 | #define WLAN_SET_BAND_CONFIG (SIOCIWFIRSTPRIV + 25) |
| 2709 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 2710 | #define WLAN_PRIV_SET_MCBC_FILTER (SIOCIWFIRSTPRIV + 26) |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 2711 | /* (SIOCIWFIRSTPRIV + 27) is currently unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2712 | |
| 2713 | /* Private ioctls and their sub-ioctls */ |
| 2714 | #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 2715 | #define WE_SET_SMPS_PARAM 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2716 | #define WE_SET_FW_CRASH_INJECT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2717 | #define WE_DUMP_DP_TRACE_LEVEL 3 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2718 | /* Private sub ioctl for enabling and setting histogram interval of profiling */ |
| 2719 | #define WE_ENABLE_FW_PROFILE 4 |
| 2720 | #define WE_SET_FW_PROFILE_HIST_INTVL 5 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2721 | |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 2722 | /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2723 | #define WE_SET_WLAN_SUSPEND 6 |
| 2724 | #define WE_SET_WLAN_RESUME 7 |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2725 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2726 | /* |
| 2727 | * <ioctl> |
| 2728 | * log_buffer - prints host/target related communication logs via dmesg |
| 2729 | * |
| 2730 | * @INPUT: Log Id, Count |
| 2731 | * |
| 2732 | * Log Id: |
| 2733 | * 0) HTC_CREDIT_HISTORY_LOG |
| 2734 | * 1) COMMAND_LOG, |
| 2735 | * 2) COMMAND_TX_CMP_LOG, |
| 2736 | * 3) MGMT_COMMAND_LOG, |
| 2737 | * 4) MGMT_COMMAND_TX_CMP_LOG, |
| 2738 | * 5) EVENT_LOG, |
| 2739 | * 6) RX_EVENT_LOG, |
| 2740 | * 7) MGMT_EVENT_LOG |
| 2741 | * |
| 2742 | * @OUTPUT: None |
| 2743 | * |
| 2744 | * @E.g: |
| 2745 | * # print up to 10 of the most recent records from HTC Credit History |
| 2746 | * iwpriv wlan0 log_buffer 0 10 |
| 2747 | * # print up to 3 of the most recent records from Event Log |
| 2748 | * iwpriv wlan0 log_buffer 5 3 |
| 2749 | * |
| 2750 | * Supported Feature: WLAN Trace |
| 2751 | * |
| 2752 | * Usage: Internal/External |
| 2753 | * |
| 2754 | * </ioctl> |
| 2755 | */ |
| 2756 | #define WE_LOG_BUFFER 8 |
| 2757 | |
| 2758 | enum host_target_comm_log { |
| 2759 | HTC_CREDIT_HISTORY_LOG = 0, |
| 2760 | COMMAND_LOG, |
| 2761 | COMMAND_TX_CMP_LOG, |
| 2762 | MGMT_COMMAND_LOG, |
| 2763 | MGMT_COMMAND_TX_CMP_LOG, |
| 2764 | EVENT_LOG, |
| 2765 | RX_EVENT_LOG, |
| 2766 | MGMT_EVENT_LOG |
| 2767 | }; |
| 2768 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2769 | /* (SIOCIWFIRSTPRIV + 29) is currently unused */ |
| 2770 | |
| 2771 | /* 802.11p IOCTL */ |
| 2772 | #define WLAN_SET_DOT11P_CHANNEL_SCHED (SIOCIWFIRSTPRIV + 30) |
| 2773 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2774 | /* |
| 2775 | * <ioctl> |
| 2776 | * getLinkSpeed - Gets the current link speed in Mbps |
| 2777 | * |
| 2778 | * @INPUT: None |
| 2779 | * |
| 2780 | * @OUTPUT: linkspeed in mbps |
| 2781 | * wlan0 getLinkSpeed:7 |
| 2782 | * |
| 2783 | * This IOCTL is used get the current link speed in Mbps |
| 2784 | * |
| 2785 | * @E.g: iwpriv wlan0 getLinkSpeed |
| 2786 | * |
| 2787 | * Supported Feature: STA |
| 2788 | * |
| 2789 | * Usage: Internal/External |
| 2790 | * |
| 2791 | * </ioctl> |
| 2792 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2793 | #define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 2794 | |
| 2795 | #define WLAN_STATS_INVALID 0 |
| 2796 | #define WLAN_STATS_RETRY_CNT 1 |
| 2797 | #define WLAN_STATS_MUL_RETRY_CNT 2 |
| 2798 | #define WLAN_STATS_TX_FRM_CNT 3 |
| 2799 | #define WLAN_STATS_RX_FRM_CNT 4 |
| 2800 | #define WLAN_STATS_FRM_DUP_CNT 5 |
| 2801 | #define WLAN_STATS_FAIL_CNT 6 |
| 2802 | #define WLAN_STATS_RTS_FAIL_CNT 7 |
| 2803 | #define WLAN_STATS_ACK_FAIL_CNT 8 |
| 2804 | #define WLAN_STATS_RTS_SUC_CNT 9 |
| 2805 | #define WLAN_STATS_RX_DISCARD_CNT 10 |
| 2806 | #define WLAN_STATS_RX_ERROR_CNT 11 |
| 2807 | #define WLAN_STATS_TX_BYTE_CNT 12 |
| 2808 | |
| 2809 | #define WLAN_STATS_RX_BYTE_CNT 13 |
| 2810 | #define WLAN_STATS_RX_RATE 14 |
| 2811 | #define WLAN_STATS_TX_RATE 15 |
| 2812 | |
| 2813 | #define WLAN_STATS_RX_UC_BYTE_CNT 16 |
| 2814 | #define WLAN_STATS_RX_MC_BYTE_CNT 17 |
| 2815 | #define WLAN_STATS_RX_BC_BYTE_CNT 18 |
| 2816 | #define WLAN_STATS_TX_UC_BYTE_CNT 19 |
| 2817 | #define WLAN_STATS_TX_MC_BYTE_CNT 20 |
| 2818 | #define WLAN_STATS_TX_BC_BYTE_CNT 21 |
| 2819 | |
| 2820 | #define FILL_TLV(__p, __type, __size, __val, __tlen) do { \ |
| 2821 | if ((__tlen + __size + 2) < WE_MAX_STR_LEN) { \ |
| 2822 | *__p++ = __type; \ |
| 2823 | *__p++ = __size; \ |
| 2824 | memcpy(__p, __val, __size); \ |
| 2825 | __p += __size; \ |
| 2826 | __tlen += __size + 2; \ |
| 2827 | } else { \ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2828 | hdd_err("FILL_TLV Failed!!!"); \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2829 | } \ |
| 2830 | } while (0) |
| 2831 | |
| 2832 | #define VERSION_VALUE_MAX_LEN 32 |
| 2833 | |
| 2834 | #define TX_PER_TRACKING_DEFAULT_RATIO 5 |
| 2835 | #define TX_PER_TRACKING_MAX_RATIO 10 |
| 2836 | #define TX_PER_TRACKING_DEFAULT_WATERMARK 5 |
| 2837 | |
| 2838 | #define WLAN_ADAPTER 0 |
| 2839 | #define P2P_ADAPTER 1 |
| 2840 | |
| 2841 | /** |
| 2842 | * mem_alloc_copy_from_user_helper - copy from user helper |
| 2843 | * @wrqu_data: wireless extensions request data |
| 2844 | * @len: length of @wrqu_data |
| 2845 | * |
| 2846 | * Helper function to allocate buffer and copy user data. |
| 2847 | * |
| 2848 | * Return: On success return a pointer to a kernel buffer containing a |
| 2849 | * copy of the userspace data (with an additional NUL character |
| 2850 | * appended for safety). On failure return %NULL. |
| 2851 | */ |
| 2852 | void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len) |
| 2853 | { |
| 2854 | u8 *ptr = NULL; |
| 2855 | |
| 2856 | /* in order to protect the code, an extra byte is post |
| 2857 | * appended to the buffer and the null termination is added. |
| 2858 | * However, when allocating (len+1) byte of memory, we need to |
| 2859 | * make sure that there is no uint overflow when doing |
| 2860 | * addition. In theory check len < UINT_MAX protects the uint |
| 2861 | * overflow. For wlan private ioctl, the buffer size is much |
| 2862 | * less than UINT_MAX, as a good guess, now, it is assumed |
| 2863 | * that the private command buffer size is no greater than 4K |
| 2864 | * (4096 bytes). So we use 4096 as the upper boundary for now. |
| 2865 | */ |
| 2866 | if (len > MAX_USER_COMMAND_SIZE) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 2867 | hdd_err("Invalid length: %zu max: %u", |
| 2868 | len, MAX_USER_COMMAND_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2869 | return NULL; |
| 2870 | } |
| 2871 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2872 | ptr = qdf_mem_malloc(len + 1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2873 | if (NULL == ptr) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2874 | hdd_err("unable to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2875 | return NULL; |
| 2876 | } |
| 2877 | |
| 2878 | if (copy_from_user(ptr, wrqu_data, len)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2879 | hdd_err("failed to copy data to user buffer"); |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2880 | qdf_mem_free(ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2881 | return NULL; |
| 2882 | } |
| 2883 | ptr[len] = '\0'; |
| 2884 | return ptr; |
| 2885 | } |
| 2886 | |
| 2887 | /** |
| 2888 | * hdd_priv_get_data() - Get pointer to ioctl private data |
| 2889 | * @p_priv_data: pointer to iw_point struct to be filled |
| 2890 | * @wrqu: Pointer to IOCTL Data received from userspace |
| 2891 | * |
| 2892 | * Helper function to get compatible struct iw_point passed to ioctl |
| 2893 | * |
| 2894 | * Return - 0 if p_priv_data successfully filled, error otherwise |
| 2895 | */ |
| 2896 | int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) |
| 2897 | { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2898 | if ((NULL == p_priv_data) || (NULL == wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2899 | return -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2900 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2901 | #ifdef CONFIG_COMPAT |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 2902 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2903 | struct compat_iw_point *p_compat_priv_data; |
| 2904 | |
| 2905 | /* Compat task: |
| 2906 | * typecast to compat structure and copy the members. |
| 2907 | */ |
| 2908 | p_compat_priv_data = (struct compat_iw_point *)&wrqu->data; |
| 2909 | |
| 2910 | p_priv_data->pointer = compat_ptr(p_compat_priv_data->pointer); |
| 2911 | p_priv_data->length = p_compat_priv_data->length; |
| 2912 | p_priv_data->flags = p_compat_priv_data->flags; |
| 2913 | } else { |
| 2914 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2915 | |
| 2916 | /* Non compat task: directly copy the structure. */ |
| 2917 | memcpy(p_priv_data, &wrqu->data, sizeof(struct iw_point)); |
| 2918 | |
| 2919 | #ifdef CONFIG_COMPAT |
| 2920 | } |
| 2921 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2922 | |
| 2923 | return 0; |
| 2924 | } |
| 2925 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2926 | static int hdd_check_wext_control(enum hdd_wext_control wext_control, |
| 2927 | struct iw_request_info *info) |
| 2928 | { |
| 2929 | switch (wext_control) { |
| 2930 | default: |
| 2931 | case hdd_wext_disabled: |
| 2932 | hdd_err("Rejecting disabled ioctl %x", info->cmd); |
| 2933 | return -ENOTSUPP; |
| 2934 | case hdd_wext_deprecated: |
| 2935 | hdd_warn("Using deprecated ioctl %x", info->cmd); |
| 2936 | return 0; |
| 2937 | case hdd_wext_enabled: |
| 2938 | return 0; |
| 2939 | } |
| 2940 | } |
| 2941 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 2942 | int hdd_check_private_wext_control(struct hdd_context *hdd_ctx, |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2943 | struct iw_request_info *info) |
| 2944 | { |
| 2945 | return hdd_check_wext_control(hdd_ctx->config->private_wext_control, |
| 2946 | info); |
| 2947 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2948 | |
| 2949 | /** |
| 2950 | * hdd_wlan_get_stats() - Get txrx stats in SAP mode |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 2951 | * @adapter: Pointer to the hdd adapter. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2952 | * @length: Size of the data copied |
| 2953 | * @buffer: Pointer to char buffer. |
| 2954 | * @buf_len: Length of the char buffer. |
| 2955 | * |
| 2956 | * This function called when the "iwpriv wlan0 get_stats" command is given. |
| 2957 | * It used to collect the txrx stats when the device is configured in SAP mode. |
| 2958 | * |
| 2959 | * Return - none |
| 2960 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 2961 | void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2962 | char *buffer, uint16_t buf_len) |
| 2963 | { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2964 | struct hdd_tx_rx_stats *stats = &adapter->hdd_stats.tx_rx_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2965 | uint32_t len = 0; |
| 2966 | uint32_t total_rx_pkt = 0, total_rx_dropped = 0; |
| 2967 | uint32_t total_rx_delv = 0, total_rx_refused = 0; |
| 2968 | int i = 0; |
| 2969 | |
| 2970 | for (; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2971 | total_rx_pkt += stats->rx_packets[i]; |
| 2972 | total_rx_dropped += stats->rx_dropped[i]; |
| 2973 | total_rx_delv += stats->rx_delivered[i]; |
| 2974 | total_rx_refused += stats->rx_refused[i]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2975 | } |
| 2976 | |
| 2977 | len = scnprintf(buffer, buf_len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2978 | "\nTransmit[%lu] - " |
Mohit Khanna | d0b63f5 | 2017-02-18 18:05:52 -0800 | [diff] [blame] | 2979 | "called %u, dropped %u orphan %u," |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2980 | "\n[dropped] BK %u, BE %u, VI %u, VO %u" |
| 2981 | "\n[classified] BK %u, BE %u, VI %u, VO %u" |
| 2982 | "\n\nReceive[%lu] - " |
| 2983 | "packets %u, dropped %u, delivered %u, refused %u" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2984 | "\n", |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2985 | qdf_system_ticks(), |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2986 | stats->tx_called, |
| 2987 | stats->tx_dropped, |
| 2988 | stats->tx_orphaned, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2989 | |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2990 | stats->tx_dropped_ac[SME_AC_BK], |
| 2991 | stats->tx_dropped_ac[SME_AC_BE], |
| 2992 | stats->tx_dropped_ac[SME_AC_VI], |
| 2993 | stats->tx_dropped_ac[SME_AC_VO], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2994 | |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2995 | stats->tx_classified_ac[SME_AC_BK], |
| 2996 | stats->tx_classified_ac[SME_AC_BE], |
| 2997 | stats->tx_classified_ac[SME_AC_VI], |
| 2998 | stats->tx_classified_ac[SME_AC_VO], |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2999 | qdf_system_ticks(), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3000 | total_rx_pkt, total_rx_dropped, total_rx_delv, total_rx_refused |
| 3001 | ); |
| 3002 | |
| 3003 | for (i = 0; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3004 | if (stats->rx_packets[i] == 0) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3005 | continue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3006 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3007 | "Rx CPU[%d]:" |
| 3008 | "packets %u, dropped %u, delivered %u, refused %u\n", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3009 | i, stats->rx_packets[i], stats->rx_dropped[i], |
| 3010 | stats->rx_delivered[i], stats->rx_refused[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3011 | } |
| 3012 | |
| 3013 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3014 | "\nTX_FLOW" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3015 | "\nCurrent status: %s" |
| 3016 | "\ntx-flow timer start count %u" |
| 3017 | "\npause count %u, unpause count %u", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3018 | (stats->is_txflow_paused == true ? "PAUSED" : "UNPAUSED"), |
| 3019 | stats->txflow_timer_cnt, |
| 3020 | stats->txflow_pause_cnt, |
| 3021 | stats->txflow_unpause_cnt); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3022 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 3023 | len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3024 | adapter->session_id, &buffer[len], (buf_len - len)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3025 | *length = len + 1; |
| 3026 | } |
| 3027 | |
| 3028 | /** |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3029 | * wlan_hdd_write_suspend_resume_stats() - Writes suspend/resume stats to buffer |
| 3030 | * @hdd_ctx: The Hdd context owning the stats to be written |
| 3031 | * @buffer: The char buffer to write to |
| 3032 | * @max_len: The maximum number of chars to write |
| 3033 | * |
| 3034 | * This assumes hdd_ctx has already been validated, and buffer is not NULL. |
| 3035 | * |
| 3036 | * Return - length of written content, negative number on error |
| 3037 | */ |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3038 | #ifdef QCA_SUPPORT_CP_STATS |
| 3039 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
| 3040 | char *buffer, uint16_t max_len) |
| 3041 | { |
| 3042 | int ret; |
| 3043 | QDF_STATUS status; |
| 3044 | struct suspend_resume_stats *sr_stats; |
| 3045 | |
| 3046 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3047 | ret = scnprintf(buffer, max_len, |
| 3048 | "\n" |
| 3049 | "Suspends: %u\n" |
| 3050 | "Resumes: %u\n" |
| 3051 | "\n" |
| 3052 | "Suspend Fail Reasons\n" |
| 3053 | "\tIPA: %u\n" |
| 3054 | "\tRadar: %u\n" |
| 3055 | "\tRoam: %u\n" |
| 3056 | "\tScan: %u\n" |
| 3057 | "\tInitial Wakeup: %u\n" |
| 3058 | "\n", |
| 3059 | sr_stats->suspends, sr_stats->resumes, |
| 3060 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3061 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3062 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3063 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3064 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]); |
| 3065 | |
| 3066 | status = ucfg_mc_cp_stats_write_wow_stats(hdd_ctx->hdd_psoc, |
| 3067 | &buffer[ret], max_len - ret, |
| 3068 | &ret); |
| 3069 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3070 | hdd_err("Failed to get WoW stats"); |
| 3071 | return qdf_status_to_os_return(status); |
| 3072 | } |
| 3073 | |
| 3074 | return ret; |
| 3075 | } |
| 3076 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3077 | 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] | 3078 | char *buffer, uint16_t max_len) |
| 3079 | { |
| 3080 | QDF_STATUS status; |
| 3081 | struct suspend_resume_stats *sr_stats; |
| 3082 | struct sir_wake_lock_stats wow_stats; |
| 3083 | |
| 3084 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3085 | |
| 3086 | status = wma_get_wakelock_stats(&wow_stats); |
| 3087 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3088 | hdd_err("Failed to get WoW stats"); |
| 3089 | return qdf_status_to_os_return(status); |
| 3090 | } |
| 3091 | |
| 3092 | return scnprintf(buffer, max_len, |
| 3093 | "\n" |
| 3094 | "Suspends: %u\n" |
| 3095 | "Resumes: %u\n" |
| 3096 | "\n" |
| 3097 | "Suspend Fail Reasons\n" |
| 3098 | "\tIPA: %u\n" |
| 3099 | "\tRadar: %u\n" |
| 3100 | "\tRoam: %u\n" |
| 3101 | "\tScan: %u\n" |
| 3102 | "\tInitial Wakeup: %u\n" |
| 3103 | "\n" |
| 3104 | "WoW Wake Reasons\n" |
| 3105 | "\tunicast: %u\n" |
| 3106 | "\tbroadcast: %u\n" |
| 3107 | "\tIPv4 multicast: %u\n" |
| 3108 | "\tIPv6 multicast: %u\n" |
| 3109 | "\tIPv6 multicast RA: %u\n" |
| 3110 | "\tIPv6 multicast NS: %u\n" |
| 3111 | "\tIPv6 multicast NA: %u\n" |
| 3112 | "\tICMPv4: %u\n" |
| 3113 | "\tICMPv6: %u\n" |
| 3114 | "\tRSSI Breach: %u\n" |
| 3115 | "\tLow RSSI: %u\n" |
| 3116 | "\tG-Scan: %u\n" |
| 3117 | "\tPNO Complete: %u\n" |
| 3118 | "\tPNO Match: %u\n", |
| 3119 | sr_stats->suspends, |
| 3120 | sr_stats->resumes, |
| 3121 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3122 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3123 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3124 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3125 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP], |
| 3126 | wow_stats.wow_ucast_wake_up_count, |
| 3127 | wow_stats.wow_bcast_wake_up_count, |
| 3128 | wow_stats.wow_ipv4_mcast_wake_up_count, |
| 3129 | wow_stats.wow_ipv6_mcast_wake_up_count, |
| 3130 | wow_stats.wow_ipv6_mcast_ra_stats, |
| 3131 | wow_stats.wow_ipv6_mcast_ns_stats, |
| 3132 | wow_stats.wow_ipv6_mcast_na_stats, |
| 3133 | wow_stats.wow_icmpv4_count, |
| 3134 | wow_stats.wow_icmpv6_count, |
| 3135 | wow_stats.wow_rssi_breach_wake_up_count, |
| 3136 | wow_stats.wow_low_rssi_wake_up_count, |
| 3137 | wow_stats.wow_gscan_wake_up_count, |
| 3138 | wow_stats.wow_pno_complete_wake_up_count, |
| 3139 | wow_stats.wow_pno_match_wake_up_count); |
| 3140 | } |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3141 | #endif |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3142 | /** |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3143 | * hdd_wlan_list_fw_profile() - Get fw profiling points |
| 3144 | * @length: Size of the data copied |
| 3145 | * @buffer: Pointer to char buffer. |
| 3146 | * @buf_len: Length of the char buffer. |
| 3147 | * |
| 3148 | * This function called when the "iwpriv wlan0 listProfile" command is given. |
| 3149 | * It is used to get the supported profiling points in FW. |
| 3150 | * |
| 3151 | * Return - none |
| 3152 | */ |
| 3153 | void hdd_wlan_list_fw_profile(uint16_t *length, |
| 3154 | char *buffer, uint16_t buf_len) |
| 3155 | { |
| 3156 | uint32_t len = 0; |
| 3157 | |
| 3158 | len = scnprintf(buffer, buf_len, |
| 3159 | "PROF_CPU_IDLE: %u\n" |
| 3160 | "PROF_PPDU_PROC: %u\n" |
| 3161 | "PROF_PPDU_POST: %u\n" |
| 3162 | "PROF_HTT_TX_INPUT: %u\n" |
| 3163 | "PROF_MSDU_ENQ: %u\n" |
| 3164 | "PROF_PPDU_POST_HAL: %u\n" |
| 3165 | "PROF_COMPUTE_TX_TIME: %u\n", |
| 3166 | PROF_CPU_IDLE, |
| 3167 | PROF_PPDU_PROC, |
| 3168 | PROF_PPDU_POST, |
| 3169 | PROF_HTT_TX_INPUT, |
| 3170 | PROF_MSDU_ENQ, |
| 3171 | PROF_PPDU_POST_HAL, |
| 3172 | PROF_COMPUTE_TX_TIME); |
| 3173 | |
| 3174 | *length = len + 1; |
| 3175 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3176 | /** |
| 3177 | * hdd_display_stats_help() - print statistics help |
| 3178 | * |
| 3179 | * Return: none |
| 3180 | */ |
Jeff Johnson | a06efaa | 2018-04-18 09:43:21 -0700 | [diff] [blame] | 3181 | static void hdd_display_stats_help(void) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3182 | { |
Nirav Shah | e6194ac | 2018-07-13 11:04:41 +0530 | [diff] [blame] | 3183 | hdd_nofl_info("iwpriv wlan0 dumpStats [option] - dump statistics"); |
| 3184 | hdd_nofl_info("iwpriv wlan0 clearStats [option] - clear statistics"); |
| 3185 | hdd_nofl_info("options:"); |
| 3186 | hdd_nofl_info(" 1 -- TXRX PATH statistics"); |
| 3187 | hdd_nofl_info(" 2 -- TXRX HIST statistics"); |
| 3188 | hdd_nofl_info(" 3 -- TSO statistics"); |
| 3189 | hdd_nofl_info(" 4 -- Network queue statistics"); |
| 3190 | hdd_nofl_info(" 5 -- Flow control statistics"); |
| 3191 | hdd_nofl_info(" 6 -- Per Layer statistics"); |
| 3192 | hdd_nofl_info(" 7 -- Copy engine interrupt statistics"); |
| 3193 | hdd_nofl_info(" 9 -- NAPI statistics"); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3194 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3195 | |
| 3196 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3197 | * hdd_wlan_dump_stats() - display dump Stats |
| 3198 | * @adapter: adapter handle |
| 3199 | * @value: value from user |
| 3200 | * |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3201 | * Return: 0 => success, error code on failure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3202 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3203 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3204 | { |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3205 | int ret = 0; |
| 3206 | QDF_STATUS status; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3207 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3208 | |
| 3209 | switch (value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3210 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3211 | wlan_hdd_display_tx_rx_histogram(hdd_ctx); |
| 3212 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3213 | |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3214 | case CDP_HDD_NETIF_OPER_HISTORY: |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 3215 | wlan_hdd_display_netif_queue_history |
| 3216 | (hdd_ctx, |
| 3217 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3218 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3219 | |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3220 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 3221 | hdd_display_hif_stats(); |
| 3222 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3223 | |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3224 | case CDP_LRO_STATS: |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3225 | hdd_lro_display_stats(hdd_ctx); |
Alok Kumar | f28ca24 | 2018-05-07 17:51:38 +0530 | [diff] [blame] | 3226 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3227 | |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3228 | case CDP_NAPI_STATS: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3229 | if (hdd_display_napi_stats()) { |
| 3230 | hdd_err("error displaying napi stats"); |
| 3231 | ret = EFAULT; |
| 3232 | } |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3233 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3234 | |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3235 | case CDP_DISCONNECT_STATS: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3236 | sme_display_disconnect_stats(hdd_ctx->mac_handle, |
| 3237 | adapter->session_id); |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3238 | break; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 3239 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3240 | default: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3241 | status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3242 | value, |
| 3243 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3244 | if (status == QDF_STATUS_E_INVAL) { |
| 3245 | hdd_display_stats_help(); |
| 3246 | ret = EINVAL; |
| 3247 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3248 | break; |
| 3249 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3250 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3251 | } |
| 3252 | |
| 3253 | /** |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3254 | * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3255 | * @adapter: Adapter upon which the IBSS client is active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3256 | * @staIdx: Station index of the IBSS peer |
| 3257 | * |
| 3258 | * Return: QDF_STATUS_STATUS if the peer was found and displayed, |
| 3259 | * otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3260 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3261 | static QDF_STATUS hdd_wlan_get_ibss_peer_info(struct hdd_adapter *adapter, |
Jeff Johnson | af2a093 | 2016-10-05 14:52:57 -0700 | [diff] [blame] | 3262 | uint8_t staIdx) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3263 | { |
| 3264 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3265 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3266 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3267 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3268 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3269 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3270 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3271 | hdd_get_ibss_peer_info_cb, |
| 3272 | false, staIdx); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3273 | |
| 3274 | if (QDF_STATUS_SUCCESS == status) { |
| 3275 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3276 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3277 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3278 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3279 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3280 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3281 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3282 | return QDF_STATUS_E_FAILURE; |
| 3283 | } |
| 3284 | |
| 3285 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3286 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", pPeerInfo->numPeers); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3287 | { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3288 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3289 | uint32_t tx_rate = pPeerInfo->peerInfoParams[0].txRate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3290 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3291 | qdf_mem_copy(mac_addr, pPeerInfo->peerInfoParams[0]. |
| 3292 | mac_addr, sizeof(mac_addr)); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3293 | hdd_debug("PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3294 | mac_addr, (int)tx_rate, |
| 3295 | (int)pPeerInfo->peerInfoParams[0].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3296 | } |
| 3297 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3298 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3299 | } |
| 3300 | |
| 3301 | return status; |
| 3302 | } |
| 3303 | |
| 3304 | /** |
| 3305 | * hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3306 | * @adapter: Adapter upon which the IBSS clients are active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3307 | * |
| 3308 | * Return: QDF_STATUS_STATUS if the peer information was retrieved and |
| 3309 | * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3310 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3311 | 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] | 3312 | { |
| 3313 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3314 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3315 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3316 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3317 | int i; |
| 3318 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3319 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3320 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3321 | hdd_get_ibss_peer_info_cb, |
| 3322 | true, 0xFF); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3323 | |
| 3324 | if (QDF_STATUS_SUCCESS == status) { |
| 3325 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3326 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3327 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3328 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3329 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3330 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3331 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3332 | return QDF_STATUS_E_FAILURE; |
| 3333 | } |
| 3334 | |
| 3335 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3336 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3337 | (int)pPeerInfo->numPeers); |
| 3338 | for (i = 0; i < pPeerInfo->numPeers; i++) { |
| 3339 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3340 | uint32_t tx_rate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3341 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3342 | tx_rate = pPeerInfo->peerInfoParams[i].txRate; |
| 3343 | qdf_mem_copy(mac_addr, |
| 3344 | pPeerInfo->peerInfoParams[i].mac_addr, |
| 3345 | sizeof(mac_addr)); |
| 3346 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3347 | hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3348 | mac_addr, (int)tx_rate, |
| 3349 | (int)pPeerInfo->peerInfoParams[i].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3350 | } |
| 3351 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3352 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3353 | } |
| 3354 | |
| 3355 | return status; |
| 3356 | } |
| 3357 | |
| 3358 | /** |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3359 | * hdd_get_ldpc() - Get adapter LDPC |
| 3360 | * @adapter: adapter being queried |
| 3361 | * @value: where to store the value |
| 3362 | * |
| 3363 | * Return: 0 on success, negative errno on failure |
| 3364 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3365 | int hdd_get_ldpc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3366 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3367 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3368 | int ret; |
| 3369 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3370 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3371 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3372 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING); |
| 3373 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3374 | hdd_err("Failed to get LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3375 | } else { |
| 3376 | *value = ret; |
| 3377 | ret = 0; |
| 3378 | } |
| 3379 | return ret; |
| 3380 | } |
| 3381 | |
| 3382 | /** |
| 3383 | * hdd_set_ldpc() - Set adapter LDPC |
| 3384 | * @adapter: adapter being modified |
| 3385 | * @value: new LDPC value |
| 3386 | * |
| 3387 | * Return: 0 on success, negative errno on failure |
| 3388 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3389 | int hdd_set_ldpc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3390 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3391 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3392 | int ret; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3393 | QDF_STATUS status; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3394 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 3395 | struct hdd_config *config = hdd_ctx->config; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3396 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3397 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3398 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3399 | if (value) { |
| 3400 | /* make sure HT capabilities allow this */ |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3401 | if (!config->enable_rx_ldpc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3402 | hdd_err("LDCP not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3403 | return -EINVAL; |
| 3404 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3405 | } else if (!config->enable_rx_ldpc) { |
| 3406 | hdd_err("LDCP is already disabled"); |
| 3407 | return 0; |
| 3408 | } |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3409 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->hdd_psoc, &ht_cap_info); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3410 | if (QDF_STATUS_SUCCESS != status) { |
| 3411 | hdd_err("Failed to get HT capability info"); |
| 3412 | return -EIO; |
| 3413 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3414 | |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3415 | ht_cap_info.advCodingCap = value; |
| 3416 | status = ucfg_mlme_set_ht_cap_info(hdd_ctx->hdd_psoc, ht_cap_info); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3417 | if (QDF_STATUS_SUCCESS != status) { |
| 3418 | hdd_err("Failed to set HT capability info"); |
| 3419 | return -EIO; |
| 3420 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3421 | status = sme_cfg_set_int(mac_handle, WNI_CFG_VHT_LDPC_CODING_CAP, |
| 3422 | value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3423 | if (QDF_STATUS_SUCCESS != status) { |
| 3424 | hdd_err("Failed to set VHT LDPC capability info"); |
| 3425 | return -EIO; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3426 | } |
| 3427 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3428 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3429 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING, |
| 3430 | value); |
| 3431 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3432 | hdd_err("Failed to set LDPC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3433 | ret = sme_update_he_ldpc_supp(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3434 | if (ret) |
| 3435 | hdd_err("Failed to set HE LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3436 | |
| 3437 | return ret; |
| 3438 | } |
| 3439 | |
| 3440 | /** |
| 3441 | * hdd_get_tx_stbc() - Get adapter TX STBC |
| 3442 | * @adapter: adapter being queried |
| 3443 | * @value: where to store the value |
| 3444 | * |
| 3445 | * Return: 0 on success, negative errno on failure |
| 3446 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3447 | int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3448 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3449 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3450 | int ret; |
| 3451 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3452 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3453 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3454 | WNI_CFG_HT_CAP_INFO_TX_STBC); |
| 3455 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3456 | hdd_err("Failed to get TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3457 | } else { |
| 3458 | *value = ret; |
| 3459 | ret = 0; |
| 3460 | } |
| 3461 | |
| 3462 | return ret; |
| 3463 | } |
| 3464 | |
| 3465 | /** |
| 3466 | * hdd_set_tx_stbc() - Set adapter TX STBC |
| 3467 | * @adapter: adapter being modified |
| 3468 | * @value: new TX STBC value |
| 3469 | * |
| 3470 | * Return: 0 on success, negative errno on failure |
| 3471 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3472 | int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3473 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3474 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3475 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3476 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3477 | QDF_STATUS status; |
| 3478 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3479 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3480 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3481 | if (value) { |
| 3482 | /* make sure HT capabilities allow this */ |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3483 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->hdd_psoc, |
| 3484 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3485 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3486 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3487 | return -EIO; |
| 3488 | } |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3489 | if (!ht_cap_info.txSTBC) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3490 | hdd_err("TX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3491 | return -EINVAL; |
| 3492 | } |
| 3493 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3494 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3495 | WNI_CFG_HT_CAP_INFO_TX_STBC, |
| 3496 | value); |
| 3497 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3498 | hdd_err("Failed to set TX STBC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3499 | ret = sme_update_he_tx_stbc_cap(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3500 | if (ret) |
| 3501 | hdd_err("Failed to set HE TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3502 | |
| 3503 | return ret; |
| 3504 | } |
| 3505 | |
| 3506 | /** |
| 3507 | * hdd_get_rx_stbc() - Get adapter RX STBC |
| 3508 | * @adapter: adapter being queried |
| 3509 | * @value: where to store the value |
| 3510 | * |
| 3511 | * Return: 0 on success, negative errno on failure |
| 3512 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3513 | int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3514 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3515 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3516 | int ret; |
| 3517 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3518 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3519 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3520 | WNI_CFG_HT_CAP_INFO_RX_STBC); |
| 3521 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3522 | hdd_err("Failed to get RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3523 | } else { |
| 3524 | *value = ret; |
| 3525 | ret = 0; |
| 3526 | } |
| 3527 | |
| 3528 | return ret; |
| 3529 | } |
| 3530 | |
| 3531 | /** |
| 3532 | * hdd_set_rx_stbc() - Set adapter RX STBC |
| 3533 | * @adapter: adapter being modified |
| 3534 | * @value: new RX STBC value |
| 3535 | * |
| 3536 | * Return: 0 on success, negative errno on failure |
| 3537 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3538 | int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3539 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3540 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3541 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3542 | int ret; |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3543 | QDF_STATUS status; |
| 3544 | struct mlme_ht_capabilities_info ht_cap_info; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3545 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3546 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3547 | if (value) { |
| 3548 | /* make sure HT capabilities allow this */ |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3549 | status = ucfg_mlme_get_ht_cap_info(hdd_ctx->hdd_psoc, |
| 3550 | &ht_cap_info); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3551 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3552 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3553 | return -EIO; |
| 3554 | } |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame^] | 3555 | if (!ht_cap_info.rxSTBC) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3556 | hdd_warn("RX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3557 | return -EINVAL; |
| 3558 | } |
| 3559 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3560 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3561 | WNI_CFG_HT_CAP_INFO_RX_STBC, |
| 3562 | value); |
| 3563 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3564 | hdd_err("Failed to set RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3565 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3566 | ret = sme_update_he_rx_stbc_cap(mac_handle, adapter->session_id, value); |
Kiran Kumar Lokere | 13dedac | 2018-02-05 19:51:59 -0800 | [diff] [blame] | 3567 | if (ret) |
| 3568 | hdd_err("Failed to set HE RX STBC value"); |
| 3569 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3570 | return ret; |
| 3571 | } |
| 3572 | |
| 3573 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3574 | * iw_get_linkspeed() - Get current link speed ioctl |
| 3575 | * @dev: device upon which the ioctl was received |
| 3576 | * @info: ioctl request information |
| 3577 | * @wrqu: ioctl request data |
| 3578 | * @extra: extra ioctl buffer |
| 3579 | * |
| 3580 | * Return: 0 on success, non-zero on error |
| 3581 | */ |
| 3582 | static int __iw_get_linkspeed(struct net_device *dev, |
| 3583 | struct iw_request_info *info, |
| 3584 | union iwreq_data *wrqu, char *extra) |
| 3585 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3586 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3587 | char *pLinkSpeed = (char *)extra; |
| 3588 | int len = sizeof(uint32_t) + 1; |
| 3589 | uint32_t link_speed = 0; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3590 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3591 | int ret; |
| 3592 | int rc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3593 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 3594 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 3595 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3596 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3597 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 3598 | if (0 != ret) |
| 3599 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3600 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3601 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 3602 | if (0 != ret) |
| 3603 | return ret; |
| 3604 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3605 | ret = wlan_hdd_get_link_speed(adapter, &link_speed); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3606 | if (0 != ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3607 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3608 | |
| 3609 | wrqu->data.length = len; |
| 3610 | /* return the linkspeed as a string */ |
| 3611 | rc = snprintf(pLinkSpeed, len, "%u", link_speed); |
| 3612 | if ((rc < 0) || (rc >= len)) { |
| 3613 | /* encoding or length error? */ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3614 | hdd_err("Unable to encode link speed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3615 | return -EIO; |
| 3616 | } |
| 3617 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 3618 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3619 | /* a value is being successfully returned */ |
| 3620 | return 0; |
| 3621 | } |
| 3622 | |
| 3623 | static int iw_get_linkspeed(struct net_device *dev, |
| 3624 | struct iw_request_info *info, |
| 3625 | union iwreq_data *wrqu, char *extra) |
| 3626 | { |
| 3627 | int ret; |
| 3628 | |
| 3629 | cds_ssr_protect(__func__); |
| 3630 | ret = __iw_get_linkspeed(dev, info, wrqu, extra); |
| 3631 | cds_ssr_unprotect(__func__); |
| 3632 | |
| 3633 | return ret; |
| 3634 | } |
| 3635 | |
| 3636 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3637 | * wlan_hdd_update_phymode() - handle change in PHY mode |
| 3638 | * @net: device upon which PHY mode change was received |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3639 | * @mac_handle: umac handle for the driver |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3640 | * @new_phymode: new PHY mode for the device |
| 3641 | * @phddctx: pointer to the HDD context |
| 3642 | * |
| 3643 | * This function is called when the device is set to a new PHY mode. |
| 3644 | * It takes a holistic look at the desired PHY mode along with the |
| 3645 | * configured capabilities of the driver and the reported capabilities |
| 3646 | * of the hardware in order to correctly configure all PHY-related |
| 3647 | * parameters. |
| 3648 | * |
| 3649 | * Return: 0 on success, negative errno value on error |
| 3650 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3651 | int wlan_hdd_update_phymode(struct net_device *net, mac_handle_t mac_handle, |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3652 | int new_phymode, struct hdd_context *phddctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3653 | { |
| 3654 | #ifdef QCA_HT_2040_COEX |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3655 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(net); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3656 | QDF_STATUS halStatus = QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3657 | #endif |
| 3658 | bool band_24 = false, band_5g = false; |
| 3659 | bool ch_bond24 = false, ch_bond5g = false; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3660 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3661 | uint32_t chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3662 | uint32_t vhtchanwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3663 | eCsrPhyMode phymode = -EIO, old_phymode; |
Srinivas Girigowda | 2fb677c | 2017-03-25 15:35:34 -0700 | [diff] [blame] | 3664 | enum hdd_dot11_mode hdd_dot11mode = phddctx->config->dot11Mode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3665 | enum band_info curr_band = BAND_ALL; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3666 | int retval = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3667 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3668 | old_phymode = sme_get_phy_mode(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3669 | |
| 3670 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
| 3671 | sme_get_cb_phy_state_from_cb_ini_value(phddctx->config-> |
| 3672 | nChannelBondingMode24GHz)) |
| 3673 | ch_bond24 = true; |
| 3674 | |
| 3675 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
| 3676 | sme_get_cb_phy_state_from_cb_ini_value(phddctx->config-> |
| 3677 | nChannelBondingMode5GHz)) |
| 3678 | ch_bond5g = true; |
| 3679 | |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3680 | if (phddctx->config->nBandCapability == BAND_ALL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3681 | band_24 = band_5g = true; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3682 | else if (phddctx->config->nBandCapability == BAND_2G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3683 | band_24 = true; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3684 | else if (phddctx->config->nBandCapability == BAND_5G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3685 | band_5g = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3686 | |
| 3687 | vhtchanwidth = phddctx->config->vhtChannelWidth; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3688 | 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] | 3689 | ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth); |
| 3690 | |
| 3691 | switch (new_phymode) { |
| 3692 | case IEEE80211_MODE_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3693 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3694 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3695 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3696 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3697 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3698 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3699 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3700 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3701 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3702 | return -EIO; |
| 3703 | } |
| 3704 | break; |
| 3705 | case IEEE80211_MODE_11A: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3706 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11a); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3707 | 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] | 3708 | phymode = eCSR_DOT11_MODE_11a; |
| 3709 | hdd_dot11mode = eHDD_DOT11_MODE_11a; |
| 3710 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3711 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3712 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3713 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3714 | return -EIO; |
| 3715 | } |
| 3716 | break; |
| 3717 | case IEEE80211_MODE_11B: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3718 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11b); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3719 | 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] | 3720 | phymode = eCSR_DOT11_MODE_11b; |
| 3721 | hdd_dot11mode = eHDD_DOT11_MODE_11b; |
| 3722 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3723 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3724 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3725 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3726 | return -EIO; |
| 3727 | } |
| 3728 | break; |
| 3729 | case IEEE80211_MODE_11G: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3730 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11g); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3731 | 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] | 3732 | phymode = eCSR_DOT11_MODE_11g; |
| 3733 | hdd_dot11mode = eHDD_DOT11_MODE_11g; |
| 3734 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3735 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3736 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3737 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3738 | return -EIO; |
| 3739 | } |
| 3740 | break; |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 3741 | /* 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] | 3742 | * so setting phymode as eCSR_DOT11_MODE_11n and updating the band |
| 3743 | * and channel bonding in configuration to reflect MODE_11NA/MODE_11NG |
| 3744 | */ |
| 3745 | case IEEE80211_MODE_11NA_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3746 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3747 | 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] | 3748 | phymode = eCSR_DOT11_MODE_11n; |
| 3749 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3750 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3751 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3752 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3753 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3754 | return -EIO; |
| 3755 | } |
| 3756 | break; |
| 3757 | case IEEE80211_MODE_11NA_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3758 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3759 | 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] | 3760 | phymode = eCSR_DOT11_MODE_11n; |
| 3761 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3762 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3763 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3764 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3765 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3766 | return -EIO; |
| 3767 | } |
| 3768 | break; |
| 3769 | case IEEE80211_MODE_11NG_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3770 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3771 | 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] | 3772 | phymode = eCSR_DOT11_MODE_11n; |
| 3773 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3774 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3775 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3776 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3777 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3778 | return -EIO; |
| 3779 | } |
| 3780 | break; |
| 3781 | case IEEE80211_MODE_11NG_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3782 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3783 | 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] | 3784 | phymode = eCSR_DOT11_MODE_11n; |
| 3785 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3786 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3787 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3788 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3789 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3790 | return -EIO; |
| 3791 | } |
| 3792 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3793 | case IEEE80211_MODE_11AC_VHT20: |
| 3794 | case IEEE80211_MODE_11AC_VHT40: |
| 3795 | case IEEE80211_MODE_11AC_VHT80: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3796 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11ac); |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3797 | phymode = eCSR_DOT11_MODE_11ac; |
| 3798 | hdd_dot11mode = eHDD_DOT11_MODE_11ac; |
| 3799 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3800 | if (band_5g && band_24) { |
| 3801 | curr_band = BAND_ALL; |
| 3802 | break; |
| 3803 | } else if (band_5g) { |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3804 | curr_band = BAND_5G; |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3805 | break; |
| 3806 | } else if (new_phymode != IEEE80211_MODE_11AC_VHT80) { |
| 3807 | curr_band = BAND_2G; |
| 3808 | break; |
| 3809 | } |
| 3810 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
| 3811 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3812 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3813 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3814 | return -EIO; |
| 3815 | } |
| 3816 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3817 | case IEEE80211_MODE_2G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3818 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3819 | 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] | 3820 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3821 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3822 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3823 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3824 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3825 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3826 | return -EIO; |
| 3827 | } |
| 3828 | break; |
| 3829 | case IEEE80211_MODE_5G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3830 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3831 | 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] | 3832 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3833 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3834 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3835 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3836 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3837 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3838 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3839 | return -EIO; |
| 3840 | } |
| 3841 | break; |
| 3842 | case IEEE80211_MODE_11AGN: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3843 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3844 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3845 | phymode = eCSR_DOT11_MODE_11n; |
| 3846 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3847 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3848 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3849 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3850 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3851 | return -EIO; |
| 3852 | } |
| 3853 | break; |
| 3854 | default: |
| 3855 | return -EIO; |
| 3856 | } |
| 3857 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3858 | switch (new_phymode) { |
| 3859 | case IEEE80211_MODE_11AC_VHT20: |
| 3860 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3861 | vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 3862 | break; |
| 3863 | case IEEE80211_MODE_11AC_VHT40: |
| 3864 | vhtchanwidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 3865 | break; |
| 3866 | case IEEE80211_MODE_11AC_VHT80: |
| 3867 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3868 | break; |
| 3869 | default: |
| 3870 | vhtchanwidth = phddctx->config->vhtChannelWidth; |
| 3871 | break; |
| 3872 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3873 | |
| 3874 | if (phymode != -EIO) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3875 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 3876 | if (!sme_config) { |
| 3877 | hdd_err("Failed to allocate memory for sme_config"); |
| 3878 | return -ENOMEM; |
| 3879 | } |
| 3880 | qdf_mem_zero(sme_config, sizeof(*sme_config)); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3881 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3882 | sme_config->csrConfig.phyMode = phymode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3883 | #ifdef QCA_HT_2040_COEX |
| 3884 | if (phymode == eCSR_DOT11_MODE_11n && |
| 3885 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3886 | sme_config->csrConfig.obssEnabled = false; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3887 | halStatus = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3888 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3889 | eHT_CHAN_HT20, false); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3890 | if (halStatus == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3891 | hdd_err("Failed to disable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3892 | retval = -EIO; |
| 3893 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3894 | } |
| 3895 | } else if (phymode == eCSR_DOT11_MODE_11n && |
| 3896 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3897 | sme_config->csrConfig.obssEnabled = true; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3898 | halStatus = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3899 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3900 | eHT_CHAN_HT20, true); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3901 | if (halStatus == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3902 | hdd_err("Failed to enable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3903 | retval = -EIO; |
| 3904 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3905 | } |
| 3906 | } |
| 3907 | #endif |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3908 | sme_config->csrConfig.eBand = curr_band; |
| 3909 | sme_config->csrConfig.bandCapability = curr_band; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3910 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3911 | sme_config->csrConfig.Is11hSupportEnabled = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3912 | else |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3913 | sme_config->csrConfig.Is11hSupportEnabled = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3914 | phddctx->config->Is11hSupportEnabled; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3915 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3916 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
Jeff Johnson | 3d72577 | 2018-04-28 17:20:56 -0700 | [diff] [blame] | 3917 | else if (curr_band == BAND_5G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3918 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3919 | else { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3920 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
| 3921 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3922 | } |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3923 | sme_config->csrConfig.nVhtChannelWidth = vhtchanwidth; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3924 | sme_update_config(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3925 | |
| 3926 | phddctx->config->dot11Mode = hdd_dot11mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3927 | phddctx->config->nChannelBondingMode24GHz = |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3928 | sme_config->csrConfig.channelBondingMode24GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3929 | phddctx->config->nChannelBondingMode5GHz = |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3930 | sme_config->csrConfig.channelBondingMode5GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3931 | phddctx->config->vhtChannelWidth = vhtchanwidth; |
Krunal Soni | df0f874 | 2016-09-26 14:56:31 -0700 | [diff] [blame] | 3932 | if (hdd_update_config_cfg(phddctx) == false) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3933 | hdd_err("could not update config_dat"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3934 | retval = -EIO; |
| 3935 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3936 | } |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 3937 | |
| 3938 | if (band_5g) { |
| 3939 | struct ieee80211_supported_band *band; |
| 3940 | |
| 3941 | band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; |
| 3942 | if (phddctx->config->nChannelBondingMode5GHz) |
| 3943 | band->ht_cap.cap |= |
| 3944 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 3945 | else |
| 3946 | band->ht_cap.cap &= |
| 3947 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 3948 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3949 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3950 | 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] | 3951 | phymode, chwidth, curr_band, vhtchanwidth); |
| 3952 | } |
| 3953 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3954 | free: |
| 3955 | if (sme_config) |
| 3956 | qdf_mem_free(sme_config); |
| 3957 | return retval; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3958 | } |
| 3959 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 3960 | static int hdd_validate_pdev_reset(int value) |
| 3961 | { |
| 3962 | if ((value < 1) || (value > 5)) { |
| 3963 | hdd_warn(" Invalid value %d: Use any one of the below values\n" |
| 3964 | " TX_FLUSH = 1\n" |
| 3965 | " WARM_RESET = 2\n" |
| 3966 | " COLD_RESET = 3\n" |
| 3967 | " WARM_RESET_RESTORE_CAL = 4\n" |
| 3968 | " COLD_RESET_RESTORE_CAL = 5", value); |
| 3969 | |
| 3970 | return -EINVAL; |
| 3971 | } |
| 3972 | |
| 3973 | return 0; |
| 3974 | } |
| 3975 | |
| 3976 | static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value) |
| 3977 | { |
| 3978 | int ret; |
| 3979 | |
| 3980 | hdd_debug("%d", value); |
| 3981 | |
| 3982 | ret = hdd_validate_pdev_reset(value); |
| 3983 | if (ret) |
| 3984 | return ret; |
| 3985 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3986 | ret = wma_cli_set_command(adapter->session_id, |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 3987 | WMI_PDEV_PARAM_PDEV_RESET, |
| 3988 | value, PDEV_CMD); |
| 3989 | |
| 3990 | return ret; |
| 3991 | } |
| 3992 | |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 3993 | static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width) |
| 3994 | { |
| 3995 | int errno; |
| 3996 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 3997 | ePhyChanBondState bonding_state; |
| 3998 | uint32_t bonding_mode; |
| 3999 | tSmeConfigParams *sme_config; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4000 | mac_handle_t mac_handle; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4001 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4002 | mac_handle = hdd_ctx->mac_handle; |
| 4003 | if (!mac_handle) |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4004 | return -EINVAL; |
| 4005 | |
| 4006 | /* updating channel bonding only on 5Ghz */ |
| 4007 | hdd_debug("WMI_VDEV_PARAM_CHWIDTH val %d", ch_width); |
| 4008 | |
| 4009 | switch (ch_width) { |
| 4010 | case eHT_CHANNEL_WIDTH_20MHZ: |
| 4011 | bonding_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4012 | break; |
| 4013 | |
| 4014 | case eHT_CHANNEL_WIDTH_40MHZ: |
| 4015 | case eHT_CHANNEL_WIDTH_80MHZ: |
| 4016 | bonding_state = csr_convert_cb_ini_value_to_phy_cb_state( |
| 4017 | hdd_ctx->config->nChannelBondingMode5GHz); |
| 4018 | |
| 4019 | if (bonding_state == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) |
| 4020 | return -EINVAL; |
| 4021 | |
| 4022 | bonding_mode = hdd_ctx->config->nChannelBondingMode5GHz; |
| 4023 | break; |
| 4024 | |
| 4025 | default: |
| 4026 | hdd_err("Invalid channel width 0->20 1->40 2->80"); |
| 4027 | return -EINVAL; |
| 4028 | } |
| 4029 | |
| 4030 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4031 | if (!sme_config) { |
| 4032 | hdd_err("failed to allocate memory for sme_config"); |
| 4033 | return -ENOMEM; |
| 4034 | } |
| 4035 | |
| 4036 | errno = wma_cli_set_command(adapter->session_id, WMI_VDEV_PARAM_CHWIDTH, |
| 4037 | ch_width, VDEV_CMD); |
| 4038 | if (errno) |
| 4039 | goto free_config; |
| 4040 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4041 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4042 | sme_config->csrConfig.channelBondingMode5GHz = bonding_mode; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4043 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4044 | |
| 4045 | free_config: |
| 4046 | qdf_mem_free(sme_config); |
| 4047 | |
| 4048 | return errno; |
| 4049 | } |
| 4050 | |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4051 | static int hdd_we_set_11d_state(struct hdd_context *hdd_ctx, int state_11d) |
| 4052 | { |
| 4053 | tSmeConfigParams *sme_config; |
| 4054 | bool enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4055 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4056 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4057 | if (!mac_handle) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4058 | return -EINVAL; |
| 4059 | |
| 4060 | switch (state_11d) { |
| 4061 | case ENABLE_11D: |
| 4062 | enable_11d = true; |
| 4063 | break; |
| 4064 | case DISABLE_11D: |
| 4065 | enable_11d = false; |
| 4066 | break; |
| 4067 | default: |
| 4068 | return -EINVAL; |
| 4069 | } |
| 4070 | |
| 4071 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4072 | if (!sme_config) { |
| 4073 | hdd_err("failed to allocate memory for sme_config"); |
| 4074 | return -ENOMEM; |
| 4075 | } |
| 4076 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4077 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4078 | sme_config->csrConfig.Is11dSupportEnabled = enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4079 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4080 | |
| 4081 | qdf_mem_free(sme_config); |
| 4082 | |
Dustin Brown | ea82d56 | 2018-05-23 12:07:16 -0700 | [diff] [blame] | 4083 | hdd_debug("11D state=%d", enable_11d); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4084 | |
| 4085 | return 0; |
| 4086 | } |
| 4087 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4088 | /** |
| 4089 | * iw_setint_getnone() - Generic "set integer" private ioctl handler |
| 4090 | * @dev: device upon which the ioctl was received |
| 4091 | * @info: ioctl request information |
| 4092 | * @wrqu: ioctl request data |
| 4093 | * @extra: ioctl extra data |
| 4094 | * |
| 4095 | * Return: 0 on success, non-zero on error |
| 4096 | */ |
| 4097 | static int __iw_setint_getnone(struct net_device *dev, |
| 4098 | struct iw_request_info *info, |
| 4099 | union iwreq_data *wrqu, char *extra) |
| 4100 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4101 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4102 | mac_handle_t mac_handle; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4103 | 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] | 4104 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4105 | int *value = (int *)extra; |
| 4106 | int sub_cmd = value[0]; |
| 4107 | int set_value = value[1]; |
| 4108 | int ret; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4109 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4110 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 4111 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 4112 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4113 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4114 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 4115 | if (0 != ret) |
| 4116 | return ret; |
| 4117 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 4118 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 4119 | if (0 != ret) |
| 4120 | return ret; |
| 4121 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4122 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4123 | switch (sub_cmd) { |
| 4124 | case WE_SET_11D_STATE: |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4125 | ret = hdd_we_set_11d_state(hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4126 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4127 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4128 | case WE_SET_POWER: |
| 4129 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4130 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4131 | return -EINVAL; |
| 4132 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4133 | switch (set_value) { |
| 4134 | case 1: |
| 4135 | /* Enable PowerSave */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4136 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4137 | SME_PS_ENABLE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4138 | break; |
| 4139 | case 2: |
| 4140 | /* Disable PowerSave */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4141 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4142 | SME_PS_DISABLE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4143 | break; |
| 4144 | case 3: /* Enable UASPD */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4145 | sme_ps_uapsd_enable(mac_handle, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4146 | break; |
| 4147 | case 4: /* Disable UASPD */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4148 | sme_ps_uapsd_disable(mac_handle, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4149 | break; |
| 4150 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4151 | hdd_err("Invalid arg %d in WE_SET_POWER IOCTL", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4152 | set_value); |
| 4153 | ret = -EINVAL; |
| 4154 | break; |
| 4155 | } |
| 4156 | break; |
| 4157 | } |
| 4158 | |
| 4159 | case WE_SET_MAX_ASSOC: |
| 4160 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4161 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4162 | return -EINVAL; |
| 4163 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4164 | if ((WNI_CFG_ASSOC_STA_LIMIT_STAMIN > set_value) || |
| 4165 | (WNI_CFG_ASSOC_STA_LIMIT_STAMAX < set_value)) { |
| 4166 | ret = -EINVAL; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4167 | } else if (sme_cfg_set_int(mac_handle, WNI_CFG_ASSOC_STA_LIMIT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4168 | set_value) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4169 | != QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4170 | hdd_err("WNI_CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4171 | ret = -EIO; |
| 4172 | } |
| 4173 | break; |
| 4174 | } |
| 4175 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4176 | case WE_SET_DATA_INACTIVITY_TO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4177 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4178 | return -EINVAL; |
| 4179 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4180 | if ((set_value < CFG_DATA_INACTIVITY_TIMEOUT_MIN) || |
| 4181 | (set_value > CFG_DATA_INACTIVITY_TIMEOUT_MAX) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4182 | (sme_cfg_set_int(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4183 | WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4184 | set_value) == QDF_STATUS_E_FAILURE)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4185 | hdd_err("WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4186 | ret = -EINVAL; |
| 4187 | } |
| 4188 | break; |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4189 | case WE_SET_WOW_DATA_INACTIVITY_TO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4190 | if (!mac_handle) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4191 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4192 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4193 | } |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4194 | |
| 4195 | if ((set_value < CFG_WOW_DATA_INACTIVITY_TIMEOUT_MIN) || |
| 4196 | (set_value > CFG_WOW_DATA_INACTIVITY_TIMEOUT_MAX) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4197 | (sme_cfg_set_int(mac_handle, |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4198 | WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT, |
| 4199 | set_value) == QDF_STATUS_E_FAILURE)) { |
| 4200 | hdd_err("WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT fail"); |
| 4201 | ret = -EINVAL; |
| 4202 | } |
| 4203 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4204 | case WE_SET_MC_RATE: |
| 4205 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4206 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4207 | return -EINVAL; |
| 4208 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4209 | ret = wlan_hdd_set_mc_rate(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4210 | break; |
| 4211 | } |
| 4212 | case WE_SET_TX_POWER: |
| 4213 | { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 4214 | struct qdf_mac_addr bssid; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4215 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4216 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4217 | return -EINVAL; |
| 4218 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4219 | qdf_copy_macaddr(&bssid, &sta_ctx->conn_info.bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4220 | if (sme_set_tx_power |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4221 | (mac_handle, adapter->session_id, bssid, |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4222 | adapter->device_mode, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4223 | set_value) != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4224 | hdd_err("Setting tx power failed"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4225 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4226 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4227 | } |
| 4228 | break; |
| 4229 | } |
| 4230 | case WE_SET_MAX_TX_POWER: |
| 4231 | { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 4232 | struct qdf_mac_addr bssid; |
| 4233 | struct qdf_mac_addr selfMac; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4234 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4235 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4236 | return -EINVAL; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4237 | |
| 4238 | hdd_debug("Setting maximum tx power %d dBm", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4239 | set_value); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4240 | qdf_copy_macaddr(&bssid, &sta_ctx->conn_info.bssId); |
| 4241 | qdf_copy_macaddr(&selfMac, &sta_ctx->conn_info.bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4242 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4243 | if (sme_set_max_tx_power(mac_handle, bssid, selfMac, set_value) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4244 | != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4245 | hdd_err("Setting maximum tx power failed"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4246 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4247 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4248 | } |
| 4249 | |
| 4250 | break; |
| 4251 | } |
| 4252 | case WE_SET_MAX_TX_POWER_2_4: |
| 4253 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4254 | hdd_debug("Setting maximum tx power %d dBm for 2.4 GHz band", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4255 | set_value); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4256 | if (sme_set_max_tx_power_per_band(BAND_2G, set_value) != |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4257 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4258 | hdd_err("Setting max tx power failed for 2.4 GHz band"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4259 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4260 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4261 | } |
| 4262 | |
| 4263 | break; |
| 4264 | } |
| 4265 | case WE_SET_MAX_TX_POWER_5_0: |
| 4266 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4267 | hdd_debug("Setting maximum tx power %d dBm for 5.0 GHz band", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4268 | set_value); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4269 | if (sme_set_max_tx_power_per_band(BAND_5G, set_value) != |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4270 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4271 | hdd_err("Setting max tx power failed for 5.0 GHz band"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4272 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4273 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4274 | } |
| 4275 | |
| 4276 | break; |
| 4277 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4278 | |
| 4279 | case WE_SET_TM_LEVEL: |
| 4280 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4281 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4282 | return -EINVAL; |
| 4283 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4284 | hdd_debug("Set Thermal Mitigation Level %d", set_value); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4285 | (void)sme_set_thermal_level(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4286 | break; |
| 4287 | } |
| 4288 | |
| 4289 | case WE_SET_PHYMODE: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4290 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4291 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4292 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4293 | ret = wlan_hdd_update_phymode(dev, mac_handle, set_value, |
| 4294 | hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4295 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4296 | |
| 4297 | case WE_SET_NSS: |
| 4298 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4299 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4300 | return -EINVAL; |
| 4301 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4302 | hdd_debug("Set NSS = %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4303 | if ((set_value > 2) || (set_value <= 0)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4304 | hdd_err("NSS greater than 2 not supported"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4305 | ret = -EINVAL; |
| 4306 | } else { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4307 | if (QDF_STATUS_SUCCESS != |
Kiran Kumar Lokere | 44a2943 | 2018-01-24 16:10:30 -0800 | [diff] [blame] | 4308 | hdd_update_nss(adapter, set_value)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4309 | ret = -EINVAL; |
| 4310 | } |
| 4311 | break; |
| 4312 | } |
| 4313 | |
| 4314 | case WE_SET_GTX_HT_MCS: |
| 4315 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4316 | hdd_debug("WMI_VDEV_PARAM_GTX_HT_MCS %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4317 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4318 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 4319 | set_value, GTX_CMD); |
| 4320 | break; |
| 4321 | } |
| 4322 | |
| 4323 | case WE_SET_GTX_VHT_MCS: |
| 4324 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4325 | hdd_debug("WMI_VDEV_PARAM_GTX_VHT_MCS %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4326 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4327 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4328 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 4329 | set_value, GTX_CMD); |
| 4330 | break; |
| 4331 | } |
| 4332 | |
| 4333 | case WE_SET_GTX_USRCFG: |
| 4334 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4335 | hdd_debug("WMI_VDEV_PARAM_GTX_USR_CFG %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4336 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4337 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4338 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 4339 | set_value, GTX_CMD); |
| 4340 | break; |
| 4341 | } |
| 4342 | |
| 4343 | case WE_SET_GTX_THRE: |
| 4344 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4345 | hdd_debug("WMI_VDEV_PARAM_GTX_THRE %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4346 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4347 | WMI_VDEV_PARAM_GTX_THRE, |
| 4348 | set_value, GTX_CMD); |
| 4349 | break; |
| 4350 | } |
| 4351 | |
| 4352 | case WE_SET_GTX_MARGIN: |
| 4353 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4354 | hdd_debug("WMI_VDEV_PARAM_GTX_MARGIN %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4355 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4356 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 4357 | set_value, GTX_CMD); |
| 4358 | break; |
| 4359 | } |
| 4360 | |
| 4361 | case WE_SET_GTX_STEP: |
| 4362 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4363 | hdd_debug("WMI_VDEV_PARAM_GTX_STEP %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4364 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4365 | WMI_VDEV_PARAM_GTX_STEP, |
| 4366 | set_value, GTX_CMD); |
| 4367 | break; |
| 4368 | } |
| 4369 | |
| 4370 | case WE_SET_GTX_MINTPC: |
| 4371 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4372 | hdd_debug("WMI_VDEV_PARAM_GTX_MINTPC %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4373 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4374 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 4375 | set_value, GTX_CMD); |
| 4376 | break; |
| 4377 | } |
| 4378 | |
| 4379 | case WE_SET_GTX_BWMASK: |
| 4380 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4381 | hdd_debug("WMI_VDEV_PARAM_GTX_BWMASK %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4382 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4383 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 4384 | set_value, GTX_CMD); |
| 4385 | break; |
| 4386 | } |
| 4387 | |
| 4388 | case WE_SET_LDPC: |
| 4389 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4390 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4391 | return -EINVAL; |
| 4392 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4393 | ret = hdd_set_ldpc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4394 | break; |
| 4395 | } |
| 4396 | |
| 4397 | case WE_SET_TX_STBC: |
| 4398 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4399 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4400 | return -EINVAL; |
| 4401 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4402 | ret = hdd_set_tx_stbc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4403 | break; |
| 4404 | } |
| 4405 | |
| 4406 | case WE_SET_RX_STBC: |
| 4407 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4408 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4409 | return -EINVAL; |
| 4410 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4411 | ret = hdd_set_rx_stbc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4412 | break; |
| 4413 | } |
| 4414 | |
| 4415 | case WE_SET_SHORT_GI: |
| 4416 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4417 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4418 | return -EINVAL; |
| 4419 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4420 | hdd_debug("WMI_VDEV_PARAM_SGI val %d", set_value); |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4421 | if (set_value & HDD_AUTO_RATE_SGI) |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4422 | ret = sme_set_auto_rate_he_sgi(mac_handle, |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4423 | adapter->session_id, |
| 4424 | set_value); |
| 4425 | else |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4426 | ret = sme_update_ht_config(mac_handle, |
| 4427 | adapter->session_id, |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4428 | WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, |
| 4429 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4430 | if (ret) |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4431 | hdd_err("Failed to set ShortGI value %d", set_value); |
| 4432 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4433 | break; |
| 4434 | } |
| 4435 | |
| 4436 | case WE_SET_RTSCTS: |
| 4437 | { |
| 4438 | uint32_t value; |
| 4439 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4440 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4441 | return -EINVAL; |
| 4442 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4443 | hdd_debug("WMI_VDEV_PARAM_ENABLE_RTSCTS val 0x%x", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4444 | |
| 4445 | if ((set_value & HDD_RTSCTS_EN_MASK) == |
| 4446 | HDD_RTSCTS_ENABLE) |
| 4447 | value = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4448 | (WLAN_HDD_GET_CTX(adapter))->config-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4449 | RTSThreshold; |
| 4450 | else if (((set_value & HDD_RTSCTS_EN_MASK) == 0) |
| 4451 | || ((set_value & HDD_RTSCTS_EN_MASK) == |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4452 | HDD_CTS_ENABLE)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4453 | value = WNI_CFG_RTS_THRESHOLD_STAMAX; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4454 | } else { |
| 4455 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4456 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4457 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4458 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4459 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4460 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 4461 | set_value, VDEV_CMD); |
| 4462 | if (!ret) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4463 | if (sme_cfg_set_int(mac_handle, WNI_CFG_RTS_THRESHOLD, |
| 4464 | value) != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4465 | hdd_err("FAILED TO SET RTSCTS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4466 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4467 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4468 | } |
| 4469 | } |
| 4470 | |
| 4471 | break; |
| 4472 | } |
| 4473 | |
| 4474 | case WE_SET_CHWIDTH: |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4475 | ret = hdd_we_set_ch_width(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4476 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4477 | |
| 4478 | case WE_SET_ANI_EN_DIS: |
| 4479 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4480 | hdd_debug("WMI_PDEV_PARAM_ANI_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4481 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4482 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4483 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 4484 | set_value, PDEV_CMD); |
| 4485 | break; |
| 4486 | } |
| 4487 | |
| 4488 | case WE_SET_ANI_POLL_PERIOD: |
| 4489 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4490 | hdd_debug("WMI_PDEV_PARAM_ANI_POLL_PERIOD val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4491 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4492 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4493 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 4494 | set_value, PDEV_CMD); |
| 4495 | break; |
| 4496 | } |
| 4497 | |
| 4498 | case WE_SET_ANI_LISTEN_PERIOD: |
| 4499 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4500 | hdd_debug("WMI_PDEV_PARAM_ANI_LISTEN_PERIOD val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4501 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4502 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4503 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 4504 | set_value, PDEV_CMD); |
| 4505 | break; |
| 4506 | } |
| 4507 | |
| 4508 | case WE_SET_ANI_OFDM_LEVEL: |
| 4509 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4510 | hdd_debug("WMI_PDEV_PARAM_ANI_OFDM_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4511 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4512 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4513 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 4514 | set_value, PDEV_CMD); |
| 4515 | break; |
| 4516 | } |
| 4517 | |
| 4518 | case WE_SET_ANI_CCK_LEVEL: |
| 4519 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4520 | hdd_debug("WMI_PDEV_PARAM_ANI_CCK_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4521 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4522 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4523 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 4524 | set_value, PDEV_CMD); |
| 4525 | break; |
| 4526 | } |
| 4527 | |
| 4528 | case WE_SET_DYNAMIC_BW: |
| 4529 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4530 | hdd_debug("WMI_PDEV_PARAM_DYNAMIC_BW val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4531 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4532 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4533 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 4534 | set_value, PDEV_CMD); |
| 4535 | break; |
| 4536 | } |
| 4537 | |
| 4538 | case WE_SET_CTS_CBW: |
| 4539 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4540 | hdd_debug("WE_SET_CTS_CBW val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4541 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4542 | WMI_PDEV_PARAM_CTS_CBW, |
| 4543 | set_value, PDEV_CMD); |
| 4544 | break; |
| 4545 | } |
| 4546 | |
| 4547 | case WE_SET_11N_RATE: |
| 4548 | { |
| 4549 | uint8_t preamble = 0, nss = 0, rix = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4550 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4551 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4552 | set_value); |
| 4553 | |
| 4554 | if (set_value != 0xff) { |
| 4555 | rix = RC_2_RATE_IDX(set_value); |
| 4556 | if (set_value & 0x80) { |
| 4557 | preamble = WMI_RATE_PREAMBLE_HT; |
| 4558 | nss = HT_RC_2_STREAMS(set_value) - 1; |
| 4559 | } else { |
| 4560 | nss = 0; |
| 4561 | rix = RC_2_RATE_IDX(set_value); |
| 4562 | if (set_value & 0x10) { |
| 4563 | preamble = |
| 4564 | WMI_RATE_PREAMBLE_CCK; |
| 4565 | if (rix != 0x3) |
| 4566 | /* Enable Short |
| 4567 | * preamble always for |
| 4568 | * CCK except 1mbps |
| 4569 | */ |
| 4570 | rix |= 0x4; |
| 4571 | } else { |
| 4572 | preamble = |
| 4573 | WMI_RATE_PREAMBLE_OFDM; |
| 4574 | } |
| 4575 | } |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 4576 | set_value = hdd_assemble_rate_code(preamble, nss, rix); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4577 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4578 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4579 | set_value, rix, preamble, nss); |
| 4580 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4581 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4582 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4583 | set_value, VDEV_CMD); |
| 4584 | break; |
| 4585 | } |
| 4586 | |
| 4587 | case WE_SET_VHT_RATE: |
| 4588 | { |
| 4589 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4590 | |
| 4591 | if (set_value != 0xff) { |
| 4592 | rix = RC_2_RATE_IDX_11AC(set_value); |
| 4593 | preamble = WMI_RATE_PREAMBLE_VHT; |
| 4594 | nss = HT_RC_2_STREAMS_11AC(set_value) - 1; |
| 4595 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 4596 | set_value = hdd_assemble_rate_code(preamble, nss, rix); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4597 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4598 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d rix %d preamble %x nss %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4599 | set_value, rix, preamble, nss); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4600 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4601 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4602 | set_value, VDEV_CMD); |
| 4603 | break; |
| 4604 | } |
| 4605 | |
| 4606 | case WE_SET_AMPDU: |
| 4607 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4608 | hdd_debug("SET AMPDU val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4609 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4610 | GEN_VDEV_PARAM_AMPDU, |
| 4611 | set_value, GEN_CMD); |
| 4612 | break; |
| 4613 | } |
| 4614 | |
| 4615 | case WE_SET_AMSDU: |
| 4616 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4617 | hdd_debug("SET AMSDU val %d", set_value); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4618 | if (set_value > 1) |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4619 | sme_set_amsdu(mac_handle, true); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4620 | else |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4621 | sme_set_amsdu(mac_handle, false); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4622 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4623 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4624 | GEN_VDEV_PARAM_AMSDU, |
| 4625 | set_value, GEN_CMD); |
Deepak Dhamdhere | 612392c | 2016-08-28 02:56:51 -0700 | [diff] [blame] | 4626 | /* Update the stored ini value */ |
| 4627 | if (!ret) |
| 4628 | hdd_ctx->config->max_amsdu_num = set_value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4629 | break; |
| 4630 | } |
| 4631 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4632 | case WE_SET_TX_CHAINMASK: |
| 4633 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4634 | hdd_debug("WMI_PDEV_PARAM_TX_CHAIN_MASK val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4635 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4636 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4637 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 4638 | set_value, PDEV_CMD); |
Abhishek Singh | 1571ca7 | 2018-04-17 15:14:21 +0530 | [diff] [blame] | 4639 | ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4640 | break; |
| 4641 | } |
| 4642 | |
| 4643 | case WE_SET_RX_CHAINMASK: |
| 4644 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4645 | hdd_debug("WMI_PDEV_PARAM_RX_CHAIN_MASK val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4646 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4647 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4648 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 4649 | set_value, PDEV_CMD); |
Abhishek Singh | 1571ca7 | 2018-04-17 15:14:21 +0530 | [diff] [blame] | 4650 | ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4651 | break; |
| 4652 | } |
| 4653 | |
| 4654 | case WE_SET_TXPOW_2G: |
| 4655 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4656 | hdd_debug("WMI_PDEV_PARAM_TXPOWER_LIMIT2G val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4657 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4658 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4659 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 4660 | set_value, PDEV_CMD); |
| 4661 | break; |
| 4662 | } |
| 4663 | |
| 4664 | case WE_SET_TXPOW_5G: |
| 4665 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4666 | hdd_debug("WMI_PDEV_PARAM_TXPOWER_LIMIT5G val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4667 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4668 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4669 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 4670 | set_value, PDEV_CMD); |
| 4671 | break; |
| 4672 | } |
| 4673 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4674 | /* Firmware debug log */ |
| 4675 | case WE_DBGLOG_LOG_LEVEL: |
| 4676 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4677 | hdd_debug("WE_DBGLOG_LOG_LEVEL val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4678 | hdd_ctx->fw_log_settings.dl_loglevel = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4679 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4680 | WMI_DBGLOG_LOG_LEVEL, |
| 4681 | set_value, DBG_CMD); |
| 4682 | break; |
| 4683 | } |
| 4684 | |
| 4685 | case WE_DBGLOG_VAP_ENABLE: |
| 4686 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4687 | hdd_debug("WE_DBGLOG_VAP_ENABLE val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4688 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4689 | WMI_DBGLOG_VAP_ENABLE, |
| 4690 | set_value, DBG_CMD); |
| 4691 | break; |
| 4692 | } |
| 4693 | |
| 4694 | case WE_DBGLOG_VAP_DISABLE: |
| 4695 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4696 | hdd_debug("WE_DBGLOG_VAP_DISABLE val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4697 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4698 | WMI_DBGLOG_VAP_DISABLE, |
| 4699 | set_value, DBG_CMD); |
| 4700 | break; |
| 4701 | } |
| 4702 | |
| 4703 | case WE_DBGLOG_MODULE_ENABLE: |
| 4704 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4705 | hdd_debug("WE_DBGLOG_MODULE_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4706 | set_value); |
| 4707 | hdd_ctx->fw_log_settings.enable = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4708 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4709 | WMI_DBGLOG_MODULE_ENABLE, |
| 4710 | set_value, DBG_CMD); |
| 4711 | break; |
| 4712 | } |
| 4713 | |
| 4714 | case WE_DBGLOG_MODULE_DISABLE: |
| 4715 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4716 | hdd_debug("WE_DBGLOG_MODULE_DISABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4717 | set_value); |
| 4718 | hdd_ctx->fw_log_settings.enable = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4719 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4720 | WMI_DBGLOG_MODULE_DISABLE, |
| 4721 | set_value, DBG_CMD); |
| 4722 | break; |
| 4723 | } |
| 4724 | case WE_DBGLOG_MOD_LOG_LEVEL: |
| 4725 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4726 | hdd_debug("WE_DBGLOG_MOD_LOG_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4727 | set_value); |
| 4728 | |
| 4729 | if (hdd_ctx->fw_log_settings.index >= MAX_MOD_LOGLEVEL) |
| 4730 | hdd_ctx->fw_log_settings.index = 0; |
| 4731 | |
| 4732 | hdd_ctx->fw_log_settings. |
| 4733 | dl_mod_loglevel[hdd_ctx->fw_log_settings.index] = |
| 4734 | set_value; |
| 4735 | hdd_ctx->fw_log_settings.index++; |
| 4736 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4737 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4738 | WMI_DBGLOG_MOD_LOG_LEVEL, |
| 4739 | set_value, DBG_CMD); |
| 4740 | break; |
| 4741 | } |
| 4742 | |
| 4743 | case WE_DBGLOG_TYPE: |
| 4744 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4745 | hdd_debug("WE_DBGLOG_TYPE val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4746 | hdd_ctx->fw_log_settings.dl_type = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4747 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4748 | WMI_DBGLOG_TYPE, |
| 4749 | set_value, DBG_CMD); |
| 4750 | break; |
| 4751 | } |
| 4752 | case WE_DBGLOG_REPORT_ENABLE: |
| 4753 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4754 | hdd_debug("WE_DBGLOG_REPORT_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4755 | set_value); |
| 4756 | hdd_ctx->fw_log_settings.dl_report = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4757 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4758 | WMI_DBGLOG_REPORT_ENABLE, |
| 4759 | set_value, DBG_CMD); |
| 4760 | break; |
| 4761 | } |
| 4762 | |
| 4763 | case WE_SET_TXRX_FWSTATS: |
| 4764 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4765 | hdd_debug("WE_SET_TXRX_FWSTATS val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4766 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4767 | WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID, |
| 4768 | set_value, VDEV_CMD); |
| 4769 | break; |
| 4770 | } |
| 4771 | |
| 4772 | case WE_TXRX_FWSTATS_RESET: |
| 4773 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4774 | hdd_debug("WE_TXRX_FWSTATS_RESET val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4775 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4776 | WMA_VDEV_TXRX_FWSTATS_RESET_CMDID, |
| 4777 | set_value, VDEV_CMD); |
| 4778 | break; |
| 4779 | } |
| 4780 | |
| 4781 | case WE_DUMP_STATS: |
| 4782 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4783 | hdd_debug("WE_DUMP_STATS val %d", set_value); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4784 | ret = hdd_wlan_dump_stats(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4785 | break; |
| 4786 | } |
| 4787 | |
| 4788 | case WE_CLEAR_STATS: |
| 4789 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4790 | hdd_debug("WE_CLEAR_STATS val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4791 | switch (set_value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4792 | case CDP_HDD_STATS: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4793 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
| 4794 | memset(&adapter->hdd_stats, 0, |
| 4795 | sizeof(adapter->hdd_stats)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4796 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4797 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4798 | wlan_hdd_clear_tx_rx_histogram(hdd_ctx); |
| 4799 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4800 | case CDP_HDD_NETIF_OPER_HISTORY: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4801 | wlan_hdd_clear_netif_queue_history(hdd_ctx); |
| 4802 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4803 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 4804 | hdd_clear_hif_stats(); |
| 4805 | break; |
Yun Park | 1027e8c | 2017-10-13 15:17:37 -0700 | [diff] [blame] | 4806 | case CDP_NAPI_STATS: |
| 4807 | hdd_clear_napi_stats(); |
| 4808 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4809 | default: |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 4810 | cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 4811 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4812 | } |
| 4813 | break; |
| 4814 | } |
| 4815 | |
| 4816 | case WE_PPS_PAID_MATCH: |
| 4817 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4818 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4819 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4820 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4821 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4822 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4823 | hdd_debug("WMI_VDEV_PPS_PAID_MATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4824 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4825 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4826 | WMI_VDEV_PPS_PAID_MATCH, |
| 4827 | set_value, PPS_CMD); |
| 4828 | break; |
| 4829 | } |
| 4830 | |
| 4831 | case WE_PPS_GID_MATCH: |
| 4832 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4833 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4834 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4835 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4836 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4837 | hdd_debug("WMI_VDEV_PPS_GID_MATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4838 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4839 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4840 | WMI_VDEV_PPS_GID_MATCH, |
| 4841 | set_value, PPS_CMD); |
| 4842 | break; |
| 4843 | } |
| 4844 | |
| 4845 | case WE_PPS_EARLY_TIM_CLEAR: |
| 4846 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4847 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4848 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4849 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4850 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4851 | hdd_debug(" WMI_VDEV_PPS_EARLY_TIM_CLEAR val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4852 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4853 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4854 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 4855 | set_value, PPS_CMD); |
| 4856 | break; |
| 4857 | } |
| 4858 | |
| 4859 | case WE_PPS_EARLY_DTIM_CLEAR: |
| 4860 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4861 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4862 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4863 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4864 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4865 | hdd_debug("WMI_VDEV_PPS_EARLY_DTIM_CLEAR val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4866 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4867 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4868 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 4869 | set_value, PPS_CMD); |
| 4870 | break; |
| 4871 | } |
| 4872 | |
| 4873 | case WE_PPS_EOF_PAD_DELIM: |
| 4874 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4875 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4876 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4877 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4878 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4879 | hdd_debug("WMI_VDEV_PPS_EOF_PAD_DELIM val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4880 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4881 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4882 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 4883 | set_value, PPS_CMD); |
| 4884 | break; |
| 4885 | } |
| 4886 | |
| 4887 | case WE_PPS_MACADDR_MISMATCH: |
| 4888 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4889 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4890 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4891 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4892 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4893 | hdd_debug("WMI_VDEV_PPS_MACADDR_MISMATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4894 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4895 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4896 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 4897 | set_value, PPS_CMD); |
| 4898 | break; |
| 4899 | } |
| 4900 | |
| 4901 | case WE_PPS_DELIM_CRC_FAIL: |
| 4902 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4903 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4904 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4905 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4906 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4907 | hdd_debug("WMI_VDEV_PPS_DELIM_CRC_FAIL val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4908 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4909 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4910 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 4911 | set_value, PPS_CMD); |
| 4912 | break; |
| 4913 | } |
| 4914 | |
| 4915 | case WE_PPS_GID_NSTS_ZERO: |
| 4916 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4917 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4918 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4919 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4920 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4921 | hdd_debug("WMI_VDEV_PPS_GID_NSTS_ZERO val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4922 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4923 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4924 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 4925 | set_value, PPS_CMD); |
| 4926 | break; |
| 4927 | } |
| 4928 | |
| 4929 | case WE_PPS_RSSI_CHECK: |
| 4930 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4931 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4932 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4933 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4934 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4935 | hdd_debug("WMI_VDEV_PPS_RSSI_CHECK val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4936 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4937 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4938 | WMI_VDEV_PPS_RSSI_CHECK, |
| 4939 | set_value, PPS_CMD); |
| 4940 | break; |
| 4941 | } |
| 4942 | |
| 4943 | case WE_PPS_5G_EBT: |
| 4944 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4945 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4946 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4947 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4948 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4949 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4950 | hdd_debug("WMI_VDEV_PPS_5G_EBT val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4951 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4952 | WMI_VDEV_PPS_5G_EBT, |
| 4953 | set_value, PPS_CMD); |
| 4954 | break; |
| 4955 | } |
| 4956 | |
| 4957 | case WE_SET_HTSMPS: |
| 4958 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4959 | hdd_debug("WE_SET_HTSMPS val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4960 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4961 | WMI_STA_SMPS_FORCE_MODE_CMDID, |
| 4962 | set_value, VDEV_CMD); |
| 4963 | break; |
| 4964 | } |
| 4965 | |
| 4966 | case WE_SET_QPOWER_MAX_PSPOLL_COUNT: |
| 4967 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4968 | hdd_debug("WE_SET_QPOWER_MAX_PSPOLL_COUNT val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4969 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4970 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4971 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 4972 | set_value, QPOWER_CMD); |
| 4973 | break; |
| 4974 | } |
| 4975 | |
| 4976 | case WE_SET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 4977 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4978 | hdd_debug("WE_SET_QPOWER_MAX_TX_BEFORE_WAKE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4979 | set_value); |
| 4980 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4981 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4982 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 4983 | set_value, QPOWER_CMD); |
| 4984 | break; |
| 4985 | } |
| 4986 | |
| 4987 | case WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 4988 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4989 | hdd_debug("WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4990 | set_value); |
| 4991 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4992 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4993 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 4994 | set_value, QPOWER_CMD); |
| 4995 | break; |
| 4996 | } |
| 4997 | |
| 4998 | case WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 4999 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5000 | hdd_debug("WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5001 | set_value); |
| 5002 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5003 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5004 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 5005 | set_value, QPOWER_CMD); |
| 5006 | break; |
| 5007 | } |
| 5008 | |
| 5009 | case WE_MCC_CONFIG_LATENCY: |
| 5010 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5011 | wlan_hdd_set_mcc_latency(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5012 | break; |
| 5013 | } |
| 5014 | |
| 5015 | case WE_MCC_CONFIG_QUOTA: |
| 5016 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5017 | hdd_debug("iwpriv cmd to set MCC quota with val %dms", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5018 | set_value); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5019 | ret = wlan_hdd_set_mcc_p2p_quota(adapter, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 5020 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5021 | break; |
| 5022 | } |
| 5023 | case WE_SET_DEBUG_LOG: |
| 5024 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5025 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 4f7f7c6 | 2017-10-05 08:53:41 -0700 | [diff] [blame] | 5026 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5027 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5028 | return -EINVAL; |
| 5029 | |
Nirav Shah | 1da7768 | 2016-05-03 20:16:39 +0530 | [diff] [blame] | 5030 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5031 | hdd_ctx->config->gEnableDebugLog = set_value; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5032 | sme_update_connect_debug(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5033 | break; |
| 5034 | } |
| 5035 | case WE_SET_EARLY_RX_ADJUST_ENABLE: |
| 5036 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5037 | hdd_debug("SET early_rx enable val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5038 | if ((set_value == 0) || (set_value == 1)) |
| 5039 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5040 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5041 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, |
| 5042 | set_value, VDEV_CMD); |
| 5043 | else |
| 5044 | ret = -EINVAL; |
| 5045 | break; |
| 5046 | } |
| 5047 | case WE_SET_EARLY_RX_TGT_BMISS_NUM: |
| 5048 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5049 | hdd_debug("SET early_rx bmiss val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5050 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5051 | WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, |
| 5052 | set_value, VDEV_CMD); |
| 5053 | break; |
| 5054 | } |
| 5055 | case WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE: |
| 5056 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5057 | hdd_debug("SET early_rx bmiss sample cycle %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5058 | set_value); |
| 5059 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5060 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5061 | WMI_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 5062 | set_value, VDEV_CMD); |
| 5063 | break; |
| 5064 | } |
| 5065 | case WE_SET_EARLY_RX_SLOP_STEP: |
| 5066 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5067 | hdd_debug("SET early_rx bmiss slop step val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5068 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5069 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5070 | WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP, |
| 5071 | set_value, VDEV_CMD); |
| 5072 | break; |
| 5073 | } |
| 5074 | case WE_SET_EARLY_RX_INIT_SLOP: |
| 5075 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5076 | hdd_debug("SET early_rx init slop step val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5077 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5078 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5079 | WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP, |
| 5080 | set_value, VDEV_CMD); |
| 5081 | break; |
| 5082 | } |
| 5083 | case WE_SET_EARLY_RX_ADJUST_PAUSE: |
| 5084 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5085 | hdd_debug("SET early_rx adjust pause %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5086 | if ((set_value == 0) || (set_value == 1)) |
| 5087 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5088 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5089 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, |
| 5090 | set_value, VDEV_CMD); |
| 5091 | else |
| 5092 | ret = -EINVAL; |
| 5093 | break; |
| 5094 | } |
| 5095 | case WE_SET_EARLY_RX_DRIFT_SAMPLE: |
| 5096 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5097 | hdd_debug("SET early_rx drift sample %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5098 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5099 | WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE, |
| 5100 | set_value, VDEV_CMD); |
| 5101 | break; |
| 5102 | } |
| 5103 | case WE_SET_SCAN_DISABLE: |
| 5104 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5105 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5106 | return -EINVAL; |
| 5107 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5108 | hdd_debug("SET SCAN DISABLE %d", set_value); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5109 | sme_set_scan_disable(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5110 | break; |
| 5111 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 5112 | case WE_START_FW_PROFILE: |
| 5113 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5114 | hdd_debug("WE_START_FW_PROFILE %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5115 | ret = wma_cli_set_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 5116 | WMI_WLAN_PROFILE_TRIGGER_CMDID, |
| 5117 | set_value, DBG_CMD); |
| 5118 | break; |
| 5119 | } |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5120 | case WE_SET_CHANNEL: |
| 5121 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5122 | hdd_debug("Set Channel %d Session ID %d mode %d", set_value, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5123 | adapter->session_id, adapter->device_mode); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5124 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5125 | return -EINVAL; |
| 5126 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5127 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5128 | if ((QDF_STA_MODE == adapter->device_mode) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5129 | (QDF_P2P_CLIENT_MODE == adapter->device_mode)) { |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5130 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5131 | status = sme_ext_change_channel(mac_handle, |
| 5132 | set_value, |
| 5133 | adapter->session_id); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5134 | if (status != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5135 | hdd_err("Error in change channel status %d", |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5136 | status); |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5137 | ret = -EINVAL; |
| 5138 | } |
| 5139 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5140 | hdd_err("change channel not supported for device mode %d", |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5141 | adapter->device_mode); |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5142 | ret = -EINVAL; |
| 5143 | } |
| 5144 | break; |
| 5145 | } |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5146 | case WE_SET_CONC_SYSTEM_PREF: |
| 5147 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5148 | hdd_debug("New preference: %d", set_value); |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5149 | if (!((set_value >= CFG_CONC_SYSTEM_PREF_MIN) && |
| 5150 | (set_value <= CFG_CONC_SYSTEM_PREF_MAX))) { |
| 5151 | hdd_err("Invalid system preference %d", set_value); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5152 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5153 | break; |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5154 | } |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5155 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5156 | /* hdd_ctx, hdd_ctx->config are already checked for null */ |
| 5157 | hdd_ctx->config->conc_system_pref = set_value; |
| 5158 | break; |
| 5159 | } |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5160 | case WE_SET_11AX_RATE: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5161 | ret = hdd_set_11ax_rate(adapter, set_value, NULL); |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5162 | break; |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5163 | case WE_SET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5164 | hdd_debug("Set WMI_VDEV_PARAM_HE_DCM: %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5165 | ret = wma_cli_set_command(adapter->session_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5166 | WMI_VDEV_PARAM_HE_DCM, set_value, |
| 5167 | VDEV_CMD); |
| 5168 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5169 | case WE_SET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5170 | hdd_debug("Set WMI_VDEV_PARAM_HE_RANGE_EXT: %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5171 | ret = wma_cli_set_command(adapter->session_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5172 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5173 | set_value, VDEV_CMD); |
| 5174 | break; |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 5175 | case WE_SET_PDEV_RESET: |
| 5176 | ret = hdd_handle_pdev_reset(adapter, set_value); |
| 5177 | break; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5178 | case WE_SET_MODULATED_DTIM: |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5179 | if ((set_value < CFG_ENABLE_MODULATED_DTIM_MIN) || |
| 5180 | (set_value > CFG_ENABLE_MODULATED_DTIM_MAX)) { |
| 5181 | hdd_err("Invalid gEnableModuleDTIM value %d", |
| 5182 | set_value); |
| 5183 | return -EINVAL; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5184 | } |
Jeff Johnson | c66d310 | 2018-02-28 11:58:26 -0800 | [diff] [blame] | 5185 | |
| 5186 | hdd_ctx->config->enableModulatedDTIM = set_value; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5187 | break; |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 5188 | case WE_SET_PPDU_DUR: |
| 5189 | /*Validate set value for Min and Max range*/ |
| 5190 | if (!set_value || (set_value > 4000)) { |
| 5191 | hdd_err("Invalid ppdu duraion value: %d usec", |
| 5192 | set_value); |
| 5193 | return -EINVAL; |
| 5194 | } |
| 5195 | ret = wma_cli_set_command(adapter->session_id, |
| 5196 | WMI_PDEV_PARAM_SET_PPDU_DURATION_CMDID, |
| 5197 | set_value, PDEV_CMD); |
| 5198 | if (ret) |
| 5199 | hdd_err("SET_PPDU_DURATION_CMDID %d usec set failed", |
| 5200 | set_value); |
| 5201 | else |
| 5202 | hdd_debug("PDEV_PARAM_SET_PPDU_DUR_CMDID is set to %d", |
| 5203 | set_value); |
| 5204 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5205 | default: |
Rajeev Kumar | d056536 | 2018-03-01 12:02:01 -0800 | [diff] [blame] | 5206 | hdd_debug("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5207 | ret = -EINVAL; |
| 5208 | break; |
| 5209 | } |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5210 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5211 | hdd_exit(); |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5212 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5213 | return ret; |
| 5214 | } |
| 5215 | |
| 5216 | static int iw_setint_getnone(struct net_device *dev, |
| 5217 | struct iw_request_info *info, |
| 5218 | union iwreq_data *wrqu, |
| 5219 | char *extra) |
| 5220 | { |
| 5221 | int ret; |
| 5222 | |
| 5223 | cds_ssr_protect(__func__); |
| 5224 | ret = __iw_setint_getnone(dev, info, wrqu, extra); |
| 5225 | cds_ssr_unprotect(__func__); |
| 5226 | |
| 5227 | return ret; |
| 5228 | } |
| 5229 | |
| 5230 | /** |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5231 | * __iw_setnone_get_threeint() - return three value to up layer. |
| 5232 | * |
| 5233 | * @dev: pointer of net_device of this wireless card |
| 5234 | * @info: meta data about Request sent |
| 5235 | * @wrqu: include request info |
| 5236 | * @extra: buf used for in/Output |
| 5237 | * |
| 5238 | * Return: execute result |
| 5239 | */ |
| 5240 | static int __iw_setnone_get_threeint(struct net_device *dev, |
| 5241 | struct iw_request_info *info, |
| 5242 | union iwreq_data *wrqu, char *extra) |
| 5243 | { |
| 5244 | int ret = 0; /* success */ |
| 5245 | uint32_t *value = (int *)extra; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 5246 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5247 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5248 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5249 | hdd_enter_dev(dev); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5250 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5251 | if (0 != ret) |
| 5252 | return ret; |
| 5253 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5254 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5255 | if (0 != ret) |
| 5256 | return ret; |
| 5257 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5258 | hdd_debug("param = %d", value[0]); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5259 | switch (value[0]) { |
| 5260 | case WE_GET_TSF: |
| 5261 | ret = hdd_indicate_tsf(adapter, value, 3); |
| 5262 | break; |
| 5263 | default: |
| 5264 | hdd_err("Invalid IOCTL get_value command %d", value[0]); |
| 5265 | break; |
| 5266 | } |
| 5267 | return ret; |
| 5268 | } |
| 5269 | |
| 5270 | /** |
| 5271 | * iw_setnone_get_threeint() - return three value to up layer. |
| 5272 | * |
| 5273 | * @dev: pointer of net_device of this wireless card |
| 5274 | * @info: meta data about Request sent |
| 5275 | * @wrqu: include request info |
| 5276 | * @extra: buf used for in/Output |
| 5277 | * |
| 5278 | * Return: execute result |
| 5279 | */ |
| 5280 | static int iw_setnone_get_threeint(struct net_device *dev, |
| 5281 | struct iw_request_info *info, |
| 5282 | union iwreq_data *wrqu, char *extra) |
| 5283 | { |
| 5284 | int ret; |
| 5285 | |
| 5286 | cds_ssr_protect(__func__); |
| 5287 | ret = __iw_setnone_get_threeint(dev, info, wrqu, extra); |
| 5288 | cds_ssr_unprotect(__func__); |
| 5289 | |
| 5290 | return ret; |
| 5291 | } |
| 5292 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5293 | #ifdef WLAN_UNIT_TEST |
| 5294 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *component) |
| 5295 | { |
| 5296 | uint32_t errors = 0; |
| 5297 | bool all = !component || !component[0]; |
| 5298 | |
| 5299 | if (all) |
| 5300 | hdd_info("Starting unit tests for all components"); |
| 5301 | else |
| 5302 | hdd_info("Starting unit tests for component '%s'", component); |
| 5303 | |
Dustin Brown | 6099ddc | 2018-07-06 14:32:53 -0700 | [diff] [blame] | 5304 | if (all || qdf_str_eq(component, "dsc")) |
| 5305 | errors += dsc_unit_test(); |
| 5306 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5307 | /* add future tests here */ |
| 5308 | |
| 5309 | if (errors) { |
| 5310 | hdd_err("Unit tests failed with %u errors", errors); |
| 5311 | return -EPERM; |
| 5312 | } |
| 5313 | |
| 5314 | hdd_info("Unit tests passed successfully"); |
| 5315 | |
| 5316 | return 0; |
| 5317 | } |
| 5318 | #else |
| 5319 | static int hdd_we_unit_test(struct hdd_context *hdd_ctx, const char *component) |
| 5320 | { |
| 5321 | return -EOPNOTSUPP; |
| 5322 | } |
| 5323 | #endif /* WLAN_UNIT_TEST */ |
| 5324 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5325 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5326 | * iw_setchar_getnone() - Generic "set string" private ioctl handler |
| 5327 | * @dev: device upon which the ioctl was received |
| 5328 | * @info: ioctl request information |
| 5329 | * @wrqu: ioctl request data |
| 5330 | * @extra: ioctl extra data |
| 5331 | * |
| 5332 | * Return: 0 on success, non-zero on error |
| 5333 | */ |
| 5334 | static int __iw_setchar_getnone(struct net_device *dev, |
| 5335 | struct iw_request_info *info, |
| 5336 | union iwreq_data *wrqu, char *extra) |
| 5337 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5338 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5339 | int sub_cmd; |
| 5340 | int ret; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5341 | char *str_arg = NULL; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5342 | struct hdd_adapter *adapter = (netdev_priv(dev)); |
| 5343 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5344 | struct hdd_config *pConfig = hdd_ctx->config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5345 | struct iw_point s_priv_data; |
| 5346 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5347 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 5348 | |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5349 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5350 | hdd_err("permission check failed"); |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5351 | return -EPERM; |
| 5352 | } |
| 5353 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5354 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5355 | if (0 != ret) |
| 5356 | return ret; |
| 5357 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5358 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5359 | if (0 != ret) |
| 5360 | return ret; |
| 5361 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5362 | /* helper function to get iwreq_data with compat handling. */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5363 | if (hdd_priv_get_data(&s_priv_data, wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5364 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5365 | |
| 5366 | /* make sure all params are correctly passed to function */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5367 | if ((NULL == s_priv_data.pointer) || (0 == s_priv_data.length)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5368 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5369 | |
| 5370 | sub_cmd = s_priv_data.flags; |
| 5371 | |
| 5372 | /* ODD number is used for set, copy data using copy_from_user */ |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5373 | str_arg = mem_alloc_copy_from_user_helper(s_priv_data.pointer, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5374 | s_priv_data.length); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5375 | if (!str_arg) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5376 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5377 | return -ENOMEM; |
| 5378 | } |
| 5379 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5380 | hdd_debug("Received length: %d data: %s", |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5381 | s_priv_data.length, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5382 | |
| 5383 | switch (sub_cmd) { |
| 5384 | case WE_WOWL_ADD_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5385 | hdd_debug("ADD_PTRN"); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5386 | hdd_add_wowl_ptrn(adapter, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5387 | break; |
| 5388 | case WE_WOWL_DEL_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5389 | hdd_debug("DEL_PTRN"); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5390 | hdd_del_wowl_ptrn(adapter, str_arg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5391 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5392 | case WE_NEIGHBOR_REPORT_REQUEST: |
| 5393 | { |
| 5394 | tRrmNeighborReq neighborReq; |
| 5395 | tRrmNeighborRspCallbackInfo callbackInfo; |
| 5396 | |
| 5397 | if (pConfig->fRrmEnable) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5398 | neighborReq.neighbor_report_offload = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5399 | neighborReq.no_ssid = |
| 5400 | (s_priv_data.length - 1) ? false : true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5401 | hdd_debug("Neighbor Request ssid present %d", |
| 5402 | neighborReq.no_ssid); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5403 | if (!neighborReq.no_ssid) { |
| 5404 | neighborReq.ssid.length = |
| 5405 | (s_priv_data.length - 1) > |
| 5406 | 32 ? 32 : (s_priv_data.length - 1); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 5407 | qdf_mem_copy(neighborReq.ssid.ssId, |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5408 | str_arg, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5409 | neighborReq.ssid.length); |
| 5410 | } |
| 5411 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5412 | /* |
| 5413 | * If 11k offload is supported by FW and enabled |
| 5414 | * in the ini, set the offload to true |
| 5415 | */ |
| 5416 | if (hdd_ctx->config->is_11k_offload_supported && |
| 5417 | (hdd_ctx->config->offload_11k_enable_bitmask & |
| 5418 | OFFLOAD_11K_BITMASK_NEIGHBOR_REPORT_REQUEST)) { |
| 5419 | hdd_debug("Neighbor report offloaded to FW"); |
| 5420 | neighborReq.neighbor_report_offload = true; |
| 5421 | } |
| 5422 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5423 | callbackInfo.neighborRspCallback = NULL; |
| 5424 | callbackInfo.neighborRspCallbackContext = NULL; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5425 | callbackInfo.timeout = 5000; /* 5 seconds */ |
| 5426 | sme_neighbor_report_request( |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5427 | hdd_ctx->mac_handle, |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5428 | adapter->session_id, |
| 5429 | &neighborReq, |
| 5430 | &callbackInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5431 | } else { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5432 | hdd_err("Ignoring neighbor request as RRM not enabled"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5433 | ret = -EINVAL; |
| 5434 | } |
| 5435 | } |
| 5436 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5437 | case WE_SET_AP_WPS_IE: |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 5438 | hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5439 | break; |
| 5440 | case WE_SET_CONFIG: |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5441 | status = hdd_execute_global_config_command(hdd_ctx, str_arg); |
| 5442 | if (QDF_IS_STATUS_ERROR(status)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5443 | ret = -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5444 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5445 | break; |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5446 | case WE_UNIT_TEST: |
| 5447 | ret = hdd_we_unit_test(hdd_ctx, str_arg); |
| 5448 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5449 | default: |
| 5450 | { |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5451 | hdd_err("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5452 | ret = -EINVAL; |
| 5453 | break; |
| 5454 | } |
| 5455 | } |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5456 | |
| 5457 | qdf_mem_free(str_arg); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5458 | hdd_exit(); |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 5459 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5460 | return ret; |
| 5461 | } |
| 5462 | |
| 5463 | static int iw_setchar_getnone(struct net_device *dev, |
| 5464 | struct iw_request_info *info, |
| 5465 | union iwreq_data *wrqu, char *extra) |
| 5466 | { |
| 5467 | int ret; |
| 5468 | |
| 5469 | cds_ssr_protect(__func__); |
| 5470 | ret = __iw_setchar_getnone(dev, info, wrqu, extra); |
| 5471 | cds_ssr_unprotect(__func__); |
| 5472 | |
| 5473 | return ret; |
| 5474 | } |
| 5475 | |
| 5476 | /** |
| 5477 | * iw_setnone_getint() - Generic "get integer" private ioctl handler |
| 5478 | * @dev: device upon which the ioctl was received |
| 5479 | * @info: ioctl request information |
| 5480 | * @wrqu: ioctl request data |
| 5481 | * @extra: ioctl extra data |
| 5482 | * |
| 5483 | * Return: 0 on success, non-zero on error |
| 5484 | */ |
| 5485 | static int __iw_setnone_getint(struct net_device *dev, |
| 5486 | struct iw_request_info *info, |
| 5487 | union iwreq_data *wrqu, char *extra) |
| 5488 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5489 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5490 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5491 | int *value = (int *)extra; |
| 5492 | int ret; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5493 | tSmeConfigParams *sme_config; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5494 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5495 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5496 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5497 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5498 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5499 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5500 | if (0 != ret) |
| 5501 | return ret; |
| 5502 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5503 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5504 | if (0 != ret) |
| 5505 | return ret; |
| 5506 | |
Rajeev Kumar | 1117fcf | 2018-02-15 16:25:19 -0800 | [diff] [blame] | 5507 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 5508 | if (!sme_config) { |
| 5509 | hdd_err("failed to allocate memory for sme_config"); |
| 5510 | return -ENOMEM; |
| 5511 | } |
| 5512 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5513 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5514 | switch (value[0]) { |
| 5515 | case WE_GET_11D_STATE: |
| 5516 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5517 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5518 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5519 | *value = sme_config->csrConfig.Is11dSupportEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5520 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5521 | hdd_debug("11D state=%d!!", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5522 | |
| 5523 | break; |
| 5524 | } |
| 5525 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5526 | case WE_GET_WLAN_DBG: |
| 5527 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 5528 | qdf_trace_display(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5529 | *value = 0; |
| 5530 | break; |
| 5531 | } |
| 5532 | case WE_GET_MAX_ASSOC: |
| 5533 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5534 | if (sme_cfg_get_int(mac_handle, WNI_CFG_ASSOC_STA_LIMIT, |
| 5535 | (uint32_t *) value) != QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5536 | hdd_err("WNI_CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5537 | ret = -EIO; |
| 5538 | } |
| 5539 | break; |
| 5540 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5541 | |
| 5542 | case WE_GET_CONCURRENCY_MODE: |
| 5543 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 5544 | *value = policy_mgr_get_concurrency_mode(hdd_ctx->hdd_psoc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5545 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5546 | hdd_debug("concurrency mode=%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5547 | break; |
| 5548 | } |
| 5549 | |
| 5550 | case WE_GET_NSS: |
| 5551 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5552 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5553 | *value = (sme_config->csrConfig.enable2x2 == 0) ? 1 : 2; |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 5554 | if (policy_mgr_is_current_hwmode_dbs(hdd_ctx->hdd_psoc)) |
| 5555 | *value = *value - 1; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5556 | hdd_debug("GET_NSS: Current NSS:%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5557 | break; |
| 5558 | } |
| 5559 | |
| 5560 | case WE_GET_GTX_HT_MCS: |
| 5561 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5562 | hdd_debug("GET WMI_VDEV_PARAM_GTX_HT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5563 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5564 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 5565 | GTX_CMD); |
| 5566 | break; |
| 5567 | } |
| 5568 | |
| 5569 | case WE_GET_GTX_VHT_MCS: |
| 5570 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5571 | hdd_debug("GET WMI_VDEV_PARAM_GTX_VHT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5572 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5573 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 5574 | GTX_CMD); |
| 5575 | break; |
| 5576 | } |
| 5577 | |
| 5578 | case WE_GET_GTX_USRCFG: |
| 5579 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5580 | hdd_debug("GET WMI_VDEV_PARAM_GTX_USR_CFG"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5581 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5582 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 5583 | GTX_CMD); |
| 5584 | break; |
| 5585 | } |
| 5586 | |
| 5587 | case WE_GET_GTX_THRE: |
| 5588 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5589 | hdd_debug("GET WMI_VDEV_PARAM_GTX_THRE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5590 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5591 | WMI_VDEV_PARAM_GTX_THRE, |
| 5592 | GTX_CMD); |
| 5593 | break; |
| 5594 | } |
| 5595 | |
| 5596 | case WE_GET_GTX_MARGIN: |
| 5597 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5598 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MARGIN"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5599 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5600 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 5601 | GTX_CMD); |
| 5602 | break; |
| 5603 | } |
| 5604 | |
| 5605 | case WE_GET_GTX_STEP: |
| 5606 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5607 | hdd_debug("GET WMI_VDEV_PARAM_GTX_STEP"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5608 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5609 | WMI_VDEV_PARAM_GTX_STEP, |
| 5610 | GTX_CMD); |
| 5611 | break; |
| 5612 | } |
| 5613 | |
| 5614 | case WE_GET_GTX_MINTPC: |
| 5615 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5616 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MINTPC"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5617 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5618 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 5619 | GTX_CMD); |
| 5620 | break; |
| 5621 | } |
| 5622 | |
| 5623 | case WE_GET_GTX_BWMASK: |
| 5624 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5625 | hdd_debug("GET WMI_VDEV_PARAM_GTX_BW_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5626 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5627 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 5628 | GTX_CMD); |
| 5629 | break; |
| 5630 | } |
| 5631 | |
| 5632 | case WE_GET_LDPC: |
| 5633 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5634 | ret = hdd_get_ldpc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5635 | break; |
| 5636 | } |
| 5637 | |
| 5638 | case WE_GET_TX_STBC: |
| 5639 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5640 | ret = hdd_get_tx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5641 | break; |
| 5642 | } |
| 5643 | |
| 5644 | case WE_GET_RX_STBC: |
| 5645 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5646 | ret = hdd_get_rx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5647 | break; |
| 5648 | } |
| 5649 | |
| 5650 | case WE_GET_SHORT_GI: |
| 5651 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5652 | hdd_debug("GET WMI_VDEV_PARAM_SGI"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5653 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | a5c5aad | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5654 | WMI_VDEV_PARAM_SGI, |
| 5655 | VDEV_CMD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5656 | break; |
| 5657 | } |
| 5658 | |
| 5659 | case WE_GET_RTSCTS: |
| 5660 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5661 | hdd_debug("GET WMI_VDEV_PARAM_ENABLE_RTSCTS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5662 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5663 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 5664 | VDEV_CMD); |
| 5665 | break; |
| 5666 | } |
| 5667 | |
| 5668 | case WE_GET_CHWIDTH: |
| 5669 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5670 | hdd_debug("GET WMI_VDEV_PARAM_CHWIDTH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5671 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5672 | WMI_VDEV_PARAM_CHWIDTH, |
| 5673 | VDEV_CMD); |
| 5674 | break; |
| 5675 | } |
| 5676 | |
| 5677 | case WE_GET_ANI_EN_DIS: |
| 5678 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5679 | hdd_debug("GET WMI_PDEV_PARAM_ANI_ENABLE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5680 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5681 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 5682 | PDEV_CMD); |
| 5683 | break; |
| 5684 | } |
| 5685 | |
| 5686 | case WE_GET_ANI_POLL_PERIOD: |
| 5687 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5688 | hdd_debug("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5689 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5690 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 5691 | PDEV_CMD); |
| 5692 | break; |
| 5693 | } |
| 5694 | |
| 5695 | case WE_GET_ANI_LISTEN_PERIOD: |
| 5696 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5697 | hdd_debug("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5698 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5699 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 5700 | PDEV_CMD); |
| 5701 | break; |
| 5702 | } |
| 5703 | |
| 5704 | case WE_GET_ANI_OFDM_LEVEL: |
| 5705 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5706 | hdd_debug("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5707 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5708 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 5709 | PDEV_CMD); |
| 5710 | break; |
| 5711 | } |
| 5712 | |
| 5713 | case WE_GET_ANI_CCK_LEVEL: |
| 5714 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5715 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5716 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5717 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 5718 | PDEV_CMD); |
| 5719 | break; |
| 5720 | } |
| 5721 | |
| 5722 | case WE_GET_DYNAMIC_BW: |
| 5723 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5724 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5725 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5726 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 5727 | PDEV_CMD); |
| 5728 | break; |
| 5729 | } |
| 5730 | |
| 5731 | case WE_GET_11N_RATE: |
| 5732 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5733 | hdd_debug("GET WMI_VDEV_PARAM_FIXED_RATE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5734 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5735 | WMI_VDEV_PARAM_FIXED_RATE, |
| 5736 | VDEV_CMD); |
| 5737 | break; |
| 5738 | } |
| 5739 | |
| 5740 | case WE_GET_AMPDU: |
| 5741 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5742 | hdd_debug("GET AMPDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5743 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5744 | GEN_VDEV_PARAM_AMPDU, |
| 5745 | GEN_CMD); |
| 5746 | break; |
| 5747 | } |
| 5748 | |
| 5749 | case WE_GET_AMSDU: |
| 5750 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5751 | hdd_debug("GET AMSDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5752 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5753 | GEN_VDEV_PARAM_AMSDU, |
| 5754 | GEN_CMD); |
| 5755 | break; |
| 5756 | } |
| 5757 | |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 5758 | case WE_GET_ROAM_SYNCH_DELAY: |
| 5759 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5760 | hdd_debug("GET ROAM SYNCH DELAY"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5761 | *value = wma_cli_get_command(adapter->session_id, |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 5762 | GEN_VDEV_ROAM_SYNCH_DELAY, |
| 5763 | GEN_CMD); |
| 5764 | break; |
| 5765 | } |
| 5766 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5767 | case WE_GET_TX_CHAINMASK: |
| 5768 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5769 | hdd_debug("GET WMI_PDEV_PARAM_TX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5770 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5771 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 5772 | PDEV_CMD); |
| 5773 | break; |
| 5774 | } |
| 5775 | |
| 5776 | case WE_GET_RX_CHAINMASK: |
| 5777 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5778 | hdd_debug("GET WMI_PDEV_PARAM_RX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5779 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5780 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 5781 | PDEV_CMD); |
| 5782 | break; |
| 5783 | } |
| 5784 | |
| 5785 | case WE_GET_TXPOW_2G: |
| 5786 | { |
| 5787 | uint32_t txpow2g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5788 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5789 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5790 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5791 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 5792 | PDEV_CMD); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5793 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5794 | sme_cfg_get_int(mac_handle, WNI_CFG_CURRENT_TX_POWER_LEVEL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5795 | &txpow2g)) { |
| 5796 | return -EIO; |
| 5797 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5798 | hdd_debug("2G tx_power %d", txpow2g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5799 | break; |
| 5800 | } |
| 5801 | |
| 5802 | case WE_GET_TXPOW_5G: |
| 5803 | { |
| 5804 | uint32_t txpow5g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5805 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5806 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5807 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5808 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 5809 | PDEV_CMD); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5810 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5811 | sme_cfg_get_int(mac_handle, WNI_CFG_CURRENT_TX_POWER_LEVEL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5812 | &txpow5g)) { |
| 5813 | return -EIO; |
| 5814 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5815 | hdd_debug("5G tx_power %d", txpow5g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5816 | break; |
| 5817 | } |
| 5818 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5819 | case WE_GET_PPS_PAID_MATCH: |
| 5820 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5821 | hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5822 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5823 | WMI_VDEV_PPS_PAID_MATCH, |
| 5824 | PPS_CMD); |
| 5825 | break; |
| 5826 | } |
| 5827 | |
| 5828 | case WE_GET_PPS_GID_MATCH: |
| 5829 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5830 | hdd_debug("GET WMI_VDEV_PPS_GID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5831 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5832 | WMI_VDEV_PPS_GID_MATCH, |
| 5833 | PPS_CMD); |
| 5834 | break; |
| 5835 | } |
| 5836 | |
| 5837 | case WE_GET_PPS_EARLY_TIM_CLEAR: |
| 5838 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5839 | hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5840 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5841 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 5842 | PPS_CMD); |
| 5843 | break; |
| 5844 | } |
| 5845 | |
| 5846 | case WE_GET_PPS_EARLY_DTIM_CLEAR: |
| 5847 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5848 | hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5849 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5850 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 5851 | PPS_CMD); |
| 5852 | break; |
| 5853 | } |
| 5854 | |
| 5855 | case WE_GET_PPS_EOF_PAD_DELIM: |
| 5856 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5857 | hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5858 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5859 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 5860 | PPS_CMD); |
| 5861 | break; |
| 5862 | } |
| 5863 | |
| 5864 | case WE_GET_PPS_MACADDR_MISMATCH: |
| 5865 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5866 | hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5867 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5868 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 5869 | PPS_CMD); |
| 5870 | break; |
| 5871 | } |
| 5872 | |
| 5873 | case WE_GET_PPS_DELIM_CRC_FAIL: |
| 5874 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5875 | hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5876 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5877 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 5878 | PPS_CMD); |
| 5879 | break; |
| 5880 | } |
| 5881 | |
| 5882 | case WE_GET_PPS_GID_NSTS_ZERO: |
| 5883 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5884 | hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5885 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5886 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 5887 | PPS_CMD); |
| 5888 | break; |
| 5889 | } |
| 5890 | |
| 5891 | case WE_GET_PPS_RSSI_CHECK: |
| 5892 | { |
| 5893 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5894 | hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5895 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5896 | WMI_VDEV_PPS_RSSI_CHECK, |
| 5897 | PPS_CMD); |
| 5898 | break; |
| 5899 | } |
| 5900 | |
| 5901 | case WE_GET_QPOWER_MAX_PSPOLL_COUNT: |
| 5902 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5903 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5904 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5905 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 5906 | QPOWER_CMD); |
| 5907 | break; |
| 5908 | } |
| 5909 | |
| 5910 | case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 5911 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5912 | hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5913 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5914 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 5915 | QPOWER_CMD); |
| 5916 | break; |
| 5917 | } |
| 5918 | |
| 5919 | case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 5920 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5921 | hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5922 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5923 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 5924 | QPOWER_CMD); |
| 5925 | break; |
| 5926 | } |
| 5927 | |
| 5928 | case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 5929 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5930 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5931 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5932 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 5933 | QPOWER_CMD); |
| 5934 | break; |
| 5935 | } |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5936 | case WE_CAP_TSF: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5937 | ret = hdd_capture_tsf(adapter, (uint32_t *)value, 1); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5938 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5939 | case WE_GET_TEMPERATURE: |
| 5940 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5941 | hdd_debug("WE_GET_TEMPERATURE"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5942 | ret = wlan_hdd_get_temperature(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5943 | break; |
| 5944 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5945 | case WE_GET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5946 | hdd_debug("GET WMI_VDEV_PARAM_HE_DCM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5947 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5948 | WMI_VDEV_PARAM_HE_DCM, |
| 5949 | VDEV_CMD); |
| 5950 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5951 | case WE_GET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5952 | hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5953 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5954 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5955 | VDEV_CMD); |
| 5956 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5957 | default: |
| 5958 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5959 | hdd_err("Invalid IOCTL get_value command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5960 | value[0]); |
| 5961 | break; |
| 5962 | } |
| 5963 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5964 | hdd_exit(); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5965 | qdf_mem_free(sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5966 | return ret; |
| 5967 | } |
| 5968 | |
| 5969 | static int iw_setnone_getint(struct net_device *dev, |
| 5970 | struct iw_request_info *info, |
| 5971 | union iwreq_data *wrqu, char *extra) |
| 5972 | { |
| 5973 | int ret; |
| 5974 | |
| 5975 | cds_ssr_protect(__func__); |
| 5976 | ret = __iw_setnone_getint(dev, info, wrqu, extra); |
| 5977 | cds_ssr_unprotect(__func__); |
| 5978 | |
| 5979 | return ret; |
| 5980 | } |
| 5981 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 5982 | static int hdd_set_fwtest(int argc, int cmd, int value) |
| 5983 | { |
| 5984 | struct set_fwtest_params *fw_test; |
| 5985 | |
| 5986 | /* check for max number of arguments */ |
| 5987 | if (argc > (WMA_MAX_NUM_ARGS) || |
| 5988 | argc != HDD_FWTEST_PARAMS) { |
| 5989 | hdd_err("Too Many args %d", argc); |
| 5990 | return -EINVAL; |
| 5991 | } |
| 5992 | /* |
| 5993 | * check if number of arguments are 3 then, check |
| 5994 | * then set the default value for sounding interval. |
| 5995 | */ |
| 5996 | if (HDD_FWTEST_PARAMS == argc) { |
| 5997 | if (HDD_FWTEST_SU_PARAM_ID == cmd && 0 == value) |
| 5998 | value = HDD_FWTEST_SU_DEFAULT_VALUE; |
| 5999 | if (HDD_FWTEST_MU_PARAM_ID == cmd && 0 == value) |
| 6000 | value = HDD_FWTEST_MU_DEFAULT_VALUE; |
| 6001 | } |
| 6002 | /* check sounding interval value should not exceed to max */ |
| 6003 | if (value > HDD_FWTEST_MAX_VALUE) { |
| 6004 | hdd_err("Invalid arguments value should not exceed max: %d", |
| 6005 | value); |
| 6006 | return -EINVAL; |
| 6007 | } |
| 6008 | fw_test = qdf_mem_malloc(sizeof(*fw_test)); |
| 6009 | if (NULL == fw_test) { |
| 6010 | hdd_err("qdf_mem_malloc failed for fw_test"); |
| 6011 | return -ENOMEM; |
| 6012 | } |
| 6013 | fw_test->arg = cmd; |
| 6014 | fw_test->value = value; |
| 6015 | if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) { |
| 6016 | qdf_mem_free(fw_test); |
| 6017 | hdd_err("Not able to post FW_TEST_CMD message to WMA"); |
| 6018 | return -EINVAL; |
| 6019 | } |
| 6020 | return 0; |
| 6021 | } |
| 6022 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6023 | /** |
| 6024 | * iw_set_three_ints_getnone() - Generic "set 3 params" private ioctl handler |
| 6025 | * @dev: device upon which the ioctl was received |
| 6026 | * @info: ioctl request information |
| 6027 | * @wrqu: ioctl request data |
| 6028 | * @extra: ioctl extra data |
| 6029 | * |
| 6030 | * Return: 0 on success, non-zero on error |
| 6031 | */ |
| 6032 | static int __iw_set_three_ints_getnone(struct net_device *dev, |
| 6033 | struct iw_request_info *info, |
| 6034 | union iwreq_data *wrqu, char *extra) |
| 6035 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6036 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6037 | int *value = (int *)extra; |
| 6038 | int sub_cmd = value[0]; |
| 6039 | int ret; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6040 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6041 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6042 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6043 | |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6044 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6045 | hdd_err("permission check failed"); |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6046 | return -EPERM; |
| 6047 | } |
| 6048 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6049 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6050 | if (0 != ret) |
| 6051 | return ret; |
| 6052 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6053 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6054 | if (0 != ret) |
| 6055 | return ret; |
| 6056 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6057 | switch (sub_cmd) { |
| 6058 | |
| 6059 | case WE_SET_WLAN_DBG: |
Dustin Brown | 36e2e5c | 2017-05-16 15:41:37 -0700 | [diff] [blame] | 6060 | qdf_print_set_category_verbose(qdf_get_pidx(), value[1], |
| 6061 | value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6062 | break; |
| 6063 | case WE_SET_DP_TRACE: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6064 | qdf_dp_trace_set_value(value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6065 | break; |
Himanshu Agarwal | ad4c039 | 2018-05-08 16:53:36 +0530 | [diff] [blame] | 6066 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6067 | case WE_SET_DUAL_MAC_SCAN_CONFIG: |
| 6068 | hdd_debug("Ioctl to set dual mac scan config"); |
Tushnim Bhattacharyya | 49ed8ab | 2017-05-26 18:20:10 -0700 | [diff] [blame] | 6069 | if (hdd_ctx->config->dual_mac_feature_disable == |
| 6070 | DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6071 | hdd_err("Dual mac feature is disabled from INI"); |
| 6072 | return -EPERM; |
| 6073 | } |
| 6074 | hdd_debug("%d %d %d", value[1], value[2], value[3]); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6075 | policy_mgr_set_dual_mac_scan_config(hdd_ctx->hdd_psoc, |
| 6076 | value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6077 | break; |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6078 | case WE_SET_FW_TEST: |
| 6079 | { |
| 6080 | ret = hdd_set_fwtest(value[1], value[2], value[3]); |
| 6081 | if (ret) { |
| 6082 | hdd_err("Not able to set fwtest %d", ret); |
| 6083 | return ret; |
| 6084 | } |
| 6085 | } |
| 6086 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6087 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6088 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6089 | break; |
| 6090 | |
| 6091 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6092 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6093 | return ret; |
| 6094 | } |
| 6095 | |
| 6096 | int iw_set_three_ints_getnone(struct net_device *dev, |
| 6097 | struct iw_request_info *info, |
| 6098 | union iwreq_data *wrqu, char *extra) |
| 6099 | { |
| 6100 | int ret; |
| 6101 | |
| 6102 | cds_ssr_protect(__func__); |
| 6103 | ret = __iw_set_three_ints_getnone(dev, info, wrqu, extra); |
| 6104 | cds_ssr_unprotect(__func__); |
| 6105 | |
| 6106 | return ret; |
| 6107 | } |
| 6108 | |
| 6109 | /** |
| 6110 | * hdd_connection_state_string() - Get connection state string |
| 6111 | * @connection_state: enum to be converted to a string |
| 6112 | * |
| 6113 | * Return: the string equivalent of @connection_state |
| 6114 | */ |
| 6115 | static const char * |
| 6116 | hdd_connection_state_string(eConnectionState connection_state) |
| 6117 | { |
| 6118 | switch (connection_state) { |
| 6119 | CASE_RETURN_STRING(eConnectionState_NotConnected); |
| 6120 | CASE_RETURN_STRING(eConnectionState_Connecting); |
| 6121 | CASE_RETURN_STRING(eConnectionState_Associated); |
| 6122 | CASE_RETURN_STRING(eConnectionState_IbssDisconnected); |
| 6123 | CASE_RETURN_STRING(eConnectionState_IbssConnected); |
| 6124 | CASE_RETURN_STRING(eConnectionState_Disconnecting); |
| 6125 | default: |
| 6126 | return "UNKNOWN"; |
| 6127 | } |
| 6128 | } |
| 6129 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6130 | #if defined(FEATURE_OEM_DATA_SUPPORT) |
| 6131 | /** |
| 6132 | * iw_get_oem_data_cap_wrapper() - wrapper function to call legacy or new |
| 6133 | * wifi_pos api to get oem data caps |
| 6134 | * @dev: net device upon which the request was received |
| 6135 | * @info: ioctl request information |
| 6136 | * @wrqu: ioctl request data |
| 6137 | * @extra: ioctl data payload |
| 6138 | * |
| 6139 | * Return: 0 for success, negative errno value on failure |
| 6140 | */ |
| 6141 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6142 | struct iw_request_info *info, |
| 6143 | union iwreq_data *wrqu, char *extra) |
| 6144 | { |
| 6145 | return iw_get_oem_data_cap(dev, info, wrqu, extra); |
| 6146 | } |
| 6147 | #elif defined(WIFI_POS_CONVERGED) |
| 6148 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6149 | struct iw_request_info *info, |
| 6150 | union iwreq_data *wrqu, char *extra) |
| 6151 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6152 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6153 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6154 | |
| 6155 | return os_if_wifi_pos_populate_caps(hdd_ctx->hdd_psoc, |
| 6156 | (struct wifi_pos_driver_caps *)extra); |
| 6157 | } |
| 6158 | #else |
| 6159 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6160 | struct iw_request_info *info, |
| 6161 | union iwreq_data *wrqu, char *extra) |
| 6162 | { |
| 6163 | return -ENOTSUPP; |
| 6164 | } |
| 6165 | #endif |
| 6166 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6167 | /** |
| 6168 | * iw_get_char_setnone() - Generic "get string" private ioctl handler |
| 6169 | * @dev: device upon which the ioctl was received |
| 6170 | * @info: ioctl request information |
| 6171 | * @wrqu: ioctl request data |
| 6172 | * @extra: ioctl extra data |
| 6173 | * |
| 6174 | * Return: 0 on success, non-zero on error |
| 6175 | */ |
| 6176 | static int __iw_get_char_setnone(struct net_device *dev, |
| 6177 | struct iw_request_info *info, |
| 6178 | union iwreq_data *wrqu, char *extra) |
| 6179 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6180 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6181 | int sub_cmd = wrqu->data.flags; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6182 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6183 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6184 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6185 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6186 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6187 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6188 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6189 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6190 | if (0 != ret) |
| 6191 | return ret; |
| 6192 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6193 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6194 | if (0 != ret) |
| 6195 | return ret; |
| 6196 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6197 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6198 | switch (sub_cmd) { |
| 6199 | case WE_WLAN_VERSION: |
| 6200 | { |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 6201 | wrqu->data.length = hdd_wlan_get_version(hdd_ctx, |
| 6202 | WE_MAX_STR_LEN, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6203 | break; |
| 6204 | } |
| 6205 | |
| 6206 | case WE_GET_STATS: |
| 6207 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6208 | hdd_wlan_get_stats(adapter, &(wrqu->data.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6209 | extra, WE_MAX_STR_LEN); |
| 6210 | break; |
| 6211 | } |
| 6212 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6213 | case WE_GET_SUSPEND_RESUME_STATS: |
| 6214 | { |
| 6215 | ret = wlan_hdd_write_suspend_resume_stats(hdd_ctx, extra, |
| 6216 | WE_MAX_STR_LEN); |
| 6217 | if (ret >= 0) { |
| 6218 | wrqu->data.length = ret; |
| 6219 | ret = 0; |
| 6220 | } |
| 6221 | |
| 6222 | break; |
| 6223 | } |
| 6224 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6225 | case WE_LIST_FW_PROFILE: |
| 6226 | hdd_wlan_list_fw_profile(&(wrqu->data.length), |
| 6227 | extra, WE_MAX_STR_LEN); |
| 6228 | break; |
| 6229 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6230 | /* The case prints the current state of the HDD, SME, CSR, PE, |
| 6231 | * TL it can be extended for WDI Global State as well. And |
| 6232 | * currently it only checks P2P_CLIENT adapter. P2P_DEVICE |
| 6233 | * and P2P_GO have not been added as of now. |
| 6234 | */ |
| 6235 | case WE_GET_STATES: |
| 6236 | { |
| 6237 | int buf = 0, len = 0; |
| 6238 | int adapter_num = 0; |
| 6239 | int count = 0, check = 1; |
| 6240 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6241 | struct hdd_station_ctx *sta_ctx = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6242 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6243 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6244 | struct hdd_adapter *useAdapter = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6245 | |
| 6246 | /* Print wlan0 or p2p0 states based on the adapter_num |
| 6247 | * by using the correct adapter |
| 6248 | */ |
| 6249 | while (adapter_num < 2) { |
| 6250 | if (WLAN_ADAPTER == adapter_num) { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6251 | useAdapter = adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6252 | buf = |
| 6253 | scnprintf(extra + len, |
| 6254 | WE_MAX_STR_LEN - len, |
| 6255 | "\n\n wlan0 States:-"); |
| 6256 | len += buf; |
| 6257 | } else if (P2P_ADAPTER == adapter_num) { |
| 6258 | buf = |
| 6259 | scnprintf(extra + len, |
| 6260 | WE_MAX_STR_LEN - len, |
| 6261 | "\n\n p2p0 States:-"); |
| 6262 | len += buf; |
| 6263 | |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6264 | if (!hdd_ctx) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6265 | buf = |
| 6266 | scnprintf(extra + len, |
| 6267 | WE_MAX_STR_LEN - |
| 6268 | len, |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6269 | "\n hdd_ctx is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6270 | len += buf; |
| 6271 | break; |
| 6272 | } |
| 6273 | |
| 6274 | /* Printing p2p0 states only in the |
| 6275 | * case when the device is configured |
| 6276 | * as a p2p_client |
| 6277 | */ |
| 6278 | useAdapter = |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6279 | hdd_get_adapter(hdd_ctx, |
Krunal Soni | f07bb38 | 2016-03-10 13:02:11 -0800 | [diff] [blame] | 6280 | QDF_P2P_CLIENT_MODE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6281 | if (!useAdapter) { |
| 6282 | buf = |
| 6283 | scnprintf(extra + len, |
| 6284 | WE_MAX_STR_LEN - |
| 6285 | len, |
| 6286 | "\n Device not configured as P2P_CLIENT."); |
| 6287 | len += buf; |
| 6288 | break; |
| 6289 | } |
| 6290 | } |
| 6291 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6292 | if (!mac_handle) { |
Jeff Johnson | 2a8a64f | 2018-04-28 12:31:36 -0700 | [diff] [blame] | 6293 | buf = scnprintf(extra + len, |
| 6294 | WE_MAX_STR_LEN - len, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6295 | "\n mac_handle is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6296 | len += buf; |
| 6297 | break; |
| 6298 | } |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6299 | sta_ctx = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6300 | WLAN_HDD_GET_STATION_CTX_PTR(useAdapter); |
| 6301 | |
| 6302 | |
| 6303 | buf = |
| 6304 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
| 6305 | "\n HDD Conn State - %s " |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6306 | "\n\n SME State:" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6307 | "\n Neighbour Roam State - %s" |
| 6308 | "\n CSR State - %s" |
| 6309 | "\n CSR Substate - %s", |
| 6310 | hdd_connection_state_string |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6311 | (sta_ctx->conn_info.connState), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6312 | mac_trace_get_neighbour_roam_state |
| 6313 | (sme_get_neighbor_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6314 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6315 | mac_trace_getcsr_roam_state |
| 6316 | (sme_get_current_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6317 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6318 | mac_trace_getcsr_roam_sub_state |
| 6319 | (sme_get_current_roam_sub_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6320 | (mac_handle, useAdapter->session_id)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6321 | ); |
| 6322 | len += buf; |
| 6323 | adapter_num++; |
| 6324 | } |
| 6325 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6326 | if (mac_handle) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6327 | /* Printing Lim State starting with global lim states */ |
| 6328 | buf = |
| 6329 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6330 | "\n\n LIM STATES:-" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6331 | "\n Global Sme State - %s " |
| 6332 | "\n Global mlm State - %s " "\n", |
| 6333 | mac_trace_get_lim_sme_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6334 | (sme_get_lim_sme_state(mac_handle)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6335 | mac_trace_get_lim_mlm_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6336 | (sme_get_lim_sme_state(mac_handle)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6337 | ); |
| 6338 | len += buf; |
| 6339 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6340 | while (check < 3 && count < 255) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6341 | if (sme_is_lim_session_valid(mac_handle, count)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6342 | buf = |
| 6343 | scnprintf(extra + len, |
| 6344 | WE_MAX_STR_LEN - |
| 6345 | len, |
| 6346 | "\n Lim Valid Session %d:-" |
| 6347 | "\n PE Sme State - %s " |
| 6348 | "\n PE Mlm State - %s " |
| 6349 | "\n", check, |
| 6350 | mac_trace_get_lim_sme_state |
| 6351 | (sme_get_lim_sme_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6352 | (mac_handle, count)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6353 | mac_trace_get_lim_mlm_state |
| 6354 | (sme_get_lim_mlm_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6355 | (mac_handle, count)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6356 | ); |
| 6357 | |
| 6358 | len += buf; |
| 6359 | check++; |
| 6360 | } |
| 6361 | count++; |
| 6362 | } |
| 6363 | } |
| 6364 | |
| 6365 | wrqu->data.length = strlen(extra) + 1; |
| 6366 | break; |
| 6367 | } |
| 6368 | |
| 6369 | case WE_GET_CFG: |
| 6370 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6371 | hdd_debug("Printing CLD global INI Config"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6372 | hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(adapter), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6373 | extra, |
| 6374 | QCSAP_IOCTL_MAX_STR_LEN); |
| 6375 | wrqu->data.length = strlen(extra) + 1; |
| 6376 | break; |
| 6377 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6378 | case WE_GET_RSSI: |
| 6379 | { |
| 6380 | int8_t s7Rssi = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6381 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6382 | wlan_hdd_get_rssi(adapter, &s7Rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6383 | snprintf(extra, WE_MAX_STR_LEN, "rssi=%d", s7Rssi); |
| 6384 | wrqu->data.length = strlen(extra) + 1; |
| 6385 | break; |
| 6386 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6387 | |
| 6388 | case WE_GET_WMM_STATUS: |
| 6389 | { |
| 6390 | snprintf(extra, WE_MAX_STR_LEN, |
| 6391 | "\nDir: 0=up, 1=down, 3=both\n" |
| 6392 | "|------------------------|\n" |
| 6393 | "|AC | ACM |Admitted| Dir |\n" |
| 6394 | "|------------------------|\n" |
| 6395 | "|VO | %d | %3s | %d |\n" |
| 6396 | "|VI | %d | %3s | %d |\n" |
| 6397 | "|BE | %d | %3s | %d |\n" |
| 6398 | "|BK | %d | %3s | %d |\n" |
| 6399 | "|------------------------|\n", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6400 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6401 | wmmAcStatus[SME_AC_VO].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6402 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6403 | wmmAcStatus[SME_AC_VO]. |
| 6404 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6405 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6406 | wmmAcStatus[SME_AC_VO].wmmAcTspecInfo. |
| 6407 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6408 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6409 | wmmAcStatus[SME_AC_VI].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6410 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6411 | wmmAcStatus[SME_AC_VI]. |
| 6412 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6413 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6414 | wmmAcStatus[SME_AC_VI].wmmAcTspecInfo. |
| 6415 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6416 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6417 | wmmAcStatus[SME_AC_BE].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6418 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6419 | wmmAcStatus[SME_AC_BE]. |
| 6420 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6421 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6422 | wmmAcStatus[SME_AC_BE].wmmAcTspecInfo. |
| 6423 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6424 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6425 | wmmAcStatus[SME_AC_BK].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6426 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6427 | wmmAcStatus[SME_AC_BK]. |
| 6428 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6429 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6430 | wmmAcStatus[SME_AC_BK].wmmAcTspecInfo. |
| 6431 | ts_info.direction); |
| 6432 | |
| 6433 | wrqu->data.length = strlen(extra) + 1; |
| 6434 | break; |
| 6435 | } |
| 6436 | case WE_GET_CHANNEL_LIST: |
| 6437 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6438 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6439 | uint8_t i, len; |
| 6440 | char *buf; |
| 6441 | uint8_t ubuf[WNI_CFG_COUNTRY_CODE_LEN]; |
| 6442 | uint8_t ubuf_len = WNI_CFG_COUNTRY_CODE_LEN; |
Srinivas Girigowda | c231df6 | 2017-03-24 18:27:57 -0700 | [diff] [blame] | 6443 | struct channel_list_info channel_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6444 | |
| 6445 | memset(&channel_list, 0, sizeof(channel_list)); |
Agrawal Ashish | 6c9bca7 | 2016-09-04 13:37:59 +0530 | [diff] [blame] | 6446 | status = iw_get_channel_list(dev, info, wrqu, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6447 | (char *)&channel_list); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6448 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6449 | hdd_err("GetChannelList Failed!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6450 | return -EINVAL; |
| 6451 | } |
| 6452 | buf = extra; |
| 6453 | /* |
| 6454 | * Maximum channels = WNI_CFG_VALID_CHANNEL_LIST_LEN. |
| 6455 | * Maximum buffer needed = 5 * number of channels. |
| 6456 | * Check ifsufficient buffer is available and then |
| 6457 | * proceed to fill the buffer. |
| 6458 | */ |
| 6459 | if (WE_MAX_STR_LEN < |
| 6460 | (5 * WNI_CFG_VALID_CHANNEL_LIST_LEN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6461 | hdd_err("Insufficient Buffer to populate channel list"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6462 | return -EINVAL; |
| 6463 | } |
| 6464 | len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", |
| 6465 | channel_list.num_channels); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6466 | if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, |
| 6467 | ubuf, |
| 6468 | &ubuf_len)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6469 | /* Printing Country code in getChannelList */ |
| 6470 | for (i = 0; i < (ubuf_len - 1); i++) |
| 6471 | len += scnprintf(buf + len, |
| 6472 | WE_MAX_STR_LEN - len, |
| 6473 | "%c", ubuf[i]); |
| 6474 | } |
| 6475 | for (i = 0; i < channel_list.num_channels; i++) { |
| 6476 | len += |
| 6477 | scnprintf(buf + len, WE_MAX_STR_LEN - len, |
| 6478 | " %u", channel_list.channels[i]); |
| 6479 | } |
| 6480 | wrqu->data.length = strlen(extra) + 1; |
| 6481 | |
| 6482 | break; |
| 6483 | } |
| 6484 | #ifdef FEATURE_WLAN_TDLS |
| 6485 | case WE_GET_TDLS_PEERS: |
| 6486 | { |
| 6487 | wrqu->data.length = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6488 | wlan_hdd_tdls_get_all_peers(adapter, extra, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6489 | WE_MAX_STR_LEN) + 1; |
| 6490 | break; |
| 6491 | } |
| 6492 | #endif |
| 6493 | #ifdef WLAN_FEATURE_11W |
| 6494 | case WE_GET_11W_INFO: |
| 6495 | { |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6496 | struct csr_roam_profile *roam_profile = |
| 6497 | hdd_roam_profile(adapter); |
| 6498 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6499 | hdd_debug("WE_GET_11W_ENABLED = %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6500 | roam_profile->MFPEnabled); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6501 | |
| 6502 | snprintf(extra, WE_MAX_STR_LEN, |
| 6503 | "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d" |
| 6504 | "\n Number of Unprotected Disassocs %d" |
| 6505 | "\n Number of Unprotected Deauths %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6506 | roam_profile->BSSIDs.bssid->bytes[0], |
| 6507 | roam_profile->BSSIDs.bssid->bytes[1], |
| 6508 | roam_profile->BSSIDs.bssid->bytes[2], |
| 6509 | roam_profile->BSSIDs.bssid->bytes[3], |
| 6510 | roam_profile->BSSIDs.bssid->bytes[4], |
| 6511 | roam_profile->BSSIDs.bssid->bytes[5], |
| 6512 | roam_profile->MFPEnabled, |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 6513 | adapter->hdd_stats.hdd_pmf_stats. |
| 6514 | num_unprot_disassoc_rx, |
| 6515 | adapter->hdd_stats.hdd_pmf_stats. |
| 6516 | num_unprot_deauth_rx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6517 | |
| 6518 | wrqu->data.length = strlen(extra) + 1; |
| 6519 | break; |
| 6520 | } |
| 6521 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6522 | case WE_GET_IBSS_STA_INFO: |
| 6523 | { |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6524 | struct hdd_station_ctx *sta_ctx = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6525 | WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6526 | int idx = 0; |
| 6527 | int length = 0, buf = 0; |
| 6528 | |
Naveen Rawat | c45d162 | 2016-07-05 12:20:09 -0700 | [diff] [blame] | 6529 | for (idx = 0; idx < MAX_PEERS; idx++) { |
Naveen Rawat | ac027cb | 2017-04-27 15:02:42 -0700 | [diff] [blame] | 6530 | if (HDD_WLAN_INVALID_STA_ID != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6531 | sta_ctx->conn_info.staId[idx]) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6532 | buf = snprintf |
| 6533 | ((extra + length), |
| 6534 | WE_MAX_STR_LEN - length, |
| 6535 | "\n%d .%02x:%02x:%02x:%02x:%02x:%02x\n", |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6536 | sta_ctx->conn_info.staId[idx], |
| 6537 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6538 | peerMacAddress[idx].bytes[0], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6539 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6540 | peerMacAddress[idx].bytes[1], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6541 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6542 | peerMacAddress[idx].bytes[2], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6543 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6544 | peerMacAddress[idx].bytes[3], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6545 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6546 | peerMacAddress[idx].bytes[4], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6547 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6548 | peerMacAddress[idx].bytes[5] |
| 6549 | ); |
| 6550 | length += buf; |
| 6551 | } |
| 6552 | } |
| 6553 | wrqu->data.length = strlen(extra) + 1; |
| 6554 | break; |
| 6555 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6556 | case WE_GET_PHYMODE: |
| 6557 | { |
| 6558 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6559 | struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6560 | eCsrPhyMode phymode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6561 | enum band_info currBand; |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6562 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6563 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6564 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 6565 | if (!sme_config) { |
| 6566 | hdd_err("Out of memory"); |
| 6567 | ret = -ENOMEM; |
| 6568 | break; |
| 6569 | } |
| 6570 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6571 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6572 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6573 | sme_config->csrConfig.channelBondingMode24GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6574 | ch_bond24 = true; |
| 6575 | |
| 6576 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6577 | sme_config->csrConfig.channelBondingMode5GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6578 | ch_bond5g = true; |
| 6579 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6580 | qdf_mem_free(sme_config); |
| 6581 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6582 | phymode = sme_get_phy_mode(mac_handle); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6583 | if ((QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6584 | sme_get_freq_band(mac_handle, &currBand))) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6585 | hdd_err("Failed to get current band config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6586 | return -EIO; |
| 6587 | } |
| 6588 | |
| 6589 | switch (phymode) { |
| 6590 | case eCSR_DOT11_MODE_AUTO: |
| 6591 | snprintf(extra, WE_MAX_STR_LEN, "AUTO MODE"); |
| 6592 | break; |
| 6593 | case eCSR_DOT11_MODE_11n: |
| 6594 | case eCSR_DOT11_MODE_11n_ONLY: |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6595 | if (currBand == BAND_2G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6596 | if (ch_bond24) |
| 6597 | snprintf(extra, WE_MAX_STR_LEN, |
| 6598 | "11NGHT40"); |
| 6599 | else |
| 6600 | snprintf(extra, WE_MAX_STR_LEN, |
| 6601 | "11NGHT20"); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6602 | } else if (currBand == BAND_5G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6603 | if (ch_bond5g) |
| 6604 | snprintf(extra, WE_MAX_STR_LEN, |
| 6605 | "11NAHT40"); |
| 6606 | else |
| 6607 | snprintf(extra, WE_MAX_STR_LEN, |
| 6608 | "11NAHT20"); |
| 6609 | } else { |
| 6610 | snprintf(extra, WE_MAX_STR_LEN, "11N"); |
| 6611 | } |
| 6612 | break; |
| 6613 | case eCSR_DOT11_MODE_abg: |
| 6614 | snprintf(extra, WE_MAX_STR_LEN, "11ABG"); |
| 6615 | break; |
| 6616 | case eCSR_DOT11_MODE_11a: |
| 6617 | snprintf(extra, WE_MAX_STR_LEN, "11A"); |
| 6618 | break; |
| 6619 | case eCSR_DOT11_MODE_11b: |
| 6620 | case eCSR_DOT11_MODE_11b_ONLY: |
| 6621 | snprintf(extra, WE_MAX_STR_LEN, "11B"); |
| 6622 | break; |
| 6623 | case eCSR_DOT11_MODE_11g: |
| 6624 | case eCSR_DOT11_MODE_11g_ONLY: |
| 6625 | snprintf(extra, WE_MAX_STR_LEN, "11G"); |
| 6626 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6627 | case eCSR_DOT11_MODE_11ac: |
| 6628 | case eCSR_DOT11_MODE_11ac_ONLY: |
| 6629 | if (hddctx->config->vhtChannelWidth == |
| 6630 | eHT_CHANNEL_WIDTH_20MHZ) |
| 6631 | snprintf(extra, WE_MAX_STR_LEN, |
| 6632 | "11ACVHT20"); |
| 6633 | else if (hddctx->config->vhtChannelWidth == |
| 6634 | eHT_CHANNEL_WIDTH_40MHZ) |
| 6635 | snprintf(extra, WE_MAX_STR_LEN, |
| 6636 | "11ACVHT40"); |
| 6637 | else if (hddctx->config->vhtChannelWidth == |
| 6638 | eHT_CHANNEL_WIDTH_80MHZ) |
| 6639 | snprintf(extra, WE_MAX_STR_LEN, |
| 6640 | "11ACVHT80"); |
| 6641 | else if (hddctx->config->vhtChannelWidth == |
| 6642 | eHT_CHANNEL_WIDTH_160MHZ) |
| 6643 | snprintf(extra, WE_MAX_STR_LEN, |
| 6644 | "11ACVHT160"); |
| 6645 | break; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 6646 | case eCSR_DOT11_MODE_11ax: |
| 6647 | case eCSR_DOT11_MODE_11ax_ONLY: |
| 6648 | /* currently using vhtChannelWidth */ |
| 6649 | if (hddctx->config->vhtChannelWidth == |
| 6650 | eHT_CHANNEL_WIDTH_20MHZ) |
| 6651 | snprintf(extra, WE_MAX_STR_LEN, |
| 6652 | "11AX_HE_20"); |
| 6653 | else if (hddctx->config->vhtChannelWidth == |
| 6654 | eHT_CHANNEL_WIDTH_40MHZ) |
| 6655 | snprintf(extra, WE_MAX_STR_LEN, |
| 6656 | "11AX_HE_40"); |
| 6657 | else if (hddctx->config->vhtChannelWidth == |
| 6658 | eHT_CHANNEL_WIDTH_80MHZ) |
| 6659 | snprintf(extra, WE_MAX_STR_LEN, |
| 6660 | "11AX_HE_80"); |
| 6661 | else if (hddctx->config->vhtChannelWidth == |
| 6662 | eHT_CHANNEL_WIDTH_160MHZ) |
| 6663 | snprintf(extra, WE_MAX_STR_LEN, |
| 6664 | "11AX_HE_160"); |
| 6665 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6666 | } |
| 6667 | |
| 6668 | wrqu->data.length = strlen(extra) + 1; |
| 6669 | break; |
| 6670 | } |
| 6671 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6672 | case WE_GET_OEM_DATA_CAP: |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6673 | return iw_get_oem_data_cap_wrapper(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6674 | case WE_GET_SNR: |
| 6675 | { |
| 6676 | int8_t s7snr = 0; |
| 6677 | int status = 0; |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6678 | struct hdd_context *hdd_ctx; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6679 | struct hdd_station_ctx *sta_ctx; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6680 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6681 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6682 | status = wlan_hdd_validate_context(hdd_ctx); |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 6683 | if (status) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6684 | return status; |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 6685 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6686 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6687 | if (0 == hdd_ctx->config->fEnableSNRMonitoring || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6688 | eConnectionState_Associated != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6689 | sta_ctx->conn_info.connState) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6690 | hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d", |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6691 | hdd_ctx->config->fEnableSNRMonitoring, |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6692 | sta_ctx->conn_info.connState); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6693 | return -ENONET; |
| 6694 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6695 | wlan_hdd_get_snr(adapter, &s7snr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6696 | snprintf(extra, WE_MAX_STR_LEN, "snr=%d", s7snr); |
| 6697 | wrqu->data.length = strlen(extra) + 1; |
| 6698 | break; |
| 6699 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6700 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6701 | default: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6702 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6703 | break; |
| 6704 | } |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6705 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6706 | hdd_exit(); |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6707 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6708 | } |
| 6709 | |
| 6710 | static int iw_get_char_setnone(struct net_device *dev, |
| 6711 | struct iw_request_info *info, |
| 6712 | union iwreq_data *wrqu, char *extra) |
| 6713 | { |
| 6714 | int ret; |
| 6715 | |
| 6716 | cds_ssr_protect(__func__); |
| 6717 | ret = __iw_get_char_setnone(dev, info, wrqu, extra); |
| 6718 | cds_ssr_unprotect(__func__); |
| 6719 | |
| 6720 | return ret; |
| 6721 | } |
| 6722 | |
| 6723 | /** |
| 6724 | * iw_setnone_getnone() - Generic "action" private ioctl handler |
| 6725 | * @dev: device upon which the ioctl was received |
| 6726 | * @info: ioctl request information |
| 6727 | * @wrqu: ioctl request data |
| 6728 | * @extra: ioctl extra data |
| 6729 | * |
| 6730 | * Return: 0 on success, non-zero on error |
| 6731 | */ |
| 6732 | static int __iw_setnone_getnone(struct net_device *dev, |
| 6733 | struct iw_request_info *info, |
| 6734 | union iwreq_data *wrqu, char *extra) |
| 6735 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6736 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6737 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6738 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6739 | int ret; |
| 6740 | int sub_cmd; |
| 6741 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6742 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6743 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6744 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6745 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6746 | if (0 != ret) |
| 6747 | return ret; |
| 6748 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6749 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6750 | if (0 != ret) |
| 6751 | return ret; |
| 6752 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6753 | #ifdef CONFIG_COMPAT |
| 6754 | /* this ioctl is a special case where a sub-ioctl is used and both |
| 6755 | * the number of get and set args is 0. in this specific case the |
| 6756 | * logic in iwpriv places the sub_cmd in the data.flags portion of |
| 6757 | * the iwreq. unfortunately the location of this field will be |
| 6758 | * different between 32-bit and 64-bit userspace, and the standard |
| 6759 | * compat support in the kernel does not handle this case. so we |
| 6760 | * need to explicitly handle it here. |
| 6761 | */ |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 6762 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6763 | struct compat_iw_point *compat_iw_point = |
| 6764 | (struct compat_iw_point *)&wrqu->data; |
| 6765 | sub_cmd = compat_iw_point->flags; |
| 6766 | } else { |
| 6767 | sub_cmd = wrqu->data.flags; |
| 6768 | } |
| 6769 | #else |
| 6770 | sub_cmd = wrqu->data.flags; |
| 6771 | #endif |
| 6772 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6773 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6774 | switch (sub_cmd) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6775 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6776 | case WE_GET_RECOVERY_STAT: |
| 6777 | sme_get_recovery_stats(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6778 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6779 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6780 | case WE_GET_FW_PROFILE_DATA: |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6781 | ret = wma_cli_set_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6782 | WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, |
| 6783 | 0, DBG_CMD); |
| 6784 | break; |
| 6785 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6786 | case WE_IBSS_GET_PEER_INFO_ALL: |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6787 | hdd_wlan_get_ibss_peer_info_all(adapter); |
| 6788 | break; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6789 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6790 | case WE_SET_REASSOC_TRIGGER: |
| 6791 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6792 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6793 | tSirMacAddr bssid; |
Krunal Soni | bfd0549 | 2017-10-03 15:48:37 -0700 | [diff] [blame] | 6794 | uint32_t roamId = INVALID_ROAM_ID; |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6795 | uint8_t operating_ch = |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 6796 | adapter->session.station.conn_info.operationChannel; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6797 | tCsrRoamModifyProfileFields modProfileFields; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6798 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6799 | sme_get_modify_profile_fields(mac_handle, adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6800 | &modProfileFields); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6801 | if (roaming_offload_enabled(hdd_ctx)) { |
| 6802 | qdf_mem_copy(bssid, |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 6803 | &adapter->session.station.conn_info.bssId, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6804 | sizeof(bssid)); |
Naveen Rawat | 664a7cb | 2017-01-19 17:58:14 -0800 | [diff] [blame] | 6805 | hdd_wma_send_fastreassoc_cmd(adapter, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6806 | bssid, operating_ch); |
| 6807 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6808 | sme_roam_reassoc(mac_handle, adapter->session_id, |
| 6809 | NULL, modProfileFields, &roamId, 1); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6810 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6811 | return 0; |
| 6812 | } |
| 6813 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6814 | case WE_STOP_OBSS_SCAN: |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6815 | /* |
| 6816 | * 1.OBSS Scan is mandatory while operating in 2.4GHz |
| 6817 | * 2.OBSS scan is stopped by Firmware during the disassociation |
| 6818 | * 3.OBSS stop comamnd is added for debugging purpose |
| 6819 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6820 | if (!mac_handle) { |
| 6821 | hdd_err("mac_handle context is NULL"); |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6822 | return -EINVAL; |
| 6823 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6824 | sme_ht40_stop_obss_scan(mac_handle, adapter->session_id); |
| 6825 | break; |
| 6826 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6827 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6828 | hdd_err("unknown ioctl %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6829 | break; |
| 6830 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6831 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6832 | return ret; |
| 6833 | } |
| 6834 | |
| 6835 | static int iw_setnone_getnone(struct net_device *dev, |
| 6836 | struct iw_request_info *info, |
| 6837 | union iwreq_data *wrqu, char *extra) |
| 6838 | { |
| 6839 | int ret; |
| 6840 | |
| 6841 | cds_ssr_protect(__func__); |
| 6842 | ret = __iw_setnone_getnone(dev, info, wrqu, extra); |
| 6843 | cds_ssr_unprotect(__func__); |
| 6844 | |
| 6845 | return ret; |
| 6846 | } |
| 6847 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6848 | #ifdef MPC_UT_FRAMEWORK |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6849 | 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] | 6850 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6851 | { |
Jeff Johnson | ac8b0de | 2017-02-10 09:22:22 -0800 | [diff] [blame] | 6852 | switch (sub_cmd) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6853 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 6854 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6855 | hdd_debug("<iwpriv wlan0 pm_clist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6856 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6857 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 6858 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 6859 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 6860 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6861 | return 0; |
| 6862 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6863 | policy_mgr_incr_connection_count_utfw(hdd_ctx->hdd_psoc, |
| 6864 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 6865 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6866 | } |
| 6867 | break; |
| 6868 | |
| 6869 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 6870 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6871 | hdd_debug("<iwpriv wlan0 pm_dlist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6872 | if ((apps_args[0] < 0) || (apps_args[1] < 0)) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6873 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6874 | return 0; |
| 6875 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6876 | policy_mgr_decr_connection_count_utfw(hdd_ctx->hdd_psoc, |
| 6877 | apps_args[0], apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6878 | } |
| 6879 | break; |
| 6880 | |
| 6881 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 6882 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6883 | hdd_debug("<iwpriv wlan0 pm_ulist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6884 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6885 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 6886 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 6887 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 6888 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6889 | return 0; |
| 6890 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6891 | policy_mgr_update_connection_info_utfw(hdd_ctx->hdd_psoc, |
| 6892 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 6893 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6894 | } |
| 6895 | break; |
| 6896 | |
| 6897 | case WE_POLICY_MANAGER_DBS_CMD: |
| 6898 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6899 | hdd_debug("<iwpriv wlan0 pm_dbs> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6900 | if (apps_args[0] == 0) |
| 6901 | wma_set_dbs_capability_ut(0); |
| 6902 | else |
| 6903 | wma_set_dbs_capability_ut(1); |
| 6904 | |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6905 | if (apps_args[1] >= PM_THROUGHPUT && |
| 6906 | apps_args[1] <= PM_LATENCY) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6907 | pr_info("setting system pref to [%d]\n", apps_args[1]); |
| 6908 | hdd_ctx->config->conc_system_pref = apps_args[1]; |
| 6909 | } |
| 6910 | } |
| 6911 | break; |
| 6912 | |
| 6913 | case WE_POLICY_MANAGER_PCL_CMD: |
| 6914 | { |
| 6915 | uint8_t pcl[QDF_MAX_NUM_CHAN] = {0}; |
| 6916 | uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0}; |
| 6917 | uint32_t pcl_len = 0, i = 0; |
| 6918 | |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 6919 | hdd_debug("<iwpriv wlan0 pm_pcl> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6920 | |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6921 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6922 | hdd_err("Invalid input param received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6923 | return 0; |
| 6924 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6925 | policy_mgr_get_pcl(hdd_ctx->hdd_psoc, apps_args[0], |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6926 | pcl, &pcl_len, |
| 6927 | weight_list, QDF_ARRAY_SIZE(weight_list)); |
| 6928 | pr_info("PCL list for role[%d] is {", apps_args[0]); |
| 6929 | for (i = 0 ; i < pcl_len; i++) |
| 6930 | pr_info(" %d, ", pcl[i]); |
| 6931 | pr_info("}--------->\n"); |
| 6932 | } |
| 6933 | break; |
| 6934 | |
| 6935 | case WE_POLICY_SET_HW_MODE_CMD: |
| 6936 | { |
| 6937 | if (apps_args[0] == 0) { |
| 6938 | hdd_err("set hw mode for single mac"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6939 | policy_mgr_pdev_set_hw_mode(hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6940 | adapter->session_id, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6941 | HW_MODE_SS_2x2, |
| 6942 | HW_MODE_80_MHZ, |
| 6943 | HW_MODE_SS_0x0, HW_MODE_BW_NONE, |
Liangwei Dong | 0f9c75d | 2018-05-22 22:14:37 -0400 | [diff] [blame] | 6944 | HW_MODE_MAC_BAND_NONE, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6945 | HW_MODE_DBS_NONE, |
| 6946 | HW_MODE_AGILE_DFS_NONE, |
| 6947 | HW_MODE_SBS_NONE, |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6948 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6949 | } else if (apps_args[0] == 1) { |
| 6950 | hdd_err("set hw mode for dual mac"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6951 | policy_mgr_pdev_set_hw_mode(hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6952 | adapter->session_id, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6953 | HW_MODE_SS_1x1, |
| 6954 | HW_MODE_80_MHZ, |
| 6955 | HW_MODE_SS_1x1, HW_MODE_40_MHZ, |
Liangwei Dong | 0f9c75d | 2018-05-22 22:14:37 -0400 | [diff] [blame] | 6956 | HW_MODE_MAC_BAND_NONE, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6957 | HW_MODE_DBS, |
| 6958 | HW_MODE_AGILE_DFS_NONE, |
| 6959 | HW_MODE_SBS_NONE, |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6960 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6961 | } |
| 6962 | } |
| 6963 | break; |
| 6964 | |
| 6965 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 6966 | { |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 6967 | hdd_debug("<iwpriv wlan0 pm_query_action> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6968 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6969 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6970 | return 0; |
| 6971 | } |
Tushnim Bhattacharyya | dfbce70 | 2018-03-27 12:46:48 -0700 | [diff] [blame] | 6972 | policy_mgr_current_connections_update( |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6973 | hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6974 | adapter->session_id, apps_args[0], |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6975 | POLICY_MGR_UPDATE_REASON_UT); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6976 | } |
| 6977 | break; |
| 6978 | |
| 6979 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 6980 | { |
| 6981 | bool allow; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6982 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6983 | hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6984 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6985 | (apps_args[2] < 0)) { |
| 6986 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6987 | return 0; |
| 6988 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6989 | allow = policy_mgr_allow_concurrency(hdd_ctx->hdd_psoc, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6990 | apps_args[0], apps_args[1], apps_args[2]); |
| 6991 | pr_info("allow %d {0 = don't allow, 1 = allow}", allow); |
| 6992 | } |
| 6993 | break; |
| 6994 | |
| 6995 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 6996 | { |
| 6997 | clean_report(hdd_ctx); |
| 6998 | if (apps_args[0] == 1) { |
| 6999 | wlan_hdd_one_connection_scenario(hdd_ctx); |
| 7000 | } else if (apps_args[0] == 2) { |
| 7001 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7002 | 6, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7003 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7004 | 36, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7005 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7006 | 6, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7007 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7008 | 36, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7009 | } else if (apps_args[0] == 3) { |
| 7010 | /* MCC on same band with 2x2 same mac*/ |
| 7011 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7012 | 6, 11, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7013 | /* MCC on diff band with 2x2 same mac*/ |
| 7014 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7015 | 6, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7016 | /* MCC on diff band with 1x1 diff mac */ |
| 7017 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7018 | 36, 6, POLICY_MGR_ONE_ONE, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7019 | /* MCC on diff band with 1x1 same mac */ |
| 7020 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7021 | 36, 6, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7022 | /* SCC on same band with 2x2 same mac */ |
| 7023 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7024 | 36, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7025 | /* SCC on same band with 1x1 same mac */ |
| 7026 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7027 | 36, 36, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7028 | /* MCC on same band with 2x2 same mac */ |
| 7029 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7030 | 36, 149, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7031 | /* MCC on same band with 1x1 same mac */ |
| 7032 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7033 | 36, 149, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7034 | } |
| 7035 | print_report(hdd_ctx); |
| 7036 | } |
| 7037 | break; |
| 7038 | } |
| 7039 | return 0; |
| 7040 | } |
| 7041 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7042 | 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] | 7043 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7044 | { |
| 7045 | return 0; |
| 7046 | } |
| 7047 | #endif |
| 7048 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7049 | /** |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7050 | * hdd_ch_avoid_unit_cmd - unit test ch avoidance |
| 7051 | * @hdd_ctx: hdd_context |
| 7052 | * @num_args: input args number |
| 7053 | * @apps_args: args data ptr |
| 7054 | * |
| 7055 | * This is to inject a ch avoid event to do unit test SAP chan avoidance. |
| 7056 | * |
| 7057 | * Return: void |
| 7058 | */ |
| 7059 | #if WLAN_DEBUG |
| 7060 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7061 | int num_args, int *apps_args) |
| 7062 | { |
| 7063 | struct ch_avoid_ind_type ch_avoid; |
| 7064 | int cnt = 0, i; |
| 7065 | |
| 7066 | if (num_args < 2 || num_args > CH_AVOID_MAX_RANGE * 2 || |
| 7067 | num_args % 2 != 0) |
| 7068 | return; |
| 7069 | hdd_info("simulate ch avoid num_args %d", num_args); |
| 7070 | for (i = 0; i < num_args && i < CH_AVOID_MAX_RANGE * 2; i++) { |
| 7071 | ch_avoid.avoid_freq_range[cnt].start_freq = |
| 7072 | apps_args[i]; |
| 7073 | ch_avoid.avoid_freq_range[cnt].end_freq = |
| 7074 | apps_args[++i]; |
| 7075 | |
| 7076 | hdd_info("simulate ch avoid [%d %d]", |
| 7077 | ch_avoid.avoid_freq_range[cnt].start_freq, |
| 7078 | ch_avoid.avoid_freq_range[cnt].end_freq); |
| 7079 | cnt++; |
| 7080 | } |
| 7081 | ch_avoid.ch_avoid_range_cnt = cnt; |
| 7082 | ucfg_reg_unit_simulate_ch_avoid(hdd_ctx->hdd_psoc, &ch_avoid); |
| 7083 | } |
| 7084 | #else |
| 7085 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7086 | int num_args, int *apps_args) |
| 7087 | { |
| 7088 | } |
| 7089 | #endif |
| 7090 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7091 | * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7092 | * @dev: device upon which the ioctl was received |
| 7093 | * @info: ioctl request information |
| 7094 | * @wrqu: ioctl request data |
| 7095 | * @extra: ioctl extra data |
| 7096 | * |
| 7097 | * This is an SSR-protected generic handler for private ioctls which |
| 7098 | * take multiple arguments. Note that this implementation is also |
| 7099 | * somewhat unique in that it is shared by both STA-mode and SAP-mode |
| 7100 | * interfaces. |
| 7101 | * |
| 7102 | * Return: 0 on success, non-zero on error |
| 7103 | */ |
| 7104 | static int __iw_set_var_ints_getnone(struct net_device *dev, |
| 7105 | struct iw_request_info *info, |
| 7106 | union iwreq_data *wrqu, char *extra) |
| 7107 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7108 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7109 | mac_handle_t mac_handle; |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7110 | 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] | 7111 | int sub_cmd; |
| 7112 | int *apps_args = (int *) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7113 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7114 | int ret, num_args; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7115 | void *soc = NULL; |
| 7116 | struct cdp_pdev *pdev = NULL; |
| 7117 | struct cdp_vdev *vdev = NULL; |
| 7118 | struct cdp_txrx_stats_req req = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7119 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7120 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7121 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7122 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7123 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7124 | if (0 != ret) |
| 7125 | return ret; |
| 7126 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7127 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7128 | if (0 != ret) |
| 7129 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7130 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7131 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7132 | sub_cmd = wrqu->data.flags; |
| 7133 | num_args = wrqu->data.length; |
| 7134 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7135 | hdd_debug("Received length %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7136 | |
| 7137 | switch (sub_cmd) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7138 | case WE_IBSS_GET_PEER_INFO: |
| 7139 | { |
| 7140 | pr_info("Station ID = %d\n", apps_args[0]); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7141 | hdd_wlan_get_ibss_peer_info(adapter, apps_args[0]); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7142 | } |
| 7143 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7144 | |
| 7145 | case WE_P2P_NOA_CMD: |
| 7146 | { |
Srinivas Girigowda | 5d5fdc5 | 2017-03-24 22:30:57 -0700 | [diff] [blame] | 7147 | struct p2p_app_set_ps p2pNoA; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7148 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7149 | if (adapter->device_mode != QDF_P2P_GO_MODE) { |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7150 | hdd_err("Setting NoA is not allowed in Device mode %s(%d)", |
| 7151 | hdd_device_mode_to_string( |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7152 | adapter->device_mode), |
| 7153 | adapter->device_mode); |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7154 | return -EINVAL; |
| 7155 | } |
| 7156 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7157 | p2pNoA.opp_ps = apps_args[0]; |
| 7158 | p2pNoA.ctWindow = apps_args[1]; |
| 7159 | p2pNoA.duration = apps_args[2]; |
| 7160 | p2pNoA.interval = apps_args[3]; |
| 7161 | p2pNoA.count = apps_args[4]; |
| 7162 | p2pNoA.single_noa_duration = apps_args[5]; |
| 7163 | p2pNoA.psSelection = apps_args[6]; |
| 7164 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7165 | 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] | 7166 | apps_args[0], apps_args[1], apps_args[2], |
| 7167 | apps_args[3], apps_args[4], |
| 7168 | apps_args[5], apps_args[6]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7169 | |
| 7170 | hdd_set_p2p_ps(dev, &p2pNoA); |
| 7171 | |
| 7172 | } |
| 7173 | break; |
| 7174 | |
| 7175 | case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD: |
| 7176 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7177 | hdd_debug("SELECTIVE_MODULE_LOG %d arg1 %d arg2", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7178 | apps_args[0], apps_args[1]); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 7179 | qdf_trace_enable(apps_args[0], apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7180 | } |
| 7181 | break; |
| 7182 | |
| 7183 | case WE_MTRACE_DUMP_CMD: |
| 7184 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7185 | 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] | 7186 | apps_args[0], apps_args[1], |
| 7187 | apps_args[2], apps_args[3]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7188 | qdf_trace_dump_all((void *)mac_handle, apps_args[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7189 | apps_args[1], apps_args[2], |
| 7190 | apps_args[3]); |
| 7191 | |
| 7192 | } |
| 7193 | break; |
| 7194 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7195 | case WE_POLICY_MANAGER_CINFO_CMD: |
| 7196 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7197 | struct policy_mgr_conc_connection_info *conn_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7198 | uint32_t i = 0, len = 0; |
| 7199 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7200 | hdd_info("<iwpriv wlan0 pm_cinfo> is called"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7201 | conn_info = policy_mgr_get_conn_info(&len); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7202 | pr_info("+--------------------------+\n"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7203 | for (i = 0; i < len; i++) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7204 | pr_info("|table_index[%d]\t\t\n", i); |
| 7205 | pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id); |
| 7206 | pr_info("|\t|chan - %-10d|\n", conn_info->chan); |
| 7207 | pr_info("|\t|bw - %-10d|\n", conn_info->bw); |
| 7208 | pr_info("|\t|mode - %-10d|\n", conn_info->mode); |
| 7209 | pr_info("|\t|mac - %-10d|\n", conn_info->mac); |
| 7210 | pr_info("|\t|in_use - %-10d|\n", conn_info->in_use); |
| 7211 | pr_info("+--------------------------+\n"); |
| 7212 | conn_info++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7213 | } |
| 7214 | } |
| 7215 | break; |
| 7216 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7217 | case WE_UNIT_TEST_CMD: |
| 7218 | { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7219 | QDF_STATUS status; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7220 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7221 | if ((apps_args[0] < WLAN_MODULE_ID_MIN) || |
| 7222 | (apps_args[0] >= WLAN_MODULE_ID_MAX)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7223 | hdd_err("Invalid MODULE ID %d", apps_args[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7224 | return -EINVAL; |
| 7225 | } |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7226 | if ((apps_args[1] >= (WMA_MAX_NUM_ARGS)) || |
Anurag Chouhan | 7756418 | 2016-09-03 16:38:01 +0530 | [diff] [blame] | 7227 | (apps_args[1] < 0)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7228 | hdd_err("Too Many/Few args %d", apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7229 | return -EINVAL; |
| 7230 | } |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7231 | status = sme_send_unit_test_cmd(adapter->session_id, |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7232 | apps_args[0], |
| 7233 | apps_args[1], |
| 7234 | &apps_args[2]); |
| 7235 | if (QDF_STATUS_SUCCESS != status) { |
Jeff Johnson | 21d63bb | 2017-10-07 17:45:33 -0700 | [diff] [blame] | 7236 | hdd_err("sme_send_unit_test_cmd returned %d", status); |
| 7237 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7238 | } |
| 7239 | } |
| 7240 | break; |
| 7241 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 7242 | case WE_LED_FLASHING_PARAM: |
| 7243 | { |
| 7244 | int i; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7245 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7246 | if (num_args != 4) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7247 | hdd_err("gpio_control: 4 parameters are required"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7248 | return -EINVAL; |
| 7249 | } |
| 7250 | for (i = 0; i < num_args; i++) { |
| 7251 | if (apps_args[i] >= 0x7fffffff) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7252 | hdd_err("gpio_control: parameter should be less than 0x7fffffff"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7253 | return -EINVAL; |
| 7254 | } |
| 7255 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7256 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7257 | 0, apps_args[0], apps_args[1]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7258 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7259 | 1, apps_args[2], apps_args[3]); |
| 7260 | } |
| 7261 | break; |
| 7262 | #endif |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 7263 | case WE_SET_PKTLOG: |
| 7264 | { |
| 7265 | int ret; |
| 7266 | |
| 7267 | if (num_args < 1 || num_args > 2) { |
| 7268 | hdd_err("pktlog: either 1 or 2 parameters are required"); |
| 7269 | return -EINVAL; |
| 7270 | } |
| 7271 | |
| 7272 | ret = hdd_process_pktlog_command(hdd_ctx, apps_args[0], |
| 7273 | apps_args[1]); |
| 7274 | if (ret) |
| 7275 | return ret; |
| 7276 | break; |
| 7277 | } |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7278 | case WE_MAC_PWR_DEBUG_CMD: |
| 7279 | { |
| 7280 | struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args; |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7281 | int i, j; |
| 7282 | |
| 7283 | if (num_args < 3) { |
| 7284 | hdd_err("number of arguments can't be null %d", |
| 7285 | num_args); |
| 7286 | return -EINVAL; |
| 7287 | } |
| 7288 | if (num_args - 3 != apps_args[2]) { |
| 7289 | hdd_err("arg list of size %d doesn't match num_args %d", |
| 7290 | num_args-3, apps_args[2]); |
| 7291 | return -EINVAL; |
| 7292 | } |
| 7293 | if ((apps_args[1] < WLAN_MODULE_ID_MIN) || |
| 7294 | (apps_args[1] >= WLAN_MODULE_ID_MAX)) { |
| 7295 | hdd_err("Invalid MODULE ID %d", apps_args[1]); |
| 7296 | return -EINVAL; |
| 7297 | } |
| 7298 | if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) { |
| 7299 | hdd_err("Too Many args %d", apps_args[2]); |
| 7300 | return -EINVAL; |
| 7301 | } |
| 7302 | mac_pwr_dbg_args.pdev_id = apps_args[0]; |
| 7303 | mac_pwr_dbg_args.module_id = apps_args[1]; |
| 7304 | mac_pwr_dbg_args.num_args = apps_args[2]; |
| 7305 | |
| 7306 | for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++) |
| 7307 | mac_pwr_dbg_args.args[i] = apps_args[j]; |
| 7308 | |
| 7309 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7310 | sme_process_mac_pwr_dbg_cmd(mac_handle, |
| 7311 | adapter->session_id, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7312 | &mac_pwr_dbg_args)) { |
| 7313 | return -EINVAL; |
| 7314 | } |
| 7315 | } |
| 7316 | break; |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7317 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7318 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7319 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7320 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7321 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7322 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7323 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7324 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7325 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7326 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7327 | iw_get_policy_manager_ut_ops(hdd_ctx, adapter, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7328 | sub_cmd, apps_args); |
| 7329 | } |
| 7330 | break; |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7331 | case WE_SET_CHAN_AVOID: |
| 7332 | { |
| 7333 | hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args); |
| 7334 | } |
| 7335 | break; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7336 | case WE_SET_TXRX_STATS: |
| 7337 | { |
| 7338 | ret = cds_get_datapath_handles(&soc, &pdev, &vdev, |
| 7339 | adapter->session_id); |
| 7340 | |
| 7341 | if (ret != 0) { |
| 7342 | hdd_err("Invalid handles"); |
| 7343 | break; |
| 7344 | } |
| 7345 | |
| 7346 | req.stats = apps_args[0]; |
| 7347 | /* default value of secondary parameter is 0(mac_id) */ |
| 7348 | req.mac_id = apps_args[1]; |
| 7349 | |
| 7350 | hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", |
| 7351 | req.stats, req.mac_id); |
Venkata Sharath Chandra Manchala | 43cb55c | 2018-03-14 00:04:22 -0700 | [diff] [blame] | 7352 | if (apps_args[0] == CDP_TXRX_STATS_28) { |
| 7353 | if (sta_ctx->conn_info.uIsAuthenticated) { |
| 7354 | hdd_debug("ap mac addr: %pM", |
| 7355 | (void *)&sta_ctx->conn_info.bssId); |
| 7356 | req.peer_addr = |
| 7357 | (char *)&sta_ctx->conn_info.bssId; |
| 7358 | } |
| 7359 | } |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7360 | ret = cdp_txrx_stats_request(soc, vdev, &req); |
| 7361 | break; |
| 7362 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7363 | default: |
| 7364 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7365 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7366 | } |
| 7367 | break; |
| 7368 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7369 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7370 | return 0; |
| 7371 | } |
| 7372 | |
| 7373 | /** |
| 7374 | * iw_hdd_set_var_ints_getnone() - set var ints getnone callback |
| 7375 | * @dev: pointer to net_device structure |
| 7376 | * @info: pointer to iw_request_info structure |
| 7377 | * @wrqu: pointer to iwreq_data |
| 7378 | * @extra; extra |
| 7379 | * |
| 7380 | * Return: 0 on success, error number otherwise |
| 7381 | * |
| 7382 | */ |
| 7383 | static int iw_hdd_set_var_ints_getnone(struct net_device *dev, |
| 7384 | struct iw_request_info *info, |
| 7385 | union iwreq_data *wrqu, char *extra) |
| 7386 | { |
| 7387 | union iwreq_data u_priv_wrqu; |
| 7388 | int apps_args[MAX_VAR_ARGS] = {0}; |
| 7389 | int ret, num_args; |
| 7390 | |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7391 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7392 | hdd_err("permission check failed"); |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7393 | return -EPERM; |
| 7394 | } |
| 7395 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7396 | /* Helper function to get iwreq_data with compat handling. */ |
| 7397 | if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) |
| 7398 | return -EINVAL; |
| 7399 | |
| 7400 | if (NULL == u_priv_wrqu.data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7401 | hdd_err("NULL data pointer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7402 | return -EINVAL; |
| 7403 | } |
| 7404 | |
| 7405 | num_args = u_priv_wrqu.data.length; |
| 7406 | if (num_args > MAX_VAR_ARGS) |
| 7407 | num_args = MAX_VAR_ARGS; |
| 7408 | |
| 7409 | if (copy_from_user(apps_args, u_priv_wrqu.data.pointer, |
| 7410 | (sizeof(int)) * num_args)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7411 | hdd_err("failed to copy data from user buffer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7412 | return -EFAULT; |
| 7413 | } |
| 7414 | |
| 7415 | cds_ssr_protect(__func__); |
| 7416 | ret = __iw_set_var_ints_getnone(dev, info, &u_priv_wrqu, |
| 7417 | (char *)&apps_args); |
| 7418 | cds_ssr_unprotect(__func__); |
| 7419 | return ret; |
| 7420 | } |
| 7421 | |
| 7422 | /** |
| 7423 | * iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7424 | * @dev: device upon which the ioctl was received |
| 7425 | * @info: ioctl request information |
| 7426 | * @wrqu: ioctl request data |
| 7427 | * @extra: ioctl extra data |
| 7428 | * |
| 7429 | * This is a generic handler for private ioctls which take multiple |
| 7430 | * arguments. Note that this implementation is also somewhat unique |
| 7431 | * in that it is shared by both STA-mode and SAP-mode interfaces. |
| 7432 | * |
| 7433 | * Return: 0 on success, non-zero on error |
| 7434 | */ |
| 7435 | int iw_set_var_ints_getnone(struct net_device *dev, |
| 7436 | struct iw_request_info *info, |
| 7437 | union iwreq_data *wrqu, char *extra) |
| 7438 | { |
| 7439 | int ret; |
| 7440 | |
| 7441 | cds_ssr_protect(__func__); |
| 7442 | ret = __iw_set_var_ints_getnone(dev, info, wrqu, extra); |
| 7443 | cds_ssr_unprotect(__func__); |
| 7444 | return ret; |
| 7445 | } |
| 7446 | |
| 7447 | /** |
| 7448 | * iw_add_tspec - Add TSpec private ioctl handler |
| 7449 | * @dev: device upon which the ioctl was received |
| 7450 | * @info: ioctl request information |
| 7451 | * @wrqu: ioctl request data |
| 7452 | * @extra: ioctl extra data |
| 7453 | * |
| 7454 | * Return: 0 on success, non-zero on error |
| 7455 | */ |
| 7456 | static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7457 | union iwreq_data *wrqu, char *extra) |
| 7458 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7459 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7460 | 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] | 7461 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7462 | int params[HDD_WLAN_WMM_PARAM_COUNT]; |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 7463 | struct sme_qos_wmmtspecinfo tSpec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7464 | uint32_t handle; |
| 7465 | struct iw_point s_priv_data; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7466 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7467 | int ret; |
| 7468 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7469 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7470 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7471 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7472 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7473 | if (0 != ret) |
| 7474 | return ret; |
| 7475 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7476 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7477 | if (0 != ret) |
| 7478 | return ret; |
| 7479 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7480 | /* make sure the application is sufficiently priviledged */ |
| 7481 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 7482 | /* this ioctl wants to return status to user space it must be */ |
| 7483 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7484 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7485 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7486 | |
| 7487 | /* we must be associated in order to add a tspec */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7488 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7489 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7490 | return 0; |
| 7491 | } |
| 7492 | /* since we are defined to be a "get" ioctl, and since the number */ |
| 7493 | /* of params exceeds the number of params that wireless extensions */ |
| 7494 | /* will pass down in the iwreq_data, we must copy the "set" params. */ |
| 7495 | /* We must handle the compat for iwreq_data in 32U/64K environment. */ |
| 7496 | |
| 7497 | /* helper function to get iwreq_data with compat handling. */ |
| 7498 | if (hdd_priv_get_data(&s_priv_data, wrqu)) { |
| 7499 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7500 | return 0; |
| 7501 | } |
| 7502 | /* make sure all params are correctly passed to function */ |
| 7503 | if ((NULL == s_priv_data.pointer) || |
| 7504 | (HDD_WLAN_WMM_PARAM_COUNT != s_priv_data.length)) { |
| 7505 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7506 | return 0; |
| 7507 | } |
| 7508 | /* from user space ourselves */ |
| 7509 | if (copy_from_user(¶ms, s_priv_data.pointer, sizeof(params))) { |
| 7510 | /* hmmm, can't get them */ |
| 7511 | return -EIO; |
| 7512 | } |
| 7513 | /* clear the tspec */ |
| 7514 | memset(&tSpec, 0, sizeof(tSpec)); |
| 7515 | |
| 7516 | /* validate the handle */ |
| 7517 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7518 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7519 | /* that one is reserved */ |
| 7520 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7521 | return 0; |
| 7522 | } |
| 7523 | /* validate the TID */ |
| 7524 | if (params[HDD_WLAN_WMM_PARAM_TID] > 7) { |
| 7525 | /* out of range */ |
| 7526 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7527 | return 0; |
| 7528 | } |
| 7529 | tSpec.ts_info.tid = params[HDD_WLAN_WMM_PARAM_TID]; |
| 7530 | |
| 7531 | /* validate the direction */ |
| 7532 | switch (params[HDD_WLAN_WMM_PARAM_DIRECTION]) { |
| 7533 | case HDD_WLAN_WMM_DIRECTION_UPSTREAM: |
| 7534 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_UPLINK; |
| 7535 | break; |
| 7536 | |
| 7537 | case HDD_WLAN_WMM_DIRECTION_DOWNSTREAM: |
| 7538 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_DOWNLINK; |
| 7539 | break; |
| 7540 | |
| 7541 | case HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL: |
| 7542 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_BOTH; |
| 7543 | break; |
| 7544 | |
| 7545 | default: |
| 7546 | /* unknown */ |
| 7547 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7548 | return 0; |
| 7549 | } |
| 7550 | |
| 7551 | tSpec.ts_info.psb = params[HDD_WLAN_WMM_PARAM_APSD]; |
| 7552 | |
| 7553 | /* validate the user priority */ |
| 7554 | if (params[HDD_WLAN_WMM_PARAM_USER_PRIORITY] >= SME_QOS_WMM_UP_MAX) { |
| 7555 | /* out of range */ |
| 7556 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7557 | return 0; |
| 7558 | } |
| 7559 | tSpec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY]; |
| 7560 | 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] | 7561 | hdd_err("***ts_info.up out of bounds***"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7562 | return 0; |
| 7563 | } |
| 7564 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7565 | hdd_debug("TS_INFO PSB %d UP %d !!!", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7566 | tSpec.ts_info.psb, tSpec.ts_info.up); |
| 7567 | |
| 7568 | tSpec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE]; |
| 7569 | tSpec.maximum_msdu_size = params[HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE]; |
| 7570 | tSpec.min_data_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE]; |
| 7571 | tSpec.mean_data_rate = params[HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE]; |
| 7572 | tSpec.peak_data_rate = params[HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE]; |
| 7573 | tSpec.max_burst_size = params[HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE]; |
| 7574 | tSpec.min_phy_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE]; |
| 7575 | tSpec.surplus_bw_allowance = |
| 7576 | params[HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE]; |
| 7577 | tSpec.min_service_interval = |
| 7578 | params[HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL]; |
| 7579 | tSpec.max_service_interval = |
| 7580 | params[HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL]; |
| 7581 | tSpec.suspension_interval = |
| 7582 | params[HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL]; |
| 7583 | tSpec.inactivity_interval = |
| 7584 | params[HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL]; |
| 7585 | |
| 7586 | tSpec.ts_info.burst_size_defn = |
| 7587 | params[HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN]; |
| 7588 | |
| 7589 | /* validate the ts info ack policy */ |
| 7590 | switch (params[HDD_WLAN_WMM_PARAM_ACK_POLICY]) { |
| 7591 | case HDD_WLAN_WMM_TS_INFO_ACK_POLICY_NORMAL_ACK: |
| 7592 | tSpec.ts_info.ack_policy = SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK; |
| 7593 | break; |
| 7594 | |
| 7595 | case HDD_WLAN_WMM_TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK: |
| 7596 | tSpec.ts_info.ack_policy = |
| 7597 | SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK; |
| 7598 | break; |
| 7599 | |
| 7600 | default: |
| 7601 | /* unknown */ |
| 7602 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7603 | return 0; |
| 7604 | } |
| 7605 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7606 | *pStatus = hdd_wmm_addts(adapter, handle, &tSpec); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7607 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7608 | return 0; |
| 7609 | } |
| 7610 | |
| 7611 | static int iw_add_tspec(struct net_device *dev, |
| 7612 | struct iw_request_info *info, |
| 7613 | union iwreq_data *wrqu, char *extra) |
| 7614 | { |
| 7615 | int ret; |
| 7616 | |
| 7617 | cds_ssr_protect(__func__); |
| 7618 | ret = __iw_add_tspec(dev, info, wrqu, extra); |
| 7619 | cds_ssr_unprotect(__func__); |
| 7620 | |
| 7621 | return ret; |
| 7622 | } |
| 7623 | |
| 7624 | /** |
| 7625 | * iw_del_tspec - Delete TSpec private ioctl handler |
| 7626 | * @dev: device upon which the ioctl was received |
| 7627 | * @info: ioctl request information |
| 7628 | * @wrqu: ioctl request data |
| 7629 | * @extra: ioctl extra data |
| 7630 | * |
| 7631 | * Return: 0 on success, non-zero on error |
| 7632 | */ |
| 7633 | static int __iw_del_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7634 | union iwreq_data *wrqu, char *extra) |
| 7635 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7636 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7637 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7638 | int *params = (int *)extra; |
| 7639 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7640 | uint32_t handle; |
| 7641 | int ret; |
| 7642 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7643 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7644 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7645 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7646 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7647 | if (0 != ret) |
| 7648 | return ret; |
| 7649 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7650 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7651 | if (0 != ret) |
| 7652 | return ret; |
| 7653 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7654 | /* make sure the application is sufficiently priviledged */ |
| 7655 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 7656 | /* this ioctl wants to return status to user space it must be */ |
| 7657 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7658 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7659 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7660 | |
| 7661 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 7662 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 7663 | /* is no need to copy the params from user space */ |
| 7664 | |
| 7665 | /* validate the handle */ |
| 7666 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7667 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7668 | /* that one is reserved */ |
| 7669 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7670 | return 0; |
| 7671 | } |
| 7672 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7673 | *pStatus = hdd_wmm_delts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7674 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7675 | return 0; |
| 7676 | } |
| 7677 | |
| 7678 | static int iw_del_tspec(struct net_device *dev, |
| 7679 | struct iw_request_info *info, |
| 7680 | union iwreq_data *wrqu, char *extra) |
| 7681 | { |
| 7682 | int ret; |
| 7683 | |
| 7684 | cds_ssr_protect(__func__); |
| 7685 | ret = __iw_del_tspec(dev, info, wrqu, extra); |
| 7686 | cds_ssr_unprotect(__func__); |
| 7687 | |
| 7688 | return ret; |
| 7689 | } |
| 7690 | |
| 7691 | /** |
| 7692 | * iw_get_tspec - Get TSpec private ioctl handler |
| 7693 | * @dev: device upon which the ioctl was received |
| 7694 | * @info: ioctl request information |
| 7695 | * @wrqu: ioctl request data |
| 7696 | * @extra: ioctl extra data |
| 7697 | * |
| 7698 | * Return: 0 on success, non-zero on error |
| 7699 | */ |
| 7700 | static int __iw_get_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7701 | union iwreq_data *wrqu, char *extra) |
| 7702 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7703 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7704 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7705 | int *params = (int *)extra; |
| 7706 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7707 | uint32_t handle; |
| 7708 | int ret; |
| 7709 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7710 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7711 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7712 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7713 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7714 | if (0 != ret) |
| 7715 | return ret; |
| 7716 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7717 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7718 | if (0 != ret) |
| 7719 | return ret; |
| 7720 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7721 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 7722 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 7723 | /* is no need to copy the params from user space */ |
| 7724 | |
| 7725 | /* validate the handle */ |
| 7726 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7727 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7728 | /* that one is reserved */ |
| 7729 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7730 | return 0; |
| 7731 | } |
| 7732 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7733 | *pStatus = hdd_wmm_checkts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7734 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7735 | return 0; |
| 7736 | } |
| 7737 | |
| 7738 | static int iw_get_tspec(struct net_device *dev, |
| 7739 | struct iw_request_info *info, |
| 7740 | union iwreq_data *wrqu, char *extra) |
| 7741 | { |
| 7742 | int ret; |
| 7743 | |
| 7744 | cds_ssr_protect(__func__); |
| 7745 | ret = __iw_get_tspec(dev, info, wrqu, extra); |
| 7746 | cds_ssr_unprotect(__func__); |
| 7747 | |
| 7748 | return ret; |
| 7749 | } |
| 7750 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7751 | /** |
| 7752 | * iw_set_fties - Set FT IEs private ioctl handler |
| 7753 | * @dev: device upon which the ioctl was received |
| 7754 | * @info: ioctl request information |
| 7755 | * @wrqu: ioctl request data |
| 7756 | * @extra: ioctl extra data |
| 7757 | * |
| 7758 | * Each time the supplicant has the auth_request or reassoc request |
| 7759 | * IEs ready they are pushed to the driver. The driver will in turn |
| 7760 | * use it to send out the auth req and reassoc req for 11r FT Assoc. |
| 7761 | * |
| 7762 | * Return: 0 on success, non-zero on error |
| 7763 | */ |
| 7764 | static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info, |
| 7765 | union iwreq_data *wrqu, char *extra) |
| 7766 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7767 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7768 | 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] | 7769 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7770 | int ret; |
| 7771 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7772 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7773 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7774 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7775 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7776 | if (0 != ret) |
| 7777 | return ret; |
| 7778 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7779 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7780 | if (0 != ret) |
| 7781 | return ret; |
| 7782 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7783 | if (!wrqu->data.length) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7784 | hdd_err("called with 0 length IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7785 | return -EINVAL; |
| 7786 | } |
| 7787 | if (wrqu->data.pointer == NULL) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7788 | hdd_err("called with NULL IE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7789 | return -EINVAL; |
| 7790 | } |
| 7791 | /* Added for debug on reception of Re-assoc Req. */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7792 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7793 | hdd_debug("Called with Ie of length = %d when not associated", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7794 | wrqu->data.length); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7795 | hdd_debug("Should be Re-assoc Req IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7796 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7797 | hdd_debug("called with Ie of length = %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7798 | |
| 7799 | /* Pass the received FT IEs to SME */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7800 | sme_set_ft_ies(hdd_ctx->mac_handle, adapter->session_id, |
| 7801 | extra, wrqu->data.length); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7802 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7803 | return 0; |
| 7804 | } |
| 7805 | |
| 7806 | static int iw_set_fties(struct net_device *dev, |
| 7807 | struct iw_request_info *info, |
| 7808 | union iwreq_data *wrqu, char *extra) |
| 7809 | { |
| 7810 | int ret; |
| 7811 | |
| 7812 | cds_ssr_protect(__func__); |
| 7813 | ret = __iw_set_fties(dev, info, wrqu, extra); |
| 7814 | cds_ssr_unprotect(__func__); |
| 7815 | |
| 7816 | return ret; |
| 7817 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7818 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7819 | /** |
| 7820 | * iw_set_dynamic_mcbc_filter() - Set Dynamic MCBC Filter ioctl handler |
| 7821 | * @dev: device upon which the ioctl was received |
| 7822 | * @info: ioctl request information |
| 7823 | * @wrqu: ioctl request data |
| 7824 | * @extra: ioctl extra data |
| 7825 | * |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 7826 | * This IOCTL is OBSOLETE as of Jan 30, 2017. We are leaving it here for the |
| 7827 | * time being to provide guidance in migrating to standard APIs. |
| 7828 | * |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7829 | * Return: 0 on success, non-zero on error |
| 7830 | */ |
| 7831 | static int iw_set_dynamic_mcbc_filter(struct net_device *dev, |
| 7832 | struct iw_request_info *info, |
| 7833 | union iwreq_data *wrqu, |
| 7834 | char *extra) |
| 7835 | { |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 7836 | hdd_err("\n" |
| 7837 | "setMCBCFilter is obsolete. Use the following instead:\n" |
| 7838 | "Configure multicast filtering via the ‘ip’ command.\n" |
| 7839 | "\tip maddr add 11:22:33:44:55:66 dev wlan0 # allow traffic to address\n" |
| 7840 | "\tip maddr del 11:22:33:44:55:66 dev wlan0 # undo allow\n" |
| 7841 | "Configure broadcast filtering via ini item, 'g_enable_non_arp_bc_hw_filter.'\n" |
| 7842 | "\tg_enable_non_arp_bc_hw_filter=1 # drop all non-ARP broadcast traffic\n" |
| 7843 | "\tg_enable_non_arp_bc_hw_filter=0 # allow all broadcast traffic"); |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7844 | return -EINVAL; |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7845 | } |
| 7846 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7847 | /** |
| 7848 | * iw_set_host_offload - Set host offload ioctl handler |
| 7849 | * @dev: device upon which the ioctl was received |
| 7850 | * @info: ioctl request information |
| 7851 | * @wrqu: ioctl request data |
| 7852 | * @extra: ioctl extra data |
| 7853 | * |
| 7854 | * Return: 0 on success, non-zero on error |
| 7855 | */ |
| 7856 | static int __iw_set_host_offload(struct net_device *dev, |
| 7857 | struct iw_request_info *info, |
| 7858 | union iwreq_data *wrqu, char *extra) |
| 7859 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7860 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Srinivas Girigowda | 077143e | 2017-03-25 10:47:27 -0700 | [diff] [blame] | 7861 | struct host_offload_req *pRequest = (struct host_offload_req *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7862 | tSirHostOffloadReq offloadRequest; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7863 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7864 | int ret; |
| 7865 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7866 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7867 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7868 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7869 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7870 | if (0 != ret) |
| 7871 | return ret; |
| 7872 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7873 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7874 | if (0 != ret) |
| 7875 | return ret; |
| 7876 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7877 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7878 | hdd_err("dev is not in CONNECTED state, ignore!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7879 | return -EINVAL; |
| 7880 | } |
| 7881 | |
| 7882 | /* Debug display of request components. */ |
| 7883 | switch (pRequest->offloadType) { |
| 7884 | case WLAN_IPV4_ARP_REPLY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7885 | hdd_debug("Host offload request: ARP reply"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7886 | switch (pRequest->enableOrDisable) { |
| 7887 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7888 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7889 | break; |
| 7890 | case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7891 | hdd_debug(" BC Filtering enable"); |
Jeff Johnson | 00052dd | 2018-04-29 19:19:06 -0700 | [diff] [blame] | 7892 | /* fallthrough */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7893 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7894 | hdd_debug(" ARP offload enable"); |
| 7895 | hdd_debug(" IP address: %d.%d.%d.%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7896 | pRequest->params.hostIpv4Addr[0], |
| 7897 | pRequest->params.hostIpv4Addr[1], |
| 7898 | pRequest->params.hostIpv4Addr[2], |
| 7899 | pRequest->params.hostIpv4Addr[3]); |
| 7900 | } |
| 7901 | break; |
| 7902 | |
| 7903 | case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7904 | hdd_debug("Host offload request: neighbor discovery"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7905 | switch (pRequest->enableOrDisable) { |
| 7906 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7907 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7908 | break; |
| 7909 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7910 | hdd_debug(" enable"); |
| 7911 | hdd_debug(" IP address: %x:%x:%x:%x:%x:%x:%x:%x", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7912 | *(uint16_t *) (pRequest->params.hostIpv6Addr), |
| 7913 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7914 | 2), |
| 7915 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7916 | 4), |
| 7917 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7918 | 6), |
| 7919 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7920 | 8), |
| 7921 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7922 | 10), |
| 7923 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7924 | 12), |
| 7925 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7926 | 14)); |
| 7927 | } |
| 7928 | } |
| 7929 | |
Hanumanth Reddy Pothula | 8fcade5 | 2017-12-01 13:49:40 +0530 | [diff] [blame] | 7930 | qdf_mem_zero(&offloadRequest, sizeof(offloadRequest)); |
| 7931 | offloadRequest.offloadType = pRequest->offloadType; |
| 7932 | offloadRequest.enableOrDisable = pRequest->enableOrDisable; |
| 7933 | qdf_mem_copy(&offloadRequest.params, &pRequest->params, |
| 7934 | sizeof(pRequest->params)); |
| 7935 | qdf_mem_copy(&offloadRequest.bssid, &pRequest->bssId.bytes, |
| 7936 | QDF_MAC_ADDR_SIZE); |
| 7937 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7938 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7939 | sme_set_host_offload(hdd_ctx->mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7940 | adapter->session_id, &offloadRequest)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7941 | hdd_err("Failure to execute host offload request"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7942 | return -EINVAL; |
| 7943 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7944 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7945 | return 0; |
| 7946 | } |
| 7947 | |
| 7948 | static int iw_set_host_offload(struct net_device *dev, |
| 7949 | struct iw_request_info *info, |
| 7950 | union iwreq_data *wrqu, char *extra) |
| 7951 | { |
| 7952 | int ret; |
| 7953 | |
| 7954 | cds_ssr_protect(__func__); |
| 7955 | ret = __iw_set_host_offload(dev, info, wrqu, extra); |
| 7956 | cds_ssr_unprotect(__func__); |
| 7957 | |
| 7958 | return ret; |
| 7959 | } |
| 7960 | |
| 7961 | /** |
| 7962 | * iw_set_keepalive_params - Set keepalive params ioctl handler |
| 7963 | * @dev: device upon which the ioctl was received |
| 7964 | * @info: ioctl request information |
| 7965 | * @wrqu: ioctl request data |
| 7966 | * @extra: ioctl extra data |
| 7967 | * |
| 7968 | * Return: 0 on success, non-zero on error |
| 7969 | */ |
| 7970 | static int __iw_set_keepalive_params(struct net_device *dev, |
| 7971 | struct iw_request_info *info, |
| 7972 | union iwreq_data *wrqu, char *extra) |
| 7973 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7974 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 7975 | tpSirKeepAliveReq request = (tpSirKeepAliveReq) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7976 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7977 | int ret; |
| 7978 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7979 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7980 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7981 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7982 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7983 | if (0 != ret) |
| 7984 | return ret; |
| 7985 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7986 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7987 | if (0 != ret) |
| 7988 | return ret; |
| 7989 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 7990 | if (wrqu->data.length != sizeof(*request)) { |
| 7991 | hdd_err("Invalid length %d", wrqu->data.length); |
| 7992 | return -EINVAL; |
| 7993 | } |
| 7994 | |
| 7995 | if (request->timePeriod > WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX) { |
| 7996 | hdd_err("Value of timePeriod %d exceed Max limit %d", |
| 7997 | request->timePeriod, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7998 | WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX); |
| 7999 | return -EINVAL; |
| 8000 | } |
| 8001 | |
| 8002 | /* Debug display of request components. */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8003 | hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8004 | request->timePeriod, sizeof(tSirKeepAliveReq)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8005 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8006 | switch (request->packetType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8007 | case WLAN_KEEP_ALIVE_NULL_PKT: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8008 | hdd_debug("Keep Alive Request: Tx NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8009 | break; |
| 8010 | |
| 8011 | case WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8012 | hdd_debug("Keep Alive Request: Tx UnSolicited ARP RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8013 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8014 | hdd_debug("Host IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8015 | request->hostIpv4Addr[0], request->hostIpv4Addr[1], |
| 8016 | request->hostIpv4Addr[2], request->hostIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8017 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8018 | hdd_debug("Dest IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8019 | request->destIpv4Addr[0], request->destIpv4Addr[1], |
| 8020 | request->destIpv4Addr[2], request->destIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8021 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8022 | hdd_debug("Dest MAC address: "MAC_ADDRESS_STR, |
Srinivas Girigowda | 9c330a9 | 2015-11-24 12:28:25 -0800 | [diff] [blame] | 8023 | MAC_ADDR_ARRAY(request->dest_macaddr.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8024 | break; |
| 8025 | } |
| 8026 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8027 | hdd_debug("Keep alive period %d", request->timePeriod); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8028 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8029 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8030 | sme_set_keep_alive(hdd_ctx->mac_handle, |
| 8031 | adapter->session_id, request)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8032 | hdd_err("Failure to execute Keep Alive"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8033 | return -EINVAL; |
| 8034 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8035 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8036 | return 0; |
| 8037 | } |
| 8038 | |
| 8039 | static int iw_set_keepalive_params(struct net_device *dev, |
| 8040 | struct iw_request_info *info, |
| 8041 | union iwreq_data *wrqu, |
| 8042 | char *extra) |
| 8043 | { |
| 8044 | int ret; |
| 8045 | |
| 8046 | cds_ssr_protect(__func__); |
| 8047 | ret = __iw_set_keepalive_params(dev, info, wrqu, extra); |
| 8048 | cds_ssr_unprotect(__func__); |
| 8049 | |
| 8050 | return ret; |
| 8051 | } |
| 8052 | |
| 8053 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 8054 | /** |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8055 | * validate_packet_filter_params_size() - Validate the size of the params rcvd |
| 8056 | * @priv_data: Pointer to the priv data from user space |
| 8057 | * @request: Pointer to the struct containing the copied data from user space |
| 8058 | * |
| 8059 | * Return: False on invalid length, true otherwise |
| 8060 | */ |
| 8061 | static bool validate_packet_filter_params_size(struct pkt_filter_cfg *request, |
| 8062 | uint16_t length) |
| 8063 | { |
| 8064 | int max_params_size, rcvd_params_size; |
| 8065 | |
| 8066 | max_params_size = HDD_MAX_CMP_PER_PACKET_FILTER * |
| 8067 | sizeof(struct pkt_filter_param_cfg); |
| 8068 | |
| 8069 | if (length < sizeof(struct pkt_filter_cfg) - max_params_size) { |
| 8070 | hdd_err("Less than minimum number of arguments needed"); |
| 8071 | return false; |
| 8072 | } |
| 8073 | |
| 8074 | rcvd_params_size = request->num_params * |
| 8075 | sizeof(struct pkt_filter_param_cfg); |
| 8076 | |
| 8077 | if (length != sizeof(struct pkt_filter_cfg) - |
| 8078 | max_params_size + rcvd_params_size) { |
| 8079 | hdd_err("Arguments do not match the number of params provided"); |
| 8080 | return false; |
| 8081 | } |
| 8082 | |
| 8083 | return true; |
| 8084 | } |
| 8085 | |
| 8086 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8087 | * __iw_set_packet_filter_params() - set packet filter parameters in target |
| 8088 | * @dev: Pointer to netdev |
| 8089 | * @info: Pointer to iw request info |
| 8090 | * @wrqu: Pointer to data |
| 8091 | * @extra: Pointer to extra data |
| 8092 | * |
| 8093 | * Return: 0 on success, non-zero on error |
| 8094 | */ |
| 8095 | static int __iw_set_packet_filter_params(struct net_device *dev, |
| 8096 | struct iw_request_info *info, |
| 8097 | union iwreq_data *wrqu, char *extra) |
| 8098 | { |
| 8099 | int ret; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8100 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8101 | struct iw_point priv_data; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8102 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8103 | struct pkt_filter_cfg *request = NULL; |
| 8104 | |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8105 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8106 | hdd_err("permission check failed"); |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8107 | return -EPERM; |
| 8108 | } |
| 8109 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8110 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8111 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8112 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8113 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8114 | if (0 != ret) |
| 8115 | return ret; |
| 8116 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8117 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8118 | if (0 != ret) |
| 8119 | return ret; |
| 8120 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8121 | if (hdd_priv_get_data(&priv_data, wrqu)) { |
| 8122 | hdd_err("failed to get priv data"); |
| 8123 | return -EINVAL; |
| 8124 | } |
| 8125 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8126 | if ((NULL == priv_data.pointer) || (0 == priv_data.length)) { |
Jeff Johnson | 36e74c4 | 2017-09-18 08:15:42 -0700 | [diff] [blame] | 8127 | hdd_err("invalid priv data %pK or invalid priv data length %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8128 | priv_data.pointer, priv_data.length); |
| 8129 | return -EINVAL; |
| 8130 | } |
| 8131 | |
Arun Khandavalli | 75d246b | 2017-08-07 19:46:06 +0530 | [diff] [blame] | 8132 | if (adapter->device_mode != QDF_STA_MODE) { |
| 8133 | hdd_err("Packet filter not supported for this mode :%d", |
| 8134 | adapter->device_mode); |
| 8135 | return -ENOTSUPP; |
| 8136 | } |
| 8137 | |
Mukul Sharma | be846bb | 2017-05-09 17:41:52 +0530 | [diff] [blame] | 8138 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
| 8139 | hdd_err("Packet filter not supported in disconnected state"); |
| 8140 | return -ENOTSUPP; |
| 8141 | } |
| 8142 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8143 | /* copy data using copy_from_user */ |
| 8144 | request = mem_alloc_copy_from_user_helper(priv_data.pointer, |
| 8145 | priv_data.length); |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8146 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8147 | if (NULL == request) { |
| 8148 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
| 8149 | return -ENOMEM; |
| 8150 | } |
| 8151 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8152 | if (!validate_packet_filter_params_size(request, priv_data.length)) { |
| 8153 | hdd_err("Invalid priv data length %d", priv_data.length); |
| 8154 | qdf_mem_free(request); |
| 8155 | return -EINVAL; |
| 8156 | } |
| 8157 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 8158 | if (request->filter_action == HDD_RCV_FILTER_SET) |
| 8159 | hdd_ctx->user_configured_pkt_filter_rules |= |
| 8160 | 1 << request->filter_id; |
| 8161 | else if (request->filter_action == HDD_RCV_FILTER_CLEAR) |
| 8162 | hdd_ctx->user_configured_pkt_filter_rules &= |
| 8163 | ~(1 << request->filter_id); |
| 8164 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8165 | ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8166 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 8167 | qdf_mem_free(request); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8168 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8169 | return ret; |
| 8170 | } |
| 8171 | |
| 8172 | /** |
| 8173 | * iw_set_packet_filter_params() - set packet filter parameters in target |
| 8174 | * @dev: Pointer to netdev |
| 8175 | * @info: Pointer to iw request info |
| 8176 | * @wrqu: Pointer to data |
| 8177 | * @extra: Pointer to extra data |
| 8178 | * |
| 8179 | * Return: 0 on success, non-zero on error |
| 8180 | */ |
| 8181 | static int iw_set_packet_filter_params(struct net_device *dev, |
| 8182 | struct iw_request_info *info, |
| 8183 | union iwreq_data *wrqu, char *extra) |
| 8184 | { |
| 8185 | int ret; |
| 8186 | |
| 8187 | cds_ssr_protect(__func__); |
| 8188 | ret = __iw_set_packet_filter_params(dev, info, wrqu, extra); |
| 8189 | cds_ssr_unprotect(__func__); |
| 8190 | |
| 8191 | return ret; |
| 8192 | } |
| 8193 | #endif |
| 8194 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8195 | #ifdef QCA_SUPPORT_CP_STATS |
| 8196 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
| 8197 | { |
| 8198 | return wlan_hdd_get_station_stats(adapter); |
| 8199 | } |
| 8200 | #else /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8201 | struct hdd_statistics_priv { |
| 8202 | tCsrSummaryStatsInfo summary_stats; |
| 8203 | tCsrGlobalClassAStatsInfo class_a_stats; |
| 8204 | tCsrGlobalClassDStatsInfo class_d_stats; |
| 8205 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8206 | |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8207 | /** |
| 8208 | * hdd_statistics_cb() - "Get statistics" callback function |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8209 | * @stats: statistics payload |
| 8210 | * @context: opaque context originally passed to SME. HDD always passes |
| 8211 | * a cookie for the request context |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8212 | * |
| 8213 | * Return: None |
| 8214 | */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8215 | static void hdd_statistics_cb(void *stats, void *context) |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8216 | { |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8217 | struct osif_request *request; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8218 | struct hdd_statistics_priv *priv; |
| 8219 | tCsrSummaryStatsInfo *summary_stats; |
| 8220 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8221 | tCsrGlobalClassDStatsInfo *class_d_stats; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8222 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8223 | request = osif_request_get(context); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8224 | if (!request) { |
| 8225 | hdd_err("Obsolete request"); |
| 8226 | return; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8227 | } |
| 8228 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8229 | priv = osif_request_priv(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8230 | |
| 8231 | summary_stats = (tCsrSummaryStatsInfo *)stats; |
| 8232 | priv->summary_stats = *summary_stats; |
| 8233 | |
| 8234 | class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); |
| 8235 | priv->class_a_stats = *class_a_stats; |
| 8236 | |
| 8237 | class_d_stats = (tCsrGlobalClassDStatsInfo *)(class_a_stats + 1); |
| 8238 | priv->class_d_stats = *class_d_stats; |
| 8239 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8240 | osif_request_complete(request); |
| 8241 | osif_request_put(request); |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8242 | } |
| 8243 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8244 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8245 | { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8246 | int ret = 0; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8247 | void *cookie; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8248 | QDF_STATUS status; |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8249 | struct osif_request *request; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8250 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8251 | struct hdd_statistics_priv *priv; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8252 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8253 | static const struct osif_request_params params = { |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8254 | .priv_size = sizeof(*priv), |
| 8255 | .timeout_ms = WLAN_WAIT_TIME_STATS, |
| 8256 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8257 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8258 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8259 | request = osif_request_alloc(¶ms); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8260 | if (!request) { |
| 8261 | hdd_warn("request allocation failed"); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8262 | return -EINVAL; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8263 | } |
| 8264 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8265 | cookie = osif_request_cookie(request); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8266 | status = sme_get_statistics(hdd_ctx->mac_handle, eCSR_HDD, |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8267 | SME_SUMMARY_STATS | |
| 8268 | SME_GLOBAL_CLASSA_STATS | |
| 8269 | SME_GLOBAL_CLASSD_STATS, |
| 8270 | hdd_statistics_cb, |
| 8271 | sta_ctx->conn_info.staId[0], |
| 8272 | cookie, adapter->session_id); |
| 8273 | |
| 8274 | if (QDF_STATUS_SUCCESS != status) { |
| 8275 | hdd_warn("Unable to retrieve SME statistics"); |
| 8276 | goto put_request; |
| 8277 | } |
| 8278 | |
| 8279 | /* request was sent -- wait for the response */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8280 | ret = osif_request_wait_for_response(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8281 | if (ret) { |
| 8282 | hdd_err("Failed to wait for statistics, errno %d", ret); |
| 8283 | goto put_request; |
| 8284 | } |
| 8285 | |
| 8286 | /* update the adapter cache with the fresh results */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8287 | priv = osif_request_priv(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8288 | adapter->hdd_stats.summary_stat = priv->summary_stats; |
| 8289 | adapter->hdd_stats.class_a_stat = priv->class_a_stats; |
| 8290 | adapter->hdd_stats.class_d_stat = priv->class_d_stats; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8291 | |
| 8292 | put_request: |
| 8293 | /* |
| 8294 | * either we never sent a request, we sent a request and |
| 8295 | * received a response or we sent a request and timed out. |
| 8296 | * regardless we are done with the request. |
| 8297 | */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8298 | osif_request_put(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8299 | return ret; |
| 8300 | } |
| 8301 | #endif /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8302 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8303 | static int __iw_get_statistics(struct net_device *dev, |
| 8304 | struct iw_request_info *info, |
| 8305 | union iwreq_data *wrqu, char *extra) |
| 8306 | { |
| 8307 | int ret; |
| 8308 | char *p; |
| 8309 | int tlen; |
| 8310 | struct hdd_station_ctx *sta_ctx; |
| 8311 | tCsrSummaryStatsInfo *summary_stats; |
| 8312 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8313 | tCsrGlobalClassDStatsInfo *class_d_stats; |
| 8314 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 8315 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8316 | |
| 8317 | hdd_enter_dev(dev); |
| 8318 | |
| 8319 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8320 | if (0 != ret) |
| 8321 | return ret; |
| 8322 | |
| 8323 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8324 | if (0 != ret) |
| 8325 | return ret; |
| 8326 | |
| 8327 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 8328 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
| 8329 | wrqu->data.length = 0; |
| 8330 | return 0; |
| 8331 | } |
| 8332 | |
| 8333 | hdd_get_wlan_stats(adapter); |
| 8334 | |
| 8335 | summary_stats = &(adapter->hdd_stats.summary_stat); |
| 8336 | class_a_stats = &(adapter->hdd_stats.class_a_stat); |
| 8337 | class_d_stats = &(adapter->hdd_stats.class_d_stat); |
| 8338 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8339 | p = extra; |
| 8340 | tlen = 0; |
| 8341 | |
| 8342 | FILL_TLV(p, WLAN_STATS_RETRY_CNT, |
| 8343 | sizeof(summary_stats->retry_cnt), |
| 8344 | &(summary_stats->retry_cnt[0]), tlen); |
| 8345 | |
| 8346 | FILL_TLV(p, WLAN_STATS_MUL_RETRY_CNT, |
| 8347 | sizeof(summary_stats->multiple_retry_cnt), |
| 8348 | &(summary_stats->multiple_retry_cnt[0]), tlen); |
| 8349 | |
| 8350 | FILL_TLV(p, WLAN_STATS_TX_FRM_CNT, |
| 8351 | sizeof(summary_stats->tx_frm_cnt), |
| 8352 | &(summary_stats->tx_frm_cnt[0]), tlen); |
| 8353 | |
| 8354 | FILL_TLV(p, WLAN_STATS_RX_FRM_CNT, |
| 8355 | sizeof(summary_stats->rx_frm_cnt), |
| 8356 | &(summary_stats->rx_frm_cnt), tlen); |
| 8357 | |
| 8358 | FILL_TLV(p, WLAN_STATS_FRM_DUP_CNT, |
| 8359 | sizeof(summary_stats->frm_dup_cnt), |
| 8360 | &(summary_stats->frm_dup_cnt), tlen); |
| 8361 | |
| 8362 | FILL_TLV(p, WLAN_STATS_FAIL_CNT, |
| 8363 | sizeof(summary_stats->fail_cnt), |
| 8364 | &(summary_stats->fail_cnt[0]), tlen); |
| 8365 | |
| 8366 | FILL_TLV(p, WLAN_STATS_RTS_FAIL_CNT, |
| 8367 | sizeof(summary_stats->rts_fail_cnt), |
| 8368 | &(summary_stats->rts_fail_cnt), tlen); |
| 8369 | |
| 8370 | FILL_TLV(p, WLAN_STATS_ACK_FAIL_CNT, |
| 8371 | sizeof(summary_stats->ack_fail_cnt), |
| 8372 | &(summary_stats->ack_fail_cnt), tlen); |
| 8373 | |
| 8374 | FILL_TLV(p, WLAN_STATS_RTS_SUC_CNT, |
| 8375 | sizeof(summary_stats->rts_succ_cnt), |
| 8376 | &(summary_stats->rts_succ_cnt), tlen); |
| 8377 | |
| 8378 | FILL_TLV(p, WLAN_STATS_RX_DISCARD_CNT, |
| 8379 | sizeof(summary_stats->rx_discard_cnt), |
| 8380 | &(summary_stats->rx_discard_cnt), tlen); |
| 8381 | |
| 8382 | FILL_TLV(p, WLAN_STATS_RX_ERROR_CNT, |
| 8383 | sizeof(summary_stats->rx_error_cnt), |
| 8384 | &(summary_stats->rx_error_cnt), tlen); |
| 8385 | |
| 8386 | FILL_TLV(p, WLAN_STATS_TX_BYTE_CNT, |
| 8387 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8388 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8389 | |
| 8390 | FILL_TLV(p, WLAN_STATS_RX_BYTE_CNT, |
| 8391 | sizeof(class_d_stats->rx_byte_cnt), |
| 8392 | &(class_d_stats->rx_byte_cnt), tlen); |
| 8393 | |
| 8394 | FILL_TLV(p, WLAN_STATS_RX_RATE, |
| 8395 | sizeof(class_d_stats->rx_rate), |
| 8396 | &(class_d_stats->rx_rate), tlen); |
| 8397 | |
| 8398 | /* Transmit rate, in units of 500 kbit/sec */ |
| 8399 | FILL_TLV(p, WLAN_STATS_TX_RATE, |
| 8400 | sizeof(class_a_stats->tx_rate), |
| 8401 | &(class_a_stats->tx_rate), tlen); |
| 8402 | |
| 8403 | FILL_TLV(p, WLAN_STATS_RX_UC_BYTE_CNT, |
| 8404 | sizeof(class_d_stats->rx_uc_byte_cnt[0]), |
| 8405 | &(class_d_stats->rx_uc_byte_cnt[0]), tlen); |
| 8406 | FILL_TLV(p, WLAN_STATS_RX_MC_BYTE_CNT, |
| 8407 | sizeof(class_d_stats->rx_mc_byte_cnt), |
| 8408 | &(class_d_stats->rx_mc_byte_cnt), tlen); |
| 8409 | FILL_TLV(p, WLAN_STATS_RX_BC_BYTE_CNT, |
| 8410 | sizeof(class_d_stats->rx_bc_byte_cnt), |
| 8411 | &(class_d_stats->rx_bc_byte_cnt), tlen); |
| 8412 | FILL_TLV(p, WLAN_STATS_TX_UC_BYTE_CNT, |
| 8413 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8414 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8415 | FILL_TLV(p, WLAN_STATS_TX_MC_BYTE_CNT, |
| 8416 | sizeof(class_d_stats->tx_mc_byte_cnt), |
| 8417 | &(class_d_stats->tx_mc_byte_cnt), tlen); |
| 8418 | FILL_TLV(p, WLAN_STATS_TX_BC_BYTE_CNT, |
| 8419 | sizeof(class_d_stats->tx_bc_byte_cnt), |
| 8420 | &(class_d_stats->tx_bc_byte_cnt), tlen); |
| 8421 | |
| 8422 | wrqu->data.length = tlen; |
| 8423 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8424 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8425 | |
| 8426 | return 0; |
| 8427 | } |
| 8428 | |
| 8429 | static int iw_get_statistics(struct net_device *dev, |
| 8430 | struct iw_request_info *info, |
| 8431 | union iwreq_data *wrqu, char *extra) |
| 8432 | { |
| 8433 | int ret; |
| 8434 | |
| 8435 | cds_ssr_protect(__func__); |
| 8436 | ret = __iw_get_statistics(dev, info, wrqu, extra); |
| 8437 | cds_ssr_unprotect(__func__); |
| 8438 | |
| 8439 | return ret; |
| 8440 | } |
| 8441 | |
| 8442 | #ifdef FEATURE_WLAN_SCAN_PNO |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8443 | /*Max Len for PNO notification*/ |
| 8444 | #define MAX_PNO_NOTIFY_LEN 100 |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8445 | static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev, |
| 8446 | struct scan_event *event, void *args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8447 | { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8448 | struct vdev_osif_priv *osif_priv; |
| 8449 | struct wireless_dev *wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8450 | union iwreq_data wrqu; |
| 8451 | char buf[MAX_PNO_NOTIFY_LEN + 1]; |
| 8452 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8453 | wlan_vdev_obj_lock(vdev); |
| 8454 | osif_priv = wlan_vdev_get_ospriv(vdev); |
| 8455 | wlan_vdev_obj_unlock(vdev); |
| 8456 | if (!osif_priv) { |
| 8457 | hdd_err("osif_priv is null"); |
| 8458 | return; |
| 8459 | } |
| 8460 | |
| 8461 | wdev = osif_priv->wdev; |
| 8462 | if (!wdev) { |
| 8463 | hdd_err("wdev is null"); |
| 8464 | return; |
| 8465 | } |
| 8466 | |
| 8467 | hdd_debug("A preferred network was found"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8468 | |
| 8469 | /* create the event */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8470 | qdf_mem_zero(&wrqu, sizeof(wrqu)); |
| 8471 | qdf_mem_zero(buf, sizeof(buf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8472 | |
| 8473 | snprintf(buf, MAX_PNO_NOTIFY_LEN, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8474 | "QCOM: Found preferred network:"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8475 | |
| 8476 | wrqu.data.pointer = buf; |
| 8477 | wrqu.data.length = strlen(buf); |
| 8478 | |
| 8479 | /* send the event */ |
| 8480 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8481 | wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8482 | } |
| 8483 | |
| 8484 | /** |
| 8485 | * __iw_set_pno() - Preferred Network Offload ioctl handler |
| 8486 | * @dev: device upon which the ioctl was received |
| 8487 | * @info: ioctl request information |
| 8488 | * @wrqu: ioctl request data |
| 8489 | * @extra: ioctl extra data |
| 8490 | * |
| 8491 | * This function parses a Preferred Network Offload command |
| 8492 | * Input is string based and expected to be of the form: |
| 8493 | * |
| 8494 | * <enable(1) | disable(0)> |
| 8495 | * when enabling: |
| 8496 | * <number of networks> |
| 8497 | * for each network: |
| 8498 | * <ssid_len> <ssid> <authentication> <encryption> |
| 8499 | * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8500 | * <scan_time (seconds)> |
| 8501 | * <scan_repeat_count (0 means indefinite)> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8502 | * <suspend mode> |
| 8503 | * |
| 8504 | * e.g: |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8505 | * 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] | 8506 | * |
| 8507 | * this translates into: |
| 8508 | * ----------------------------- |
| 8509 | * enable PNO |
| 8510 | * 2 networks |
| 8511 | * Network 1: |
| 8512 | * test - with authentication type 0 and encryption type 0, |
| 8513 | * search on 3 channels: 1 6 and 11, |
| 8514 | * SSID bcast type is unknown (directed probe will be sent if |
| 8515 | * AP not found) and must meet -40dBm RSSI |
| 8516 | * Network 2: |
| 8517 | * test2 - with authentication type 4 and encryption type 4, |
| 8518 | * search on 6 channels 1, 2, 3, 4, 5 and 6 |
| 8519 | * bcast type is non-bcast (directed probe will be sent) |
| 8520 | * and must not meet any RSSI threshold |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8521 | * scan every 5 seconds 2 times |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8522 | * enable on suspend |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8523 | */ |
| 8524 | static int __iw_set_pno(struct net_device *dev, |
| 8525 | struct iw_request_info *info, |
| 8526 | union iwreq_data *wrqu, char *extra) |
| 8527 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8528 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8529 | struct hdd_context *hdd_ctx; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8530 | uint8_t value; |
| 8531 | struct wlan_objmgr_vdev *vdev; |
| 8532 | struct wlan_objmgr_psoc *psoc; |
| 8533 | int ret = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8534 | int offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8535 | char *ptr, *data; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8536 | uint8_t i, j, params; |
| 8537 | QDF_STATUS status; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8538 | size_t len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8539 | |
| 8540 | /* request is a large struct, so we make it static to avoid |
| 8541 | * stack overflow. This API is only invoked via ioctl, so it |
| 8542 | * is serialized by the kernel rtnl_lock and hence does not |
| 8543 | * need to be reentrant |
| 8544 | */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8545 | static struct pno_scan_req_params req; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8546 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8547 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8548 | |
| 8549 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8550 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8551 | if (ret) |
| 8552 | return ret; |
| 8553 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8554 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8555 | if (0 != ret) |
| 8556 | return ret; |
| 8557 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8558 | vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->hdd_pdev, |
| 8559 | dev->dev_addr, WLAN_LEGACY_MAC_ID); |
| 8560 | if (!vdev) { |
| 8561 | hdd_err("vdev object is NULL"); |
| 8562 | return -EIO; |
| 8563 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8564 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8565 | /* making sure argument string ends with '\0' */ |
| 8566 | len = (wrqu->data.length + 1); |
| 8567 | data = qdf_mem_malloc(len); |
| 8568 | if (!data) { |
| 8569 | hdd_err("fail to allocate memory %zu", len); |
| 8570 | return -EINVAL; |
| 8571 | } |
| 8572 | qdf_mem_copy(data, extra, (len-1)); |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8573 | ptr = data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8574 | |
Hanumanth Reddy Pothula | 3048c93 | 2018-05-15 12:43:39 +0530 | [diff] [blame] | 8575 | hdd_debug("PNO data len %d data %s", wrqu->data.length, data); |
| 8576 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8577 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8578 | hdd_err("PNO enable input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8579 | ret = -EINVAL; |
| 8580 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8581 | } |
| 8582 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8583 | if (!value) { |
| 8584 | status = ucfg_scan_pno_stop(vdev); |
| 8585 | if (QDF_IS_STATUS_ERROR(status)) { |
| 8586 | hdd_err("Failed to disabled PNO"); |
| 8587 | ret = -EINVAL; |
| 8588 | } else { |
| 8589 | hdd_debug("PNO scan disabled"); |
| 8590 | } |
| 8591 | goto exit; |
| 8592 | } |
| 8593 | |
| 8594 | if (ucfg_scan_get_pno_in_progress(vdev)) { |
| 8595 | hdd_debug("pno is already in progress"); |
| 8596 | ret = -EBUSY; |
| 8597 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8598 | } |
| 8599 | |
| 8600 | ptr += offset; |
| 8601 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8602 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8603 | hdd_err("PNO count input not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8604 | ret = -EINVAL; |
| 8605 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8606 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8607 | req.networks_cnt = value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8608 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8609 | hdd_debug("PNO enable networks count %d offset %d", |
| 8610 | req.networks_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8611 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8612 | if ((0 == req.networks_cnt) || |
| 8613 | (req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8614 | hdd_err("Network count %d invalid", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8615 | req.networks_cnt); |
| 8616 | ret = -EINVAL; |
| 8617 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8618 | } |
| 8619 | |
| 8620 | ptr += offset; |
| 8621 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8622 | for (i = 0; i < req.networks_cnt; i++) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8623 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8624 | req.networks_list[i].ssid.length = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8625 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8626 | params = sscanf(ptr, " %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8627 | &(req.networks_list[i].ssid.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8628 | &offset); |
| 8629 | |
| 8630 | if (1 != params) { |
| 8631 | hdd_err("PNO ssid length input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8632 | ret = -EINVAL; |
| 8633 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8634 | } |
| 8635 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8636 | if ((0 == req.networks_list[i].ssid.length) || |
| 8637 | (req.networks_list[i].ssid.length > 32)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8638 | hdd_err("SSID Len %d is not correct for network %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8639 | req.networks_list[i].ssid.length, i); |
| 8640 | ret = -EINVAL; |
| 8641 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8642 | } |
| 8643 | |
| 8644 | /* Advance to SSID */ |
| 8645 | ptr += offset; |
| 8646 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8647 | memcpy(req.networks_list[i].ssid.ssid, ptr, |
| 8648 | req.networks_list[i].ssid.length); |
| 8649 | ptr += req.networks_list[i].ssid.length; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8650 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8651 | params = sscanf(ptr, " %u %u %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8652 | &(req.networks_list[i].authentication), |
| 8653 | &(req.networks_list[i].encryption), |
| 8654 | &(req.networks_list[i].channel_cnt), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8655 | &offset); |
| 8656 | |
| 8657 | if (3 != params) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8658 | hdd_err("Incorrect cmd %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8659 | ret = -EINVAL; |
| 8660 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8661 | } |
| 8662 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8663 | 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] | 8664 | req.networks_list[i].ssid.length, |
| 8665 | req.networks_list[i].ssid.length, |
| 8666 | req.networks_list[i].ssid.ssid, |
| 8667 | req.networks_list[i].authentication, |
| 8668 | req.networks_list[i].encryption, |
| 8669 | req.networks_list[i].channel_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8670 | |
| 8671 | /* Advance to channel list */ |
| 8672 | ptr += offset; |
| 8673 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8674 | if (SCAN_PNO_MAX_NETW_CHANNELS_EX < |
| 8675 | req.networks_list[i].channel_cnt) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8676 | hdd_err("Incorrect number of channels"); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8677 | ret = -EINVAL; |
| 8678 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8679 | } |
| 8680 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8681 | if (0 != req.networks_list[i].channel_cnt) { |
| 8682 | for (j = 0; j < req.networks_list[i].channel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8683 | j++) { |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8684 | if (1 != sscanf(ptr, " %hhu %n", &value, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8685 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8686 | hdd_err("PNO network channel is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8687 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8688 | ret = -EINVAL; |
| 8689 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8690 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8691 | if (!IS_CHANNEL_VALID(value)) { |
| 8692 | hdd_err("invalid channel: %hhu", value); |
| 8693 | ret = -EINVAL; |
| 8694 | goto exit; |
| 8695 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8696 | req.networks_list[i].channels[j] = |
| 8697 | cds_chan_to_freq(value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8698 | /* Advance to next channel number */ |
| 8699 | ptr += offset; |
| 8700 | } |
| 8701 | } |
| 8702 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8703 | if (1 != sscanf(ptr, " %u %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8704 | &(req.networks_list[i].bc_new_type), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8705 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8706 | hdd_err("PNO broadcast network type is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8707 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8708 | ret = -EINVAL; |
| 8709 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8710 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8711 | if (req.networks_list[i].bc_new_type > 2) { |
| 8712 | hdd_err("invalid bcast nw type: %u", |
| 8713 | req.networks_list[i].bc_new_type); |
| 8714 | ret = -EINVAL; |
| 8715 | goto exit; |
| 8716 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8717 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8718 | hdd_debug("PNO bcastNetwType %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8719 | req.networks_list[i].bc_new_type, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8720 | |
| 8721 | /* Advance to rssi Threshold */ |
| 8722 | ptr += offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8723 | if (1 != sscanf(ptr, " %d %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8724 | &(req.networks_list[i].rssi_thresh), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8725 | &offset)) { |
| 8726 | hdd_err("PNO rssi threshold input is not valid %s", |
| 8727 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8728 | ret = -EINVAL; |
| 8729 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8730 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8731 | hdd_debug("PNO rssi %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8732 | req.networks_list[i].rssi_thresh, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8733 | /* Advance to next network */ |
| 8734 | ptr += offset; |
| 8735 | } /* For ucNetworkCount */ |
| 8736 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8737 | req.fast_scan_period = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8738 | if (sscanf(ptr, " %u %n", &(req.fast_scan_period), &offset) > 0) { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8739 | req.fast_scan_period *= MSEC_PER_SEC; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8740 | ptr += offset; |
| 8741 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8742 | if (req.fast_scan_period == 0) { |
| 8743 | hdd_err("invalid fast scan period %u", |
| 8744 | req.fast_scan_period); |
| 8745 | ret = -EINVAL; |
| 8746 | goto exit; |
| 8747 | } |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8748 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8749 | req.fast_scan_max_cycles = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8750 | if (sscanf(ptr, " %hhu %n", &value, |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8751 | &offset) > 0) |
| 8752 | ptr += offset; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8753 | req.fast_scan_max_cycles = value; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8754 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8755 | wlan_pdev_obj_lock(hdd_ctx->hdd_pdev); |
| 8756 | psoc = wlan_pdev_get_psoc(hdd_ctx->hdd_pdev); |
| 8757 | wlan_pdev_obj_unlock(hdd_ctx->hdd_pdev); |
| 8758 | ucfg_scan_register_pno_cb(psoc, |
| 8759 | found_pref_network_cb, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8760 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8761 | ucfg_scan_get_pno_def_params(vdev, &req); |
| 8762 | status = ucfg_scan_pno_start(vdev, &req); |
| 8763 | if (QDF_IS_STATUS_ERROR(status)) { |
| 8764 | hdd_err("Failed to enable PNO"); |
| 8765 | ret = -EINVAL; |
| 8766 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8767 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8768 | exit: |
| 8769 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8770 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8771 | qdf_mem_free(data); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8772 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8773 | } |
| 8774 | |
| 8775 | static int iw_set_pno(struct net_device *dev, |
| 8776 | struct iw_request_info *info, |
| 8777 | union iwreq_data *wrqu, char *extra) |
| 8778 | { |
| 8779 | int ret; |
| 8780 | |
| 8781 | cds_ssr_protect(__func__); |
| 8782 | ret = __iw_set_pno(dev, info, wrqu, extra); |
| 8783 | cds_ssr_unprotect(__func__); |
| 8784 | |
| 8785 | return ret; |
| 8786 | } |
| 8787 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 8788 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8789 | static int __iw_set_band_config(struct net_device *dev, |
| 8790 | struct iw_request_info *info, |
| 8791 | union iwreq_data *wrqu, char *extra) |
| 8792 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8793 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8794 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8795 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8796 | int *value = (int *)extra; |
| 8797 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8798 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8799 | |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 8800 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8801 | hdd_err("permission check failed"); |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 8802 | return -EPERM; |
| 8803 | } |
| 8804 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8805 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8806 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8807 | if (0 != ret) |
| 8808 | return ret; |
| 8809 | |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 8810 | return hdd_reg_set_band(dev, value[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8811 | } |
| 8812 | |
| 8813 | static int iw_set_band_config(struct net_device *dev, |
| 8814 | struct iw_request_info *info, |
| 8815 | union iwreq_data *wrqu, char *extra) |
| 8816 | { |
| 8817 | int ret; |
| 8818 | |
| 8819 | cds_ssr_protect(__func__); |
| 8820 | ret = __iw_set_band_config(dev, info, wrqu, extra); |
| 8821 | cds_ssr_unprotect(__func__); |
| 8822 | |
| 8823 | return ret; |
| 8824 | } |
| 8825 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8826 | static int printk_adapter(void *priv, const char *fmt, ...) |
| 8827 | { |
| 8828 | int ret; |
| 8829 | va_list args; |
| 8830 | |
| 8831 | va_start(args, fmt); |
| 8832 | ret = vprintk(fmt, args); |
| 8833 | ret += printk("\n"); |
| 8834 | va_end(args); |
| 8835 | |
| 8836 | return ret; |
| 8837 | } |
| 8838 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8839 | static void hdd_ioctl_log_buffer(int log_id, uint32_t count) |
| 8840 | { |
| 8841 | qdf_abstract_print *print = &printk_adapter; |
| 8842 | |
| 8843 | switch (log_id) { |
| 8844 | case HTC_CREDIT_HISTORY_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8845 | cds_print_htc_credit_history(count, print, NULL); |
| 8846 | break; |
| 8847 | case COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8848 | wma_print_wmi_cmd_log(count, print, NULL); |
| 8849 | break; |
| 8850 | case COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8851 | wma_print_wmi_cmd_tx_cmp_log(count, print, NULL); |
| 8852 | break; |
| 8853 | case MGMT_COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8854 | wma_print_wmi_mgmt_cmd_log(count, print, NULL); |
| 8855 | break; |
| 8856 | case MGMT_COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8857 | wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL); |
| 8858 | break; |
| 8859 | case EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8860 | wma_print_wmi_event_log(count, print, NULL); |
| 8861 | break; |
| 8862 | case RX_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8863 | wma_print_wmi_rx_event_log(count, print, NULL); |
| 8864 | break; |
| 8865 | case MGMT_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8866 | wma_print_wmi_mgmt_event_log(count, print, NULL); |
| 8867 | break; |
| 8868 | default: |
| 8869 | print(NULL, "Invalid Log Id %d", log_id); |
| 8870 | break; |
| 8871 | } |
| 8872 | } |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8873 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 8874 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
| 8875 | int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2) |
| 8876 | { |
| 8877 | struct hdd_context *hdd_ctx; |
| 8878 | int ret; |
| 8879 | |
| 8880 | hdd_debug("WE_SET_FW_CRASH_INJECT: %d %d", |
| 8881 | v1, v2); |
| 8882 | pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n", |
| 8883 | v1, v2); |
| 8884 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8885 | if (!hdd_ctx->config->crash_inject_enabled) { |
| 8886 | hdd_err("Crash Inject ini disabled, Ignore Crash Inject"); |
| 8887 | return 0; |
| 8888 | } |
| 8889 | if (v1 == 3) { |
| 8890 | cds_trigger_recovery(QDF_REASON_UNSPECIFIED); |
| 8891 | return 0; |
| 8892 | } |
| 8893 | ret = wma_cli_set2_command(adapter->session_id, |
| 8894 | GEN_PARAM_CRASH_INJECT, |
| 8895 | v1, v2, GEN_CMD); |
| 8896 | return ret; |
| 8897 | } |
| 8898 | #endif |
| 8899 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 8900 | #ifdef CONFIG_DP_TRACE |
| 8901 | void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) |
| 8902 | { |
| 8903 | hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d", |
| 8904 | cmd_type, count); |
| 8905 | if (cmd_type == DUMP_DP_TRACE) |
| 8906 | qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID); |
| 8907 | else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE) |
| 8908 | qdf_dp_trace_enable_live_mode(); |
| 8909 | else if (cmd_type == CLEAR_DP_TRACE_BUFFER) |
| 8910 | qdf_dp_trace_clear_buffer(); |
| 8911 | else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE) |
| 8912 | qdf_dp_trace_disable_live_mode(); |
| 8913 | } |
| 8914 | #endif |
| 8915 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8916 | static int __iw_set_two_ints_getnone(struct net_device *dev, |
| 8917 | struct iw_request_info *info, |
| 8918 | union iwreq_data *wrqu, char *extra) |
| 8919 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8920 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8921 | int *value = (int *)extra; |
| 8922 | int sub_cmd = value[0]; |
| 8923 | int ret; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8924 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8925 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8926 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 8927 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8928 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8929 | if (0 != ret) |
| 8930 | return ret; |
| 8931 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8932 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8933 | if (0 != ret) |
| 8934 | return ret; |
| 8935 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8936 | switch (sub_cmd) { |
| 8937 | case WE_SET_SMPS_PARAM: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8938 | hdd_debug("WE_SET_SMPS_PARAM val %d %d", value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8939 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8940 | WMI_STA_SMPS_PARAM_CMDID, |
| 8941 | value[1] << WMA_SMPS_PARAM_VALUE_S |
| 8942 | | value[2], |
| 8943 | VDEV_CMD); |
| 8944 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8945 | case WE_SET_FW_CRASH_INJECT: |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 8946 | ret = hdd_crash_inject(adapter, value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8947 | break; |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8948 | case WE_ENABLE_FW_PROFILE: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8949 | hdd_err("WE_ENABLE_FW_PROFILE: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8950 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8951 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8952 | WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, |
| 8953 | value[1], value[2], DBG_CMD); |
| 8954 | break; |
| 8955 | case WE_SET_FW_PROFILE_HIST_INTVL: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8956 | hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8957 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8958 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8959 | WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, |
| 8960 | value[1], value[2], DBG_CMD); |
| 8961 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8962 | case WE_SET_DUAL_MAC_FW_MODE_CONFIG: |
| 8963 | hdd_debug("Ioctl to set dual fw mode config"); |
Tushnim Bhattacharyya | 49ed8ab | 2017-05-26 18:20:10 -0700 | [diff] [blame] | 8964 | if (hdd_ctx->config->dual_mac_feature_disable == |
| 8965 | DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8966 | hdd_err("Dual mac feature is disabled from INI"); |
| 8967 | return -EPERM; |
| 8968 | } |
| 8969 | hdd_debug("%d %d", value[1], value[2]); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 8970 | policy_mgr_set_dual_mac_fw_mode_config(hdd_ctx->hdd_psoc, |
| 8971 | value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8972 | break; |
| 8973 | case WE_DUMP_DP_TRACE_LEVEL: |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 8974 | hdd_set_dump_dp_trace(value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8975 | break; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 8976 | case WE_SET_MON_MODE_CHAN: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8977 | ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 8978 | break; |
Rajeev Kumar | 15b40a2 | 2018-04-12 11:45:24 -0700 | [diff] [blame] | 8979 | case WE_SET_WLAN_SUSPEND: |
Dustin Brown | 5409643 | 2017-02-23 13:00:44 -0800 | [diff] [blame] | 8980 | ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, |
| 8981 | value[1], value[2]); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 8982 | break; |
| 8983 | case WE_SET_WLAN_RESUME: |
Dustin Brown | bc81a47 | 2016-10-26 16:56:59 -0700 | [diff] [blame] | 8984 | ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 8985 | break; |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8986 | case WE_LOG_BUFFER: { |
| 8987 | int log_id = value[1]; |
| 8988 | uint32_t count = value[2] < 0 ? 0 : value[2]; |
| 8989 | |
| 8990 | hdd_ioctl_log_buffer(log_id, count); |
| 8991 | |
| 8992 | break; |
| 8993 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8994 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8995 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8996 | break; |
| 8997 | } |
| 8998 | |
| 8999 | return ret; |
| 9000 | } |
| 9001 | |
| 9002 | static int iw_set_two_ints_getnone(struct net_device *dev, |
| 9003 | struct iw_request_info *info, |
| 9004 | union iwreq_data *wrqu, char *extra) |
| 9005 | { |
| 9006 | int ret; |
| 9007 | |
| 9008 | cds_ssr_protect(__func__); |
| 9009 | ret = __iw_set_two_ints_getnone(dev, info, wrqu, extra); |
| 9010 | cds_ssr_unprotect(__func__); |
| 9011 | |
| 9012 | return ret; |
| 9013 | } |
| 9014 | |
| 9015 | /* Define the Wireless Extensions to the Linux Network Device structure */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9016 | |
| 9017 | static const iw_handler we_private[] = { |
| 9018 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9019 | [WLAN_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_setint_getnone, |
| 9020 | [WLAN_PRIV_SET_NONE_GET_INT - SIOCIWFIRSTPRIV] = iw_setnone_getint, |
| 9021 | [WLAN_PRIV_SET_CHAR_GET_NONE - SIOCIWFIRSTPRIV] = iw_setchar_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9022 | [WLAN_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9023 | iw_set_three_ints_getnone, |
| 9024 | [WLAN_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] = iw_get_char_setnone, |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9025 | [WLAN_PRIV_SET_NONE_GET_NONE - SIOCIWFIRSTPRIV] = iw_setnone_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9026 | [WLAN_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9027 | iw_hdd_set_var_ints_getnone, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9028 | [WLAN_PRIV_SET_NONE_GET_THREE_INT - SIOCIWFIRSTPRIV] = |
| 9029 | iw_setnone_get_threeint, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9030 | #ifdef WLAN_FEATURE_FIPS |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 9031 | [WLAN_PRIV_FIPS_TEST - SIOCIWFIRSTPRIV] = hdd_fips_test, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9032 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9033 | [WLAN_PRIV_ADD_TSPEC - SIOCIWFIRSTPRIV] = iw_add_tspec, |
| 9034 | [WLAN_PRIV_DEL_TSPEC - SIOCIWFIRSTPRIV] = iw_del_tspec, |
| 9035 | [WLAN_PRIV_GET_TSPEC - SIOCIWFIRSTPRIV] = iw_get_tspec, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9036 | [WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9037 | [WLAN_PRIV_SET_HOST_OFFLOAD - SIOCIWFIRSTPRIV] = iw_set_host_offload, |
| 9038 | [WLAN_GET_WLAN_STATISTICS - SIOCIWFIRSTPRIV] = iw_get_statistics, |
| 9039 | [WLAN_SET_KEEPALIVE_PARAMS - SIOCIWFIRSTPRIV] = |
| 9040 | iw_set_keepalive_params, |
| 9041 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 9042 | [WLAN_SET_PACKET_FILTER_PARAMS - SIOCIWFIRSTPRIV] = |
| 9043 | iw_set_packet_filter_params, |
| 9044 | #endif |
| 9045 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9046 | [WLAN_SET_PNO - SIOCIWFIRSTPRIV] = iw_set_pno, |
| 9047 | #endif |
| 9048 | [WLAN_SET_BAND_CONFIG - SIOCIWFIRSTPRIV] = iw_set_band_config, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 9049 | [WLAN_PRIV_SET_MCBC_FILTER - SIOCIWFIRSTPRIV] = |
| 9050 | iw_set_dynamic_mcbc_filter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9051 | [WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed, |
| 9052 | [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9053 | iw_set_two_ints_getnone, |
| 9054 | [WLAN_SET_DOT11P_CHANNEL_SCHED - SIOCIWFIRSTPRIV] = |
| 9055 | iw_set_dot11p_channel_sched, |
| 9056 | }; |
| 9057 | |
| 9058 | /*Maximum command length can be only 15 */ |
| 9059 | static const struct iw_priv_args we_private_args[] = { |
| 9060 | |
| 9061 | /* handlers for main ioctl */ |
| 9062 | {WLAN_PRIV_SET_INT_GET_NONE, |
| 9063 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9064 | 0, |
| 9065 | ""}, |
| 9066 | |
| 9067 | /* handlers for sub-ioctl */ |
| 9068 | {WE_SET_11D_STATE, |
| 9069 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9070 | 0, |
| 9071 | "set11Dstate"}, |
| 9072 | |
| 9073 | {WE_WOWL, |
| 9074 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9075 | 0, |
| 9076 | "wowl"}, |
| 9077 | |
| 9078 | {WE_SET_POWER, |
| 9079 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9080 | 0, |
| 9081 | "setPower"}, |
| 9082 | |
| 9083 | {WE_SET_MAX_ASSOC, |
| 9084 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9085 | 0, |
| 9086 | "setMaxAssoc"}, |
| 9087 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9088 | {WE_SET_SCAN_DISABLE, |
| 9089 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9090 | 0, |
| 9091 | "scan_disable"}, |
| 9092 | |
| 9093 | {WE_SET_DATA_INACTIVITY_TO, |
| 9094 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9095 | 0, |
| 9096 | "inactivityTO"}, |
| 9097 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 9098 | {WE_SET_WOW_DATA_INACTIVITY_TO, |
| 9099 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9100 | 0, |
| 9101 | "wow_ito"}, |
| 9102 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9103 | {WE_SET_MAX_TX_POWER, |
| 9104 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9105 | 0, |
| 9106 | "setMaxTxPower"}, |
| 9107 | |
| 9108 | {WE_SET_TX_POWER, |
| 9109 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9110 | 0, |
| 9111 | "setTxPower"}, |
| 9112 | |
| 9113 | {WE_SET_MC_RATE, |
| 9114 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9115 | 0, |
| 9116 | "setMcRate"}, |
| 9117 | |
| 9118 | {WE_SET_MAX_TX_POWER_2_4, |
| 9119 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9120 | 0, |
| 9121 | "setTxMaxPower2G"}, |
| 9122 | |
| 9123 | {WE_SET_MAX_TX_POWER_5_0, |
| 9124 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9125 | 0, |
| 9126 | "setTxMaxPower5G"}, |
| 9127 | |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9128 | #ifndef REMOVE_PKT_LOG |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9129 | {WE_SET_PKTLOG, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 9130 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9131 | 0, |
| 9132 | "pktlog"}, |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9133 | #endif |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9134 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9135 | /* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA |
| 9136 | * as well to keep same syntax as in SAP. Now onwards, STA |
Jeff Johnson | 3bb7c73 | 2017-01-12 08:40:17 -0800 | [diff] [blame] | 9137 | * will support both |
| 9138 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9139 | {WE_SET_MAX_TX_POWER, |
| 9140 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9141 | 0, |
| 9142 | "setTxMaxPower"}, |
| 9143 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9144 | {WE_SET_TM_LEVEL, |
| 9145 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9146 | 0, |
| 9147 | "setTmLevel"}, |
| 9148 | |
| 9149 | {WE_SET_PHYMODE, |
| 9150 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9151 | 0, |
| 9152 | "setphymode"}, |
| 9153 | |
| 9154 | {WE_SET_NSS, |
| 9155 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9156 | 0, |
| 9157 | "nss"}, |
| 9158 | |
| 9159 | {WE_SET_LDPC, |
| 9160 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9161 | 0, |
| 9162 | "ldpc"}, |
| 9163 | |
| 9164 | {WE_SET_TX_STBC, |
| 9165 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9166 | 0, |
| 9167 | "tx_stbc"}, |
| 9168 | |
| 9169 | {WE_SET_RX_STBC, |
| 9170 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9171 | 0, |
| 9172 | "rx_stbc"}, |
| 9173 | |
| 9174 | {WE_SET_SHORT_GI, |
| 9175 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9176 | 0, |
| 9177 | "shortgi"}, |
| 9178 | |
| 9179 | {WE_SET_RTSCTS, |
| 9180 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9181 | 0, |
| 9182 | "enablertscts"}, |
| 9183 | |
| 9184 | {WE_SET_CHWIDTH, |
| 9185 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9186 | 0, |
| 9187 | "chwidth"}, |
| 9188 | |
| 9189 | {WE_SET_ANI_EN_DIS, |
| 9190 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9191 | 0, |
| 9192 | "anienable"}, |
| 9193 | |
| 9194 | {WE_SET_ANI_POLL_PERIOD, |
| 9195 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9196 | 0, |
| 9197 | "aniplen"}, |
| 9198 | |
| 9199 | {WE_SET_ANI_LISTEN_PERIOD, |
| 9200 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9201 | 0, |
| 9202 | "anilislen"}, |
| 9203 | |
| 9204 | {WE_SET_ANI_OFDM_LEVEL, |
| 9205 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9206 | 0, |
| 9207 | "aniofdmlvl"}, |
| 9208 | |
| 9209 | {WE_SET_ANI_CCK_LEVEL, |
| 9210 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9211 | 0, |
| 9212 | "aniccklvl"}, |
| 9213 | |
| 9214 | {WE_SET_DYNAMIC_BW, |
| 9215 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9216 | 0, |
| 9217 | "cwmenable"}, |
| 9218 | |
| 9219 | {WE_SET_CTS_CBW, |
| 9220 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9221 | 0, |
| 9222 | "cts_cbw" }, |
| 9223 | |
| 9224 | {WE_SET_GTX_HT_MCS, |
| 9225 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9226 | 0, |
| 9227 | "gtxHTMcs"}, |
| 9228 | |
| 9229 | {WE_SET_GTX_VHT_MCS, |
| 9230 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9231 | 0, |
| 9232 | "gtxVHTMcs"}, |
| 9233 | |
| 9234 | {WE_SET_GTX_USRCFG, |
| 9235 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9236 | 0, |
| 9237 | "gtxUsrCfg"}, |
| 9238 | |
| 9239 | {WE_SET_GTX_THRE, |
| 9240 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9241 | 0, |
| 9242 | "gtxThre"}, |
| 9243 | |
| 9244 | {WE_SET_GTX_MARGIN, |
| 9245 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9246 | 0, |
| 9247 | "gtxMargin"}, |
| 9248 | |
| 9249 | {WE_SET_GTX_STEP, |
| 9250 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9251 | 0, |
| 9252 | "gtxStep"}, |
| 9253 | |
| 9254 | {WE_SET_GTX_MINTPC, |
| 9255 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9256 | 0, |
| 9257 | "gtxMinTpc"}, |
| 9258 | |
| 9259 | {WE_SET_GTX_BWMASK, |
| 9260 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9261 | 0, |
| 9262 | "gtxBWMask"}, |
| 9263 | |
| 9264 | {WE_SET_TX_CHAINMASK, |
| 9265 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9266 | 0, |
| 9267 | "txchainmask"}, |
| 9268 | |
| 9269 | {WE_SET_RX_CHAINMASK, |
| 9270 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9271 | 0, |
| 9272 | "rxchainmask"}, |
| 9273 | |
| 9274 | {WE_SET_11N_RATE, |
| 9275 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9276 | 0, |
| 9277 | "set11NRates"}, |
| 9278 | |
| 9279 | {WE_SET_VHT_RATE, |
| 9280 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9281 | 0, |
| 9282 | "set11ACRates"}, |
| 9283 | |
| 9284 | {WE_SET_AMPDU, |
| 9285 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9286 | 0, |
| 9287 | "ampdu"}, |
| 9288 | |
| 9289 | {WE_SET_AMSDU, |
| 9290 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9291 | 0, |
| 9292 | "amsdu"}, |
| 9293 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9294 | {WE_SET_TXPOW_2G, |
| 9295 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9296 | 0, |
| 9297 | "txpow2g"}, |
| 9298 | |
| 9299 | {WE_SET_TXPOW_5G, |
| 9300 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9301 | 0, |
| 9302 | "txpow5g"}, |
| 9303 | |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9304 | #ifdef FEATURE_FW_LOG_PARSING |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9305 | /* Sub-cmds DBGLOG specific commands */ |
| 9306 | {WE_DBGLOG_LOG_LEVEL, |
| 9307 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9308 | 0, |
| 9309 | "dl_loglevel"}, |
| 9310 | |
| 9311 | {WE_DBGLOG_VAP_ENABLE, |
| 9312 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9313 | 0, |
| 9314 | "dl_vapon"}, |
| 9315 | |
| 9316 | {WE_DBGLOG_VAP_DISABLE, |
| 9317 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9318 | 0, |
| 9319 | "dl_vapoff"}, |
| 9320 | |
| 9321 | {WE_DBGLOG_MODULE_ENABLE, |
| 9322 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9323 | 0, |
| 9324 | "dl_modon"}, |
| 9325 | |
| 9326 | {WE_DBGLOG_MODULE_DISABLE, |
| 9327 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9328 | 0, |
| 9329 | "dl_modoff"}, |
| 9330 | |
| 9331 | {WE_DBGLOG_MOD_LOG_LEVEL, |
| 9332 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9333 | 0, |
| 9334 | "dl_mod_loglevel"}, |
| 9335 | |
| 9336 | {WE_DBGLOG_TYPE, |
| 9337 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9338 | 0, |
| 9339 | "dl_type"}, |
| 9340 | {WE_DBGLOG_REPORT_ENABLE, |
| 9341 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9342 | 0, |
| 9343 | "dl_report"}, |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9344 | #endif /* FEATURE_FW_LOG_PARSING */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9345 | |
| 9346 | {WE_SET_TXRX_FWSTATS, |
| 9347 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9348 | 0, |
| 9349 | "txrx_fw_stats"}, |
| 9350 | |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9351 | {WE_SET_TXRX_STATS, |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 9352 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9353 | 0, |
| 9354 | "txrx_stats"}, |
| 9355 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9356 | {WE_TXRX_FWSTATS_RESET, |
| 9357 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9358 | 0, |
| 9359 | "txrx_fw_st_rst"}, |
| 9360 | |
| 9361 | {WE_PPS_PAID_MATCH, |
| 9362 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9363 | 0, "paid_match"}, |
| 9364 | |
| 9365 | {WE_PPS_GID_MATCH, |
| 9366 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9367 | 0, "gid_match"}, |
| 9368 | |
| 9369 | {WE_PPS_EARLY_TIM_CLEAR, |
| 9370 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9371 | 0, "tim_clear"}, |
| 9372 | |
| 9373 | {WE_PPS_EARLY_DTIM_CLEAR, |
| 9374 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9375 | 0, "dtim_clear"}, |
| 9376 | |
| 9377 | {WE_PPS_EOF_PAD_DELIM, |
| 9378 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9379 | 0, "eof_delim"}, |
| 9380 | |
| 9381 | {WE_PPS_MACADDR_MISMATCH, |
| 9382 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9383 | 0, "mac_match"}, |
| 9384 | |
| 9385 | {WE_PPS_DELIM_CRC_FAIL, |
| 9386 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9387 | 0, "delim_fail"}, |
| 9388 | |
| 9389 | {WE_PPS_GID_NSTS_ZERO, |
| 9390 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9391 | 0, "nsts_zero"}, |
| 9392 | |
| 9393 | {WE_PPS_RSSI_CHECK, |
| 9394 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9395 | 0, "rssi_chk"}, |
| 9396 | |
| 9397 | {WE_PPS_5G_EBT, |
| 9398 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9399 | 0, "5g_ebt"}, |
| 9400 | |
| 9401 | {WE_SET_HTSMPS, |
| 9402 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9403 | 0, "htsmps"}, |
| 9404 | |
| 9405 | {WE_SET_QPOWER_MAX_PSPOLL_COUNT, |
| 9406 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9407 | 0, "set_qpspollcnt"}, |
| 9408 | |
| 9409 | {WE_SET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 9410 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9411 | 0, "set_qtxwake"}, |
| 9412 | |
| 9413 | {WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 9414 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9415 | 0, "set_qwakeintv"}, |
| 9416 | |
| 9417 | {WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 9418 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9419 | 0, "set_qnodatapoll"}, |
| 9420 | |
| 9421 | /* handlers for MCC time quota and latency sub ioctls */ |
| 9422 | {WE_MCC_CONFIG_LATENCY, |
| 9423 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9424 | 0, "setMccLatency"}, |
| 9425 | |
| 9426 | {WE_MCC_CONFIG_QUOTA, |
| 9427 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9428 | 0, "setMccQuota"}, |
| 9429 | |
| 9430 | {WE_SET_DEBUG_LOG, |
| 9431 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9432 | 0, "setDbgLvl"}, |
| 9433 | |
| 9434 | /* handlers for early_rx power save */ |
| 9435 | {WE_SET_EARLY_RX_ADJUST_ENABLE, |
| 9436 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9437 | 0, "erx_enable"}, |
| 9438 | |
| 9439 | {WE_SET_EARLY_RX_TGT_BMISS_NUM, |
| 9440 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9441 | 0, "erx_bmiss_val"}, |
| 9442 | |
| 9443 | {WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 9444 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9445 | 0, "erx_bmiss_smpl"}, |
| 9446 | |
| 9447 | {WE_SET_EARLY_RX_SLOP_STEP, |
| 9448 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9449 | 0, "erx_slop_step"}, |
| 9450 | |
| 9451 | {WE_SET_EARLY_RX_INIT_SLOP, |
| 9452 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9453 | 0, "erx_init_slop"}, |
| 9454 | |
| 9455 | {WE_SET_EARLY_RX_ADJUST_PAUSE, |
| 9456 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9457 | 0, "erx_adj_pause"}, |
| 9458 | |
| 9459 | {WE_SET_EARLY_RX_DRIFT_SAMPLE, |
| 9460 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9461 | 0, "erx_dri_sample"}, |
| 9462 | |
| 9463 | {WE_DUMP_STATS, |
| 9464 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9465 | 0, "dumpStats"}, |
| 9466 | |
| 9467 | {WE_CLEAR_STATS, |
| 9468 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9469 | 0, "clearStats"}, |
| 9470 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9471 | {WE_START_FW_PROFILE, |
| 9472 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9473 | 0, "startProfile"}, |
| 9474 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 9475 | {WE_SET_CHANNEL, |
| 9476 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9477 | 0, "setChanChange" }, |
| 9478 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 9479 | {WE_SET_CONC_SYSTEM_PREF, |
| 9480 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9481 | 0, "setConcSysPref" }, |
| 9482 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 9483 | {WE_SET_PDEV_RESET, |
| 9484 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9485 | 0, "pdev_reset" }, |
| 9486 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 9487 | {WE_SET_MODULATED_DTIM, |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 9488 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9489 | 0, "setModDTIM" }, |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 9490 | |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 9491 | {WE_SET_PPDU_DUR, |
| 9492 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9493 | 0, "set_ppdu_dur" }, |
| 9494 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9495 | {WLAN_PRIV_SET_NONE_GET_INT, |
| 9496 | 0, |
| 9497 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9498 | ""}, |
| 9499 | |
| 9500 | /* handlers for sub-ioctl */ |
| 9501 | {WE_GET_11D_STATE, |
| 9502 | 0, |
| 9503 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9504 | "get11Dstate"}, |
| 9505 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9506 | {WE_GET_WLAN_DBG, |
| 9507 | 0, |
| 9508 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9509 | "getwlandbg"}, |
| 9510 | |
| 9511 | {WE_GET_MAX_ASSOC, |
| 9512 | 0, |
| 9513 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9514 | "getMaxAssoc"}, |
| 9515 | |
| 9516 | {WE_GET_SAP_AUTO_CHANNEL_SELECTION, |
| 9517 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9518 | "getAutoChannel" }, |
| 9519 | |
| 9520 | {WE_GET_CONCURRENCY_MODE, |
| 9521 | 0, |
| 9522 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9523 | "getconcurrency"}, |
| 9524 | |
| 9525 | {WE_GET_NSS, |
| 9526 | 0, |
| 9527 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9528 | "get_nss"}, |
| 9529 | |
| 9530 | {WE_GET_LDPC, |
| 9531 | 0, |
| 9532 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9533 | "get_ldpc"}, |
| 9534 | |
| 9535 | {WE_GET_TX_STBC, |
| 9536 | 0, |
| 9537 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9538 | "get_tx_stbc"}, |
| 9539 | |
| 9540 | {WE_GET_RX_STBC, |
| 9541 | 0, |
| 9542 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9543 | "get_rx_stbc"}, |
| 9544 | |
| 9545 | {WE_GET_SHORT_GI, |
| 9546 | 0, |
| 9547 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9548 | "get_shortgi"}, |
| 9549 | |
| 9550 | {WE_GET_RTSCTS, |
| 9551 | 0, |
| 9552 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9553 | "get_rtscts"}, |
| 9554 | |
| 9555 | {WE_GET_CHWIDTH, |
| 9556 | 0, |
| 9557 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9558 | "get_chwidth"}, |
| 9559 | |
| 9560 | {WE_GET_ANI_EN_DIS, |
| 9561 | 0, |
| 9562 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9563 | "get_anienable"}, |
| 9564 | |
| 9565 | {WE_GET_ANI_POLL_PERIOD, |
| 9566 | 0, |
| 9567 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9568 | "get_aniplen"}, |
| 9569 | |
| 9570 | {WE_GET_ANI_LISTEN_PERIOD, |
| 9571 | 0, |
| 9572 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9573 | "get_anilislen"}, |
| 9574 | |
| 9575 | {WE_GET_ANI_OFDM_LEVEL, |
| 9576 | 0, |
| 9577 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9578 | "get_aniofdmlvl"}, |
| 9579 | |
| 9580 | {WE_GET_ANI_CCK_LEVEL, |
| 9581 | 0, |
| 9582 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9583 | "get_aniccklvl"}, |
| 9584 | |
| 9585 | {WE_GET_DYNAMIC_BW, |
| 9586 | 0, |
| 9587 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9588 | "get_cwmenable"}, |
| 9589 | |
| 9590 | {WE_GET_GTX_HT_MCS, |
| 9591 | 0, |
| 9592 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9593 | "get_gtxHTMcs"}, |
| 9594 | |
| 9595 | {WE_GET_GTX_VHT_MCS, |
| 9596 | 0, |
| 9597 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9598 | "get_gtxVHTMcs"}, |
| 9599 | |
| 9600 | {WE_GET_GTX_USRCFG, |
| 9601 | 0, |
| 9602 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9603 | "get_gtxUsrCfg"}, |
| 9604 | |
| 9605 | {WE_GET_GTX_THRE, |
| 9606 | 0, |
| 9607 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9608 | "get_gtxThre"}, |
| 9609 | |
| 9610 | {WE_GET_GTX_MARGIN, |
| 9611 | 0, |
| 9612 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9613 | "get_gtxMargin"}, |
| 9614 | |
| 9615 | {WE_GET_GTX_STEP, |
| 9616 | 0, |
| 9617 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9618 | "get_gtxStep"}, |
| 9619 | |
| 9620 | {WE_GET_GTX_MINTPC, |
| 9621 | 0, |
| 9622 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9623 | "get_gtxMinTpc"}, |
| 9624 | |
| 9625 | {WE_GET_GTX_BWMASK, |
| 9626 | 0, |
| 9627 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9628 | "get_gtxBWMask"}, |
| 9629 | |
| 9630 | {WE_GET_TX_CHAINMASK, |
| 9631 | 0, |
| 9632 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9633 | "get_txchainmask"}, |
| 9634 | |
| 9635 | {WE_GET_RX_CHAINMASK, |
| 9636 | 0, |
| 9637 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9638 | "get_rxchainmask"}, |
| 9639 | |
| 9640 | {WE_GET_11N_RATE, |
| 9641 | 0, |
| 9642 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9643 | "get_11nrate"}, |
| 9644 | |
| 9645 | {WE_GET_AMPDU, |
| 9646 | 0, |
| 9647 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9648 | "get_ampdu"}, |
| 9649 | |
| 9650 | {WE_GET_AMSDU, |
| 9651 | 0, |
| 9652 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9653 | "get_amsdu"}, |
| 9654 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9655 | {WE_GET_TXPOW_2G, |
| 9656 | 0, |
| 9657 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9658 | "get_txpow2g"}, |
| 9659 | |
| 9660 | {WE_GET_TXPOW_5G, |
| 9661 | 0, |
| 9662 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9663 | "get_txpow5g"}, |
| 9664 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9665 | {WE_GET_PPS_PAID_MATCH, |
| 9666 | 0, |
| 9667 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9668 | "get_paid_match"}, |
| 9669 | |
| 9670 | {WE_GET_PPS_GID_MATCH, |
| 9671 | 0, |
| 9672 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9673 | "get_gid_match"}, |
| 9674 | |
| 9675 | {WE_GET_PPS_EARLY_TIM_CLEAR, |
| 9676 | 0, |
| 9677 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9678 | "get_tim_clear"}, |
| 9679 | |
| 9680 | {WE_GET_PPS_EARLY_DTIM_CLEAR, |
| 9681 | 0, |
| 9682 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9683 | "get_dtim_clear"}, |
| 9684 | |
| 9685 | {WE_GET_PPS_EOF_PAD_DELIM, |
| 9686 | 0, |
| 9687 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9688 | "get_eof_delim"}, |
| 9689 | |
| 9690 | {WE_GET_PPS_MACADDR_MISMATCH, |
| 9691 | 0, |
| 9692 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9693 | "get_mac_match"}, |
| 9694 | |
| 9695 | {WE_GET_PPS_DELIM_CRC_FAIL, |
| 9696 | 0, |
| 9697 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9698 | "get_delim_fail"}, |
| 9699 | |
| 9700 | {WE_GET_PPS_GID_NSTS_ZERO, |
| 9701 | 0, |
| 9702 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9703 | "get_nsts_zero"}, |
| 9704 | |
| 9705 | {WE_GET_PPS_RSSI_CHECK, |
| 9706 | 0, |
| 9707 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9708 | "get_rssi_chk"}, |
| 9709 | |
| 9710 | {WE_GET_QPOWER_MAX_PSPOLL_COUNT, |
| 9711 | 0, |
| 9712 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9713 | "get_qpspollcnt"}, |
| 9714 | |
| 9715 | {WE_GET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 9716 | 0, |
| 9717 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9718 | "get_qtxwake"}, |
| 9719 | |
| 9720 | {WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 9721 | 0, |
| 9722 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9723 | "get_qwakeintv"}, |
| 9724 | |
| 9725 | {WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 9726 | 0, |
| 9727 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9728 | "get_qnodatapoll"}, |
| 9729 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9730 | {WE_CAP_TSF, |
| 9731 | 0, |
| 9732 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9733 | "cap_tsf"}, |
| 9734 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9735 | {WE_GET_TEMPERATURE, |
| 9736 | 0, |
| 9737 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9738 | "get_temp"}, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 9739 | {WE_GET_DCM, |
| 9740 | 0, |
| 9741 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9742 | "get_dcm"}, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 9743 | {WE_GET_RANGE_EXT, |
| 9744 | 0, |
| 9745 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9746 | "get_range_ext"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9747 | /* handlers for main ioctl */ |
| 9748 | {WLAN_PRIV_SET_CHAR_GET_NONE, |
| 9749 | IW_PRIV_TYPE_CHAR | 512, |
| 9750 | 0, |
| 9751 | ""}, |
| 9752 | |
| 9753 | /* handlers for sub-ioctl */ |
| 9754 | {WE_WOWL_ADD_PTRN, |
| 9755 | IW_PRIV_TYPE_CHAR | 512, |
| 9756 | 0, |
| 9757 | "wowlAddPtrn"}, |
| 9758 | |
| 9759 | {WE_WOWL_DEL_PTRN, |
| 9760 | IW_PRIV_TYPE_CHAR | 512, |
| 9761 | 0, |
| 9762 | "wowlDelPtrn"}, |
| 9763 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9764 | /* handlers for sub-ioctl */ |
| 9765 | {WE_NEIGHBOR_REPORT_REQUEST, |
| 9766 | IW_PRIV_TYPE_CHAR | 512, |
| 9767 | 0, |
| 9768 | "neighbor"}, |
Deepak Dhamdhere | 641bf32 | 2016-01-06 15:19:03 -0800 | [diff] [blame] | 9769 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9770 | {WE_SET_AP_WPS_IE, |
| 9771 | IW_PRIV_TYPE_CHAR | 512, |
| 9772 | 0, |
| 9773 | "set_ap_wps_ie"}, |
| 9774 | |
| 9775 | {WE_SET_CONFIG, |
| 9776 | IW_PRIV_TYPE_CHAR | 512, |
| 9777 | 0, |
| 9778 | "setConfig"}, |
| 9779 | |
Dustin Brown | 0ea8d3b | 2018-07-06 13:58:49 -0700 | [diff] [blame] | 9780 | #ifdef WLAN_UNIT_TEST |
| 9781 | {WE_UNIT_TEST, |
| 9782 | IW_PRIV_TYPE_CHAR | 512, |
| 9783 | 0, |
| 9784 | "unit_test"}, |
| 9785 | #endif |
| 9786 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9787 | /* handlers for main ioctl */ |
| 9788 | {WLAN_PRIV_SET_THREE_INT_GET_NONE, |
| 9789 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9790 | 0, |
| 9791 | ""}, |
| 9792 | |
| 9793 | /* handlers for sub-ioctl */ |
| 9794 | {WE_SET_WLAN_DBG, |
| 9795 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9796 | 0, |
| 9797 | "setwlandbg"}, |
| 9798 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9799 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9800 | /* handlers for sub-ioctl */ |
| 9801 | {WE_SET_DP_TRACE, |
| 9802 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9803 | 0, |
| 9804 | "set_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9805 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9806 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 9807 | {WE_SET_FW_TEST, |
| 9808 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9809 | 0, "fw_test"}, |
| 9810 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9811 | /* handlers for main ioctl */ |
| 9812 | {WLAN_PRIV_SET_NONE_GET_THREE_INT, |
| 9813 | 0, |
| 9814 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9815 | "" }, |
| 9816 | {WE_GET_TSF, |
| 9817 | 0, |
| 9818 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9819 | "get_tsf" }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9820 | |
| 9821 | {WE_SET_DUAL_MAC_SCAN_CONFIG, |
| 9822 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9823 | 0, |
| 9824 | "set_scan_cfg"}, |
| 9825 | |
| 9826 | /* handlers for main ioctl */ |
| 9827 | {WLAN_PRIV_GET_CHAR_SET_NONE, |
| 9828 | 0, |
| 9829 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9830 | ""}, |
| 9831 | |
| 9832 | /* handlers for sub-ioctl */ |
| 9833 | {WE_WLAN_VERSION, |
| 9834 | 0, |
| 9835 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9836 | "version"}, |
| 9837 | {WE_GET_STATS, |
| 9838 | 0, |
| 9839 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9840 | "getStats"}, |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 9841 | {WE_GET_SUSPEND_RESUME_STATS, |
| 9842 | 0, |
| 9843 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9844 | "getSuspendStats"}, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9845 | {WE_LIST_FW_PROFILE, |
| 9846 | 0, |
| 9847 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9848 | "listProfile"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9849 | {WE_GET_STATES, |
| 9850 | 0, |
| 9851 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9852 | "getHostStates"}, |
| 9853 | {WE_GET_CFG, |
| 9854 | 0, |
| 9855 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9856 | "getConfig"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9857 | {WE_GET_RSSI, |
| 9858 | 0, |
| 9859 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9860 | "getRSSI"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9861 | {WE_GET_WMM_STATUS, |
| 9862 | 0, |
| 9863 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9864 | "getWmmStatus"}, |
| 9865 | { |
| 9866 | WE_GET_CHANNEL_LIST, |
| 9867 | 0, |
| 9868 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9869 | "getChannelList" |
| 9870 | }, |
| 9871 | #ifdef FEATURE_WLAN_TDLS |
| 9872 | { |
| 9873 | WE_GET_TDLS_PEERS, |
| 9874 | 0, |
| 9875 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9876 | "getTdlsPeers" |
| 9877 | }, |
| 9878 | #endif |
| 9879 | #ifdef WLAN_FEATURE_11W |
| 9880 | { |
| 9881 | WE_GET_11W_INFO, |
| 9882 | 0, |
| 9883 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9884 | "getPMFInfo" |
| 9885 | }, |
| 9886 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9887 | { |
| 9888 | WE_GET_IBSS_STA_INFO, |
| 9889 | 0, |
| 9890 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9891 | "getIbssSTAs" |
| 9892 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9893 | {WE_GET_PHYMODE, |
| 9894 | 0, |
| 9895 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9896 | "getphymode"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 9897 | #if defined(FEATURE_OEM_DATA_SUPPORT) || defined(WIFI_POS_CONVERGED) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9898 | {WE_GET_OEM_DATA_CAP, |
| 9899 | 0, |
| 9900 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9901 | "getOemDataCap"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 9902 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9903 | {WE_GET_SNR, |
| 9904 | 0, |
| 9905 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9906 | "getSNR"}, |
| 9907 | |
| 9908 | /* handlers for main ioctl */ |
| 9909 | {WLAN_PRIV_SET_NONE_GET_NONE, |
| 9910 | 0, |
| 9911 | 0, |
| 9912 | ""}, |
| 9913 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9914 | /* handlers for sub-ioctl */ |
| 9915 | { |
| 9916 | WE_IBSS_GET_PEER_INFO_ALL, |
| 9917 | 0, |
| 9918 | 0, |
| 9919 | "ibssPeerInfoAll" |
| 9920 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9921 | {WE_GET_RECOVERY_STAT, |
| 9922 | 0, |
| 9923 | 0, |
| 9924 | "getRecoverStat"}, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9925 | |
| 9926 | {WE_GET_FW_PROFILE_DATA, |
| 9927 | 0, |
| 9928 | 0, |
| 9929 | "getProfileData"}, |
| 9930 | |
| 9931 | {WE_SET_REASSOC_TRIGGER, |
| 9932 | 0, |
| 9933 | 0, |
| 9934 | "reassoc"}, |
| 9935 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 9936 | {WE_STOP_OBSS_SCAN, |
| 9937 | 0, |
| 9938 | 0, |
| 9939 | "stop_obss_scan"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9940 | /* handlers for main ioctl */ |
| 9941 | {WLAN_PRIV_SET_VAR_INT_GET_NONE, |
| 9942 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9943 | 0, |
| 9944 | ""}, |
| 9945 | |
| 9946 | /* handlers for sub-ioctl */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9947 | {WE_IBSS_GET_PEER_INFO, |
| 9948 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9949 | 0, |
| 9950 | "ibssPeerInfo"}, |
| 9951 | |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 9952 | #ifdef TRACE_RECORD |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9953 | /* handlers for sub-ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9954 | {WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD, |
| 9955 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9956 | 0, |
| 9957 | "setdumplog"}, |
| 9958 | |
| 9959 | {WE_MTRACE_DUMP_CMD, |
| 9960 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9961 | 0, |
| 9962 | "dumplog"}, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 9963 | #endif |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 9964 | |
| 9965 | {WE_POLICY_MANAGER_CINFO_CMD, |
| 9966 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9967 | 0, |
| 9968 | "pm_cinfo"}, |
| 9969 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9970 | #ifdef MPC_UT_FRAMEWORK |
| 9971 | {WE_POLICY_MANAGER_CLIST_CMD, |
| 9972 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9973 | 0, |
| 9974 | "pm_clist"}, |
| 9975 | |
| 9976 | {WE_POLICY_MANAGER_DLIST_CMD, |
| 9977 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9978 | 0, |
| 9979 | "pm_dlist"}, |
| 9980 | |
| 9981 | {WE_POLICY_MANAGER_DBS_CMD, |
| 9982 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9983 | 0, |
| 9984 | "pm_dbs"}, |
| 9985 | |
| 9986 | {WE_POLICY_MANAGER_PCL_CMD, |
| 9987 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9988 | 0, |
| 9989 | "pm_pcl"}, |
| 9990 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9991 | {WE_POLICY_MANAGER_ULIST_CMD, |
| 9992 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9993 | 0, |
| 9994 | "pm_ulist"}, |
| 9995 | |
| 9996 | {WE_POLICY_MANAGER_QUERY_ACTION_CMD, |
| 9997 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9998 | 0, |
| 9999 | "pm_query_action"}, |
| 10000 | |
| 10001 | {WE_POLICY_MANAGER_QUERY_ALLOW_CMD, |
| 10002 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10003 | 0, |
| 10004 | "pm_query_allow"}, |
| 10005 | |
| 10006 | {WE_POLICY_MANAGER_SCENARIO_CMD, |
| 10007 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10008 | 0, |
| 10009 | "pm_run_scenario"}, |
| 10010 | |
| 10011 | {WE_POLICY_SET_HW_MODE_CMD, |
| 10012 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10013 | 0, |
| 10014 | "pm_set_hw_mode"}, |
| 10015 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10016 | { |
| 10017 | WE_UNIT_TEST_CMD, |
| 10018 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10019 | 0, |
| 10020 | "setUnitTestCmd" |
| 10021 | }, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 10022 | { |
| 10023 | WE_MAC_PWR_DEBUG_CMD, |
| 10024 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10025 | 0, |
| 10026 | "halPwrDebug" |
| 10027 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10028 | |
| 10029 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 10030 | {WE_LED_FLASHING_PARAM, |
| 10031 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10032 | 0, |
| 10033 | "gpio_control"}, |
| 10034 | #endif |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 10035 | #ifdef WLAN_DEBUG |
| 10036 | {WE_SET_CHAN_AVOID, |
| 10037 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10038 | 0, |
| 10039 | "ch_avoid"}, |
| 10040 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10041 | /* handlers for main ioctl */ |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 10042 | {WLAN_PRIV_FIPS_TEST, |
| 10043 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10044 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10045 | "fips_test"}, |
| 10046 | |
| 10047 | /* handlers for main ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10048 | {WLAN_PRIV_ADD_TSPEC, |
| 10049 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
| 10050 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10051 | "addTspec"}, |
| 10052 | |
| 10053 | /* handlers for main ioctl */ |
| 10054 | {WLAN_PRIV_DEL_TSPEC, |
| 10055 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10056 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10057 | "delTspec"}, |
| 10058 | |
| 10059 | /* handlers for main ioctl */ |
| 10060 | {WLAN_PRIV_GET_TSPEC, |
| 10061 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10062 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10063 | "getTspec"}, |
| 10064 | |
| 10065 | /* handlers for main ioctl - host offload */ |
| 10066 | { |
| 10067 | WLAN_PRIV_SET_HOST_OFFLOAD, |
Srinivas Girigowda | 077143e | 2017-03-25 10:47:27 -0700 | [diff] [blame] | 10068 | IW_PRIV_TYPE_BYTE | sizeof(struct host_offload_req), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10069 | 0, |
| 10070 | "setHostOffload" |
| 10071 | } |
| 10072 | , |
| 10073 | |
| 10074 | { |
| 10075 | WLAN_GET_WLAN_STATISTICS, |
| 10076 | 0, |
| 10077 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10078 | "getWlanStats" |
| 10079 | } |
| 10080 | , |
| 10081 | |
| 10082 | { |
| 10083 | WLAN_SET_KEEPALIVE_PARAMS, |
Mahesh A Saptasagar | 72d2e4b | 2016-04-20 12:44:17 +0530 | [diff] [blame] | 10084 | IW_PRIV_TYPE_BYTE | sizeof(tSirKeepAliveReq) | |
| 10085 | IW_PRIV_SIZE_FIXED, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10086 | 0, |
| 10087 | "setKeepAlive" |
| 10088 | } |
| 10089 | , |
| 10090 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 10091 | { |
| 10092 | WLAN_SET_PACKET_FILTER_PARAMS, |
Hanumanth Reddy Pothula | b3ef416 | 2016-10-25 15:13:26 +0530 | [diff] [blame] | 10093 | IW_PRIV_TYPE_BYTE | |
| 10094 | sizeof(struct pkt_filter_cfg), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10095 | 0, |
| 10096 | "setPktFilter" |
| 10097 | } |
| 10098 | , |
| 10099 | #endif |
| 10100 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 10101 | { |
| 10102 | WLAN_SET_PNO, |
| 10103 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10104 | 0, |
| 10105 | "setpno" |
| 10106 | } |
| 10107 | , |
| 10108 | #endif |
| 10109 | { |
| 10110 | WLAN_SET_BAND_CONFIG, |
| 10111 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10112 | 0, |
| 10113 | "SETBAND" |
| 10114 | } |
| 10115 | , |
| 10116 | { |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10117 | WLAN_PRIV_SET_MCBC_FILTER, |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 10118 | 0, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10119 | 0, |
| 10120 | "setMCBCFilter" |
| 10121 | } |
| 10122 | , |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10123 | |
| 10124 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10125 | WLAN_GET_LINK_SPEED, |
| 10126 | IW_PRIV_TYPE_CHAR | 18, |
| 10127 | IW_PRIV_TYPE_CHAR | 5, "getLinkSpeed" |
| 10128 | } |
| 10129 | , |
| 10130 | |
| 10131 | /* handlers for main ioctl */ |
| 10132 | {WLAN_PRIV_SET_TWO_INT_GET_NONE, |
| 10133 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10134 | 0, |
| 10135 | ""} |
| 10136 | , |
| 10137 | {WE_SET_SMPS_PARAM, |
| 10138 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10139 | 0, "set_smps_param"} |
| 10140 | , |
| 10141 | {WLAN_SET_DOT11P_CHANNEL_SCHED, |
| 10142 | IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), |
| 10143 | 0, "set_dot11p" } |
| 10144 | , |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10145 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10146 | {WE_SET_FW_CRASH_INJECT, |
| 10147 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10148 | 0, "crash_inject"} |
| 10149 | , |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10150 | #endif |
Rachit Kankane | b103562 | 2018-01-24 18:41:35 +0530 | [diff] [blame] | 10151 | #if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY) |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 10152 | {WE_LOG_BUFFER, |
| 10153 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10154 | 0, "log_buffer"} |
| 10155 | , |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10156 | #endif |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 10157 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 10158 | {WE_SET_WLAN_SUSPEND, |
| 10159 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10160 | 0, "wlan_suspend"} |
| 10161 | , |
| 10162 | {WE_SET_WLAN_RESUME, |
| 10163 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10164 | 0, "wlan_resume"} |
| 10165 | , |
| 10166 | #endif |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10167 | {WE_ENABLE_FW_PROFILE, |
| 10168 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10169 | 0, "enableProfile"} |
| 10170 | , |
| 10171 | {WE_SET_FW_PROFILE_HIST_INTVL, |
| 10172 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10173 | 0, "set_hist_intvl"} |
| 10174 | , |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10175 | {WE_SET_DUAL_MAC_FW_MODE_CONFIG, |
| 10176 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10177 | 0, "set_fw_mode_cfg"} |
| 10178 | , |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10179 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10180 | {WE_DUMP_DP_TRACE_LEVEL, |
| 10181 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10182 | 0, "dump_dp_trace"} |
| 10183 | , |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10184 | #endif |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10185 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 10186 | {WE_SET_MON_MODE_CHAN, |
| 10187 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10188 | 0, "setMonChan"} |
| 10189 | , |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10190 | #endif |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 10191 | {WE_GET_ROAM_SYNCH_DELAY, |
| 10192 | 0, |
| 10193 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10194 | "hostroamdelay"} |
| 10195 | , |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 10196 | {WE_SET_11AX_RATE, |
| 10197 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10198 | 0, |
| 10199 | "set_11ax_rate"} |
| 10200 | , |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10201 | {WE_SET_DCM, |
| 10202 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10203 | 0, |
| 10204 | "enable_dcm"} |
| 10205 | , |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10206 | {WE_SET_RANGE_EXT, |
| 10207 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10208 | 0, |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 10209 | "range_ext"} |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10210 | , |
Naveen Rawat | c921c7b | 2017-06-13 17:29:51 -0700 | [diff] [blame] | 10211 | |
| 10212 | {WLAN_PRIV_SET_FTIES, |
| 10213 | IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, |
| 10214 | 0, |
| 10215 | "set_ft_ies"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10216 | }; |
| 10217 | |
| 10218 | const struct iw_handler_def we_handler_def = { |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10219 | .num_standard = 0, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 10220 | .num_private = QDF_ARRAY_SIZE(we_private), |
| 10221 | .num_private_args = QDF_ARRAY_SIZE(we_private_args), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10222 | |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10223 | .standard = NULL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10224 | .private = (iw_handler *) we_private, |
| 10225 | .private_args = we_private_args, |
| 10226 | .get_wireless_stats = NULL, |
| 10227 | }; |
| 10228 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10229 | void hdd_register_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10230 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10231 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10232 | |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 10233 | dev->wireless_handlers = &we_handler_def; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10234 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 10235 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10236 | } |
| 10237 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10238 | void hdd_unregister_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10239 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10240 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10241 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10242 | rtnl_lock(); |
| 10243 | dev->wireless_handlers = NULL; |
| 10244 | rtnl_unlock(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10245 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10246 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10247 | } |