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" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 69 | #include "qdf_trace.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 70 | #include "wlan_hdd_assoc.h" |
| 71 | #include "wlan_hdd_ioctl.h" |
| 72 | #include "wlan_hdd_scan.h" |
| 73 | #include "sme_power_save_api.h" |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 74 | #include "wlan_policy_mgr_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 75 | #include "wlan_hdd_conc_ut.h" |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 76 | #include "wlan_hdd_fips.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 77 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 78 | #include "wlan_hdd_ocb.h" |
| 79 | #include "wlan_hdd_napi.h" |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 80 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 81 | #include "wlan_hdd_nan_datapath.h" |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 82 | #include "wlan_hdd_stats.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 83 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 84 | #include "wlan_hdd_driver_ops.h" |
| 85 | #include "hif.h" |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 86 | #include "pld_common.h" |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 87 | #endif |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 88 | #include "wlan_hdd_lro.h" |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 89 | #include "cds_utils.h" |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 90 | #include "wlan_osif_request_manager.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 91 | #include "os_if_wifi_pos.h" |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 92 | #include <cdp_txrx_stats.h> |
| 93 | #include <cds_api.h> |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 94 | #include <wlan_osif_priv.h> |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 95 | #include "wlan_hdd_regulatory.h" |
| 96 | #include "wlan_reg_ucfg_api.h" |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 97 | #include "wlan_hdd_packet_filter_api.h" |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 98 | #include "wlan_cp_stats_mc_ucfg_api.h" |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 99 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 100 | #define HDD_FINISH_ULA_TIME_OUT 800 |
| 101 | #define HDD_SET_MCBC_FILTERS_TO_FW 1 |
| 102 | #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0 |
| 103 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 104 | /* Private ioctls and their sub-ioctls */ |
| 105 | #define WLAN_PRIV_SET_INT_GET_NONE (SIOCIWFIRSTPRIV + 0) |
| 106 | #define WE_SET_11D_STATE 1 |
| 107 | #define WE_WOWL 2 |
| 108 | #define WE_SET_POWER 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 109 | /* |
| 110 | * <ioctl> |
| 111 | * setMaxAssoc - Sets the maximum number of associated stations |
| 112 | * |
| 113 | * @INPUT: 1 to 32 |
| 114 | * |
| 115 | * @OUTPUT: None |
| 116 | * |
| 117 | * This IOTCL sets the maximum number of associated stations |
| 118 | * |
| 119 | * @E.g: iwpriv wlan0 setMaxAssoc <value> |
| 120 | * |
| 121 | * Supported Feature: STA |
| 122 | * |
| 123 | * Usage: Internal/External |
| 124 | * |
| 125 | * </ioctl> |
| 126 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 127 | #define WE_SET_MAX_ASSOC 4 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 128 | /* |
| 129 | * <ioctl> |
Jeff Johnson | f2cf659 | 2018-05-06 16:27:44 -0700 | [diff] [blame] | 130 | * scan_disable - Disable scan |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 131 | * |
| 132 | * @INPUT: set_value |
| 133 | * |
| 134 | * @OUTPUT: None |
| 135 | * |
| 136 | * This IOCTL is used to set disable scan |
| 137 | * |
| 138 | * @E.g: iwpriv wlan0 scan_disable 1 |
| 139 | * |
| 140 | * Supported Feature: Scan |
| 141 | * |
| 142 | * Usage: Internal/External |
| 143 | * |
| 144 | * </ioctl> |
| 145 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 146 | #define WE_SET_SCAN_DISABLE 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 147 | /* |
| 148 | * <ioctl> |
| 149 | * inactivityTO - sets the timeout value for inactivity data while |
| 150 | * in power save mode |
| 151 | * |
| 152 | * @INPUT: int1…..int255 |
| 153 | * |
| 154 | * @OUTPUT: None |
| 155 | * |
| 156 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 157 | * |
| 158 | * @E.g: iwpriv wlan0 inactivityTO 20 |
| 159 | * |
| 160 | * Supported Feature: STA |
| 161 | * |
| 162 | * Usage: Internal/External |
| 163 | * |
| 164 | * </ioctl> |
| 165 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 166 | #define WE_SET_DATA_INACTIVITY_TO 6 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 167 | /* |
| 168 | * <ioctl> |
| 169 | * setMaxTxPower - Dynamically sets the maximum transmission power |
| 170 | * |
| 171 | * @INPUT: Transmission power in dBm |
| 172 | * |
| 173 | * @OUTPUT: None |
| 174 | * |
| 175 | * This IOCTL dynamically sets the maximum transmission power |
| 176 | * This setting does not persist over reboots |
| 177 | * |
| 178 | * @E.g: iwpriv wlan0 setMaxTxPower <value in db) |
| 179 | * |
| 180 | * Supported Feature: STA |
| 181 | * |
| 182 | * Usage: Internal/External |
| 183 | * |
| 184 | * </ioctl> |
| 185 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 186 | #define WE_SET_MAX_TX_POWER 7 |
Jeff Johnson | fab9b25 | 2017-10-28 15:44:34 -0700 | [diff] [blame] | 187 | /* 8 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 188 | #define WE_SET_TM_LEVEL 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 189 | /* |
| 190 | * <ioctl> |
| 191 | * setphymode - Set the phymode dynamically |
| 192 | * |
| 193 | * @INPUT: 0 IEEE80211_MODE_AUTO to 22 IEEE80211_MODE_11AGN |
| 194 | * |
| 195 | * @OUTPUT: None |
| 196 | * |
| 197 | * This IOCTL sets the phymode dynamically |
| 198 | * |
| 199 | * @E.g: iwpriv wlan0 setphymode 10 |
| 200 | * |
| 201 | * Supported Feature: STA |
| 202 | * |
| 203 | * Usage: Internal/External |
| 204 | * |
| 205 | * </ioctl> |
| 206 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 207 | #define WE_SET_PHYMODE 10 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 208 | /* |
| 209 | * <ioctl> |
| 210 | * nss - Set the number of spatial streams |
| 211 | * |
| 212 | * @INPUT: int1…..int3 |
| 213 | * |
| 214 | * @OUTPUT: None |
| 215 | * |
| 216 | * This IOCTL sets the number of spatial streams. Supported values are 1 and 2 |
| 217 | * |
| 218 | * @E.g: iwpriv wlan0 nss 2 |
| 219 | * |
| 220 | * Supported Feature: STA |
| 221 | * |
| 222 | * Usage: Internal/External |
| 223 | * |
| 224 | * </ioctl> |
| 225 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 226 | #define WE_SET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 227 | /* |
| 228 | * <ioctl> |
| 229 | * ldpc - Enables or disables LDPC |
| 230 | * |
| 231 | * @INPUT: 0 – Disable, 1 - Enable |
| 232 | * |
| 233 | * @OUTPUT: None |
| 234 | * |
| 235 | * This IOCTL enables or disables LDPC |
| 236 | * |
| 237 | * @E.g: iwpriv wlan0 ldpc 1 |
| 238 | * |
| 239 | * Supported Feature: STA |
| 240 | * |
| 241 | * Usage: Internal/External |
| 242 | * |
| 243 | * </ioctl> |
| 244 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | #define WE_SET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 246 | /* |
| 247 | * <ioctl> |
| 248 | * tx_stbc - Enables or disables tx_stbc |
| 249 | * |
| 250 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 251 | * |
| 252 | * @OUTPUT: None |
| 253 | * |
| 254 | * This IOTCL used to enables or disables tx_stbc |
| 255 | * |
| 256 | * @E.g: iwpriv wlan0 tx_stbc <value> |
| 257 | * |
| 258 | * Supported Feature: STA |
| 259 | * |
| 260 | * Usage: Internal/External |
| 261 | * |
| 262 | * </ioctl> |
| 263 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 264 | #define WE_SET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 265 | /* |
| 266 | * <ioctl> |
| 267 | * rx_stbc - Set the rx_stbc parameter |
| 268 | * |
| 269 | * @INPUT: Int 0 – Disable, 1 - Enable |
| 270 | * |
| 271 | * @OUTPUT: None |
| 272 | * |
| 273 | * This IOTCL used to set rx_stbc parameter |
| 274 | * |
| 275 | * @E.g: iwpriv wlan0 rx_stbc <value> |
| 276 | * |
| 277 | * Supported Feature: STA |
| 278 | * |
| 279 | * Usage: Internal/External |
| 280 | * |
| 281 | * </ioctl> |
| 282 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | #define WE_SET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 284 | /* |
| 285 | * <ioctl> |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 286 | * shortgi - Sets the short-guard interval |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 287 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 288 | * @INPUT: Fixed Rate: 0 - 400ns, 1 - 800ns, 2 - 1600ns, 3 - 3200us |
| 289 | * Auto Rate: 8 - 400ns, 9 - 800ns, 10 - 1600ns, 11 - 3200us |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 290 | * |
| 291 | * @OUTPUT: None |
| 292 | * |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 293 | * This IOCTL sets the short-guard interval. |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 294 | * |
| 295 | * @E.g: iwpriv wlan0 shortgi <value> |
| 296 | * |
| 297 | * Supported Feature: STA |
| 298 | * |
| 299 | * Usage: Internal/External |
| 300 | * |
| 301 | * </ioctl> |
| 302 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 303 | #define WE_SET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 304 | /* |
| 305 | * <ioctl> |
| 306 | * enablertscts - enables or disables rts/cts. |
| 307 | * |
| 308 | * @INPUT: 1-Enable , 0-Disable |
| 309 | * |
| 310 | * @OUTPUT: None |
| 311 | * |
| 312 | * This IOCTL enables or disables rts/cts. |
| 313 | * |
| 314 | * @E.g: iwpriv wlan0 enablertscts <value> |
| 315 | * |
| 316 | * Supported Feature: STA |
| 317 | * |
| 318 | * Usage: Internal/External |
| 319 | * |
| 320 | * </ioctl> |
| 321 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 322 | #define WE_SET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 323 | /* |
| 324 | * <ioctl> |
| 325 | * chwidth - Set the channel bandwidth |
| 326 | * |
| 327 | * @INPUT: 0-20mhz to 3-160mhz |
| 328 | * |
| 329 | * @OUTPUT: None |
| 330 | * |
| 331 | * This IOTCL used to set the channel bandwidth |
| 332 | * |
| 333 | * @E.g: iwpriv wlan0 chwidth 1 |
| 334 | * |
| 335 | * Supported Feature: STA |
| 336 | * |
| 337 | * Usage: Internal/External |
| 338 | * |
| 339 | * </ioctl> |
| 340 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 341 | #define WE_SET_CHWIDTH 17 |
| 342 | #define WE_SET_ANI_EN_DIS 18 |
| 343 | #define WE_SET_ANI_POLL_PERIOD 19 |
| 344 | #define WE_SET_ANI_LISTEN_PERIOD 20 |
| 345 | #define WE_SET_ANI_OFDM_LEVEL 21 |
| 346 | #define WE_SET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 347 | /* |
| 348 | * <ioctl> |
| 349 | * cwmenable - Enables or disables the dynamic channel bandwidth |
| 350 | * |
| 351 | * @INPUT: 0-Disable, 1-Enable |
| 352 | * |
| 353 | * @OUTPUT: None |
| 354 | * |
| 355 | * This IOTCL used to enables or disables the dynamic channel bandwidth |
| 356 | * |
| 357 | * @E.g: iwpriv wlan0 cwmenable <value> |
| 358 | * |
| 359 | * Supported Feature: STA |
| 360 | * |
| 361 | * Usage: Internal/External |
| 362 | * |
| 363 | * </ioctl> |
| 364 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 365 | #define WE_SET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 366 | /* |
| 367 | * <ioctl> |
| 368 | * txchainmask - This IOCTL sets the current Tx chain mask |
| 369 | * |
| 370 | * @INPUT: Mask Value |
| 371 | * |
| 372 | * @OUTPUT: None |
| 373 | * |
| 374 | * This IOCTL sets the current Tx chain mask |
| 375 | * |
| 376 | * @E.g: iwpriv wlan0 txchainmask 1 |
| 377 | * |
| 378 | * Supported Feature: STA |
| 379 | * |
| 380 | * Usage: Internal/External |
| 381 | * |
| 382 | * </ioctl> |
| 383 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 384 | #define WE_SET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 385 | /* |
| 386 | * <ioctl> |
| 387 | * rxchainmask - Sets the current Rx chain mask |
| 388 | * |
| 389 | * @INPUT: Mask Value |
| 390 | * |
| 391 | * @OUTPUT: None |
| 392 | * |
| 393 | * This IOCTL sets the current Rx chain mask. This command is the |
| 394 | * equivalent to setting in gSetRxChainmask1x1 in WCNSS_qcom_cfg.ini. |
| 395 | * |
| 396 | * @E.g: iwpriv wlan0 rxchainmask <value> |
| 397 | * |
| 398 | * Supported Feature: STA |
| 399 | * |
| 400 | * Usage: Internal/External |
| 401 | * |
| 402 | * </ioctl> |
| 403 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 404 | #define WE_SET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 405 | /* |
| 406 | * <ioctl> |
| 407 | * set11NRates - Fixes the Tx data rate of the 11N mode. |
| 408 | * |
| 409 | * @INPUT: 0x1b to 0x8f |
| 410 | * |
| 411 | * @OUTPUT: None |
| 412 | * |
| 413 | * This IOCTL fixes the Tx data rate of the 11N mode. |
| 414 | * |
| 415 | * @E.g: iwpriv wlan0 set11NRates 0x85 |
| 416 | * |
| 417 | * Supported Feature: STA |
| 418 | * |
| 419 | * Usage: Internal/External |
| 420 | * |
| 421 | * </ioctl> |
| 422 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | #define WE_SET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 424 | /* |
| 425 | * <ioctl> |
| 426 | * ampdu - Set the the maximum subframe of ampdu |
| 427 | * |
| 428 | * @INPUT: int 1 to int 63 |
| 429 | * |
| 430 | * @OUTPUT: None |
| 431 | * |
| 432 | * This IOCTL sets the maximum subframe of ampdu. |
| 433 | * |
| 434 | * @E.g: iwpriv wlan0 ampdu 9 |
| 435 | * |
| 436 | * Supported Feature: STA |
| 437 | * |
| 438 | * Usage: Internal/External |
| 439 | * |
| 440 | * </ioctl> |
| 441 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 442 | #define WE_SET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 443 | /* |
| 444 | * <ioctl> |
| 445 | * amsdu - Sets the maximum subframe of amsdu. |
| 446 | * |
| 447 | * @INPUT: int 1 to int 31 |
| 448 | * |
| 449 | * @OUTPUT: None |
| 450 | * |
| 451 | * This IOCTL sets the maximum subframe of amsdu. |
| 452 | * |
| 453 | * @E.g: iwpriv wlan0 amsdu 9 |
| 454 | * |
| 455 | * Supported Feature: STA |
| 456 | * |
| 457 | * Usage: Internal/External |
| 458 | * |
| 459 | * </ioctl> |
| 460 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 461 | #define WE_SET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 462 | /* |
| 463 | * <ioctl> |
| 464 | * txpow2g - current 2 GHz Tx power setting |
| 465 | * |
| 466 | * @INPUT: Tx power in dBm |
| 467 | * |
| 468 | * @OUTPUT: None |
| 469 | * |
| 470 | * This IOTCL used to set 2 ghz tx power |
| 471 | * |
| 472 | * @E.g: iwpriv wlan0 txpow2g |
| 473 | * |
| 474 | * Supported Feature: STA |
| 475 | * |
| 476 | * Usage: Internal/External |
| 477 | * |
| 478 | * </ioctl> |
| 479 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 480 | #define WE_SET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 481 | /* |
| 482 | * <ioctl> |
| 483 | * txpow5g - Current 5 GHz tx power setting |
| 484 | * |
| 485 | * @INPUT: Tx power in dBm |
| 486 | * |
| 487 | * @OUTPUT: None |
| 488 | * |
| 489 | * This IOTCL used to set the 5 ghz txpower |
| 490 | * |
| 491 | * @E.g: iwpriv wlan0 txpow5g |
| 492 | * |
| 493 | * Supported Feature: STA |
| 494 | * |
| 495 | * Usage: Internal/External |
| 496 | * |
| 497 | * </ioctl> |
| 498 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 499 | #define WE_SET_TXPOW_5G 30 |
| 500 | /* Private ioctl for firmware debug log */ |
| 501 | #define WE_DBGLOG_LOG_LEVEL 31 |
| 502 | #define WE_DBGLOG_VAP_ENABLE 32 |
| 503 | #define WE_DBGLOG_VAP_DISABLE 33 |
| 504 | #define WE_DBGLOG_MODULE_ENABLE 34 |
| 505 | #define WE_DBGLOG_MODULE_DISABLE 35 |
| 506 | #define WE_DBGLOG_MOD_LOG_LEVEL 36 |
| 507 | #define WE_DBGLOG_TYPE 37 |
| 508 | #define WE_SET_TXRX_FWSTATS 38 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 509 | /* |
| 510 | * <ioctl> |
| 511 | * set11ACRates - Fixes the Tx data rate of 11AC |
| 512 | * |
| 513 | * @INPUT: 0x1 to 0x9 |
| 514 | * |
| 515 | * @OUTPUT: None |
| 516 | * |
| 517 | * This IOCTL fixes the Tx data rate of 11AC. |
| 518 | * |
| 519 | * @E.g: iwpriv wlan0 set11ACRates 0x9 |
| 520 | * |
| 521 | * Supported Feature: STA |
| 522 | * |
| 523 | * Usage: Internal/External |
| 524 | * |
| 525 | * </ioctl> |
| 526 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 527 | #define WE_SET_VHT_RATE 39 |
| 528 | #define WE_DBGLOG_REPORT_ENABLE 40 |
| 529 | #define WE_TXRX_FWSTATS_RESET 41 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 530 | /* |
| 531 | * <ioctl> |
| 532 | * setTxMaxPower2G - Set the maximum transmit power for the 2.4-GHz band |
| 533 | * |
| 534 | * @INPUT: Transmission power in dBm |
| 535 | * |
| 536 | * @OUTPUT: None |
| 537 | * |
| 538 | * This IOCTL sets the maximum transmit power for the 2.4-GHz band |
| 539 | * This setting does not persist over reboots |
| 540 | * |
| 541 | * @E.g: iwpriv wlan0 setTxMaxPower2G 10 |
| 542 | * |
| 543 | * Supported Feature: STA |
| 544 | * |
| 545 | * Usage: Internal/External |
| 546 | * |
| 547 | * </ioctl> |
| 548 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 549 | #define WE_SET_MAX_TX_POWER_2_4 42 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 550 | /* |
| 551 | * <ioctl> |
| 552 | * setTxMaxPower5G - Set the maximum transmit power for the 5-GHz band |
| 553 | * |
| 554 | * @INPUT: Transmission power in dBm |
| 555 | * |
| 556 | * @OUTPUT: None |
| 557 | * |
| 558 | * This IOCTL sets the maximum transmit power for the 5-GHz band |
| 559 | * This setting does not persist over reboots |
| 560 | * |
| 561 | * @E.g: iwpriv wlan0 setTxMaxPower5G 10 |
| 562 | * |
| 563 | * Supported Feature: STA |
| 564 | * |
| 565 | * Usage: Internal/External |
| 566 | * |
| 567 | * </ioctl> |
| 568 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 569 | #define WE_SET_MAX_TX_POWER_5_0 43 |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 570 | #define WE_SET_PKTLOG 44 |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 571 | /* Private ioctl for packet power save */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 572 | #define WE_PPS_PAID_MATCH 45 |
| 573 | #define WE_PPS_GID_MATCH 46 |
| 574 | #define WE_PPS_EARLY_TIM_CLEAR 47 |
| 575 | #define WE_PPS_EARLY_DTIM_CLEAR 48 |
| 576 | #define WE_PPS_EOF_PAD_DELIM 49 |
| 577 | #define WE_PPS_MACADDR_MISMATCH 50 |
| 578 | #define WE_PPS_DELIM_CRC_FAIL 51 |
| 579 | #define WE_PPS_GID_NSTS_ZERO 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 580 | /* |
| 581 | * <ioctl> |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 582 | * rssi_chk - Check the rssi |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 583 | * |
| 584 | * @INPUT: One argument as input |
| 585 | * |
| 586 | * @OUTPUT: rssi |
| 587 | * wlan0 rssi_chk:56 |
| 588 | * |
| 589 | * This IOTCL used to chek rssi |
| 590 | * |
| 591 | * @E.g: iwpriv wlan0 rssi_chk <value> |
| 592 | * |
| 593 | * Supported Feature: STA |
| 594 | * |
| 595 | * Usage: Internal/External |
| 596 | * |
| 597 | * </ioctl> |
| 598 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 599 | #define WE_PPS_RSSI_CHECK 53 |
Agrawal Ashish | bafaff1 | 2016-12-27 17:43:08 +0530 | [diff] [blame] | 600 | /* |
| 601 | * <ioctl> |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 602 | * htsmps - Sets the htsmps |
| 603 | * |
| 604 | * @INPUT: Atleast one int argument |
| 605 | * |
| 606 | * @OUTPUT: None |
| 607 | * |
| 608 | * This IOTCL used to set htsmps |
| 609 | * |
| 610 | * @E.g: iwpriv wlan0 htsmps <value> |
| 611 | * |
| 612 | * Supported Feature: STA |
| 613 | * |
| 614 | * Usage: Internal/External |
| 615 | * |
| 616 | * </ioctl> |
| 617 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 618 | #define WE_SET_HTSMPS 55 |
| 619 | /* Private ioctl for QPower */ |
| 620 | #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 |
| 621 | #define WE_SET_QPOWER_MAX_TX_BEFORE_WAKE 57 |
| 622 | #define WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 58 |
| 623 | #define WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 624 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 625 | /* |
| 626 | * <ioctl> |
| 627 | * gtxHTMcs - Set the tx HTM value |
| 628 | * |
| 629 | * @INPUT: Atleast one int orgument |
| 630 | * |
| 631 | * @OUTPUT: None |
| 632 | * |
| 633 | * This IOTCL sets htm tx value |
| 634 | * |
| 635 | * @E.g: iwpriv wlan0 gtxHTMcs <value> |
| 636 | * |
| 637 | * Supported Feature: STA |
| 638 | * |
| 639 | * Usage: Internal/External |
| 640 | * |
| 641 | * </ioctl> |
| 642 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 643 | #define WE_SET_GTX_HT_MCS 62 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 644 | /* |
| 645 | * <ioctl> |
| 646 | * gtxVHTMcs - Set gtxVHTMcs value |
| 647 | * |
| 648 | * @INPUT: Atleast one int argument |
| 649 | * |
| 650 | * @OUTPUT: None |
| 651 | * |
| 652 | * This IOTCL used to set gtxVHTMcs value |
| 653 | * |
| 654 | * @E.g: iwpriv wlan0 gtxVHTMcs <value> |
| 655 | * |
| 656 | * Supported Feature: STA |
| 657 | * |
| 658 | * Usage: Internal/External |
| 659 | * |
| 660 | * </ioctl> |
| 661 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 662 | #define WE_SET_GTX_VHT_MCS 63 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 663 | /* |
| 664 | * <ioctl> |
| 665 | * gtxUsrCfg - Host request for GTX mask |
| 666 | * |
| 667 | * @INPUT: Atleast one int orgument |
| 668 | * |
| 669 | * @OUTPUT: None |
| 670 | * |
| 671 | * This IOTCL used send the host request for GTX mask |
| 672 | * |
| 673 | * @E.g: iwpriv wlan0 gtxUsrCfg <value> |
| 674 | * |
| 675 | * Supported Feature: STA |
| 676 | * |
| 677 | * Usage: Internal/External |
| 678 | * |
| 679 | * </ioctl> |
| 680 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 681 | #define WE_SET_GTX_USRCFG 64 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 682 | /* |
| 683 | * <ioctl> |
| 684 | * gtxThre - Set the tx threshold |
| 685 | * |
| 686 | * @INPUT: Atleast one int argument |
| 687 | * |
| 688 | * @OUTPUT: None |
| 689 | * |
| 690 | * This IOTCL used to set tx threshold |
| 691 | * |
| 692 | * @E.g: iwpriv wlan0 gtxThre <value> |
| 693 | * |
| 694 | * Supported Feature: STA |
| 695 | * |
| 696 | * Usage: Internal/External |
| 697 | * |
| 698 | * </ioctl> |
| 699 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 700 | #define WE_SET_GTX_THRE 65 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 701 | /* |
| 702 | * <ioctl> |
| 703 | * gtxMargin - Set the gtxMargin |
| 704 | * |
| 705 | * @INPUT: 1 to 32 |
| 706 | * |
| 707 | * @OUTPUT: None |
| 708 | * |
| 709 | * This IOTCL use dto set gtxMargin |
| 710 | * |
| 711 | * @E.g: iwpriv wlan0 gtxMargini <value> |
| 712 | * |
| 713 | * Supported Feature: STA |
| 714 | * |
| 715 | * Usage: Internal/External |
| 716 | * |
| 717 | * </ioctl> |
| 718 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 719 | #define WE_SET_GTX_MARGIN 66 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 720 | /* |
| 721 | * <ioctl> |
| 722 | * gtxStep - Set the gtxStep |
| 723 | * |
| 724 | * @INPUT: None |
| 725 | * |
| 726 | * @OUTPUT: None |
| 727 | * |
| 728 | * This IOTCL used to sets gtxStep |
| 729 | * |
| 730 | * @E.g: iwpriv wlan0 gtxStep <value> |
| 731 | * |
| 732 | * Supported Feature: STA |
| 733 | * |
| 734 | * Usage: Internal/External |
| 735 | * |
| 736 | * </ioctl> |
| 737 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 738 | #define WE_SET_GTX_STEP 67 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 739 | /* |
| 740 | * <ioctl> |
| 741 | * gtxMinTpc - Sets the gtxMinTpc |
| 742 | * |
| 743 | * @INPUT: Atleast one int argument |
| 744 | * |
| 745 | * @OUTPUT: None |
| 746 | * |
| 747 | * This IOTCL sets the tx MinTpc |
| 748 | * |
| 749 | * @E.g: iwpriv wlan0 gtxMinTpc <value> |
| 750 | * |
| 751 | * Supported Feature: STA |
| 752 | * |
| 753 | * Usage: Internal/External |
| 754 | * |
| 755 | * </ioctl> |
| 756 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 757 | #define WE_SET_GTX_MINTPC 68 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 758 | /* |
| 759 | * <ioctl> |
| 760 | * gtxBWMask - Sets the BW mask (20/40/80/160 Mhz) |
| 761 | * |
| 762 | * @INPUT: Mask value |
| 763 | * |
| 764 | * @OUTPUT: None |
| 765 | * |
| 766 | * This IOTCL used to set gtxBWMask |
| 767 | * |
| 768 | * @E.g: iwpriv wlan0 gtxBWMask <value> |
| 769 | * |
| 770 | * Supported Feature: STA |
| 771 | * |
| 772 | * Usage: Internal/External |
| 773 | * |
| 774 | * </ioctl> |
| 775 | */ |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 776 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 777 | #define WE_SET_GTX_BWMASK 69 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 778 | /* |
| 779 | * <ioctl> |
| 780 | * setMccLatency - Sets the MCC latency value during STA-P2P concurrency |
| 781 | * |
| 782 | * @INPUT: set_value |
| 783 | * |
| 784 | * @OUTPUT: None |
| 785 | * |
| 786 | * This IOCTL is used to set the MCC latency value in milliseconds |
| 787 | * during STA-P2P concurrency. |
| 788 | * |
| 789 | * If 0ms latency is provided, then FW will set to a default. |
| 790 | * Otherwise, latency must be at least 30ms. |
| 791 | * |
| 792 | * @E.g: iwpriv wlan0 setMccLatency 40 |
| 793 | * |
| 794 | * |
| 795 | * Supported Feature: Concurrency |
| 796 | * |
| 797 | * Usage: Internal/External |
| 798 | * |
| 799 | * </ioctl> |
| 800 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 801 | #define WE_MCC_CONFIG_LATENCY 70 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 802 | |
| 803 | /* |
| 804 | * <ioctl> |
| 805 | * setMccQuota- Set the quota for P2P cases |
| 806 | * |
| 807 | * @INPUT: set_value [0,100] |
| 808 | * |
| 809 | * @OUTPUT: None |
| 810 | * |
| 811 | * This IOCTL is used to set the quota in milliseconds for P2P_GO/STA. |
| 812 | * |
| 813 | * Currently used to set time quota for 2 MCC vdevs/adapters using |
| 814 | * (operating channel, quota) for each mode. |
| 815 | * The info is provided run time using iwpriv command: |
| 816 | * iwpriv <wlan0 | p2p0> setMccQuota <quota in ms>. |
| 817 | * Note: the quota provided in command is for the same mode in cmd. |
| 818 | * HDD checks if MCC mode is active, gets the second mode and its |
| 819 | * operating chan. |
| 820 | * Quota for the 2nd role is calculated as 100 - quota of first mode. |
| 821 | * |
| 822 | * @E.g: iwpriv wlan0 setMccQuota 50 |
| 823 | * iwpriv p2p0 setMccQuota 50 |
| 824 | * |
| 825 | * Supported Feature: Concurrency |
| 826 | * |
| 827 | * Usage: Internal/External |
| 828 | * |
| 829 | * </ioctl> |
| 830 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 831 | #define WE_MCC_CONFIG_QUOTA 71 |
| 832 | /* Private IOCTL for debug connection issues */ |
| 833 | #define WE_SET_DEBUG_LOG 72 |
| 834 | #ifdef WE_SET_TX_POWER |
| 835 | #undef WE_SET_TX_POWER |
| 836 | #endif |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 837 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 838 | /* |
| 839 | * <ioctl> |
| 840 | * setTxPower - Set the current transmit power |
| 841 | * |
| 842 | * @INPUT: Transmission power in dBm |
| 843 | * |
| 844 | * @OUTPUT: None |
| 845 | * |
| 846 | * This IOCTL sets the current transmit power. |
| 847 | * This setting does not persist over reboots. |
| 848 | * |
| 849 | * @E.g: iwpriv wlan0 setTxPower 10 |
| 850 | * |
| 851 | * Supported Feature: STA |
| 852 | * |
| 853 | * Usage: Internal/External |
| 854 | * |
| 855 | * </ioctl> |
| 856 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 857 | #define WE_SET_TX_POWER 74 |
| 858 | /* Private ioctl for earlyrx power save feature */ |
| 859 | #define WE_SET_EARLY_RX_ADJUST_ENABLE 75 |
| 860 | #define WE_SET_EARLY_RX_TGT_BMISS_NUM 76 |
| 861 | #define WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE 77 |
| 862 | #define WE_SET_EARLY_RX_SLOP_STEP 78 |
| 863 | #define WE_SET_EARLY_RX_INIT_SLOP 79 |
| 864 | #define WE_SET_EARLY_RX_ADJUST_PAUSE 80 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 865 | /* |
| 866 | * <ioctl> |
| 867 | * setMcRate - Set the data rate for multicast data |
| 868 | * |
| 869 | * @INPUT: 1 to 32 |
| 870 | * |
| 871 | * @OUTPUT: None |
| 872 | * |
| 873 | * This IOCTL sets the data rate for multicast data. Note that this command |
| 874 | * is allowed only in STA, IBSS, or QCMobileAP mode |
| 875 | * |
| 876 | * @E.g: iwpriv wlan0 setMcRate <value> |
| 877 | * |
| 878 | * Supported Feature: STA |
| 879 | * |
| 880 | * Usage: Internal/External |
| 881 | * |
| 882 | * </ioctl> |
| 883 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 884 | #define WE_SET_MC_RATE 81 |
| 885 | #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 |
| 886 | /* Private ioctl for packet power save */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 887 | /* |
| 888 | * <ioctl> |
| 889 | * 5g_ebt - Sets the 5g_ebt |
| 890 | * |
| 891 | * @INPUT: <value> |
| 892 | * |
| 893 | * @OUTPUT: None |
| 894 | * |
| 895 | * This IOTCL used to set 5g_ebt |
| 896 | * |
| 897 | * @E.g: iwpriv wlan0 5g_ebt <value> |
| 898 | * |
| 899 | * Supported Feature: STA |
| 900 | * |
| 901 | * Usage: Internal/External |
| 902 | * |
| 903 | * </ioctl> |
| 904 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 905 | #define WE_PPS_5G_EBT 83 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 906 | /* |
| 907 | * <ioctl> |
| 908 | * cts_cbw - Set CTS channel BW for dynamic BW adjustment |
| 909 | * |
| 910 | * @INPUT: 20 t0 160 |
| 911 | * |
| 912 | * @OUTPUT: None |
| 913 | * |
| 914 | * This IOTCL used to set CTS channel BW for dynamic BW adjustment |
| 915 | * |
| 916 | * @E.g: iwpriv wlan0 cts_cbw <value> |
| 917 | * |
| 918 | * Supported Feature: STA |
| 919 | * |
| 920 | * Usage: Internal/External |
| 921 | * |
| 922 | * </ioctl> |
| 923 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | #define WE_SET_CTS_CBW 84 |
| 925 | #define WE_DUMP_STATS 85 |
| 926 | #define WE_CLEAR_STATS 86 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 927 | /* Private sub ioctl for starting/stopping the profiling */ |
| 928 | #define WE_START_FW_PROFILE 87 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 929 | |
Abhishek Singh | 3c50701 | 2016-12-01 11:15:42 +0530 | [diff] [blame] | 930 | /* |
| 931 | * <ioctl> |
| 932 | * setChanChange - Initiate channel change |
| 933 | * |
| 934 | * @INPUT: channel number to switch to. |
| 935 | * |
| 936 | * @OUTPUT: None |
| 937 | * |
| 938 | * This IOCTL is used to initiate a channel change. |
| 939 | * If called on STA/CLI interface it will send the |
| 940 | * ECSA action frame to the connected SAP/GO asking to |
| 941 | * initiate the ECSA, if supported. |
| 942 | * If called on SAP/GO interface it will initiate |
| 943 | * ECSA and ask connected peers to move to new channel. |
| 944 | * |
| 945 | * @E.g: iwpriv wlan0 setChanChange <channel> |
| 946 | * iwpriv wlan0 setChanChange 1 |
| 947 | * |
| 948 | * Supported Feature: ECSA |
| 949 | * |
| 950 | * Usage: Internal/External |
| 951 | * |
| 952 | * </ioctl> |
| 953 | */ |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 954 | #define WE_SET_CHANNEL 88 |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 955 | #define WE_SET_CONC_SYSTEM_PREF 89 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 956 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 957 | /* |
| 958 | * <ioctl> |
| 959 | * set_11ax_rate - set 11ax rates to FW |
| 960 | * |
| 961 | * @INPUT: rate code |
| 962 | * |
| 963 | * @OUTPUT: None |
| 964 | * |
| 965 | * This IOCTL fixes the Tx data rate of 11AX. |
| 966 | * |
| 967 | * @E.g: iwpriv wlan0 set_11ax_rate <rate code> |
| 968 | * |
| 969 | * Supported Feature: STA/SAP |
| 970 | * |
| 971 | * Usage: Internal |
| 972 | * |
| 973 | * </ioctl> |
| 974 | */ |
| 975 | #define WE_SET_11AX_RATE 91 |
| 976 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 977 | /* |
| 978 | * <ioctl> |
| 979 | * enable_dcm - enable Dual Carrier Modulation(DCM) |
| 980 | * |
| 981 | * @INPUT: 0/1 |
| 982 | * |
| 983 | * @OUTPUT: None |
| 984 | * |
| 985 | * This IOCTL enables/disables DCM. |
| 986 | * |
| 987 | * @E.g: iwpriv wlan0 enable_dcm <0/1> |
| 988 | * |
| 989 | * Supported Feature: STA/SAP |
| 990 | * |
| 991 | * Usage: Internal |
| 992 | * |
| 993 | * </ioctl> |
| 994 | */ |
| 995 | #define WE_SET_DCM 92 |
| 996 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 997 | /* |
| 998 | * <ioctl> |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 999 | * range_ext - enable Range extension |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1000 | * |
| 1001 | * @INPUT: 0/1 |
| 1002 | * |
| 1003 | * @OUTPUT: None |
| 1004 | * |
| 1005 | * This IOCTL enables/disables Range extension. |
| 1006 | * |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 1007 | * @E.g: iwpriv wlan0 range_ext <1/0> |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1008 | * |
| 1009 | * Supported Feature: STA/SAP |
| 1010 | * |
| 1011 | * Usage: Internal |
| 1012 | * |
| 1013 | * </ioctl> |
| 1014 | */ |
| 1015 | #define WE_SET_RANGE_EXT 93 |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1016 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1017 | /* |
| 1018 | * <ioctl> |
| 1019 | * wow_ito - sets the timeout value for inactivity data while |
| 1020 | * in power save mode during wow |
| 1021 | * |
| 1022 | * @INPUT: int |
| 1023 | * |
| 1024 | * @OUTPUT: None |
| 1025 | * |
| 1026 | * This IOCTL set the timeout value for inactivity data in power save mode |
| 1027 | * |
| 1028 | * @E.g: iwpriv wlan0 wow_ito 20 |
| 1029 | * |
| 1030 | * Supported Feature: STA |
| 1031 | * |
| 1032 | * Usage: External |
| 1033 | * |
| 1034 | * </ioctl> |
Jeff Johnson | dcf84ce | 2017-10-05 09:26:24 -0700 | [diff] [blame] | 1035 | */ |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1036 | #define WE_SET_WOW_DATA_INACTIVITY_TO 94 |
| 1037 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 1038 | /* |
| 1039 | * <ioctl> |
| 1040 | * pdev_reset - reset the pdev |
| 1041 | * |
| 1042 | * @INPUT: Reset command to initiate: |
| 1043 | * TX_FLUSH = 1 |
| 1044 | * WARM_RESET = 2 |
| 1045 | * COLD_RESET = 3 |
| 1046 | * WARM_RESET_RESTORE_CAL = 4 |
| 1047 | * COLD_RESET_RESTORE_CAL = 5 |
| 1048 | * |
| 1049 | * @OUTPUT: None |
| 1050 | * |
| 1051 | * This IOCTL is used to reset the pdev. The primary use is |
| 1052 | * for internal testing. It is not expected that this will |
| 1053 | * be used on a production device. |
| 1054 | * |
| 1055 | * @E.g: iwpriv wlan0 pdev_reset <command> |
| 1056 | * iwpriv wlan0 pdev_reset 1 |
| 1057 | * |
| 1058 | * Supported Feature: None |
| 1059 | * |
| 1060 | * Usage: Internal |
| 1061 | * |
| 1062 | * </ioctl> |
| 1063 | */ |
| 1064 | #define WE_SET_PDEV_RESET 95 |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 1065 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 1066 | /* |
| 1067 | * setModDTIM - Change Modulated DTIM |
| 1068 | * |
| 1069 | * @INPUT: set_value. |
| 1070 | * |
| 1071 | * @OUTPUT: None |
| 1072 | * |
| 1073 | * This IOCTL is used to change modulated DTIM |
| 1074 | * value without WIFI OFF/ON. |
| 1075 | * |
| 1076 | * @E.g: iwpriv wlan0 setModDTIM <value> |
| 1077 | * iwpriv wlan0 setModDTIM 2 |
| 1078 | * |
| 1079 | * Supported Feature: N/A |
| 1080 | * |
| 1081 | * Usage: Internal/External |
| 1082 | * |
| 1083 | * </ioctl> |
| 1084 | */ |
| 1085 | #define WE_SET_MODULATED_DTIM 96 |
| 1086 | |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 1087 | /* |
| 1088 | * <ioctl> |
| 1089 | * set_ppdu_dur - Sets the global ppdu duration |
| 1090 | * |
| 1091 | * @INPUT: Atleast one int argument |
| 1092 | * |
| 1093 | * @OUTPUT: None |
| 1094 | * |
| 1095 | * This IOTCL used to set global ppdu duration |
| 1096 | * |
| 1097 | * @E.g: iwpriv wlan0 set_ppdu_dur <value> |
| 1098 | * Valid values are 1 to 4000 |
| 1099 | * |
| 1100 | * Supported Feature: STA/SAP |
| 1101 | * |
| 1102 | * Usage: Internal |
| 1103 | * |
| 1104 | * </ioctl> |
| 1105 | */ |
| 1106 | #define WE_SET_PPDU_DUR 97 |
| 1107 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1108 | /* Private ioctls and their sub-ioctls */ |
| 1109 | #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) |
| 1110 | #define WE_GET_11D_STATE 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1111 | #define WE_GET_WLAN_DBG 4 |
| 1112 | #define WE_GET_MAX_ASSOC 6 |
| 1113 | /* 7 is unused */ |
| 1114 | #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 |
Nitesh Shah | c87a7a8 | 2016-12-14 11:37:55 +0530 | [diff] [blame] | 1115 | |
| 1116 | /* |
| 1117 | * <ioctl> |
| 1118 | * getconcurrency - Get concurrency mode |
| 1119 | * |
| 1120 | * @INPUT: None |
| 1121 | * |
| 1122 | * @OUTPUT: It shows concurrency value |
| 1123 | * Bit 0:STA 1:SAP 2:P2P_Client 3:P2P_GO |
| 1124 | * 4:FTM 5:IBSS 6:Monitor 7:P2P_Device |
| 1125 | * 8:OCB 9:EPPING 10:QVIT 11:NDI |
| 1126 | * |
| 1127 | * This IOCTL is used to retrieve concurrency mode. |
| 1128 | * |
| 1129 | * @E.g: iwpriv wlan0 getconcurrency |
| 1130 | * wlan0 getconcurrency:5 |
| 1131 | * Above value shows STA+P2P_Client |
| 1132 | * |
| 1133 | * Supported Feature: Concurrency |
| 1134 | * |
| 1135 | * Usage: Internal/External |
| 1136 | * |
| 1137 | * </ioctl> |
| 1138 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1139 | #define WE_GET_CONCURRENCY_MODE 9 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1140 | /* |
| 1141 | * <ioctl> |
| 1142 | * get_nss - Get the number of spatial STBC streams (NSS) |
| 1143 | * |
| 1144 | * @INPUT: None |
| 1145 | * |
| 1146 | * @OUTPUT: NSS |
| 1147 | * wlan0 get_nss:2 |
| 1148 | * |
| 1149 | * This IOTCL used to get the number of spatial STBC streams |
| 1150 | * |
| 1151 | * @E.g: iwpriv wlan0 get_nss |
| 1152 | * |
| 1153 | * Supported Feature: STA |
| 1154 | * |
| 1155 | * Usage: Internal/External |
| 1156 | * |
| 1157 | * </ioctl> |
| 1158 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | #define WE_GET_NSS 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1160 | /* |
| 1161 | * <ioctl> |
| 1162 | * get_ldpc - This IOCTL gets the low density parity check (LDPC) |
| 1163 | * |
| 1164 | * @INPUT: None |
| 1165 | * |
| 1166 | * @OUTPUT: ldpc |
| 1167 | * wlan0 get_ldpc:1 |
| 1168 | * |
| 1169 | * This IOTCL used to gets the low density parity check (LDPC) |
| 1170 | * |
| 1171 | * @E.g: iwpriv wlan0 get_ldpc |
| 1172 | * |
| 1173 | * Supported Feature: STA |
| 1174 | * |
| 1175 | * Usage: Internal/External |
| 1176 | * |
| 1177 | * </ioctl> |
| 1178 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1179 | #define WE_GET_LDPC 12 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1180 | /* |
| 1181 | * <ioctl> |
| 1182 | * get_tx_stbc - Get the value of the current Tx space time block code (STBC) |
| 1183 | * |
| 1184 | * @INPUT: None |
| 1185 | * |
| 1186 | * @OUTPUT: TXSTBC |
| 1187 | * wlan0 get_tx_stbc:1 |
| 1188 | * |
| 1189 | * This IOTCL get the value of the current Tx space time block code (STBC) |
| 1190 | * |
| 1191 | * @E.g: iwpriv wlan0 get_tx_stbc |
| 1192 | * |
| 1193 | * Supported Feature: STA |
| 1194 | * |
| 1195 | * Usage: Internal/External |
| 1196 | * |
| 1197 | * </ioctl> |
| 1198 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1199 | #define WE_GET_TX_STBC 13 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1200 | /* |
| 1201 | * <ioctl> |
| 1202 | * get_rx_stbc - Gets the value of the current Rx STBC |
| 1203 | * |
| 1204 | * @INPUT: None |
| 1205 | * |
| 1206 | * @OUTPUT: Rx STBC |
| 1207 | * wlan0 get_rx_stbc:1 |
| 1208 | * |
| 1209 | * This IOTCL used to get the value of the current Rx STBC |
| 1210 | * |
| 1211 | * @E.g: iwpriv wlan0 get_rx_stbc |
| 1212 | * |
| 1213 | * Supported Feature: STA |
| 1214 | * |
| 1215 | * Usage: Internal/External |
| 1216 | * |
| 1217 | * </ioctl> |
| 1218 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1219 | #define WE_GET_RX_STBC 14 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1220 | /* |
| 1221 | * <ioctl> |
| 1222 | * get_shortgi - Get the value of the current short GI setting |
| 1223 | * |
| 1224 | * @INPUT: None |
| 1225 | * |
| 1226 | * @OUTPUT: Enable/disable of shortgi |
| 1227 | * wlan0 get_shortgi:1 |
| 1228 | * |
| 1229 | * This IOCTL gets the value of the current short GI setting |
| 1230 | * |
| 1231 | * @E.g: iwpriv wlan0 get_shortgi |
| 1232 | * |
| 1233 | * Supported Feature: STA |
| 1234 | * |
| 1235 | * Usage: Internal/External |
| 1236 | * |
| 1237 | * </ioctl> |
| 1238 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1239 | #define WE_GET_SHORT_GI 15 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1240 | /* |
| 1241 | * <ioctl> |
| 1242 | * get_rtscts - Get the value of the current RTS/CTS setting. |
| 1243 | * |
| 1244 | * @INPUT: None |
| 1245 | * |
| 1246 | * @OUTPUT: Enable/disable of RTS/CTS |
| 1247 | * wlan0 get_rtscts:33 |
| 1248 | * |
| 1249 | * This IOTCL get the value of the current RTS/CTS setting. |
| 1250 | * |
| 1251 | * @E.g: iwpriv wlan0 get_rtscts |
| 1252 | * |
| 1253 | * Supported Feature: STA |
| 1254 | * |
| 1255 | * Usage: Internal/External |
| 1256 | * |
| 1257 | * </ioctl> |
| 1258 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1259 | #define WE_GET_RTSCTS 16 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1260 | /* |
| 1261 | * <ioctl> |
| 1262 | * get_chwidth - Get the current channel width setting |
| 1263 | * |
| 1264 | * @INPUT: None |
| 1265 | * |
| 1266 | * @OUTPUT: channel width |
| 1267 | * wlan0 get_chwidth:0 |
| 1268 | * |
| 1269 | * This IOTCL get the current channel width setting. |
| 1270 | * |
| 1271 | * @E.g: iwpriv wlan0 get_chwidth |
| 1272 | * |
| 1273 | * Supported Feature: STA |
| 1274 | * |
| 1275 | * Usage: Internal/External |
| 1276 | * |
| 1277 | * </ioctl> |
| 1278 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1279 | #define WE_GET_CHWIDTH 17 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1280 | /* |
| 1281 | * <ioctl> |
| 1282 | * get_anienable - Get the anienable |
| 1283 | * |
| 1284 | * @INPUT: None |
| 1285 | * |
| 1286 | * @OUTPUT: |
| 1287 | * wlan0 get_anienable:0 |
| 1288 | * |
| 1289 | * This IOTCL get the anienable |
| 1290 | * |
| 1291 | * @E.g: iwpriv wlan0 get_anienable |
| 1292 | * |
| 1293 | * Supported Feature: STA |
| 1294 | * |
| 1295 | * Usage: Internal/External |
| 1296 | * |
| 1297 | * </ioctl> |
| 1298 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1299 | #define WE_GET_ANI_EN_DIS 18 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1300 | /* |
| 1301 | * <ioctl> |
| 1302 | * get_aniplen - Get the aniplen |
| 1303 | * |
| 1304 | * @INPUT: None |
| 1305 | * |
| 1306 | * @OUTPUT: |
| 1307 | * wlan0 get_aniplen:0 |
| 1308 | * |
| 1309 | * This IOTCL get the aniplen |
| 1310 | * |
| 1311 | * @E.g: iwpriv wlan0 get_aniplen |
| 1312 | * |
| 1313 | * Supported Feature: STA |
| 1314 | * |
| 1315 | * Usage: Internal/External |
| 1316 | * |
| 1317 | * </ioctl> |
| 1318 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1319 | #define WE_GET_ANI_POLL_PERIOD 19 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1320 | /* |
| 1321 | * <ioctl> |
| 1322 | * get_anilislen- Get the anilislen |
| 1323 | * |
| 1324 | * @INPUT: None |
| 1325 | * |
| 1326 | * @OUTPUT: |
| 1327 | * wlan0 get_anilislen:0 |
| 1328 | * |
| 1329 | * This IOTCL used to get anilislen |
| 1330 | * |
| 1331 | * @E.g: iwpriv wlan0 get_anilislen |
| 1332 | * |
| 1333 | * Supported Feature: STA |
| 1334 | * |
| 1335 | * Usage: Internal/External |
| 1336 | * |
| 1337 | * </ioctl> |
| 1338 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1339 | #define WE_GET_ANI_LISTEN_PERIOD 20 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1340 | /* |
| 1341 | * <ioctl> |
| 1342 | * get_aniofdmlvl - Get the OFDM level |
| 1343 | * |
| 1344 | * @INPUT: None |
| 1345 | * |
| 1346 | * @OUTPUT: OFDM |
| 1347 | * wlan0 get_aniofdmlvl:0 |
| 1348 | * |
| 1349 | * This IOTCL used to get ofdm level |
| 1350 | * |
| 1351 | * @E.g: iwpriv wlan0 get_aniofdmlvl |
| 1352 | * |
| 1353 | * Supported Feature: STA |
| 1354 | * |
| 1355 | * Usage: Internal/External |
| 1356 | * |
| 1357 | * </ioctl> |
| 1358 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1359 | #define WE_GET_ANI_OFDM_LEVEL 21 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1360 | /* |
| 1361 | * <ioctl> |
| 1362 | * get_aniccklvl - Get the cck level |
| 1363 | * |
| 1364 | * @INPUT: None |
| 1365 | * |
| 1366 | * @OUTPUT: |
| 1367 | * wlan0 get_aniccklvl:0 |
| 1368 | * |
| 1369 | * This IOTCL used to get cck level |
| 1370 | * |
| 1371 | * @E.g: iwpriv wlan0 get_aniccklvl |
| 1372 | * |
| 1373 | * Supported Feature: STA |
| 1374 | * |
| 1375 | * Usage: Internal/External |
| 1376 | * |
| 1377 | * </ioctl> |
| 1378 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1379 | #define WE_GET_ANI_CCK_LEVEL 22 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1380 | /* |
| 1381 | * <ioctl> |
| 1382 | * get_cwmenable - Get the value of the dynamic channel bandwidth setting |
| 1383 | * |
| 1384 | * @INPUT: None |
| 1385 | * |
| 1386 | * @OUTPUT: Enable/disable dynamic channel bandwidth |
| 1387 | * wlan0 get_cwmenable:0 |
| 1388 | * |
| 1389 | * This IOTCL get the value of the dynamic channel bandwidth setting |
| 1390 | * |
| 1391 | * @E.g: iwpriv wlan0 get_cwmenable |
| 1392 | * |
| 1393 | * Supported Feature: STA |
| 1394 | * |
| 1395 | * Usage: Internal/External |
| 1396 | * |
| 1397 | * </ioctl> |
| 1398 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1399 | #define WE_GET_DYNAMIC_BW 23 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1400 | /* |
| 1401 | * <ioctl> |
| 1402 | * get_txchainmask - Get the txchainmask that was set |
| 1403 | * |
| 1404 | * @INPUT: None |
| 1405 | * |
| 1406 | * @OUTPUT: txchainmask |
| 1407 | * wlan0 get_txchainmask:1 |
| 1408 | * |
| 1409 | * This IOCTL gets the txchainmask that was set |
| 1410 | * This command is useful if it was previously set |
| 1411 | * |
| 1412 | * @E.g: iwpriv wlan0 get_txchainmask |
| 1413 | * |
| 1414 | * Supported Feature: STA |
| 1415 | * |
| 1416 | * Usage: Internal/External |
| 1417 | * |
| 1418 | * </ioctl> |
| 1419 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1420 | #define WE_GET_TX_CHAINMASK 24 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1421 | /* |
| 1422 | * <ioctl> |
| 1423 | * get_rxchainmask - Get the rxchainmask that was set |
| 1424 | * |
| 1425 | * @INPUT: None |
| 1426 | * |
| 1427 | * @OUTPUT: rxchainmask |
| 1428 | * wlan0 get_rxchainmask:1 |
| 1429 | * |
| 1430 | * This IOCTL gets the rxchainmask that was set |
| 1431 | * This command is useful only if it was previously set. |
| 1432 | * |
| 1433 | * @E.g: iwpriv wlan0 get_rxchainmask |
| 1434 | * |
| 1435 | * Supported Feature: STA |
| 1436 | * |
| 1437 | * Usage: Internal/External |
| 1438 | * |
| 1439 | * </ioctl> |
| 1440 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1441 | #define WE_GET_RX_CHAINMASK 25 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1442 | /* |
| 1443 | * <ioctl> |
| 1444 | * get_11nrate - Get the fixed Tx data rate |
| 1445 | * |
| 1446 | * @INPUT: None |
| 1447 | * |
| 1448 | * @OUTPUT: Using this command does not return the same value as set |
| 1449 | * wlan0 get_11nrate:0 |
| 1450 | * |
| 1451 | * This IOCTL gets the fixed Tx data rate |
| 1452 | * This command is useful only if setting the fixed Tx rate. |
| 1453 | * |
| 1454 | * @E.g: iwpriv wlan0 get_11nrate |
| 1455 | * |
| 1456 | * Supported Feature: STA |
| 1457 | * |
| 1458 | * Usage: Internal/External |
| 1459 | * |
| 1460 | * </ioctl> |
| 1461 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1462 | #define WE_GET_11N_RATE 26 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1463 | /* |
| 1464 | * <ioctl> |
| 1465 | * get_ampdu - Get the maximum subframe of ampdu |
| 1466 | * |
| 1467 | * @INPUT: None |
| 1468 | * |
| 1469 | * @OUTPUT: Maximum subframe of ampdu |
| 1470 | * wlan0 get_ampdu:1 |
| 1471 | * |
| 1472 | * This IOCTL gets the maximum subframe of ampdu |
| 1473 | * This command is useful only if setting ampdu. |
| 1474 | * |
| 1475 | * @E.g: iwpriv wlan0 get_ampdu |
| 1476 | * |
| 1477 | * Supported Feature: STA |
| 1478 | * |
| 1479 | * Usage: Internal/External |
| 1480 | * |
| 1481 | * </ioctl> |
| 1482 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1483 | #define WE_GET_AMPDU 27 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1484 | /* |
| 1485 | * <ioctl> |
| 1486 | * get_amsdu - Get the maximum subframe of amsdu |
| 1487 | * |
| 1488 | * @INPUT: None |
| 1489 | * |
| 1490 | * @OUTPUT: Maximum subframe of amsdu |
| 1491 | * wlan0 get_amsdu:1 |
| 1492 | * |
| 1493 | * This IOCTL gets the maximum subframe of amsdu. |
| 1494 | * This command is useful only if setting amsdu |
| 1495 | * |
| 1496 | * @E.g: iwpriv wlan0 get_amsdu |
| 1497 | * |
| 1498 | * Supported Feature: STA |
| 1499 | * |
| 1500 | * Usage: Internal/External |
| 1501 | * |
| 1502 | * </ioctl> |
| 1503 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1504 | #define WE_GET_AMSDU 28 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1505 | /* |
| 1506 | * <ioctl> |
| 1507 | * get_txpow2g - Get the current 2 GHz Tx power setting |
| 1508 | * |
| 1509 | * @INPUT: None |
| 1510 | * |
| 1511 | * @OUTPUT: Tx Power in dbm |
| 1512 | * wlan0 get_txpow2g:0 |
| 1513 | * |
| 1514 | * This IOCTL gets the current 2 GHz Tx power setting |
| 1515 | * This command is useful if setting Tx power |
| 1516 | * |
| 1517 | * @E.g: iwpriv wlan0 get_txpow2g |
| 1518 | * |
| 1519 | * Supported Feature: STA |
| 1520 | * |
| 1521 | * Usage: Internal/External |
| 1522 | * |
| 1523 | * </ioctl> |
| 1524 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1525 | #define WE_GET_TXPOW_2G 29 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1526 | /* |
| 1527 | * <ioctl> |
| 1528 | * get_txpow5g - Get the current 5 GHz Tx power setting |
| 1529 | * |
| 1530 | * @INPUT: None |
| 1531 | * |
| 1532 | * @OUTPUT: Tx Power in dbm |
| 1533 | * wlan0 get_txpow5g:0 |
| 1534 | * |
| 1535 | * This IOCTL gets the current 5 GHz Tx power setting |
| 1536 | * This command is useful if setting Tx power |
| 1537 | * |
| 1538 | * @E.g: iwpriv wlan0 get_txpow5g |
| 1539 | * |
| 1540 | * Supported Feature: STA |
| 1541 | * |
| 1542 | * Usage: Internal/External |
| 1543 | * |
| 1544 | * </ioctl> |
| 1545 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1546 | #define WE_GET_TXPOW_5G 30 |
Rajeev Kumar | 1bcfd63 | 2015-12-07 11:38:51 -0800 | [diff] [blame] | 1547 | /* 31 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1548 | #define WE_GET_PPS_PAID_MATCH 32 |
| 1549 | #define WE_GET_PPS_GID_MATCH 33 |
| 1550 | #define WE_GET_PPS_EARLY_TIM_CLEAR 34 |
| 1551 | #define WE_GET_PPS_EARLY_DTIM_CLEAR 35 |
| 1552 | #define WE_GET_PPS_EOF_PAD_DELIM 36 |
| 1553 | #define WE_GET_PPS_MACADDR_MISMATCH 37 |
| 1554 | #define WE_GET_PPS_DELIM_CRC_FAIL 38 |
| 1555 | #define WE_GET_PPS_GID_NSTS_ZERO 39 |
| 1556 | #define WE_GET_PPS_RSSI_CHECK 40 |
| 1557 | /* Private ioctl for QPower */ |
| 1558 | #define WE_GET_QPOWER_MAX_PSPOLL_COUNT 41 |
| 1559 | #define WE_GET_QPOWER_MAX_TX_BEFORE_WAKE 42 |
| 1560 | #define WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL 43 |
| 1561 | #define WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL 44 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1562 | /* GTX Commands */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1563 | /* |
| 1564 | * <ioctl> |
| 1565 | * get_gtxHTMcs - Get the tx HTM |
| 1566 | * |
| 1567 | * @INPUT: None |
| 1568 | * |
| 1569 | * @OUTPUT: HTM |
| 1570 | * wlan0 get_gtxHTMcs:32896 |
| 1571 | * |
| 1572 | * This IOTCL used to get HTM |
| 1573 | * |
| 1574 | * @E.g: iwpriv wlan0 get_gtxHTMcs |
| 1575 | * |
| 1576 | * Supported Feature: STA |
| 1577 | * |
| 1578 | * Usage: Internal/External |
| 1579 | * |
| 1580 | * </ioctl> |
| 1581 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1582 | #define WE_GET_GTX_HT_MCS 47 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1583 | /* |
| 1584 | * <ioctl> |
| 1585 | * get_gtxVHTMcs - Get the VHTM |
| 1586 | * |
| 1587 | * @INPUT: None |
| 1588 | * |
| 1589 | * @OUTPUT: VHTM |
| 1590 | * wlan0 get_gtxVHTMcs:524800 |
| 1591 | * |
| 1592 | * This IOTCL used to get the VHTM |
| 1593 | * |
| 1594 | * @E.g: iwpriv wlan0 get_gtxVHTMcs |
| 1595 | * |
| 1596 | * Supported Feature: STA |
| 1597 | * |
| 1598 | * Usage: Internal/External |
| 1599 | * |
| 1600 | * </ioctl> |
| 1601 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1602 | #define WE_GET_GTX_VHT_MCS 48 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1603 | /* |
| 1604 | * <ioctl> |
| 1605 | * get_gtxUsrCfg - Get the tx cfg |
| 1606 | * |
| 1607 | * @INPUT: None |
| 1608 | * |
| 1609 | * @OUTPUT: TXCFG |
| 1610 | * wlan0 get_gtxUsrCfg:32 |
| 1611 | * |
| 1612 | * This IOTCL used to get the tx cfg |
| 1613 | * |
| 1614 | * @E.g: iwpriv wlan0 get_gtxUsrCfg |
| 1615 | * |
| 1616 | * Supported Feature: STA |
| 1617 | * |
| 1618 | * Usage: Internal/External |
| 1619 | * |
| 1620 | * </ioctl> |
| 1621 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1622 | #define WE_GET_GTX_USRCFG 49 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1623 | /* |
| 1624 | * <ioctl> |
| 1625 | * get_gtxThre - Get the tx threshold |
| 1626 | * |
| 1627 | * @INPUT: None |
| 1628 | * |
| 1629 | * @OUTPUT: Threshold |
| 1630 | * wlan0 get_gtxThre:3 |
| 1631 | * |
| 1632 | * This IOCTL is used to get tx threshold |
| 1633 | * |
| 1634 | * @E.g: iwpriv wlan0 get_gtxThre |
| 1635 | * |
| 1636 | * Supported Feature: STA |
| 1637 | * |
| 1638 | * Usage: Internal/External |
| 1639 | * |
| 1640 | * </ioctl> |
| 1641 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1642 | #define WE_GET_GTX_THRE 50 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1643 | /* |
| 1644 | * <ioctl> |
| 1645 | * get_gtxMargin - Get the tx margin |
| 1646 | * |
| 1647 | * @INPUT: None |
| 1648 | * |
| 1649 | * @OUTPUT: GTXMARGIN |
| 1650 | * wlan0 get_gtxMargin:2 |
| 1651 | * |
| 1652 | * This IOCTL is used to set tx margin |
| 1653 | * |
| 1654 | * @E.g: iwpriv wlan0 get_gtxMargin |
| 1655 | * |
| 1656 | * Supported Feature: STA |
| 1657 | * |
| 1658 | * Usage: Internal/External |
| 1659 | * |
| 1660 | * </ioctl> |
| 1661 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1662 | #define WE_GET_GTX_MARGIN 51 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1663 | /* |
| 1664 | * <ioctl> |
| 1665 | * get_gtxStep - Get the tx step |
| 1666 | * |
| 1667 | * @INPUT: None |
| 1668 | * |
| 1669 | * @OUTPUT: GTXSTEP |
| 1670 | * wlan0 get_gtxStep:0 |
| 1671 | * |
| 1672 | * This IOCTL is used to get the gtx step |
| 1673 | * |
| 1674 | * @E.g: iwpriv wlan0 get_gtxStep |
| 1675 | * |
| 1676 | * Supported Feature: STA |
| 1677 | * |
| 1678 | * Usage: Internal/External |
| 1679 | * |
| 1680 | * </ioctl> |
| 1681 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1682 | #define WE_GET_GTX_STEP 52 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1683 | /* |
| 1684 | * <ioctl> |
| 1685 | * get_gtxMinTpc - Get the tx miminum tpc |
| 1686 | * |
| 1687 | * @INPUT: None |
| 1688 | * |
| 1689 | * @OUTPUT: TPC |
| 1690 | * wlan0 get_gtxMinTpc:0 |
| 1691 | * |
| 1692 | * This IOCTL is used to get tx miminum tpc |
| 1693 | * |
| 1694 | * @E.g: iwpriv wlan0 get_gtxMinTpc |
| 1695 | * |
| 1696 | * Supported Feature: STA |
| 1697 | * |
| 1698 | * Usage: Internal/External |
| 1699 | * |
| 1700 | * </ioctl> |
| 1701 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1702 | #define WE_GET_GTX_MINTPC 53 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1703 | /* |
| 1704 | * <ioctl> |
| 1705 | * get_gtxBWMask - Get the tx BW MASK |
| 1706 | * |
| 1707 | * @INPUT: None |
| 1708 | * |
| 1709 | * @OUTPUT: MASK |
| 1710 | * wlan0 get_gtxBWMask:15 |
| 1711 | * |
| 1712 | * This IOCTL is used get gtx bw mask |
| 1713 | * |
| 1714 | * @E.g: iwpriv wlan0 get_gtxBWMask |
| 1715 | * |
| 1716 | * Supported Feature: STA |
| 1717 | * |
| 1718 | * Usage: Internal/External |
| 1719 | * |
| 1720 | * </ioctl> |
| 1721 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1722 | #define WE_GET_GTX_BWMASK 54 |
| 1723 | #define WE_GET_TEMPERATURE 56 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1724 | #define WE_CAP_TSF 58 |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 1725 | #define WE_GET_ROAM_SYNCH_DELAY 59 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1726 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 1727 | /* |
| 1728 | * <ioctl> |
| 1729 | * get_dcm - Get dcm enablement value |
| 1730 | * |
| 1731 | * @INPUT: None |
| 1732 | * |
| 1733 | * @OUTPUT: 0/1 |
| 1734 | * wlan0 get_dcm |
| 1735 | * |
| 1736 | * This IOCTL is used get dcm value |
| 1737 | * |
| 1738 | * Supported Feature: STA/SAP |
| 1739 | * |
| 1740 | * Usage: Internal |
| 1741 | * |
| 1742 | * </ioctl> |
| 1743 | */ |
| 1744 | #define WE_GET_DCM 60 |
| 1745 | |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 1746 | /* |
| 1747 | * <ioctl> |
| 1748 | * get_dcm - Get range extension enablement value |
| 1749 | * |
| 1750 | * @INPUT: None |
| 1751 | * |
| 1752 | * @OUTPUT: 0/1 |
| 1753 | * wlan0 get_range_ext |
| 1754 | * |
| 1755 | * This IOCTL is used get range_extension value |
| 1756 | * |
| 1757 | * Supported Feature: STA/SAP |
| 1758 | * |
| 1759 | * Usage: Internal |
| 1760 | * |
| 1761 | * </ioctl> |
| 1762 | */ |
| 1763 | #define WE_GET_RANGE_EXT 61 |
| 1764 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1765 | /* Private ioctls and their sub-ioctls */ |
| 1766 | #define WLAN_PRIV_SET_INT_GET_INT (SIOCIWFIRSTPRIV + 2) |
| 1767 | |
| 1768 | /* Private ioctls and their sub-ioctls */ |
| 1769 | #define WLAN_PRIV_SET_CHAR_GET_NONE (SIOCIWFIRSTPRIV + 3) |
| 1770 | #define WE_WOWL_ADD_PTRN 1 |
| 1771 | #define WE_WOWL_DEL_PTRN 2 |
Sreelakshmi Konamki | ded64d7 | 2017-02-23 10:39:26 +0530 | [diff] [blame] | 1772 | /* |
| 1773 | * <ioctl> |
| 1774 | * neighbor - Send neighbor report request |
| 1775 | * |
| 1776 | * @INPUT: string |
| 1777 | * |
| 1778 | * @OUTPUT: None |
| 1779 | * |
| 1780 | * This IOCTL create a Neighbor report request and send it to peer |
| 1781 | * |
| 1782 | * @E.g: iwpriv wlan0 neighbor "SSID" |
| 1783 | * |
| 1784 | * Supported Feature: 11k |
| 1785 | * |
| 1786 | * Usage: Internal/External |
| 1787 | * |
| 1788 | * </ioctl> |
| 1789 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1790 | #define WE_NEIGHBOR_REPORT_REQUEST 3 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1791 | /* |
| 1792 | * <ioctl> |
| 1793 | * set_ap_wps_ie - Set the P2P IE of the probe response |
| 1794 | * |
| 1795 | * @INPUT: string |
| 1796 | * |
| 1797 | * @OUTPUT: None |
| 1798 | * |
| 1799 | * This IOCTL sets the P2P IE of the probe response |
| 1800 | * |
| 1801 | * @E.g: iwpriv wlan0 set_ap_wps_ie abcd |
| 1802 | * |
| 1803 | * Supported Feature: STA |
| 1804 | * |
| 1805 | * Usage: Internal/External |
| 1806 | * |
| 1807 | * </ioctl> |
| 1808 | */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 1809 | #define WE_SET_AP_WPS_IE 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1810 | #define WE_SET_CONFIG 5 |
| 1811 | |
| 1812 | /* Private ioctls and their sub-ioctls */ |
| 1813 | #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) |
| 1814 | #define WE_SET_WLAN_DBG 1 |
| 1815 | #define WE_SET_DP_TRACE 2 |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 1816 | #define WE_SET_FW_TEST 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1817 | |
| 1818 | /* Private ioctls and their sub-ioctls */ |
| 1819 | #define WLAN_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 5) |
| 1820 | #define WE_WLAN_VERSION 1 |
| 1821 | #define WE_GET_STATS 2 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1822 | /* |
| 1823 | * <ioctl> |
| 1824 | * getConfig - gets the values of all configurations listed in WCNSS |
| 1825 | * |
| 1826 | * @INPUT: None |
| 1827 | * |
| 1828 | * @OUTPUT: Current configuration to the sys log |
| 1829 | * wlan0 getConfig: WLAN configuration written to system log |
| 1830 | * |
| 1831 | * This IOCTL gets the values of all configurations listed in WCNSS |
| 1832 | * |
| 1833 | * @E.g: iwpriv wlan0 getConfig |
| 1834 | * |
| 1835 | * Supported Feature: STA |
| 1836 | * |
| 1837 | * Usage: Internal/External |
| 1838 | * |
| 1839 | * </ioctl> |
| 1840 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1841 | #define WE_GET_CFG 3 |
| 1842 | #define WE_GET_WMM_STATUS 4 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1843 | /* |
| 1844 | * <ioctl> |
| 1845 | * getChannelList - Get the available channel list while in QCMobileAP |
| 1846 | * |
| 1847 | * @INPUT: None |
| 1848 | * |
| 1849 | * @OUTPUT: Channel list |
| 1850 | * wlan0 getChannelList:36 US 1..165 |
| 1851 | * |
| 1852 | * This IOCTL gets the available channel list while in QCMobileAP |
| 1853 | * |
| 1854 | * @E.g: iwpriv wlan0 getChannelList |
| 1855 | * |
| 1856 | * Supported Feature: STA |
| 1857 | * |
| 1858 | * Usage: Internal/External |
| 1859 | * |
| 1860 | * </ioctl> |
| 1861 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1862 | #define WE_GET_CHANNEL_LIST 5 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1863 | /* |
| 1864 | * <ioctl> |
| 1865 | * getRSSI - Get the Received Signal Strength Indicator |
| 1866 | * |
| 1867 | * @INPUT: None |
| 1868 | * |
| 1869 | * @OUTPUT: RSSI |
| 1870 | * wlan0 getRSSI:rsssi=-32 |
| 1871 | * |
| 1872 | * This IOCTL gets the Received Signal Strength Indicator (RSSI) |
| 1873 | * |
| 1874 | * @E.g: iwpriv wlan0 getRSSI |
| 1875 | * |
| 1876 | * Supported Feature: STA |
| 1877 | * |
| 1878 | * Usage: Internal/External |
| 1879 | * |
| 1880 | * </ioctl> |
| 1881 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1882 | #define WE_GET_RSSI 6 |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1883 | |
| 1884 | /* |
| 1885 | * <ioctl> |
| 1886 | * getSuspendStats - Get suspend/resume stats |
| 1887 | * |
| 1888 | * @INPUT: None |
| 1889 | * |
| 1890 | * @OUTPUT: character string containing formatted suspend/resume stats |
| 1891 | * |
| 1892 | * This ioctl is used to get suspend/resume stats formatted for display. |
| 1893 | * Currently it includes suspend/resume counts, wow wake up reasons, and |
| 1894 | * suspend fail reasons. |
| 1895 | * |
| 1896 | * @E.g: iwpriv wlan0 getSuspendStats |
| 1897 | * iwpriv wlan0 getSuspendStats |
| 1898 | * |
| 1899 | * Supported Feature: suspend/resume |
| 1900 | * |
| 1901 | * Usage: Internal |
| 1902 | * |
| 1903 | * </ioctl> |
| 1904 | */ |
| 1905 | #define WE_GET_SUSPEND_RESUME_STATS 7 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1906 | #ifdef FEATURE_WLAN_TDLS |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 1907 | /* |
| 1908 | * <ioctl> |
| 1909 | * getTdlsPeers - Get all TDLS peers. |
| 1910 | * |
| 1911 | * @INPUT: None |
| 1912 | * |
| 1913 | * @OUTPUT: Returns the MAC address of all the TDLS peers |
| 1914 | * wlan0 getTdlsPeers: |
| 1915 | * MAC Id cap up RSSI |
| 1916 | * --------------------------------- |
| 1917 | * 00:0a:f5:0e:bd:18 2 Y Y -44 |
| 1918 | * 00:0a:f5:bf:0e:12 0 N N 0 |
| 1919 | * |
| 1920 | * This IOCTL is used to get all TDLS peers. |
| 1921 | * |
| 1922 | * @E.g: iwpriv wlan0 getTdlsPeers |
| 1923 | * |
| 1924 | * Supported Feature: TDLS |
| 1925 | * |
| 1926 | * Usage: Internal/External |
| 1927 | * |
| 1928 | * </ioctl> |
| 1929 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1930 | #define WE_GET_TDLS_PEERS 8 |
| 1931 | #endif |
| 1932 | #ifdef WLAN_FEATURE_11W |
Abhishek Singh | 2f81049 | 2016-12-01 11:39:39 +0530 | [diff] [blame] | 1933 | /* |
| 1934 | * <ioctl> |
| 1935 | * getPMFInfo - get the PMF info of the connected session |
| 1936 | * |
| 1937 | * @INPUT: None |
| 1938 | * |
| 1939 | * @OUTPUT: |
| 1940 | * wlan0 getPMFInfo: |
| 1941 | * BSSID E4:F4:C6:0A:E0:36, Is PMF Assoc? 0 |
| 1942 | * Number of Unprotected Disassocs 0 |
| 1943 | * Number of Unprotected Deauths 0 |
| 1944 | * |
| 1945 | * This IOCTL is used to get the PMF stats/status of the current |
| 1946 | * connection. |
| 1947 | * |
| 1948 | * @e.g:iwpriv wlan0 getPMFInfo |
| 1949 | * |
| 1950 | * Supported Feature: PMF |
| 1951 | * |
| 1952 | * Usage: Internal/External |
| 1953 | * |
| 1954 | * </ioctl> |
| 1955 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1956 | #define WE_GET_11W_INFO 9 |
| 1957 | #endif |
| 1958 | #define WE_GET_STATES 10 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 1959 | /* |
| 1960 | * <ioctl> |
| 1961 | * getIbssSTAs - get ibss sta info |
| 1962 | * |
| 1963 | * @INPUT: None |
| 1964 | * |
| 1965 | * @OUTPUT: Give the MAC of the IBSS STA |
| 1966 | * wlan0 getIbssSTAs: |
| 1967 | * 1 .8c:fd:f0:01:9c:bf |
| 1968 | * |
| 1969 | * This IOCTL is used to get ibss sta info |
| 1970 | * |
| 1971 | * @E.g: iwpriv wlan0 getIbssSTAs |
| 1972 | * |
| 1973 | * Supported Feature: IBSS |
| 1974 | * |
| 1975 | * Usage: Internal/External |
| 1976 | * |
| 1977 | * </ioctl> |
| 1978 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1979 | #define WE_GET_IBSS_STA_INFO 11 |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 1980 | /* |
| 1981 | * <ioctl> |
| 1982 | * getphymode - Get the current phymode. |
| 1983 | * |
| 1984 | * @INPUT: None |
| 1985 | * |
| 1986 | * @OUTPUT: In phymode |
| 1987 | * wlan0 getphymode:AUTO MODE |
| 1988 | * |
| 1989 | * This IOCTL used to gets the current phymode. |
| 1990 | * |
| 1991 | * @E.g: iwpriv wlan0 getphymode |
| 1992 | * |
| 1993 | * Supported Feature: STA |
| 1994 | * |
| 1995 | * Usage: Internal/External |
| 1996 | * |
| 1997 | * </ioctl> |
| 1998 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1999 | #define WE_GET_PHYMODE 12 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2000 | |
| 2001 | /* |
| 2002 | * <ioctl> |
| 2003 | * getOemDataCap - Get the oem data caps. |
| 2004 | * |
| 2005 | * @INPUT: None |
| 2006 | * |
| 2007 | * @OUTPUT: oem data capability |
| 2008 | * |
| 2009 | * This IOCTL used to gets the current oem data cap. |
| 2010 | * |
| 2011 | * @E.g: iwpriv wlan0 getOemDataCap |
| 2012 | * |
| 2013 | * Usage: Internal/External |
| 2014 | * |
| 2015 | * </ioctl> |
| 2016 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2017 | #define WE_GET_OEM_DATA_CAP 13 |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2018 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2019 | /* |
| 2020 | * <ioctl> |
| 2021 | * getSNR - Enable SNR Monitoring |
| 2022 | * |
| 2023 | * @INPUT: None |
| 2024 | * |
| 2025 | * @OUTPUT: Signal strength/ratio |
| 2026 | * wlan0 getSNR:1 |
| 2027 | * |
| 2028 | * This IOCTL is used to get ibss sta info |
| 2029 | * |
| 2030 | * @E.g: iwpriv wlan0 getSNR |
| 2031 | * |
| 2032 | * Supported Feature: STA |
| 2033 | * |
| 2034 | * Usage: Internal/External |
| 2035 | * |
| 2036 | * </ioctl> |
| 2037 | */ |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2038 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2039 | #define WE_GET_SNR 14 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2040 | #define WE_LIST_FW_PROFILE 15 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2041 | |
| 2042 | /* Private ioctls and their sub-ioctls */ |
| 2043 | #define WLAN_PRIV_SET_NONE_GET_NONE (SIOCIWFIRSTPRIV + 6) |
Selvaraj, Sridhar | f793983 | 2017-03-25 16:59:50 +0530 | [diff] [blame] | 2044 | |
| 2045 | /* |
| 2046 | * <ioctl> |
| 2047 | * reassoc - Trigger STA re-association to the connected AP |
| 2048 | * |
| 2049 | * @INPUT: None |
| 2050 | * |
| 2051 | * @OUTPUT: None |
| 2052 | * |
| 2053 | * This IOCTL is used to trigger STA reassociation to the connected AP. |
| 2054 | * |
| 2055 | * @E.g: iwpriv wlan0 reassoc |
| 2056 | * |
| 2057 | * Supported Feature: Roaming |
| 2058 | * |
| 2059 | * Usage: Internal |
| 2060 | * |
| 2061 | * </ioctl> |
| 2062 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2063 | #define WE_SET_REASSOC_TRIGGER 8 |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2064 | /* |
| 2065 | * <ioctl> |
| 2066 | * ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI |
| 2067 | * |
| 2068 | * @INPUT: None |
| 2069 | * |
| 2070 | * @OUTPUT: print ibss peer in info logs |
| 2071 | * pPeerInfo->numIBSSPeers = 1 |
| 2072 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2073 | * |
| 2074 | * This IOCTL is used to rint the ibss peers's MAC, rate and RSSI |
| 2075 | * in info logs |
| 2076 | * |
| 2077 | * @E.g: iwpriv wlan0 ibssPeerInfoAll |
| 2078 | * |
| 2079 | * Supported Feature: IBSS |
| 2080 | * |
| 2081 | * Usage: Internal/External |
| 2082 | * |
| 2083 | * </ioctl> |
| 2084 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2085 | #define WE_IBSS_GET_PEER_INFO_ALL 10 |
Rajeev Kumar | f4390fa | 2016-12-22 13:17:33 -0800 | [diff] [blame] | 2086 | /* Sub ioctls 11 to 16 are not used */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2087 | #define WE_GET_RECOVERY_STAT 17 |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2088 | #define WE_GET_FW_PROFILE_DATA 18 |
yeshwanth sriram guntuka | bdfe435 | 2017-02-16 14:44:31 +0530 | [diff] [blame] | 2089 | /* |
| 2090 | * <ioctl> |
| 2091 | * stop_obss_scan - Stop obss scan |
| 2092 | * |
| 2093 | * @INPUT: None |
| 2094 | * |
| 2095 | * @OUTPUT: None |
| 2096 | * |
| 2097 | * This IOCTL is used to stop obss scan |
| 2098 | * |
| 2099 | * @E.g: iwpriv wlan0 stop_obss_scan |
| 2100 | * |
| 2101 | * Supported Feature: Scan |
| 2102 | * |
| 2103 | * Usage: Internal/External |
| 2104 | * |
| 2105 | * </ioctl> |
| 2106 | */ |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 2107 | #define WE_STOP_OBSS_SCAN 19 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2108 | |
| 2109 | /* Private ioctls and their sub-ioctls */ |
| 2110 | #define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7) |
| 2111 | |
| 2112 | #define WE_P2P_NOA_CMD 2 |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2113 | /* subcommands 3 is unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2114 | |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 2115 | #define WE_MAC_PWR_DEBUG_CMD 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2116 | |
Kabilan Kannan | 6894e6a | 2017-11-09 14:37:55 -0800 | [diff] [blame] | 2117 | /* subcommand 5 is unused */ |
Nitesh Shah | 5dfb99e | 2016-12-10 14:19:46 +0530 | [diff] [blame] | 2118 | |
Abhishek Singh | 49b654e | 2016-12-01 16:11:17 +0530 | [diff] [blame] | 2119 | /* |
| 2120 | * <ioctl> |
| 2121 | * ibssPeerInfo - Print the ibss peers's MAC, rate and RSSI |
| 2122 | * |
| 2123 | * @INPUT: staid |
| 2124 | * |
| 2125 | * @OUTPUT: print ibss peer corresponding to staid in info logs |
| 2126 | * PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35 |
| 2127 | * |
| 2128 | * This IOCTL is used to print the specific ibss peers's MAC, |
| 2129 | * rate and RSSI in info logs |
| 2130 | * |
| 2131 | * @E.g: iwpriv wlan0 ibssPeerInfo <sta_id> |
| 2132 | * iwpriv wlan0 ibssPeerInfo 0 |
| 2133 | * |
| 2134 | * Supported Feature: IBSS |
| 2135 | * |
| 2136 | * Usage: Internal/External |
| 2137 | * |
| 2138 | * </ioctl> |
| 2139 | */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 2140 | #define WE_IBSS_GET_PEER_INFO 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2141 | #define WE_UNIT_TEST_CMD 7 |
| 2142 | |
| 2143 | #define WE_MTRACE_DUMP_CMD 8 |
| 2144 | #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 |
| 2145 | |
| 2146 | |
| 2147 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 2148 | #define WE_LED_FLASHING_PARAM 10 |
| 2149 | #endif |
| 2150 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2151 | /* |
| 2152 | * <ioctl> |
| 2153 | * pm_clist - Increments the index value of the concurrent connection list |
| 2154 | * and update with the input parameters provided. |
| 2155 | * |
| 2156 | * @INPUT: Following 8 arguments: |
| 2157 | * @vdev_id: vdev id |
| 2158 | * @tx_streams: TX streams |
| 2159 | * @rx_streams: RX streams |
| 2160 | * @chain_mask: Chain mask |
| 2161 | * @type: vdev_type |
| 2162 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2163 | * @sub_type: vdev_subtype |
| 2164 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2165 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2166 | * @channel: Channel |
| 2167 | * @mac: Mac id |
| 2168 | * |
| 2169 | * @OUTPUT: None |
| 2170 | * |
| 2171 | * This IOCTL is used to increments the index value of the concurrent connection |
| 2172 | * list and update with the input parameters provided. |
| 2173 | * |
| 2174 | * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type |
| 2175 | * sub_type channel mac |
| 2176 | * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1 |
| 2177 | * |
| 2178 | * Supported Feature: DBS |
| 2179 | * |
| 2180 | * Usage: Internal/External |
| 2181 | * |
| 2182 | * </ioctl> |
| 2183 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2184 | #define WE_POLICY_MANAGER_CLIST_CMD 11 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2185 | |
| 2186 | /* |
| 2187 | * <ioctl> |
| 2188 | * pm_dlist - Delete the index from the concurrent connection list that is |
| 2189 | * present in the given vdev_id. |
| 2190 | * |
| 2191 | * @INPUT: delete_all, vdev_id |
| 2192 | * @delete_all: delete all indices |
| 2193 | * @vdev_id: vdev id |
| 2194 | * |
| 2195 | * @OUTPUT: None |
| 2196 | * |
| 2197 | * This IOCTL is used to delete the index from the concurrent connection list |
| 2198 | * that is present in the given vdev_id. |
| 2199 | * |
| 2200 | * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id |
| 2201 | * iwpriv wlan0 pm_dlist 0 1 |
| 2202 | * |
| 2203 | * Supported Feature: DBS |
| 2204 | * |
| 2205 | * Usage: Internal/External |
| 2206 | * |
| 2207 | * </ioctl> |
| 2208 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2209 | #define WE_POLICY_MANAGER_DLIST_CMD 12 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2210 | |
| 2211 | /* |
| 2212 | * <ioctl> |
| 2213 | * pm_dbs - Set dbs capability and system preference |
| 2214 | * |
| 2215 | * @INPUT: dbs, system_pref |
| 2216 | * @dbs: Value of DBS capability to be set |
| 2217 | * @system_pref: System preference |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2218 | * 0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2219 | * |
| 2220 | * @OUTPUT: None |
| 2221 | * |
| 2222 | * This IOCTL is used to set dbs capability and system preference. |
| 2223 | * |
| 2224 | * @E.g: iwpriv wlan0 pm_dbs dbs system_pref |
| 2225 | * iwpriv wlan0 pm_dbs 1 0 |
| 2226 | * |
| 2227 | * Supported Feature: DBS |
| 2228 | * |
| 2229 | * Usage: Internal/External |
| 2230 | * |
| 2231 | * </ioctl> |
| 2232 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2233 | #define WE_POLICY_MANAGER_DBS_CMD 13 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2234 | |
| 2235 | /* |
| 2236 | * <ioctl> |
| 2237 | * pm_pcl - Set pcl for concurrency mode. |
| 2238 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2239 | * @INPUT: policy_mgr_con_mode |
| 2240 | * @policy_mgr_con_mode: concurrency mode for PCL table |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2241 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2242 | * |
| 2243 | * @OUTPUT: None |
| 2244 | * |
| 2245 | * This IOCTL is used to set pcl for concurrency mode. |
| 2246 | * |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 2247 | * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2248 | * iwpriv wlan0 pm_pcl 0 |
| 2249 | * |
| 2250 | * Supported Feature: DBS |
| 2251 | * |
| 2252 | * Usage: Internal/External |
| 2253 | * |
| 2254 | * </ioctl> |
| 2255 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2256 | #define WE_POLICY_MANAGER_PCL_CMD 14 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2257 | |
| 2258 | /* |
| 2259 | * <ioctl> |
| 2260 | * pm_cinfo - Shows the concurrent connection list. |
| 2261 | * |
| 2262 | * @INPUT: None |
| 2263 | * |
| 2264 | * @OUTPUT: None |
| 2265 | * |
| 2266 | * This IOCTL is used to show the concurrent connection list. |
| 2267 | * |
| 2268 | * @E.g: iwpriv wlan0 pm_cinfo |
| 2269 | * |
| 2270 | * Supported Feature: DBS |
| 2271 | * |
| 2272 | * Usage: Internal/External |
| 2273 | * |
| 2274 | * </ioctl> |
| 2275 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2276 | #define WE_POLICY_MANAGER_CINFO_CMD 15 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2277 | |
| 2278 | /* |
| 2279 | * <ioctl> |
| 2280 | * pm_ulist - Updates the index value of the concurrent connection list |
| 2281 | * with the input parameters provided. |
| 2282 | * |
| 2283 | * @INPUT: Following 8 arguments: |
| 2284 | * @vdev_id: vdev id |
| 2285 | * @tx_streams: TX streams |
| 2286 | * @rx_streams: RX streams |
| 2287 | * @chain_mask: Chain mask |
| 2288 | * @type: vdev_type |
| 2289 | * AP:1 STA:2 IBSS:3 Monitor:4 NAN:5 OCB:6 NDI:7 |
| 2290 | * @sub_type: vdev_subtype |
| 2291 | * P2P_Device:1 P2P_Client:2 P2P_GO:3 |
| 2292 | * Proxy_STA:4 Mesh:5 Mesh_11s:6 |
| 2293 | * @channel: Channel |
| 2294 | * @mac: Mac id |
| 2295 | * |
| 2296 | * @OUTPUT: None |
| 2297 | * |
| 2298 | * This IOCTL is used to updates the index value of the concurrent |
| 2299 | * connection list with the input parameters provided. |
| 2300 | * |
| 2301 | * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type |
| 2302 | * sub_type channel mac |
| 2303 | * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1 |
| 2304 | * |
| 2305 | * Supported Feature: DBS |
| 2306 | * |
| 2307 | * Usage: Internal/External |
| 2308 | * |
| 2309 | * </ioctl> |
| 2310 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2311 | #define WE_POLICY_MANAGER_ULIST_CMD 16 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2312 | |
| 2313 | /* |
| 2314 | * <ioctl> |
| 2315 | * pm_query_action - Initiate actions needed on current connections as |
| 2316 | * per the channel provided. |
| 2317 | * |
| 2318 | * @INPUT: channel |
| 2319 | * @channel: Channel on which new connection will be. |
| 2320 | * |
| 2321 | * @OUTPUT: None |
| 2322 | * |
| 2323 | * This IOCTL is used to initiate actions needed on current connections |
| 2324 | * as per the channel provided. |
| 2325 | * |
| 2326 | * @E.g: iwpriv wlan0 pm_query_action channel |
| 2327 | * iwpriv wlan0 pm_query_action 6 |
| 2328 | * |
| 2329 | * Supported Feature: DBS |
| 2330 | * |
| 2331 | * Usage: Internal/External |
| 2332 | * |
| 2333 | * </ioctl> |
| 2334 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2335 | #define WE_POLICY_MANAGER_QUERY_ACTION_CMD 17 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2336 | |
| 2337 | /* |
| 2338 | * <ioctl> |
| 2339 | * pm_query_allow - Checks for allowed concurrency combination |
| 2340 | * |
| 2341 | * @INPUT: mode, channel, bandwidth |
| 2342 | * @mode: new connection mode |
| 2343 | * 0:STA 1:SAP 2:P2P_Client 3:P2P_GO 4:IBSS |
| 2344 | * @channel: channel on which new connection is coming up |
| 2345 | * @bandwidth: Bandwidth requested by the connection |
| 2346 | * 0:None 1:5MHz 2:10MHz 3:20MHz |
| 2347 | * 4:40MHz 5:80MHz 6:80+80MHz 7:160MHz |
| 2348 | * |
| 2349 | * @OUTPUT: None |
| 2350 | * |
| 2351 | * This IOCTL is used to checks for allowed concurrency combination. |
| 2352 | * |
| 2353 | * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth |
| 2354 | * iwpriv wlan0 pm_query_allow 0 6 4 |
| 2355 | * |
| 2356 | * Supported Feature: DBS |
| 2357 | * |
| 2358 | * Usage: Internal/External |
| 2359 | * |
| 2360 | * </ioctl> |
| 2361 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2362 | #define WE_POLICY_MANAGER_QUERY_ALLOW_CMD 18 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2363 | |
| 2364 | /* |
| 2365 | * <ioctl> |
| 2366 | * pm_run_scenario - Create scenario with number of connections provided. |
| 2367 | * |
| 2368 | * @INPUT: num_of_conn |
| 2369 | * @num_of_conn: the number of connections (values: 1~3) |
| 2370 | * |
| 2371 | * @OUTPUT: None |
| 2372 | * |
| 2373 | * This IOCTL is used to create scenario with the number of connections |
| 2374 | * provided. |
| 2375 | * |
| 2376 | * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn |
| 2377 | * iwpriv wlan0 pm_run_scenario 1 |
| 2378 | * |
| 2379 | * Supported Feature: DBS |
| 2380 | * |
| 2381 | * Usage: Internal/External |
| 2382 | * |
| 2383 | * </ioctl> |
| 2384 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2385 | #define WE_POLICY_MANAGER_SCENARIO_CMD 19 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2386 | |
| 2387 | /* |
| 2388 | * <ioctl> |
| 2389 | * pm_set_hw_mode - Set hardware for single/dual mac. |
| 2390 | * |
| 2391 | * @INPUT: hw_mode |
| 2392 | * 0:single mac 1:dual mac |
| 2393 | * |
| 2394 | * @OUTPUT: None |
| 2395 | * |
| 2396 | * This IOCTL is used to set hardware for single/dual mac. |
| 2397 | * |
| 2398 | * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode |
| 2399 | * iwpriv wlan0 pm_set_hw_mode 1 |
| 2400 | * |
| 2401 | * Supported Feature: DBS |
| 2402 | * |
| 2403 | * Usage: Internal/External |
| 2404 | * |
| 2405 | * </ioctl> |
| 2406 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2407 | #define WE_POLICY_SET_HW_MODE_CMD 20 |
| 2408 | |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2409 | /* |
| 2410 | * <ioctl> |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 2411 | * ch_avoid - unit test SAP channel avoidance |
| 2412 | * |
| 2413 | * @INPUT: chan avoid ranges |
| 2414 | * |
| 2415 | * @OUTPUT: none |
| 2416 | * |
| 2417 | * This IOCTL is used to fake a channel avoidance event. |
| 2418 | * To test SAP/GO chan switch during chan avoid event process. |
| 2419 | * |
| 2420 | * @E.g: iwpriv wlan0 ch_avoid 2452 2462 |
| 2421 | * |
| 2422 | * Supported Feature: SAP chan avoidance. |
| 2423 | * |
| 2424 | * Usage: Internal |
| 2425 | * |
| 2426 | * </ioctl> |
| 2427 | */ |
| 2428 | #define WE_SET_CHAN_AVOID 21 |
| 2429 | |
| 2430 | /* |
| 2431 | * <ioctl> |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2432 | * set_scan_cfg - Set dual MAC scan config parameters. |
| 2433 | * |
| 2434 | * @INPUT: dbs, dbs_plus_agile_scan, single_mac_scan_with_dbs |
| 2435 | * @dbs: Value of DBS bit |
| 2436 | * @dbs_plus_agile_scan: Value of DBS plus agile scan bit |
| 2437 | * @single_mac_scan_with_dbs: Value of Single MAC scan with DBS |
| 2438 | * |
| 2439 | * @OUTPUT: None |
| 2440 | * |
| 2441 | * This IOCTL is used to set the dual MAC scan config. |
| 2442 | * |
| 2443 | * @E.g: iwpriv wlan0 set_scan_cfg dbs dbs_plus_agile_scan |
| 2444 | * single_mac_scan_with_dbs |
| 2445 | * iwpriv wlan0 set_scan_cfg 1 0 1 |
| 2446 | * |
| 2447 | * Supported Feature: DBS |
| 2448 | * |
| 2449 | * Usage: Internal/External |
| 2450 | * |
| 2451 | * </ioctl> |
| 2452 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2453 | #define WE_SET_DUAL_MAC_SCAN_CONFIG 21 |
Nitesh Shah | f9503dd | 2016-12-15 20:26:07 +0530 | [diff] [blame] | 2454 | |
| 2455 | /* |
| 2456 | * <ioctl> |
| 2457 | * set_fw_mode_cfg - Sets the dual mac FW mode config |
| 2458 | * |
| 2459 | * @INPUT: dbs, dfs |
| 2460 | * @dbs: DBS bit |
| 2461 | * @dfs: Agile DFS bit |
| 2462 | * |
| 2463 | * @OUTPUT: None |
| 2464 | * |
| 2465 | * This IOCTL is used to set the dual mac FW mode config. |
| 2466 | * |
| 2467 | * @E.g: iwpriv wlan0 set_fw_mode_cfg dbs dfs |
| 2468 | * iwpriv wlan0 set_fw_mode_cfg 1 1 |
| 2469 | * |
| 2470 | * Supported Feature: DBS |
| 2471 | * |
| 2472 | * Usage: Internal/External |
| 2473 | * |
| 2474 | * </ioctl> |
| 2475 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2476 | #define WE_SET_DUAL_MAC_FW_MODE_CONFIG 22 |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 2477 | #define WE_SET_MON_MODE_CHAN 23 |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 2478 | /* |
| 2479 | * <ioctl> |
| 2480 | * txrx_stats - TXRX statistics query |
| 2481 | * |
| 2482 | * @INPUT: query category, mac id (default mac id is 0) |
| 2483 | * |
| 2484 | * @OUTPUT: TXRX statistics result |
| 2485 | * |
| 2486 | * This IOCTL is used to get TXRX statistics counters. |
| 2487 | * |
| 2488 | * @E.g: iwpriv wlan0 txrx_stats 21 0 |
| 2489 | * iwpriv wlan0 txrx_stats 21 1 |
| 2490 | * |
| 2491 | * Usage: Internal |
| 2492 | * |
| 2493 | * </ioctl> |
| 2494 | */ |
| 2495 | #define WE_SET_TXRX_STATS 24 |
| 2496 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2497 | |
| 2498 | #ifdef FEATURE_WLAN_TDLS |
| 2499 | #undef MAX_VAR_ARGS |
| 2500 | #define MAX_VAR_ARGS 11 |
| 2501 | #else |
| 2502 | #undef MAX_VAR_ARGS |
| 2503 | #define MAX_VAR_ARGS 9 |
| 2504 | #endif |
| 2505 | |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 2506 | /* |
| 2507 | * <ioctl> |
| 2508 | * fips_test - Perform a FIPS test |
| 2509 | * |
| 2510 | * @INPUT: Binary representation of the following packed structure |
| 2511 | * |
| 2512 | * @OUTPUT: Binary representation of the following packed structure |
| 2513 | * |
| 2514 | * This IOCTL is used to perform FIPS certification testing |
| 2515 | * |
| 2516 | * @E.g: iwpriv wlan0 fips_test <test vector> |
| 2517 | * |
| 2518 | * iwpriv wlan0 fips_test <tbd> |
| 2519 | * |
| 2520 | * Supported Feature: FIPS |
| 2521 | * |
| 2522 | * Usage: Internal |
| 2523 | * |
| 2524 | * </ioctl> |
| 2525 | */ |
| 2526 | #define WLAN_PRIV_FIPS_TEST (SIOCIWFIRSTPRIV + 8) |
| 2527 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2528 | /* Private ioctls (with no sub-ioctls) */ |
| 2529 | /* note that they must be odd so that they have "get" semantics */ |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2530 | /* |
| 2531 | * <ioctl> |
| 2532 | * addTspec - Add TSPEC for each AC |
| 2533 | * |
| 2534 | * @INPUT: 19 TSPEC params |
| 2535 | * @[arg0]: handle |
| 2536 | * @[arg1]: tid |
| 2537 | * @[arg2]: dir |
| 2538 | * @[arg3]: psb |
| 2539 | * @[arg4]: up |
| 2540 | * @[arg5]: nomMsduSize |
| 2541 | * @[arg6]: maxMsduSize |
| 2542 | * @[arg7]: minDataRate |
| 2543 | * @[arg8]: meanDataRate |
| 2544 | * @[arg9]: peakDataRate |
| 2545 | * @[arg10]: maxBurstSize |
| 2546 | * @[arg11]: minPhyRate |
| 2547 | * @[arg12]: sba |
| 2548 | * @[arg13]: minServiceIntv |
| 2549 | * @[arg14]: suspendIntv |
| 2550 | * @[arg15]: burstSizeDefn |
| 2551 | * @[arg16]: ackPolicy |
| 2552 | * @[arg17]: inactivityPeriod |
| 2553 | * @[arg18]: maxServiceIntv |
| 2554 | * |
| 2555 | * @OUTPUT: Success/Failure |
| 2556 | * |
| 2557 | * This IOCTL is used to add TSPEC for each AC. |
| 2558 | * |
| 2559 | * @E.g: iwpriv wlan0 addTspec <handle> <tid> <dir> <psb> <up> <nomMsduSize> |
| 2560 | * <maxMsduSize> <minDataRate> <meanDataRate> |
| 2561 | * <peakDataRate> <maxBurstSize> <minPhyRate> |
| 2562 | * <sba> <minServiceIntv> <suspendIntv> |
| 2563 | * <burstSizeDefn> <ackPolicy> <inactivityPeriod> |
| 2564 | * <maxServiceIntv> |
| 2565 | * iwpriv wlan0 addTspec 7001 6 2 1 6 0x80D0 0x80D0 0x14500 0x14500 0x14500 |
| 2566 | * 0 0x5B8D80 0x2001 20 2000 0 0 0 2000 |
| 2567 | * wlan0 addTspec:3 |
| 2568 | * |
| 2569 | * Supported Feature: WMM |
| 2570 | * |
| 2571 | * Usage: Internal/External |
| 2572 | * |
| 2573 | * </ioctl> |
| 2574 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2575 | #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2576 | /* |
| 2577 | * <ioctl> |
| 2578 | * delTspec - Delete TSPEC entry for each AC |
| 2579 | * |
| 2580 | * @INPUT: 1 TSPEC param |
| 2581 | * @[arg0]: handle |
| 2582 | * |
| 2583 | * @OUTPUT: Success/Failure |
| 2584 | * |
| 2585 | * This IOCTL is used to delete TSPEC entry for each AC. |
| 2586 | * |
| 2587 | * @E.g: iwpriv wlan0 delTspec <handle> |
| 2588 | * iwpriv wlan0 delTspec 7001 |
| 2589 | * wlan0 delTspec:16 |
| 2590 | * |
| 2591 | * Supported Feature: WMM |
| 2592 | * |
| 2593 | * Usage: Internal/External |
| 2594 | * |
| 2595 | * </ioctl> |
| 2596 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2597 | #define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11) |
Sreelakshmi Konamki | 9be8d41 | 2017-03-01 10:29:08 +0530 | [diff] [blame] | 2598 | /* |
| 2599 | * <ioctl> |
| 2600 | * getTspec - Get TSPEC entry for each AC |
| 2601 | * |
| 2602 | * @INPUT: 1 TSPEC param |
| 2603 | * @[arg0]: handle |
| 2604 | * |
| 2605 | * @OUTPUT: Success/Failure |
| 2606 | * |
| 2607 | * This IOCTL is used to get TSPEC entry for each AC. |
| 2608 | * |
| 2609 | * @E.g: iwpriv wlan0 getTspec <handle> |
| 2610 | * iwpriv wlan0 getTspec 7001 |
| 2611 | * wlan0 delTspec:18 |
| 2612 | * |
| 2613 | * Supported Feature: WMM |
| 2614 | * |
| 2615 | * Usage: Internal/External |
| 2616 | * |
| 2617 | * </ioctl> |
| 2618 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2619 | #define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13) |
| 2620 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2621 | /* (SIOCIWFIRSTPRIV + 10) is currently unused */ |
| 2622 | /* (SIOCIWFIRSTPRIV + 12) is currently unused */ |
| 2623 | /* (SIOCIWFIRSTPRIV + 14) is currently unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 2624 | #define WLAN_PRIV_SET_NONE_GET_THREE_INT (SIOCIWFIRSTPRIV + 15) |
| 2625 | #define WE_GET_TSF 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2626 | /* (SIOCIWFIRSTPRIV + 16) is currently unused */ |
| 2627 | /* (SIOCIWFIRSTPRIV + 17) is currently unused */ |
| 2628 | /* (SIOCIWFIRSTPRIV + 19) is currently unused */ |
| 2629 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2630 | #define WLAN_PRIV_SET_FTIES (SIOCIWFIRSTPRIV + 20) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2631 | |
| 2632 | /* Private ioctl for setting the host offload feature */ |
| 2633 | #define WLAN_PRIV_SET_HOST_OFFLOAD (SIOCIWFIRSTPRIV + 18) |
| 2634 | |
| 2635 | /* Private ioctl to get the statistics */ |
| 2636 | #define WLAN_GET_WLAN_STATISTICS (SIOCIWFIRSTPRIV + 21) |
| 2637 | |
| 2638 | /* Private ioctl to set the Keep Alive Params */ |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2639 | /* |
| 2640 | * <ioctl> |
| 2641 | * setKeepAlive - Set the keep alive feature |
| 2642 | * |
| 2643 | * @INPUT: 28 bytes of information in the order of packet type, time period |
| 2644 | * host IPv4 address, destination IPv4 address, destination MAC address, bssID |
| 2645 | * |
| 2646 | * @OUTPUT: None |
| 2647 | * |
| 2648 | * This IOCTL sets the keep alive feature to send either NULL |
| 2649 | * or unsolicited ARP response packets |
| 2650 | * |
| 2651 | * @E.g: iwpriv wlan0 setKeepAlive |
| 2652 | * |
| 2653 | * Supported Feature: STA |
| 2654 | * |
| 2655 | * Usage: Internal/External |
| 2656 | * |
| 2657 | * </ioctl> |
| 2658 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2659 | #define WLAN_SET_KEEPALIVE_PARAMS (SIOCIWFIRSTPRIV + 22) |
| 2660 | |
| 2661 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2662 | /* Private ioctl to set the packet filtering params */ |
| 2663 | #define WLAN_SET_PACKET_FILTER_PARAMS (SIOCIWFIRSTPRIV + 23) |
| 2664 | #endif |
| 2665 | |
| 2666 | |
| 2667 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2668 | /* Private ioctl to get the statistics */ |
| 2669 | #define WLAN_SET_PNO (SIOCIWFIRSTPRIV + 24) |
| 2670 | #endif |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2671 | /* |
| 2672 | * <ioctl> |
| 2673 | * SETBAND - Set the operational band |
| 2674 | * |
| 2675 | * @INPUT: 0 to Auto, 1 to 5 GHz and 2 to 2.4 GHz |
| 2676 | * |
| 2677 | * @OUTPUT: None |
| 2678 | * |
| 2679 | * This IOCTL Set the operational band If the new band is different from the |
| 2680 | * current operational band, it aborts the pending scan requests, flushes |
| 2681 | * the existing scan results, and then change * the band capability |
| 2682 | * |
| 2683 | * @E.g: iwpriv wlan0 SETBAND <value> |
| 2684 | * |
| 2685 | * Supported Feature: STA |
| 2686 | * |
| 2687 | * Usage: Internal/External |
| 2688 | * |
| 2689 | * </ioctl> |
| 2690 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2691 | #define WLAN_SET_BAND_CONFIG (SIOCIWFIRSTPRIV + 25) |
| 2692 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 2693 | #define WLAN_PRIV_SET_MCBC_FILTER (SIOCIWFIRSTPRIV + 26) |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 2694 | /* (SIOCIWFIRSTPRIV + 27) is currently unused */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2695 | |
| 2696 | /* Private ioctls and their sub-ioctls */ |
| 2697 | #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 2698 | #define WE_SET_SMPS_PARAM 1 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2699 | #define WE_SET_FW_CRASH_INJECT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2700 | #define WE_DUMP_DP_TRACE_LEVEL 3 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 2701 | /* Private sub ioctl for enabling and setting histogram interval of profiling */ |
| 2702 | #define WE_ENABLE_FW_PROFILE 4 |
| 2703 | #define WE_SET_FW_PROFILE_HIST_INTVL 5 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2704 | |
Rajeev Kumar | 9bb2e85 | 2016-09-24 12:29:25 -0700 | [diff] [blame] | 2705 | /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2706 | #define WE_SET_WLAN_SUSPEND 6 |
| 2707 | #define WE_SET_WLAN_RESUME 7 |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 2708 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 2709 | /* |
| 2710 | * <ioctl> |
| 2711 | * log_buffer - prints host/target related communication logs via dmesg |
| 2712 | * |
| 2713 | * @INPUT: Log Id, Count |
| 2714 | * |
| 2715 | * Log Id: |
| 2716 | * 0) HTC_CREDIT_HISTORY_LOG |
| 2717 | * 1) COMMAND_LOG, |
| 2718 | * 2) COMMAND_TX_CMP_LOG, |
| 2719 | * 3) MGMT_COMMAND_LOG, |
| 2720 | * 4) MGMT_COMMAND_TX_CMP_LOG, |
| 2721 | * 5) EVENT_LOG, |
| 2722 | * 6) RX_EVENT_LOG, |
| 2723 | * 7) MGMT_EVENT_LOG |
| 2724 | * |
| 2725 | * @OUTPUT: None |
| 2726 | * |
| 2727 | * @E.g: |
| 2728 | * # print up to 10 of the most recent records from HTC Credit History |
| 2729 | * iwpriv wlan0 log_buffer 0 10 |
| 2730 | * # print up to 3 of the most recent records from Event Log |
| 2731 | * iwpriv wlan0 log_buffer 5 3 |
| 2732 | * |
| 2733 | * Supported Feature: WLAN Trace |
| 2734 | * |
| 2735 | * Usage: Internal/External |
| 2736 | * |
| 2737 | * </ioctl> |
| 2738 | */ |
| 2739 | #define WE_LOG_BUFFER 8 |
| 2740 | |
| 2741 | enum host_target_comm_log { |
| 2742 | HTC_CREDIT_HISTORY_LOG = 0, |
| 2743 | COMMAND_LOG, |
| 2744 | COMMAND_TX_CMP_LOG, |
| 2745 | MGMT_COMMAND_LOG, |
| 2746 | MGMT_COMMAND_TX_CMP_LOG, |
| 2747 | EVENT_LOG, |
| 2748 | RX_EVENT_LOG, |
| 2749 | MGMT_EVENT_LOG |
| 2750 | }; |
| 2751 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2752 | /* (SIOCIWFIRSTPRIV + 29) is currently unused */ |
| 2753 | |
| 2754 | /* 802.11p IOCTL */ |
| 2755 | #define WLAN_SET_DOT11P_CHANNEL_SCHED (SIOCIWFIRSTPRIV + 30) |
| 2756 | |
Sen, Devendra | 9ca8c43 | 2017-02-23 15:10:26 +0530 | [diff] [blame] | 2757 | /* |
| 2758 | * <ioctl> |
| 2759 | * getLinkSpeed - Gets the current link speed in Mbps |
| 2760 | * |
| 2761 | * @INPUT: None |
| 2762 | * |
| 2763 | * @OUTPUT: linkspeed in mbps |
| 2764 | * wlan0 getLinkSpeed:7 |
| 2765 | * |
| 2766 | * This IOCTL is used get the current link speed in Mbps |
| 2767 | * |
| 2768 | * @E.g: iwpriv wlan0 getLinkSpeed |
| 2769 | * |
| 2770 | * Supported Feature: STA |
| 2771 | * |
| 2772 | * Usage: Internal/External |
| 2773 | * |
| 2774 | * </ioctl> |
| 2775 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2776 | #define WLAN_GET_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 2777 | |
| 2778 | #define WLAN_STATS_INVALID 0 |
| 2779 | #define WLAN_STATS_RETRY_CNT 1 |
| 2780 | #define WLAN_STATS_MUL_RETRY_CNT 2 |
| 2781 | #define WLAN_STATS_TX_FRM_CNT 3 |
| 2782 | #define WLAN_STATS_RX_FRM_CNT 4 |
| 2783 | #define WLAN_STATS_FRM_DUP_CNT 5 |
| 2784 | #define WLAN_STATS_FAIL_CNT 6 |
| 2785 | #define WLAN_STATS_RTS_FAIL_CNT 7 |
| 2786 | #define WLAN_STATS_ACK_FAIL_CNT 8 |
| 2787 | #define WLAN_STATS_RTS_SUC_CNT 9 |
| 2788 | #define WLAN_STATS_RX_DISCARD_CNT 10 |
| 2789 | #define WLAN_STATS_RX_ERROR_CNT 11 |
| 2790 | #define WLAN_STATS_TX_BYTE_CNT 12 |
| 2791 | |
| 2792 | #define WLAN_STATS_RX_BYTE_CNT 13 |
| 2793 | #define WLAN_STATS_RX_RATE 14 |
| 2794 | #define WLAN_STATS_TX_RATE 15 |
| 2795 | |
| 2796 | #define WLAN_STATS_RX_UC_BYTE_CNT 16 |
| 2797 | #define WLAN_STATS_RX_MC_BYTE_CNT 17 |
| 2798 | #define WLAN_STATS_RX_BC_BYTE_CNT 18 |
| 2799 | #define WLAN_STATS_TX_UC_BYTE_CNT 19 |
| 2800 | #define WLAN_STATS_TX_MC_BYTE_CNT 20 |
| 2801 | #define WLAN_STATS_TX_BC_BYTE_CNT 21 |
| 2802 | |
| 2803 | #define FILL_TLV(__p, __type, __size, __val, __tlen) do { \ |
| 2804 | if ((__tlen + __size + 2) < WE_MAX_STR_LEN) { \ |
| 2805 | *__p++ = __type; \ |
| 2806 | *__p++ = __size; \ |
| 2807 | memcpy(__p, __val, __size); \ |
| 2808 | __p += __size; \ |
| 2809 | __tlen += __size + 2; \ |
| 2810 | } else { \ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2811 | hdd_err("FILL_TLV Failed!!!"); \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2812 | } \ |
| 2813 | } while (0) |
| 2814 | |
| 2815 | #define VERSION_VALUE_MAX_LEN 32 |
| 2816 | |
| 2817 | #define TX_PER_TRACKING_DEFAULT_RATIO 5 |
| 2818 | #define TX_PER_TRACKING_MAX_RATIO 10 |
| 2819 | #define TX_PER_TRACKING_DEFAULT_WATERMARK 5 |
| 2820 | |
| 2821 | #define WLAN_ADAPTER 0 |
| 2822 | #define P2P_ADAPTER 1 |
| 2823 | |
| 2824 | /** |
| 2825 | * mem_alloc_copy_from_user_helper - copy from user helper |
| 2826 | * @wrqu_data: wireless extensions request data |
| 2827 | * @len: length of @wrqu_data |
| 2828 | * |
| 2829 | * Helper function to allocate buffer and copy user data. |
| 2830 | * |
| 2831 | * Return: On success return a pointer to a kernel buffer containing a |
| 2832 | * copy of the userspace data (with an additional NUL character |
| 2833 | * appended for safety). On failure return %NULL. |
| 2834 | */ |
| 2835 | void *mem_alloc_copy_from_user_helper(const __user void *wrqu_data, size_t len) |
| 2836 | { |
| 2837 | u8 *ptr = NULL; |
| 2838 | |
| 2839 | /* in order to protect the code, an extra byte is post |
| 2840 | * appended to the buffer and the null termination is added. |
| 2841 | * However, when allocating (len+1) byte of memory, we need to |
| 2842 | * make sure that there is no uint overflow when doing |
| 2843 | * addition. In theory check len < UINT_MAX protects the uint |
| 2844 | * overflow. For wlan private ioctl, the buffer size is much |
| 2845 | * less than UINT_MAX, as a good guess, now, it is assumed |
| 2846 | * that the private command buffer size is no greater than 4K |
| 2847 | * (4096 bytes). So we use 4096 as the upper boundary for now. |
| 2848 | */ |
| 2849 | if (len > MAX_USER_COMMAND_SIZE) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 2850 | hdd_err("Invalid length: %zu max: %u", |
| 2851 | len, MAX_USER_COMMAND_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2852 | return NULL; |
| 2853 | } |
| 2854 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2855 | ptr = qdf_mem_malloc(len + 1); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2856 | if (NULL == ptr) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2857 | hdd_err("unable to allocate memory"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2858 | return NULL; |
| 2859 | } |
| 2860 | |
| 2861 | if (copy_from_user(ptr, wrqu_data, len)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 2862 | hdd_err("failed to copy data to user buffer"); |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 2863 | qdf_mem_free(ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2864 | return NULL; |
| 2865 | } |
| 2866 | ptr[len] = '\0'; |
| 2867 | return ptr; |
| 2868 | } |
| 2869 | |
| 2870 | /** |
| 2871 | * hdd_priv_get_data() - Get pointer to ioctl private data |
| 2872 | * @p_priv_data: pointer to iw_point struct to be filled |
| 2873 | * @wrqu: Pointer to IOCTL Data received from userspace |
| 2874 | * |
| 2875 | * Helper function to get compatible struct iw_point passed to ioctl |
| 2876 | * |
| 2877 | * Return - 0 if p_priv_data successfully filled, error otherwise |
| 2878 | */ |
| 2879 | int hdd_priv_get_data(struct iw_point *p_priv_data, union iwreq_data *wrqu) |
| 2880 | { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2881 | if ((NULL == p_priv_data) || (NULL == wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2882 | return -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 2883 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2884 | #ifdef CONFIG_COMPAT |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 2885 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2886 | struct compat_iw_point *p_compat_priv_data; |
| 2887 | |
| 2888 | /* Compat task: |
| 2889 | * typecast to compat structure and copy the members. |
| 2890 | */ |
| 2891 | p_compat_priv_data = (struct compat_iw_point *)&wrqu->data; |
| 2892 | |
| 2893 | p_priv_data->pointer = compat_ptr(p_compat_priv_data->pointer); |
| 2894 | p_priv_data->length = p_compat_priv_data->length; |
| 2895 | p_priv_data->flags = p_compat_priv_data->flags; |
| 2896 | } else { |
| 2897 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2898 | |
| 2899 | /* Non compat task: directly copy the structure. */ |
| 2900 | memcpy(p_priv_data, &wrqu->data, sizeof(struct iw_point)); |
| 2901 | |
| 2902 | #ifdef CONFIG_COMPAT |
| 2903 | } |
| 2904 | #endif /* #ifdef CONFIG_COMPAT */ |
| 2905 | |
| 2906 | return 0; |
| 2907 | } |
| 2908 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2909 | static int hdd_check_wext_control(enum hdd_wext_control wext_control, |
| 2910 | struct iw_request_info *info) |
| 2911 | { |
| 2912 | switch (wext_control) { |
| 2913 | default: |
| 2914 | case hdd_wext_disabled: |
| 2915 | hdd_err("Rejecting disabled ioctl %x", info->cmd); |
| 2916 | return -ENOTSUPP; |
| 2917 | case hdd_wext_deprecated: |
| 2918 | hdd_warn("Using deprecated ioctl %x", info->cmd); |
| 2919 | return 0; |
| 2920 | case hdd_wext_enabled: |
| 2921 | return 0; |
| 2922 | } |
| 2923 | } |
| 2924 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 2925 | int hdd_check_private_wext_control(struct hdd_context *hdd_ctx, |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 2926 | struct iw_request_info *info) |
| 2927 | { |
| 2928 | return hdd_check_wext_control(hdd_ctx->config->private_wext_control, |
| 2929 | info); |
| 2930 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2931 | |
| 2932 | /** |
| 2933 | * hdd_wlan_get_stats() - Get txrx stats in SAP mode |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 2934 | * @adapter: Pointer to the hdd adapter. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2935 | * @length: Size of the data copied |
| 2936 | * @buffer: Pointer to char buffer. |
| 2937 | * @buf_len: Length of the char buffer. |
| 2938 | * |
| 2939 | * This function called when the "iwpriv wlan0 get_stats" command is given. |
| 2940 | * It used to collect the txrx stats when the device is configured in SAP mode. |
| 2941 | * |
| 2942 | * Return - none |
| 2943 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 2944 | void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2945 | char *buffer, uint16_t buf_len) |
| 2946 | { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2947 | struct hdd_tx_rx_stats *stats = &adapter->hdd_stats.tx_rx_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2948 | uint32_t len = 0; |
| 2949 | uint32_t total_rx_pkt = 0, total_rx_dropped = 0; |
| 2950 | uint32_t total_rx_delv = 0, total_rx_refused = 0; |
| 2951 | int i = 0; |
| 2952 | |
| 2953 | for (; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2954 | total_rx_pkt += stats->rx_packets[i]; |
| 2955 | total_rx_dropped += stats->rx_dropped[i]; |
| 2956 | total_rx_delv += stats->rx_delivered[i]; |
| 2957 | total_rx_refused += stats->rx_refused[i]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2958 | } |
| 2959 | |
| 2960 | len = scnprintf(buffer, buf_len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2961 | "\nTransmit[%lu] - " |
Mohit Khanna | d0b63f5 | 2017-02-18 18:05:52 -0800 | [diff] [blame] | 2962 | "called %u, dropped %u orphan %u," |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2963 | "\n[dropped] BK %u, BE %u, VI %u, VO %u" |
| 2964 | "\n[classified] BK %u, BE %u, VI %u, VO %u" |
| 2965 | "\n\nReceive[%lu] - " |
| 2966 | "packets %u, dropped %u, delivered %u, refused %u" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2967 | "\n", |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2968 | qdf_system_ticks(), |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2969 | stats->tx_called, |
| 2970 | stats->tx_dropped, |
| 2971 | stats->tx_orphaned, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2972 | |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2973 | stats->tx_dropped_ac[SME_AC_BK], |
| 2974 | stats->tx_dropped_ac[SME_AC_BE], |
| 2975 | stats->tx_dropped_ac[SME_AC_VI], |
| 2976 | stats->tx_dropped_ac[SME_AC_VO], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2977 | |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2978 | stats->tx_classified_ac[SME_AC_BK], |
| 2979 | stats->tx_classified_ac[SME_AC_BE], |
| 2980 | stats->tx_classified_ac[SME_AC_VI], |
| 2981 | stats->tx_classified_ac[SME_AC_VO], |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2982 | qdf_system_ticks(), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2983 | total_rx_pkt, total_rx_dropped, total_rx_delv, total_rx_refused |
| 2984 | ); |
| 2985 | |
| 2986 | for (i = 0; i < NUM_CPUS; i++) { |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2987 | if (stats->rx_packets[i] == 0) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2988 | continue; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2989 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2990 | "Rx CPU[%d]:" |
| 2991 | "packets %u, dropped %u, delivered %u, refused %u\n", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 2992 | i, stats->rx_packets[i], stats->rx_dropped[i], |
| 2993 | stats->rx_delivered[i], stats->rx_refused[i]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2994 | } |
| 2995 | |
| 2996 | len += scnprintf(buffer + len, buf_len - len, |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2997 | "\nTX_FLOW" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2998 | "\nCurrent status: %s" |
| 2999 | "\ntx-flow timer start count %u" |
| 3000 | "\npause count %u, unpause count %u", |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 3001 | (stats->is_txflow_paused == true ? "PAUSED" : "UNPAUSED"), |
| 3002 | stats->txflow_timer_cnt, |
| 3003 | stats->txflow_pause_cnt, |
| 3004 | stats->txflow_unpause_cnt); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3005 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 3006 | len += cdp_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3007 | adapter->session_id, &buffer[len], (buf_len - len)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3008 | *length = len + 1; |
| 3009 | } |
| 3010 | |
| 3011 | /** |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3012 | * wlan_hdd_write_suspend_resume_stats() - Writes suspend/resume stats to buffer |
| 3013 | * @hdd_ctx: The Hdd context owning the stats to be written |
| 3014 | * @buffer: The char buffer to write to |
| 3015 | * @max_len: The maximum number of chars to write |
| 3016 | * |
| 3017 | * This assumes hdd_ctx has already been validated, and buffer is not NULL. |
| 3018 | * |
| 3019 | * Return - length of written content, negative number on error |
| 3020 | */ |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3021 | #ifdef QCA_SUPPORT_CP_STATS |
| 3022 | static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx, |
| 3023 | char *buffer, uint16_t max_len) |
| 3024 | { |
| 3025 | int ret; |
| 3026 | QDF_STATUS status; |
| 3027 | struct suspend_resume_stats *sr_stats; |
| 3028 | |
| 3029 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3030 | ret = scnprintf(buffer, max_len, |
| 3031 | "\n" |
| 3032 | "Suspends: %u\n" |
| 3033 | "Resumes: %u\n" |
| 3034 | "\n" |
| 3035 | "Suspend Fail Reasons\n" |
| 3036 | "\tIPA: %u\n" |
| 3037 | "\tRadar: %u\n" |
| 3038 | "\tRoam: %u\n" |
| 3039 | "\tScan: %u\n" |
| 3040 | "\tInitial Wakeup: %u\n" |
| 3041 | "\n", |
| 3042 | sr_stats->suspends, sr_stats->resumes, |
| 3043 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3044 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3045 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3046 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3047 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]); |
| 3048 | |
| 3049 | status = ucfg_mc_cp_stats_write_wow_stats(hdd_ctx->hdd_psoc, |
| 3050 | &buffer[ret], max_len - ret, |
| 3051 | &ret); |
| 3052 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3053 | hdd_err("Failed to get WoW stats"); |
| 3054 | return qdf_status_to_os_return(status); |
| 3055 | } |
| 3056 | |
| 3057 | return ret; |
| 3058 | } |
| 3059 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3060 | 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] | 3061 | char *buffer, uint16_t max_len) |
| 3062 | { |
| 3063 | QDF_STATUS status; |
| 3064 | struct suspend_resume_stats *sr_stats; |
| 3065 | struct sir_wake_lock_stats wow_stats; |
| 3066 | |
| 3067 | sr_stats = &hdd_ctx->suspend_resume_stats; |
| 3068 | |
| 3069 | status = wma_get_wakelock_stats(&wow_stats); |
| 3070 | if (QDF_IS_STATUS_ERROR(status)) { |
| 3071 | hdd_err("Failed to get WoW stats"); |
| 3072 | return qdf_status_to_os_return(status); |
| 3073 | } |
| 3074 | |
| 3075 | return scnprintf(buffer, max_len, |
| 3076 | "\n" |
| 3077 | "Suspends: %u\n" |
| 3078 | "Resumes: %u\n" |
| 3079 | "\n" |
| 3080 | "Suspend Fail Reasons\n" |
| 3081 | "\tIPA: %u\n" |
| 3082 | "\tRadar: %u\n" |
| 3083 | "\tRoam: %u\n" |
| 3084 | "\tScan: %u\n" |
| 3085 | "\tInitial Wakeup: %u\n" |
| 3086 | "\n" |
| 3087 | "WoW Wake Reasons\n" |
| 3088 | "\tunicast: %u\n" |
| 3089 | "\tbroadcast: %u\n" |
| 3090 | "\tIPv4 multicast: %u\n" |
| 3091 | "\tIPv6 multicast: %u\n" |
| 3092 | "\tIPv6 multicast RA: %u\n" |
| 3093 | "\tIPv6 multicast NS: %u\n" |
| 3094 | "\tIPv6 multicast NA: %u\n" |
| 3095 | "\tICMPv4: %u\n" |
| 3096 | "\tICMPv6: %u\n" |
| 3097 | "\tRSSI Breach: %u\n" |
| 3098 | "\tLow RSSI: %u\n" |
| 3099 | "\tG-Scan: %u\n" |
| 3100 | "\tPNO Complete: %u\n" |
| 3101 | "\tPNO Match: %u\n", |
| 3102 | sr_stats->suspends, |
| 3103 | sr_stats->resumes, |
| 3104 | sr_stats->suspend_fail[SUSPEND_FAIL_IPA], |
| 3105 | sr_stats->suspend_fail[SUSPEND_FAIL_RADAR], |
| 3106 | sr_stats->suspend_fail[SUSPEND_FAIL_ROAM], |
| 3107 | sr_stats->suspend_fail[SUSPEND_FAIL_SCAN], |
| 3108 | sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP], |
| 3109 | wow_stats.wow_ucast_wake_up_count, |
| 3110 | wow_stats.wow_bcast_wake_up_count, |
| 3111 | wow_stats.wow_ipv4_mcast_wake_up_count, |
| 3112 | wow_stats.wow_ipv6_mcast_wake_up_count, |
| 3113 | wow_stats.wow_ipv6_mcast_ra_stats, |
| 3114 | wow_stats.wow_ipv6_mcast_ns_stats, |
| 3115 | wow_stats.wow_ipv6_mcast_na_stats, |
| 3116 | wow_stats.wow_icmpv4_count, |
| 3117 | wow_stats.wow_icmpv6_count, |
| 3118 | wow_stats.wow_rssi_breach_wake_up_count, |
| 3119 | wow_stats.wow_low_rssi_wake_up_count, |
| 3120 | wow_stats.wow_gscan_wake_up_count, |
| 3121 | wow_stats.wow_pno_complete_wake_up_count, |
| 3122 | wow_stats.wow_pno_match_wake_up_count); |
| 3123 | } |
Naveen Rawat | 3ff5cff | 2018-01-29 14:31:16 -0800 | [diff] [blame] | 3124 | #endif |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 3125 | /** |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3126 | * hdd_wlan_list_fw_profile() - Get fw profiling points |
| 3127 | * @length: Size of the data copied |
| 3128 | * @buffer: Pointer to char buffer. |
| 3129 | * @buf_len: Length of the char buffer. |
| 3130 | * |
| 3131 | * This function called when the "iwpriv wlan0 listProfile" command is given. |
| 3132 | * It is used to get the supported profiling points in FW. |
| 3133 | * |
| 3134 | * Return - none |
| 3135 | */ |
| 3136 | void hdd_wlan_list_fw_profile(uint16_t *length, |
| 3137 | char *buffer, uint16_t buf_len) |
| 3138 | { |
| 3139 | uint32_t len = 0; |
| 3140 | |
| 3141 | len = scnprintf(buffer, buf_len, |
| 3142 | "PROF_CPU_IDLE: %u\n" |
| 3143 | "PROF_PPDU_PROC: %u\n" |
| 3144 | "PROF_PPDU_POST: %u\n" |
| 3145 | "PROF_HTT_TX_INPUT: %u\n" |
| 3146 | "PROF_MSDU_ENQ: %u\n" |
| 3147 | "PROF_PPDU_POST_HAL: %u\n" |
| 3148 | "PROF_COMPUTE_TX_TIME: %u\n", |
| 3149 | PROF_CPU_IDLE, |
| 3150 | PROF_PPDU_PROC, |
| 3151 | PROF_PPDU_POST, |
| 3152 | PROF_HTT_TX_INPUT, |
| 3153 | PROF_MSDU_ENQ, |
| 3154 | PROF_PPDU_POST_HAL, |
| 3155 | PROF_COMPUTE_TX_TIME); |
| 3156 | |
| 3157 | *length = len + 1; |
| 3158 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3159 | /** |
| 3160 | * hdd_display_stats_help() - print statistics help |
| 3161 | * |
| 3162 | * Return: none |
| 3163 | */ |
Jeff Johnson | a06efaa | 2018-04-18 09:43:21 -0700 | [diff] [blame] | 3164 | static void hdd_display_stats_help(void) |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3165 | { |
| 3166 | hdd_err("iwpriv wlan0 dumpStats [option] - dump statistics"); |
| 3167 | hdd_err("iwpriv wlan0 clearStats [option] - clear statistics"); |
| 3168 | hdd_err("options:"); |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3169 | hdd_err(" 1 -- TXRX PATH statistics"); |
| 3170 | hdd_err(" 2 -- TXRX HIST statistics"); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3171 | hdd_err(" 3 -- TSO statistics"); |
| 3172 | hdd_err(" 4 -- Network queue statistics"); |
| 3173 | hdd_err(" 5 -- Flow control statistics"); |
| 3174 | hdd_err(" 6 -- Per Layer statistics"); |
| 3175 | hdd_err(" 7 -- Copy engine interrupt statistics"); |
| 3176 | hdd_err(" 8 -- LRO statistics"); |
| 3177 | hdd_err(" 9 -- NAPI statistics"); |
| 3178 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 3179 | |
| 3180 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3181 | * hdd_wlan_dump_stats() - display dump Stats |
| 3182 | * @adapter: adapter handle |
| 3183 | * @value: value from user |
| 3184 | * |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3185 | * Return: 0 => success, error code on failure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3186 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3187 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3188 | { |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3189 | int ret = 0; |
| 3190 | QDF_STATUS status; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3191 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3192 | |
| 3193 | switch (value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3194 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3195 | wlan_hdd_display_tx_rx_histogram(hdd_ctx); |
| 3196 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3197 | case CDP_HDD_NETIF_OPER_HISTORY: |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 3198 | wlan_hdd_display_netif_queue_history |
| 3199 | (hdd_ctx, |
| 3200 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3201 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3202 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 3203 | hdd_display_hif_stats(); |
| 3204 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3205 | case CDP_LRO_STATS: |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3206 | hdd_lro_display_stats(hdd_ctx); |
Alok Kumar | f28ca24 | 2018-05-07 17:51:38 +0530 | [diff] [blame] | 3207 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 3208 | case CDP_NAPI_STATS: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3209 | if (hdd_display_napi_stats()) { |
| 3210 | hdd_err("error displaying napi stats"); |
| 3211 | ret = EFAULT; |
| 3212 | } |
Dhanashri Atre | e7d442a | 2016-07-14 18:20:29 -0700 | [diff] [blame] | 3213 | break; |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3214 | case CDP_DISCONNECT_STATS: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3215 | sme_display_disconnect_stats(hdd_ctx->mac_handle, |
| 3216 | adapter->session_id); |
Vignesh Viswanathan | 66c951d | 2017-09-06 12:23:42 +0530 | [diff] [blame] | 3217 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3218 | default: |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3219 | status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3220 | value, |
| 3221 | QDF_STATS_VERBOSITY_LEVEL_HIGH); |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3222 | if (status == QDF_STATUS_E_INVAL) { |
| 3223 | hdd_display_stats_help(); |
| 3224 | ret = EINVAL; |
| 3225 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3226 | break; |
| 3227 | } |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 3228 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3229 | } |
| 3230 | |
| 3231 | /** |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3232 | * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3233 | * @adapter: Adapter upon which the IBSS client is active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3234 | * @staIdx: Station index of the IBSS peer |
| 3235 | * |
| 3236 | * Return: QDF_STATUS_STATUS if the peer was found and displayed, |
| 3237 | * otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3238 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3239 | 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] | 3240 | uint8_t staIdx) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3241 | { |
| 3242 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3243 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3244 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3245 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3246 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3247 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3248 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3249 | hdd_get_ibss_peer_info_cb, |
| 3250 | false, staIdx); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3251 | |
| 3252 | if (QDF_STATUS_SUCCESS == status) { |
| 3253 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3254 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3255 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3256 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3257 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3258 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3259 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3260 | return QDF_STATUS_E_FAILURE; |
| 3261 | } |
| 3262 | |
| 3263 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3264 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", pPeerInfo->numPeers); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3265 | { |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3266 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3267 | uint32_t tx_rate = pPeerInfo->peerInfoParams[0].txRate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3268 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3269 | qdf_mem_copy(mac_addr, pPeerInfo->peerInfoParams[0]. |
| 3270 | mac_addr, sizeof(mac_addr)); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3271 | hdd_debug("PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3272 | mac_addr, (int)tx_rate, |
| 3273 | (int)pPeerInfo->peerInfoParams[0].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3274 | } |
| 3275 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3276 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3277 | } |
| 3278 | |
| 3279 | return status; |
| 3280 | } |
| 3281 | |
| 3282 | /** |
| 3283 | * hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3284 | * @adapter: Adapter upon which the IBSS clients are active |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3285 | * |
| 3286 | * Return: QDF_STATUS_STATUS if the peer information was retrieved and |
| 3287 | * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. |
| 3288 | */ |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3289 | 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] | 3290 | { |
| 3291 | QDF_STATUS status = QDF_STATUS_E_FAILURE; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3292 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3293 | struct hdd_station_ctx *pStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3294 | tSirPeerInfoRspParams *pPeerInfo = &pStaCtx->ibss_peer_info; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3295 | int i; |
| 3296 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3297 | INIT_COMPLETION(adapter->ibss_peer_info_comp); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3298 | status = sme_request_ibss_peer_info(mac_handle, adapter, |
Prakash Dhavali | 4c2a9fe | 2016-12-02 16:01:08 -0800 | [diff] [blame] | 3299 | hdd_get_ibss_peer_info_cb, |
| 3300 | true, 0xFF); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3301 | |
| 3302 | if (QDF_STATUS_SUCCESS == status) { |
| 3303 | unsigned long rc; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3304 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3305 | rc = wait_for_completion_timeout |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3306 | (&adapter->ibss_peer_info_comp, |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3307 | msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT)); |
| 3308 | if (!rc) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3309 | hdd_err("failed wait on ibss_peer_info_comp"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3310 | return QDF_STATUS_E_FAILURE; |
| 3311 | } |
| 3312 | |
| 3313 | /** Print the peer info */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3314 | hdd_debug("pPeerInfo->numIBSSPeers = %d ", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3315 | (int)pPeerInfo->numPeers); |
| 3316 | for (i = 0; i < pPeerInfo->numPeers; i++) { |
| 3317 | uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; |
| 3318 | uint32_t tx_rate; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3319 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3320 | tx_rate = pPeerInfo->peerInfoParams[i].txRate; |
| 3321 | qdf_mem_copy(mac_addr, |
| 3322 | pPeerInfo->peerInfoParams[i].mac_addr, |
| 3323 | sizeof(mac_addr)); |
| 3324 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3325 | hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d", |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 3326 | mac_addr, (int)tx_rate, |
| 3327 | (int)pPeerInfo->peerInfoParams[i].rssi); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3328 | } |
| 3329 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3330 | hdd_warn("Warning: sme_request_ibss_peer_info Request failed"); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 3331 | } |
| 3332 | |
| 3333 | return status; |
| 3334 | } |
| 3335 | |
| 3336 | /** |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3337 | * hdd_get_ldpc() - Get adapter LDPC |
| 3338 | * @adapter: adapter being queried |
| 3339 | * @value: where to store the value |
| 3340 | * |
| 3341 | * Return: 0 on success, negative errno on failure |
| 3342 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3343 | int hdd_get_ldpc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3344 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3345 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3346 | int ret; |
| 3347 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3348 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3349 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3350 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING); |
| 3351 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3352 | hdd_err("Failed to get LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3353 | } else { |
| 3354 | *value = ret; |
| 3355 | ret = 0; |
| 3356 | } |
| 3357 | return ret; |
| 3358 | } |
| 3359 | |
| 3360 | /** |
| 3361 | * hdd_set_ldpc() - Set adapter LDPC |
| 3362 | * @adapter: adapter being modified |
| 3363 | * @value: new LDPC value |
| 3364 | * |
| 3365 | * Return: 0 on success, negative errno on failure |
| 3366 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3367 | int hdd_set_ldpc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3368 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3369 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3370 | int ret; |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3371 | QDF_STATUS status; |
| 3372 | uint32_t cfg_value; |
| 3373 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 3374 | struct hdd_config *config = hdd_ctx->config; |
| 3375 | union { |
| 3376 | uint16_t cfg_value16; |
| 3377 | tSirMacHTCapabilityInfo ht_cap_info; |
| 3378 | } u; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3379 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3380 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3381 | if (value) { |
| 3382 | /* make sure HT capabilities allow this */ |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3383 | if (!config->enable_rx_ldpc) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3384 | hdd_err("LDCP not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3385 | return -EINVAL; |
| 3386 | } |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3387 | } else if (!config->enable_rx_ldpc) { |
| 3388 | hdd_err("LDCP is already disabled"); |
| 3389 | return 0; |
| 3390 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3391 | status = sme_cfg_get_int(mac_handle, WNI_CFG_HT_CAP_INFO, &cfg_value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3392 | if (QDF_STATUS_SUCCESS != status) { |
| 3393 | hdd_err("Failed to get HT capability info"); |
| 3394 | return -EIO; |
| 3395 | } |
| 3396 | u.cfg_value16 = cfg_value & 0xFFFF; |
| 3397 | |
| 3398 | u.ht_cap_info.advCodingCap = value; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3399 | status = sme_cfg_set_int(mac_handle, WNI_CFG_HT_CAP_INFO, |
| 3400 | u.cfg_value16); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3401 | if (QDF_STATUS_SUCCESS != status) { |
| 3402 | hdd_err("Failed to set HT capability info"); |
| 3403 | return -EIO; |
| 3404 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3405 | status = sme_cfg_set_int(mac_handle, WNI_CFG_VHT_LDPC_CODING_CAP, |
| 3406 | value); |
Kiran Kumar Lokere | e43a458 | 2018-05-08 19:54:03 -0700 | [diff] [blame] | 3407 | if (QDF_STATUS_SUCCESS != status) { |
| 3408 | hdd_err("Failed to set VHT LDPC capability info"); |
| 3409 | return -EIO; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3410 | } |
| 3411 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3412 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3413 | WNI_CFG_HT_CAP_INFO_ADVANCE_CODING, |
| 3414 | value); |
| 3415 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3416 | hdd_err("Failed to set LDPC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3417 | 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] | 3418 | if (ret) |
| 3419 | hdd_err("Failed to set HE LDPC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3420 | |
| 3421 | return ret; |
| 3422 | } |
| 3423 | |
| 3424 | /** |
| 3425 | * hdd_get_tx_stbc() - Get adapter TX STBC |
| 3426 | * @adapter: adapter being queried |
| 3427 | * @value: where to store the value |
| 3428 | * |
| 3429 | * Return: 0 on success, negative errno on failure |
| 3430 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3431 | int hdd_get_tx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3432 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3433 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3434 | int ret; |
| 3435 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3436 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3437 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3438 | WNI_CFG_HT_CAP_INFO_TX_STBC); |
| 3439 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3440 | hdd_err("Failed to get TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3441 | } else { |
| 3442 | *value = ret; |
| 3443 | ret = 0; |
| 3444 | } |
| 3445 | |
| 3446 | return ret; |
| 3447 | } |
| 3448 | |
| 3449 | /** |
| 3450 | * hdd_set_tx_stbc() - Set adapter TX STBC |
| 3451 | * @adapter: adapter being modified |
| 3452 | * @value: new TX STBC value |
| 3453 | * |
| 3454 | * Return: 0 on success, negative errno on failure |
| 3455 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3456 | int hdd_set_tx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3457 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3458 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3459 | int ret; |
| 3460 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3461 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3462 | if (value) { |
| 3463 | /* make sure HT capabilities allow this */ |
| 3464 | QDF_STATUS status; |
| 3465 | uint32_t cfg_value; |
| 3466 | union { |
| 3467 | uint16_t cfg_value16; |
| 3468 | tSirMacHTCapabilityInfo ht_cap_info; |
| 3469 | } u; |
| 3470 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3471 | status = sme_cfg_get_int(mac_handle, WNI_CFG_HT_CAP_INFO, |
| 3472 | &cfg_value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3473 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3474 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3475 | return -EIO; |
| 3476 | } |
| 3477 | u.cfg_value16 = cfg_value & 0xFFFF; |
| 3478 | if (!u.ht_cap_info.txSTBC) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3479 | hdd_err("TX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3480 | return -EINVAL; |
| 3481 | } |
| 3482 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3483 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3484 | WNI_CFG_HT_CAP_INFO_TX_STBC, |
| 3485 | value); |
| 3486 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3487 | hdd_err("Failed to set TX STBC value"); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3488 | 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] | 3489 | if (ret) |
| 3490 | hdd_err("Failed to set HE TX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3491 | |
| 3492 | return ret; |
| 3493 | } |
| 3494 | |
| 3495 | /** |
| 3496 | * hdd_get_rx_stbc() - Get adapter RX STBC |
| 3497 | * @adapter: adapter being queried |
| 3498 | * @value: where to store the value |
| 3499 | * |
| 3500 | * Return: 0 on success, negative errno on failure |
| 3501 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3502 | int hdd_get_rx_stbc(struct hdd_adapter *adapter, int *value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3503 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3504 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3505 | int ret; |
| 3506 | |
Dustin Brown | 491d54b | 2018-03-14 12:39:11 -0700 | [diff] [blame] | 3507 | hdd_enter(); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3508 | ret = sme_get_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3509 | WNI_CFG_HT_CAP_INFO_RX_STBC); |
| 3510 | if (ret < 0) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3511 | hdd_err("Failed to get RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3512 | } else { |
| 3513 | *value = ret; |
| 3514 | ret = 0; |
| 3515 | } |
| 3516 | |
| 3517 | return ret; |
| 3518 | } |
| 3519 | |
| 3520 | /** |
| 3521 | * hdd_set_rx_stbc() - Set adapter RX STBC |
| 3522 | * @adapter: adapter being modified |
| 3523 | * @value: new RX STBC value |
| 3524 | * |
| 3525 | * Return: 0 on success, negative errno on failure |
| 3526 | */ |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3527 | int hdd_set_rx_stbc(struct hdd_adapter *adapter, int value) |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3528 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3529 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3530 | int ret; |
| 3531 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3532 | hdd_debug("%d", value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3533 | if (value) { |
| 3534 | /* make sure HT capabilities allow this */ |
| 3535 | QDF_STATUS status; |
| 3536 | uint32_t cfg_value; |
| 3537 | union { |
| 3538 | uint16_t cfg_value16; |
| 3539 | tSirMacHTCapabilityInfo ht_cap_info; |
| 3540 | } u; |
| 3541 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3542 | status = sme_cfg_get_int(mac_handle, WNI_CFG_HT_CAP_INFO, |
| 3543 | &cfg_value); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3544 | if (QDF_STATUS_SUCCESS != status) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3545 | hdd_err("Failed to get HT capability info"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3546 | return -EIO; |
| 3547 | } |
| 3548 | u.cfg_value16 = cfg_value & 0xFFFF; |
| 3549 | if (!u.ht_cap_info.rxSTBC) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3550 | hdd_warn("RX STBC not supported"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3551 | return -EINVAL; |
| 3552 | } |
| 3553 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3554 | ret = sme_update_ht_config(mac_handle, adapter->session_id, |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3555 | WNI_CFG_HT_CAP_INFO_RX_STBC, |
| 3556 | value); |
| 3557 | if (ret) |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3558 | hdd_err("Failed to set RX STBC value"); |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3559 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3560 | 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] | 3561 | if (ret) |
| 3562 | hdd_err("Failed to set HE RX STBC value"); |
| 3563 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3564 | return ret; |
| 3565 | } |
| 3566 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3567 | int hdd_assemble_rate_code(uint8_t preamble, uint8_t nss, uint8_t rate) |
| 3568 | { |
| 3569 | int set_value; |
| 3570 | |
| 3571 | if (sme_is_feature_supported_by_fw(DOT11AX)) |
| 3572 | set_value = WMI_ASSEMBLE_RATECODE_V1(rate, nss, preamble); |
| 3573 | else |
| 3574 | set_value = (preamble << 6) | (nss << 4) | rate; |
| 3575 | |
| 3576 | return set_value; |
| 3577 | } |
| 3578 | |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 3579 | int hdd_set_11ax_rate(struct hdd_adapter *adapter, int set_value, |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 3580 | struct sap_config *sap_config) |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3581 | { |
| 3582 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 3583 | int ret; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3584 | mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle; |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3585 | |
| 3586 | if (!sap_config) { |
| 3587 | if (!sme_is_feature_supported_by_fw(DOT11AX)) { |
| 3588 | hdd_err("Target does not support 11ax"); |
| 3589 | return -EIO; |
| 3590 | } |
| 3591 | } else if (sap_config->SapHw_mode != eCSR_DOT11_MODE_11ax && |
| 3592 | sap_config->SapHw_mode != eCSR_DOT11_MODE_11ax_ONLY) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 3593 | hdd_err("Invalid hw mode, SAP hw_mode= 0x%x, ch = %d", |
| 3594 | sap_config->SapHw_mode, sap_config->channel); |
| 3595 | return -EIO; |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3596 | } |
| 3597 | |
| 3598 | if (set_value != 0xff) { |
| 3599 | rix = RC_2_RATE_IDX_11AX(set_value); |
| 3600 | preamble = WMI_RATE_PREAMBLE_HE; |
| 3601 | nss = HT_RC_2_STREAMS_11AX(set_value); |
| 3602 | |
| 3603 | set_value = hdd_assemble_rate_code(preamble, nss, rix); |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 3604 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3605 | ret = sme_set_auto_rate_he_ltf(mac_handle, adapter->session_id, |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 3606 | QCA_WLAN_HE_LTF_AUTO); |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3607 | } |
| 3608 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 3609 | hdd_info("SET_11AX_RATE val %d rix %d preamble %x nss %d", |
| 3610 | set_value, rix, preamble, nss); |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3611 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3612 | ret = wma_cli_set_command(adapter->session_id, |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 3613 | WMI_VDEV_PARAM_FIXED_RATE, |
| 3614 | set_value, VDEV_CMD); |
| 3615 | |
| 3616 | return ret; |
| 3617 | } |
| 3618 | |
Manjeet Singh | e80d6d8 | 2016-09-02 19:04:41 +0530 | [diff] [blame] | 3619 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3620 | * iw_get_linkspeed() - Get current link speed ioctl |
| 3621 | * @dev: device upon which the ioctl was received |
| 3622 | * @info: ioctl request information |
| 3623 | * @wrqu: ioctl request data |
| 3624 | * @extra: extra ioctl buffer |
| 3625 | * |
| 3626 | * Return: 0 on success, non-zero on error |
| 3627 | */ |
| 3628 | static int __iw_get_linkspeed(struct net_device *dev, |
| 3629 | struct iw_request_info *info, |
| 3630 | union iwreq_data *wrqu, char *extra) |
| 3631 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3632 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3633 | char *pLinkSpeed = (char *)extra; |
| 3634 | int len = sizeof(uint32_t) + 1; |
| 3635 | uint32_t link_speed = 0; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 3636 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3637 | int ret; |
| 3638 | int rc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3639 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 3640 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 3641 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3642 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3643 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 3644 | if (0 != ret) |
| 3645 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3646 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3647 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 3648 | if (0 != ret) |
| 3649 | return ret; |
| 3650 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3651 | ret = wlan_hdd_get_link_speed(adapter, &link_speed); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 3652 | if (0 != ret) |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 3653 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3654 | |
| 3655 | wrqu->data.length = len; |
| 3656 | /* return the linkspeed as a string */ |
| 3657 | rc = snprintf(pLinkSpeed, len, "%u", link_speed); |
| 3658 | if ((rc < 0) || (rc >= len)) { |
| 3659 | /* encoding or length error? */ |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3660 | hdd_err("Unable to encode link speed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3661 | return -EIO; |
| 3662 | } |
| 3663 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 3664 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3665 | /* a value is being successfully returned */ |
| 3666 | return 0; |
| 3667 | } |
| 3668 | |
| 3669 | static int iw_get_linkspeed(struct net_device *dev, |
| 3670 | struct iw_request_info *info, |
| 3671 | union iwreq_data *wrqu, char *extra) |
| 3672 | { |
| 3673 | int ret; |
| 3674 | |
| 3675 | cds_ssr_protect(__func__); |
| 3676 | ret = __iw_get_linkspeed(dev, info, wrqu, extra); |
| 3677 | cds_ssr_unprotect(__func__); |
| 3678 | |
| 3679 | return ret; |
| 3680 | } |
| 3681 | |
| 3682 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3683 | * wlan_hdd_update_phymode() - handle change in PHY mode |
| 3684 | * @net: device upon which PHY mode change was received |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3685 | * @mac_handle: umac handle for the driver |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3686 | * @new_phymode: new PHY mode for the device |
| 3687 | * @phddctx: pointer to the HDD context |
| 3688 | * |
| 3689 | * This function is called when the device is set to a new PHY mode. |
| 3690 | * It takes a holistic look at the desired PHY mode along with the |
| 3691 | * configured capabilities of the driver and the reported capabilities |
| 3692 | * of the hardware in order to correctly configure all PHY-related |
| 3693 | * parameters. |
| 3694 | * |
| 3695 | * Return: 0 on success, negative errno value on error |
| 3696 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3697 | 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] | 3698 | int new_phymode, struct hdd_context *phddctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3699 | { |
| 3700 | #ifdef QCA_HT_2040_COEX |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 3701 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(net); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3702 | QDF_STATUS halStatus = QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3703 | #endif |
| 3704 | bool band_24 = false, band_5g = false; |
| 3705 | bool ch_bond24 = false, ch_bond5g = false; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3706 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3707 | uint32_t chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3708 | uint32_t vhtchanwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3709 | eCsrPhyMode phymode = -EIO, old_phymode; |
Srinivas Girigowda | 2fb677c | 2017-03-25 15:35:34 -0700 | [diff] [blame] | 3710 | enum hdd_dot11_mode hdd_dot11mode = phddctx->config->dot11Mode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3711 | enum band_info curr_band = BAND_ALL; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3712 | int retval = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3713 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3714 | old_phymode = sme_get_phy_mode(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3715 | |
| 3716 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
| 3717 | sme_get_cb_phy_state_from_cb_ini_value(phddctx->config-> |
| 3718 | nChannelBondingMode24GHz)) |
| 3719 | ch_bond24 = true; |
| 3720 | |
| 3721 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
| 3722 | sme_get_cb_phy_state_from_cb_ini_value(phddctx->config-> |
| 3723 | nChannelBondingMode5GHz)) |
| 3724 | ch_bond5g = true; |
| 3725 | |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3726 | if (phddctx->config->nBandCapability == BAND_ALL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3727 | band_24 = band_5g = true; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3728 | else if (phddctx->config->nBandCapability == BAND_2G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3729 | band_24 = true; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3730 | else if (phddctx->config->nBandCapability == BAND_5G) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3731 | band_5g = true; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3732 | |
| 3733 | vhtchanwidth = phddctx->config->vhtChannelWidth; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3734 | 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] | 3735 | ch_bond24, ch_bond5g, band_24, band_5g, vhtchanwidth); |
| 3736 | |
| 3737 | switch (new_phymode) { |
| 3738 | case IEEE80211_MODE_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3739 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3740 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3741 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3742 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3743 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3744 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3745 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3746 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3747 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3748 | return -EIO; |
| 3749 | } |
| 3750 | break; |
| 3751 | case IEEE80211_MODE_11A: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3752 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11a); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3753 | 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] | 3754 | phymode = eCSR_DOT11_MODE_11a; |
| 3755 | hdd_dot11mode = eHDD_DOT11_MODE_11a; |
| 3756 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3757 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3758 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3759 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3760 | return -EIO; |
| 3761 | } |
| 3762 | break; |
| 3763 | case IEEE80211_MODE_11B: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3764 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11b); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3765 | 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] | 3766 | phymode = eCSR_DOT11_MODE_11b; |
| 3767 | hdd_dot11mode = eHDD_DOT11_MODE_11b; |
| 3768 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3769 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3770 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3771 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3772 | return -EIO; |
| 3773 | } |
| 3774 | break; |
| 3775 | case IEEE80211_MODE_11G: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3776 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11g); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3777 | 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] | 3778 | phymode = eCSR_DOT11_MODE_11g; |
| 3779 | hdd_dot11mode = eHDD_DOT11_MODE_11g; |
| 3780 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3781 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3782 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3783 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3784 | return -EIO; |
| 3785 | } |
| 3786 | break; |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 3787 | /* 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] | 3788 | * so setting phymode as eCSR_DOT11_MODE_11n and updating the band |
| 3789 | * and channel bonding in configuration to reflect MODE_11NA/MODE_11NG |
| 3790 | */ |
| 3791 | case IEEE80211_MODE_11NA_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3792 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3793 | 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] | 3794 | phymode = eCSR_DOT11_MODE_11n; |
| 3795 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3796 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3797 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3798 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3799 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3800 | return -EIO; |
| 3801 | } |
| 3802 | break; |
| 3803 | case IEEE80211_MODE_11NA_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3804 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3805 | 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] | 3806 | phymode = eCSR_DOT11_MODE_11n; |
| 3807 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3808 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3809 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3810 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3811 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3812 | return -EIO; |
| 3813 | } |
| 3814 | break; |
| 3815 | case IEEE80211_MODE_11NG_HT20: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3816 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3817 | 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] | 3818 | phymode = eCSR_DOT11_MODE_11n; |
| 3819 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3820 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3821 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3822 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3823 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3824 | return -EIO; |
| 3825 | } |
| 3826 | break; |
| 3827 | case IEEE80211_MODE_11NG_HT40: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3828 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3829 | 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] | 3830 | phymode = eCSR_DOT11_MODE_11n; |
| 3831 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3832 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3833 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3834 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3835 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3836 | return -EIO; |
| 3837 | } |
| 3838 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3839 | case IEEE80211_MODE_11AC_VHT20: |
| 3840 | case IEEE80211_MODE_11AC_VHT40: |
| 3841 | case IEEE80211_MODE_11AC_VHT80: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3842 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11ac); |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3843 | phymode = eCSR_DOT11_MODE_11ac; |
| 3844 | hdd_dot11mode = eHDD_DOT11_MODE_11ac; |
| 3845 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3846 | if (band_5g && band_24) { |
| 3847 | curr_band = BAND_ALL; |
| 3848 | break; |
| 3849 | } else if (band_5g) { |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3850 | curr_band = BAND_5G; |
Kiran Kumar Lokere | b04f7f8 | 2018-03-21 18:54:21 -0700 | [diff] [blame] | 3851 | break; |
| 3852 | } else if (new_phymode != IEEE80211_MODE_11AC_VHT80) { |
| 3853 | curr_band = BAND_2G; |
| 3854 | break; |
| 3855 | } |
| 3856 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
| 3857 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3858 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3859 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3860 | return -EIO; |
| 3861 | } |
| 3862 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3863 | case IEEE80211_MODE_2G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3864 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3865 | 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] | 3866 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3867 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3868 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3869 | curr_band = BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3870 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3871 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3872 | return -EIO; |
| 3873 | } |
| 3874 | break; |
| 3875 | case IEEE80211_MODE_5G_AUTO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3876 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_AUTO); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3877 | 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] | 3878 | phymode = eCSR_DOT11_MODE_AUTO; |
| 3879 | hdd_dot11mode = eHDD_DOT11_MODE_AUTO; |
| 3880 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
| 3881 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3882 | curr_band = BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3883 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3884 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3885 | return -EIO; |
| 3886 | } |
| 3887 | break; |
| 3888 | case IEEE80211_MODE_11AGN: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3889 | sme_set_phy_mode(mac_handle, eCSR_DOT11_MODE_11n); |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 3890 | if (hdd_reg_set_band(net, WLAN_HDD_UI_BAND_AUTO) == 0) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3891 | phymode = eCSR_DOT11_MODE_11n; |
| 3892 | hdd_dot11mode = eHDD_DOT11_MODE_11n; |
| 3893 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3894 | curr_band = BAND_ALL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3895 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3896 | sme_set_phy_mode(mac_handle, old_phymode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3897 | return -EIO; |
| 3898 | } |
| 3899 | break; |
| 3900 | default: |
| 3901 | return -EIO; |
| 3902 | } |
| 3903 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3904 | switch (new_phymode) { |
| 3905 | case IEEE80211_MODE_11AC_VHT20: |
| 3906 | chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3907 | vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 3908 | break; |
| 3909 | case IEEE80211_MODE_11AC_VHT40: |
| 3910 | vhtchanwidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 3911 | break; |
| 3912 | case IEEE80211_MODE_11AC_VHT80: |
| 3913 | vhtchanwidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 3914 | break; |
| 3915 | default: |
| 3916 | vhtchanwidth = phddctx->config->vhtChannelWidth; |
| 3917 | break; |
| 3918 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3919 | |
| 3920 | if (phymode != -EIO) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3921 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 3922 | if (!sme_config) { |
| 3923 | hdd_err("Failed to allocate memory for sme_config"); |
| 3924 | return -ENOMEM; |
| 3925 | } |
| 3926 | qdf_mem_zero(sme_config, sizeof(*sme_config)); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3927 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3928 | sme_config->csrConfig.phyMode = phymode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3929 | #ifdef QCA_HT_2040_COEX |
| 3930 | if (phymode == eCSR_DOT11_MODE_11n && |
| 3931 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3932 | sme_config->csrConfig.obssEnabled = false; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3933 | halStatus = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3934 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3935 | eHT_CHAN_HT20, false); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3936 | if (halStatus == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3937 | hdd_err("Failed to disable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3938 | retval = -EIO; |
| 3939 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3940 | } |
| 3941 | } else if (phymode == eCSR_DOT11_MODE_11n && |
| 3942 | chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3943 | sme_config->csrConfig.obssEnabled = true; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3944 | halStatus = sme_set_ht2040_mode(mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 3945 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3946 | eHT_CHAN_HT20, true); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 3947 | if (halStatus == QDF_STATUS_E_FAILURE) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3948 | hdd_err("Failed to enable OBSS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3949 | retval = -EIO; |
| 3950 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3951 | } |
| 3952 | } |
| 3953 | #endif |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3954 | sme_config->csrConfig.eBand = curr_band; |
| 3955 | sme_config->csrConfig.bandCapability = curr_band; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3956 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3957 | sme_config->csrConfig.Is11hSupportEnabled = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3958 | else |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3959 | sme_config->csrConfig.Is11hSupportEnabled = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3960 | phddctx->config->Is11hSupportEnabled; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 3961 | if (curr_band == BAND_2G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3962 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
Jeff Johnson | 3d72577 | 2018-04-28 17:20:56 -0700 | [diff] [blame] | 3963 | else if (curr_band == BAND_5G) |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3964 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3965 | else { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3966 | sme_config->csrConfig.channelBondingMode24GHz = chwidth; |
| 3967 | sme_config->csrConfig.channelBondingMode5GHz = chwidth; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3968 | } |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3969 | sme_config->csrConfig.nVhtChannelWidth = vhtchanwidth; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 3970 | sme_update_config(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3971 | |
| 3972 | phddctx->config->dot11Mode = hdd_dot11mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3973 | phddctx->config->nChannelBondingMode24GHz = |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3974 | sme_config->csrConfig.channelBondingMode24GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3975 | phddctx->config->nChannelBondingMode5GHz = |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3976 | sme_config->csrConfig.channelBondingMode5GHz; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3977 | phddctx->config->vhtChannelWidth = vhtchanwidth; |
Krunal Soni | df0f874 | 2016-09-26 14:56:31 -0700 | [diff] [blame] | 3978 | if (hdd_update_config_cfg(phddctx) == false) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 3979 | hdd_err("could not update config_dat"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 3980 | retval = -EIO; |
| 3981 | goto free; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3982 | } |
Rajeev Kumar Sirasanagandla | 4c9b675 | 2017-07-25 20:35:20 +0530 | [diff] [blame] | 3983 | |
| 3984 | if (band_5g) { |
| 3985 | struct ieee80211_supported_band *band; |
| 3986 | |
| 3987 | band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ]; |
| 3988 | if (phddctx->config->nChannelBondingMode5GHz) |
| 3989 | band->ht_cap.cap |= |
| 3990 | IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 3991 | else |
| 3992 | band->ht_cap.cap &= |
| 3993 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| 3994 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3995 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 3996 | 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] | 3997 | phymode, chwidth, curr_band, vhtchanwidth); |
| 3998 | } |
| 3999 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4000 | free: |
| 4001 | if (sme_config) |
| 4002 | qdf_mem_free(sme_config); |
| 4003 | return retval; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4004 | } |
| 4005 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4006 | static int hdd_validate_pdev_reset(int value) |
| 4007 | { |
| 4008 | if ((value < 1) || (value > 5)) { |
| 4009 | hdd_warn(" Invalid value %d: Use any one of the below values\n" |
| 4010 | " TX_FLUSH = 1\n" |
| 4011 | " WARM_RESET = 2\n" |
| 4012 | " COLD_RESET = 3\n" |
| 4013 | " WARM_RESET_RESTORE_CAL = 4\n" |
| 4014 | " COLD_RESET_RESTORE_CAL = 5", value); |
| 4015 | |
| 4016 | return -EINVAL; |
| 4017 | } |
| 4018 | |
| 4019 | return 0; |
| 4020 | } |
| 4021 | |
| 4022 | static int hdd_handle_pdev_reset(struct hdd_adapter *adapter, int value) |
| 4023 | { |
| 4024 | int ret; |
| 4025 | |
| 4026 | hdd_debug("%d", value); |
| 4027 | |
| 4028 | ret = hdd_validate_pdev_reset(value); |
| 4029 | if (ret) |
| 4030 | return ret; |
| 4031 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4032 | ret = wma_cli_set_command(adapter->session_id, |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 4033 | WMI_PDEV_PARAM_PDEV_RESET, |
| 4034 | value, PDEV_CMD); |
| 4035 | |
| 4036 | return ret; |
| 4037 | } |
| 4038 | |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4039 | static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width) |
| 4040 | { |
| 4041 | int errno; |
| 4042 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 4043 | ePhyChanBondState bonding_state; |
| 4044 | uint32_t bonding_mode; |
| 4045 | tSmeConfigParams *sme_config; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4046 | mac_handle_t mac_handle; |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4047 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4048 | mac_handle = hdd_ctx->mac_handle; |
| 4049 | if (!mac_handle) |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4050 | return -EINVAL; |
| 4051 | |
| 4052 | /* updating channel bonding only on 5Ghz */ |
| 4053 | hdd_debug("WMI_VDEV_PARAM_CHWIDTH val %d", ch_width); |
| 4054 | |
| 4055 | switch (ch_width) { |
| 4056 | case eHT_CHANNEL_WIDTH_20MHZ: |
| 4057 | bonding_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4058 | break; |
| 4059 | |
| 4060 | case eHT_CHANNEL_WIDTH_40MHZ: |
| 4061 | case eHT_CHANNEL_WIDTH_80MHZ: |
| 4062 | bonding_state = csr_convert_cb_ini_value_to_phy_cb_state( |
| 4063 | hdd_ctx->config->nChannelBondingMode5GHz); |
| 4064 | |
| 4065 | if (bonding_state == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) |
| 4066 | return -EINVAL; |
| 4067 | |
| 4068 | bonding_mode = hdd_ctx->config->nChannelBondingMode5GHz; |
| 4069 | break; |
| 4070 | |
| 4071 | default: |
| 4072 | hdd_err("Invalid channel width 0->20 1->40 2->80"); |
| 4073 | return -EINVAL; |
| 4074 | } |
| 4075 | |
| 4076 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4077 | if (!sme_config) { |
| 4078 | hdd_err("failed to allocate memory for sme_config"); |
| 4079 | return -ENOMEM; |
| 4080 | } |
| 4081 | |
| 4082 | errno = wma_cli_set_command(adapter->session_id, WMI_VDEV_PARAM_CHWIDTH, |
| 4083 | ch_width, VDEV_CMD); |
| 4084 | if (errno) |
| 4085 | goto free_config; |
| 4086 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4087 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4088 | sme_config->csrConfig.channelBondingMode5GHz = bonding_mode; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4089 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4090 | |
| 4091 | free_config: |
| 4092 | qdf_mem_free(sme_config); |
| 4093 | |
| 4094 | return errno; |
| 4095 | } |
| 4096 | |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4097 | static int hdd_we_set_11d_state(struct hdd_context *hdd_ctx, int state_11d) |
| 4098 | { |
| 4099 | tSmeConfigParams *sme_config; |
| 4100 | bool enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4101 | mac_handle_t mac_handle = hdd_ctx->mac_handle; |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4102 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4103 | if (!mac_handle) |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4104 | return -EINVAL; |
| 4105 | |
| 4106 | switch (state_11d) { |
| 4107 | case ENABLE_11D: |
| 4108 | enable_11d = true; |
| 4109 | break; |
| 4110 | case DISABLE_11D: |
| 4111 | enable_11d = false; |
| 4112 | break; |
| 4113 | default: |
| 4114 | return -EINVAL; |
| 4115 | } |
| 4116 | |
| 4117 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 4118 | if (!sme_config) { |
| 4119 | hdd_err("failed to allocate memory for sme_config"); |
| 4120 | return -ENOMEM; |
| 4121 | } |
| 4122 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4123 | sme_get_config_param(mac_handle, sme_config); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4124 | sme_config->csrConfig.Is11dSupportEnabled = enable_11d; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4125 | sme_update_config(mac_handle, sme_config); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4126 | |
| 4127 | qdf_mem_free(sme_config); |
| 4128 | |
Dustin Brown | ea82d56 | 2018-05-23 12:07:16 -0700 | [diff] [blame] | 4129 | hdd_debug("11D state=%d", enable_11d); |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4130 | |
| 4131 | return 0; |
| 4132 | } |
| 4133 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4134 | /** |
| 4135 | * iw_setint_getnone() - Generic "set integer" private ioctl handler |
| 4136 | * @dev: device upon which the ioctl was received |
| 4137 | * @info: ioctl request information |
| 4138 | * @wrqu: ioctl request data |
| 4139 | * @extra: ioctl extra data |
| 4140 | * |
| 4141 | * Return: 0 on success, non-zero on error |
| 4142 | */ |
| 4143 | static int __iw_setint_getnone(struct net_device *dev, |
| 4144 | struct iw_request_info *info, |
| 4145 | union iwreq_data *wrqu, char *extra) |
| 4146 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4147 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4148 | mac_handle_t mac_handle; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4149 | 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] | 4150 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4151 | int *value = (int *)extra; |
| 4152 | int sub_cmd = value[0]; |
| 4153 | int set_value = value[1]; |
| 4154 | int ret; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4155 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4156 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 4157 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 4158 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4159 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4160 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 4161 | if (0 != ret) |
| 4162 | return ret; |
| 4163 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 4164 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 4165 | if (0 != ret) |
| 4166 | return ret; |
| 4167 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4168 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4169 | switch (sub_cmd) { |
| 4170 | case WE_SET_11D_STATE: |
Dustin Brown | d90f61a | 2018-04-26 12:25:58 -0700 | [diff] [blame] | 4171 | ret = hdd_we_set_11d_state(hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4172 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4173 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4174 | case WE_SET_POWER: |
| 4175 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4176 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4177 | return -EINVAL; |
| 4178 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4179 | switch (set_value) { |
| 4180 | case 1: |
| 4181 | /* Enable PowerSave */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4182 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4183 | SME_PS_ENABLE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4184 | break; |
| 4185 | case 2: |
| 4186 | /* Disable PowerSave */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4187 | sme_ps_enable_disable(mac_handle, adapter->session_id, |
| 4188 | SME_PS_DISABLE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4189 | break; |
| 4190 | case 3: /* Enable UASPD */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4191 | sme_ps_uapsd_enable(mac_handle, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4192 | break; |
| 4193 | case 4: /* Disable UASPD */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4194 | sme_ps_uapsd_disable(mac_handle, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4195 | break; |
| 4196 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4197 | hdd_err("Invalid arg %d in WE_SET_POWER IOCTL", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4198 | set_value); |
| 4199 | ret = -EINVAL; |
| 4200 | break; |
| 4201 | } |
| 4202 | break; |
| 4203 | } |
| 4204 | |
| 4205 | case WE_SET_MAX_ASSOC: |
| 4206 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4207 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4208 | return -EINVAL; |
| 4209 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4210 | if ((WNI_CFG_ASSOC_STA_LIMIT_STAMIN > set_value) || |
| 4211 | (WNI_CFG_ASSOC_STA_LIMIT_STAMAX < set_value)) { |
| 4212 | ret = -EINVAL; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4213 | } 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] | 4214 | set_value) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4215 | != QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4216 | hdd_err("WNI_CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4217 | ret = -EIO; |
| 4218 | } |
| 4219 | break; |
| 4220 | } |
| 4221 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4222 | case WE_SET_DATA_INACTIVITY_TO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4223 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4224 | return -EINVAL; |
| 4225 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4226 | if ((set_value < CFG_DATA_INACTIVITY_TIMEOUT_MIN) || |
| 4227 | (set_value > CFG_DATA_INACTIVITY_TIMEOUT_MAX) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4228 | (sme_cfg_set_int(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4229 | WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4230 | set_value) == QDF_STATUS_E_FAILURE)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4231 | hdd_err("WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4232 | ret = -EINVAL; |
| 4233 | } |
| 4234 | break; |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4235 | case WE_SET_WOW_DATA_INACTIVITY_TO: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4236 | if (!mac_handle) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4237 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4238 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4239 | } |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4240 | |
| 4241 | if ((set_value < CFG_WOW_DATA_INACTIVITY_TIMEOUT_MIN) || |
| 4242 | (set_value > CFG_WOW_DATA_INACTIVITY_TIMEOUT_MAX) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4243 | (sme_cfg_set_int(mac_handle, |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 4244 | WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT, |
| 4245 | set_value) == QDF_STATUS_E_FAILURE)) { |
| 4246 | hdd_err("WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT fail"); |
| 4247 | ret = -EINVAL; |
| 4248 | } |
| 4249 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4250 | case WE_SET_MC_RATE: |
| 4251 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4252 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4253 | return -EINVAL; |
| 4254 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4255 | ret = wlan_hdd_set_mc_rate(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4256 | break; |
| 4257 | } |
| 4258 | case WE_SET_TX_POWER: |
| 4259 | { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 4260 | struct qdf_mac_addr bssid; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4261 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4262 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4263 | return -EINVAL; |
| 4264 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4265 | qdf_copy_macaddr(&bssid, &sta_ctx->conn_info.bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4266 | if (sme_set_tx_power |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4267 | (mac_handle, adapter->session_id, bssid, |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4268 | adapter->device_mode, |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4269 | set_value) != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4270 | hdd_err("Setting tx power failed"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4271 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4272 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4273 | } |
| 4274 | break; |
| 4275 | } |
| 4276 | case WE_SET_MAX_TX_POWER: |
| 4277 | { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 4278 | struct qdf_mac_addr bssid; |
| 4279 | struct qdf_mac_addr selfMac; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4283 | |
| 4284 | hdd_debug("Setting maximum tx power %d dBm", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4285 | set_value); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 4286 | qdf_copy_macaddr(&bssid, &sta_ctx->conn_info.bssId); |
| 4287 | qdf_copy_macaddr(&selfMac, &sta_ctx->conn_info.bssId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4288 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4289 | if (sme_set_max_tx_power(mac_handle, bssid, selfMac, set_value) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4290 | != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4291 | hdd_err("Setting maximum tx power failed"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4292 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4293 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4294 | } |
| 4295 | |
| 4296 | break; |
| 4297 | } |
| 4298 | case WE_SET_MAX_TX_POWER_2_4: |
| 4299 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4300 | 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] | 4301 | set_value); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4302 | if (sme_set_max_tx_power_per_band(BAND_2G, set_value) != |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4303 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4304 | hdd_err("Setting max tx power failed for 2.4 GHz band"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4305 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4306 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4307 | } |
| 4308 | |
| 4309 | break; |
| 4310 | } |
| 4311 | case WE_SET_MAX_TX_POWER_5_0: |
| 4312 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4313 | 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] | 4314 | set_value); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 4315 | if (sme_set_max_tx_power_per_band(BAND_5G, set_value) != |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4316 | QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4317 | hdd_err("Setting max tx power failed for 5.0 GHz band"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4318 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4319 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4320 | } |
| 4321 | |
| 4322 | break; |
| 4323 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4324 | |
| 4325 | case WE_SET_TM_LEVEL: |
| 4326 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4327 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4328 | return -EINVAL; |
| 4329 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4330 | hdd_debug("Set Thermal Mitigation Level %d", set_value); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4331 | (void)sme_set_thermal_level(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4332 | break; |
| 4333 | } |
| 4334 | |
| 4335 | case WE_SET_PHYMODE: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4336 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4337 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4338 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4339 | ret = wlan_hdd_update_phymode(dev, mac_handle, set_value, |
| 4340 | hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4341 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4342 | |
| 4343 | case WE_SET_NSS: |
| 4344 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4345 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4346 | return -EINVAL; |
| 4347 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4348 | hdd_debug("Set NSS = %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4349 | if ((set_value > 2) || (set_value <= 0)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4350 | hdd_err("NSS greater than 2 not supported"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4351 | ret = -EINVAL; |
| 4352 | } else { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 4353 | if (QDF_STATUS_SUCCESS != |
Kiran Kumar Lokere | 44a2943 | 2018-01-24 16:10:30 -0800 | [diff] [blame] | 4354 | hdd_update_nss(adapter, set_value)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4355 | ret = -EINVAL; |
| 4356 | } |
| 4357 | break; |
| 4358 | } |
| 4359 | |
| 4360 | case WE_SET_GTX_HT_MCS: |
| 4361 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4362 | hdd_debug("WMI_VDEV_PARAM_GTX_HT_MCS %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4363 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4364 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 4365 | set_value, GTX_CMD); |
| 4366 | break; |
| 4367 | } |
| 4368 | |
| 4369 | case WE_SET_GTX_VHT_MCS: |
| 4370 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4371 | hdd_debug("WMI_VDEV_PARAM_GTX_VHT_MCS %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4372 | 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_VHT_MCS, |
| 4375 | set_value, GTX_CMD); |
| 4376 | break; |
| 4377 | } |
| 4378 | |
| 4379 | case WE_SET_GTX_USRCFG: |
| 4380 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4381 | hdd_debug("WMI_VDEV_PARAM_GTX_USR_CFG %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4382 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4383 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4384 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 4385 | set_value, GTX_CMD); |
| 4386 | break; |
| 4387 | } |
| 4388 | |
| 4389 | case WE_SET_GTX_THRE: |
| 4390 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4391 | hdd_debug("WMI_VDEV_PARAM_GTX_THRE %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4392 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4393 | WMI_VDEV_PARAM_GTX_THRE, |
| 4394 | set_value, GTX_CMD); |
| 4395 | break; |
| 4396 | } |
| 4397 | |
| 4398 | case WE_SET_GTX_MARGIN: |
| 4399 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4400 | hdd_debug("WMI_VDEV_PARAM_GTX_MARGIN %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4401 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4402 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 4403 | set_value, GTX_CMD); |
| 4404 | break; |
| 4405 | } |
| 4406 | |
| 4407 | case WE_SET_GTX_STEP: |
| 4408 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4409 | hdd_debug("WMI_VDEV_PARAM_GTX_STEP %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4410 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4411 | WMI_VDEV_PARAM_GTX_STEP, |
| 4412 | set_value, GTX_CMD); |
| 4413 | break; |
| 4414 | } |
| 4415 | |
| 4416 | case WE_SET_GTX_MINTPC: |
| 4417 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4418 | hdd_debug("WMI_VDEV_PARAM_GTX_MINTPC %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4419 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4420 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 4421 | set_value, GTX_CMD); |
| 4422 | break; |
| 4423 | } |
| 4424 | |
| 4425 | case WE_SET_GTX_BWMASK: |
| 4426 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4427 | hdd_debug("WMI_VDEV_PARAM_GTX_BWMASK %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4428 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4429 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 4430 | set_value, GTX_CMD); |
| 4431 | break; |
| 4432 | } |
| 4433 | |
| 4434 | case WE_SET_LDPC: |
| 4435 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4436 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4437 | return -EINVAL; |
| 4438 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4439 | ret = hdd_set_ldpc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4440 | break; |
| 4441 | } |
| 4442 | |
| 4443 | case WE_SET_TX_STBC: |
| 4444 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4445 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4446 | return -EINVAL; |
| 4447 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4448 | ret = hdd_set_tx_stbc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4449 | break; |
| 4450 | } |
| 4451 | |
| 4452 | case WE_SET_RX_STBC: |
| 4453 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4454 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4455 | return -EINVAL; |
| 4456 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4457 | ret = hdd_set_rx_stbc(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4458 | break; |
| 4459 | } |
| 4460 | |
| 4461 | case WE_SET_SHORT_GI: |
| 4462 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4463 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4464 | return -EINVAL; |
| 4465 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4466 | hdd_debug("WMI_VDEV_PARAM_SGI val %d", set_value); |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4467 | if (set_value & HDD_AUTO_RATE_SGI) |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4468 | ret = sme_set_auto_rate_he_sgi(mac_handle, |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4469 | adapter->session_id, |
| 4470 | set_value); |
| 4471 | else |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4472 | ret = sme_update_ht_config(mac_handle, |
| 4473 | adapter->session_id, |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4474 | WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ, |
| 4475 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4476 | if (ret) |
Kiran Kumar Lokere | a006a30 | 2018-03-07 20:58:13 -0800 | [diff] [blame] | 4477 | hdd_err("Failed to set ShortGI value %d", set_value); |
| 4478 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4479 | break; |
| 4480 | } |
| 4481 | |
| 4482 | case WE_SET_RTSCTS: |
| 4483 | { |
| 4484 | uint32_t value; |
| 4485 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4486 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 4487 | return -EINVAL; |
| 4488 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 4489 | hdd_debug("WMI_VDEV_PARAM_ENABLE_RTSCTS val 0x%x", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4490 | |
| 4491 | if ((set_value & HDD_RTSCTS_EN_MASK) == |
| 4492 | HDD_RTSCTS_ENABLE) |
| 4493 | value = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4494 | (WLAN_HDD_GET_CTX(adapter))->config-> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4495 | RTSThreshold; |
| 4496 | else if (((set_value & HDD_RTSCTS_EN_MASK) == 0) |
| 4497 | || ((set_value & HDD_RTSCTS_EN_MASK) == |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4498 | HDD_CTS_ENABLE)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4499 | value = WNI_CFG_RTS_THRESHOLD_STAMAX; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4500 | } else { |
| 4501 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4502 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4503 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4504 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4505 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4506 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 4507 | set_value, VDEV_CMD); |
| 4508 | if (!ret) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4509 | if (sme_cfg_set_int(mac_handle, WNI_CFG_RTS_THRESHOLD, |
| 4510 | value) != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 4511 | hdd_err("FAILED TO SET RTSCTS"); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4512 | ret = -EIO; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4513 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4514 | } |
| 4515 | } |
| 4516 | |
| 4517 | break; |
| 4518 | } |
| 4519 | |
| 4520 | case WE_SET_CHWIDTH: |
Dustin Brown | 65a6f0d | 2018-04-26 10:54:41 -0700 | [diff] [blame] | 4521 | ret = hdd_we_set_ch_width(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4522 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4523 | |
| 4524 | case WE_SET_ANI_EN_DIS: |
| 4525 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4526 | hdd_debug("WMI_PDEV_PARAM_ANI_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4527 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4528 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4529 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 4530 | set_value, PDEV_CMD); |
| 4531 | break; |
| 4532 | } |
| 4533 | |
| 4534 | case WE_SET_ANI_POLL_PERIOD: |
| 4535 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4536 | hdd_debug("WMI_PDEV_PARAM_ANI_POLL_PERIOD val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4537 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4538 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4539 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 4540 | set_value, PDEV_CMD); |
| 4541 | break; |
| 4542 | } |
| 4543 | |
| 4544 | case WE_SET_ANI_LISTEN_PERIOD: |
| 4545 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4546 | hdd_debug("WMI_PDEV_PARAM_ANI_LISTEN_PERIOD val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4547 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4548 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4549 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 4550 | set_value, PDEV_CMD); |
| 4551 | break; |
| 4552 | } |
| 4553 | |
| 4554 | case WE_SET_ANI_OFDM_LEVEL: |
| 4555 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4556 | hdd_debug("WMI_PDEV_PARAM_ANI_OFDM_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4557 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4558 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4559 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 4560 | set_value, PDEV_CMD); |
| 4561 | break; |
| 4562 | } |
| 4563 | |
| 4564 | case WE_SET_ANI_CCK_LEVEL: |
| 4565 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4566 | hdd_debug("WMI_PDEV_PARAM_ANI_CCK_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4567 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4568 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4569 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 4570 | set_value, PDEV_CMD); |
| 4571 | break; |
| 4572 | } |
| 4573 | |
| 4574 | case WE_SET_DYNAMIC_BW: |
| 4575 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4576 | hdd_debug("WMI_PDEV_PARAM_DYNAMIC_BW val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4577 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4578 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4579 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 4580 | set_value, PDEV_CMD); |
| 4581 | break; |
| 4582 | } |
| 4583 | |
| 4584 | case WE_SET_CTS_CBW: |
| 4585 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4586 | hdd_debug("WE_SET_CTS_CBW val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4587 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4588 | WMI_PDEV_PARAM_CTS_CBW, |
| 4589 | set_value, PDEV_CMD); |
| 4590 | break; |
| 4591 | } |
| 4592 | |
| 4593 | case WE_SET_11N_RATE: |
| 4594 | { |
| 4595 | uint8_t preamble = 0, nss = 0, rix = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 4596 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4597 | hdd_debug("WMI_VDEV_PARAM_FIXED_RATE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4598 | set_value); |
| 4599 | |
| 4600 | if (set_value != 0xff) { |
| 4601 | rix = RC_2_RATE_IDX(set_value); |
| 4602 | if (set_value & 0x80) { |
| 4603 | preamble = WMI_RATE_PREAMBLE_HT; |
| 4604 | nss = HT_RC_2_STREAMS(set_value) - 1; |
| 4605 | } else { |
| 4606 | nss = 0; |
| 4607 | rix = RC_2_RATE_IDX(set_value); |
| 4608 | if (set_value & 0x10) { |
| 4609 | preamble = |
| 4610 | WMI_RATE_PREAMBLE_CCK; |
| 4611 | if (rix != 0x3) |
| 4612 | /* Enable Short |
| 4613 | * preamble always for |
| 4614 | * CCK except 1mbps |
| 4615 | */ |
| 4616 | rix |= 0x4; |
| 4617 | } else { |
| 4618 | preamble = |
| 4619 | WMI_RATE_PREAMBLE_OFDM; |
| 4620 | } |
| 4621 | } |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 4622 | set_value = hdd_assemble_rate_code(preamble, nss, rix); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4623 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4624 | 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] | 4625 | set_value, rix, preamble, nss); |
| 4626 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4627 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4628 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4629 | set_value, VDEV_CMD); |
| 4630 | break; |
| 4631 | } |
| 4632 | |
| 4633 | case WE_SET_VHT_RATE: |
| 4634 | { |
| 4635 | uint8_t preamble = 0, nss = 0, rix = 0; |
| 4636 | |
| 4637 | if (set_value != 0xff) { |
| 4638 | rix = RC_2_RATE_IDX_11AC(set_value); |
| 4639 | preamble = WMI_RATE_PREAMBLE_VHT; |
| 4640 | nss = HT_RC_2_STREAMS_11AC(set_value) - 1; |
| 4641 | |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 4642 | set_value = hdd_assemble_rate_code(preamble, nss, rix); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4643 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4644 | 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] | 4645 | set_value, rix, preamble, nss); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4646 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4647 | WMI_VDEV_PARAM_FIXED_RATE, |
| 4648 | set_value, VDEV_CMD); |
| 4649 | break; |
| 4650 | } |
| 4651 | |
| 4652 | case WE_SET_AMPDU: |
| 4653 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4654 | hdd_debug("SET AMPDU val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4655 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4656 | GEN_VDEV_PARAM_AMPDU, |
| 4657 | set_value, GEN_CMD); |
| 4658 | break; |
| 4659 | } |
| 4660 | |
| 4661 | case WE_SET_AMSDU: |
| 4662 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4663 | hdd_debug("SET AMSDU val %d", set_value); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4664 | if (set_value > 1) |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4665 | sme_set_amsdu(mac_handle, true); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4666 | else |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 4667 | sme_set_amsdu(mac_handle, false); |
Arif Hussain | 0e24680 | 2018-05-01 18:13:44 -0700 | [diff] [blame] | 4668 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4669 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4670 | GEN_VDEV_PARAM_AMSDU, |
| 4671 | set_value, GEN_CMD); |
Deepak Dhamdhere | 612392c | 2016-08-28 02:56:51 -0700 | [diff] [blame] | 4672 | /* Update the stored ini value */ |
| 4673 | if (!ret) |
| 4674 | hdd_ctx->config->max_amsdu_num = set_value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4675 | break; |
| 4676 | } |
| 4677 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4678 | case WE_SET_TX_CHAINMASK: |
| 4679 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4680 | hdd_debug("WMI_PDEV_PARAM_TX_CHAIN_MASK val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4681 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4682 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4683 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 4684 | set_value, PDEV_CMD); |
Abhishek Singh | 1571ca7 | 2018-04-17 15:14:21 +0530 | [diff] [blame] | 4685 | ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4686 | break; |
| 4687 | } |
| 4688 | |
| 4689 | case WE_SET_RX_CHAINMASK: |
| 4690 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4691 | hdd_debug("WMI_PDEV_PARAM_RX_CHAIN_MASK val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4692 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4693 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4694 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 4695 | set_value, PDEV_CMD); |
Abhishek Singh | 1571ca7 | 2018-04-17 15:14:21 +0530 | [diff] [blame] | 4696 | ret = hdd_set_antenna_mode(adapter, hdd_ctx, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4697 | break; |
| 4698 | } |
| 4699 | |
| 4700 | case WE_SET_TXPOW_2G: |
| 4701 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4702 | hdd_debug("WMI_PDEV_PARAM_TXPOWER_LIMIT2G val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4703 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4704 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4705 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 4706 | set_value, PDEV_CMD); |
| 4707 | break; |
| 4708 | } |
| 4709 | |
| 4710 | case WE_SET_TXPOW_5G: |
| 4711 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4712 | hdd_debug("WMI_PDEV_PARAM_TXPOWER_LIMIT5G val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4713 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4714 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4715 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 4716 | set_value, PDEV_CMD); |
| 4717 | break; |
| 4718 | } |
| 4719 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4720 | /* Firmware debug log */ |
| 4721 | case WE_DBGLOG_LOG_LEVEL: |
| 4722 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4723 | hdd_debug("WE_DBGLOG_LOG_LEVEL val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4724 | hdd_ctx->fw_log_settings.dl_loglevel = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4725 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4726 | WMI_DBGLOG_LOG_LEVEL, |
| 4727 | set_value, DBG_CMD); |
| 4728 | break; |
| 4729 | } |
| 4730 | |
| 4731 | case WE_DBGLOG_VAP_ENABLE: |
| 4732 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4733 | hdd_debug("WE_DBGLOG_VAP_ENABLE val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4734 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4735 | WMI_DBGLOG_VAP_ENABLE, |
| 4736 | set_value, DBG_CMD); |
| 4737 | break; |
| 4738 | } |
| 4739 | |
| 4740 | case WE_DBGLOG_VAP_DISABLE: |
| 4741 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4742 | hdd_debug("WE_DBGLOG_VAP_DISABLE val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4743 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4744 | WMI_DBGLOG_VAP_DISABLE, |
| 4745 | set_value, DBG_CMD); |
| 4746 | break; |
| 4747 | } |
| 4748 | |
| 4749 | case WE_DBGLOG_MODULE_ENABLE: |
| 4750 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4751 | hdd_debug("WE_DBGLOG_MODULE_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4752 | set_value); |
| 4753 | hdd_ctx->fw_log_settings.enable = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4754 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4755 | WMI_DBGLOG_MODULE_ENABLE, |
| 4756 | set_value, DBG_CMD); |
| 4757 | break; |
| 4758 | } |
| 4759 | |
| 4760 | case WE_DBGLOG_MODULE_DISABLE: |
| 4761 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4762 | hdd_debug("WE_DBGLOG_MODULE_DISABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4763 | set_value); |
| 4764 | hdd_ctx->fw_log_settings.enable = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4765 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4766 | WMI_DBGLOG_MODULE_DISABLE, |
| 4767 | set_value, DBG_CMD); |
| 4768 | break; |
| 4769 | } |
| 4770 | case WE_DBGLOG_MOD_LOG_LEVEL: |
| 4771 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4772 | hdd_debug("WE_DBGLOG_MOD_LOG_LEVEL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4773 | set_value); |
| 4774 | |
| 4775 | if (hdd_ctx->fw_log_settings.index >= MAX_MOD_LOGLEVEL) |
| 4776 | hdd_ctx->fw_log_settings.index = 0; |
| 4777 | |
| 4778 | hdd_ctx->fw_log_settings. |
| 4779 | dl_mod_loglevel[hdd_ctx->fw_log_settings.index] = |
| 4780 | set_value; |
| 4781 | hdd_ctx->fw_log_settings.index++; |
| 4782 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4783 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4784 | WMI_DBGLOG_MOD_LOG_LEVEL, |
| 4785 | set_value, DBG_CMD); |
| 4786 | break; |
| 4787 | } |
| 4788 | |
| 4789 | case WE_DBGLOG_TYPE: |
| 4790 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4791 | hdd_debug("WE_DBGLOG_TYPE val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4792 | hdd_ctx->fw_log_settings.dl_type = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4793 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4794 | WMI_DBGLOG_TYPE, |
| 4795 | set_value, DBG_CMD); |
| 4796 | break; |
| 4797 | } |
| 4798 | case WE_DBGLOG_REPORT_ENABLE: |
| 4799 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4800 | hdd_debug("WE_DBGLOG_REPORT_ENABLE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4801 | set_value); |
| 4802 | hdd_ctx->fw_log_settings.dl_report = set_value; |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4803 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4804 | WMI_DBGLOG_REPORT_ENABLE, |
| 4805 | set_value, DBG_CMD); |
| 4806 | break; |
| 4807 | } |
| 4808 | |
| 4809 | case WE_SET_TXRX_FWSTATS: |
| 4810 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4811 | hdd_debug("WE_SET_TXRX_FWSTATS val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4812 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4813 | WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID, |
| 4814 | set_value, VDEV_CMD); |
| 4815 | break; |
| 4816 | } |
| 4817 | |
| 4818 | case WE_TXRX_FWSTATS_RESET: |
| 4819 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4820 | hdd_debug("WE_TXRX_FWSTATS_RESET val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4821 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4822 | WMA_VDEV_TXRX_FWSTATS_RESET_CMDID, |
| 4823 | set_value, VDEV_CMD); |
| 4824 | break; |
| 4825 | } |
| 4826 | |
| 4827 | case WE_DUMP_STATS: |
| 4828 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4829 | hdd_debug("WE_DUMP_STATS val %d", set_value); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4830 | ret = hdd_wlan_dump_stats(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4831 | break; |
| 4832 | } |
| 4833 | |
| 4834 | case WE_CLEAR_STATS: |
| 4835 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4836 | hdd_debug("WE_CLEAR_STATS val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4837 | switch (set_value) { |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4838 | case CDP_HDD_STATS: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4839 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
| 4840 | memset(&adapter->hdd_stats, 0, |
| 4841 | sizeof(adapter->hdd_stats)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4842 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4843 | case CDP_TXRX_HIST_STATS: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4844 | wlan_hdd_clear_tx_rx_histogram(hdd_ctx); |
| 4845 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4846 | case CDP_HDD_NETIF_OPER_HISTORY: |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4847 | wlan_hdd_clear_netif_queue_history(hdd_ctx); |
| 4848 | break; |
Venkata Sharath Chandra Manchala | 71032b6 | 2017-03-29 12:30:45 -0700 | [diff] [blame] | 4849 | case CDP_HIF_STATS: |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 4850 | hdd_clear_hif_stats(); |
| 4851 | break; |
Yun Park | 1027e8c | 2017-10-13 15:17:37 -0700 | [diff] [blame] | 4852 | case CDP_NAPI_STATS: |
| 4853 | hdd_clear_napi_stats(); |
| 4854 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4855 | default: |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 4856 | cdp_clear_stats(cds_get_context(QDF_MODULE_ID_SOC), |
| 4857 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4858 | } |
| 4859 | break; |
| 4860 | } |
| 4861 | |
| 4862 | case WE_PPS_PAID_MATCH: |
| 4863 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4864 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4865 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4866 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4867 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4868 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4869 | hdd_debug("WMI_VDEV_PPS_PAID_MATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4870 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4871 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4872 | WMI_VDEV_PPS_PAID_MATCH, |
| 4873 | set_value, PPS_CMD); |
| 4874 | break; |
| 4875 | } |
| 4876 | |
| 4877 | case WE_PPS_GID_MATCH: |
| 4878 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4879 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4880 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4881 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4882 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4883 | hdd_debug("WMI_VDEV_PPS_GID_MATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4884 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4885 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4886 | WMI_VDEV_PPS_GID_MATCH, |
| 4887 | set_value, PPS_CMD); |
| 4888 | break; |
| 4889 | } |
| 4890 | |
| 4891 | case WE_PPS_EARLY_TIM_CLEAR: |
| 4892 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4893 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4894 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4895 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4896 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4897 | hdd_debug(" WMI_VDEV_PPS_EARLY_TIM_CLEAR val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4898 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4899 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4900 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 4901 | set_value, PPS_CMD); |
| 4902 | break; |
| 4903 | } |
| 4904 | |
| 4905 | case WE_PPS_EARLY_DTIM_CLEAR: |
| 4906 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4907 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4908 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4909 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4910 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4911 | hdd_debug("WMI_VDEV_PPS_EARLY_DTIM_CLEAR val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4912 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4913 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4914 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 4915 | set_value, PPS_CMD); |
| 4916 | break; |
| 4917 | } |
| 4918 | |
| 4919 | case WE_PPS_EOF_PAD_DELIM: |
| 4920 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4921 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4922 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4923 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4924 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4925 | hdd_debug("WMI_VDEV_PPS_EOF_PAD_DELIM val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4926 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4927 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4928 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 4929 | set_value, PPS_CMD); |
| 4930 | break; |
| 4931 | } |
| 4932 | |
| 4933 | case WE_PPS_MACADDR_MISMATCH: |
| 4934 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4935 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4936 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4937 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4938 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4939 | hdd_debug("WMI_VDEV_PPS_MACADDR_MISMATCH val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4940 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4941 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4942 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 4943 | set_value, PPS_CMD); |
| 4944 | break; |
| 4945 | } |
| 4946 | |
| 4947 | case WE_PPS_DELIM_CRC_FAIL: |
| 4948 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4949 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4950 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4951 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4952 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4953 | hdd_debug("WMI_VDEV_PPS_DELIM_CRC_FAIL val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4954 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4955 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4956 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 4957 | set_value, PPS_CMD); |
| 4958 | break; |
| 4959 | } |
| 4960 | |
| 4961 | case WE_PPS_GID_NSTS_ZERO: |
| 4962 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4963 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4964 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4965 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4966 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4967 | hdd_debug("WMI_VDEV_PPS_GID_NSTS_ZERO val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4968 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4969 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4970 | WMI_VDEV_PPS_GID_NSTS_ZERO, |
| 4971 | set_value, PPS_CMD); |
| 4972 | break; |
| 4973 | } |
| 4974 | |
| 4975 | case WE_PPS_RSSI_CHECK: |
| 4976 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4977 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4978 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4979 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4980 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4981 | hdd_debug("WMI_VDEV_PPS_RSSI_CHECK val %d ", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4982 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4983 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4984 | WMI_VDEV_PPS_RSSI_CHECK, |
| 4985 | set_value, PPS_CMD); |
| 4986 | break; |
| 4987 | } |
| 4988 | |
| 4989 | case WE_PPS_5G_EBT: |
| 4990 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 4991 | if (adapter->device_mode != QDF_STA_MODE) { |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4992 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 4993 | break; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 4994 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4995 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 4996 | hdd_debug("WMI_VDEV_PPS_5G_EBT val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 4997 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4998 | WMI_VDEV_PPS_5G_EBT, |
| 4999 | set_value, PPS_CMD); |
| 5000 | break; |
| 5001 | } |
| 5002 | |
| 5003 | case WE_SET_HTSMPS: |
| 5004 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5005 | hdd_debug("WE_SET_HTSMPS val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5006 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5007 | WMI_STA_SMPS_FORCE_MODE_CMDID, |
| 5008 | set_value, VDEV_CMD); |
| 5009 | break; |
| 5010 | } |
| 5011 | |
| 5012 | case WE_SET_QPOWER_MAX_PSPOLL_COUNT: |
| 5013 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5014 | hdd_debug("WE_SET_QPOWER_MAX_PSPOLL_COUNT val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5015 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5016 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5017 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 5018 | set_value, QPOWER_CMD); |
| 5019 | break; |
| 5020 | } |
| 5021 | |
| 5022 | case WE_SET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 5023 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5024 | hdd_debug("WE_SET_QPOWER_MAX_TX_BEFORE_WAKE val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5025 | set_value); |
| 5026 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5027 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5028 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 5029 | set_value, QPOWER_CMD); |
| 5030 | break; |
| 5031 | } |
| 5032 | |
| 5033 | case WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 5034 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5035 | hdd_debug("WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5036 | set_value); |
| 5037 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5038 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5039 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 5040 | set_value, QPOWER_CMD); |
| 5041 | break; |
| 5042 | } |
| 5043 | |
| 5044 | case WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 5045 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5046 | hdd_debug("WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5047 | set_value); |
| 5048 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5049 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5050 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 5051 | set_value, QPOWER_CMD); |
| 5052 | break; |
| 5053 | } |
| 5054 | |
| 5055 | case WE_MCC_CONFIG_LATENCY: |
| 5056 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5057 | wlan_hdd_set_mcc_latency(adapter, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5058 | break; |
| 5059 | } |
| 5060 | |
| 5061 | case WE_MCC_CONFIG_QUOTA: |
| 5062 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5063 | hdd_debug("iwpriv cmd to set MCC quota with val %dms", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5064 | set_value); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5065 | ret = wlan_hdd_set_mcc_p2p_quota(adapter, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 5066 | set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5067 | break; |
| 5068 | } |
| 5069 | case WE_SET_DEBUG_LOG: |
| 5070 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5071 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 4f7f7c6 | 2017-10-05 08:53:41 -0700 | [diff] [blame] | 5072 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5073 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5074 | return -EINVAL; |
| 5075 | |
Nirav Shah | 1da7768 | 2016-05-03 20:16:39 +0530 | [diff] [blame] | 5076 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5077 | hdd_ctx->config->gEnableDebugLog = set_value; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5078 | sme_update_connect_debug(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5079 | break; |
| 5080 | } |
| 5081 | case WE_SET_EARLY_RX_ADJUST_ENABLE: |
| 5082 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5083 | hdd_debug("SET early_rx enable val %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5084 | if ((set_value == 0) || (set_value == 1)) |
| 5085 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5086 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5087 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE, |
| 5088 | set_value, VDEV_CMD); |
| 5089 | else |
| 5090 | ret = -EINVAL; |
| 5091 | break; |
| 5092 | } |
| 5093 | case WE_SET_EARLY_RX_TGT_BMISS_NUM: |
| 5094 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5095 | hdd_debug("SET early_rx bmiss val %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5096 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5097 | WMI_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM, |
| 5098 | set_value, VDEV_CMD); |
| 5099 | break; |
| 5100 | } |
| 5101 | case WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE: |
| 5102 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5103 | hdd_debug("SET early_rx bmiss sample cycle %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5104 | set_value); |
| 5105 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5106 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5107 | WMI_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 5108 | set_value, VDEV_CMD); |
| 5109 | break; |
| 5110 | } |
| 5111 | case WE_SET_EARLY_RX_SLOP_STEP: |
| 5112 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5113 | hdd_debug("SET early_rx bmiss slop step val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5114 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5115 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5116 | WMI_VDEV_PARAM_EARLY_RX_SLOP_STEP, |
| 5117 | set_value, VDEV_CMD); |
| 5118 | break; |
| 5119 | } |
| 5120 | case WE_SET_EARLY_RX_INIT_SLOP: |
| 5121 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5122 | hdd_debug("SET early_rx init slop step val %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5123 | set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5124 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5125 | WMI_VDEV_PARAM_EARLY_RX_INIT_SLOP, |
| 5126 | set_value, VDEV_CMD); |
| 5127 | break; |
| 5128 | } |
| 5129 | case WE_SET_EARLY_RX_ADJUST_PAUSE: |
| 5130 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5131 | hdd_debug("SET early_rx adjust pause %d", set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5132 | if ((set_value == 0) || (set_value == 1)) |
| 5133 | ret = wma_cli_set_command( |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5134 | adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5135 | WMI_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE, |
| 5136 | set_value, VDEV_CMD); |
| 5137 | else |
| 5138 | ret = -EINVAL; |
| 5139 | break; |
| 5140 | } |
| 5141 | case WE_SET_EARLY_RX_DRIFT_SAMPLE: |
| 5142 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5143 | hdd_debug("SET early_rx drift sample %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5144 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5145 | WMI_VDEV_PARAM_EARLY_RX_DRIFT_SAMPLE, |
| 5146 | set_value, VDEV_CMD); |
| 5147 | break; |
| 5148 | } |
| 5149 | case WE_SET_SCAN_DISABLE: |
| 5150 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5151 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5152 | return -EINVAL; |
| 5153 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5154 | hdd_debug("SET SCAN DISABLE %d", set_value); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5155 | sme_set_scan_disable(mac_handle, set_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5156 | break; |
| 5157 | } |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 5158 | case WE_START_FW_PROFILE: |
| 5159 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5160 | hdd_debug("WE_START_FW_PROFILE %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5161 | ret = wma_cli_set_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 5162 | WMI_WLAN_PROFILE_TRIGGER_CMDID, |
| 5163 | set_value, DBG_CMD); |
| 5164 | break; |
| 5165 | } |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5166 | case WE_SET_CHANNEL: |
| 5167 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5168 | hdd_debug("Set Channel %d Session ID %d mode %d", set_value, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5169 | adapter->session_id, adapter->device_mode); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5170 | if (!mac_handle) |
SaidiReddy Yenuga | 8cbd921 | 2017-02-15 15:35:29 +0530 | [diff] [blame] | 5171 | return -EINVAL; |
| 5172 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5173 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5174 | if ((QDF_STA_MODE == adapter->device_mode) || |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5175 | (QDF_P2P_CLIENT_MODE == adapter->device_mode)) { |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5176 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5177 | status = sme_ext_change_channel(mac_handle, |
| 5178 | set_value, |
| 5179 | adapter->session_id); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5180 | if (status != QDF_STATUS_SUCCESS) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5181 | hdd_err("Error in change channel status %d", |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5182 | status); |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5183 | ret = -EINVAL; |
| 5184 | } |
| 5185 | } else { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5186 | hdd_err("change channel not supported for device mode %d", |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5187 | adapter->device_mode); |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5188 | ret = -EINVAL; |
| 5189 | } |
| 5190 | break; |
| 5191 | } |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5192 | case WE_SET_CONC_SYSTEM_PREF: |
| 5193 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5194 | hdd_debug("New preference: %d", set_value); |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5195 | if (!((set_value >= CFG_CONC_SYSTEM_PREF_MIN) && |
| 5196 | (set_value <= CFG_CONC_SYSTEM_PREF_MAX))) { |
| 5197 | hdd_err("Invalid system preference %d", set_value); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5198 | ret = -EINVAL; |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5199 | break; |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5200 | } |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 5201 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 5202 | /* hdd_ctx, hdd_ctx->config are already checked for null */ |
| 5203 | hdd_ctx->config->conc_system_pref = set_value; |
| 5204 | break; |
| 5205 | } |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5206 | case WE_SET_11AX_RATE: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5207 | ret = hdd_set_11ax_rate(adapter, set_value, NULL); |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5208 | break; |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5209 | case WE_SET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5210 | hdd_debug("Set WMI_VDEV_PARAM_HE_DCM: %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5211 | ret = wma_cli_set_command(adapter->session_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5212 | WMI_VDEV_PARAM_HE_DCM, set_value, |
| 5213 | VDEV_CMD); |
| 5214 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5215 | case WE_SET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5216 | hdd_debug("Set WMI_VDEV_PARAM_HE_RANGE_EXT: %d", set_value); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5217 | ret = wma_cli_set_command(adapter->session_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5218 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5219 | set_value, VDEV_CMD); |
| 5220 | break; |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 5221 | case WE_SET_PDEV_RESET: |
| 5222 | ret = hdd_handle_pdev_reset(adapter, set_value); |
| 5223 | break; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5224 | case WE_SET_MODULATED_DTIM: |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5225 | if ((set_value < CFG_ENABLE_MODULATED_DTIM_MIN) || |
| 5226 | (set_value > CFG_ENABLE_MODULATED_DTIM_MAX)) { |
| 5227 | hdd_err("Invalid gEnableModuleDTIM value %d", |
| 5228 | set_value); |
| 5229 | return -EINVAL; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5230 | } |
Jeff Johnson | c66d310 | 2018-02-28 11:58:26 -0800 | [diff] [blame] | 5231 | |
| 5232 | hdd_ctx->config->enableModulatedDTIM = set_value; |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 5233 | break; |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 5234 | case WE_SET_PPDU_DUR: |
| 5235 | /*Validate set value for Min and Max range*/ |
| 5236 | if (!set_value || (set_value > 4000)) { |
| 5237 | hdd_err("Invalid ppdu duraion value: %d usec", |
| 5238 | set_value); |
| 5239 | return -EINVAL; |
| 5240 | } |
| 5241 | ret = wma_cli_set_command(adapter->session_id, |
| 5242 | WMI_PDEV_PARAM_SET_PPDU_DURATION_CMDID, |
| 5243 | set_value, PDEV_CMD); |
| 5244 | if (ret) |
| 5245 | hdd_err("SET_PPDU_DURATION_CMDID %d usec set failed", |
| 5246 | set_value); |
| 5247 | else |
| 5248 | hdd_debug("PDEV_PARAM_SET_PPDU_DUR_CMDID is set to %d", |
| 5249 | set_value); |
| 5250 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5251 | default: |
Rajeev Kumar | d056536 | 2018-03-01 12:02:01 -0800 | [diff] [blame] | 5252 | hdd_debug("Invalid sub command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5253 | ret = -EINVAL; |
| 5254 | break; |
| 5255 | } |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5256 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5257 | hdd_exit(); |
Dustin Brown | c88e596 | 2018-04-26 12:32:40 -0700 | [diff] [blame] | 5258 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5259 | return ret; |
| 5260 | } |
| 5261 | |
| 5262 | static int iw_setint_getnone(struct net_device *dev, |
| 5263 | struct iw_request_info *info, |
| 5264 | union iwreq_data *wrqu, |
| 5265 | char *extra) |
| 5266 | { |
| 5267 | int ret; |
| 5268 | |
| 5269 | cds_ssr_protect(__func__); |
| 5270 | ret = __iw_setint_getnone(dev, info, wrqu, extra); |
| 5271 | cds_ssr_unprotect(__func__); |
| 5272 | |
| 5273 | return ret; |
| 5274 | } |
| 5275 | |
| 5276 | /** |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5277 | * __iw_setnone_get_threeint() - return three value to up layer. |
| 5278 | * |
| 5279 | * @dev: pointer of net_device of this wireless card |
| 5280 | * @info: meta data about Request sent |
| 5281 | * @wrqu: include request info |
| 5282 | * @extra: buf used for in/Output |
| 5283 | * |
| 5284 | * Return: execute result |
| 5285 | */ |
| 5286 | static int __iw_setnone_get_threeint(struct net_device *dev, |
| 5287 | struct iw_request_info *info, |
| 5288 | union iwreq_data *wrqu, char *extra) |
| 5289 | { |
| 5290 | int ret = 0; /* success */ |
| 5291 | uint32_t *value = (int *)extra; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 5292 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5293 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5294 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5295 | hdd_enter_dev(dev); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5296 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5297 | if (0 != ret) |
| 5298 | return ret; |
| 5299 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5300 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5301 | if (0 != ret) |
| 5302 | return ret; |
| 5303 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5304 | hdd_debug("param = %d", value[0]); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5305 | switch (value[0]) { |
| 5306 | case WE_GET_TSF: |
| 5307 | ret = hdd_indicate_tsf(adapter, value, 3); |
| 5308 | break; |
| 5309 | default: |
| 5310 | hdd_err("Invalid IOCTL get_value command %d", value[0]); |
| 5311 | break; |
| 5312 | } |
| 5313 | return ret; |
| 5314 | } |
| 5315 | |
| 5316 | /** |
| 5317 | * iw_setnone_get_threeint() - return three value to up layer. |
| 5318 | * |
| 5319 | * @dev: pointer of net_device of this wireless card |
| 5320 | * @info: meta data about Request sent |
| 5321 | * @wrqu: include request info |
| 5322 | * @extra: buf used for in/Output |
| 5323 | * |
| 5324 | * Return: execute result |
| 5325 | */ |
| 5326 | static int iw_setnone_get_threeint(struct net_device *dev, |
| 5327 | struct iw_request_info *info, |
| 5328 | union iwreq_data *wrqu, char *extra) |
| 5329 | { |
| 5330 | int ret; |
| 5331 | |
| 5332 | cds_ssr_protect(__func__); |
| 5333 | ret = __iw_setnone_get_threeint(dev, info, wrqu, extra); |
| 5334 | cds_ssr_unprotect(__func__); |
| 5335 | |
| 5336 | return ret; |
| 5337 | } |
| 5338 | |
| 5339 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5340 | * iw_setchar_getnone() - Generic "set string" private ioctl handler |
| 5341 | * @dev: device upon which the ioctl was received |
| 5342 | * @info: ioctl request information |
| 5343 | * @wrqu: ioctl request data |
| 5344 | * @extra: ioctl extra data |
| 5345 | * |
| 5346 | * Return: 0 on success, non-zero on error |
| 5347 | */ |
| 5348 | static int __iw_setchar_getnone(struct net_device *dev, |
| 5349 | struct iw_request_info *info, |
| 5350 | union iwreq_data *wrqu, char *extra) |
| 5351 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5352 | QDF_STATUS vstatus; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5353 | int sub_cmd; |
| 5354 | int ret; |
| 5355 | char *pBuffer = NULL; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5356 | struct hdd_adapter *adapter = (netdev_priv(dev)); |
| 5357 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5358 | struct hdd_config *pConfig = hdd_ctx->config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5359 | struct iw_point s_priv_data; |
| 5360 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5361 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 5362 | |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5363 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5364 | hdd_err("permission check failed"); |
Mukul Sharma | 34777c6 | 2015-11-02 20:22:30 +0530 | [diff] [blame] | 5365 | return -EPERM; |
| 5366 | } |
| 5367 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5368 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5369 | if (0 != ret) |
| 5370 | return ret; |
| 5371 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5372 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5373 | if (0 != ret) |
| 5374 | return ret; |
| 5375 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5376 | /* helper function to get iwreq_data with compat handling. */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5377 | if (hdd_priv_get_data(&s_priv_data, wrqu)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5378 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5379 | |
| 5380 | /* make sure all params are correctly passed to function */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5381 | if ((NULL == s_priv_data.pointer) || (0 == s_priv_data.length)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5382 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5383 | |
| 5384 | sub_cmd = s_priv_data.flags; |
| 5385 | |
| 5386 | /* ODD number is used for set, copy data using copy_from_user */ |
| 5387 | pBuffer = mem_alloc_copy_from_user_helper(s_priv_data.pointer, |
| 5388 | s_priv_data.length); |
| 5389 | if (NULL == pBuffer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5390 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5391 | return -ENOMEM; |
| 5392 | } |
| 5393 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5394 | hdd_debug("Received length: %d data: %s", |
| 5395 | s_priv_data.length, pBuffer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5396 | |
| 5397 | switch (sub_cmd) { |
| 5398 | case WE_WOWL_ADD_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5399 | hdd_debug("ADD_PTRN"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5400 | hdd_add_wowl_ptrn(adapter, pBuffer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5401 | break; |
| 5402 | case WE_WOWL_DEL_PTRN: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5403 | hdd_debug("DEL_PTRN"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5404 | hdd_del_wowl_ptrn(adapter, pBuffer); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5405 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5406 | case WE_NEIGHBOR_REPORT_REQUEST: |
| 5407 | { |
| 5408 | tRrmNeighborReq neighborReq; |
| 5409 | tRrmNeighborRspCallbackInfo callbackInfo; |
| 5410 | |
| 5411 | if (pConfig->fRrmEnable) { |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5412 | neighborReq.neighbor_report_offload = false; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5413 | neighborReq.no_ssid = |
| 5414 | (s_priv_data.length - 1) ? false : true; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5415 | hdd_debug("Neighbor Request ssid present %d", |
| 5416 | neighborReq.no_ssid); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5417 | if (!neighborReq.no_ssid) { |
| 5418 | neighborReq.ssid.length = |
| 5419 | (s_priv_data.length - 1) > |
| 5420 | 32 ? 32 : (s_priv_data.length - 1); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 5421 | qdf_mem_copy(neighborReq.ssid.ssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5422 | pBuffer, |
| 5423 | neighborReq.ssid.length); |
| 5424 | } |
| 5425 | |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5426 | /* |
| 5427 | * If 11k offload is supported by FW and enabled |
| 5428 | * in the ini, set the offload to true |
| 5429 | */ |
| 5430 | if (hdd_ctx->config->is_11k_offload_supported && |
| 5431 | (hdd_ctx->config->offload_11k_enable_bitmask & |
| 5432 | OFFLOAD_11K_BITMASK_NEIGHBOR_REPORT_REQUEST)) { |
| 5433 | hdd_debug("Neighbor report offloaded to FW"); |
| 5434 | neighborReq.neighbor_report_offload = true; |
| 5435 | } |
| 5436 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5437 | callbackInfo.neighborRspCallback = NULL; |
| 5438 | callbackInfo.neighborRspCallbackContext = NULL; |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5439 | callbackInfo.timeout = 5000; /* 5 seconds */ |
| 5440 | sme_neighbor_report_request( |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5441 | hdd_ctx->mac_handle, |
Vignesh Viswanathan | 694e28e | 2018-01-18 20:53:57 +0530 | [diff] [blame] | 5442 | adapter->session_id, |
| 5443 | &neighborReq, |
| 5444 | &callbackInfo); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5445 | } else { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5446 | hdd_err("Ignoring neighbor request as RRM not enabled"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5447 | ret = -EINVAL; |
| 5448 | } |
| 5449 | } |
| 5450 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5451 | case WE_SET_AP_WPS_IE: |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 5452 | hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5453 | break; |
| 5454 | case WE_SET_CONFIG: |
| 5455 | vstatus = hdd_execute_global_config_command(hdd_ctx, pBuffer); |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5456 | if (QDF_STATUS_SUCCESS != vstatus) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5457 | ret = -EINVAL; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5458 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5459 | break; |
| 5460 | default: |
| 5461 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5462 | hdd_err("Invalid sub command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5463 | sub_cmd); |
| 5464 | ret = -EINVAL; |
| 5465 | break; |
| 5466 | } |
| 5467 | } |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 5468 | qdf_mem_free(pBuffer); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5469 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5470 | return ret; |
| 5471 | } |
| 5472 | |
| 5473 | static int iw_setchar_getnone(struct net_device *dev, |
| 5474 | struct iw_request_info *info, |
| 5475 | union iwreq_data *wrqu, char *extra) |
| 5476 | { |
| 5477 | int ret; |
| 5478 | |
| 5479 | cds_ssr_protect(__func__); |
| 5480 | ret = __iw_setchar_getnone(dev, info, wrqu, extra); |
| 5481 | cds_ssr_unprotect(__func__); |
| 5482 | |
| 5483 | return ret; |
| 5484 | } |
| 5485 | |
| 5486 | /** |
| 5487 | * iw_setnone_getint() - Generic "get integer" private ioctl handler |
| 5488 | * @dev: device upon which the ioctl was received |
| 5489 | * @info: ioctl request information |
| 5490 | * @wrqu: ioctl request data |
| 5491 | * @extra: ioctl extra data |
| 5492 | * |
| 5493 | * Return: 0 on success, non-zero on error |
| 5494 | */ |
| 5495 | static int __iw_setnone_getint(struct net_device *dev, |
| 5496 | struct iw_request_info *info, |
| 5497 | union iwreq_data *wrqu, char *extra) |
| 5498 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5499 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5500 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5501 | int *value = (int *)extra; |
| 5502 | int ret; |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5503 | tSmeConfigParams *sme_config; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 5504 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5505 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 5506 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 5507 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5508 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5509 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 5510 | if (0 != ret) |
| 5511 | return ret; |
| 5512 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 5513 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 5514 | if (0 != ret) |
| 5515 | return ret; |
| 5516 | |
Rajeev Kumar | 1117fcf | 2018-02-15 16:25:19 -0800 | [diff] [blame] | 5517 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 5518 | if (!sme_config) { |
| 5519 | hdd_err("failed to allocate memory for sme_config"); |
| 5520 | return -ENOMEM; |
| 5521 | } |
| 5522 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5523 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5524 | switch (value[0]) { |
| 5525 | case WE_GET_11D_STATE: |
| 5526 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5527 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5528 | |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5529 | *value = sme_config->csrConfig.Is11dSupportEnabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5530 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5531 | hdd_debug("11D state=%d!!", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5532 | |
| 5533 | break; |
| 5534 | } |
| 5535 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5536 | case WE_GET_WLAN_DBG: |
| 5537 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 5538 | qdf_trace_display(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5539 | *value = 0; |
| 5540 | break; |
| 5541 | } |
| 5542 | case WE_GET_MAX_ASSOC: |
| 5543 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5544 | if (sme_cfg_get_int(mac_handle, WNI_CFG_ASSOC_STA_LIMIT, |
| 5545 | (uint32_t *) value) != QDF_STATUS_SUCCESS) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5546 | hdd_err("WNI_CFG_ASSOC_STA_LIMIT failed"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5547 | ret = -EIO; |
| 5548 | } |
| 5549 | break; |
| 5550 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5551 | |
| 5552 | case WE_GET_CONCURRENCY_MODE: |
| 5553 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 5554 | *value = policy_mgr_get_concurrency_mode(hdd_ctx->hdd_psoc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5555 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5556 | hdd_debug("concurrency mode=%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5557 | break; |
| 5558 | } |
| 5559 | |
| 5560 | case WE_GET_NSS: |
| 5561 | { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5562 | sme_get_config_param(mac_handle, sme_config); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5563 | *value = (sme_config->csrConfig.enable2x2 == 0) ? 1 : 2; |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 5564 | if (policy_mgr_is_current_hwmode_dbs(hdd_ctx->hdd_psoc)) |
| 5565 | *value = *value - 1; |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5566 | hdd_debug("GET_NSS: Current NSS:%d", *value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5567 | break; |
| 5568 | } |
| 5569 | |
| 5570 | case WE_GET_GTX_HT_MCS: |
| 5571 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5572 | hdd_debug("GET WMI_VDEV_PARAM_GTX_HT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5573 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5574 | WMI_VDEV_PARAM_GTX_HT_MCS, |
| 5575 | GTX_CMD); |
| 5576 | break; |
| 5577 | } |
| 5578 | |
| 5579 | case WE_GET_GTX_VHT_MCS: |
| 5580 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5581 | hdd_debug("GET WMI_VDEV_PARAM_GTX_VHT_MCS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5582 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5583 | WMI_VDEV_PARAM_GTX_VHT_MCS, |
| 5584 | GTX_CMD); |
| 5585 | break; |
| 5586 | } |
| 5587 | |
| 5588 | case WE_GET_GTX_USRCFG: |
| 5589 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5590 | hdd_debug("GET WMI_VDEV_PARAM_GTX_USR_CFG"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5591 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5592 | WMI_VDEV_PARAM_GTX_USR_CFG, |
| 5593 | GTX_CMD); |
| 5594 | break; |
| 5595 | } |
| 5596 | |
| 5597 | case WE_GET_GTX_THRE: |
| 5598 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5599 | hdd_debug("GET WMI_VDEV_PARAM_GTX_THRE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5600 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5601 | WMI_VDEV_PARAM_GTX_THRE, |
| 5602 | GTX_CMD); |
| 5603 | break; |
| 5604 | } |
| 5605 | |
| 5606 | case WE_GET_GTX_MARGIN: |
| 5607 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5608 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MARGIN"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5609 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5610 | WMI_VDEV_PARAM_GTX_MARGIN, |
| 5611 | GTX_CMD); |
| 5612 | break; |
| 5613 | } |
| 5614 | |
| 5615 | case WE_GET_GTX_STEP: |
| 5616 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5617 | hdd_debug("GET WMI_VDEV_PARAM_GTX_STEP"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5618 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5619 | WMI_VDEV_PARAM_GTX_STEP, |
| 5620 | GTX_CMD); |
| 5621 | break; |
| 5622 | } |
| 5623 | |
| 5624 | case WE_GET_GTX_MINTPC: |
| 5625 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5626 | hdd_debug("GET WMI_VDEV_PARAM_GTX_MINTPC"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5627 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5628 | WMI_VDEV_PARAM_GTX_MINTPC, |
| 5629 | GTX_CMD); |
| 5630 | break; |
| 5631 | } |
| 5632 | |
| 5633 | case WE_GET_GTX_BWMASK: |
| 5634 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5635 | hdd_debug("GET WMI_VDEV_PARAM_GTX_BW_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5636 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5637 | WMI_VDEV_PARAM_GTX_BW_MASK, |
| 5638 | GTX_CMD); |
| 5639 | break; |
| 5640 | } |
| 5641 | |
| 5642 | case WE_GET_LDPC: |
| 5643 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5644 | ret = hdd_get_ldpc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5645 | break; |
| 5646 | } |
| 5647 | |
| 5648 | case WE_GET_TX_STBC: |
| 5649 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5650 | ret = hdd_get_tx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5651 | break; |
| 5652 | } |
| 5653 | |
| 5654 | case WE_GET_RX_STBC: |
| 5655 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5656 | ret = hdd_get_rx_stbc(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5657 | break; |
| 5658 | } |
| 5659 | |
| 5660 | case WE_GET_SHORT_GI: |
| 5661 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5662 | hdd_debug("GET WMI_VDEV_PARAM_SGI"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5663 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | a5c5aad | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 5664 | WMI_VDEV_PARAM_SGI, |
| 5665 | VDEV_CMD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5666 | break; |
| 5667 | } |
| 5668 | |
| 5669 | case WE_GET_RTSCTS: |
| 5670 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5671 | hdd_debug("GET WMI_VDEV_PARAM_ENABLE_RTSCTS"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5672 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5673 | WMI_VDEV_PARAM_ENABLE_RTSCTS, |
| 5674 | VDEV_CMD); |
| 5675 | break; |
| 5676 | } |
| 5677 | |
| 5678 | case WE_GET_CHWIDTH: |
| 5679 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5680 | hdd_debug("GET WMI_VDEV_PARAM_CHWIDTH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5681 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5682 | WMI_VDEV_PARAM_CHWIDTH, |
| 5683 | VDEV_CMD); |
| 5684 | break; |
| 5685 | } |
| 5686 | |
| 5687 | case WE_GET_ANI_EN_DIS: |
| 5688 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5689 | hdd_debug("GET WMI_PDEV_PARAM_ANI_ENABLE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5690 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5691 | WMI_PDEV_PARAM_ANI_ENABLE, |
| 5692 | PDEV_CMD); |
| 5693 | break; |
| 5694 | } |
| 5695 | |
| 5696 | case WE_GET_ANI_POLL_PERIOD: |
| 5697 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5698 | hdd_debug("GET WMI_PDEV_PARAM_ANI_POLL_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5699 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5700 | WMI_PDEV_PARAM_ANI_POLL_PERIOD, |
| 5701 | PDEV_CMD); |
| 5702 | break; |
| 5703 | } |
| 5704 | |
| 5705 | case WE_GET_ANI_LISTEN_PERIOD: |
| 5706 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5707 | hdd_debug("GET WMI_PDEV_PARAM_ANI_LISTEN_PERIOD"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5708 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5709 | WMI_PDEV_PARAM_ANI_LISTEN_PERIOD, |
| 5710 | PDEV_CMD); |
| 5711 | break; |
| 5712 | } |
| 5713 | |
| 5714 | case WE_GET_ANI_OFDM_LEVEL: |
| 5715 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5716 | hdd_debug("GET WMI_PDEV_PARAM_ANI_OFDM_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5717 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5718 | WMI_PDEV_PARAM_ANI_OFDM_LEVEL, |
| 5719 | PDEV_CMD); |
| 5720 | break; |
| 5721 | } |
| 5722 | |
| 5723 | case WE_GET_ANI_CCK_LEVEL: |
| 5724 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5725 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5726 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5727 | WMI_PDEV_PARAM_ANI_CCK_LEVEL, |
| 5728 | PDEV_CMD); |
| 5729 | break; |
| 5730 | } |
| 5731 | |
| 5732 | case WE_GET_DYNAMIC_BW: |
| 5733 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5734 | hdd_debug("GET WMI_PDEV_PARAM_ANI_CCK_LEVEL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5735 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5736 | WMI_PDEV_PARAM_DYNAMIC_BW, |
| 5737 | PDEV_CMD); |
| 5738 | break; |
| 5739 | } |
| 5740 | |
| 5741 | case WE_GET_11N_RATE: |
| 5742 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5743 | hdd_debug("GET WMI_VDEV_PARAM_FIXED_RATE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5744 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5745 | WMI_VDEV_PARAM_FIXED_RATE, |
| 5746 | VDEV_CMD); |
| 5747 | break; |
| 5748 | } |
| 5749 | |
| 5750 | case WE_GET_AMPDU: |
| 5751 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5752 | hdd_debug("GET AMPDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5753 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5754 | GEN_VDEV_PARAM_AMPDU, |
| 5755 | GEN_CMD); |
| 5756 | break; |
| 5757 | } |
| 5758 | |
| 5759 | case WE_GET_AMSDU: |
| 5760 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5761 | hdd_debug("GET AMSDU"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5762 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5763 | GEN_VDEV_PARAM_AMSDU, |
| 5764 | GEN_CMD); |
| 5765 | break; |
| 5766 | } |
| 5767 | |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 5768 | case WE_GET_ROAM_SYNCH_DELAY: |
| 5769 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5770 | hdd_debug("GET ROAM SYNCH DELAY"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5771 | *value = wma_cli_get_command(adapter->session_id, |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 5772 | GEN_VDEV_ROAM_SYNCH_DELAY, |
| 5773 | GEN_CMD); |
| 5774 | break; |
| 5775 | } |
| 5776 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5777 | case WE_GET_TX_CHAINMASK: |
| 5778 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5779 | hdd_debug("GET WMI_PDEV_PARAM_TX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5780 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5781 | WMI_PDEV_PARAM_TX_CHAIN_MASK, |
| 5782 | PDEV_CMD); |
| 5783 | break; |
| 5784 | } |
| 5785 | |
| 5786 | case WE_GET_RX_CHAINMASK: |
| 5787 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5788 | hdd_debug("GET WMI_PDEV_PARAM_RX_CHAIN_MASK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5789 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5790 | WMI_PDEV_PARAM_RX_CHAIN_MASK, |
| 5791 | PDEV_CMD); |
| 5792 | break; |
| 5793 | } |
| 5794 | |
| 5795 | case WE_GET_TXPOW_2G: |
| 5796 | { |
| 5797 | uint32_t txpow2g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5798 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5799 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT2G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5800 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5801 | WMI_PDEV_PARAM_TXPOWER_LIMIT2G, |
| 5802 | PDEV_CMD); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5803 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5804 | sme_cfg_get_int(mac_handle, WNI_CFG_CURRENT_TX_POWER_LEVEL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5805 | &txpow2g)) { |
| 5806 | return -EIO; |
| 5807 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5808 | hdd_debug("2G tx_power %d", txpow2g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5809 | break; |
| 5810 | } |
| 5811 | |
| 5812 | case WE_GET_TXPOW_5G: |
| 5813 | { |
| 5814 | uint32_t txpow5g = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 5815 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5816 | hdd_debug("GET WMI_PDEV_PARAM_TXPOWER_LIMIT5G"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5817 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5818 | WMI_PDEV_PARAM_TXPOWER_LIMIT5G, |
| 5819 | PDEV_CMD); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 5820 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 5821 | sme_cfg_get_int(mac_handle, WNI_CFG_CURRENT_TX_POWER_LEVEL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5822 | &txpow5g)) { |
| 5823 | return -EIO; |
| 5824 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5825 | hdd_debug("5G tx_power %d", txpow5g); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5826 | break; |
| 5827 | } |
| 5828 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5829 | case WE_GET_PPS_PAID_MATCH: |
| 5830 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5831 | hdd_debug("GET WMI_VDEV_PPS_PAID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5832 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5833 | WMI_VDEV_PPS_PAID_MATCH, |
| 5834 | PPS_CMD); |
| 5835 | break; |
| 5836 | } |
| 5837 | |
| 5838 | case WE_GET_PPS_GID_MATCH: |
| 5839 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5840 | hdd_debug("GET WMI_VDEV_PPS_GID_MATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5841 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5842 | WMI_VDEV_PPS_GID_MATCH, |
| 5843 | PPS_CMD); |
| 5844 | break; |
| 5845 | } |
| 5846 | |
| 5847 | case WE_GET_PPS_EARLY_TIM_CLEAR: |
| 5848 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5849 | hdd_debug("GET WMI_VDEV_PPS_EARLY_TIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5850 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5851 | WMI_VDEV_PPS_EARLY_TIM_CLEAR, |
| 5852 | PPS_CMD); |
| 5853 | break; |
| 5854 | } |
| 5855 | |
| 5856 | case WE_GET_PPS_EARLY_DTIM_CLEAR: |
| 5857 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5858 | hdd_debug("GET WMI_VDEV_PPS_EARLY_DTIM_CLEAR"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5859 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5860 | WMI_VDEV_PPS_EARLY_DTIM_CLEAR, |
| 5861 | PPS_CMD); |
| 5862 | break; |
| 5863 | } |
| 5864 | |
| 5865 | case WE_GET_PPS_EOF_PAD_DELIM: |
| 5866 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5867 | hdd_debug("GET WMI_VDEV_PPS_EOF_PAD_DELIM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5868 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5869 | WMI_VDEV_PPS_EOF_PAD_DELIM, |
| 5870 | PPS_CMD); |
| 5871 | break; |
| 5872 | } |
| 5873 | |
| 5874 | case WE_GET_PPS_MACADDR_MISMATCH: |
| 5875 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5876 | hdd_debug("GET WMI_VDEV_PPS_MACADDR_MISMATCH"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5877 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5878 | WMI_VDEV_PPS_MACADDR_MISMATCH, |
| 5879 | PPS_CMD); |
| 5880 | break; |
| 5881 | } |
| 5882 | |
| 5883 | case WE_GET_PPS_DELIM_CRC_FAIL: |
| 5884 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5885 | hdd_debug("GET WMI_VDEV_PPS_DELIM_CRC_FAIL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5886 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5887 | WMI_VDEV_PPS_DELIM_CRC_FAIL, |
| 5888 | PPS_CMD); |
| 5889 | break; |
| 5890 | } |
| 5891 | |
| 5892 | case WE_GET_PPS_GID_NSTS_ZERO: |
| 5893 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5894 | hdd_debug("GET WMI_VDEV_PPS_GID_NSTS_ZERO"); |
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_GID_NSTS_ZERO, |
| 5897 | PPS_CMD); |
| 5898 | break; |
| 5899 | } |
| 5900 | |
| 5901 | case WE_GET_PPS_RSSI_CHECK: |
| 5902 | { |
| 5903 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5904 | hdd_debug("GET WMI_VDEV_PPS_RSSI_CHECK"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5905 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5906 | WMI_VDEV_PPS_RSSI_CHECK, |
| 5907 | PPS_CMD); |
| 5908 | break; |
| 5909 | } |
| 5910 | |
| 5911 | case WE_GET_QPOWER_MAX_PSPOLL_COUNT: |
| 5912 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5913 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5914 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5915 | WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, |
| 5916 | QPOWER_CMD); |
| 5917 | break; |
| 5918 | } |
| 5919 | |
| 5920 | case WE_GET_QPOWER_MAX_TX_BEFORE_WAKE: |
| 5921 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5922 | hdd_debug("WE_GET_QPOWER_MAX_TX_BEFORE_WAKE"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5923 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5924 | WMI_STA_PS_PARAM_QPOWER_MAX_TX_BEFORE_WAKE, |
| 5925 | QPOWER_CMD); |
| 5926 | break; |
| 5927 | } |
| 5928 | |
| 5929 | case WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL: |
| 5930 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5931 | hdd_debug("WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5932 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5933 | WMI_STA_PS_PARAM_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 5934 | QPOWER_CMD); |
| 5935 | break; |
| 5936 | } |
| 5937 | |
| 5938 | case WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL: |
| 5939 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5940 | hdd_debug("WE_GET_QPOWER_MAX_PSPOLL_COUNT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5941 | *value = wma_cli_get_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5942 | WMI_STA_PS_PARAM_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 5943 | QPOWER_CMD); |
| 5944 | break; |
| 5945 | } |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5946 | case WE_CAP_TSF: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5947 | ret = hdd_capture_tsf(adapter, (uint32_t *)value, 1); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 5948 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5949 | case WE_GET_TEMPERATURE: |
| 5950 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 5951 | hdd_debug("WE_GET_TEMPERATURE"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 5952 | ret = wlan_hdd_get_temperature(adapter, value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5953 | break; |
| 5954 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5955 | case WE_GET_DCM: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5956 | hdd_debug("GET WMI_VDEV_PARAM_HE_DCM"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5957 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 5958 | WMI_VDEV_PARAM_HE_DCM, |
| 5959 | VDEV_CMD); |
| 5960 | break; |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5961 | case WE_GET_RANGE_EXT: |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 5962 | hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT"); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 5963 | *value = wma_cli_get_command(adapter->session_id, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 5964 | WMI_VDEV_PARAM_HE_RANGE_EXT, |
| 5965 | VDEV_CMD); |
| 5966 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5967 | default: |
| 5968 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 5969 | hdd_err("Invalid IOCTL get_value command %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5970 | value[0]); |
| 5971 | break; |
| 5972 | } |
| 5973 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 5974 | hdd_exit(); |
Sridhar Selvaraj | 48c4709 | 2017-07-31 18:18:14 +0530 | [diff] [blame] | 5975 | qdf_mem_free(sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 5976 | return ret; |
| 5977 | } |
| 5978 | |
| 5979 | static int iw_setnone_getint(struct net_device *dev, |
| 5980 | struct iw_request_info *info, |
| 5981 | union iwreq_data *wrqu, char *extra) |
| 5982 | { |
| 5983 | int ret; |
| 5984 | |
| 5985 | cds_ssr_protect(__func__); |
| 5986 | ret = __iw_setnone_getint(dev, info, wrqu, extra); |
| 5987 | cds_ssr_unprotect(__func__); |
| 5988 | |
| 5989 | return ret; |
| 5990 | } |
| 5991 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 5992 | static int hdd_set_fwtest(int argc, int cmd, int value) |
| 5993 | { |
| 5994 | struct set_fwtest_params *fw_test; |
| 5995 | |
| 5996 | /* check for max number of arguments */ |
| 5997 | if (argc > (WMA_MAX_NUM_ARGS) || |
| 5998 | argc != HDD_FWTEST_PARAMS) { |
| 5999 | hdd_err("Too Many args %d", argc); |
| 6000 | return -EINVAL; |
| 6001 | } |
| 6002 | /* |
| 6003 | * check if number of arguments are 3 then, check |
| 6004 | * then set the default value for sounding interval. |
| 6005 | */ |
| 6006 | if (HDD_FWTEST_PARAMS == argc) { |
| 6007 | if (HDD_FWTEST_SU_PARAM_ID == cmd && 0 == value) |
| 6008 | value = HDD_FWTEST_SU_DEFAULT_VALUE; |
| 6009 | if (HDD_FWTEST_MU_PARAM_ID == cmd && 0 == value) |
| 6010 | value = HDD_FWTEST_MU_DEFAULT_VALUE; |
| 6011 | } |
| 6012 | /* check sounding interval value should not exceed to max */ |
| 6013 | if (value > HDD_FWTEST_MAX_VALUE) { |
| 6014 | hdd_err("Invalid arguments value should not exceed max: %d", |
| 6015 | value); |
| 6016 | return -EINVAL; |
| 6017 | } |
| 6018 | fw_test = qdf_mem_malloc(sizeof(*fw_test)); |
| 6019 | if (NULL == fw_test) { |
| 6020 | hdd_err("qdf_mem_malloc failed for fw_test"); |
| 6021 | return -ENOMEM; |
| 6022 | } |
| 6023 | fw_test->arg = cmd; |
| 6024 | fw_test->value = value; |
| 6025 | if (QDF_STATUS_SUCCESS != sme_set_fw_test(fw_test)) { |
| 6026 | qdf_mem_free(fw_test); |
| 6027 | hdd_err("Not able to post FW_TEST_CMD message to WMA"); |
| 6028 | return -EINVAL; |
| 6029 | } |
| 6030 | return 0; |
| 6031 | } |
| 6032 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6033 | /** |
| 6034 | * iw_set_three_ints_getnone() - Generic "set 3 params" private ioctl handler |
| 6035 | * @dev: device upon which the ioctl was received |
| 6036 | * @info: ioctl request information |
| 6037 | * @wrqu: ioctl request data |
| 6038 | * @extra: ioctl extra data |
| 6039 | * |
| 6040 | * Return: 0 on success, non-zero on error |
| 6041 | */ |
| 6042 | static int __iw_set_three_ints_getnone(struct net_device *dev, |
| 6043 | struct iw_request_info *info, |
| 6044 | union iwreq_data *wrqu, char *extra) |
| 6045 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6046 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6047 | int *value = (int *)extra; |
| 6048 | int sub_cmd = value[0]; |
| 6049 | int ret; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6050 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6051 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6052 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6053 | |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6054 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6055 | hdd_err("permission check failed"); |
Rajeev Kumar | 2cce8a8 | 2016-04-14 15:10:41 -0700 | [diff] [blame] | 6056 | return -EPERM; |
| 6057 | } |
| 6058 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6059 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6060 | if (0 != ret) |
| 6061 | return ret; |
| 6062 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6063 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6064 | if (0 != ret) |
| 6065 | return ret; |
| 6066 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6067 | switch (sub_cmd) { |
| 6068 | |
| 6069 | case WE_SET_WLAN_DBG: |
Dustin Brown | 36e2e5c | 2017-05-16 15:41:37 -0700 | [diff] [blame] | 6070 | qdf_print_set_category_verbose(qdf_get_pidx(), value[1], |
| 6071 | value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6072 | break; |
| 6073 | case WE_SET_DP_TRACE: |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 6074 | qdf_dp_trace_set_value(value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6075 | break; |
Himanshu Agarwal | ad4c039 | 2018-05-08 16:53:36 +0530 | [diff] [blame] | 6076 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6077 | case WE_SET_DUAL_MAC_SCAN_CONFIG: |
| 6078 | hdd_debug("Ioctl to set dual mac scan config"); |
Tushnim Bhattacharyya | 49ed8ab | 2017-05-26 18:20:10 -0700 | [diff] [blame] | 6079 | if (hdd_ctx->config->dual_mac_feature_disable == |
| 6080 | DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6081 | hdd_err("Dual mac feature is disabled from INI"); |
| 6082 | return -EPERM; |
| 6083 | } |
| 6084 | hdd_debug("%d %d %d", value[1], value[2], value[3]); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6085 | policy_mgr_set_dual_mac_scan_config(hdd_ctx->hdd_psoc, |
| 6086 | value[1], value[2], value[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6087 | break; |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 6088 | case WE_SET_FW_TEST: |
| 6089 | { |
| 6090 | ret = hdd_set_fwtest(value[1], value[2], value[3]); |
| 6091 | if (ret) { |
| 6092 | hdd_err("Not able to set fwtest %d", ret); |
| 6093 | return ret; |
| 6094 | } |
| 6095 | } |
| 6096 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6097 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6098 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6099 | break; |
| 6100 | |
| 6101 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6102 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6103 | return ret; |
| 6104 | } |
| 6105 | |
| 6106 | int iw_set_three_ints_getnone(struct net_device *dev, |
| 6107 | struct iw_request_info *info, |
| 6108 | union iwreq_data *wrqu, char *extra) |
| 6109 | { |
| 6110 | int ret; |
| 6111 | |
| 6112 | cds_ssr_protect(__func__); |
| 6113 | ret = __iw_set_three_ints_getnone(dev, info, wrqu, extra); |
| 6114 | cds_ssr_unprotect(__func__); |
| 6115 | |
| 6116 | return ret; |
| 6117 | } |
| 6118 | |
| 6119 | /** |
| 6120 | * hdd_connection_state_string() - Get connection state string |
| 6121 | * @connection_state: enum to be converted to a string |
| 6122 | * |
| 6123 | * Return: the string equivalent of @connection_state |
| 6124 | */ |
| 6125 | static const char * |
| 6126 | hdd_connection_state_string(eConnectionState connection_state) |
| 6127 | { |
| 6128 | switch (connection_state) { |
| 6129 | CASE_RETURN_STRING(eConnectionState_NotConnected); |
| 6130 | CASE_RETURN_STRING(eConnectionState_Connecting); |
| 6131 | CASE_RETURN_STRING(eConnectionState_Associated); |
| 6132 | CASE_RETURN_STRING(eConnectionState_IbssDisconnected); |
| 6133 | CASE_RETURN_STRING(eConnectionState_IbssConnected); |
| 6134 | CASE_RETURN_STRING(eConnectionState_Disconnecting); |
| 6135 | default: |
| 6136 | return "UNKNOWN"; |
| 6137 | } |
| 6138 | } |
| 6139 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6140 | #if defined(FEATURE_OEM_DATA_SUPPORT) |
| 6141 | /** |
| 6142 | * iw_get_oem_data_cap_wrapper() - wrapper function to call legacy or new |
| 6143 | * wifi_pos api to get oem data caps |
| 6144 | * @dev: net device upon which the request was received |
| 6145 | * @info: ioctl request information |
| 6146 | * @wrqu: ioctl request data |
| 6147 | * @extra: ioctl data payload |
| 6148 | * |
| 6149 | * Return: 0 for success, negative errno value on failure |
| 6150 | */ |
| 6151 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6152 | struct iw_request_info *info, |
| 6153 | union iwreq_data *wrqu, char *extra) |
| 6154 | { |
| 6155 | return iw_get_oem_data_cap(dev, info, wrqu, extra); |
| 6156 | } |
| 6157 | #elif defined(WIFI_POS_CONVERGED) |
| 6158 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6159 | struct iw_request_info *info, |
| 6160 | union iwreq_data *wrqu, char *extra) |
| 6161 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6162 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6163 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6164 | |
| 6165 | return os_if_wifi_pos_populate_caps(hdd_ctx->hdd_psoc, |
| 6166 | (struct wifi_pos_driver_caps *)extra); |
| 6167 | } |
| 6168 | #else |
| 6169 | static inline int iw_get_oem_data_cap_wrapper(struct net_device *dev, |
| 6170 | struct iw_request_info *info, |
| 6171 | union iwreq_data *wrqu, char *extra) |
| 6172 | { |
| 6173 | return -ENOTSUPP; |
| 6174 | } |
| 6175 | #endif |
| 6176 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6177 | /** |
| 6178 | * iw_get_char_setnone() - Generic "get string" private ioctl handler |
| 6179 | * @dev: device upon which the ioctl was received |
| 6180 | * @info: ioctl request information |
| 6181 | * @wrqu: ioctl request data |
| 6182 | * @extra: ioctl extra data |
| 6183 | * |
| 6184 | * Return: 0 on success, non-zero on error |
| 6185 | */ |
| 6186 | static int __iw_get_char_setnone(struct net_device *dev, |
| 6187 | struct iw_request_info *info, |
| 6188 | union iwreq_data *wrqu, char *extra) |
| 6189 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6190 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6191 | int sub_cmd = wrqu->data.flags; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6192 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6193 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6194 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6195 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6196 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6197 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6198 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6199 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6200 | if (0 != ret) |
| 6201 | return ret; |
| 6202 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6203 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6204 | if (0 != ret) |
| 6205 | return ret; |
| 6206 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6207 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6208 | switch (sub_cmd) { |
| 6209 | case WE_WLAN_VERSION: |
| 6210 | { |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 6211 | wrqu->data.length = hdd_wlan_get_version(hdd_ctx, |
| 6212 | WE_MAX_STR_LEN, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6213 | break; |
| 6214 | } |
| 6215 | |
| 6216 | case WE_GET_STATS: |
| 6217 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6218 | hdd_wlan_get_stats(adapter, &(wrqu->data.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6219 | extra, WE_MAX_STR_LEN); |
| 6220 | break; |
| 6221 | } |
| 6222 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6223 | case WE_GET_SUSPEND_RESUME_STATS: |
| 6224 | { |
| 6225 | ret = wlan_hdd_write_suspend_resume_stats(hdd_ctx, extra, |
| 6226 | WE_MAX_STR_LEN); |
| 6227 | if (ret >= 0) { |
| 6228 | wrqu->data.length = ret; |
| 6229 | ret = 0; |
| 6230 | } |
| 6231 | |
| 6232 | break; |
| 6233 | } |
| 6234 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6235 | case WE_LIST_FW_PROFILE: |
| 6236 | hdd_wlan_list_fw_profile(&(wrqu->data.length), |
| 6237 | extra, WE_MAX_STR_LEN); |
| 6238 | break; |
| 6239 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6240 | /* The case prints the current state of the HDD, SME, CSR, PE, |
| 6241 | * TL it can be extended for WDI Global State as well. And |
| 6242 | * currently it only checks P2P_CLIENT adapter. P2P_DEVICE |
| 6243 | * and P2P_GO have not been added as of now. |
| 6244 | */ |
| 6245 | case WE_GET_STATES: |
| 6246 | { |
| 6247 | int buf = 0, len = 0; |
| 6248 | int adapter_num = 0; |
| 6249 | int count = 0, check = 1; |
| 6250 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6251 | struct hdd_station_ctx *sta_ctx = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6252 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6253 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6254 | struct hdd_adapter *useAdapter = NULL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6255 | |
| 6256 | /* Print wlan0 or p2p0 states based on the adapter_num |
| 6257 | * by using the correct adapter |
| 6258 | */ |
| 6259 | while (adapter_num < 2) { |
| 6260 | if (WLAN_ADAPTER == adapter_num) { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6261 | useAdapter = adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6262 | buf = |
| 6263 | scnprintf(extra + len, |
| 6264 | WE_MAX_STR_LEN - len, |
| 6265 | "\n\n wlan0 States:-"); |
| 6266 | len += buf; |
| 6267 | } else if (P2P_ADAPTER == adapter_num) { |
| 6268 | buf = |
| 6269 | scnprintf(extra + len, |
| 6270 | WE_MAX_STR_LEN - len, |
| 6271 | "\n\n p2p0 States:-"); |
| 6272 | len += buf; |
| 6273 | |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6274 | if (!hdd_ctx) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6275 | buf = |
| 6276 | scnprintf(extra + len, |
| 6277 | WE_MAX_STR_LEN - |
| 6278 | len, |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6279 | "\n hdd_ctx is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6280 | len += buf; |
| 6281 | break; |
| 6282 | } |
| 6283 | |
| 6284 | /* Printing p2p0 states only in the |
| 6285 | * case when the device is configured |
| 6286 | * as a p2p_client |
| 6287 | */ |
| 6288 | useAdapter = |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6289 | hdd_get_adapter(hdd_ctx, |
Krunal Soni | f07bb38 | 2016-03-10 13:02:11 -0800 | [diff] [blame] | 6290 | QDF_P2P_CLIENT_MODE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6291 | if (!useAdapter) { |
| 6292 | buf = |
| 6293 | scnprintf(extra + len, |
| 6294 | WE_MAX_STR_LEN - |
| 6295 | len, |
| 6296 | "\n Device not configured as P2P_CLIENT."); |
| 6297 | len += buf; |
| 6298 | break; |
| 6299 | } |
| 6300 | } |
| 6301 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6302 | if (!mac_handle) { |
Jeff Johnson | 2a8a64f | 2018-04-28 12:31:36 -0700 | [diff] [blame] | 6303 | buf = scnprintf(extra + len, |
| 6304 | WE_MAX_STR_LEN - len, |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6305 | "\n mac_handle is NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6306 | len += buf; |
| 6307 | break; |
| 6308 | } |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6309 | sta_ctx = |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6310 | WLAN_HDD_GET_STATION_CTX_PTR(useAdapter); |
| 6311 | |
| 6312 | |
| 6313 | buf = |
| 6314 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
| 6315 | "\n HDD Conn State - %s " |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6316 | "\n\n SME State:" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6317 | "\n Neighbour Roam State - %s" |
| 6318 | "\n CSR State - %s" |
| 6319 | "\n CSR Substate - %s", |
| 6320 | hdd_connection_state_string |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6321 | (sta_ctx->conn_info.connState), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6322 | mac_trace_get_neighbour_roam_state |
| 6323 | (sme_get_neighbor_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6324 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6325 | mac_trace_getcsr_roam_state |
| 6326 | (sme_get_current_roam_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6327 | (mac_handle, useAdapter->session_id)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6328 | mac_trace_getcsr_roam_sub_state |
| 6329 | (sme_get_current_roam_sub_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6330 | (mac_handle, useAdapter->session_id)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6331 | ); |
| 6332 | len += buf; |
| 6333 | adapter_num++; |
| 6334 | } |
| 6335 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6336 | if (mac_handle) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6337 | /* Printing Lim State starting with global lim states */ |
| 6338 | buf = |
| 6339 | scnprintf(extra + len, WE_MAX_STR_LEN - len, |
Srinivas Girigowda | b9086af | 2017-10-14 14:41:13 -0700 | [diff] [blame] | 6340 | "\n\n LIM STATES:-" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6341 | "\n Global Sme State - %s " |
| 6342 | "\n Global mlm State - %s " "\n", |
| 6343 | mac_trace_get_lim_sme_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6344 | (sme_get_lim_sme_state(mac_handle)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6345 | mac_trace_get_lim_mlm_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6346 | (sme_get_lim_sme_state(mac_handle)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6347 | ); |
| 6348 | len += buf; |
| 6349 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6350 | while (check < 3 && count < 255) { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6351 | if (sme_is_lim_session_valid(mac_handle, count)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6352 | buf = |
| 6353 | scnprintf(extra + len, |
| 6354 | WE_MAX_STR_LEN - |
| 6355 | len, |
| 6356 | "\n Lim Valid Session %d:-" |
| 6357 | "\n PE Sme State - %s " |
| 6358 | "\n PE Mlm State - %s " |
| 6359 | "\n", check, |
| 6360 | mac_trace_get_lim_sme_state |
| 6361 | (sme_get_lim_sme_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6362 | (mac_handle, count)), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6363 | mac_trace_get_lim_mlm_state |
| 6364 | (sme_get_lim_mlm_session_state |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6365 | (mac_handle, count)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6366 | ); |
| 6367 | |
| 6368 | len += buf; |
| 6369 | check++; |
| 6370 | } |
| 6371 | count++; |
| 6372 | } |
| 6373 | } |
| 6374 | |
| 6375 | wrqu->data.length = strlen(extra) + 1; |
| 6376 | break; |
| 6377 | } |
| 6378 | |
| 6379 | case WE_GET_CFG: |
| 6380 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6381 | hdd_debug("Printing CLD global INI Config"); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6382 | hdd_cfg_get_global_config(WLAN_HDD_GET_CTX(adapter), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6383 | extra, |
| 6384 | QCSAP_IOCTL_MAX_STR_LEN); |
| 6385 | wrqu->data.length = strlen(extra) + 1; |
| 6386 | break; |
| 6387 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6388 | case WE_GET_RSSI: |
| 6389 | { |
| 6390 | int8_t s7Rssi = 0; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6391 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6392 | wlan_hdd_get_rssi(adapter, &s7Rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6393 | snprintf(extra, WE_MAX_STR_LEN, "rssi=%d", s7Rssi); |
| 6394 | wrqu->data.length = strlen(extra) + 1; |
| 6395 | break; |
| 6396 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6397 | |
| 6398 | case WE_GET_WMM_STATUS: |
| 6399 | { |
| 6400 | snprintf(extra, WE_MAX_STR_LEN, |
| 6401 | "\nDir: 0=up, 1=down, 3=both\n" |
| 6402 | "|------------------------|\n" |
| 6403 | "|AC | ACM |Admitted| Dir |\n" |
| 6404 | "|------------------------|\n" |
| 6405 | "|VO | %d | %3s | %d |\n" |
| 6406 | "|VI | %d | %3s | %d |\n" |
| 6407 | "|BE | %d | %3s | %d |\n" |
| 6408 | "|BK | %d | %3s | %d |\n" |
| 6409 | "|------------------------|\n", |
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_VO].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6412 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6413 | wmmAcStatus[SME_AC_VO]. |
| 6414 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6415 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6416 | wmmAcStatus[SME_AC_VO].wmmAcTspecInfo. |
| 6417 | ts_info.direction, |
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_VI].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6420 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6421 | wmmAcStatus[SME_AC_VI]. |
| 6422 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6423 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6424 | wmmAcStatus[SME_AC_VI].wmmAcTspecInfo. |
| 6425 | ts_info.direction, |
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_BE].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6428 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6429 | wmmAcStatus[SME_AC_BE]. |
| 6430 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6431 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6432 | wmmAcStatus[SME_AC_BE].wmmAcTspecInfo. |
| 6433 | ts_info.direction, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6434 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6435 | wmmAcStatus[SME_AC_BK].wmmAcAccessRequired, |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6436 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6437 | wmmAcStatus[SME_AC_BK]. |
| 6438 | wmmAcAccessAllowed ? "YES" : "NO", |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 6439 | adapter->hdd_wmm_status. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6440 | wmmAcStatus[SME_AC_BK].wmmAcTspecInfo. |
| 6441 | ts_info.direction); |
| 6442 | |
| 6443 | wrqu->data.length = strlen(extra) + 1; |
| 6444 | break; |
| 6445 | } |
| 6446 | case WE_GET_CHANNEL_LIST: |
| 6447 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6448 | QDF_STATUS status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6449 | uint8_t i, len; |
| 6450 | char *buf; |
| 6451 | uint8_t ubuf[WNI_CFG_COUNTRY_CODE_LEN]; |
| 6452 | uint8_t ubuf_len = WNI_CFG_COUNTRY_CODE_LEN; |
Srinivas Girigowda | c231df6 | 2017-03-24 18:27:57 -0700 | [diff] [blame] | 6453 | struct channel_list_info channel_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6454 | |
| 6455 | memset(&channel_list, 0, sizeof(channel_list)); |
Agrawal Ashish | 6c9bca7 | 2016-09-04 13:37:59 +0530 | [diff] [blame] | 6456 | status = iw_get_channel_list(dev, info, wrqu, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6457 | (char *)&channel_list); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6458 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6459 | hdd_err("GetChannelList Failed!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6460 | return -EINVAL; |
| 6461 | } |
| 6462 | buf = extra; |
| 6463 | /* |
| 6464 | * Maximum channels = WNI_CFG_VALID_CHANNEL_LIST_LEN. |
| 6465 | * Maximum buffer needed = 5 * number of channels. |
| 6466 | * Check ifsufficient buffer is available and then |
| 6467 | * proceed to fill the buffer. |
| 6468 | */ |
| 6469 | if (WE_MAX_STR_LEN < |
| 6470 | (5 * WNI_CFG_VALID_CHANNEL_LIST_LEN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6471 | hdd_err("Insufficient Buffer to populate channel list"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6472 | return -EINVAL; |
| 6473 | } |
| 6474 | len = scnprintf(buf, WE_MAX_STR_LEN, "%u ", |
| 6475 | channel_list.num_channels); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6476 | if (QDF_STATUS_SUCCESS == sme_get_country_code(mac_handle, |
| 6477 | ubuf, |
| 6478 | &ubuf_len)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6479 | /* Printing Country code in getChannelList */ |
| 6480 | for (i = 0; i < (ubuf_len - 1); i++) |
| 6481 | len += scnprintf(buf + len, |
| 6482 | WE_MAX_STR_LEN - len, |
| 6483 | "%c", ubuf[i]); |
| 6484 | } |
| 6485 | for (i = 0; i < channel_list.num_channels; i++) { |
| 6486 | len += |
| 6487 | scnprintf(buf + len, WE_MAX_STR_LEN - len, |
| 6488 | " %u", channel_list.channels[i]); |
| 6489 | } |
| 6490 | wrqu->data.length = strlen(extra) + 1; |
| 6491 | |
| 6492 | break; |
| 6493 | } |
| 6494 | #ifdef FEATURE_WLAN_TDLS |
| 6495 | case WE_GET_TDLS_PEERS: |
| 6496 | { |
| 6497 | wrqu->data.length = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6498 | wlan_hdd_tdls_get_all_peers(adapter, extra, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6499 | WE_MAX_STR_LEN) + 1; |
| 6500 | break; |
| 6501 | } |
| 6502 | #endif |
| 6503 | #ifdef WLAN_FEATURE_11W |
| 6504 | case WE_GET_11W_INFO: |
| 6505 | { |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6506 | struct csr_roam_profile *roam_profile = |
| 6507 | hdd_roam_profile(adapter); |
| 6508 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6509 | hdd_debug("WE_GET_11W_ENABLED = %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6510 | roam_profile->MFPEnabled); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6511 | |
| 6512 | snprintf(extra, WE_MAX_STR_LEN, |
| 6513 | "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d" |
| 6514 | "\n Number of Unprotected Disassocs %d" |
| 6515 | "\n Number of Unprotected Deauths %d", |
Jeff Johnson | f908cd0 | 2018-03-16 11:49:50 -0700 | [diff] [blame] | 6516 | roam_profile->BSSIDs.bssid->bytes[0], |
| 6517 | roam_profile->BSSIDs.bssid->bytes[1], |
| 6518 | roam_profile->BSSIDs.bssid->bytes[2], |
| 6519 | roam_profile->BSSIDs.bssid->bytes[3], |
| 6520 | roam_profile->BSSIDs.bssid->bytes[4], |
| 6521 | roam_profile->BSSIDs.bssid->bytes[5], |
| 6522 | roam_profile->MFPEnabled, |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 6523 | adapter->hdd_stats.hdd_pmf_stats. |
| 6524 | num_unprot_disassoc_rx, |
| 6525 | adapter->hdd_stats.hdd_pmf_stats. |
| 6526 | num_unprot_deauth_rx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6527 | |
| 6528 | wrqu->data.length = strlen(extra) + 1; |
| 6529 | break; |
| 6530 | } |
| 6531 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6532 | case WE_GET_IBSS_STA_INFO: |
| 6533 | { |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6534 | struct hdd_station_ctx *sta_ctx = |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6535 | WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6536 | int idx = 0; |
| 6537 | int length = 0, buf = 0; |
| 6538 | |
Naveen Rawat | c45d162 | 2016-07-05 12:20:09 -0700 | [diff] [blame] | 6539 | for (idx = 0; idx < MAX_PEERS; idx++) { |
Naveen Rawat | ac027cb | 2017-04-27 15:02:42 -0700 | [diff] [blame] | 6540 | if (HDD_WLAN_INVALID_STA_ID != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6541 | sta_ctx->conn_info.staId[idx]) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6542 | buf = snprintf |
| 6543 | ((extra + length), |
| 6544 | WE_MAX_STR_LEN - length, |
| 6545 | "\n%d .%02x:%02x:%02x:%02x:%02x:%02x\n", |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6546 | sta_ctx->conn_info.staId[idx], |
| 6547 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6548 | peerMacAddress[idx].bytes[0], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6549 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6550 | peerMacAddress[idx].bytes[1], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6551 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6552 | peerMacAddress[idx].bytes[2], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6553 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6554 | peerMacAddress[idx].bytes[3], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6555 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6556 | peerMacAddress[idx].bytes[4], |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6557 | sta_ctx->conn_info. |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6558 | peerMacAddress[idx].bytes[5] |
| 6559 | ); |
| 6560 | length += buf; |
| 6561 | } |
| 6562 | } |
| 6563 | wrqu->data.length = strlen(extra) + 1; |
| 6564 | break; |
| 6565 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6566 | case WE_GET_PHYMODE: |
| 6567 | { |
| 6568 | bool ch_bond24 = false, ch_bond5g = false; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6569 | struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6570 | eCsrPhyMode phymode; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6571 | enum band_info currBand; |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6572 | tSmeConfigParams *sme_config; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6573 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6574 | sme_config = qdf_mem_malloc(sizeof(*sme_config)); |
| 6575 | if (!sme_config) { |
| 6576 | hdd_err("Out of memory"); |
| 6577 | ret = -ENOMEM; |
| 6578 | break; |
| 6579 | } |
| 6580 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6581 | sme_get_config_param(mac_handle, sme_config); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6582 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6583 | sme_config->csrConfig.channelBondingMode24GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6584 | ch_bond24 = true; |
| 6585 | |
| 6586 | if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6587 | sme_config->csrConfig.channelBondingMode5GHz) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6588 | ch_bond5g = true; |
| 6589 | |
Dustin Brown | e9c6b3a | 2017-01-23 17:17:32 -0800 | [diff] [blame] | 6590 | qdf_mem_free(sme_config); |
| 6591 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6592 | phymode = sme_get_phy_mode(mac_handle); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 6593 | if ((QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6594 | sme_get_freq_band(mac_handle, &currBand))) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6595 | hdd_err("Failed to get current band config"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6596 | return -EIO; |
| 6597 | } |
| 6598 | |
| 6599 | switch (phymode) { |
| 6600 | case eCSR_DOT11_MODE_AUTO: |
| 6601 | snprintf(extra, WE_MAX_STR_LEN, "AUTO MODE"); |
| 6602 | break; |
| 6603 | case eCSR_DOT11_MODE_11n: |
| 6604 | case eCSR_DOT11_MODE_11n_ONLY: |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6605 | if (currBand == BAND_2G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6606 | if (ch_bond24) |
| 6607 | snprintf(extra, WE_MAX_STR_LEN, |
| 6608 | "11NGHT40"); |
| 6609 | else |
| 6610 | snprintf(extra, WE_MAX_STR_LEN, |
| 6611 | "11NGHT20"); |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 6612 | } else if (currBand == BAND_5G) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6613 | if (ch_bond5g) |
| 6614 | snprintf(extra, WE_MAX_STR_LEN, |
| 6615 | "11NAHT40"); |
| 6616 | else |
| 6617 | snprintf(extra, WE_MAX_STR_LEN, |
| 6618 | "11NAHT20"); |
| 6619 | } else { |
| 6620 | snprintf(extra, WE_MAX_STR_LEN, "11N"); |
| 6621 | } |
| 6622 | break; |
| 6623 | case eCSR_DOT11_MODE_abg: |
| 6624 | snprintf(extra, WE_MAX_STR_LEN, "11ABG"); |
| 6625 | break; |
| 6626 | case eCSR_DOT11_MODE_11a: |
| 6627 | snprintf(extra, WE_MAX_STR_LEN, "11A"); |
| 6628 | break; |
| 6629 | case eCSR_DOT11_MODE_11b: |
| 6630 | case eCSR_DOT11_MODE_11b_ONLY: |
| 6631 | snprintf(extra, WE_MAX_STR_LEN, "11B"); |
| 6632 | break; |
| 6633 | case eCSR_DOT11_MODE_11g: |
| 6634 | case eCSR_DOT11_MODE_11g_ONLY: |
| 6635 | snprintf(extra, WE_MAX_STR_LEN, "11G"); |
| 6636 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6637 | case eCSR_DOT11_MODE_11ac: |
| 6638 | case eCSR_DOT11_MODE_11ac_ONLY: |
| 6639 | if (hddctx->config->vhtChannelWidth == |
| 6640 | eHT_CHANNEL_WIDTH_20MHZ) |
| 6641 | snprintf(extra, WE_MAX_STR_LEN, |
| 6642 | "11ACVHT20"); |
| 6643 | else if (hddctx->config->vhtChannelWidth == |
| 6644 | eHT_CHANNEL_WIDTH_40MHZ) |
| 6645 | snprintf(extra, WE_MAX_STR_LEN, |
| 6646 | "11ACVHT40"); |
| 6647 | else if (hddctx->config->vhtChannelWidth == |
| 6648 | eHT_CHANNEL_WIDTH_80MHZ) |
| 6649 | snprintf(extra, WE_MAX_STR_LEN, |
| 6650 | "11ACVHT80"); |
| 6651 | else if (hddctx->config->vhtChannelWidth == |
| 6652 | eHT_CHANNEL_WIDTH_160MHZ) |
| 6653 | snprintf(extra, WE_MAX_STR_LEN, |
| 6654 | "11ACVHT160"); |
| 6655 | break; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 6656 | case eCSR_DOT11_MODE_11ax: |
| 6657 | case eCSR_DOT11_MODE_11ax_ONLY: |
| 6658 | /* currently using vhtChannelWidth */ |
| 6659 | if (hddctx->config->vhtChannelWidth == |
| 6660 | eHT_CHANNEL_WIDTH_20MHZ) |
| 6661 | snprintf(extra, WE_MAX_STR_LEN, |
| 6662 | "11AX_HE_20"); |
| 6663 | else if (hddctx->config->vhtChannelWidth == |
| 6664 | eHT_CHANNEL_WIDTH_40MHZ) |
| 6665 | snprintf(extra, WE_MAX_STR_LEN, |
| 6666 | "11AX_HE_40"); |
| 6667 | else if (hddctx->config->vhtChannelWidth == |
| 6668 | eHT_CHANNEL_WIDTH_80MHZ) |
| 6669 | snprintf(extra, WE_MAX_STR_LEN, |
| 6670 | "11AX_HE_80"); |
| 6671 | else if (hddctx->config->vhtChannelWidth == |
| 6672 | eHT_CHANNEL_WIDTH_160MHZ) |
| 6673 | snprintf(extra, WE_MAX_STR_LEN, |
| 6674 | "11AX_HE_160"); |
| 6675 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6676 | } |
| 6677 | |
| 6678 | wrqu->data.length = strlen(extra) + 1; |
| 6679 | break; |
| 6680 | } |
| 6681 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6682 | case WE_GET_OEM_DATA_CAP: |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 6683 | return iw_get_oem_data_cap_wrapper(dev, info, wrqu, extra); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6684 | case WE_GET_SNR: |
| 6685 | { |
| 6686 | int8_t s7snr = 0; |
| 6687 | int status = 0; |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6688 | struct hdd_context *hdd_ctx; |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6689 | struct hdd_station_ctx *sta_ctx; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6690 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6691 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6692 | status = wlan_hdd_validate_context(hdd_ctx); |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 6693 | if (status) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6694 | return status; |
Abhishek Singh | 23edd1c | 2016-05-05 11:56:06 +0530 | [diff] [blame] | 6695 | |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6696 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6697 | if (0 == hdd_ctx->config->fEnableSNRMonitoring || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6698 | eConnectionState_Associated != |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6699 | sta_ctx->conn_info.connState) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6700 | hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d", |
Jeff Johnson | ce2ee98 | 2017-09-03 09:27:35 -0700 | [diff] [blame] | 6701 | hdd_ctx->config->fEnableSNRMonitoring, |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 6702 | sta_ctx->conn_info.connState); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6703 | return -ENONET; |
| 6704 | } |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 6705 | wlan_hdd_get_snr(adapter, &s7snr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6706 | snprintf(extra, WE_MAX_STR_LEN, "snr=%d", s7snr); |
| 6707 | wrqu->data.length = strlen(extra) + 1; |
| 6708 | break; |
| 6709 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6710 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6711 | default: |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6712 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6713 | break; |
| 6714 | } |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6715 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6716 | hdd_exit(); |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 6717 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6718 | } |
| 6719 | |
| 6720 | static int iw_get_char_setnone(struct net_device *dev, |
| 6721 | struct iw_request_info *info, |
| 6722 | union iwreq_data *wrqu, char *extra) |
| 6723 | { |
| 6724 | int ret; |
| 6725 | |
| 6726 | cds_ssr_protect(__func__); |
| 6727 | ret = __iw_get_char_setnone(dev, info, wrqu, extra); |
| 6728 | cds_ssr_unprotect(__func__); |
| 6729 | |
| 6730 | return ret; |
| 6731 | } |
| 6732 | |
| 6733 | /** |
| 6734 | * iw_setnone_getnone() - Generic "action" private ioctl handler |
| 6735 | * @dev: device upon which the ioctl was received |
| 6736 | * @info: ioctl request information |
| 6737 | * @wrqu: ioctl request data |
| 6738 | * @extra: ioctl extra data |
| 6739 | * |
| 6740 | * Return: 0 on success, non-zero on error |
| 6741 | */ |
| 6742 | static int __iw_setnone_getnone(struct net_device *dev, |
| 6743 | struct iw_request_info *info, |
| 6744 | union iwreq_data *wrqu, char *extra) |
| 6745 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6746 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6747 | struct hdd_context *hdd_ctx; |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6748 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6749 | int ret; |
| 6750 | int sub_cmd; |
| 6751 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 6752 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 6753 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6754 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6755 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 6756 | if (0 != ret) |
| 6757 | return ret; |
| 6758 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 6759 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 6760 | if (0 != ret) |
| 6761 | return ret; |
| 6762 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6763 | #ifdef CONFIG_COMPAT |
| 6764 | /* this ioctl is a special case where a sub-ioctl is used and both |
| 6765 | * the number of get and set args is 0. in this specific case the |
| 6766 | * logic in iwpriv places the sub_cmd in the data.flags portion of |
| 6767 | * the iwreq. unfortunately the location of this field will be |
| 6768 | * different between 32-bit and 64-bit userspace, and the standard |
| 6769 | * compat support in the kernel does not handle this case. so we |
| 6770 | * need to explicitly handle it here. |
| 6771 | */ |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 6772 | if (in_compat_syscall()) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6773 | struct compat_iw_point *compat_iw_point = |
| 6774 | (struct compat_iw_point *)&wrqu->data; |
| 6775 | sub_cmd = compat_iw_point->flags; |
| 6776 | } else { |
| 6777 | sub_cmd = wrqu->data.flags; |
| 6778 | } |
| 6779 | #else |
| 6780 | sub_cmd = wrqu->data.flags; |
| 6781 | #endif |
| 6782 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6783 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6784 | switch (sub_cmd) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6785 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6786 | case WE_GET_RECOVERY_STAT: |
| 6787 | sme_get_recovery_stats(mac_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6788 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6789 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6790 | case WE_GET_FW_PROFILE_DATA: |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6791 | ret = wma_cli_set_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 6792 | WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, |
| 6793 | 0, DBG_CMD); |
| 6794 | break; |
| 6795 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6796 | case WE_IBSS_GET_PEER_INFO_ALL: |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6797 | hdd_wlan_get_ibss_peer_info_all(adapter); |
| 6798 | break; |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 6799 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6800 | case WE_SET_REASSOC_TRIGGER: |
| 6801 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 6802 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6803 | tSirMacAddr bssid; |
Krunal Soni | bfd0549 | 2017-10-03 15:48:37 -0700 | [diff] [blame] | 6804 | uint32_t roamId = INVALID_ROAM_ID; |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6805 | uint8_t operating_ch = |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 6806 | adapter->session.station.conn_info.operationChannel; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6807 | tCsrRoamModifyProfileFields modProfileFields; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6808 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6809 | sme_get_modify_profile_fields(mac_handle, adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6810 | &modProfileFields); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6811 | if (roaming_offload_enabled(hdd_ctx)) { |
| 6812 | qdf_mem_copy(bssid, |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 6813 | &adapter->session.station.conn_info.bssId, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6814 | sizeof(bssid)); |
Naveen Rawat | 664a7cb | 2017-01-19 17:58:14 -0800 | [diff] [blame] | 6815 | hdd_wma_send_fastreassoc_cmd(adapter, |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6816 | bssid, operating_ch); |
| 6817 | } else { |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6818 | sme_roam_reassoc(mac_handle, adapter->session_id, |
| 6819 | NULL, modProfileFields, &roamId, 1); |
Deepak Dhamdhere | 5fda0e4 | 2016-06-24 18:30:02 +0530 | [diff] [blame] | 6820 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6821 | return 0; |
| 6822 | } |
| 6823 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6824 | case WE_STOP_OBSS_SCAN: |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6825 | /* |
| 6826 | * 1.OBSS Scan is mandatory while operating in 2.4GHz |
| 6827 | * 2.OBSS scan is stopped by Firmware during the disassociation |
| 6828 | * 3.OBSS stop comamnd is added for debugging purpose |
| 6829 | */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6830 | if (!mac_handle) { |
| 6831 | hdd_err("mac_handle context is NULL"); |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 6832 | return -EINVAL; |
| 6833 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 6834 | sme_ht40_stop_obss_scan(mac_handle, adapter->session_id); |
| 6835 | break; |
| 6836 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6837 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 6838 | hdd_err("unknown ioctl %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6839 | break; |
| 6840 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 6841 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 6842 | return ret; |
| 6843 | } |
| 6844 | |
| 6845 | static int iw_setnone_getnone(struct net_device *dev, |
| 6846 | struct iw_request_info *info, |
| 6847 | union iwreq_data *wrqu, char *extra) |
| 6848 | { |
| 6849 | int ret; |
| 6850 | |
| 6851 | cds_ssr_protect(__func__); |
| 6852 | ret = __iw_setnone_getnone(dev, info, wrqu, extra); |
| 6853 | cds_ssr_unprotect(__func__); |
| 6854 | |
| 6855 | return ret; |
| 6856 | } |
| 6857 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6858 | #ifdef MPC_UT_FRAMEWORK |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 6859 | 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] | 6860 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6861 | { |
Jeff Johnson | ac8b0de | 2017-02-10 09:22:22 -0800 | [diff] [blame] | 6862 | switch (sub_cmd) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6863 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 6864 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6865 | hdd_debug("<iwpriv wlan0 pm_clist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6866 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6867 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 6868 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 6869 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 6870 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6871 | return 0; |
| 6872 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6873 | policy_mgr_incr_connection_count_utfw(hdd_ctx->hdd_psoc, |
| 6874 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 6875 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6876 | } |
| 6877 | break; |
| 6878 | |
| 6879 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 6880 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6881 | hdd_debug("<iwpriv wlan0 pm_dlist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6882 | if ((apps_args[0] < 0) || (apps_args[1] < 0)) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6883 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6884 | return 0; |
| 6885 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6886 | policy_mgr_decr_connection_count_utfw(hdd_ctx->hdd_psoc, |
| 6887 | apps_args[0], apps_args[1]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6888 | } |
| 6889 | break; |
| 6890 | |
| 6891 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 6892 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6893 | hdd_debug("<iwpriv wlan0 pm_ulist> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6894 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6895 | (apps_args[2] < 0) || (apps_args[3] < 0) || |
| 6896 | (apps_args[4] < 0) || (apps_args[5] < 0) || |
| 6897 | (apps_args[6] < 0) || (apps_args[7] < 0)) { |
| 6898 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6899 | return 0; |
| 6900 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6901 | policy_mgr_update_connection_info_utfw(hdd_ctx->hdd_psoc, |
| 6902 | apps_args[0], apps_args[1], apps_args[2], apps_args[3], |
| 6903 | apps_args[4], apps_args[5], apps_args[6], apps_args[7]); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6904 | } |
| 6905 | break; |
| 6906 | |
| 6907 | case WE_POLICY_MANAGER_DBS_CMD: |
| 6908 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 6909 | hdd_debug("<iwpriv wlan0 pm_dbs> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6910 | if (apps_args[0] == 0) |
| 6911 | wma_set_dbs_capability_ut(0); |
| 6912 | else |
| 6913 | wma_set_dbs_capability_ut(1); |
| 6914 | |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6915 | if (apps_args[1] >= PM_THROUGHPUT && |
| 6916 | apps_args[1] <= PM_LATENCY) { |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6917 | pr_info("setting system pref to [%d]\n", apps_args[1]); |
| 6918 | hdd_ctx->config->conc_system_pref = apps_args[1]; |
| 6919 | } |
| 6920 | } |
| 6921 | break; |
| 6922 | |
| 6923 | case WE_POLICY_MANAGER_PCL_CMD: |
| 6924 | { |
| 6925 | uint8_t pcl[QDF_MAX_NUM_CHAN] = {0}; |
| 6926 | uint8_t weight_list[QDF_MAX_NUM_CHAN] = {0}; |
| 6927 | uint32_t pcl_len = 0, i = 0; |
| 6928 | |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 6929 | hdd_debug("<iwpriv wlan0 pm_pcl> is called"); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6930 | |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6931 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6932 | hdd_err("Invalid input param received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6933 | return 0; |
| 6934 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6935 | policy_mgr_get_pcl(hdd_ctx->hdd_psoc, apps_args[0], |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6936 | pcl, &pcl_len, |
| 6937 | weight_list, QDF_ARRAY_SIZE(weight_list)); |
| 6938 | pr_info("PCL list for role[%d] is {", apps_args[0]); |
| 6939 | for (i = 0 ; i < pcl_len; i++) |
| 6940 | pr_info(" %d, ", pcl[i]); |
| 6941 | pr_info("}--------->\n"); |
| 6942 | } |
| 6943 | break; |
| 6944 | |
| 6945 | case WE_POLICY_SET_HW_MODE_CMD: |
| 6946 | { |
| 6947 | if (apps_args[0] == 0) { |
| 6948 | hdd_err("set hw mode for single mac"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6949 | policy_mgr_pdev_set_hw_mode(hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6950 | adapter->session_id, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6951 | HW_MODE_SS_2x2, |
| 6952 | HW_MODE_80_MHZ, |
| 6953 | HW_MODE_SS_0x0, HW_MODE_BW_NONE, |
| 6954 | HW_MODE_DBS_NONE, |
| 6955 | HW_MODE_AGILE_DFS_NONE, |
| 6956 | HW_MODE_SBS_NONE, |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6957 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6958 | } else if (apps_args[0] == 1) { |
| 6959 | hdd_err("set hw mode for dual mac"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6960 | policy_mgr_pdev_set_hw_mode(hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6961 | adapter->session_id, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6962 | HW_MODE_SS_1x1, |
| 6963 | HW_MODE_80_MHZ, |
| 6964 | HW_MODE_SS_1x1, HW_MODE_40_MHZ, |
| 6965 | HW_MODE_DBS, |
| 6966 | HW_MODE_AGILE_DFS_NONE, |
| 6967 | HW_MODE_SBS_NONE, |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6968 | POLICY_MGR_UPDATE_REASON_UT, PM_NOP); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6969 | } |
| 6970 | } |
| 6971 | break; |
| 6972 | |
| 6973 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 6974 | { |
Varun Reddy Yeturu | 8a5d3d4 | 2017-08-02 13:03:27 -0700 | [diff] [blame] | 6975 | hdd_debug("<iwpriv wlan0 pm_query_action> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6976 | if (apps_args[0] < 0) { |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6977 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6978 | return 0; |
| 6979 | } |
Tushnim Bhattacharyya | dfbce70 | 2018-03-27 12:46:48 -0700 | [diff] [blame] | 6980 | policy_mgr_current_connections_update( |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6981 | hdd_ctx->hdd_psoc, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 6982 | adapter->session_id, apps_args[0], |
Tushnim Bhattacharyya | 3b99f4b | 2018-03-26 14:19:24 -0700 | [diff] [blame] | 6983 | POLICY_MGR_UPDATE_REASON_UT); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6984 | } |
| 6985 | break; |
| 6986 | |
| 6987 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 6988 | { |
| 6989 | bool allow; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 6990 | |
Dustin Brown | 5e89ef8 | 2018-03-14 11:50:23 -0700 | [diff] [blame] | 6991 | hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6992 | if ((apps_args[0] < 0) || (apps_args[1] < 0) || |
Pragaspathi Thilagaraj | c81ad0e | 2018-05-22 14:02:41 +0530 | [diff] [blame] | 6993 | (apps_args[2] < 0)) { |
| 6994 | hdd_err("Invalid input params received for the IOCTL"); |
Pragaspathi Thilagaraj | 1e5420a | 2018-04-24 14:32:56 +0530 | [diff] [blame] | 6995 | return 0; |
| 6996 | } |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 6997 | allow = policy_mgr_allow_concurrency(hdd_ctx->hdd_psoc, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 6998 | apps_args[0], apps_args[1], apps_args[2]); |
| 6999 | pr_info("allow %d {0 = don't allow, 1 = allow}", allow); |
| 7000 | } |
| 7001 | break; |
| 7002 | |
| 7003 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7004 | { |
| 7005 | clean_report(hdd_ctx); |
| 7006 | if (apps_args[0] == 1) { |
| 7007 | wlan_hdd_one_connection_scenario(hdd_ctx); |
| 7008 | } else if (apps_args[0] == 2) { |
| 7009 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7010 | 6, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7011 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7012 | 36, POLICY_MGR_TWO_TWO); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7013 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7014 | 6, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7015 | wlan_hdd_two_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7016 | 36, POLICY_MGR_ONE_ONE); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7017 | } else if (apps_args[0] == 3) { |
| 7018 | /* MCC on same band with 2x2 same mac*/ |
| 7019 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7020 | 6, 11, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7021 | /* MCC on diff band with 2x2 same mac*/ |
| 7022 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7023 | 6, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7024 | /* MCC on diff band with 1x1 diff mac */ |
| 7025 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7026 | 36, 6, POLICY_MGR_ONE_ONE, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7027 | /* MCC on diff band with 1x1 same mac */ |
| 7028 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7029 | 36, 6, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7030 | /* SCC on same band with 2x2 same mac */ |
| 7031 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7032 | 36, 36, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7033 | /* SCC on same band with 1x1 same mac */ |
| 7034 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7035 | 36, 36, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7036 | /* MCC on same band with 2x2 same mac */ |
| 7037 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7038 | 36, 149, POLICY_MGR_TWO_TWO, 0); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7039 | /* MCC on same band with 1x1 same mac */ |
| 7040 | wlan_hdd_three_connections_scenario(hdd_ctx, |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7041 | 36, 149, POLICY_MGR_ONE_ONE, 1); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7042 | } |
| 7043 | print_report(hdd_ctx); |
| 7044 | } |
| 7045 | break; |
| 7046 | } |
| 7047 | return 0; |
| 7048 | } |
| 7049 | #else |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7050 | 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] | 7051 | struct hdd_adapter *adapter, int sub_cmd, int *apps_args) |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7052 | { |
| 7053 | return 0; |
| 7054 | } |
| 7055 | #endif |
| 7056 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7057 | /** |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7058 | * hdd_ch_avoid_unit_cmd - unit test ch avoidance |
| 7059 | * @hdd_ctx: hdd_context |
| 7060 | * @num_args: input args number |
| 7061 | * @apps_args: args data ptr |
| 7062 | * |
| 7063 | * This is to inject a ch avoid event to do unit test SAP chan avoidance. |
| 7064 | * |
| 7065 | * Return: void |
| 7066 | */ |
| 7067 | #if WLAN_DEBUG |
| 7068 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7069 | int num_args, int *apps_args) |
| 7070 | { |
| 7071 | struct ch_avoid_ind_type ch_avoid; |
| 7072 | int cnt = 0, i; |
| 7073 | |
| 7074 | if (num_args < 2 || num_args > CH_AVOID_MAX_RANGE * 2 || |
| 7075 | num_args % 2 != 0) |
| 7076 | return; |
| 7077 | hdd_info("simulate ch avoid num_args %d", num_args); |
| 7078 | for (i = 0; i < num_args && i < CH_AVOID_MAX_RANGE * 2; i++) { |
| 7079 | ch_avoid.avoid_freq_range[cnt].start_freq = |
| 7080 | apps_args[i]; |
| 7081 | ch_avoid.avoid_freq_range[cnt].end_freq = |
| 7082 | apps_args[++i]; |
| 7083 | |
| 7084 | hdd_info("simulate ch avoid [%d %d]", |
| 7085 | ch_avoid.avoid_freq_range[cnt].start_freq, |
| 7086 | ch_avoid.avoid_freq_range[cnt].end_freq); |
| 7087 | cnt++; |
| 7088 | } |
| 7089 | ch_avoid.ch_avoid_range_cnt = cnt; |
| 7090 | ucfg_reg_unit_simulate_ch_avoid(hdd_ctx->hdd_psoc, &ch_avoid); |
| 7091 | } |
| 7092 | #else |
| 7093 | static void hdd_ch_avoid_unit_cmd(struct hdd_context *hdd_ctx, |
| 7094 | int num_args, int *apps_args) |
| 7095 | { |
| 7096 | } |
| 7097 | #endif |
| 7098 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7099 | * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7100 | * @dev: device upon which the ioctl was received |
| 7101 | * @info: ioctl request information |
| 7102 | * @wrqu: ioctl request data |
| 7103 | * @extra: ioctl extra data |
| 7104 | * |
| 7105 | * This is an SSR-protected generic handler for private ioctls which |
| 7106 | * take multiple arguments. Note that this implementation is also |
| 7107 | * somewhat unique in that it is shared by both STA-mode and SAP-mode |
| 7108 | * interfaces. |
| 7109 | * |
| 7110 | * Return: 0 on success, non-zero on error |
| 7111 | */ |
| 7112 | static int __iw_set_var_ints_getnone(struct net_device *dev, |
| 7113 | struct iw_request_info *info, |
| 7114 | union iwreq_data *wrqu, char *extra) |
| 7115 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7116 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7117 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7118 | int sub_cmd; |
| 7119 | int *apps_args = (int *) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7120 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7121 | int ret, num_args; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7122 | void *soc = NULL; |
| 7123 | struct cdp_pdev *pdev = NULL; |
| 7124 | struct cdp_vdev *vdev = NULL; |
| 7125 | struct cdp_txrx_stats_req req = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7126 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7127 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7128 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7129 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7130 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7131 | if (0 != ret) |
| 7132 | return ret; |
| 7133 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7134 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7135 | if (0 != ret) |
| 7136 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7137 | |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7138 | mac_handle = hdd_ctx->mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7139 | sub_cmd = wrqu->data.flags; |
| 7140 | num_args = wrqu->data.length; |
| 7141 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7142 | hdd_debug("Received length %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7143 | |
| 7144 | switch (sub_cmd) { |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7145 | case WE_IBSS_GET_PEER_INFO: |
| 7146 | { |
| 7147 | pr_info("Station ID = %d\n", apps_args[0]); |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7148 | hdd_wlan_get_ibss_peer_info(adapter, apps_args[0]); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 7149 | } |
| 7150 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7151 | |
| 7152 | case WE_P2P_NOA_CMD: |
| 7153 | { |
Srinivas Girigowda | 5d5fdc5 | 2017-03-24 22:30:57 -0700 | [diff] [blame] | 7154 | struct p2p_app_set_ps p2pNoA; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7155 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7156 | if (adapter->device_mode != QDF_P2P_GO_MODE) { |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7157 | hdd_err("Setting NoA is not allowed in Device mode %s(%d)", |
| 7158 | hdd_device_mode_to_string( |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7159 | adapter->device_mode), |
| 7160 | adapter->device_mode); |
Rajeev Kumar | 274034c | 2015-11-23 11:28:58 -0800 | [diff] [blame] | 7161 | return -EINVAL; |
| 7162 | } |
| 7163 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7164 | p2pNoA.opp_ps = apps_args[0]; |
| 7165 | p2pNoA.ctWindow = apps_args[1]; |
| 7166 | p2pNoA.duration = apps_args[2]; |
| 7167 | p2pNoA.interval = apps_args[3]; |
| 7168 | p2pNoA.count = apps_args[4]; |
| 7169 | p2pNoA.single_noa_duration = apps_args[5]; |
| 7170 | p2pNoA.psSelection = apps_args[6]; |
| 7171 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7172 | 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] | 7173 | apps_args[0], apps_args[1], apps_args[2], |
| 7174 | apps_args[3], apps_args[4], |
| 7175 | apps_args[5], apps_args[6]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7176 | |
| 7177 | hdd_set_p2p_ps(dev, &p2pNoA); |
| 7178 | |
| 7179 | } |
| 7180 | break; |
| 7181 | |
| 7182 | case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD: |
| 7183 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7184 | hdd_debug("SELECTIVE_MODULE_LOG %d arg1 %d arg2", |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7185 | apps_args[0], apps_args[1]); |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 7186 | qdf_trace_enable(apps_args[0], apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7187 | } |
| 7188 | break; |
| 7189 | |
| 7190 | case WE_MTRACE_DUMP_CMD: |
| 7191 | { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7192 | 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] | 7193 | apps_args[0], apps_args[1], |
| 7194 | apps_args[2], apps_args[3]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7195 | qdf_trace_dump_all((void *)mac_handle, apps_args[0], |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7196 | apps_args[1], apps_args[2], |
| 7197 | apps_args[3]); |
| 7198 | |
| 7199 | } |
| 7200 | break; |
| 7201 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7202 | case WE_POLICY_MANAGER_CINFO_CMD: |
| 7203 | { |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7204 | struct policy_mgr_conc_connection_info *conn_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7205 | uint32_t i = 0, len = 0; |
| 7206 | |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7207 | hdd_info("<iwpriv wlan0 pm_cinfo> is called"); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 7208 | conn_info = policy_mgr_get_conn_info(&len); |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7209 | pr_info("+--------------------------+\n"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7210 | for (i = 0; i < len; i++) { |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7211 | pr_info("|table_index[%d]\t\t\n", i); |
| 7212 | pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id); |
| 7213 | pr_info("|\t|chan - %-10d|\n", conn_info->chan); |
| 7214 | pr_info("|\t|bw - %-10d|\n", conn_info->bw); |
| 7215 | pr_info("|\t|mode - %-10d|\n", conn_info->mode); |
| 7216 | pr_info("|\t|mac - %-10d|\n", conn_info->mac); |
| 7217 | pr_info("|\t|in_use - %-10d|\n", conn_info->in_use); |
| 7218 | pr_info("+--------------------------+\n"); |
| 7219 | conn_info++; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7220 | } |
| 7221 | } |
| 7222 | break; |
| 7223 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7224 | case WE_UNIT_TEST_CMD: |
| 7225 | { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7226 | QDF_STATUS status; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7227 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7228 | if ((apps_args[0] < WLAN_MODULE_ID_MIN) || |
| 7229 | (apps_args[0] >= WLAN_MODULE_ID_MAX)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7230 | hdd_err("Invalid MODULE ID %d", apps_args[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7231 | return -EINVAL; |
| 7232 | } |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7233 | if ((apps_args[1] >= (WMA_MAX_NUM_ARGS)) || |
Anurag Chouhan | 7756418 | 2016-09-03 16:38:01 +0530 | [diff] [blame] | 7234 | (apps_args[1] < 0)) { |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7235 | hdd_err("Too Many/Few args %d", apps_args[1]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7236 | return -EINVAL; |
| 7237 | } |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7238 | status = sme_send_unit_test_cmd(adapter->session_id, |
Krunal Soni | aadaa27 | 2017-10-04 16:42:55 -0700 | [diff] [blame] | 7239 | apps_args[0], |
| 7240 | apps_args[1], |
| 7241 | &apps_args[2]); |
| 7242 | if (QDF_STATUS_SUCCESS != status) { |
Jeff Johnson | 21d63bb | 2017-10-07 17:45:33 -0700 | [diff] [blame] | 7243 | hdd_err("sme_send_unit_test_cmd returned %d", status); |
| 7244 | return -EINVAL; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7245 | } |
| 7246 | } |
| 7247 | break; |
| 7248 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 7249 | case WE_LED_FLASHING_PARAM: |
| 7250 | { |
| 7251 | int i; |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7252 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7253 | if (num_args != 4) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7254 | hdd_err("gpio_control: 4 parameters are required"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7255 | return -EINVAL; |
| 7256 | } |
| 7257 | for (i = 0; i < num_args; i++) { |
| 7258 | if (apps_args[i] >= 0x7fffffff) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7259 | hdd_err("gpio_control: parameter should be less than 0x7fffffff"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7260 | return -EINVAL; |
| 7261 | } |
| 7262 | } |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7263 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7264 | 0, apps_args[0], apps_args[1]); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7265 | sme_set_led_flashing(mac_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7266 | 1, apps_args[2], apps_args[3]); |
| 7267 | } |
| 7268 | break; |
| 7269 | #endif |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 7270 | case WE_SET_PKTLOG: |
| 7271 | { |
| 7272 | int ret; |
| 7273 | |
| 7274 | if (num_args < 1 || num_args > 2) { |
| 7275 | hdd_err("pktlog: either 1 or 2 parameters are required"); |
| 7276 | return -EINVAL; |
| 7277 | } |
| 7278 | |
| 7279 | ret = hdd_process_pktlog_command(hdd_ctx, apps_args[0], |
| 7280 | apps_args[1]); |
| 7281 | if (ret) |
| 7282 | return ret; |
| 7283 | break; |
| 7284 | } |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7285 | case WE_MAC_PWR_DEBUG_CMD: |
| 7286 | { |
| 7287 | struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args; |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7288 | int i, j; |
| 7289 | |
| 7290 | if (num_args < 3) { |
| 7291 | hdd_err("number of arguments can't be null %d", |
| 7292 | num_args); |
| 7293 | return -EINVAL; |
| 7294 | } |
| 7295 | if (num_args - 3 != apps_args[2]) { |
| 7296 | hdd_err("arg list of size %d doesn't match num_args %d", |
| 7297 | num_args-3, apps_args[2]); |
| 7298 | return -EINVAL; |
| 7299 | } |
| 7300 | if ((apps_args[1] < WLAN_MODULE_ID_MIN) || |
| 7301 | (apps_args[1] >= WLAN_MODULE_ID_MAX)) { |
| 7302 | hdd_err("Invalid MODULE ID %d", apps_args[1]); |
| 7303 | return -EINVAL; |
| 7304 | } |
| 7305 | if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) { |
| 7306 | hdd_err("Too Many args %d", apps_args[2]); |
| 7307 | return -EINVAL; |
| 7308 | } |
| 7309 | mac_pwr_dbg_args.pdev_id = apps_args[0]; |
| 7310 | mac_pwr_dbg_args.module_id = apps_args[1]; |
| 7311 | mac_pwr_dbg_args.num_args = apps_args[2]; |
| 7312 | |
| 7313 | for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++) |
| 7314 | mac_pwr_dbg_args.args[i] = apps_args[j]; |
| 7315 | |
| 7316 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7317 | sme_process_mac_pwr_dbg_cmd(mac_handle, |
| 7318 | adapter->session_id, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 7319 | &mac_pwr_dbg_args)) { |
| 7320 | return -EINVAL; |
| 7321 | } |
| 7322 | } |
| 7323 | break; |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7324 | case WE_POLICY_MANAGER_CLIST_CMD: |
| 7325 | case WE_POLICY_MANAGER_DLIST_CMD: |
| 7326 | case WE_POLICY_MANAGER_ULIST_CMD: |
| 7327 | case WE_POLICY_MANAGER_DBS_CMD: |
| 7328 | case WE_POLICY_MANAGER_PCL_CMD: |
| 7329 | case WE_POLICY_SET_HW_MODE_CMD: |
| 7330 | case WE_POLICY_MANAGER_QUERY_ACTION_CMD: |
| 7331 | case WE_POLICY_MANAGER_QUERY_ALLOW_CMD: |
| 7332 | case WE_POLICY_MANAGER_SCENARIO_CMD: |
| 7333 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7334 | iw_get_policy_manager_ut_ops(hdd_ctx, adapter, |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 7335 | sub_cmd, apps_args); |
| 7336 | } |
| 7337 | break; |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 7338 | case WE_SET_CHAN_AVOID: |
| 7339 | { |
| 7340 | hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args); |
| 7341 | } |
| 7342 | break; |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 7343 | case WE_SET_TXRX_STATS: |
| 7344 | { |
| 7345 | ret = cds_get_datapath_handles(&soc, &pdev, &vdev, |
| 7346 | adapter->session_id); |
| 7347 | |
| 7348 | if (ret != 0) { |
| 7349 | hdd_err("Invalid handles"); |
| 7350 | break; |
| 7351 | } |
| 7352 | |
| 7353 | req.stats = apps_args[0]; |
| 7354 | /* default value of secondary parameter is 0(mac_id) */ |
| 7355 | req.mac_id = apps_args[1]; |
| 7356 | |
| 7357 | hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", |
| 7358 | req.stats, req.mac_id); |
| 7359 | ret = cdp_txrx_stats_request(soc, vdev, &req); |
| 7360 | break; |
| 7361 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7362 | default: |
| 7363 | { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7364 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7365 | } |
| 7366 | break; |
| 7367 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7368 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7369 | return 0; |
| 7370 | } |
| 7371 | |
| 7372 | /** |
| 7373 | * iw_hdd_set_var_ints_getnone() - set var ints getnone callback |
| 7374 | * @dev: pointer to net_device structure |
| 7375 | * @info: pointer to iw_request_info structure |
| 7376 | * @wrqu: pointer to iwreq_data |
| 7377 | * @extra; extra |
| 7378 | * |
| 7379 | * Return: 0 on success, error number otherwise |
| 7380 | * |
| 7381 | */ |
| 7382 | static int iw_hdd_set_var_ints_getnone(struct net_device *dev, |
| 7383 | struct iw_request_info *info, |
| 7384 | union iwreq_data *wrqu, char *extra) |
| 7385 | { |
| 7386 | union iwreq_data u_priv_wrqu; |
| 7387 | int apps_args[MAX_VAR_ARGS] = {0}; |
| 7388 | int ret, num_args; |
| 7389 | |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7390 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7391 | hdd_err("permission check failed"); |
Mukul Sharma | 64a70e8 | 2015-11-02 20:05:09 +0530 | [diff] [blame] | 7392 | return -EPERM; |
| 7393 | } |
| 7394 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7395 | /* Helper function to get iwreq_data with compat handling. */ |
| 7396 | if (hdd_priv_get_data(&u_priv_wrqu.data, wrqu)) |
| 7397 | return -EINVAL; |
| 7398 | |
| 7399 | if (NULL == u_priv_wrqu.data.pointer) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7400 | hdd_err("NULL data pointer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7401 | return -EINVAL; |
| 7402 | } |
| 7403 | |
| 7404 | num_args = u_priv_wrqu.data.length; |
| 7405 | if (num_args > MAX_VAR_ARGS) |
| 7406 | num_args = MAX_VAR_ARGS; |
| 7407 | |
| 7408 | if (copy_from_user(apps_args, u_priv_wrqu.data.pointer, |
| 7409 | (sizeof(int)) * num_args)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7410 | hdd_err("failed to copy data from user buffer"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7411 | return -EFAULT; |
| 7412 | } |
| 7413 | |
| 7414 | cds_ssr_protect(__func__); |
| 7415 | ret = __iw_set_var_ints_getnone(dev, info, &u_priv_wrqu, |
| 7416 | (char *)&apps_args); |
| 7417 | cds_ssr_unprotect(__func__); |
| 7418 | return ret; |
| 7419 | } |
| 7420 | |
| 7421 | /** |
| 7422 | * iw_set_var_ints_getnone - Generic "set many" private ioctl handler |
| 7423 | * @dev: device upon which the ioctl was received |
| 7424 | * @info: ioctl request information |
| 7425 | * @wrqu: ioctl request data |
| 7426 | * @extra: ioctl extra data |
| 7427 | * |
| 7428 | * This is a generic handler for private ioctls which take multiple |
| 7429 | * arguments. Note that this implementation is also somewhat unique |
| 7430 | * in that it is shared by both STA-mode and SAP-mode interfaces. |
| 7431 | * |
| 7432 | * Return: 0 on success, non-zero on error |
| 7433 | */ |
| 7434 | int iw_set_var_ints_getnone(struct net_device *dev, |
| 7435 | struct iw_request_info *info, |
| 7436 | union iwreq_data *wrqu, char *extra) |
| 7437 | { |
| 7438 | int ret; |
| 7439 | |
| 7440 | cds_ssr_protect(__func__); |
| 7441 | ret = __iw_set_var_ints_getnone(dev, info, wrqu, extra); |
| 7442 | cds_ssr_unprotect(__func__); |
| 7443 | return ret; |
| 7444 | } |
| 7445 | |
| 7446 | /** |
| 7447 | * iw_add_tspec - Add TSpec private ioctl handler |
| 7448 | * @dev: device upon which the ioctl was received |
| 7449 | * @info: ioctl request information |
| 7450 | * @wrqu: ioctl request data |
| 7451 | * @extra: ioctl extra data |
| 7452 | * |
| 7453 | * Return: 0 on success, non-zero on error |
| 7454 | */ |
| 7455 | static int __iw_add_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7456 | union iwreq_data *wrqu, char *extra) |
| 7457 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7458 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7459 | 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] | 7460 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7461 | int params[HDD_WLAN_WMM_PARAM_COUNT]; |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 7462 | struct sme_qos_wmmtspecinfo tSpec; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7463 | uint32_t handle; |
| 7464 | struct iw_point s_priv_data; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7465 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7466 | int ret; |
| 7467 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7468 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7469 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7470 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7471 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7472 | if (0 != ret) |
| 7473 | return ret; |
| 7474 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7475 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7476 | if (0 != ret) |
| 7477 | return ret; |
| 7478 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7479 | /* make sure the application is sufficiently priviledged */ |
| 7480 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 7481 | /* this ioctl wants to return status to user space it must be */ |
| 7482 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7483 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7484 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7485 | |
| 7486 | /* we must be associated in order to add a tspec */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7487 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7488 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7489 | return 0; |
| 7490 | } |
| 7491 | /* since we are defined to be a "get" ioctl, and since the number */ |
| 7492 | /* of params exceeds the number of params that wireless extensions */ |
| 7493 | /* will pass down in the iwreq_data, we must copy the "set" params. */ |
| 7494 | /* We must handle the compat for iwreq_data in 32U/64K environment. */ |
| 7495 | |
| 7496 | /* helper function to get iwreq_data with compat handling. */ |
| 7497 | if (hdd_priv_get_data(&s_priv_data, wrqu)) { |
| 7498 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7499 | return 0; |
| 7500 | } |
| 7501 | /* make sure all params are correctly passed to function */ |
| 7502 | if ((NULL == s_priv_data.pointer) || |
| 7503 | (HDD_WLAN_WMM_PARAM_COUNT != s_priv_data.length)) { |
| 7504 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7505 | return 0; |
| 7506 | } |
| 7507 | /* from user space ourselves */ |
| 7508 | if (copy_from_user(¶ms, s_priv_data.pointer, sizeof(params))) { |
| 7509 | /* hmmm, can't get them */ |
| 7510 | return -EIO; |
| 7511 | } |
| 7512 | /* clear the tspec */ |
| 7513 | memset(&tSpec, 0, sizeof(tSpec)); |
| 7514 | |
| 7515 | /* validate the handle */ |
| 7516 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7517 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7518 | /* that one is reserved */ |
| 7519 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7520 | return 0; |
| 7521 | } |
| 7522 | /* validate the TID */ |
| 7523 | if (params[HDD_WLAN_WMM_PARAM_TID] > 7) { |
| 7524 | /* out of range */ |
| 7525 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7526 | return 0; |
| 7527 | } |
| 7528 | tSpec.ts_info.tid = params[HDD_WLAN_WMM_PARAM_TID]; |
| 7529 | |
| 7530 | /* validate the direction */ |
| 7531 | switch (params[HDD_WLAN_WMM_PARAM_DIRECTION]) { |
| 7532 | case HDD_WLAN_WMM_DIRECTION_UPSTREAM: |
| 7533 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_UPLINK; |
| 7534 | break; |
| 7535 | |
| 7536 | case HDD_WLAN_WMM_DIRECTION_DOWNSTREAM: |
| 7537 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_DOWNLINK; |
| 7538 | break; |
| 7539 | |
| 7540 | case HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL: |
| 7541 | tSpec.ts_info.direction = SME_QOS_WMM_TS_DIR_BOTH; |
| 7542 | break; |
| 7543 | |
| 7544 | default: |
| 7545 | /* unknown */ |
| 7546 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7547 | return 0; |
| 7548 | } |
| 7549 | |
| 7550 | tSpec.ts_info.psb = params[HDD_WLAN_WMM_PARAM_APSD]; |
| 7551 | |
| 7552 | /* validate the user priority */ |
| 7553 | if (params[HDD_WLAN_WMM_PARAM_USER_PRIORITY] >= SME_QOS_WMM_UP_MAX) { |
| 7554 | /* out of range */ |
| 7555 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7556 | return 0; |
| 7557 | } |
| 7558 | tSpec.ts_info.up = params[HDD_WLAN_WMM_PARAM_USER_PRIORITY]; |
| 7559 | 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] | 7560 | hdd_err("***ts_info.up out of bounds***"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7561 | return 0; |
| 7562 | } |
| 7563 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7564 | hdd_debug("TS_INFO PSB %d UP %d !!!", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7565 | tSpec.ts_info.psb, tSpec.ts_info.up); |
| 7566 | |
| 7567 | tSpec.nominal_msdu_size = params[HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE]; |
| 7568 | tSpec.maximum_msdu_size = params[HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE]; |
| 7569 | tSpec.min_data_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE]; |
| 7570 | tSpec.mean_data_rate = params[HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE]; |
| 7571 | tSpec.peak_data_rate = params[HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE]; |
| 7572 | tSpec.max_burst_size = params[HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE]; |
| 7573 | tSpec.min_phy_rate = params[HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE]; |
| 7574 | tSpec.surplus_bw_allowance = |
| 7575 | params[HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE]; |
| 7576 | tSpec.min_service_interval = |
| 7577 | params[HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL]; |
| 7578 | tSpec.max_service_interval = |
| 7579 | params[HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL]; |
| 7580 | tSpec.suspension_interval = |
| 7581 | params[HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL]; |
| 7582 | tSpec.inactivity_interval = |
| 7583 | params[HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL]; |
| 7584 | |
| 7585 | tSpec.ts_info.burst_size_defn = |
| 7586 | params[HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN]; |
| 7587 | |
| 7588 | /* validate the ts info ack policy */ |
| 7589 | switch (params[HDD_WLAN_WMM_PARAM_ACK_POLICY]) { |
| 7590 | case HDD_WLAN_WMM_TS_INFO_ACK_POLICY_NORMAL_ACK: |
| 7591 | tSpec.ts_info.ack_policy = SME_QOS_WMM_TS_ACK_POLICY_NORMAL_ACK; |
| 7592 | break; |
| 7593 | |
| 7594 | case HDD_WLAN_WMM_TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK: |
| 7595 | tSpec.ts_info.ack_policy = |
| 7596 | SME_QOS_WMM_TS_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK; |
| 7597 | break; |
| 7598 | |
| 7599 | default: |
| 7600 | /* unknown */ |
| 7601 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7602 | return 0; |
| 7603 | } |
| 7604 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7605 | *pStatus = hdd_wmm_addts(adapter, handle, &tSpec); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7606 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7607 | return 0; |
| 7608 | } |
| 7609 | |
| 7610 | static int iw_add_tspec(struct net_device *dev, |
| 7611 | struct iw_request_info *info, |
| 7612 | union iwreq_data *wrqu, char *extra) |
| 7613 | { |
| 7614 | int ret; |
| 7615 | |
| 7616 | cds_ssr_protect(__func__); |
| 7617 | ret = __iw_add_tspec(dev, info, wrqu, extra); |
| 7618 | cds_ssr_unprotect(__func__); |
| 7619 | |
| 7620 | return ret; |
| 7621 | } |
| 7622 | |
| 7623 | /** |
| 7624 | * iw_del_tspec - Delete TSpec private ioctl handler |
| 7625 | * @dev: device upon which the ioctl was received |
| 7626 | * @info: ioctl request information |
| 7627 | * @wrqu: ioctl request data |
| 7628 | * @extra: ioctl extra data |
| 7629 | * |
| 7630 | * Return: 0 on success, non-zero on error |
| 7631 | */ |
| 7632 | static int __iw_del_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7633 | union iwreq_data *wrqu, char *extra) |
| 7634 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7635 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7636 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7637 | int *params = (int *)extra; |
| 7638 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7639 | uint32_t handle; |
| 7640 | int ret; |
| 7641 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7642 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7643 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7644 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7645 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7646 | if (0 != ret) |
| 7647 | return ret; |
| 7648 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7649 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7650 | if (0 != ret) |
| 7651 | return ret; |
| 7652 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7653 | /* make sure the application is sufficiently priviledged */ |
| 7654 | /* note that the kernel will do this for "set" ioctls, but since */ |
| 7655 | /* this ioctl wants to return status to user space it must be */ |
| 7656 | /* defined as a "get" ioctl */ |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 7657 | if (!capable(CAP_NET_ADMIN)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7658 | return -EPERM; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7659 | |
| 7660 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 7661 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 7662 | /* is no need to copy the params from user space */ |
| 7663 | |
| 7664 | /* validate the handle */ |
| 7665 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7666 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7667 | /* that one is reserved */ |
| 7668 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7669 | return 0; |
| 7670 | } |
| 7671 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7672 | *pStatus = hdd_wmm_delts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7673 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7674 | return 0; |
| 7675 | } |
| 7676 | |
| 7677 | static int iw_del_tspec(struct net_device *dev, |
| 7678 | struct iw_request_info *info, |
| 7679 | union iwreq_data *wrqu, char *extra) |
| 7680 | { |
| 7681 | int ret; |
| 7682 | |
| 7683 | cds_ssr_protect(__func__); |
| 7684 | ret = __iw_del_tspec(dev, info, wrqu, extra); |
| 7685 | cds_ssr_unprotect(__func__); |
| 7686 | |
| 7687 | return ret; |
| 7688 | } |
| 7689 | |
| 7690 | /** |
| 7691 | * iw_get_tspec - Get TSpec private ioctl handler |
| 7692 | * @dev: device upon which the ioctl was received |
| 7693 | * @info: ioctl request information |
| 7694 | * @wrqu: ioctl request data |
| 7695 | * @extra: ioctl extra data |
| 7696 | * |
| 7697 | * Return: 0 on success, non-zero on error |
| 7698 | */ |
| 7699 | static int __iw_get_tspec(struct net_device *dev, struct iw_request_info *info, |
| 7700 | union iwreq_data *wrqu, char *extra) |
| 7701 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7702 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7703 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7704 | int *params = (int *)extra; |
| 7705 | hdd_wlan_wmm_status_e *pStatus = (hdd_wlan_wmm_status_e *) extra; |
| 7706 | uint32_t handle; |
| 7707 | int ret; |
| 7708 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7709 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7710 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7711 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7712 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7713 | if (0 != ret) |
| 7714 | return ret; |
| 7715 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7716 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7717 | if (0 != ret) |
| 7718 | return ret; |
| 7719 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7720 | /* although we are defined to be a "get" ioctl, the params we require */ |
| 7721 | /* will fit in the iwreq_data, therefore unlike iw_add_tspec() there */ |
| 7722 | /* is no need to copy the params from user space */ |
| 7723 | |
| 7724 | /* validate the handle */ |
| 7725 | handle = params[HDD_WLAN_WMM_PARAM_HANDLE]; |
| 7726 | if (HDD_WMM_HANDLE_IMPLICIT == handle) { |
| 7727 | /* that one is reserved */ |
| 7728 | *pStatus = HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; |
| 7729 | return 0; |
| 7730 | } |
| 7731 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7732 | *pStatus = hdd_wmm_checkts(adapter, handle); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7733 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7734 | return 0; |
| 7735 | } |
| 7736 | |
| 7737 | static int iw_get_tspec(struct net_device *dev, |
| 7738 | struct iw_request_info *info, |
| 7739 | union iwreq_data *wrqu, char *extra) |
| 7740 | { |
| 7741 | int ret; |
| 7742 | |
| 7743 | cds_ssr_protect(__func__); |
| 7744 | ret = __iw_get_tspec(dev, info, wrqu, extra); |
| 7745 | cds_ssr_unprotect(__func__); |
| 7746 | |
| 7747 | return ret; |
| 7748 | } |
| 7749 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7750 | /** |
| 7751 | * iw_set_fties - Set FT IEs private ioctl handler |
| 7752 | * @dev: device upon which the ioctl was received |
| 7753 | * @info: ioctl request information |
| 7754 | * @wrqu: ioctl request data |
| 7755 | * @extra: ioctl extra data |
| 7756 | * |
| 7757 | * Each time the supplicant has the auth_request or reassoc request |
| 7758 | * IEs ready they are pushed to the driver. The driver will in turn |
| 7759 | * use it to send out the auth req and reassoc req for 11r FT Assoc. |
| 7760 | * |
| 7761 | * Return: 0 on success, non-zero on error |
| 7762 | */ |
| 7763 | static int __iw_set_fties(struct net_device *dev, struct iw_request_info *info, |
| 7764 | union iwreq_data *wrqu, char *extra) |
| 7765 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7766 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7767 | 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] | 7768 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7769 | int ret; |
| 7770 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7771 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7772 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7773 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7774 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7775 | if (0 != ret) |
| 7776 | return ret; |
| 7777 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7778 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7779 | if (0 != ret) |
| 7780 | return ret; |
| 7781 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7782 | if (!wrqu->data.length) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7783 | hdd_err("called with 0 length IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7784 | return -EINVAL; |
| 7785 | } |
| 7786 | if (wrqu->data.pointer == NULL) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7787 | hdd_err("called with NULL IE"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7788 | return -EINVAL; |
| 7789 | } |
| 7790 | /* Added for debug on reception of Re-assoc Req. */ |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 7791 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7792 | hdd_debug("Called with Ie of length = %d when not associated", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7793 | wrqu->data.length); |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7794 | hdd_debug("Should be Re-assoc Req IEs"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7795 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7796 | hdd_debug("called with Ie of length = %d", wrqu->data.length); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7797 | |
| 7798 | /* Pass the received FT IEs to SME */ |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7799 | sme_set_ft_ies(hdd_ctx->mac_handle, adapter->session_id, |
| 7800 | extra, wrqu->data.length); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7801 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7802 | return 0; |
| 7803 | } |
| 7804 | |
| 7805 | static int iw_set_fties(struct net_device *dev, |
| 7806 | struct iw_request_info *info, |
| 7807 | union iwreq_data *wrqu, char *extra) |
| 7808 | { |
| 7809 | int ret; |
| 7810 | |
| 7811 | cds_ssr_protect(__func__); |
| 7812 | ret = __iw_set_fties(dev, info, wrqu, extra); |
| 7813 | cds_ssr_unprotect(__func__); |
| 7814 | |
| 7815 | return ret; |
| 7816 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7817 | |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7818 | /** |
| 7819 | * iw_set_dynamic_mcbc_filter() - Set Dynamic MCBC Filter ioctl handler |
| 7820 | * @dev: device upon which the ioctl was received |
| 7821 | * @info: ioctl request information |
| 7822 | * @wrqu: ioctl request data |
| 7823 | * @extra: ioctl extra data |
| 7824 | * |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 7825 | * This IOCTL is OBSOLETE as of Jan 30, 2017. We are leaving it here for the |
| 7826 | * time being to provide guidance in migrating to standard APIs. |
| 7827 | * |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7828 | * Return: 0 on success, non-zero on error |
| 7829 | */ |
| 7830 | static int iw_set_dynamic_mcbc_filter(struct net_device *dev, |
| 7831 | struct iw_request_info *info, |
| 7832 | union iwreq_data *wrqu, |
| 7833 | char *extra) |
| 7834 | { |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 7835 | hdd_err("\n" |
| 7836 | "setMCBCFilter is obsolete. Use the following instead:\n" |
| 7837 | "Configure multicast filtering via the ‘ip’ command.\n" |
| 7838 | "\tip maddr add 11:22:33:44:55:66 dev wlan0 # allow traffic to address\n" |
| 7839 | "\tip maddr del 11:22:33:44:55:66 dev wlan0 # undo allow\n" |
| 7840 | "Configure broadcast filtering via ini item, 'g_enable_non_arp_bc_hw_filter.'\n" |
| 7841 | "\tg_enable_non_arp_bc_hw_filter=1 # drop all non-ARP broadcast traffic\n" |
| 7842 | "\tg_enable_non_arp_bc_hw_filter=0 # allow all broadcast traffic"); |
Jeff Johnson | 59eb5fd | 2017-10-05 09:42:39 -0700 | [diff] [blame] | 7843 | return -EINVAL; |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 7844 | } |
| 7845 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7846 | /** |
| 7847 | * iw_set_host_offload - Set host offload ioctl handler |
| 7848 | * @dev: device upon which the ioctl was received |
| 7849 | * @info: ioctl request information |
| 7850 | * @wrqu: ioctl request data |
| 7851 | * @extra: ioctl extra data |
| 7852 | * |
| 7853 | * Return: 0 on success, non-zero on error |
| 7854 | */ |
| 7855 | static int __iw_set_host_offload(struct net_device *dev, |
| 7856 | struct iw_request_info *info, |
| 7857 | union iwreq_data *wrqu, char *extra) |
| 7858 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7859 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Srinivas Girigowda | 077143e | 2017-03-25 10:47:27 -0700 | [diff] [blame] | 7860 | struct host_offload_req *pRequest = (struct host_offload_req *) extra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7861 | tSirHostOffloadReq offloadRequest; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7862 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7863 | int ret; |
| 7864 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7865 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7866 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7867 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7868 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7869 | if (0 != ret) |
| 7870 | return ret; |
| 7871 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7872 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7873 | if (0 != ret) |
| 7874 | return ret; |
| 7875 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7876 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7877 | hdd_err("dev is not in CONNECTED state, ignore!!!"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7878 | return -EINVAL; |
| 7879 | } |
| 7880 | |
| 7881 | /* Debug display of request components. */ |
| 7882 | switch (pRequest->offloadType) { |
| 7883 | case WLAN_IPV4_ARP_REPLY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7884 | hdd_debug("Host offload request: ARP reply"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7885 | switch (pRequest->enableOrDisable) { |
| 7886 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7887 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7888 | break; |
| 7889 | case WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7890 | hdd_debug(" BC Filtering enable"); |
Jeff Johnson | 00052dd | 2018-04-29 19:19:06 -0700 | [diff] [blame] | 7891 | /* fallthrough */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7892 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7893 | hdd_debug(" ARP offload enable"); |
| 7894 | hdd_debug(" IP address: %d.%d.%d.%d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7895 | pRequest->params.hostIpv4Addr[0], |
| 7896 | pRequest->params.hostIpv4Addr[1], |
| 7897 | pRequest->params.hostIpv4Addr[2], |
| 7898 | pRequest->params.hostIpv4Addr[3]); |
| 7899 | } |
| 7900 | break; |
| 7901 | |
| 7902 | case WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7903 | hdd_debug("Host offload request: neighbor discovery"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7904 | switch (pRequest->enableOrDisable) { |
| 7905 | case WLAN_OFFLOAD_DISABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7906 | hdd_debug(" disable"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7907 | break; |
| 7908 | case WLAN_OFFLOAD_ENABLE: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 7909 | hdd_debug(" enable"); |
| 7910 | hdd_debug(" IP address: %x:%x:%x:%x:%x:%x:%x:%x", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7911 | *(uint16_t *) (pRequest->params.hostIpv6Addr), |
| 7912 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7913 | 2), |
| 7914 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7915 | 4), |
| 7916 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7917 | 6), |
| 7918 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7919 | 8), |
| 7920 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7921 | 10), |
| 7922 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7923 | 12), |
| 7924 | *(uint16_t *) (pRequest->params.hostIpv6Addr + |
| 7925 | 14)); |
| 7926 | } |
| 7927 | } |
| 7928 | |
Hanumanth Reddy Pothula | 8fcade5 | 2017-12-01 13:49:40 +0530 | [diff] [blame] | 7929 | qdf_mem_zero(&offloadRequest, sizeof(offloadRequest)); |
| 7930 | offloadRequest.offloadType = pRequest->offloadType; |
| 7931 | offloadRequest.enableOrDisable = pRequest->enableOrDisable; |
| 7932 | qdf_mem_copy(&offloadRequest.params, &pRequest->params, |
| 7933 | sizeof(pRequest->params)); |
| 7934 | qdf_mem_copy(&offloadRequest.bssid, &pRequest->bssId.bytes, |
| 7935 | QDF_MAC_ADDR_SIZE); |
| 7936 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 7937 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 7938 | sme_set_host_offload(hdd_ctx->mac_handle, |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 7939 | adapter->session_id, &offloadRequest)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 7940 | hdd_err("Failure to execute host offload request"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7941 | return -EINVAL; |
| 7942 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 7943 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7944 | return 0; |
| 7945 | } |
| 7946 | |
| 7947 | static int iw_set_host_offload(struct net_device *dev, |
| 7948 | struct iw_request_info *info, |
| 7949 | union iwreq_data *wrqu, char *extra) |
| 7950 | { |
| 7951 | int ret; |
| 7952 | |
| 7953 | cds_ssr_protect(__func__); |
| 7954 | ret = __iw_set_host_offload(dev, info, wrqu, extra); |
| 7955 | cds_ssr_unprotect(__func__); |
| 7956 | |
| 7957 | return ret; |
| 7958 | } |
| 7959 | |
| 7960 | /** |
| 7961 | * iw_set_keepalive_params - Set keepalive params ioctl handler |
| 7962 | * @dev: device upon which the ioctl was received |
| 7963 | * @info: ioctl request information |
| 7964 | * @wrqu: ioctl request data |
| 7965 | * @extra: ioctl extra data |
| 7966 | * |
| 7967 | * Return: 0 on success, non-zero on error |
| 7968 | */ |
| 7969 | static int __iw_set_keepalive_params(struct net_device *dev, |
| 7970 | struct iw_request_info *info, |
| 7971 | union iwreq_data *wrqu, char *extra) |
| 7972 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7973 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 7974 | tpSirKeepAliveReq request = (tpSirKeepAliveReq) extra; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 7975 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7976 | int ret; |
| 7977 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 7978 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 7979 | |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 7980 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7981 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 7982 | if (0 != ret) |
| 7983 | return ret; |
| 7984 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 7985 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 7986 | if (0 != ret) |
| 7987 | return ret; |
| 7988 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 7989 | if (wrqu->data.length != sizeof(*request)) { |
| 7990 | hdd_err("Invalid length %d", wrqu->data.length); |
| 7991 | return -EINVAL; |
| 7992 | } |
| 7993 | |
| 7994 | if (request->timePeriod > WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX) { |
| 7995 | hdd_err("Value of timePeriod %d exceed Max limit %d", |
| 7996 | request->timePeriod, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 7997 | WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX); |
| 7998 | return -EINVAL; |
| 7999 | } |
| 8000 | |
| 8001 | /* Debug display of request components. */ |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8002 | hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8003 | request->timePeriod, sizeof(tSirKeepAliveReq)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8004 | |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8005 | switch (request->packetType) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8006 | case WLAN_KEEP_ALIVE_NULL_PKT: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8007 | hdd_debug("Keep Alive Request: Tx NULL"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8008 | break; |
| 8009 | |
| 8010 | case WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8011 | hdd_debug("Keep Alive Request: Tx UnSolicited ARP RSP"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8012 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8013 | hdd_debug("Host IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8014 | request->hostIpv4Addr[0], request->hostIpv4Addr[1], |
| 8015 | request->hostIpv4Addr[2], request->hostIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8016 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8017 | hdd_debug("Dest IP address: %d.%d.%d.%d", |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8018 | request->destIpv4Addr[0], request->destIpv4Addr[1], |
| 8019 | request->destIpv4Addr[2], request->destIpv4Addr[3]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8020 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8021 | hdd_debug("Dest MAC address: "MAC_ADDRESS_STR, |
Srinivas Girigowda | 9c330a9 | 2015-11-24 12:28:25 -0800 | [diff] [blame] | 8022 | MAC_ADDR_ARRAY(request->dest_macaddr.bytes)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8023 | break; |
| 8024 | } |
| 8025 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8026 | hdd_debug("Keep alive period %d", request->timePeriod); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8027 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 8028 | if (QDF_STATUS_SUCCESS != |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8029 | sme_set_keep_alive(hdd_ctx->mac_handle, |
| 8030 | adapter->session_id, request)) { |
Rajeev Kumar | 3ddf1c6 | 2015-11-03 14:10:13 -0800 | [diff] [blame] | 8031 | hdd_err("Failure to execute Keep Alive"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8032 | return -EINVAL; |
| 8033 | } |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8034 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8035 | return 0; |
| 8036 | } |
| 8037 | |
| 8038 | static int iw_set_keepalive_params(struct net_device *dev, |
| 8039 | struct iw_request_info *info, |
| 8040 | union iwreq_data *wrqu, |
| 8041 | char *extra) |
| 8042 | { |
| 8043 | int ret; |
| 8044 | |
| 8045 | cds_ssr_protect(__func__); |
| 8046 | ret = __iw_set_keepalive_params(dev, info, wrqu, extra); |
| 8047 | cds_ssr_unprotect(__func__); |
| 8048 | |
| 8049 | return ret; |
| 8050 | } |
| 8051 | |
| 8052 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 8053 | /** |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8054 | * validate_packet_filter_params_size() - Validate the size of the params rcvd |
| 8055 | * @priv_data: Pointer to the priv data from user space |
| 8056 | * @request: Pointer to the struct containing the copied data from user space |
| 8057 | * |
| 8058 | * Return: False on invalid length, true otherwise |
| 8059 | */ |
| 8060 | static bool validate_packet_filter_params_size(struct pkt_filter_cfg *request, |
| 8061 | uint16_t length) |
| 8062 | { |
| 8063 | int max_params_size, rcvd_params_size; |
| 8064 | |
| 8065 | max_params_size = HDD_MAX_CMP_PER_PACKET_FILTER * |
| 8066 | sizeof(struct pkt_filter_param_cfg); |
| 8067 | |
| 8068 | if (length < sizeof(struct pkt_filter_cfg) - max_params_size) { |
| 8069 | hdd_err("Less than minimum number of arguments needed"); |
| 8070 | return false; |
| 8071 | } |
| 8072 | |
| 8073 | rcvd_params_size = request->num_params * |
| 8074 | sizeof(struct pkt_filter_param_cfg); |
| 8075 | |
| 8076 | if (length != sizeof(struct pkt_filter_cfg) - |
| 8077 | max_params_size + rcvd_params_size) { |
| 8078 | hdd_err("Arguments do not match the number of params provided"); |
| 8079 | return false; |
| 8080 | } |
| 8081 | |
| 8082 | return true; |
| 8083 | } |
| 8084 | |
| 8085 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8086 | * __iw_set_packet_filter_params() - set packet filter parameters in target |
| 8087 | * @dev: Pointer to netdev |
| 8088 | * @info: Pointer to iw request info |
| 8089 | * @wrqu: Pointer to data |
| 8090 | * @extra: Pointer to extra data |
| 8091 | * |
| 8092 | * Return: 0 on success, non-zero on error |
| 8093 | */ |
| 8094 | static int __iw_set_packet_filter_params(struct net_device *dev, |
| 8095 | struct iw_request_info *info, |
| 8096 | union iwreq_data *wrqu, char *extra) |
| 8097 | { |
| 8098 | int ret; |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8099 | struct hdd_context *hdd_ctx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8100 | struct iw_point priv_data; |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8101 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8102 | struct pkt_filter_cfg *request = NULL; |
| 8103 | |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8104 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8105 | hdd_err("permission check failed"); |
Mukul Sharma | 472382f | 2015-11-02 20:16:31 +0530 | [diff] [blame] | 8106 | return -EPERM; |
| 8107 | } |
| 8108 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8109 | hdd_enter_dev(dev); |
Hanumantha Reddy Pothula | 2db50ed | 2015-11-23 10:48:33 +0530 | [diff] [blame] | 8110 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8111 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8112 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8113 | if (0 != ret) |
| 8114 | return ret; |
| 8115 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8116 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8117 | if (0 != ret) |
| 8118 | return ret; |
| 8119 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8120 | if (hdd_priv_get_data(&priv_data, wrqu)) { |
| 8121 | hdd_err("failed to get priv data"); |
| 8122 | return -EINVAL; |
| 8123 | } |
| 8124 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8125 | if ((NULL == priv_data.pointer) || (0 == priv_data.length)) { |
Jeff Johnson | 36e74c4 | 2017-09-18 08:15:42 -0700 | [diff] [blame] | 8126 | hdd_err("invalid priv data %pK or invalid priv data length %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8127 | priv_data.pointer, priv_data.length); |
| 8128 | return -EINVAL; |
| 8129 | } |
| 8130 | |
Arun Khandavalli | 75d246b | 2017-08-07 19:46:06 +0530 | [diff] [blame] | 8131 | if (adapter->device_mode != QDF_STA_MODE) { |
| 8132 | hdd_err("Packet filter not supported for this mode :%d", |
| 8133 | adapter->device_mode); |
| 8134 | return -ENOTSUPP; |
| 8135 | } |
| 8136 | |
Mukul Sharma | be846bb | 2017-05-09 17:41:52 +0530 | [diff] [blame] | 8137 | if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { |
| 8138 | hdd_err("Packet filter not supported in disconnected state"); |
| 8139 | return -ENOTSUPP; |
| 8140 | } |
| 8141 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8142 | /* copy data using copy_from_user */ |
| 8143 | request = mem_alloc_copy_from_user_helper(priv_data.pointer, |
| 8144 | priv_data.length); |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8145 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8146 | if (NULL == request) { |
| 8147 | hdd_err("mem_alloc_copy_from_user_helper fail"); |
| 8148 | return -ENOMEM; |
| 8149 | } |
| 8150 | |
Sourav Mohapatra | 69d0780 | 2018-05-31 17:09:05 +0530 | [diff] [blame] | 8151 | if (!validate_packet_filter_params_size(request, priv_data.length)) { |
| 8152 | hdd_err("Invalid priv data length %d", priv_data.length); |
| 8153 | qdf_mem_free(request); |
| 8154 | return -EINVAL; |
| 8155 | } |
| 8156 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 8157 | if (request->filter_action == HDD_RCV_FILTER_SET) |
| 8158 | hdd_ctx->user_configured_pkt_filter_rules |= |
| 8159 | 1 << request->filter_id; |
| 8160 | else if (request->filter_action == HDD_RCV_FILTER_CLEAR) |
| 8161 | hdd_ctx->user_configured_pkt_filter_rules &= |
| 8162 | ~(1 << request->filter_id); |
| 8163 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8164 | ret = wlan_hdd_set_filter(hdd_ctx, request, adapter->session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8165 | |
Mahesh Kumar Kalikot Veetil | 9c65618 | 2016-11-02 10:28:03 -0700 | [diff] [blame] | 8166 | qdf_mem_free(request); |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8167 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8168 | return ret; |
| 8169 | } |
| 8170 | |
| 8171 | /** |
| 8172 | * iw_set_packet_filter_params() - set packet filter parameters in target |
| 8173 | * @dev: Pointer to netdev |
| 8174 | * @info: Pointer to iw request info |
| 8175 | * @wrqu: Pointer to data |
| 8176 | * @extra: Pointer to extra data |
| 8177 | * |
| 8178 | * Return: 0 on success, non-zero on error |
| 8179 | */ |
| 8180 | static int iw_set_packet_filter_params(struct net_device *dev, |
| 8181 | struct iw_request_info *info, |
| 8182 | union iwreq_data *wrqu, char *extra) |
| 8183 | { |
| 8184 | int ret; |
| 8185 | |
| 8186 | cds_ssr_protect(__func__); |
| 8187 | ret = __iw_set_packet_filter_params(dev, info, wrqu, extra); |
| 8188 | cds_ssr_unprotect(__func__); |
| 8189 | |
| 8190 | return ret; |
| 8191 | } |
| 8192 | #endif |
| 8193 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8194 | #ifdef QCA_SUPPORT_CP_STATS |
| 8195 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
| 8196 | { |
| 8197 | return wlan_hdd_get_station_stats(adapter); |
| 8198 | } |
| 8199 | #else /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8200 | struct hdd_statistics_priv { |
| 8201 | tCsrSummaryStatsInfo summary_stats; |
| 8202 | tCsrGlobalClassAStatsInfo class_a_stats; |
| 8203 | tCsrGlobalClassDStatsInfo class_d_stats; |
| 8204 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8205 | |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8206 | /** |
| 8207 | * hdd_statistics_cb() - "Get statistics" callback function |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8208 | * @stats: statistics payload |
| 8209 | * @context: opaque context originally passed to SME. HDD always passes |
| 8210 | * a cookie for the request context |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8211 | * |
| 8212 | * Return: None |
| 8213 | */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8214 | static void hdd_statistics_cb(void *stats, void *context) |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8215 | { |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8216 | struct osif_request *request; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8217 | struct hdd_statistics_priv *priv; |
| 8218 | tCsrSummaryStatsInfo *summary_stats; |
| 8219 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8220 | tCsrGlobalClassDStatsInfo *class_d_stats; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8221 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8222 | request = osif_request_get(context); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8223 | if (!request) { |
| 8224 | hdd_err("Obsolete request"); |
| 8225 | return; |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8226 | } |
| 8227 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8228 | priv = osif_request_priv(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8229 | |
| 8230 | summary_stats = (tCsrSummaryStatsInfo *)stats; |
| 8231 | priv->summary_stats = *summary_stats; |
| 8232 | |
| 8233 | class_a_stats = (tCsrGlobalClassAStatsInfo *)(summary_stats + 1); |
| 8234 | priv->class_a_stats = *class_a_stats; |
| 8235 | |
| 8236 | class_d_stats = (tCsrGlobalClassDStatsInfo *)(class_a_stats + 1); |
| 8237 | priv->class_d_stats = *class_d_stats; |
| 8238 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8239 | osif_request_complete(request); |
| 8240 | osif_request_put(request); |
Jeff Johnson | d37833f | 2018-03-07 14:22:44 -0800 | [diff] [blame] | 8241 | } |
| 8242 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8243 | static int hdd_get_wlan_stats(struct hdd_adapter *adapter) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8244 | { |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8245 | int ret = 0; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8246 | void *cookie; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8247 | QDF_STATUS status; |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8248 | struct osif_request *request; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8249 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8250 | struct hdd_statistics_priv *priv; |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8251 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8252 | static const struct osif_request_params params = { |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8253 | .priv_size = sizeof(*priv), |
| 8254 | .timeout_ms = WLAN_WAIT_TIME_STATS, |
| 8255 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8256 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8257 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8258 | request = osif_request_alloc(¶ms); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8259 | if (!request) { |
| 8260 | hdd_warn("request allocation failed"); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8261 | return -EINVAL; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8262 | } |
| 8263 | |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8264 | cookie = osif_request_cookie(request); |
Jeff Johnson | cec6e92 | 2018-06-12 16:17:27 -0700 | [diff] [blame] | 8265 | status = sme_get_statistics(hdd_ctx->mac_handle, eCSR_HDD, |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8266 | SME_SUMMARY_STATS | |
| 8267 | SME_GLOBAL_CLASSA_STATS | |
| 8268 | SME_GLOBAL_CLASSD_STATS, |
| 8269 | hdd_statistics_cb, |
| 8270 | sta_ctx->conn_info.staId[0], |
| 8271 | cookie, adapter->session_id); |
| 8272 | |
| 8273 | if (QDF_STATUS_SUCCESS != status) { |
| 8274 | hdd_warn("Unable to retrieve SME statistics"); |
| 8275 | goto put_request; |
| 8276 | } |
| 8277 | |
| 8278 | /* request was sent -- wait for the response */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8279 | ret = osif_request_wait_for_response(request); |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8280 | if (ret) { |
| 8281 | hdd_err("Failed to wait for statistics, errno %d", ret); |
| 8282 | goto put_request; |
| 8283 | } |
| 8284 | |
| 8285 | /* update the adapter cache with the fresh results */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8286 | priv = osif_request_priv(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8287 | adapter->hdd_stats.summary_stat = priv->summary_stats; |
| 8288 | adapter->hdd_stats.class_a_stat = priv->class_a_stats; |
| 8289 | adapter->hdd_stats.class_d_stat = priv->class_d_stats; |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8290 | |
| 8291 | put_request: |
| 8292 | /* |
| 8293 | * either we never sent a request, we sent a request and |
| 8294 | * received a response or we sent a request and timed out. |
| 8295 | * regardless we are done with the request. |
| 8296 | */ |
Jeff Johnson | f1a99ea | 2018-06-28 13:27:01 -0700 | [diff] [blame] | 8297 | osif_request_put(request); |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8298 | return ret; |
| 8299 | } |
| 8300 | #endif /* QCA_SUPPORT_CP_STATS */ |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8301 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 8302 | static int __iw_get_statistics(struct net_device *dev, |
| 8303 | struct iw_request_info *info, |
| 8304 | union iwreq_data *wrqu, char *extra) |
| 8305 | { |
| 8306 | int ret; |
| 8307 | char *p; |
| 8308 | int tlen; |
| 8309 | struct hdd_station_ctx *sta_ctx; |
| 8310 | tCsrSummaryStatsInfo *summary_stats; |
| 8311 | tCsrGlobalClassAStatsInfo *class_a_stats; |
| 8312 | tCsrGlobalClassDStatsInfo *class_d_stats; |
| 8313 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
| 8314 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8315 | |
| 8316 | hdd_enter_dev(dev); |
| 8317 | |
| 8318 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8319 | if (0 != ret) |
| 8320 | return ret; |
| 8321 | |
| 8322 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8323 | if (0 != ret) |
| 8324 | return ret; |
| 8325 | |
| 8326 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
| 8327 | if (eConnectionState_Associated != sta_ctx->conn_info.connState) { |
| 8328 | wrqu->data.length = 0; |
| 8329 | return 0; |
| 8330 | } |
| 8331 | |
| 8332 | hdd_get_wlan_stats(adapter); |
| 8333 | |
| 8334 | summary_stats = &(adapter->hdd_stats.summary_stat); |
| 8335 | class_a_stats = &(adapter->hdd_stats.class_a_stat); |
| 8336 | class_d_stats = &(adapter->hdd_stats.class_d_stat); |
| 8337 | |
Jeff Johnson | ced658b | 2018-03-08 09:54:01 -0800 | [diff] [blame] | 8338 | p = extra; |
| 8339 | tlen = 0; |
| 8340 | |
| 8341 | FILL_TLV(p, WLAN_STATS_RETRY_CNT, |
| 8342 | sizeof(summary_stats->retry_cnt), |
| 8343 | &(summary_stats->retry_cnt[0]), tlen); |
| 8344 | |
| 8345 | FILL_TLV(p, WLAN_STATS_MUL_RETRY_CNT, |
| 8346 | sizeof(summary_stats->multiple_retry_cnt), |
| 8347 | &(summary_stats->multiple_retry_cnt[0]), tlen); |
| 8348 | |
| 8349 | FILL_TLV(p, WLAN_STATS_TX_FRM_CNT, |
| 8350 | sizeof(summary_stats->tx_frm_cnt), |
| 8351 | &(summary_stats->tx_frm_cnt[0]), tlen); |
| 8352 | |
| 8353 | FILL_TLV(p, WLAN_STATS_RX_FRM_CNT, |
| 8354 | sizeof(summary_stats->rx_frm_cnt), |
| 8355 | &(summary_stats->rx_frm_cnt), tlen); |
| 8356 | |
| 8357 | FILL_TLV(p, WLAN_STATS_FRM_DUP_CNT, |
| 8358 | sizeof(summary_stats->frm_dup_cnt), |
| 8359 | &(summary_stats->frm_dup_cnt), tlen); |
| 8360 | |
| 8361 | FILL_TLV(p, WLAN_STATS_FAIL_CNT, |
| 8362 | sizeof(summary_stats->fail_cnt), |
| 8363 | &(summary_stats->fail_cnt[0]), tlen); |
| 8364 | |
| 8365 | FILL_TLV(p, WLAN_STATS_RTS_FAIL_CNT, |
| 8366 | sizeof(summary_stats->rts_fail_cnt), |
| 8367 | &(summary_stats->rts_fail_cnt), tlen); |
| 8368 | |
| 8369 | FILL_TLV(p, WLAN_STATS_ACK_FAIL_CNT, |
| 8370 | sizeof(summary_stats->ack_fail_cnt), |
| 8371 | &(summary_stats->ack_fail_cnt), tlen); |
| 8372 | |
| 8373 | FILL_TLV(p, WLAN_STATS_RTS_SUC_CNT, |
| 8374 | sizeof(summary_stats->rts_succ_cnt), |
| 8375 | &(summary_stats->rts_succ_cnt), tlen); |
| 8376 | |
| 8377 | FILL_TLV(p, WLAN_STATS_RX_DISCARD_CNT, |
| 8378 | sizeof(summary_stats->rx_discard_cnt), |
| 8379 | &(summary_stats->rx_discard_cnt), tlen); |
| 8380 | |
| 8381 | FILL_TLV(p, WLAN_STATS_RX_ERROR_CNT, |
| 8382 | sizeof(summary_stats->rx_error_cnt), |
| 8383 | &(summary_stats->rx_error_cnt), tlen); |
| 8384 | |
| 8385 | FILL_TLV(p, WLAN_STATS_TX_BYTE_CNT, |
| 8386 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8387 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8388 | |
| 8389 | FILL_TLV(p, WLAN_STATS_RX_BYTE_CNT, |
| 8390 | sizeof(class_d_stats->rx_byte_cnt), |
| 8391 | &(class_d_stats->rx_byte_cnt), tlen); |
| 8392 | |
| 8393 | FILL_TLV(p, WLAN_STATS_RX_RATE, |
| 8394 | sizeof(class_d_stats->rx_rate), |
| 8395 | &(class_d_stats->rx_rate), tlen); |
| 8396 | |
| 8397 | /* Transmit rate, in units of 500 kbit/sec */ |
| 8398 | FILL_TLV(p, WLAN_STATS_TX_RATE, |
| 8399 | sizeof(class_a_stats->tx_rate), |
| 8400 | &(class_a_stats->tx_rate), tlen); |
| 8401 | |
| 8402 | FILL_TLV(p, WLAN_STATS_RX_UC_BYTE_CNT, |
| 8403 | sizeof(class_d_stats->rx_uc_byte_cnt[0]), |
| 8404 | &(class_d_stats->rx_uc_byte_cnt[0]), tlen); |
| 8405 | FILL_TLV(p, WLAN_STATS_RX_MC_BYTE_CNT, |
| 8406 | sizeof(class_d_stats->rx_mc_byte_cnt), |
| 8407 | &(class_d_stats->rx_mc_byte_cnt), tlen); |
| 8408 | FILL_TLV(p, WLAN_STATS_RX_BC_BYTE_CNT, |
| 8409 | sizeof(class_d_stats->rx_bc_byte_cnt), |
| 8410 | &(class_d_stats->rx_bc_byte_cnt), tlen); |
| 8411 | FILL_TLV(p, WLAN_STATS_TX_UC_BYTE_CNT, |
| 8412 | sizeof(class_d_stats->tx_uc_byte_cnt[0]), |
| 8413 | &(class_d_stats->tx_uc_byte_cnt[0]), tlen); |
| 8414 | FILL_TLV(p, WLAN_STATS_TX_MC_BYTE_CNT, |
| 8415 | sizeof(class_d_stats->tx_mc_byte_cnt), |
| 8416 | &(class_d_stats->tx_mc_byte_cnt), tlen); |
| 8417 | FILL_TLV(p, WLAN_STATS_TX_BC_BYTE_CNT, |
| 8418 | sizeof(class_d_stats->tx_bc_byte_cnt), |
| 8419 | &(class_d_stats->tx_bc_byte_cnt), tlen); |
| 8420 | |
| 8421 | wrqu->data.length = tlen; |
| 8422 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 8423 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8424 | |
| 8425 | return 0; |
| 8426 | } |
| 8427 | |
| 8428 | static int iw_get_statistics(struct net_device *dev, |
| 8429 | struct iw_request_info *info, |
| 8430 | union iwreq_data *wrqu, char *extra) |
| 8431 | { |
| 8432 | int ret; |
| 8433 | |
| 8434 | cds_ssr_protect(__func__); |
| 8435 | ret = __iw_get_statistics(dev, info, wrqu, extra); |
| 8436 | cds_ssr_unprotect(__func__); |
| 8437 | |
| 8438 | return ret; |
| 8439 | } |
| 8440 | |
| 8441 | #ifdef FEATURE_WLAN_SCAN_PNO |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8442 | /*Max Len for PNO notification*/ |
| 8443 | #define MAX_PNO_NOTIFY_LEN 100 |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8444 | static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev, |
| 8445 | struct scan_event *event, void *args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8446 | { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8447 | struct vdev_osif_priv *osif_priv; |
| 8448 | struct wireless_dev *wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8449 | union iwreq_data wrqu; |
| 8450 | char buf[MAX_PNO_NOTIFY_LEN + 1]; |
| 8451 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8452 | wlan_vdev_obj_lock(vdev); |
| 8453 | osif_priv = wlan_vdev_get_ospriv(vdev); |
| 8454 | wlan_vdev_obj_unlock(vdev); |
| 8455 | if (!osif_priv) { |
| 8456 | hdd_err("osif_priv is null"); |
| 8457 | return; |
| 8458 | } |
| 8459 | |
| 8460 | wdev = osif_priv->wdev; |
| 8461 | if (!wdev) { |
| 8462 | hdd_err("wdev is null"); |
| 8463 | return; |
| 8464 | } |
| 8465 | |
| 8466 | hdd_debug("A preferred network was found"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8467 | |
| 8468 | /* create the event */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8469 | qdf_mem_zero(&wrqu, sizeof(wrqu)); |
| 8470 | qdf_mem_zero(buf, sizeof(buf)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8471 | |
| 8472 | snprintf(buf, MAX_PNO_NOTIFY_LEN, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8473 | "QCOM: Found preferred network:"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8474 | |
| 8475 | wrqu.data.pointer = buf; |
| 8476 | wrqu.data.length = strlen(buf); |
| 8477 | |
| 8478 | /* send the event */ |
| 8479 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8480 | wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8481 | } |
| 8482 | |
| 8483 | /** |
| 8484 | * __iw_set_pno() - Preferred Network Offload ioctl handler |
| 8485 | * @dev: device upon which the ioctl was received |
| 8486 | * @info: ioctl request information |
| 8487 | * @wrqu: ioctl request data |
| 8488 | * @extra: ioctl extra data |
| 8489 | * |
| 8490 | * This function parses a Preferred Network Offload command |
| 8491 | * Input is string based and expected to be of the form: |
| 8492 | * |
| 8493 | * <enable(1) | disable(0)> |
| 8494 | * when enabling: |
| 8495 | * <number of networks> |
| 8496 | * for each network: |
| 8497 | * <ssid_len> <ssid> <authentication> <encryption> |
| 8498 | * <ch_num> <channel_list optional> <bcast_type> <rssi_threshold> |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8499 | * <scan_time (seconds)> |
| 8500 | * <scan_repeat_count (0 means indefinite)> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8501 | * <suspend mode> |
| 8502 | * |
| 8503 | * e.g: |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8504 | * 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] | 8505 | * |
| 8506 | * this translates into: |
| 8507 | * ----------------------------- |
| 8508 | * enable PNO |
| 8509 | * 2 networks |
| 8510 | * Network 1: |
| 8511 | * test - with authentication type 0 and encryption type 0, |
| 8512 | * search on 3 channels: 1 6 and 11, |
| 8513 | * SSID bcast type is unknown (directed probe will be sent if |
| 8514 | * AP not found) and must meet -40dBm RSSI |
| 8515 | * Network 2: |
| 8516 | * test2 - with authentication type 4 and encryption type 4, |
| 8517 | * search on 6 channels 1, 2, 3, 4, 5 and 6 |
| 8518 | * bcast type is non-bcast (directed probe will be sent) |
| 8519 | * and must not meet any RSSI threshold |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8520 | * scan every 5 seconds 2 times |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8521 | * enable on suspend |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8522 | */ |
| 8523 | static int __iw_set_pno(struct net_device *dev, |
| 8524 | struct iw_request_info *info, |
| 8525 | union iwreq_data *wrqu, char *extra) |
| 8526 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8527 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8528 | struct hdd_context *hdd_ctx; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8529 | uint8_t value; |
| 8530 | struct wlan_objmgr_vdev *vdev; |
| 8531 | struct wlan_objmgr_psoc *psoc; |
| 8532 | int ret = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8533 | int offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8534 | char *ptr, *data; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8535 | uint8_t i, j, params; |
| 8536 | QDF_STATUS status; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8537 | size_t len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8538 | |
| 8539 | /* request is a large struct, so we make it static to avoid |
| 8540 | * stack overflow. This API is only invoked via ioctl, so it |
| 8541 | * is serialized by the kernel rtnl_lock and hence does not |
| 8542 | * need to be reentrant |
| 8543 | */ |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8544 | static struct pno_scan_req_params req; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8545 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8546 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8547 | |
| 8548 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8549 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8550 | if (ret) |
| 8551 | return ret; |
| 8552 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8553 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8554 | if (0 != ret) |
| 8555 | return ret; |
| 8556 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8557 | vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(hdd_ctx->hdd_pdev, |
| 8558 | dev->dev_addr, WLAN_LEGACY_MAC_ID); |
| 8559 | if (!vdev) { |
| 8560 | hdd_err("vdev object is NULL"); |
| 8561 | return -EIO; |
| 8562 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8563 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8564 | /* making sure argument string ends with '\0' */ |
| 8565 | len = (wrqu->data.length + 1); |
| 8566 | data = qdf_mem_malloc(len); |
| 8567 | if (!data) { |
| 8568 | hdd_err("fail to allocate memory %zu", len); |
| 8569 | return -EINVAL; |
| 8570 | } |
| 8571 | qdf_mem_copy(data, extra, (len-1)); |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8572 | ptr = data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8573 | |
Hanumanth Reddy Pothula | 3048c93 | 2018-05-15 12:43:39 +0530 | [diff] [blame] | 8574 | hdd_debug("PNO data len %d data %s", wrqu->data.length, data); |
| 8575 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8576 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8577 | hdd_err("PNO enable input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8578 | ret = -EINVAL; |
| 8579 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8580 | } |
| 8581 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8582 | if (!value) { |
| 8583 | status = ucfg_scan_pno_stop(vdev); |
| 8584 | if (QDF_IS_STATUS_ERROR(status)) { |
| 8585 | hdd_err("Failed to disabled PNO"); |
| 8586 | ret = -EINVAL; |
| 8587 | } else { |
| 8588 | hdd_debug("PNO scan disabled"); |
| 8589 | } |
| 8590 | goto exit; |
| 8591 | } |
| 8592 | |
| 8593 | if (ucfg_scan_get_pno_in_progress(vdev)) { |
| 8594 | hdd_debug("pno is already in progress"); |
| 8595 | ret = -EBUSY; |
| 8596 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8597 | } |
| 8598 | |
| 8599 | ptr += offset; |
| 8600 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8601 | if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8602 | hdd_err("PNO count input not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8603 | ret = -EINVAL; |
| 8604 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8605 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8606 | req.networks_cnt = value; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8607 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8608 | hdd_debug("PNO enable networks count %d offset %d", |
| 8609 | req.networks_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8610 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8611 | if ((0 == req.networks_cnt) || |
| 8612 | (req.networks_cnt > SCAN_PNO_MAX_SUPP_NETWORKS)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8613 | hdd_err("Network count %d invalid", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8614 | req.networks_cnt); |
| 8615 | ret = -EINVAL; |
| 8616 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8617 | } |
| 8618 | |
| 8619 | ptr += offset; |
| 8620 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8621 | for (i = 0; i < req.networks_cnt; i++) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8622 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8623 | req.networks_list[i].ssid.length = 0; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8624 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8625 | params = sscanf(ptr, " %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8626 | &(req.networks_list[i].ssid.length), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8627 | &offset); |
| 8628 | |
| 8629 | if (1 != params) { |
| 8630 | hdd_err("PNO ssid length input is not valid %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8631 | ret = -EINVAL; |
| 8632 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8633 | } |
| 8634 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8635 | if ((0 == req.networks_list[i].ssid.length) || |
| 8636 | (req.networks_list[i].ssid.length > 32)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8637 | hdd_err("SSID Len %d is not correct for network %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8638 | req.networks_list[i].ssid.length, i); |
| 8639 | ret = -EINVAL; |
| 8640 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8641 | } |
| 8642 | |
| 8643 | /* Advance to SSID */ |
| 8644 | ptr += offset; |
| 8645 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8646 | memcpy(req.networks_list[i].ssid.ssid, ptr, |
| 8647 | req.networks_list[i].ssid.length); |
| 8648 | ptr += req.networks_list[i].ssid.length; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8649 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8650 | params = sscanf(ptr, " %u %u %hhu %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8651 | &(req.networks_list[i].authentication), |
| 8652 | &(req.networks_list[i].encryption), |
| 8653 | &(req.networks_list[i].channel_cnt), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8654 | &offset); |
| 8655 | |
| 8656 | if (3 != params) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8657 | hdd_err("Incorrect cmd %s", ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8658 | ret = -EINVAL; |
| 8659 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8660 | } |
| 8661 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8662 | 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] | 8663 | req.networks_list[i].ssid.length, |
| 8664 | req.networks_list[i].ssid.length, |
| 8665 | req.networks_list[i].ssid.ssid, |
| 8666 | req.networks_list[i].authentication, |
| 8667 | req.networks_list[i].encryption, |
| 8668 | req.networks_list[i].channel_cnt, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8669 | |
| 8670 | /* Advance to channel list */ |
| 8671 | ptr += offset; |
| 8672 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8673 | if (SCAN_PNO_MAX_NETW_CHANNELS_EX < |
| 8674 | req.networks_list[i].channel_cnt) { |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8675 | hdd_err("Incorrect number of channels"); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8676 | ret = -EINVAL; |
| 8677 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8678 | } |
| 8679 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8680 | if (0 != req.networks_list[i].channel_cnt) { |
| 8681 | for (j = 0; j < req.networks_list[i].channel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8682 | j++) { |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8683 | if (1 != sscanf(ptr, " %hhu %n", &value, |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8684 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8685 | hdd_err("PNO network channel is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8686 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8687 | ret = -EINVAL; |
| 8688 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8689 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8690 | if (!IS_CHANNEL_VALID(value)) { |
| 8691 | hdd_err("invalid channel: %hhu", value); |
| 8692 | ret = -EINVAL; |
| 8693 | goto exit; |
| 8694 | } |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8695 | req.networks_list[i].channels[j] = |
| 8696 | cds_chan_to_freq(value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8697 | /* Advance to next channel number */ |
| 8698 | ptr += offset; |
| 8699 | } |
| 8700 | } |
| 8701 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8702 | if (1 != sscanf(ptr, " %u %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8703 | &(req.networks_list[i].bc_new_type), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8704 | &offset)) { |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 8705 | hdd_err("PNO broadcast network type is not valid %s", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8706 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8707 | ret = -EINVAL; |
| 8708 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8709 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8710 | if (req.networks_list[i].bc_new_type > 2) { |
| 8711 | hdd_err("invalid bcast nw type: %u", |
| 8712 | req.networks_list[i].bc_new_type); |
| 8713 | ret = -EINVAL; |
| 8714 | goto exit; |
| 8715 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8716 | |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8717 | hdd_debug("PNO bcastNetwType %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8718 | req.networks_list[i].bc_new_type, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8719 | |
| 8720 | /* Advance to rssi Threshold */ |
| 8721 | ptr += offset; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8722 | if (1 != sscanf(ptr, " %d %n", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8723 | &(req.networks_list[i].rssi_thresh), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8724 | &offset)) { |
| 8725 | hdd_err("PNO rssi threshold input is not valid %s", |
| 8726 | ptr); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8727 | ret = -EINVAL; |
| 8728 | goto exit; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8729 | } |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8730 | hdd_debug("PNO rssi %d offset %d", |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8731 | req.networks_list[i].rssi_thresh, offset); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8732 | /* Advance to next network */ |
| 8733 | ptr += offset; |
| 8734 | } /* For ucNetworkCount */ |
| 8735 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8736 | req.fast_scan_period = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8737 | if (sscanf(ptr, " %u %n", &(req.fast_scan_period), &offset) > 0) { |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8738 | req.fast_scan_period *= MSEC_PER_SEC; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8739 | ptr += offset; |
| 8740 | } |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8741 | if (req.fast_scan_period == 0) { |
| 8742 | hdd_err("invalid fast scan period %u", |
| 8743 | req.fast_scan_period); |
| 8744 | ret = -EINVAL; |
| 8745 | goto exit; |
| 8746 | } |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8747 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8748 | req.fast_scan_max_cycles = 0; |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8749 | if (sscanf(ptr, " %hhu %n", &value, |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8750 | &offset) > 0) |
| 8751 | ptr += offset; |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8752 | req.fast_scan_max_cycles = value; |
Dustin Brown | 43e8729 | 2016-10-10 10:38:25 -0700 | [diff] [blame] | 8753 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8754 | wlan_pdev_obj_lock(hdd_ctx->hdd_pdev); |
| 8755 | psoc = wlan_pdev_get_psoc(hdd_ctx->hdd_pdev); |
| 8756 | wlan_pdev_obj_unlock(hdd_ctx->hdd_pdev); |
| 8757 | ucfg_scan_register_pno_cb(psoc, |
| 8758 | found_pref_network_cb, NULL); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8759 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8760 | ucfg_scan_get_pno_def_params(vdev, &req); |
| 8761 | status = ucfg_scan_pno_start(vdev, &req); |
| 8762 | if (QDF_IS_STATUS_ERROR(status)) { |
| 8763 | hdd_err("Failed to enable PNO"); |
| 8764 | ret = -EINVAL; |
| 8765 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8766 | |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8767 | exit: |
| 8768 | wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8769 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 8770 | qdf_mem_free(data); |
Abhishek Singh | 0481d66 | 2017-04-11 18:20:11 +0530 | [diff] [blame] | 8771 | return ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8772 | } |
| 8773 | |
| 8774 | static int iw_set_pno(struct net_device *dev, |
| 8775 | struct iw_request_info *info, |
| 8776 | union iwreq_data *wrqu, char *extra) |
| 8777 | { |
| 8778 | int ret; |
| 8779 | |
| 8780 | cds_ssr_protect(__func__); |
| 8781 | ret = __iw_set_pno(dev, info, wrqu, extra); |
| 8782 | cds_ssr_unprotect(__func__); |
| 8783 | |
| 8784 | return ret; |
| 8785 | } |
| 8786 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 8787 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8788 | static int __iw_set_band_config(struct net_device *dev, |
| 8789 | struct iw_request_info *info, |
| 8790 | union iwreq_data *wrqu, char *extra) |
| 8791 | { |
Jeff Johnson | 3d278b0 | 2017-08-29 14:17:47 -0700 | [diff] [blame] | 8792 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Jeff Johnson | 6d38ab8 | 2017-08-28 11:36:27 -0700 | [diff] [blame] | 8793 | struct hdd_context *hdd_ctx; |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8794 | int ret; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8795 | int *value = (int *)extra; |
| 8796 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8797 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8798 | |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 8799 | if (!capable(CAP_NET_ADMIN)) { |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8800 | hdd_err("permission check failed"); |
Mukul Sharma | a5fe198 | 2015-11-02 19:28:14 +0530 | [diff] [blame] | 8801 | return -EPERM; |
| 8802 | } |
| 8803 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8804 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8805 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8806 | if (0 != ret) |
| 8807 | return ret; |
| 8808 | |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 8809 | return hdd_reg_set_band(dev, value[0]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8810 | } |
| 8811 | |
| 8812 | static int iw_set_band_config(struct net_device *dev, |
| 8813 | struct iw_request_info *info, |
| 8814 | union iwreq_data *wrqu, char *extra) |
| 8815 | { |
| 8816 | int ret; |
| 8817 | |
| 8818 | cds_ssr_protect(__func__); |
| 8819 | ret = __iw_set_band_config(dev, info, wrqu, extra); |
| 8820 | cds_ssr_unprotect(__func__); |
| 8821 | |
| 8822 | return ret; |
| 8823 | } |
| 8824 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8825 | static int printk_adapter(void *priv, const char *fmt, ...) |
| 8826 | { |
| 8827 | int ret; |
| 8828 | va_list args; |
| 8829 | |
| 8830 | va_start(args, fmt); |
| 8831 | ret = vprintk(fmt, args); |
| 8832 | ret += printk("\n"); |
| 8833 | va_end(args); |
| 8834 | |
| 8835 | return ret; |
| 8836 | } |
| 8837 | |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8838 | static void hdd_ioctl_log_buffer(int log_id, uint32_t count) |
| 8839 | { |
| 8840 | qdf_abstract_print *print = &printk_adapter; |
| 8841 | |
| 8842 | switch (log_id) { |
| 8843 | case HTC_CREDIT_HISTORY_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8844 | cds_print_htc_credit_history(count, print, NULL); |
| 8845 | break; |
| 8846 | case COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8847 | wma_print_wmi_cmd_log(count, print, NULL); |
| 8848 | break; |
| 8849 | case COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8850 | wma_print_wmi_cmd_tx_cmp_log(count, print, NULL); |
| 8851 | break; |
| 8852 | case MGMT_COMMAND_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8853 | wma_print_wmi_mgmt_cmd_log(count, print, NULL); |
| 8854 | break; |
| 8855 | case MGMT_COMMAND_TX_CMP_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8856 | wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL); |
| 8857 | break; |
| 8858 | case EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8859 | wma_print_wmi_event_log(count, print, NULL); |
| 8860 | break; |
| 8861 | case RX_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8862 | wma_print_wmi_rx_event_log(count, print, NULL); |
| 8863 | break; |
| 8864 | case MGMT_EVENT_LOG: |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8865 | wma_print_wmi_mgmt_event_log(count, print, NULL); |
| 8866 | break; |
| 8867 | default: |
| 8868 | print(NULL, "Invalid Log Id %d", log_id); |
| 8869 | break; |
| 8870 | } |
| 8871 | } |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8872 | |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 8873 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
| 8874 | int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2) |
| 8875 | { |
| 8876 | struct hdd_context *hdd_ctx; |
| 8877 | int ret; |
| 8878 | |
| 8879 | hdd_debug("WE_SET_FW_CRASH_INJECT: %d %d", |
| 8880 | v1, v2); |
| 8881 | pr_err("SSR is triggered by iwpriv CRASH_INJECT: %d %d\n", |
| 8882 | v1, v2); |
| 8883 | hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
| 8884 | if (!hdd_ctx->config->crash_inject_enabled) { |
| 8885 | hdd_err("Crash Inject ini disabled, Ignore Crash Inject"); |
| 8886 | return 0; |
| 8887 | } |
| 8888 | if (v1 == 3) { |
| 8889 | cds_trigger_recovery(QDF_REASON_UNSPECIFIED); |
| 8890 | return 0; |
| 8891 | } |
| 8892 | ret = wma_cli_set2_command(adapter->session_id, |
| 8893 | GEN_PARAM_CRASH_INJECT, |
| 8894 | v1, v2, GEN_CMD); |
| 8895 | return ret; |
| 8896 | } |
| 8897 | #endif |
| 8898 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 8899 | #ifdef CONFIG_DP_TRACE |
| 8900 | void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) |
| 8901 | { |
| 8902 | hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d", |
| 8903 | cmd_type, count); |
| 8904 | if (cmd_type == DUMP_DP_TRACE) |
| 8905 | qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID); |
| 8906 | else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE) |
| 8907 | qdf_dp_trace_enable_live_mode(); |
| 8908 | else if (cmd_type == CLEAR_DP_TRACE_BUFFER) |
| 8909 | qdf_dp_trace_clear_buffer(); |
| 8910 | else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE) |
| 8911 | qdf_dp_trace_disable_live_mode(); |
| 8912 | } |
| 8913 | #endif |
| 8914 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8915 | static int __iw_set_two_ints_getnone(struct net_device *dev, |
| 8916 | struct iw_request_info *info, |
| 8917 | union iwreq_data *wrqu, char *extra) |
| 8918 | { |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8919 | struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8920 | int *value = (int *)extra; |
| 8921 | int sub_cmd = value[0]; |
| 8922 | int ret; |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8923 | struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8924 | |
Dustin Brown | fdf17c1 | 2018-03-14 12:55:34 -0700 | [diff] [blame] | 8925 | hdd_enter_dev(dev); |
Jeff Johnson | 6ee91ee | 2016-02-11 18:55:30 -0800 | [diff] [blame] | 8926 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8927 | ret = wlan_hdd_validate_context(hdd_ctx); |
| 8928 | if (0 != ret) |
| 8929 | return ret; |
| 8930 | |
Jeff Johnson | 441e1f7 | 2017-02-07 08:50:49 -0800 | [diff] [blame] | 8931 | ret = hdd_check_private_wext_control(hdd_ctx, info); |
| 8932 | if (0 != ret) |
| 8933 | return ret; |
| 8934 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8935 | switch (sub_cmd) { |
| 8936 | case WE_SET_SMPS_PARAM: |
Srinivas Girigowda | af2bfa4 | 2017-03-06 18:45:13 -0800 | [diff] [blame] | 8937 | 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] | 8938 | ret = wma_cli_set_command(adapter->session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8939 | WMI_STA_SMPS_PARAM_CMDID, |
| 8940 | value[1] << WMA_SMPS_PARAM_VALUE_S |
| 8941 | | value[2], |
| 8942 | VDEV_CMD); |
| 8943 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8944 | case WE_SET_FW_CRASH_INJECT: |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 8945 | ret = hdd_crash_inject(adapter, value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8946 | break; |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8947 | case WE_ENABLE_FW_PROFILE: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8948 | hdd_err("WE_ENABLE_FW_PROFILE: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8949 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8950 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8951 | WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, |
| 8952 | value[1], value[2], DBG_CMD); |
| 8953 | break; |
| 8954 | case WE_SET_FW_PROFILE_HIST_INTVL: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8955 | hdd_err("WE_SET_FW_PROFILE_HIST_INTVL: %d %d", |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8956 | value[1], value[2]); |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 8957 | ret = wma_cli_set2_command(adapter->session_id, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 8958 | WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID, |
| 8959 | value[1], value[2], DBG_CMD); |
| 8960 | break; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8961 | case WE_SET_DUAL_MAC_FW_MODE_CONFIG: |
| 8962 | hdd_debug("Ioctl to set dual fw mode config"); |
Tushnim Bhattacharyya | 49ed8ab | 2017-05-26 18:20:10 -0700 | [diff] [blame] | 8963 | if (hdd_ctx->config->dual_mac_feature_disable == |
| 8964 | DISABLE_DBS_CXN_AND_SCAN) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8965 | hdd_err("Dual mac feature is disabled from INI"); |
| 8966 | return -EPERM; |
| 8967 | } |
| 8968 | hdd_debug("%d %d", value[1], value[2]); |
Tushnim Bhattacharyya | de1070d | 2017-03-09 13:23:55 -0800 | [diff] [blame] | 8969 | policy_mgr_set_dual_mac_fw_mode_config(hdd_ctx->hdd_psoc, |
| 8970 | value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8971 | break; |
| 8972 | case WE_DUMP_DP_TRACE_LEVEL: |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 8973 | hdd_set_dump_dp_trace(value[1], value[2]); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8974 | break; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 8975 | case WE_SET_MON_MODE_CHAN: |
Jeff Johnson | f23a89b | 2017-10-02 13:20:38 -0700 | [diff] [blame] | 8976 | ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 8977 | break; |
Rajeev Kumar | 15b40a2 | 2018-04-12 11:45:24 -0700 | [diff] [blame] | 8978 | case WE_SET_WLAN_SUSPEND: |
Dustin Brown | 5409643 | 2017-02-23 13:00:44 -0800 | [diff] [blame] | 8979 | ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, |
| 8980 | value[1], value[2]); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 8981 | break; |
| 8982 | case WE_SET_WLAN_RESUME: |
Dustin Brown | bc81a47 | 2016-10-26 16:56:59 -0700 | [diff] [blame] | 8983 | ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 8984 | break; |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 8985 | case WE_LOG_BUFFER: { |
| 8986 | int log_id = value[1]; |
| 8987 | uint32_t count = value[2] < 0 ? 0 : value[2]; |
| 8988 | |
| 8989 | hdd_ioctl_log_buffer(log_id, count); |
| 8990 | |
| 8991 | break; |
| 8992 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8993 | default: |
Jeff Johnson | 99bac31 | 2016-06-28 10:38:18 -0700 | [diff] [blame] | 8994 | hdd_err("Invalid IOCTL command %d", sub_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 8995 | break; |
| 8996 | } |
| 8997 | |
| 8998 | return ret; |
| 8999 | } |
| 9000 | |
| 9001 | static int iw_set_two_ints_getnone(struct net_device *dev, |
| 9002 | struct iw_request_info *info, |
| 9003 | union iwreq_data *wrqu, char *extra) |
| 9004 | { |
| 9005 | int ret; |
| 9006 | |
| 9007 | cds_ssr_protect(__func__); |
| 9008 | ret = __iw_set_two_ints_getnone(dev, info, wrqu, extra); |
| 9009 | cds_ssr_unprotect(__func__); |
| 9010 | |
| 9011 | return ret; |
| 9012 | } |
| 9013 | |
| 9014 | /* Define the Wireless Extensions to the Linux Network Device structure */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9015 | |
| 9016 | static const iw_handler we_private[] = { |
| 9017 | |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9018 | [WLAN_PRIV_SET_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_setint_getnone, |
| 9019 | [WLAN_PRIV_SET_NONE_GET_INT - SIOCIWFIRSTPRIV] = iw_setnone_getint, |
| 9020 | [WLAN_PRIV_SET_CHAR_GET_NONE - SIOCIWFIRSTPRIV] = iw_setchar_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9021 | [WLAN_PRIV_SET_THREE_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9022 | iw_set_three_ints_getnone, |
| 9023 | [WLAN_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] = iw_get_char_setnone, |
Srinivas Girigowda | fba82a0 | 2017-03-24 21:26:35 -0700 | [diff] [blame] | 9024 | [WLAN_PRIV_SET_NONE_GET_NONE - SIOCIWFIRSTPRIV] = iw_setnone_getnone, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9025 | [WLAN_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9026 | iw_hdd_set_var_ints_getnone, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9027 | [WLAN_PRIV_SET_NONE_GET_THREE_INT - SIOCIWFIRSTPRIV] = |
| 9028 | iw_setnone_get_threeint, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9029 | #ifdef WLAN_FEATURE_FIPS |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 9030 | [WLAN_PRIV_FIPS_TEST - SIOCIWFIRSTPRIV] = hdd_fips_test, |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 9031 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9032 | [WLAN_PRIV_ADD_TSPEC - SIOCIWFIRSTPRIV] = iw_add_tspec, |
| 9033 | [WLAN_PRIV_DEL_TSPEC - SIOCIWFIRSTPRIV] = iw_del_tspec, |
| 9034 | [WLAN_PRIV_GET_TSPEC - SIOCIWFIRSTPRIV] = iw_get_tspec, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9035 | [WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9036 | [WLAN_PRIV_SET_HOST_OFFLOAD - SIOCIWFIRSTPRIV] = iw_set_host_offload, |
| 9037 | [WLAN_GET_WLAN_STATISTICS - SIOCIWFIRSTPRIV] = iw_get_statistics, |
| 9038 | [WLAN_SET_KEEPALIVE_PARAMS - SIOCIWFIRSTPRIV] = |
| 9039 | iw_set_keepalive_params, |
| 9040 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 9041 | [WLAN_SET_PACKET_FILTER_PARAMS - SIOCIWFIRSTPRIV] = |
| 9042 | iw_set_packet_filter_params, |
| 9043 | #endif |
| 9044 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9045 | [WLAN_SET_PNO - SIOCIWFIRSTPRIV] = iw_set_pno, |
| 9046 | #endif |
| 9047 | [WLAN_SET_BAND_CONFIG - SIOCIWFIRSTPRIV] = iw_set_band_config, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 9048 | [WLAN_PRIV_SET_MCBC_FILTER - SIOCIWFIRSTPRIV] = |
| 9049 | iw_set_dynamic_mcbc_filter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9050 | [WLAN_GET_LINK_SPEED - SIOCIWFIRSTPRIV] = iw_get_linkspeed, |
| 9051 | [WLAN_PRIV_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = |
| 9052 | iw_set_two_ints_getnone, |
| 9053 | [WLAN_SET_DOT11P_CHANNEL_SCHED - SIOCIWFIRSTPRIV] = |
| 9054 | iw_set_dot11p_channel_sched, |
| 9055 | }; |
| 9056 | |
| 9057 | /*Maximum command length can be only 15 */ |
| 9058 | static const struct iw_priv_args we_private_args[] = { |
| 9059 | |
| 9060 | /* handlers for main ioctl */ |
| 9061 | {WLAN_PRIV_SET_INT_GET_NONE, |
| 9062 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9063 | 0, |
| 9064 | ""}, |
| 9065 | |
| 9066 | /* handlers for sub-ioctl */ |
| 9067 | {WE_SET_11D_STATE, |
| 9068 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9069 | 0, |
| 9070 | "set11Dstate"}, |
| 9071 | |
| 9072 | {WE_WOWL, |
| 9073 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9074 | 0, |
| 9075 | "wowl"}, |
| 9076 | |
| 9077 | {WE_SET_POWER, |
| 9078 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9079 | 0, |
| 9080 | "setPower"}, |
| 9081 | |
| 9082 | {WE_SET_MAX_ASSOC, |
| 9083 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9084 | 0, |
| 9085 | "setMaxAssoc"}, |
| 9086 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9087 | {WE_SET_SCAN_DISABLE, |
| 9088 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9089 | 0, |
| 9090 | "scan_disable"}, |
| 9091 | |
| 9092 | {WE_SET_DATA_INACTIVITY_TO, |
| 9093 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9094 | 0, |
| 9095 | "inactivityTO"}, |
| 9096 | |
Mukul Sharma | ed92f2f | 2017-04-20 00:06:28 +0530 | [diff] [blame] | 9097 | {WE_SET_WOW_DATA_INACTIVITY_TO, |
| 9098 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9099 | 0, |
| 9100 | "wow_ito"}, |
| 9101 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9102 | {WE_SET_MAX_TX_POWER, |
| 9103 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9104 | 0, |
| 9105 | "setMaxTxPower"}, |
| 9106 | |
| 9107 | {WE_SET_TX_POWER, |
| 9108 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9109 | 0, |
| 9110 | "setTxPower"}, |
| 9111 | |
| 9112 | {WE_SET_MC_RATE, |
| 9113 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9114 | 0, |
| 9115 | "setMcRate"}, |
| 9116 | |
| 9117 | {WE_SET_MAX_TX_POWER_2_4, |
| 9118 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9119 | 0, |
| 9120 | "setTxMaxPower2G"}, |
| 9121 | |
| 9122 | {WE_SET_MAX_TX_POWER_5_0, |
| 9123 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9124 | 0, |
| 9125 | "setTxMaxPower5G"}, |
| 9126 | |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9127 | #ifndef REMOVE_PKT_LOG |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9128 | {WE_SET_PKTLOG, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 9129 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9130 | 0, |
| 9131 | "pktlog"}, |
Nirav Shah | bb8e47c | 2018-05-17 16:56:41 +0530 | [diff] [blame] | 9132 | #endif |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 9133 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9134 | /* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA |
| 9135 | * as well to keep same syntax as in SAP. Now onwards, STA |
Jeff Johnson | 3bb7c73 | 2017-01-12 08:40:17 -0800 | [diff] [blame] | 9136 | * will support both |
| 9137 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9138 | {WE_SET_MAX_TX_POWER, |
| 9139 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9140 | 0, |
| 9141 | "setTxMaxPower"}, |
| 9142 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9143 | {WE_SET_TM_LEVEL, |
| 9144 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9145 | 0, |
| 9146 | "setTmLevel"}, |
| 9147 | |
| 9148 | {WE_SET_PHYMODE, |
| 9149 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9150 | 0, |
| 9151 | "setphymode"}, |
| 9152 | |
| 9153 | {WE_SET_NSS, |
| 9154 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9155 | 0, |
| 9156 | "nss"}, |
| 9157 | |
| 9158 | {WE_SET_LDPC, |
| 9159 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9160 | 0, |
| 9161 | "ldpc"}, |
| 9162 | |
| 9163 | {WE_SET_TX_STBC, |
| 9164 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9165 | 0, |
| 9166 | "tx_stbc"}, |
| 9167 | |
| 9168 | {WE_SET_RX_STBC, |
| 9169 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9170 | 0, |
| 9171 | "rx_stbc"}, |
| 9172 | |
| 9173 | {WE_SET_SHORT_GI, |
| 9174 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9175 | 0, |
| 9176 | "shortgi"}, |
| 9177 | |
| 9178 | {WE_SET_RTSCTS, |
| 9179 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9180 | 0, |
| 9181 | "enablertscts"}, |
| 9182 | |
| 9183 | {WE_SET_CHWIDTH, |
| 9184 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9185 | 0, |
| 9186 | "chwidth"}, |
| 9187 | |
| 9188 | {WE_SET_ANI_EN_DIS, |
| 9189 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9190 | 0, |
| 9191 | "anienable"}, |
| 9192 | |
| 9193 | {WE_SET_ANI_POLL_PERIOD, |
| 9194 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9195 | 0, |
| 9196 | "aniplen"}, |
| 9197 | |
| 9198 | {WE_SET_ANI_LISTEN_PERIOD, |
| 9199 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9200 | 0, |
| 9201 | "anilislen"}, |
| 9202 | |
| 9203 | {WE_SET_ANI_OFDM_LEVEL, |
| 9204 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9205 | 0, |
| 9206 | "aniofdmlvl"}, |
| 9207 | |
| 9208 | {WE_SET_ANI_CCK_LEVEL, |
| 9209 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9210 | 0, |
| 9211 | "aniccklvl"}, |
| 9212 | |
| 9213 | {WE_SET_DYNAMIC_BW, |
| 9214 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9215 | 0, |
| 9216 | "cwmenable"}, |
| 9217 | |
| 9218 | {WE_SET_CTS_CBW, |
| 9219 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9220 | 0, |
| 9221 | "cts_cbw" }, |
| 9222 | |
| 9223 | {WE_SET_GTX_HT_MCS, |
| 9224 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9225 | 0, |
| 9226 | "gtxHTMcs"}, |
| 9227 | |
| 9228 | {WE_SET_GTX_VHT_MCS, |
| 9229 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9230 | 0, |
| 9231 | "gtxVHTMcs"}, |
| 9232 | |
| 9233 | {WE_SET_GTX_USRCFG, |
| 9234 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9235 | 0, |
| 9236 | "gtxUsrCfg"}, |
| 9237 | |
| 9238 | {WE_SET_GTX_THRE, |
| 9239 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9240 | 0, |
| 9241 | "gtxThre"}, |
| 9242 | |
| 9243 | {WE_SET_GTX_MARGIN, |
| 9244 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9245 | 0, |
| 9246 | "gtxMargin"}, |
| 9247 | |
| 9248 | {WE_SET_GTX_STEP, |
| 9249 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9250 | 0, |
| 9251 | "gtxStep"}, |
| 9252 | |
| 9253 | {WE_SET_GTX_MINTPC, |
| 9254 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9255 | 0, |
| 9256 | "gtxMinTpc"}, |
| 9257 | |
| 9258 | {WE_SET_GTX_BWMASK, |
| 9259 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9260 | 0, |
| 9261 | "gtxBWMask"}, |
| 9262 | |
| 9263 | {WE_SET_TX_CHAINMASK, |
| 9264 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9265 | 0, |
| 9266 | "txchainmask"}, |
| 9267 | |
| 9268 | {WE_SET_RX_CHAINMASK, |
| 9269 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9270 | 0, |
| 9271 | "rxchainmask"}, |
| 9272 | |
| 9273 | {WE_SET_11N_RATE, |
| 9274 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9275 | 0, |
| 9276 | "set11NRates"}, |
| 9277 | |
| 9278 | {WE_SET_VHT_RATE, |
| 9279 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9280 | 0, |
| 9281 | "set11ACRates"}, |
| 9282 | |
| 9283 | {WE_SET_AMPDU, |
| 9284 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9285 | 0, |
| 9286 | "ampdu"}, |
| 9287 | |
| 9288 | {WE_SET_AMSDU, |
| 9289 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9290 | 0, |
| 9291 | "amsdu"}, |
| 9292 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9293 | {WE_SET_TXPOW_2G, |
| 9294 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9295 | 0, |
| 9296 | "txpow2g"}, |
| 9297 | |
| 9298 | {WE_SET_TXPOW_5G, |
| 9299 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9300 | 0, |
| 9301 | "txpow5g"}, |
| 9302 | |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9303 | #ifdef FEATURE_FW_LOG_PARSING |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9304 | /* Sub-cmds DBGLOG specific commands */ |
| 9305 | {WE_DBGLOG_LOG_LEVEL, |
| 9306 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9307 | 0, |
| 9308 | "dl_loglevel"}, |
| 9309 | |
| 9310 | {WE_DBGLOG_VAP_ENABLE, |
| 9311 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9312 | 0, |
| 9313 | "dl_vapon"}, |
| 9314 | |
| 9315 | {WE_DBGLOG_VAP_DISABLE, |
| 9316 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9317 | 0, |
| 9318 | "dl_vapoff"}, |
| 9319 | |
| 9320 | {WE_DBGLOG_MODULE_ENABLE, |
| 9321 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9322 | 0, |
| 9323 | "dl_modon"}, |
| 9324 | |
| 9325 | {WE_DBGLOG_MODULE_DISABLE, |
| 9326 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9327 | 0, |
| 9328 | "dl_modoff"}, |
| 9329 | |
| 9330 | {WE_DBGLOG_MOD_LOG_LEVEL, |
| 9331 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9332 | 0, |
| 9333 | "dl_mod_loglevel"}, |
| 9334 | |
| 9335 | {WE_DBGLOG_TYPE, |
| 9336 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9337 | 0, |
| 9338 | "dl_type"}, |
| 9339 | {WE_DBGLOG_REPORT_ENABLE, |
| 9340 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9341 | 0, |
| 9342 | "dl_report"}, |
Wen Gong | 9976890 | 2018-04-25 12:07:49 +0800 | [diff] [blame] | 9343 | #endif /* FEATURE_FW_LOG_PARSING */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9344 | |
| 9345 | {WE_SET_TXRX_FWSTATS, |
| 9346 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9347 | 0, |
| 9348 | "txrx_fw_stats"}, |
| 9349 | |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9350 | {WE_SET_TXRX_STATS, |
chenguo | aa7c90c | 2018-05-24 17:08:47 +0800 | [diff] [blame] | 9351 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
Venkata Sharath Chandra Manchala | 8398563 | 2017-02-28 14:16:22 -0800 | [diff] [blame] | 9352 | 0, |
| 9353 | "txrx_stats"}, |
| 9354 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9355 | {WE_TXRX_FWSTATS_RESET, |
| 9356 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9357 | 0, |
| 9358 | "txrx_fw_st_rst"}, |
| 9359 | |
| 9360 | {WE_PPS_PAID_MATCH, |
| 9361 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9362 | 0, "paid_match"}, |
| 9363 | |
| 9364 | {WE_PPS_GID_MATCH, |
| 9365 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9366 | 0, "gid_match"}, |
| 9367 | |
| 9368 | {WE_PPS_EARLY_TIM_CLEAR, |
| 9369 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9370 | 0, "tim_clear"}, |
| 9371 | |
| 9372 | {WE_PPS_EARLY_DTIM_CLEAR, |
| 9373 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9374 | 0, "dtim_clear"}, |
| 9375 | |
| 9376 | {WE_PPS_EOF_PAD_DELIM, |
| 9377 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9378 | 0, "eof_delim"}, |
| 9379 | |
| 9380 | {WE_PPS_MACADDR_MISMATCH, |
| 9381 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9382 | 0, "mac_match"}, |
| 9383 | |
| 9384 | {WE_PPS_DELIM_CRC_FAIL, |
| 9385 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9386 | 0, "delim_fail"}, |
| 9387 | |
| 9388 | {WE_PPS_GID_NSTS_ZERO, |
| 9389 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9390 | 0, "nsts_zero"}, |
| 9391 | |
| 9392 | {WE_PPS_RSSI_CHECK, |
| 9393 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9394 | 0, "rssi_chk"}, |
| 9395 | |
| 9396 | {WE_PPS_5G_EBT, |
| 9397 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9398 | 0, "5g_ebt"}, |
| 9399 | |
| 9400 | {WE_SET_HTSMPS, |
| 9401 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9402 | 0, "htsmps"}, |
| 9403 | |
| 9404 | {WE_SET_QPOWER_MAX_PSPOLL_COUNT, |
| 9405 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9406 | 0, "set_qpspollcnt"}, |
| 9407 | |
| 9408 | {WE_SET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 9409 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9410 | 0, "set_qtxwake"}, |
| 9411 | |
| 9412 | {WE_SET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 9413 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9414 | 0, "set_qwakeintv"}, |
| 9415 | |
| 9416 | {WE_SET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 9417 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9418 | 0, "set_qnodatapoll"}, |
| 9419 | |
| 9420 | /* handlers for MCC time quota and latency sub ioctls */ |
| 9421 | {WE_MCC_CONFIG_LATENCY, |
| 9422 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9423 | 0, "setMccLatency"}, |
| 9424 | |
| 9425 | {WE_MCC_CONFIG_QUOTA, |
| 9426 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9427 | 0, "setMccQuota"}, |
| 9428 | |
| 9429 | {WE_SET_DEBUG_LOG, |
| 9430 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9431 | 0, "setDbgLvl"}, |
| 9432 | |
| 9433 | /* handlers for early_rx power save */ |
| 9434 | {WE_SET_EARLY_RX_ADJUST_ENABLE, |
| 9435 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9436 | 0, "erx_enable"}, |
| 9437 | |
| 9438 | {WE_SET_EARLY_RX_TGT_BMISS_NUM, |
| 9439 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9440 | 0, "erx_bmiss_val"}, |
| 9441 | |
| 9442 | {WE_SET_EARLY_RX_BMISS_SAMPLE_CYCLE, |
| 9443 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9444 | 0, "erx_bmiss_smpl"}, |
| 9445 | |
| 9446 | {WE_SET_EARLY_RX_SLOP_STEP, |
| 9447 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9448 | 0, "erx_slop_step"}, |
| 9449 | |
| 9450 | {WE_SET_EARLY_RX_INIT_SLOP, |
| 9451 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9452 | 0, "erx_init_slop"}, |
| 9453 | |
| 9454 | {WE_SET_EARLY_RX_ADJUST_PAUSE, |
| 9455 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9456 | 0, "erx_adj_pause"}, |
| 9457 | |
| 9458 | {WE_SET_EARLY_RX_DRIFT_SAMPLE, |
| 9459 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9460 | 0, "erx_dri_sample"}, |
| 9461 | |
| 9462 | {WE_DUMP_STATS, |
| 9463 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9464 | 0, "dumpStats"}, |
| 9465 | |
| 9466 | {WE_CLEAR_STATS, |
| 9467 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9468 | 0, "clearStats"}, |
| 9469 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9470 | {WE_START_FW_PROFILE, |
| 9471 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9472 | 0, "startProfile"}, |
| 9473 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 9474 | {WE_SET_CHANNEL, |
| 9475 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9476 | 0, "setChanChange" }, |
| 9477 | |
Manishekar Chandrasekaran | 97e077d | 2016-03-23 17:10:31 +0530 | [diff] [blame] | 9478 | {WE_SET_CONC_SYSTEM_PREF, |
| 9479 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9480 | 0, "setConcSysPref" }, |
| 9481 | |
Jeff Johnson | 011c450 | 2017-10-05 15:25:56 -0700 | [diff] [blame] | 9482 | {WE_SET_PDEV_RESET, |
| 9483 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9484 | 0, "pdev_reset" }, |
| 9485 | |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 9486 | {WE_SET_MODULATED_DTIM, |
Kiran Kumar Lokere | 08195ef | 2018-01-17 19:25:15 -0800 | [diff] [blame] | 9487 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9488 | 0, "setModDTIM" }, |
SaidiReddy Yenuga | a92f8cc | 2017-03-24 15:15:03 +0530 | [diff] [blame] | 9489 | |
Kiran Kumar Lokere | 05e9a65 | 2018-04-10 20:27:38 -0700 | [diff] [blame] | 9490 | {WE_SET_PPDU_DUR, |
| 9491 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9492 | 0, "set_ppdu_dur" }, |
| 9493 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9494 | {WLAN_PRIV_SET_NONE_GET_INT, |
| 9495 | 0, |
| 9496 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9497 | ""}, |
| 9498 | |
| 9499 | /* handlers for sub-ioctl */ |
| 9500 | {WE_GET_11D_STATE, |
| 9501 | 0, |
| 9502 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9503 | "get11Dstate"}, |
| 9504 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9505 | {WE_GET_WLAN_DBG, |
| 9506 | 0, |
| 9507 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9508 | "getwlandbg"}, |
| 9509 | |
| 9510 | {WE_GET_MAX_ASSOC, |
| 9511 | 0, |
| 9512 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9513 | "getMaxAssoc"}, |
| 9514 | |
| 9515 | {WE_GET_SAP_AUTO_CHANNEL_SELECTION, |
| 9516 | 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9517 | "getAutoChannel" }, |
| 9518 | |
| 9519 | {WE_GET_CONCURRENCY_MODE, |
| 9520 | 0, |
| 9521 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9522 | "getconcurrency"}, |
| 9523 | |
| 9524 | {WE_GET_NSS, |
| 9525 | 0, |
| 9526 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9527 | "get_nss"}, |
| 9528 | |
| 9529 | {WE_GET_LDPC, |
| 9530 | 0, |
| 9531 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9532 | "get_ldpc"}, |
| 9533 | |
| 9534 | {WE_GET_TX_STBC, |
| 9535 | 0, |
| 9536 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9537 | "get_tx_stbc"}, |
| 9538 | |
| 9539 | {WE_GET_RX_STBC, |
| 9540 | 0, |
| 9541 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9542 | "get_rx_stbc"}, |
| 9543 | |
| 9544 | {WE_GET_SHORT_GI, |
| 9545 | 0, |
| 9546 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9547 | "get_shortgi"}, |
| 9548 | |
| 9549 | {WE_GET_RTSCTS, |
| 9550 | 0, |
| 9551 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9552 | "get_rtscts"}, |
| 9553 | |
| 9554 | {WE_GET_CHWIDTH, |
| 9555 | 0, |
| 9556 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9557 | "get_chwidth"}, |
| 9558 | |
| 9559 | {WE_GET_ANI_EN_DIS, |
| 9560 | 0, |
| 9561 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9562 | "get_anienable"}, |
| 9563 | |
| 9564 | {WE_GET_ANI_POLL_PERIOD, |
| 9565 | 0, |
| 9566 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9567 | "get_aniplen"}, |
| 9568 | |
| 9569 | {WE_GET_ANI_LISTEN_PERIOD, |
| 9570 | 0, |
| 9571 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9572 | "get_anilislen"}, |
| 9573 | |
| 9574 | {WE_GET_ANI_OFDM_LEVEL, |
| 9575 | 0, |
| 9576 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9577 | "get_aniofdmlvl"}, |
| 9578 | |
| 9579 | {WE_GET_ANI_CCK_LEVEL, |
| 9580 | 0, |
| 9581 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9582 | "get_aniccklvl"}, |
| 9583 | |
| 9584 | {WE_GET_DYNAMIC_BW, |
| 9585 | 0, |
| 9586 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9587 | "get_cwmenable"}, |
| 9588 | |
| 9589 | {WE_GET_GTX_HT_MCS, |
| 9590 | 0, |
| 9591 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9592 | "get_gtxHTMcs"}, |
| 9593 | |
| 9594 | {WE_GET_GTX_VHT_MCS, |
| 9595 | 0, |
| 9596 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9597 | "get_gtxVHTMcs"}, |
| 9598 | |
| 9599 | {WE_GET_GTX_USRCFG, |
| 9600 | 0, |
| 9601 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9602 | "get_gtxUsrCfg"}, |
| 9603 | |
| 9604 | {WE_GET_GTX_THRE, |
| 9605 | 0, |
| 9606 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9607 | "get_gtxThre"}, |
| 9608 | |
| 9609 | {WE_GET_GTX_MARGIN, |
| 9610 | 0, |
| 9611 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9612 | "get_gtxMargin"}, |
| 9613 | |
| 9614 | {WE_GET_GTX_STEP, |
| 9615 | 0, |
| 9616 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9617 | "get_gtxStep"}, |
| 9618 | |
| 9619 | {WE_GET_GTX_MINTPC, |
| 9620 | 0, |
| 9621 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9622 | "get_gtxMinTpc"}, |
| 9623 | |
| 9624 | {WE_GET_GTX_BWMASK, |
| 9625 | 0, |
| 9626 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9627 | "get_gtxBWMask"}, |
| 9628 | |
| 9629 | {WE_GET_TX_CHAINMASK, |
| 9630 | 0, |
| 9631 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9632 | "get_txchainmask"}, |
| 9633 | |
| 9634 | {WE_GET_RX_CHAINMASK, |
| 9635 | 0, |
| 9636 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9637 | "get_rxchainmask"}, |
| 9638 | |
| 9639 | {WE_GET_11N_RATE, |
| 9640 | 0, |
| 9641 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9642 | "get_11nrate"}, |
| 9643 | |
| 9644 | {WE_GET_AMPDU, |
| 9645 | 0, |
| 9646 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9647 | "get_ampdu"}, |
| 9648 | |
| 9649 | {WE_GET_AMSDU, |
| 9650 | 0, |
| 9651 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9652 | "get_amsdu"}, |
| 9653 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9654 | {WE_GET_TXPOW_2G, |
| 9655 | 0, |
| 9656 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9657 | "get_txpow2g"}, |
| 9658 | |
| 9659 | {WE_GET_TXPOW_5G, |
| 9660 | 0, |
| 9661 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9662 | "get_txpow5g"}, |
| 9663 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9664 | {WE_GET_PPS_PAID_MATCH, |
| 9665 | 0, |
| 9666 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9667 | "get_paid_match"}, |
| 9668 | |
| 9669 | {WE_GET_PPS_GID_MATCH, |
| 9670 | 0, |
| 9671 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9672 | "get_gid_match"}, |
| 9673 | |
| 9674 | {WE_GET_PPS_EARLY_TIM_CLEAR, |
| 9675 | 0, |
| 9676 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9677 | "get_tim_clear"}, |
| 9678 | |
| 9679 | {WE_GET_PPS_EARLY_DTIM_CLEAR, |
| 9680 | 0, |
| 9681 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9682 | "get_dtim_clear"}, |
| 9683 | |
| 9684 | {WE_GET_PPS_EOF_PAD_DELIM, |
| 9685 | 0, |
| 9686 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9687 | "get_eof_delim"}, |
| 9688 | |
| 9689 | {WE_GET_PPS_MACADDR_MISMATCH, |
| 9690 | 0, |
| 9691 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9692 | "get_mac_match"}, |
| 9693 | |
| 9694 | {WE_GET_PPS_DELIM_CRC_FAIL, |
| 9695 | 0, |
| 9696 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9697 | "get_delim_fail"}, |
| 9698 | |
| 9699 | {WE_GET_PPS_GID_NSTS_ZERO, |
| 9700 | 0, |
| 9701 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9702 | "get_nsts_zero"}, |
| 9703 | |
| 9704 | {WE_GET_PPS_RSSI_CHECK, |
| 9705 | 0, |
| 9706 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9707 | "get_rssi_chk"}, |
| 9708 | |
| 9709 | {WE_GET_QPOWER_MAX_PSPOLL_COUNT, |
| 9710 | 0, |
| 9711 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9712 | "get_qpspollcnt"}, |
| 9713 | |
| 9714 | {WE_GET_QPOWER_MAX_TX_BEFORE_WAKE, |
| 9715 | 0, |
| 9716 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9717 | "get_qtxwake"}, |
| 9718 | |
| 9719 | {WE_GET_QPOWER_SPEC_PSPOLL_WAKE_INTERVAL, |
| 9720 | 0, |
| 9721 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9722 | "get_qwakeintv"}, |
| 9723 | |
| 9724 | {WE_GET_QPOWER_SPEC_MAX_SPEC_NODATA_PSPOLL, |
| 9725 | 0, |
| 9726 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9727 | "get_qnodatapoll"}, |
| 9728 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9729 | {WE_CAP_TSF, |
| 9730 | 0, |
| 9731 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9732 | "cap_tsf"}, |
| 9733 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9734 | {WE_GET_TEMPERATURE, |
| 9735 | 0, |
| 9736 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9737 | "get_temp"}, |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 9738 | {WE_GET_DCM, |
| 9739 | 0, |
| 9740 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9741 | "get_dcm"}, |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 9742 | {WE_GET_RANGE_EXT, |
| 9743 | 0, |
| 9744 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 9745 | "get_range_ext"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9746 | /* handlers for main ioctl */ |
| 9747 | {WLAN_PRIV_SET_CHAR_GET_NONE, |
| 9748 | IW_PRIV_TYPE_CHAR | 512, |
| 9749 | 0, |
| 9750 | ""}, |
| 9751 | |
| 9752 | /* handlers for sub-ioctl */ |
| 9753 | {WE_WOWL_ADD_PTRN, |
| 9754 | IW_PRIV_TYPE_CHAR | 512, |
| 9755 | 0, |
| 9756 | "wowlAddPtrn"}, |
| 9757 | |
| 9758 | {WE_WOWL_DEL_PTRN, |
| 9759 | IW_PRIV_TYPE_CHAR | 512, |
| 9760 | 0, |
| 9761 | "wowlDelPtrn"}, |
| 9762 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9763 | /* handlers for sub-ioctl */ |
| 9764 | {WE_NEIGHBOR_REPORT_REQUEST, |
| 9765 | IW_PRIV_TYPE_CHAR | 512, |
| 9766 | 0, |
| 9767 | "neighbor"}, |
Deepak Dhamdhere | 641bf32 | 2016-01-06 15:19:03 -0800 | [diff] [blame] | 9768 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9769 | {WE_SET_AP_WPS_IE, |
| 9770 | IW_PRIV_TYPE_CHAR | 512, |
| 9771 | 0, |
| 9772 | "set_ap_wps_ie"}, |
| 9773 | |
| 9774 | {WE_SET_CONFIG, |
| 9775 | IW_PRIV_TYPE_CHAR | 512, |
| 9776 | 0, |
| 9777 | "setConfig"}, |
| 9778 | |
| 9779 | /* handlers for main ioctl */ |
| 9780 | {WLAN_PRIV_SET_THREE_INT_GET_NONE, |
| 9781 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9782 | 0, |
| 9783 | ""}, |
| 9784 | |
| 9785 | /* handlers for sub-ioctl */ |
| 9786 | {WE_SET_WLAN_DBG, |
| 9787 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9788 | 0, |
| 9789 | "setwlandbg"}, |
| 9790 | |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9791 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9792 | /* handlers for sub-ioctl */ |
| 9793 | {WE_SET_DP_TRACE, |
| 9794 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9795 | 0, |
| 9796 | "set_dp_trace"}, |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 9797 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9798 | |
Anurag Chouhan | bf5e0e2 | 2016-09-12 12:54:09 +0530 | [diff] [blame] | 9799 | {WE_SET_FW_TEST, |
| 9800 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9801 | 0, "fw_test"}, |
| 9802 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 9803 | /* handlers for main ioctl */ |
| 9804 | {WLAN_PRIV_SET_NONE_GET_THREE_INT, |
| 9805 | 0, |
| 9806 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9807 | "" }, |
| 9808 | {WE_GET_TSF, |
| 9809 | 0, |
| 9810 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9811 | "get_tsf" }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9812 | |
| 9813 | {WE_SET_DUAL_MAC_SCAN_CONFIG, |
| 9814 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, |
| 9815 | 0, |
| 9816 | "set_scan_cfg"}, |
| 9817 | |
| 9818 | /* handlers for main ioctl */ |
| 9819 | {WLAN_PRIV_GET_CHAR_SET_NONE, |
| 9820 | 0, |
| 9821 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9822 | ""}, |
| 9823 | |
| 9824 | /* handlers for sub-ioctl */ |
| 9825 | {WE_WLAN_VERSION, |
| 9826 | 0, |
| 9827 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9828 | "version"}, |
| 9829 | {WE_GET_STATS, |
| 9830 | 0, |
| 9831 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9832 | "getStats"}, |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 9833 | {WE_GET_SUSPEND_RESUME_STATS, |
| 9834 | 0, |
| 9835 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9836 | "getSuspendStats"}, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9837 | {WE_LIST_FW_PROFILE, |
| 9838 | 0, |
| 9839 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9840 | "listProfile"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9841 | {WE_GET_STATES, |
| 9842 | 0, |
| 9843 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9844 | "getHostStates"}, |
| 9845 | {WE_GET_CFG, |
| 9846 | 0, |
| 9847 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9848 | "getConfig"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9849 | {WE_GET_RSSI, |
| 9850 | 0, |
| 9851 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9852 | "getRSSI"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9853 | {WE_GET_WMM_STATUS, |
| 9854 | 0, |
| 9855 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9856 | "getWmmStatus"}, |
| 9857 | { |
| 9858 | WE_GET_CHANNEL_LIST, |
| 9859 | 0, |
| 9860 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9861 | "getChannelList" |
| 9862 | }, |
| 9863 | #ifdef FEATURE_WLAN_TDLS |
| 9864 | { |
| 9865 | WE_GET_TDLS_PEERS, |
| 9866 | 0, |
| 9867 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9868 | "getTdlsPeers" |
| 9869 | }, |
| 9870 | #endif |
| 9871 | #ifdef WLAN_FEATURE_11W |
| 9872 | { |
| 9873 | WE_GET_11W_INFO, |
| 9874 | 0, |
| 9875 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9876 | "getPMFInfo" |
| 9877 | }, |
| 9878 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9879 | { |
| 9880 | WE_GET_IBSS_STA_INFO, |
| 9881 | 0, |
| 9882 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9883 | "getIbssSTAs" |
| 9884 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9885 | {WE_GET_PHYMODE, |
| 9886 | 0, |
| 9887 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9888 | "getphymode"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 9889 | #if defined(FEATURE_OEM_DATA_SUPPORT) || defined(WIFI_POS_CONVERGED) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9890 | {WE_GET_OEM_DATA_CAP, |
| 9891 | 0, |
| 9892 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9893 | "getOemDataCap"}, |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 9894 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9895 | {WE_GET_SNR, |
| 9896 | 0, |
| 9897 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 9898 | "getSNR"}, |
| 9899 | |
| 9900 | /* handlers for main ioctl */ |
| 9901 | {WLAN_PRIV_SET_NONE_GET_NONE, |
| 9902 | 0, |
| 9903 | 0, |
| 9904 | ""}, |
| 9905 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9906 | /* handlers for sub-ioctl */ |
| 9907 | { |
| 9908 | WE_IBSS_GET_PEER_INFO_ALL, |
| 9909 | 0, |
| 9910 | 0, |
| 9911 | "ibssPeerInfoAll" |
| 9912 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9913 | {WE_GET_RECOVERY_STAT, |
| 9914 | 0, |
| 9915 | 0, |
| 9916 | "getRecoverStat"}, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 9917 | |
| 9918 | {WE_GET_FW_PROFILE_DATA, |
| 9919 | 0, |
| 9920 | 0, |
| 9921 | "getProfileData"}, |
| 9922 | |
| 9923 | {WE_SET_REASSOC_TRIGGER, |
| 9924 | 0, |
| 9925 | 0, |
| 9926 | "reassoc"}, |
| 9927 | |
Sandeep Puligilla | 93a29ec | 2016-02-12 16:10:56 -0800 | [diff] [blame] | 9928 | {WE_STOP_OBSS_SCAN, |
| 9929 | 0, |
| 9930 | 0, |
| 9931 | "stop_obss_scan"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9932 | /* handlers for main ioctl */ |
| 9933 | {WLAN_PRIV_SET_VAR_INT_GET_NONE, |
| 9934 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9935 | 0, |
| 9936 | ""}, |
| 9937 | |
| 9938 | /* handlers for sub-ioctl */ |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9939 | {WE_IBSS_GET_PEER_INFO, |
| 9940 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9941 | 0, |
| 9942 | "ibssPeerInfo"}, |
| 9943 | |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 9944 | #ifdef TRACE_RECORD |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 9945 | /* handlers for sub-ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9946 | {WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD, |
| 9947 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9948 | 0, |
| 9949 | "setdumplog"}, |
| 9950 | |
| 9951 | {WE_MTRACE_DUMP_CMD, |
| 9952 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9953 | 0, |
| 9954 | "dumplog"}, |
Rachit Kankane | 0baf6e7 | 2018-01-19 15:01:50 +0530 | [diff] [blame] | 9955 | #endif |
Krunal Soni | a6e505b | 2017-01-12 12:25:18 -0800 | [diff] [blame] | 9956 | |
| 9957 | {WE_POLICY_MANAGER_CINFO_CMD, |
| 9958 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9959 | 0, |
| 9960 | "pm_cinfo"}, |
| 9961 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9962 | #ifdef MPC_UT_FRAMEWORK |
| 9963 | {WE_POLICY_MANAGER_CLIST_CMD, |
| 9964 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9965 | 0, |
| 9966 | "pm_clist"}, |
| 9967 | |
| 9968 | {WE_POLICY_MANAGER_DLIST_CMD, |
| 9969 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9970 | 0, |
| 9971 | "pm_dlist"}, |
| 9972 | |
| 9973 | {WE_POLICY_MANAGER_DBS_CMD, |
| 9974 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9975 | 0, |
| 9976 | "pm_dbs"}, |
| 9977 | |
| 9978 | {WE_POLICY_MANAGER_PCL_CMD, |
| 9979 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9980 | 0, |
| 9981 | "pm_pcl"}, |
| 9982 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 9983 | {WE_POLICY_MANAGER_ULIST_CMD, |
| 9984 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9985 | 0, |
| 9986 | "pm_ulist"}, |
| 9987 | |
| 9988 | {WE_POLICY_MANAGER_QUERY_ACTION_CMD, |
| 9989 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9990 | 0, |
| 9991 | "pm_query_action"}, |
| 9992 | |
| 9993 | {WE_POLICY_MANAGER_QUERY_ALLOW_CMD, |
| 9994 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 9995 | 0, |
| 9996 | "pm_query_allow"}, |
| 9997 | |
| 9998 | {WE_POLICY_MANAGER_SCENARIO_CMD, |
| 9999 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10000 | 0, |
| 10001 | "pm_run_scenario"}, |
| 10002 | |
| 10003 | {WE_POLICY_SET_HW_MODE_CMD, |
| 10004 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10005 | 0, |
| 10006 | "pm_set_hw_mode"}, |
| 10007 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10008 | { |
| 10009 | WE_UNIT_TEST_CMD, |
| 10010 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10011 | 0, |
| 10012 | "setUnitTestCmd" |
| 10013 | }, |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 10014 | { |
| 10015 | WE_MAC_PWR_DEBUG_CMD, |
| 10016 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10017 | 0, |
| 10018 | "halPwrDebug" |
| 10019 | }, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10020 | |
| 10021 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
| 10022 | {WE_LED_FLASHING_PARAM, |
| 10023 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10024 | 0, |
| 10025 | "gpio_control"}, |
| 10026 | #endif |
Liangwei Dong | 2a7f291 | 2018-02-07 17:08:17 +0800 | [diff] [blame] | 10027 | #ifdef WLAN_DEBUG |
| 10028 | {WE_SET_CHAN_AVOID, |
| 10029 | IW_PRIV_TYPE_INT | MAX_VAR_ARGS, |
| 10030 | 0, |
| 10031 | "ch_avoid"}, |
| 10032 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10033 | /* handlers for main ioctl */ |
Jeff Johnson | 6fa1e01 | 2017-04-05 06:40:53 -0700 | [diff] [blame] | 10034 | {WLAN_PRIV_FIPS_TEST, |
| 10035 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10036 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10037 | "fips_test"}, |
| 10038 | |
| 10039 | /* handlers for main ioctl */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10040 | {WLAN_PRIV_ADD_TSPEC, |
| 10041 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
| 10042 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10043 | "addTspec"}, |
| 10044 | |
| 10045 | /* handlers for main ioctl */ |
| 10046 | {WLAN_PRIV_DEL_TSPEC, |
| 10047 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10048 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10049 | "delTspec"}, |
| 10050 | |
| 10051 | /* handlers for main ioctl */ |
| 10052 | {WLAN_PRIV_GET_TSPEC, |
| 10053 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10054 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10055 | "getTspec"}, |
| 10056 | |
| 10057 | /* handlers for main ioctl - host offload */ |
| 10058 | { |
| 10059 | WLAN_PRIV_SET_HOST_OFFLOAD, |
Srinivas Girigowda | 077143e | 2017-03-25 10:47:27 -0700 | [diff] [blame] | 10060 | IW_PRIV_TYPE_BYTE | sizeof(struct host_offload_req), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10061 | 0, |
| 10062 | "setHostOffload" |
| 10063 | } |
| 10064 | , |
| 10065 | |
| 10066 | { |
| 10067 | WLAN_GET_WLAN_STATISTICS, |
| 10068 | 0, |
| 10069 | IW_PRIV_TYPE_BYTE | WE_MAX_STR_LEN, |
| 10070 | "getWlanStats" |
| 10071 | } |
| 10072 | , |
| 10073 | |
| 10074 | { |
| 10075 | WLAN_SET_KEEPALIVE_PARAMS, |
Mahesh A Saptasagar | 72d2e4b | 2016-04-20 12:44:17 +0530 | [diff] [blame] | 10076 | IW_PRIV_TYPE_BYTE | sizeof(tSirKeepAliveReq) | |
| 10077 | IW_PRIV_SIZE_FIXED, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10078 | 0, |
| 10079 | "setKeepAlive" |
| 10080 | } |
| 10081 | , |
| 10082 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 10083 | { |
| 10084 | WLAN_SET_PACKET_FILTER_PARAMS, |
Hanumanth Reddy Pothula | b3ef416 | 2016-10-25 15:13:26 +0530 | [diff] [blame] | 10085 | IW_PRIV_TYPE_BYTE | |
| 10086 | sizeof(struct pkt_filter_cfg), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10087 | 0, |
| 10088 | "setPktFilter" |
| 10089 | } |
| 10090 | , |
| 10091 | #endif |
| 10092 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 10093 | { |
| 10094 | WLAN_SET_PNO, |
| 10095 | IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, |
| 10096 | 0, |
| 10097 | "setpno" |
| 10098 | } |
| 10099 | , |
| 10100 | #endif |
| 10101 | { |
| 10102 | WLAN_SET_BAND_CONFIG, |
| 10103 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10104 | 0, |
| 10105 | "SETBAND" |
| 10106 | } |
| 10107 | , |
| 10108 | { |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10109 | WLAN_PRIV_SET_MCBC_FILTER, |
Dustin Brown | 860566f | 2017-01-31 15:24:43 -0800 | [diff] [blame] | 10110 | 0, |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10111 | 0, |
| 10112 | "setMCBCFilter" |
| 10113 | } |
| 10114 | , |
Dustin Brown | 0cbc757 | 2016-12-16 13:54:40 -0800 | [diff] [blame] | 10115 | |
| 10116 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10117 | WLAN_GET_LINK_SPEED, |
| 10118 | IW_PRIV_TYPE_CHAR | 18, |
| 10119 | IW_PRIV_TYPE_CHAR | 5, "getLinkSpeed" |
| 10120 | } |
| 10121 | , |
| 10122 | |
| 10123 | /* handlers for main ioctl */ |
| 10124 | {WLAN_PRIV_SET_TWO_INT_GET_NONE, |
| 10125 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10126 | 0, |
| 10127 | ""} |
| 10128 | , |
| 10129 | {WE_SET_SMPS_PARAM, |
| 10130 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10131 | 0, "set_smps_param"} |
| 10132 | , |
| 10133 | {WLAN_SET_DOT11P_CHANNEL_SCHED, |
| 10134 | IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), |
| 10135 | 0, "set_dot11p" } |
| 10136 | , |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10137 | #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10138 | {WE_SET_FW_CRASH_INJECT, |
| 10139 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10140 | 0, "crash_inject"} |
| 10141 | , |
Jeff Johnson | df5d779 | 2018-04-14 15:58:24 -0700 | [diff] [blame] | 10142 | #endif |
Rachit Kankane | b103562 | 2018-01-24 18:41:35 +0530 | [diff] [blame] | 10143 | #if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY) |
Dustin Brown | 8d2d0f5 | 2017-04-03 17:02:08 -0700 | [diff] [blame] | 10144 | {WE_LOG_BUFFER, |
| 10145 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10146 | 0, "log_buffer"} |
| 10147 | , |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10148 | #endif |
Rajeev Kumar | a78a0a4 | 2016-07-13 19:28:20 -0700 | [diff] [blame] | 10149 | #ifdef WLAN_SUSPEND_RESUME_TEST |
| 10150 | {WE_SET_WLAN_SUSPEND, |
| 10151 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10152 | 0, "wlan_suspend"} |
| 10153 | , |
| 10154 | {WE_SET_WLAN_RESUME, |
| 10155 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10156 | 0, "wlan_resume"} |
| 10157 | , |
| 10158 | #endif |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 10159 | {WE_ENABLE_FW_PROFILE, |
| 10160 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10161 | 0, "enableProfile"} |
| 10162 | , |
| 10163 | {WE_SET_FW_PROFILE_HIST_INTVL, |
| 10164 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10165 | 0, "set_hist_intvl"} |
| 10166 | , |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10167 | {WE_SET_DUAL_MAC_FW_MODE_CONFIG, |
| 10168 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10169 | 0, "set_fw_mode_cfg"} |
| 10170 | , |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10171 | #ifdef CONFIG_DP_TRACE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10172 | {WE_DUMP_DP_TRACE_LEVEL, |
| 10173 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10174 | 0, "dump_dp_trace"} |
| 10175 | , |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 10176 | #endif |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10177 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 10178 | {WE_SET_MON_MODE_CHAN, |
| 10179 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, |
| 10180 | 0, "setMonChan"} |
| 10181 | , |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 10182 | #endif |
Varun Reddy Yeturu | 5ab4746 | 2016-05-08 18:08:11 -0700 | [diff] [blame] | 10183 | {WE_GET_ROAM_SYNCH_DELAY, |
| 10184 | 0, |
| 10185 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10186 | "hostroamdelay"} |
| 10187 | , |
Krishna Kumaar Natarajan | 9e5339d | 2016-12-05 14:12:13 -0800 | [diff] [blame] | 10188 | {WE_SET_11AX_RATE, |
| 10189 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10190 | 0, |
| 10191 | "set_11ax_rate"} |
| 10192 | , |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 10193 | {WE_SET_DCM, |
| 10194 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10195 | 0, |
| 10196 | "enable_dcm"} |
| 10197 | , |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10198 | {WE_SET_RANGE_EXT, |
| 10199 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
| 10200 | 0, |
Naveen Rawat | 53448ea | 2017-11-27 11:43:18 -0800 | [diff] [blame] | 10201 | "range_ext"} |
Krishna Kumaar Natarajan | 150cd01 | 2017-03-23 12:29:10 -0700 | [diff] [blame] | 10202 | , |
Naveen Rawat | c921c7b | 2017-06-13 17:29:51 -0700 | [diff] [blame] | 10203 | |
| 10204 | {WLAN_PRIV_SET_FTIES, |
| 10205 | IW_PRIV_TYPE_CHAR | MAX_FTIE_SIZE, |
| 10206 | 0, |
| 10207 | "set_ft_ies"}, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10208 | }; |
| 10209 | |
| 10210 | const struct iw_handler_def we_handler_def = { |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10211 | .num_standard = 0, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 10212 | .num_private = QDF_ARRAY_SIZE(we_private), |
| 10213 | .num_private_args = QDF_ARRAY_SIZE(we_private_args), |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10214 | |
Jeff Johnson | eefd3be | 2018-03-22 06:41:12 -0700 | [diff] [blame] | 10215 | .standard = NULL, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10216 | .private = (iw_handler *) we_private, |
| 10217 | .private_args = we_private_args, |
| 10218 | .get_wireless_stats = NULL, |
| 10219 | }; |
| 10220 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10221 | void hdd_register_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10222 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10223 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10224 | |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 10225 | dev->wireless_handlers = &we_handler_def; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10226 | |
Dustin Brown | e74003f | 2018-03-14 12:51:58 -0700 | [diff] [blame] | 10227 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10228 | } |
| 10229 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10230 | void hdd_unregister_wext(struct net_device *dev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10231 | { |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10232 | hdd_enter_dev(dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10233 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10234 | rtnl_lock(); |
| 10235 | dev->wireless_handlers = NULL; |
| 10236 | rtnl_unlock(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10237 | |
Jeff Johnson | 7f2c591 | 2018-03-23 11:42:28 -0700 | [diff] [blame] | 10238 | hdd_exit(); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 10239 | } |