Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'iwlwifi-next-for-kalle-2021-10-22' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

iwlwifi patches for v5.16

* Support for 160MHz in ranging measurements;
* Some fixes in HE capabilities;
* Fixes in vendor specific capabilities;
* Add the PC of both processors in error dumps;
* Small fix in TDLS;
* Code to sanitize firmware dumps;
* Updates for new FW rate and flags format;
* Continue implementation of new rate and flags format in the FW APIs;
* Some fixes for BZ family initialization;
* Fix session protection in some scenarios;
* Some debugging improvements;
* Fix BT-coex priority;
* Improve PS-poll timeout detection;
* Some other small fixes, clean-ups and improvements.

# gpg: Signature made Fri 22 Oct 2021 11:28:43 AM EEST
# gpg: using RSA key 1772CD7E06F604F5A6EBCB26A1479CA21A3CC5FA
# gpg: Good signature from "Luciano Roth Coelho (Luca) <luca@coelho.fi>" [full]
# gpg: aka "Luciano Roth Coelho (Intel) <luciano.coelho@intel.com>" [full]

+1961 -782
+1 -1
drivers/net/wireless/intel/iwlwifi/Makefile
··· 15 15 iwlwifi-objs += iwl-trans.o 16 16 iwlwifi-objs += queue/tx.o 17 17 18 - iwlwifi-objs += fw/img.o fw/notif-wait.o 18 + iwlwifi-objs += fw/img.o fw/notif-wait.o fw/rs.o 19 19 iwlwifi-objs += fw/dbg.o fw/pnvm.o fw/dump.o 20 20 iwlwifi-$(CONFIG_IWLMVM) += fw/paging.o fw/smem.o fw/init.o 21 21 iwlwifi-$(CONFIG_ACPI) += fw/acpi.o
-5
drivers/net/wireless/intel/iwlwifi/cfg/1000.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2018 - 2020 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/module.h>
-5
drivers/net/wireless/intel/iwlwifi/cfg/2000.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2018 - 2020 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/module.h>
+31
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
··· 53 53 #define IWL_BZ_A_GF_A_FW_PRE "iwlwifi-bz-a0-gf-a0-" 54 54 #define IWL_BZ_A_GF4_A_FW_PRE "iwlwifi-bz-a0-gf4-a0-" 55 55 #define IWL_BZ_A_MR_A_FW_PRE "iwlwifi-bz-a0-mr-a0-" 56 + #define IWL_BZ_A_FM_A_FW_PRE "iwlwifi-bz-a0-fm-a0-" 57 + #define IWL_GL_A_FM_A_FW_PRE "iwlwifi-gl-a0-fm7-a0-" 58 + 56 59 57 60 #define IWL_QU_B_HR_B_MODULE_FIRMWARE(api) \ 58 61 IWL_QU_B_HR_B_FW_PRE __stringify(api) ".ucode" ··· 109 106 IWL_BZ_A_GF4_A_FW_PRE __stringify(api) ".ucode" 110 107 #define IWL_BZ_A_MR_A_MODULE_FIRMWARE(api) \ 111 108 IWL_BZ_A_MR_A_FW_PRE __stringify(api) ".ucode" 109 + #define IWL_BZ_A_FM_A_MODULE_FIRMWARE(api) \ 110 + IWL_BZ_A_FM_A_FW_PRE __stringify(api) ".ucode" 111 + #define IWL_GL_A_FM_A_MODULE_FIRMWARE(api) \ 112 + IWL_GL_A_FM_A_FW_PRE __stringify(api) ".ucode" 112 113 113 114 static const struct iwl_base_params iwl_22000_base_params = { 114 115 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, ··· 476 469 "Killer(R) Wi-Fi 6E AX1675w 160MHz Wireless Network Adapter (210D2W)"; 477 470 const char iwl_ax210_killer_1675x_name[] = 478 471 "Killer(R) Wi-Fi 6E AX1675x 160MHz Wireless Network Adapter (210NGW)"; 472 + const char iwl_ax211_killer_1675s_name[] = 473 + "Killer(R) Wi-Fi 6E AX1675s 160MHz Wireless Network Adapter (211NGW)"; 474 + const char iwl_ax211_killer_1675i_name[] = 475 + "Killer(R) Wi-Fi 6E AX1675i 160MHz Wireless Network Adapter (211NGW)"; 476 + const char iwl_ax411_killer_1690s_name[] = 477 + "Killer(R) Wi-Fi 6E AX1690s 160MHz Wireless Network Adapter (411D2W)"; 478 + const char iwl_ax411_killer_1690i_name[] = 479 + "Killer(R) Wi-Fi 6E AX1690i 160MHz Wireless Network Adapter (411NGW)"; 479 480 480 481 const struct iwl_cfg iwl_qu_b0_hr1_b0 = { 481 482 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, ··· 865 850 .num_rbds = IWL_NUM_RBDS_AX210_HE, 866 851 }; 867 852 853 + const struct iwl_cfg iwl_cfg_bz_a0_fm_a0 = { 854 + .fw_name_pre = IWL_BZ_A_FM_A_FW_PRE, 855 + .uhb_supported = true, 856 + IWL_DEVICE_BZ, 857 + .num_rbds = IWL_NUM_RBDS_AX210_HE, 858 + }; 859 + 860 + const struct iwl_cfg iwl_cfg_gl_a0_fm_a0 = { 861 + .fw_name_pre = IWL_GL_A_FM_A_FW_PRE, 862 + .uhb_supported = true, 863 + IWL_DEVICE_BZ, 864 + .num_rbds = IWL_NUM_RBDS_AX210_HE, 865 + }; 866 + 868 867 MODULE_FIRMWARE(IWL_QU_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 869 868 MODULE_FIRMWARE(IWL_QNJ_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 870 869 MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); ··· 905 876 MODULE_FIRMWARE(IWL_BZ_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 906 877 MODULE_FIRMWARE(IWL_BZ_A_GF4_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 907 878 MODULE_FIRMWARE(IWL_BZ_A_MR_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 879 + MODULE_FIRMWARE(IWL_BZ_A_FM_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 880 + MODULE_FIRMWARE(IWL_GL_A_FM_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
-5
drivers/net/wireless/intel/iwlwifi/cfg/5000.c
··· 3 3 * 4 4 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2018 - 2020 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/module.h>
-5
drivers/net/wireless/intel/iwlwifi/cfg/6000.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2018 - 2020 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/module.h>
+7 -4
drivers/net/wireless/intel/iwlwifi/dvm/agn.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* 3 - * Copyright (C) 2005-2014 Intel Corporation 3 + * Copyright (C) 2005-2014, 2021 Intel Corporation 4 4 */ 5 5 #ifndef __iwl_agn_h__ 6 6 #define __iwl_agn_h__ ··· 398 398 if (!iwl_is_rfkill((m))) \ 399 399 IWL_ERR(m, fmt, ##args); \ 400 400 else \ 401 - __iwl_err((m)->dev, true, \ 402 - !iwl_have_debug_level(IWL_DL_RADIO), \ 401 + __iwl_err((m)->dev, \ 402 + iwl_have_debug_level(IWL_DL_RADIO) ? \ 403 + IWL_ERR_MODE_RFKILL : \ 404 + IWL_ERR_MODE_TRACE_ONLY, \ 403 405 fmt, ##args); \ 404 406 } while (0) 405 407 #else ··· 410 408 if (!iwl_is_rfkill((m))) \ 411 409 IWL_ERR(m, fmt, ##args); \ 412 410 else \ 413 - __iwl_err((m)->dev, true, true, fmt, ##args); \ 411 + __iwl_err((m)->dev, IWL_ERR_MODE_TRACE_ONLY, \ 412 + fmt, ##args); \ 414 413 } while (0) 415 414 #endif /* CONFIG_IWLWIFI_DEBUG */ 416 415
-4
drivers/net/wireless/intel/iwlwifi/dvm/debugfs.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2018 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 6 *****************************************************************************/ 11 7 12 8 #include <linux/slab.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/dev.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2003 - 2014, 2020 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 /* 12 7 * Please use this file (dev.h) for driver implementation definitions.
-5
drivers/net/wireless/intel/iwlwifi/dvm/devices.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2019 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/units.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/led.c
··· 3 3 * 4 4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2019 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8
-5
drivers/net/wireless/intel/iwlwifi/dvm/led.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 12 7 #ifndef __iwl_leds_h__
-5
drivers/net/wireless/intel/iwlwifi/dvm/lib.c
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 #include <linux/etherdevice.h> 12 7 #include <linux/kernel.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
··· 6 6 * 7 7 * Portions of this file are derived from the ipw3945 project, as well 8 8 * as portions of the ieee80211 subsystem header files. 9 - * 10 - * Contact Information: 11 - * Intel Linux Wireless <linuxwifi@intel.com> 12 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 13 - * 14 9 *****************************************************************************/ 15 10 #include <linux/kernel.h> 16 11 #include <linux/module.h>
-6
drivers/net/wireless/intel/iwlwifi/dvm/main.c
··· 6 6 * 7 7 * Portions of this file are derived from the ipw3945 project, as well 8 8 * as portions of the ieee80211 subsystem header files. 9 - * 10 - * Contact Information: 11 - * Intel Linux Wireless <linuxwifi@intel.com> 12 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 13 - * 14 9 *****************************************************************************/ 15 10 16 11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ··· 47 52 48 53 #define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link AGN driver for Linux" 49 54 MODULE_DESCRIPTION(DRV_DESCRIPTION); 50 - MODULE_AUTHOR(DRV_AUTHOR); 51 55 MODULE_LICENSE("GPL"); 52 56 53 57 /* Please keep this array *SORTED* by hex value.
-4
drivers/net/wireless/intel/iwlwifi/dvm/power.c
··· 6 6 * 7 7 * Portions of this file are derived from the ipw3945 project, as well 8 8 * as portions of the ieee80211 subsystem header files. 9 - * 10 - * Contact Information: 11 - * Intel Linux Wireless <linuxwifi@intel.com> 12 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 13 9 *****************************************************************************/ 14 10 15 11
-4
drivers/net/wireless/intel/iwlwifi/dvm/power.h
··· 5 5 * 6 6 * Portions of this file are derived from the ipw3945 project, as well 7 7 * as portions of the ieee80211 subsystem header files. 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 8 *****************************************************************************/ 13 9 #ifndef __iwl_power_setting_h__ 14 10 #define __iwl_power_setting_h__
-5
drivers/net/wireless/intel/iwlwifi/dvm/rs.c
··· 3 3 * 4 4 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2019 - 2020 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 #include <linux/kernel.h> 13 8 #include <linux/skbuff.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/rs.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 12 7 #ifndef __iwl_agn_rs_h__
-5
drivers/net/wireless/intel/iwlwifi/dvm/rx.c
··· 7 7 * 8 8 * Portions of this file are derived from the ipw3945 project, as well 9 9 * as portionhelp of the ieee80211 subsystem header files. 10 - * 11 - * Contact Information: 12 - * Intel Linux Wireless <linuxwifi@intel.com> 13 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 14 - * 15 10 *****************************************************************************/ 16 11 17 12 #include <linux/etherdevice.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/rxon.c
··· 3 3 * 4 4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2015 Intel Deutschland GmbH 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/etherdevice.h>
-4
drivers/net/wireless/intel/iwlwifi/dvm/scan.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2018 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 6 *****************************************************************************/ 11 7 #include <linux/slab.h> 12 8 #include <linux/types.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/sta.c
··· 5 5 * 6 6 * Portions of this file are derived from the ipw3945 project, as well 7 7 * as portions of the ieee80211 subsystem header files. 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 - * 13 8 *****************************************************************************/ 14 9 #include <linux/etherdevice.h> 15 10 #include <net/mac80211.h>
-4
drivers/net/wireless/intel/iwlwifi/dvm/tt.c
··· 6 6 * 7 7 * Portions of this file are derived from the ipw3945 project, as well 8 8 * as portions of the ieee80211 subsystem header files. 9 - * 10 - * Contact Information: 11 - * Intel Linux Wireless <linuxwifi@intel.com> 12 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 13 9 *****************************************************************************/ 14 10 15 11
-4
drivers/net/wireless/intel/iwlwifi/dvm/tt.h
··· 5 5 * 6 6 * Portions of this file are derived from the ipw3945 project, as well 7 7 * as portions of the ieee80211 subsystem header files. 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 8 *****************************************************************************/ 13 9 #ifndef __iwl_tt_setting_h__ 14 10 #define __iwl_tt_setting_h__
-5
drivers/net/wireless/intel/iwlwifi/dvm/tx.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2019 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/kernel.h>
-5
drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
··· 3 3 * 4 4 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2015 Intel Deutschland GmbH 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/kernel.h>
+2 -1
drivers/net/wireless/intel/iwlwifi/fw/acpi.h
··· 116 116 DSM_FUNC_DISABLE_SRD = 1, 117 117 DSM_FUNC_ENABLE_INDONESIA_5G2 = 2, 118 118 DSM_FUNC_11AX_ENABLEMENT = 6, 119 - DSM_FUNC_ENABLE_UNII4_CHAN = 7 119 + DSM_FUNC_ENABLE_UNII4_CHAN = 7, 120 + DSM_FUNC_ACTIVATE_CHANNEL = 8 120 121 }; 121 122 122 123 enum iwl_dsm_values_srd {
+1 -1
drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
··· 624 624 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */ 625 625 626 626 /** 627 - * struct iwl_wowlan_status - WoWLAN status 627 + * struct iwl_wowlan_status_v7 - WoWLAN status 628 628 * @gtk: GTK data 629 629 * @igtk: IGTK data 630 630 * @replay_ctr: GTK rekey replay counter
+57
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
··· 7 7 8 8 #include <linux/bitops.h> 9 9 10 + #define IWL_FW_INI_HW_SMEM_REGION_ID 15 10 11 #define IWL_FW_INI_MAX_REGION_ID 64 11 12 #define IWL_FW_INI_MAX_NAME 32 12 13 #define IWL_FW_INI_MAX_CFG_NAME 64 ··· 242 241 __le32 period_msec; 243 242 struct iwl_fw_ini_hcmd hcmd; 244 243 } __packed; /* FW_TLV_DEBUG_HCMD_API_S_VER_1 */ 244 + 245 + /** 246 + * struct iwl_fw_ini_conf_tlv - preset configuration TLV 247 + * 248 + * @address: the base address 249 + * @value: value to set at address 250 + 251 + */ 252 + struct iwl_fw_ini_addr_val { 253 + __le32 address; 254 + __le32 value; 255 + } __packed; /* FW_TLV_DEBUG_ADDR_VALUE_VER_1 */ 256 + 257 + /** 258 + * struct iwl_fw_ini_conf_tlv - configuration TLV to set register/memory. 259 + * 260 + * @hdr: debug header 261 + * @time_point: time point to apply config. One of &enum iwl_fw_ini_time_point 262 + * @set_type: write access type preset token for time point. 263 + * one of &enum iwl_fw_ini_config_set_type 264 + * @addr_offset: the offset to add to any item in address[0] field 265 + * @addr_val: address value pair 266 + */ 267 + struct iwl_fw_ini_conf_set_tlv { 268 + struct iwl_fw_ini_header hdr; 269 + __le32 time_point; 270 + __le32 set_type; 271 + __le32 addr_offset; 272 + struct iwl_fw_ini_addr_val addr_val[0]; 273 + } __packed; /* FW_TLV_DEBUG_CONFIG_SET_API_S_VER_1 */ 274 + 275 + /** 276 + * enum iwl_fw_ini_config_set_type 277 + * 278 + * @IWL_FW_INI_CONFIG_SET_TYPE_INVALID: invalid config set 279 + * @IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_MAC: for PERIPHERY MAC configuration 280 + * @IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_PHY: for PERIPHERY PHY configuration 281 + * @IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_AUX: for PERIPHERY AUX configuration 282 + * @IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_MEMORY: for DEVICE MEMORY configuration 283 + * @IWL_FW_INI_CONFIG_SET_TYPE_CSR: for CSR configuration 284 + * @IWL_FW_INI_CONFIG_SET_TYPE_DBGC_DRAM_ADDR: for DBGC_DRAM_ADDR configuration 285 + * @IWL_FW_INI_CONFIG_SET_TYPE_PERIPH_SCRATCH_HWM: for PERIPH SCRATCH HWM configuration 286 + * @IWL_FW_INI_ALLOCATION_NUM: max number of configuration supported 287 + */ 288 + 289 + enum iwl_fw_ini_config_set_type { 290 + IWL_FW_INI_CONFIG_SET_TYPE_INVALID = 0, 291 + IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_MAC, 292 + IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_PHY, 293 + IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_PERIPHERY_AUX, 294 + IWL_FW_INI_CONFIG_SET_TYPE_DEVICE_MEMORY, 295 + IWL_FW_INI_CONFIG_SET_TYPE_CSR, 296 + IWL_FW_INI_CONFIG_SET_TYPE_DBGC_DRAM_ADDR, 297 + IWL_FW_INI_CONFIG_SET_TYPE_PERIPH_SCRATCH_HWM, 298 + IWL_FW_INI_CONFIG_SET_TYPE_MAX_NUM, 299 + } __packed; 245 300 246 301 /** 247 302 * enum iwl_fw_ini_allocation_id
+18
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
··· 361 361 struct iwl_buf_alloc_frag frags[BUF_ALLOC_MAX_NUM_FRAGS]; 362 362 } __packed; /* BUFFER_ALLOCATION_CMD_API_S_VER_2 */ 363 363 364 + #define DRAM_INFO_FIRST_MAGIC_WORD 0x76543210 365 + #define DRAM_INFO_SECOND_MAGIC_WORD 0x89ABCDEF 366 + 367 + /** 368 + * struct iwL_dram_info - DRAM fragments allocation struct 369 + * 370 + * Driver will fill in the first 1K(+) of the pointed DRAM fragment 371 + * 372 + * @first_word: magic word value 373 + * @second_word: magic word value 374 + * @framfrags: DRAM fragmentaion detail 375 + */ 376 + struct iwl_dram_info { 377 + __le32 first_word; 378 + __le32 second_word; 379 + struct iwl_buf_alloc_cmd dram_frags[IWL_FW_INI_ALLOCATION_NUM - 1]; 380 + } __packed; /* INIT_DRAM_FRAGS_ALLOCATIONS_S_VER_1 */ 381 + 364 382 /** 365 383 * struct iwl_dbg_host_event_cfg_cmd 366 384 * @enabled_severities: enabled severities
+7 -3
drivers/net/wireless/intel/iwlwifi/fw/api/location.h
··· 206 206 IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE = BIT(8), 207 207 IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT = BIT(9), 208 208 IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL = BIT(10), 209 - IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_ABC_MSK, 209 + IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_AB_MSK, 210 210 IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT = BIT(24), 211 211 IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK = BIT(25), 212 212 IWL_TOF_RESPONDER_FLAGS_SESSION_ID = BIT(27), ··· 629 629 IWL_LOCATION_BW_20MHZ, 630 630 IWL_LOCATION_BW_40MHZ, 631 631 IWL_LOCATION_BW_80MHZ, 632 + IWL_LOCATION_BW_160MHZ, 632 633 }; 633 634 634 635 #define TK_11AZ_LEN 32 ··· 1501 1500 u8 reserved[3]; 1502 1501 u8 rx_pn[IEEE80211_CCMP_PN_LEN]; 1503 1502 u8 tx_pn[IEEE80211_CCMP_PN_LEN]; 1504 - } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6 */ 1503 + } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6, 1504 + LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_7 */ 1505 + 1505 1506 1506 1507 /** 1507 1508 * enum iwl_tof_response_status - tof response status ··· 1584 1581 u8 last_report; 1585 1582 u8 reserved; 1586 1583 struct iwl_tof_range_rsp_ap_entry_ntfy_v6 ap[IWL_MVM_TOF_MAX_APS]; 1587 - } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8 */ 1584 + } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8, 1585 + LOCATION_RANGE_RSP_NTFY_API_S_VER_9 */ 1588 1586 1589 1587 #define IWL_MVM_TOF_MCSI_BUF_SIZE (245) 1590 1588 /**
+3
drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
··· 138 138 * @FLEXIBLE_TWT_SUPPORTED: AP supports flexible TWT schedule 139 139 * @PROTECTED_TWT_SUPPORTED: AP supports protected TWT frames (with 11w) 140 140 * @BROADCAST_TWT_SUPPORTED: AP and STA support broadcast TWT 141 + * @COEX_HIGH_PRIORITY_ENABLE: high priority mode for BT coex, to be used 142 + * during 802.1X negotiation (and allowed during 4-way-HS) 141 143 */ 142 144 enum iwl_mac_data_policy { 143 145 TWT_SUPPORTED = BIT(0), ··· 147 145 FLEXIBLE_TWT_SUPPORTED = BIT(2), 148 146 PROTECTED_TWT_SUPPORTED = BIT(3), 149 147 BROADCAST_TWT_SUPPORTED = BIT(4), 148 + COEX_HIGH_PRIORITY_ENABLE = BIT(5), 150 149 }; 151 150 152 151 /**
+23
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
··· 472 472 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_4 */ 473 473 474 474 /** 475 + * struct iwl_lari_config_change_cmd_v5 - change LARI configuration 476 + * @config_bitmap: Bitmap of the config commands. Each bit will trigger a 477 + * different predefined FW config operation. 478 + * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. 479 + * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits 480 + * per country, one to indicate whether to override and the other to 481 + * indicate the value to use. 482 + * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits 483 + * per country, one to indicate whether to override and the other to 484 + * indicate allow/disallow unii4 channels. 485 + * @chan_state_active_bitmap: Bitmap for overriding channel state to active. 486 + * Each bit represents a country or region to activate, according to the BIOS 487 + * definitions. 488 + */ 489 + struct iwl_lari_config_change_cmd_v5 { 490 + __le32 config_bitmap; 491 + __le32 oem_uhb_allow_bitmap; 492 + __le32 oem_11ax_allow_bitmap; 493 + __le32 oem_unii4_allow_bitmap; 494 + __le32 chan_state_active_bitmap; 495 + } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_5 */ 496 + 497 + /** 475 498 * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete 476 499 * @status: PNVM image loading status 477 500 */
+197 -37
drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
··· 184 184 __le32 amsdu_enabled; 185 185 } __packed; /* TLC_MNG_UPDATE_NTFY_API_S_VER_2 */ 186 186 187 + 188 + #define IWL_MAX_MCS_DISPLAY_SIZE 12 189 + 190 + struct iwl_rate_mcs_info { 191 + char mbps[IWL_MAX_MCS_DISPLAY_SIZE]; 192 + char mcs[IWL_MAX_MCS_DISPLAY_SIZE]; 193 + }; 194 + 187 195 /* 188 196 * These serve as indexes into 189 197 * struct iwl_rate_info fw_rate_idx_to_plcp[IWL_RATE_COUNT]; ··· 234 226 IWL_LAST_HE_RATE = IWL_RATE_MCS_11_INDEX, 235 227 IWL_RATE_COUNT_LEGACY = IWL_LAST_NON_HT_RATE + 1, 236 228 IWL_RATE_COUNT = IWL_LAST_HE_RATE + 1, 229 + IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, 230 + IWL_RATE_INVALID = IWL_RATE_COUNT, 237 231 }; 238 232 239 233 #define IWL_RATE_BIT_MSK(r) BIT(IWL_RATE_##r##M_INDEX) ··· 258 248 }; 259 249 260 250 /* 261 - * rate_n_flags bit fields 251 + * rate_n_flags bit fields version 1 262 252 * 263 253 * The 32-bit value has different layouts in the low 8 bites depending on the 264 254 * format. There are three formats, HT, VHT and legacy (11abg, with subformats ··· 276 266 277 267 /* Bit 8: (1) HT format, (0) legacy or VHT format */ 278 268 #define RATE_MCS_HT_POS 8 279 - #define RATE_MCS_HT_MSK (1 << RATE_MCS_HT_POS) 269 + #define RATE_MCS_HT_MSK_V1 BIT(RATE_MCS_HT_POS) 280 270 281 271 /* Bit 9: (1) CCK, (0) OFDM. HT (bit 8) must be "0" for this bit to be valid */ 282 - #define RATE_MCS_CCK_POS 9 283 - #define RATE_MCS_CCK_MSK (1 << RATE_MCS_CCK_POS) 272 + #define RATE_MCS_CCK_POS_V1 9 273 + #define RATE_MCS_CCK_MSK_V1 BIT(RATE_MCS_CCK_POS_V1) 284 274 285 275 /* Bit 26: (1) VHT format, (0) legacy format in bits 8:0 */ 286 - #define RATE_MCS_VHT_POS 26 287 - #define RATE_MCS_VHT_MSK (1 << RATE_MCS_VHT_POS) 276 + #define RATE_MCS_VHT_POS_V1 26 277 + #define RATE_MCS_VHT_MSK_V1 BIT(RATE_MCS_VHT_POS_V1) 288 278 289 279 290 280 /* ··· 310 300 * streams and 16-23 have three streams. We could also support MCS 32 311 301 * which is the duplicate 20 MHz MCS (bit 5 set, all others zero.) 312 302 */ 313 - #define RATE_HT_MCS_RATE_CODE_MSK 0x7 314 - #define RATE_HT_MCS_NSS_POS 3 315 - #define RATE_HT_MCS_NSS_MSK (3 << RATE_HT_MCS_NSS_POS) 303 + #define RATE_HT_MCS_RATE_CODE_MSK_V1 0x7 304 + #define RATE_HT_MCS_NSS_POS_V1 3 305 + #define RATE_HT_MCS_NSS_MSK_V1 (3 << RATE_HT_MCS_NSS_POS_V1) 306 + #define RATE_HT_MCS_MIMO2_MSK BIT(RATE_HT_MCS_NSS_POS_V1) 316 307 317 308 /* Bit 10: (1) Use Green Field preamble */ 318 309 #define RATE_HT_MCS_GF_POS 10 319 310 #define RATE_HT_MCS_GF_MSK (1 << RATE_HT_MCS_GF_POS) 320 311 321 - #define RATE_HT_MCS_INDEX_MSK 0x3f 312 + #define RATE_HT_MCS_INDEX_MSK_V1 0x3f 322 313 323 314 /* 324 315 * Very High-throughput (VHT) rate format for bits 7:0 ··· 335 324 #define RATE_VHT_MCS_RATE_CODE_MSK 0xf 336 325 #define RATE_VHT_MCS_NSS_POS 4 337 326 #define RATE_VHT_MCS_NSS_MSK (3 << RATE_VHT_MCS_NSS_POS) 327 + #define RATE_VHT_MCS_MIMO2_MSK BIT(RATE_VHT_MCS_NSS_POS) 338 328 339 329 /* 340 330 * Legacy OFDM rate format for bits 7:0 ··· 359 347 * 110) 11 Mbps 360 348 * (bit 7 is 0) 361 349 */ 362 - #define RATE_LEGACY_RATE_MSK 0xff 350 + #define RATE_LEGACY_RATE_MSK_V1 0xff 363 351 364 352 /* Bit 10 - OFDM HE */ 365 - #define RATE_MCS_HE_POS 10 366 - #define RATE_MCS_HE_MSK BIT(RATE_MCS_HE_POS) 353 + #define RATE_MCS_HE_POS_V1 10 354 + #define RATE_MCS_HE_MSK_V1 BIT(RATE_MCS_HE_POS_V1) 367 355 368 356 /* 369 357 * Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz 370 358 * 0 and 1 are valid for HT and VHT, 2 and 3 only for VHT 371 359 */ 372 360 #define RATE_MCS_CHAN_WIDTH_POS 11 373 - #define RATE_MCS_CHAN_WIDTH_MSK (3 << RATE_MCS_CHAN_WIDTH_POS) 374 - #define RATE_MCS_CHAN_WIDTH_20 (0 << RATE_MCS_CHAN_WIDTH_POS) 375 - #define RATE_MCS_CHAN_WIDTH_40 (1 << RATE_MCS_CHAN_WIDTH_POS) 376 - #define RATE_MCS_CHAN_WIDTH_80 (2 << RATE_MCS_CHAN_WIDTH_POS) 377 - #define RATE_MCS_CHAN_WIDTH_160 (3 << RATE_MCS_CHAN_WIDTH_POS) 361 + #define RATE_MCS_CHAN_WIDTH_MSK_V1 (3 << RATE_MCS_CHAN_WIDTH_POS) 378 362 379 363 /* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */ 380 - #define RATE_MCS_SGI_POS 13 381 - #define RATE_MCS_SGI_MSK (1 << RATE_MCS_SGI_POS) 364 + #define RATE_MCS_SGI_POS_V1 13 365 + #define RATE_MCS_SGI_MSK_V1 BIT(RATE_MCS_SGI_POS_V1) 382 366 383 367 /* Bit 14-16: Antenna selection (1) Ant A, (2) Ant B, (4) Ant C */ 384 368 #define RATE_MCS_ANT_POS 14 385 369 #define RATE_MCS_ANT_A_MSK (1 << RATE_MCS_ANT_POS) 386 370 #define RATE_MCS_ANT_B_MSK (2 << RATE_MCS_ANT_POS) 387 - #define RATE_MCS_ANT_C_MSK (4 << RATE_MCS_ANT_POS) 388 371 #define RATE_MCS_ANT_AB_MSK (RATE_MCS_ANT_A_MSK | \ 389 372 RATE_MCS_ANT_B_MSK) 390 - #define RATE_MCS_ANT_ABC_MSK (RATE_MCS_ANT_AB_MSK | \ 391 - RATE_MCS_ANT_C_MSK) 392 - #define RATE_MCS_ANT_MSK RATE_MCS_ANT_ABC_MSK 373 + #define RATE_MCS_ANT_MSK RATE_MCS_ANT_AB_MSK 393 374 394 375 /* Bit 17: (0) SS, (1) SS*2 */ 395 376 #define RATE_MCS_STBC_POS 17 ··· 416 411 * 3 (does not occur) 417 412 */ 418 413 #define RATE_MCS_HE_GI_LTF_POS 20 419 - #define RATE_MCS_HE_GI_LTF_MSK (3 << RATE_MCS_HE_GI_LTF_POS) 414 + #define RATE_MCS_HE_GI_LTF_MSK_V1 (3 << RATE_MCS_HE_GI_LTF_POS) 420 415 421 416 /* Bit 22-23: HE type. (0) SU, (1) SU_EXT, (2) MU, (3) trigger based */ 422 - #define RATE_MCS_HE_TYPE_POS 22 423 - #define RATE_MCS_HE_TYPE_SU (0 << RATE_MCS_HE_TYPE_POS) 424 - #define RATE_MCS_HE_TYPE_EXT_SU (1 << RATE_MCS_HE_TYPE_POS) 425 - #define RATE_MCS_HE_TYPE_MU (2 << RATE_MCS_HE_TYPE_POS) 426 - #define RATE_MCS_HE_TYPE_TRIG (3 << RATE_MCS_HE_TYPE_POS) 427 - #define RATE_MCS_HE_TYPE_MSK (3 << RATE_MCS_HE_TYPE_POS) 417 + #define RATE_MCS_HE_TYPE_POS_V1 22 418 + #define RATE_MCS_HE_TYPE_SU_V1 (0 << RATE_MCS_HE_TYPE_POS_V1) 419 + #define RATE_MCS_HE_TYPE_EXT_SU_V1 BIT(RATE_MCS_HE_TYPE_POS_V1) 420 + #define RATE_MCS_HE_TYPE_MU_V1 (2 << RATE_MCS_HE_TYPE_POS_V1) 421 + #define RATE_MCS_HE_TYPE_TRIG_V1 (3 << RATE_MCS_HE_TYPE_POS_V1) 422 + #define RATE_MCS_HE_TYPE_MSK_V1 (3 << RATE_MCS_HE_TYPE_POS_V1) 428 423 429 424 /* Bit 24-25: (0) 20MHz (no dup), (1) 2x20MHz, (2) 4x20MHz, 3 8x20MHz */ 430 - #define RATE_MCS_DUP_POS 24 431 - #define RATE_MCS_DUP_MSK (3 << RATE_MCS_DUP_POS) 425 + #define RATE_MCS_DUP_POS_V1 24 426 + #define RATE_MCS_DUP_MSK_V1 (3 << RATE_MCS_DUP_POS_V1) 432 427 433 428 /* Bit 27: (1) LDPC enabled, (0) LDPC disabled */ 434 - #define RATE_MCS_LDPC_POS 27 435 - #define RATE_MCS_LDPC_MSK (1 << RATE_MCS_LDPC_POS) 429 + #define RATE_MCS_LDPC_POS_V1 27 430 + #define RATE_MCS_LDPC_MSK_V1 BIT(RATE_MCS_LDPC_POS_V1) 436 431 437 432 /* Bit 28: (1) 106-tone RX (8 MHz RU), (0) normal bandwidth */ 438 - #define RATE_MCS_HE_106T_POS 28 439 - #define RATE_MCS_HE_106T_MSK (1 << RATE_MCS_HE_106T_POS) 433 + #define RATE_MCS_HE_106T_POS_V1 28 434 + #define RATE_MCS_HE_106T_MSK_V1 BIT(RATE_MCS_HE_106T_POS_V1) 440 435 441 436 /* Bit 30-31: (1) RTS, (2) CTS */ 442 437 #define RATE_MCS_RTS_REQUIRED_POS (30) ··· 444 439 445 440 #define RATE_MCS_CTS_REQUIRED_POS (31) 446 441 #define RATE_MCS_CTS_REQUIRED_MSK (0x1 << RATE_MCS_CTS_REQUIRED_POS) 442 + 443 + /* rate_n_flags bit field version 2 444 + * 445 + * The 32-bit value has different layouts in the low 8 bits depending on the 446 + * format. There are three formats, HT, VHT and legacy (11abg, with subformats 447 + * for CCK and OFDM). 448 + * 449 + */ 450 + 451 + /* Bits 10-8: rate format 452 + * (0) Legacy CCK (1) Legacy OFDM (2) High-throughput (HT) 453 + * (3) Very High-throughput (VHT) (4) High-efficiency (HE) 454 + * (5) Extremely High-throughput (EHT) 455 + */ 456 + #define RATE_MCS_MOD_TYPE_POS 8 457 + #define RATE_MCS_MOD_TYPE_MSK (0x7 << RATE_MCS_MOD_TYPE_POS) 458 + #define RATE_MCS_CCK_MSK (0 << RATE_MCS_MOD_TYPE_POS) 459 + #define RATE_MCS_LEGACY_OFDM_MSK (1 << RATE_MCS_MOD_TYPE_POS) 460 + #define RATE_MCS_HT_MSK (2 << RATE_MCS_MOD_TYPE_POS) 461 + #define RATE_MCS_VHT_MSK (3 << RATE_MCS_MOD_TYPE_POS) 462 + #define RATE_MCS_HE_MSK (4 << RATE_MCS_MOD_TYPE_POS) 463 + #define RATE_MCS_EHT_MSK (5 << RATE_MCS_MOD_TYPE_POS) 464 + 465 + /* 466 + * Legacy CCK rate format for bits 0:3: 467 + * 468 + * (0) 0xa - 1 Mbps 469 + * (1) 0x14 - 2 Mbps 470 + * (2) 0x37 - 5.5 Mbps 471 + * (3) 0x6e - 11 nbps 472 + * 473 + * Legacy OFDM rate format for bis 3:0: 474 + * 475 + * (0) 6 Mbps 476 + * (1) 9 Mbps 477 + * (2) 12 Mbps 478 + * (3) 18 Mbps 479 + * (4) 24 Mbps 480 + * (5) 36 Mbps 481 + * (6) 48 Mbps 482 + * (7) 54 Mbps 483 + * 484 + */ 485 + #define RATE_LEGACY_RATE_MSK 0x7 486 + 487 + /* 488 + * HT, VHT, HE, EHT rate format for bits 3:0 489 + * 3-0: MCS 490 + * 491 + */ 492 + #define RATE_HT_MCS_CODE_MSK 0x7 493 + #define RATE_MCS_NSS_POS 4 494 + #define RATE_MCS_NSS_MSK (1 << RATE_MCS_NSS_POS) 495 + #define RATE_MCS_CODE_MSK 0xf 496 + #define RATE_HT_MCS_INDEX(r) ((((r) & RATE_MCS_NSS_MSK) >> 1) | \ 497 + ((r) & RATE_HT_MCS_CODE_MSK)) 498 + 499 + /* Bits 7-5: reserved */ 500 + 501 + /* 502 + * Bits 13-11: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz, (4) 320MHz 503 + */ 504 + #define RATE_MCS_CHAN_WIDTH_MSK (0x7 << RATE_MCS_CHAN_WIDTH_POS) 505 + #define RATE_MCS_CHAN_WIDTH_20 (0 << RATE_MCS_CHAN_WIDTH_POS) 506 + #define RATE_MCS_CHAN_WIDTH_40 (1 << RATE_MCS_CHAN_WIDTH_POS) 507 + #define RATE_MCS_CHAN_WIDTH_80 (2 << RATE_MCS_CHAN_WIDTH_POS) 508 + #define RATE_MCS_CHAN_WIDTH_160 (3 << RATE_MCS_CHAN_WIDTH_POS) 509 + #define RATE_MCS_CHAN_WIDTH_320 (4 << RATE_MCS_CHAN_WIDTH_POS) 510 + 511 + /* Bit 15-14: Antenna selection: 512 + * Bit 14: Ant A active 513 + * Bit 15: Ant B active 514 + * 515 + * All relevant definitions are same as in v1 516 + */ 517 + 518 + /* Bit 16 (1) LDPC enables, (0) LDPC disabled */ 519 + #define RATE_MCS_LDPC_POS 16 520 + #define RATE_MCS_LDPC_MSK (1 << RATE_MCS_LDPC_POS) 521 + 522 + /* Bit 17: (0) SS, (1) SS*2 (same as v1) */ 523 + 524 + /* Bit 18: OFDM-HE dual carrier mode (same as v1) */ 525 + 526 + /* Bit 19: (0) Beamforming is off, (1) Beamforming is on (same as v1) */ 527 + 528 + /* 529 + * Bit 22-20: HE LTF type and guard interval 530 + * CCK: 531 + * 0 long preamble 532 + * 1 short preamble 533 + * HT/VHT: 534 + * 0 0.8us 535 + * 1 0.4us 536 + * HE (ext) SU: 537 + * 0 1xLTF+0.8us 538 + * 1 2xLTF+0.8us 539 + * 2 2xLTF+1.6us 540 + * 3 4xLTF+3.2us 541 + * 4 4xLTF+0.8us 542 + * HE MU: 543 + * 0 4xLTF+0.8us 544 + * 1 2xLTF+0.8us 545 + * 2 2xLTF+1.6us 546 + * 3 4xLTF+3.2us 547 + * HE TRIG: 548 + * 0 1xLTF+1.6us 549 + * 1 2xLTF+1.6us 550 + * 2 4xLTF+3.2us 551 + * */ 552 + #define RATE_MCS_HE_GI_LTF_MSK (0x7 << RATE_MCS_HE_GI_LTF_POS) 553 + #define RATE_MCS_SGI_POS RATE_MCS_HE_GI_LTF_POS 554 + #define RATE_MCS_SGI_MSK (1 << RATE_MCS_SGI_POS) 555 + #define RATE_MCS_HE_SU_4_LTF 3 556 + #define RATE_MCS_HE_SU_4_LTF_08_GI 4 557 + 558 + /* Bit 24-23: HE type. (0) SU, (1) SU_EXT, (2) MU, (3) trigger based */ 559 + #define RATE_MCS_HE_TYPE_POS 23 560 + #define RATE_MCS_HE_TYPE_SU (0 << RATE_MCS_HE_TYPE_POS) 561 + #define RATE_MCS_HE_TYPE_EXT_SU (1 << RATE_MCS_HE_TYPE_POS) 562 + #define RATE_MCS_HE_TYPE_MU (2 << RATE_MCS_HE_TYPE_POS) 563 + #define RATE_MCS_HE_TYPE_TRIG (3 << RATE_MCS_HE_TYPE_POS) 564 + #define RATE_MCS_HE_TYPE_MSK (3 << RATE_MCS_HE_TYPE_POS) 565 + 566 + /* Bit 25: duplicate channel enabled 567 + * 568 + * if this bit is set, duplicate is according to BW (bits 11-13): 569 + * 570 + * CCK: 2x 20MHz 571 + * OFDM Legacy: N x 20Mhz, (N = BW \ 2 , either 2, 4, 8, 16) 572 + * EHT: 2 x BW/2, (80 - 2x40, 160 - 2x80, 320 - 2x160) 573 + * */ 574 + #define RATE_MCS_DUP_POS 25 575 + #define RATE_MCS_DUP_MSK (1 << RATE_MCS_DUP_POS) 576 + 577 + /* Bit 26: (1) 106-tone RX (8 MHz RU), (0) normal bandwidth */ 578 + #define RATE_MCS_HE_106T_POS 26 579 + #define RATE_MCS_HE_106T_MSK (1 << RATE_MCS_HE_106T_POS) 580 + 581 + /* Bit 27: EHT extra LTF: 582 + * instead of 1 LTF for SISO use 2 LTFs, 583 + * instead of 2 LTFs for NSTS=2 use 4 LTFs*/ 584 + #define RATE_MCS_EHT_EXTRA_LTF_POS 27 585 + #define RATE_MCS_EHT_EXTRA_LTF_MSK (1 << RATE_MCS_EHT_EXTRA_LTF_POS) 586 + 587 + /* Bit 31-28: reserved */ 447 588 448 589 /* Link Quality definitions */ 449 590 ··· 707 556 __le32 rs_table[LQ_MAX_RETRY_NUM]; 708 557 __le32 ss_params; 709 558 }; /* LINK_QUALITY_CMD_API_S_VER_1 */ 559 + 560 + u8 iwl_fw_rate_idx_to_plcp(int idx); 561 + u32 iwl_new_rate_from_v1(u32 rate_v1); 562 + u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags); 563 + const struct iwl_rate_mcs_info *iwl_rate_mcs(int idx); 564 + const char *iwl_rs_pretty_ant(u8 ant); 565 + const char *iwl_rs_pretty_bw(int bw); 566 + int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate); 567 + bool iwl_he_is_sgi(u32 rate_n_flags); 710 568 711 569 #endif /* __iwl_fw_api_rs_h__ */
+10 -21
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* 3 - * Copyright (C) 2012-2014, 2018-2020 Intel Corporation 3 + * Copyright (C) 2012-2014, 2018-2021 Intel Corporation 4 4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 5 5 * Copyright (C) 2015-2017 Intel Deutschland GmbH 6 6 */ ··· 13 13 #define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1 14 14 #define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff 15 15 #define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00 16 - #define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000 17 16 #define IWL_RX_INFO_ENERGY_ANT_A_POS 0 18 17 #define IWL_RX_INFO_ENERGY_ANT_B_POS 8 19 18 #define IWL_RX_INFO_ENERGY_ANT_C_POS 16 ··· 125 126 * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow 126 127 * @RX_MPDU_RES_STATUS_SRC_STA_FOUND: station was found 127 128 * @RX_MPDU_RES_STATUS_KEY_VALID: key was valid 128 - * @RX_MPDU_RES_STATUS_KEY_PARAM_OK: key parameters were usable 129 129 * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed 130 130 * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked 131 131 * in the driver. 132 132 * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine 133 133 * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or 134 - * alg = CCM only. Checks replay attack for 11w frames. Relevant only if 135 - * %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set. 134 + * alg = CCM only. Checks replay attack for 11w frames. 136 135 * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted 137 136 * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP 138 137 * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM ··· 142 145 * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted 143 146 * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm 144 147 * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted 145 - * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP: extended IV (set with TKIP) 146 - * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT: key ID comparison done 147 - * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame 148 148 * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw 149 149 * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors 150 150 * @RX_MPDU_RES_STATUS_STA_ID_MSK: station ID mask ··· 152 158 RX_MPDU_RES_STATUS_OVERRUN_OK = BIT(1), 153 159 RX_MPDU_RES_STATUS_SRC_STA_FOUND = BIT(2), 154 160 RX_MPDU_RES_STATUS_KEY_VALID = BIT(3), 155 - RX_MPDU_RES_STATUS_KEY_PARAM_OK = BIT(4), 156 161 RX_MPDU_RES_STATUS_ICV_OK = BIT(5), 157 162 RX_MPDU_RES_STATUS_MIC_OK = BIT(6), 158 163 RX_MPDU_RES_STATUS_TTAK_OK = BIT(7), ··· 165 172 RX_MPDU_RES_STATUS_SEC_ENC_ERR = (7 << 8), 166 173 RX_MPDU_RES_STATUS_SEC_ENC_MSK = (7 << 8), 167 174 RX_MPDU_RES_STATUS_DEC_DONE = BIT(11), 168 - RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP = BIT(13), 169 - RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT = BIT(14), 170 - RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME = BIT(15), 171 175 RX_MPDU_RES_STATUS_CSUM_DONE = BIT(16), 172 176 RX_MPDU_RES_STATUS_CSUM_OK = BIT(17), 173 177 RX_MDPU_RES_STATUS_STA_ID_SHIFT = 24, ··· 226 236 IWL_RX_MPDU_STATUS_OVERRUN_OK = BIT(1), 227 237 IWL_RX_MPDU_STATUS_SRC_STA_FOUND = BIT(2), 228 238 IWL_RX_MPDU_STATUS_KEY_VALID = BIT(3), 229 - IWL_RX_MPDU_STATUS_KEY_PARAM_OK = BIT(4), 230 239 IWL_RX_MPDU_STATUS_ICV_OK = BIT(5), 231 240 IWL_RX_MPDU_STATUS_MIC_OK = BIT(6), 232 241 IWL_RX_MPDU_RES_STATUS_TTAK_OK = BIT(7), ··· 240 251 IWL_RX_MPDU_STATUS_SEC_EXT_ENC = 0x4 << 8, 241 252 IWL_RX_MPDU_STATUS_SEC_GCM = 0x5 << 8, 242 253 IWL_RX_MPDU_STATUS_DECRYPTED = BIT(11), 243 - IWL_RX_MPDU_STATUS_WEP_MATCH = BIT(12), 244 - IWL_RX_MPDU_STATUS_EXT_IV_MATCH = BIT(13), 245 - IWL_RX_MPDU_STATUS_KEY_ID_MATCH = BIT(14), 246 254 IWL_RX_MPDU_STATUS_ROBUST_MNG_FRAME = BIT(15), 247 255 248 - IWL_RX_MPDU_STATUS_KEY = 0x3f0000, 249 256 IWL_RX_MPDU_STATUS_DUPLICATE = BIT(22), 250 257 251 258 IWL_RX_MPDU_STATUS_STA_ID = 0x1f000000, ··· 445 460 __le32 phy_data1; 446 461 }; 447 462 }; 448 - } __packed; 463 + } __packed; /* RX_MPDU_RES_START_API_S_VER_4 */ 449 464 450 465 /** 451 466 * struct iwl_rx_mpdu_desc_v3 - RX MPDU descriptor ··· 545 560 * @reserved: reserved 546 561 */ 547 562 __le32 reserved[2]; 548 - } __packed; /* RX_MPDU_RES_START_API_S_VER_3 */ 563 + } __packed; /* RX_MPDU_RES_START_API_S_VER_3, 564 + RX_MPDU_RES_START_API_S_VER_5 */ 549 565 550 566 /** 551 567 * struct iwl_rx_mpdu_desc - RX MPDU descriptor ··· 611 625 struct iwl_rx_mpdu_desc_v1 v1; 612 626 struct iwl_rx_mpdu_desc_v3 v3; 613 627 }; 614 - } __packed; /* RX_MPDU_RES_START_API_S_VER_3 */ 628 + } __packed; /* RX_MPDU_RES_START_API_S_VER_3, 629 + RX_MPDU_RES_START_API_S_VER_4, 630 + RX_MPDU_RES_START_API_S_VER_5 */ 615 631 616 632 #define IWL_RX_DESC_SIZE_V1 offsetofend(struct iwl_rx_mpdu_desc, v1) 617 633 ··· 667 679 __le32 rate; 668 680 __le32 phy_info[2]; 669 681 __le32 rx_vec[2]; 670 - } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */ 682 + } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1, 683 + TX_NO_DATA_NTFY_API_S_VER_2 */ 671 684 672 685 struct iwl_frame_release { 673 686 u8 baid;
+29 -11
drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* 3 - * Copyright (C) 2012-2014, 2018-2020 Intel Corporation 3 + * Copyright (C) 2012-2014, 2018-2021 Intel Corporation 4 4 * Copyright (C) 2016-2017 Intel Deutschland GmbH 5 5 */ 6 6 #ifndef __iwl_fw_api_tx_h__ ··· 81 81 IWL_TX_FLAGS_CMD_RATE = BIT(0), 82 82 IWL_TX_FLAGS_ENCRYPT_DIS = BIT(1), 83 83 IWL_TX_FLAGS_HIGH_PRI = BIT(2), 84 + /* Use these flags only from 85 + * TX_FLAGS_BITS_API_S_VER_4 and above */ 86 + IWL_TX_FLAGS_RTS = BIT(3), 87 + IWL_TX_FLAGS_CTS = BIT(4), 84 88 }; /* TX_FLAGS_BITS_API_S_VER_3 */ 85 89 86 90 /** ··· 271 267 struct iwl_dram_sec_info dram_info; 272 268 __le32 rate_n_flags; 273 269 struct ieee80211_hdr hdr[]; 274 - } __packed; /* TX_CMD_API_S_VER_7 */ 270 + } __packed; /* TX_CMD_API_S_VER_7, 271 + TX_CMD_API_S_VER_9 */ 275 272 276 273 /** 277 274 * struct iwl_tx_cmd_gen3 - TX command struct to FW for AX210+ devices ··· 295 290 __le32 rate_n_flags; 296 291 __le64 ttl; 297 292 struct ieee80211_hdr hdr[]; 298 - } __packed; /* TX_CMD_API_S_VER_8 */ 293 + } __packed; /* TX_CMD_API_S_VER_8, 294 + TX_CMD_API_S_VER_10 */ 299 295 300 296 /* 301 297 * TX response related data ··· 597 591 __le16 tx_queue; 598 592 __le16 reserved2; 599 593 struct agg_tx_status status; 600 - } __packed; /* TX_RSP_API_S_VER_6 */ 594 + } __packed; /* TX_RSP_API_S_VER_6, 595 + TX_RSP_API_S_VER_7 */ 601 596 602 597 /** 603 598 * struct iwl_mvm_ba_notif - notifies about reception of BA ··· 722 715 __le16 ra_tid_cnt; 723 716 struct iwl_mvm_compressed_ba_ratid ra_tid[0]; 724 717 struct iwl_mvm_compressed_ba_tfd tfd[]; 725 - } __packed; /* COMPRESSED_BA_RES_API_S_VER_4 */ 718 + } __packed; /* COMPRESSED_BA_RES_API_S_VER_4, 719 + COMPRESSED_BA_RES_API_S_VER_5 */ 726 720 727 721 /** 728 722 * struct iwl_mac_beacon_cmd_v6 - beacon template command ··· 763 755 struct ieee80211_hdr frame[]; 764 756 } __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_7 */ 765 757 758 + /* Bit flags for BEACON_TEMPLATE_CMD_API until version 10 */ 759 + enum iwl_mac_beacon_flags_v1 { 760 + IWL_MAC_BEACON_CCK_V1 = BIT(8), 761 + IWL_MAC_BEACON_ANT_A_V1 = BIT(9), 762 + IWL_MAC_BEACON_ANT_B_V1 = BIT(10), 763 + IWL_MAC_BEACON_FILS_V1 = BIT(12), 764 + }; 765 + 766 + /* Bit flags for BEACON_TEMPLATE_CMD_API version 11 and above */ 766 767 enum iwl_mac_beacon_flags { 767 - IWL_MAC_BEACON_CCK = BIT(8), 768 - IWL_MAC_BEACON_ANT_A = BIT(9), 769 - IWL_MAC_BEACON_ANT_B = BIT(10), 770 - IWL_MAC_BEACON_ANT_C = BIT(11), 771 - IWL_MAC_BEACON_FILS = BIT(12), 768 + IWL_MAC_BEACON_CCK = BIT(5), 769 + IWL_MAC_BEACON_ANT_A = BIT(6), 770 + IWL_MAC_BEACON_ANT_B = BIT(7), 771 + IWL_MAC_BEACON_FILS = BIT(8), 772 772 }; 773 773 774 774 /** ··· 804 788 __le32 ecsa_offset; 805 789 __le32 csa_offset; 806 790 struct ieee80211_hdr frame[]; 807 - } __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_10 */ 791 + } __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_10, 792 + BEACON_TEMPLATE_CMD_API_S_VER_11, 793 + BEACON_TEMPLATE_CMD_API_S_VER_12 */ 808 794 809 795 struct iwl_beacon_notif { 810 796 struct iwl_mvm_tx_resp beacon_notify_hdr;
+42 -4
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 159 159 iwl_trans_read_prph(fwrt->trans, TXF_READ_MODIFY_DATA + offset); 160 160 161 161 /* Read FIFO */ 162 - fifo_len /= sizeof(u32); /* Size in DWORDS */ 163 - for (i = 0; i < fifo_len; i++) 162 + for (i = 0; i < fifo_len / sizeof(u32); i++) 164 163 fifo_data[i] = iwl_trans_read_prph(fwrt->trans, 165 164 TXF_READ_MODIFY_DATA + 166 165 offset); 166 + 167 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_txf) 168 + fwrt->sanitize_ops->frob_txf(fwrt->sanitize_ctx, 169 + fifo_data, fifo_len); 170 + 167 171 *dump_data = iwl_fw_error_next_data(*dump_data); 168 172 } 169 173 ··· 663 659 iwl_trans_read_mem_bytes(fwrt->trans, ofs, dump_mem->data, len); 664 660 *dump_data = iwl_fw_error_next_data(*dump_data); 665 661 662 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_mem) 663 + fwrt->sanitize_ops->frob_mem(fwrt->sanitize_ctx, ofs, 664 + dump_mem->data, len); 665 + 666 666 IWL_DEBUG_INFO(fwrt, "WRT memory dump. Type=%u\n", dump_mem->type); 667 667 } 668 668 ··· 760 752 PAGING_BLOCK_SIZE, 761 753 DMA_BIDIRECTIONAL); 762 754 (*data) = iwl_fw_error_next_data(*data); 755 + 756 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_mem) 757 + fwrt->sanitize_ops->frob_mem(fwrt->sanitize_ctx, 758 + fwrt->fw_paging_db[i].fw_offs, 759 + paging->data, 760 + PAGING_BLOCK_SIZE); 763 761 } 764 762 } 765 763 ··· 994 980 dump_data->data + data_size, 995 981 data_size); 996 982 983 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_mem) 984 + fwrt->sanitize_ops->frob_mem(fwrt->sanitize_ctx, addr, 985 + dump_data->data + data_size, 986 + data_size); 987 + 997 988 dump_data = iwl_fw_error_next_data(dump_data); 998 989 } 999 990 ··· 1164 1145 range->range_data_size = reg->dev_addr.size; 1165 1146 iwl_trans_read_mem_bytes(fwrt->trans, addr, range->data, 1166 1147 le32_to_cpu(reg->dev_addr.size)); 1148 + 1149 + if ((le32_to_cpu(reg->id) & IWL_FW_INI_REGION_V2_MASK) == 1150 + IWL_FW_INI_HW_SMEM_REGION_ID && 1151 + fwrt->sanitize_ops && fwrt->sanitize_ops->frob_txf) 1152 + fwrt->sanitize_ops->frob_txf(fwrt->sanitize_ctx, 1153 + range->data, 1154 + le32_to_cpu(reg->dev_addr.size)); 1167 1155 1168 1156 return sizeof(*range) + le32_to_cpu(range->range_data_size); 1169 1157 } ··· 1363 1337 data = (void *)reg_dump; 1364 1338 for (i = 0; i < iter->fifo_size; i += sizeof(*data)) 1365 1339 *data++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1340 + 1341 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_txf) 1342 + fwrt->sanitize_ops->frob_txf(fwrt->sanitize_ctx, 1343 + reg_dump, iter->fifo_size); 1366 1344 1367 1345 out: 1368 1346 iwl_trans_release_nic_access(fwrt->trans); ··· 2107 2077 */ 2108 2078 hw_type = CSR_HW_REV_TYPE(fwrt->trans->hw_rev); 2109 2079 if (hw_type == IWL_AX210_HW_TYPE) { 2110 - u32 prph_val = iwl_read_prph(fwrt->trans, WFPM_OTP_CFG1_ADDR); 2080 + u32 prph_val = iwl_read_prph(fwrt->trans, WFPM_OTP_CFG1_ADDR_GEN2); 2111 2081 u32 is_jacket = !!(prph_val & WFPM_OTP_CFG1_IS_JACKET_BIT); 2112 2082 u32 is_cdb = !!(prph_val & WFPM_OTP_CFG1_IS_CDB_BIT); 2113 2083 u32 masked_bits = is_jacket | (is_cdb << 1); ··· 2390 2360 if (dump_data->monitor_only) 2391 2361 dump_mask &= BIT(IWL_FW_ERROR_DUMP_FW_MONITOR); 2392 2362 2393 - fw_error_dump.trans_ptr = iwl_trans_dump_data(fwrt->trans, dump_mask); 2363 + fw_error_dump.trans_ptr = iwl_trans_dump_data(fwrt->trans, dump_mask, 2364 + fwrt->sanitize_ops, 2365 + fwrt->sanitize_ctx); 2394 2366 file_len = le32_to_cpu(dump_file->file_len); 2395 2367 fw_error_dump.fwrt_len = file_len; 2396 2368 ··· 2820 2788 iwl_trans_read_mem_bytes(fwrt->trans, cfg->d3_debug_data_base_addr, 2821 2789 fwrt->dump.d3_debug_data, 2822 2790 cfg->d3_debug_data_length); 2791 + 2792 + if (fwrt->sanitize_ops && fwrt->sanitize_ops->frob_mem) 2793 + fwrt->sanitize_ops->frob_mem(fwrt->sanitize_ctx, 2794 + cfg->d3_debug_data_base_addr, 2795 + fwrt->dump.d3_debug_data, 2796 + cfg->d3_debug_data_length); 2823 2797 } 2824 2798 IWL_EXPORT_SYMBOL(iwl_fw_dbg_read_d3_debug_data); 2825 2799
+8 -1
drivers/net/wireless/intel/iwlwifi/fw/dump.c
··· 214 214 /* reset the device */ 215 215 iwl_trans_sw_reset(trans); 216 216 217 - err = iwl_finish_nic_init(trans, trans->trans_cfg); 217 + err = iwl_finish_nic_init(trans); 218 218 if (err) 219 219 return; 220 220 } ··· 328 328 for (i = 0; i < ARRAY_SIZE(table.sw_status); i++) 329 329 IWL_ERR(fwrt, "0x%08X | tcm SW status[%d]\n", 330 330 table.sw_status[i], i); 331 + 332 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) { 333 + u32 scratch = iwl_read32(trans, CSR_FUNC_SCRATCH); 334 + 335 + IWL_ERR(fwrt, "Function Scratch status:\n"); 336 + IWL_ERR(fwrt, "0x%08X | Func Scratch\n", scratch); 337 + } 331 338 } 332 339 333 340 static void iwl_fwrt_dump_iml_error_log(struct iwl_fw_runtime *fwrt)
-4
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
··· 342 342 #define IWL_AX210_HW_TYPE 0x42 343 343 /* How many bits to roll when adding to the HW type of AX210 HW */ 344 344 #define IWL_AX210_HW_TYPE_ADDITION_SHIFT 12 345 - /* This prph is used to tell apart HW_TYPE == 0x42 NICs */ 346 - #define WFPM_OTP_CFG1_ADDR 0xd03098 347 - #define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) 348 - #define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) 349 345 350 346 /* struct iwl_fw_ini_dump_info - ini dump information 351 347 * @version: dump version
+10
drivers/net/wireless/intel/iwlwifi/fw/file.h
··· 100 100 IWL_UCODE_TLV_PNVM_SKU = 64, 101 101 IWL_UCODE_TLV_TCM_DEBUG_ADDRS = 65, 102 102 103 + IWL_UCODE_TLV_SEC_TABLE_ADDR = 66, 104 + IWL_UCODE_TLV_D3_KEK_KCK_ADDR = 67, 105 + 103 106 IWL_UCODE_TLV_FW_NUM_STATIONS = IWL_UCODE_TLV_CONST_BASE + 0, 104 107 105 108 IWL_UCODE_TLV_TYPE_DEBUG_INFO = IWL_UCODE_TLV_DEBUG_BASE + 0, ··· 110 107 IWL_UCODE_TLV_TYPE_HCMD = IWL_UCODE_TLV_DEBUG_BASE + 2, 111 108 IWL_UCODE_TLV_TYPE_REGIONS = IWL_UCODE_TLV_DEBUG_BASE + 3, 112 109 IWL_UCODE_TLV_TYPE_TRIGGERS = IWL_UCODE_TLV_DEBUG_BASE + 4, 110 + IWL_UCODE_TLV_TYPE_CONF_SET = IWL_UCODE_TLV_DEBUG_BASE + 5, 113 111 IWL_UCODE_TLV_DEBUG_MAX = IWL_UCODE_TLV_TYPE_TRIGGERS, 114 112 115 113 /* TLVs 0x1000-0x2000 are for internal driver usage */ ··· 420 416 IWL_UCODE_TLV_CAPA_PASSIVE_6GHZ_SCAN = (__force iwl_ucode_tlv_capa_t)58, 421 417 IWL_UCODE_TLV_CAPA_HIDDEN_6GHZ_SCAN = (__force iwl_ucode_tlv_capa_t)59, 422 418 IWL_UCODE_TLV_CAPA_BROADCAST_TWT = (__force iwl_ucode_tlv_capa_t)60, 419 + IWL_UCODE_TLV_CAPA_COEX_HIGH_PRIO = (__force iwl_ucode_tlv_capa_t)61, 423 420 424 421 /* set 2 */ 425 422 IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64, ··· 455 450 456 451 IWL_UCODE_TLV_CAPA_BIGTK_SUPPORT = (__force iwl_ucode_tlv_capa_t)100, 457 452 IWL_UCODE_TLV_CAPA_RFIM_SUPPORT = (__force iwl_ucode_tlv_capa_t)102, 453 + IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT = (__force iwl_ucode_tlv_capa_t)104, 458 454 459 455 #ifdef __CHECKER__ 460 456 /* sparse says it cannot increment the previous enum member */ ··· 961 955 struct iwl_fw_tcm_error_addr { 962 956 __le32 addr; 963 957 }; /* FW_TLV_TCM_ERROR_INFO_ADDRS_S */ 958 + 959 + struct iwl_fw_dump_exclude { 960 + __le32 addr, size; 961 + }; 964 962 965 963 static inline size_t _iwl_tlv_array_len(const struct iwl_ucode_tlv *tlv, 966 964 size_t fixed_size, size_t var_size)
+3 -55
drivers/net/wireless/intel/iwlwifi/fw/img.c
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 1 + // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 + /* 8 3 * Copyright(c) 2019 - 2020 Intel Corporation 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * The full GNU General Public License is included in this distribution 20 - * in the file called COPYING. 21 - * 22 - * Contact Information: 23 - * Intel Linux Wireless <linuxwifi@intel.com> 24 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25 - * 26 - * BSD LICENSE 27 - * 28 - * Copyright(c) 2019 - 2020 Intel Corporation 29 - * All rights reserved. 30 - * 31 - * Redistribution and use in source and binary forms, with or without 32 - * modification, are permitted provided that the following conditions 33 - * are met: 34 - * 35 - * * Redistributions of source code must retain the above copyright 36 - * notice, this list of conditions and the following disclaimer. 37 - * * Redistributions in binary form must reproduce the above copyright 38 - * notice, this list of conditions and the following disclaimer in 39 - * the documentation and/or other materials provided with the 40 - * distribution. 41 - * * Neither the name Intel Corporation nor the names of its 42 - * contributors may be used to endorse or promote products derived 43 - * from this software without specific prior written permission. 44 - * 45 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 46 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 - *****************************************************************************/ 4 + */ 57 5 58 6 #include "img.h" 59 7
+12
drivers/net/wireless/intel/iwlwifi/fw/img.h
··· 124 124 * @fw_paging_phys: page phy pointer 125 125 * @fw_paging_block: pointer to the allocated block 126 126 * @fw_paging_size: page size 127 + * @fw_offs: offset in the device 127 128 */ 128 129 struct iwl_fw_paging { 129 130 dma_addr_t fw_paging_phys; 130 131 struct page *fw_paging_block; 131 132 u32 fw_paging_size; 133 + u32 fw_offs; 132 134 }; 133 135 134 136 /** ··· 176 174 u32 dump_mask; 177 175 }; 178 176 177 + struct iwl_dump_exclude { 178 + u32 addr, size; 179 + }; 180 + 179 181 /** 180 182 * struct iwl_fw - variables associated with the firmware 181 183 * ··· 200 194 * @cipher_scheme: optional external cipher scheme. 201 195 * @human_readable: human readable version 202 196 * we get the ALIVE from the uCode 197 + * @phy_integration_ver: PHY integration version string 198 + * @phy_integration_ver_len: length of @phy_integration_ver 199 + * @dump_excl: image dump exclusion areas for RT image 200 + * @dump_excl_wowlan: image dump exclusion areas for WoWLAN image 203 201 */ 204 202 struct iwl_fw { 205 203 u32 ucode_ver; ··· 235 225 236 226 u8 *phy_integration_ver; 237 227 u32 phy_integration_ver_len; 228 + 229 + struct iwl_dump_exclude dump_excl[2], dump_excl_wowlan[2]; 238 230 }; 239 231 240 232 static inline const char *get_fw_dbg_mode_string(int mode)
+5 -1
drivers/net/wireless/intel/iwlwifi/fw/init.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 3 * Copyright (C) 2017 Intel Deutschland GmbH 4 - * Copyright (C) 2019-2020 Intel Corporation 4 + * Copyright (C) 2019-2021 Intel Corporation 5 5 */ 6 6 #include "iwl-drv.h" 7 7 #include "runtime.h" ··· 16 16 void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, 17 17 const struct iwl_fw *fw, 18 18 const struct iwl_fw_runtime_ops *ops, void *ops_ctx, 19 + const struct iwl_dump_sanitize_ops *sanitize_ops, 20 + void *sanitize_ctx, 19 21 struct dentry *dbgfs_dir) 20 22 { 21 23 int i; ··· 28 26 fwrt->dev = trans->dev; 29 27 fwrt->dump.conf = FW_DBG_INVALID; 30 28 fwrt->ops = ops; 29 + fwrt->sanitize_ops = sanitize_ops; 30 + fwrt->sanitize_ctx = sanitize_ctx; 31 31 fwrt->ops_ctx = ops_ctx; 32 32 for (i = 0; i < IWL_FW_RUNTIME_DUMP_WK_NUM; i++) { 33 33 fwrt->dump.wks[i].idx = i;
+3 -1
drivers/net/wireless/intel/iwlwifi/fw/paging.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 - * Copyright (C) 2012-2014, 2018-2019 Intel Corporation 3 + * Copyright (C) 2012-2014, 2018-2019, 2021 Intel Corporation 4 4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 5 5 * Copyright (C) 2016-2017 Intel Deutschland GmbH 6 6 */ ··· 152 152 memcpy(page_address(fwrt->fw_paging_db[0].fw_paging_block), 153 153 image->sec[sec_idx].data, 154 154 image->sec[sec_idx].len); 155 + fwrt->fw_paging_db[0].fw_offs = image->sec[sec_idx].offset; 155 156 dma_sync_single_for_device(fwrt->trans->dev, 156 157 fwrt->fw_paging_db[0].fw_paging_phys, 157 158 fwrt->fw_paging_db[0].fw_paging_size, ··· 198 197 199 198 memcpy(page_address(block->fw_paging_block), 200 199 image->sec[sec_idx].data + offset, len); 200 + block->fw_offs = image->sec[sec_idx].offset + offset; 201 201 dma_sync_single_for_device(fwrt->trans->dev, 202 202 block->fw_paging_phys, 203 203 block->fw_paging_size,
+1 -1
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
··· 162 162 goto out; 163 163 } 164 164 165 - IWL_INFO(trans, "loaded PNVM version 0x%0x\n", sha1); 165 + IWL_INFO(trans, "loaded PNVM version %08x\n", sha1); 166 166 167 167 ret = iwl_trans_set_pnvm(trans, pnvm_data, size); 168 168 out:
+252
drivers/net/wireless/intel/iwlwifi/fw/rs.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 + /* 3 + * Copyright (C) 2021 Intel Corporation 4 + */ 5 + 6 + #include <net/mac80211.h> 7 + #include "fw/api/rs.h" 8 + #include "iwl-drv.h" 9 + #include "iwl-config.h" 10 + 11 + #define IWL_DECLARE_RATE_INFO(r) \ 12 + [IWL_RATE_##r##M_INDEX] = IWL_RATE_##r##M_PLCP 13 + 14 + /* 15 + * Translate from fw_rate_index (IWL_RATE_XXM_INDEX) to PLCP 16 + * */ 17 + static const u8 fw_rate_idx_to_plcp[IWL_RATE_COUNT] = { 18 + IWL_DECLARE_RATE_INFO(1), 19 + IWL_DECLARE_RATE_INFO(2), 20 + IWL_DECLARE_RATE_INFO(5), 21 + IWL_DECLARE_RATE_INFO(11), 22 + IWL_DECLARE_RATE_INFO(6), 23 + IWL_DECLARE_RATE_INFO(9), 24 + IWL_DECLARE_RATE_INFO(12), 25 + IWL_DECLARE_RATE_INFO(18), 26 + IWL_DECLARE_RATE_INFO(24), 27 + IWL_DECLARE_RATE_INFO(36), 28 + IWL_DECLARE_RATE_INFO(48), 29 + IWL_DECLARE_RATE_INFO(54), 30 + }; 31 + 32 + /* mbps, mcs */ 33 + static const struct iwl_rate_mcs_info rate_mcs[IWL_RATE_COUNT] = { 34 + { "1", "BPSK DSSS"}, 35 + { "2", "QPSK DSSS"}, 36 + {"5.5", "BPSK CCK"}, 37 + { "11", "QPSK CCK"}, 38 + { "6", "BPSK 1/2"}, 39 + { "9", "BPSK 1/2"}, 40 + { "12", "QPSK 1/2"}, 41 + { "18", "QPSK 3/4"}, 42 + { "24", "16QAM 1/2"}, 43 + { "36", "16QAM 3/4"}, 44 + { "48", "64QAM 2/3"}, 45 + { "54", "64QAM 3/4"}, 46 + { "60", "64QAM 5/6"}, 47 + }; 48 + 49 + static const char * const ant_name[] = { 50 + [ANT_NONE] = "None", 51 + [ANT_A] = "A", 52 + [ANT_B] = "B", 53 + [ANT_AB] = "AB", 54 + }; 55 + 56 + static const char * const pretty_bw[] = { 57 + "20Mhz", 58 + "40Mhz", 59 + "80Mhz", 60 + "160 Mhz", 61 + "320Mhz", 62 + }; 63 + 64 + u8 iwl_fw_rate_idx_to_plcp(int idx) 65 + { 66 + return fw_rate_idx_to_plcp[idx]; 67 + } 68 + IWL_EXPORT_SYMBOL(iwl_fw_rate_idx_to_plcp); 69 + 70 + const struct iwl_rate_mcs_info *iwl_rate_mcs(int idx) 71 + { 72 + return &rate_mcs[idx]; 73 + } 74 + IWL_EXPORT_SYMBOL(iwl_rate_mcs); 75 + 76 + const char *iwl_rs_pretty_ant(u8 ant) 77 + { 78 + if (ant >= ARRAY_SIZE(ant_name)) 79 + return "UNKNOWN"; 80 + 81 + return ant_name[ant]; 82 + } 83 + IWL_EXPORT_SYMBOL(iwl_rs_pretty_ant); 84 + 85 + const char *iwl_rs_pretty_bw(int bw) 86 + { 87 + if (bw >= ARRAY_SIZE(pretty_bw)) 88 + return "unknown bw"; 89 + 90 + return pretty_bw[bw]; 91 + } 92 + IWL_EXPORT_SYMBOL(iwl_rs_pretty_bw); 93 + 94 + u32 iwl_new_rate_from_v1(u32 rate_v1) 95 + { 96 + u32 rate_v2 = 0; 97 + u32 dup = 0; 98 + 99 + if (rate_v1 == 0) 100 + return rate_v1; 101 + /* convert rate */ 102 + if (rate_v1 & RATE_MCS_HT_MSK_V1) { 103 + u32 nss = 0; 104 + 105 + rate_v2 |= RATE_MCS_HT_MSK; 106 + rate_v2 |= 107 + rate_v1 & RATE_HT_MCS_RATE_CODE_MSK_V1; 108 + nss = (rate_v1 & RATE_HT_MCS_MIMO2_MSK) >> 109 + RATE_HT_MCS_NSS_POS_V1; 110 + rate_v2 |= nss << RATE_MCS_NSS_POS; 111 + } else if (rate_v1 & RATE_MCS_VHT_MSK_V1 || 112 + rate_v1 & RATE_MCS_HE_MSK_V1) { 113 + rate_v2 |= rate_v1 & RATE_VHT_MCS_RATE_CODE_MSK; 114 + 115 + rate_v2 |= rate_v1 & RATE_VHT_MCS_MIMO2_MSK; 116 + 117 + if (rate_v1 & RATE_MCS_HE_MSK_V1) { 118 + u32 he_type_bits = rate_v1 & RATE_MCS_HE_TYPE_MSK_V1; 119 + u32 he_type = he_type_bits >> RATE_MCS_HE_TYPE_POS_V1; 120 + u32 he_106t = (rate_v1 & RATE_MCS_HE_106T_MSK_V1) >> 121 + RATE_MCS_HE_106T_POS_V1; 122 + u32 he_gi_ltf = (rate_v1 & RATE_MCS_HE_GI_LTF_MSK_V1) >> 123 + RATE_MCS_HE_GI_LTF_POS; 124 + 125 + if ((he_type_bits == RATE_MCS_HE_TYPE_SU || 126 + he_type_bits == RATE_MCS_HE_TYPE_EXT_SU) && 127 + he_gi_ltf == RATE_MCS_HE_SU_4_LTF) 128 + /* the new rate have an additional bit to 129 + * represent the value 4 rather then using SGI 130 + * bit for this purpose - as it was done in the old 131 + * rate */ 132 + he_gi_ltf += (rate_v1 & RATE_MCS_SGI_MSK_V1) >> 133 + RATE_MCS_SGI_POS_V1; 134 + 135 + rate_v2 |= he_gi_ltf << RATE_MCS_HE_GI_LTF_POS; 136 + rate_v2 |= he_type << RATE_MCS_HE_TYPE_POS; 137 + rate_v2 |= he_106t << RATE_MCS_HE_106T_POS; 138 + rate_v2 |= rate_v1 & RATE_HE_DUAL_CARRIER_MODE_MSK; 139 + rate_v2 |= RATE_MCS_HE_MSK; 140 + } else { 141 + rate_v2 |= RATE_MCS_VHT_MSK; 142 + } 143 + /* if legacy format */ 144 + } else { 145 + u32 legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1); 146 + 147 + WARN_ON(legacy_rate < 0); 148 + rate_v2 |= legacy_rate; 149 + if (!(rate_v1 & RATE_MCS_CCK_MSK_V1)) 150 + rate_v2 |= RATE_MCS_LEGACY_OFDM_MSK; 151 + } 152 + 153 + /* convert flags */ 154 + if (rate_v1 & RATE_MCS_LDPC_MSK_V1) 155 + rate_v2 |= RATE_MCS_LDPC_MSK; 156 + rate_v2 |= (rate_v1 & RATE_MCS_CHAN_WIDTH_MSK_V1) | 157 + (rate_v1 & RATE_MCS_ANT_AB_MSK) | 158 + (rate_v1 & RATE_MCS_STBC_MSK) | 159 + (rate_v1 & RATE_MCS_BF_MSK); 160 + 161 + dup = (rate_v1 & RATE_MCS_DUP_MSK_V1) >> RATE_MCS_DUP_POS_V1; 162 + if (dup) { 163 + rate_v2 |= RATE_MCS_DUP_MSK; 164 + rate_v2 |= dup << RATE_MCS_CHAN_WIDTH_POS; 165 + } 166 + 167 + if ((!(rate_v1 & RATE_MCS_HE_MSK_V1)) && 168 + (rate_v1 & RATE_MCS_SGI_MSK_V1)) 169 + rate_v2 |= RATE_MCS_SGI_MSK; 170 + 171 + return rate_v2; 172 + } 173 + IWL_EXPORT_SYMBOL(iwl_new_rate_from_v1); 174 + 175 + u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags) 176 + { 177 + int rate = rate_n_flags & RATE_LEGACY_RATE_MSK_V1; 178 + int idx; 179 + bool ofdm = !(rate_n_flags & RATE_MCS_CCK_MSK_V1); 180 + int offset = ofdm ? IWL_FIRST_OFDM_RATE : 0; 181 + int last = ofdm ? IWL_RATE_COUNT_LEGACY : IWL_FIRST_OFDM_RATE; 182 + 183 + for (idx = offset; idx < last; idx++) 184 + if (iwl_fw_rate_idx_to_plcp(idx) == rate) 185 + return idx - offset; 186 + return -1; 187 + } 188 + 189 + int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate) 190 + { 191 + char *type; 192 + u8 mcs = 0, nss = 0; 193 + u8 ant = (rate & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 194 + u32 bw = (rate & RATE_MCS_CHAN_WIDTH_MSK) >> 195 + RATE_MCS_CHAN_WIDTH_POS; 196 + u32 format = rate & RATE_MCS_MOD_TYPE_MSK; 197 + bool sgi; 198 + 199 + if (format == RATE_MCS_CCK_MSK || 200 + format == RATE_MCS_LEGACY_OFDM_MSK) { 201 + int legacy_rate = rate & RATE_LEGACY_RATE_MSK; 202 + int index = format == RATE_MCS_CCK_MSK ? 203 + legacy_rate : 204 + legacy_rate + IWL_FIRST_OFDM_RATE; 205 + 206 + return scnprintf(buf, bufsz, "Legacy | ANT: %s Rate: %s Mbps", 207 + iwl_rs_pretty_ant(ant), 208 + index == IWL_RATE_INVALID ? "BAD" : 209 + iwl_rate_mcs(index)->mbps); 210 + } 211 + 212 + if (format == RATE_MCS_VHT_MSK) 213 + type = "VHT"; 214 + else if (format == RATE_MCS_HT_MSK) 215 + type = "HT"; 216 + else if (format == RATE_MCS_HE_MSK) 217 + type = "HE"; 218 + else 219 + type = "Unknown"; /* shouldn't happen */ 220 + 221 + mcs = format == RATE_MCS_HT_MSK ? 222 + RATE_HT_MCS_INDEX(rate) : 223 + rate & RATE_MCS_CODE_MSK; 224 + nss = ((rate & RATE_MCS_NSS_MSK) 225 + >> RATE_MCS_NSS_POS) + 1; 226 + sgi = format == RATE_MCS_HE_MSK ? 227 + iwl_he_is_sgi(rate) : 228 + rate & RATE_MCS_SGI_MSK; 229 + 230 + return scnprintf(buf, bufsz, 231 + "0x%x: %s | ANT: %s BW: %s MCS: %d NSS: %d %s%s%s%s%s", 232 + rate, type, iwl_rs_pretty_ant(ant), iwl_rs_pretty_bw(bw), mcs, nss, 233 + (sgi) ? "SGI " : "NGI ", 234 + (rate & RATE_MCS_STBC_MSK) ? "STBC " : "", 235 + (rate & RATE_MCS_LDPC_MSK) ? "LDPC " : "", 236 + (rate & RATE_HE_DUAL_CARRIER_MODE_MSK) ? "DCM " : "", 237 + (rate & RATE_MCS_BF_MSK) ? "BF " : ""); 238 + } 239 + IWL_EXPORT_SYMBOL(rs_pretty_print_rate); 240 + 241 + bool iwl_he_is_sgi(u32 rate_n_flags) 242 + { 243 + u32 type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; 244 + u32 ltf_gi = rate_n_flags & RATE_MCS_HE_GI_LTF_MSK; 245 + 246 + if (type == RATE_MCS_HE_TYPE_SU || 247 + type == RATE_MCS_HE_TYPE_EXT_SU) 248 + return ltf_gi == RATE_MCS_HE_SU_4_LTF_08_GI; 249 + return false; 250 + } 251 + IWL_EXPORT_SYMBOL(iwl_he_is_sgi); 252 +
+5
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
··· 105 105 const struct iwl_fw_runtime_ops *ops; 106 106 void *ops_ctx; 107 107 108 + const struct iwl_dump_sanitize_ops *sanitize_ops; 109 + void *sanitize_ctx; 110 + 108 111 /* Paging */ 109 112 struct iwl_fw_paging fw_paging_db[NUM_OF_FW_PAGING_BLOCKS]; 110 113 u16 num_of_paging_blk; ··· 164 161 void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, 165 162 const struct iwl_fw *fw, 166 163 const struct iwl_fw_runtime_ops *ops, void *ops_ctx, 164 + const struct iwl_dump_sanitize_ops *sanitize_ops, 165 + void *sanitize_ctx, 167 166 struct dentry *dbgfs_dir); 168 167 169 168 static inline void iwl_fw_runtime_free(struct iwl_fw_runtime *fwrt)
+7 -1
drivers/net/wireless/intel/iwlwifi/iwl-config.h
··· 95 95 #define ANT_AC (ANT_A | ANT_C) 96 96 #define ANT_BC (ANT_B | ANT_C) 97 97 #define ANT_ABC (ANT_A | ANT_B | ANT_C) 98 - #define MAX_ANT_NUM 3 99 98 100 99 101 100 static inline u8 num_of_ant(u8 mask) ··· 419 420 #define IWL_CFG_MAC_TYPE_SOF 0x43 420 421 #define IWL_CFG_MAC_TYPE_MA 0x44 421 422 #define IWL_CFG_MAC_TYPE_BZ 0x46 423 + #define IWL_CFG_MAC_TYPE_GL 0x47 422 424 423 425 #define IWL_CFG_RF_TYPE_TH 0x105 424 426 #define IWL_CFG_RF_TYPE_TH1 0x108 ··· 511 511 extern const char iwl_ax210_killer_1675x_name[]; 512 512 extern const char iwl9560_killer_1550i_160_name[]; 513 513 extern const char iwl9560_killer_1550s_160_name[]; 514 + extern const char iwl_ax211_killer_1675s_name[]; 515 + extern const char iwl_ax211_killer_1675i_name[]; 516 + extern const char iwl_ax411_killer_1690s_name[]; 517 + extern const char iwl_ax411_killer_1690i_name[]; 514 518 extern const char iwl_ax211_name[]; 515 519 extern const char iwl_ax221_name[]; 516 520 extern const char iwl_ax231_name[]; ··· 632 628 extern const struct iwl_cfg iwl_cfg_bz_a0_gf_a0; 633 629 extern const struct iwl_cfg iwl_cfg_bz_a0_gf4_a0; 634 630 extern const struct iwl_cfg iwl_cfg_bz_a0_mr_a0; 631 + extern const struct iwl_cfg iwl_cfg_bz_a0_fm_a0; 632 + extern const struct iwl_cfg iwl_cfg_gl_a0_fm_a0; 635 633 #endif /* CONFIG_IWLMVM */ 636 634 637 635 #endif /* __IWL_CONFIG_H__ */
+2 -2
drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h
··· 109 109 * struct iwl_prph_scratch_hwm_cfg - hwm config 110 110 * @hwm_base_addr: hwm start address 111 111 * @hwm_size: hwm size in DWs 112 - * @reserved: reserved 112 + * @debug_token_config: debug preset 113 113 */ 114 114 struct iwl_prph_scratch_hwm_cfg { 115 115 __le64 hwm_base_addr; 116 116 __le32 hwm_size; 117 - __le32 reserved; 117 + __le32 debug_token_config; 118 118 } __packed; /* PERIPH_SCRATCH_HWM_CFG_S */ 119 119 120 120 /*
+7
drivers/net/wireless/intel/iwlwifi/iwl-csr.h
··· 34 34 #define CSR_GPIO_IN (CSR_BASE+0x018) /* read external chip pins */ 35 35 #define CSR_RESET (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/ 36 36 #define CSR_GP_CNTRL (CSR_BASE+0x024) 37 + #define CSR_FUNC_SCRATCH (CSR_BASE+0x02c) /* Scratch register - used for FW dbg */ 37 38 38 39 /* 2nd byte of CSR_INT_COALESCING, not accessible via iwl_write32()! */ 39 40 #define CSR_INT_PERIODIC_REG (CSR_BASE+0x005) ··· 135 134 136 135 #define CSR_DBG_HPET_MEM_REG (CSR_BASE+0x240) 137 136 #define CSR_DBG_LINK_PWR_MGMT_REG (CSR_BASE+0x250) 137 + 138 + /* 139 + * Scratch register initial configuration - this is set on init, and read 140 + * during a error FW error. 141 + */ 142 + #define CSR_FUNC_SCRATCH_INIT_VALUE (0x01010101) 138 143 139 144 /* Bits for CSR_HW_IF_CONFIG_REG */ 140 145 #define CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH (0x00000003)
+163 -3
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
··· 16 16 * @IWL_DBG_TLV_TYPE_HCMD: host command TLV 17 17 * @IWL_DBG_TLV_TYPE_REGION: region TLV 18 18 * @IWL_DBG_TLV_TYPE_TRIGGER: trigger TLV 19 + * @IWL_DBG_TLV_TYPE_CONF_SET: conf set TLV 19 20 * @IWL_DBG_TLV_TYPE_NUM: number of debug TLVs 20 21 */ 21 22 enum iwl_dbg_tlv_type { ··· 26 25 IWL_DBG_TLV_TYPE_HCMD, 27 26 IWL_DBG_TLV_TYPE_REGION, 28 27 IWL_DBG_TLV_TYPE_TRIGGER, 28 + IWL_DBG_TLV_TYPE_CONF_SET, 29 29 IWL_DBG_TLV_TYPE_NUM, 30 30 }; 31 31 ··· 61 59 [IWL_DBG_TLV_TYPE_HCMD] = {.min_ver = 1, .max_ver = 1,}, 62 60 [IWL_DBG_TLV_TYPE_REGION] = {.min_ver = 1, .max_ver = 2,}, 63 61 [IWL_DBG_TLV_TYPE_TRIGGER] = {.min_ver = 1, .max_ver = 1,}, 62 + [IWL_DBG_TLV_TYPE_CONF_SET] = {.min_ver = 1, .max_ver = 1,}, 64 63 }; 65 64 66 65 static int iwl_dbg_tlv_add(const struct iwl_ucode_tlv *tlv, ··· 263 260 return ret; 264 261 } 265 262 263 + static int iwl_dbg_tlv_config_set(struct iwl_trans *trans, 264 + const struct iwl_ucode_tlv *tlv) 265 + { 266 + struct iwl_fw_ini_conf_set_tlv *conf_set = (void *)tlv->data; 267 + u32 tp = le32_to_cpu(conf_set->time_point); 268 + u32 type = le32_to_cpu(conf_set->set_type); 269 + 270 + if (tp <= IWL_FW_INI_TIME_POINT_INVALID || 271 + tp >= IWL_FW_INI_TIME_POINT_NUM) { 272 + IWL_DEBUG_FW(trans, 273 + "WRT: Invalid time point %u for config set TLV\n", tp); 274 + return -EINVAL; 275 + } 276 + 277 + if (type <= IWL_FW_INI_CONFIG_SET_TYPE_INVALID || 278 + type >= IWL_FW_INI_CONFIG_SET_TYPE_MAX_NUM) { 279 + IWL_DEBUG_FW(trans, 280 + "WRT: Invalid config set type %u for config set TLV\n", type); 281 + return -EINVAL; 282 + } 283 + 284 + if (type != IWL_FW_INI_CONFIG_SET_TYPE_PERIPH_SCRATCH_HWM || 285 + trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) { 286 + IWL_DEBUG_FW(trans, 287 + "WRT: Config set type %u is not supported\n", type); 288 + return -EINVAL; 289 + } 290 + 291 + return iwl_dbg_tlv_add(tlv, &trans->dbg.time_point[tp].config_list); 292 + } 293 + 266 294 static int (*dbg_tlv_alloc[])(struct iwl_trans *trans, 267 295 const struct iwl_ucode_tlv *tlv) = { 268 296 [IWL_DBG_TLV_TYPE_DEBUG_INFO] = iwl_dbg_tlv_alloc_debug_info, ··· 301 267 [IWL_DBG_TLV_TYPE_HCMD] = iwl_dbg_tlv_alloc_hcmd, 302 268 [IWL_DBG_TLV_TYPE_REGION] = iwl_dbg_tlv_alloc_region, 303 269 [IWL_DBG_TLV_TYPE_TRIGGER] = iwl_dbg_tlv_alloc_trigger, 270 + [IWL_DBG_TLV_TYPE_CONF_SET] = iwl_dbg_tlv_config_set, 304 271 }; 305 272 306 273 void iwl_dbg_tlv_alloc(struct iwl_trans *trans, const struct iwl_ucode_tlv *tlv, ··· 434 399 list_del(&tlv_node->list); 435 400 kfree(tlv_node); 436 401 } 402 + 403 + list_for_each_entry_safe(tlv_node, tlv_node_tmp, 404 + &tp->config_list, list) { 405 + list_del(&tlv_node->list); 406 + kfree(tlv_node); 407 + } 408 + 437 409 } 438 410 439 411 for (i = 0; i < ARRAY_SIZE(trans->dbg.fw_mon_ini); i++) ··· 508 466 INIT_LIST_HEAD(&tp->trig_list); 509 467 INIT_LIST_HEAD(&tp->hcmd_list); 510 468 INIT_LIST_HEAD(&tp->active_trig_list); 469 + INIT_LIST_HEAD(&tp->config_list); 511 470 } 512 471 } 513 472 ··· 692 649 { 693 650 int ret, i; 694 651 652 + if (fw_has_capa(&fwrt->fw->ucode_capa, 653 + IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT)) 654 + return; 655 + 695 656 for (i = 0; i < IWL_FW_INI_ALLOCATION_NUM; i++) { 696 657 ret = iwl_dbg_tlv_apply_buffer(fwrt, i); 697 658 if (ret) 698 659 IWL_WARN(fwrt, 699 660 "WRT: Failed to apply DRAM buffer for allocation id %d, ret=%d\n", 700 661 i, ret); 662 + } 663 + } 664 + 665 + static int iwl_dbg_tlv_update_dram(struct iwl_fw_runtime *fwrt, 666 + enum iwl_fw_ini_allocation_id alloc_id, 667 + struct iwl_dram_info *dram_info) 668 + { 669 + struct iwl_fw_mon *fw_mon; 670 + u32 remain_frags, num_frags; 671 + int j, fw_mon_idx = 0; 672 + struct iwl_buf_alloc_cmd *data; 673 + 674 + if (le32_to_cpu(fwrt->trans->dbg.fw_mon_cfg[alloc_id].buf_location) != 675 + IWL_FW_INI_LOCATION_DRAM_PATH) { 676 + IWL_DEBUG_FW(fwrt, "DRAM_PATH is not supported alloc_id %u\n", alloc_id); 677 + return -1; 678 + } 679 + 680 + fw_mon = &fwrt->trans->dbg.fw_mon_ini[alloc_id]; 681 + 682 + /* the first fragment of DBGC1 is given to the FW via register 683 + * or context info 684 + */ 685 + if (alloc_id == IWL_FW_INI_ALLOCATION_ID_DBGC1) 686 + fw_mon_idx++; 687 + 688 + remain_frags = fw_mon->num_frags - fw_mon_idx; 689 + if (!remain_frags) 690 + return -1; 691 + 692 + num_frags = min_t(u32, remain_frags, BUF_ALLOC_MAX_NUM_FRAGS); 693 + data = &dram_info->dram_frags[alloc_id - 1]; 694 + data->alloc_id = cpu_to_le32(alloc_id); 695 + data->num_frags = cpu_to_le32(num_frags); 696 + data->buf_location = cpu_to_le32(IWL_FW_INI_LOCATION_DRAM_PATH); 697 + 698 + IWL_DEBUG_FW(fwrt, "WRT: DRAM buffer details alloc_id=%u, num_frags=%u\n", 699 + cpu_to_le32(alloc_id), cpu_to_le32(num_frags)); 700 + 701 + for (j = 0; j < num_frags; j++) { 702 + struct iwl_buf_alloc_frag *frag = &data->frags[j]; 703 + struct iwl_dram_data *fw_mon_frag = &fw_mon->frags[fw_mon_idx++]; 704 + 705 + frag->addr = cpu_to_le64(fw_mon_frag->physical); 706 + frag->size = cpu_to_le32(fw_mon_frag->size); 707 + IWL_DEBUG_FW(fwrt, "WRT: DRAM fragment details\n"); 708 + IWL_DEBUG_FW(fwrt, "frag=%u, addr=0x%016llx, size=0x%x)\n", 709 + j, cpu_to_le64(fw_mon_frag->physical), 710 + cpu_to_le32(fw_mon_frag->size)); 711 + } 712 + return 0; 713 + } 714 + 715 + static void iwl_dbg_tlv_update_drams(struct iwl_fw_runtime *fwrt) 716 + { 717 + int ret, i, dram_alloc = 0; 718 + struct iwl_dram_info dram_info; 719 + struct iwl_dram_data *frags = 720 + &fwrt->trans->dbg.fw_mon_ini[IWL_FW_INI_ALLOCATION_ID_DBGC1].frags[0]; 721 + 722 + if (!fw_has_capa(&fwrt->fw->ucode_capa, 723 + IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT)) 724 + return; 725 + 726 + dram_info.first_word = cpu_to_le32(DRAM_INFO_FIRST_MAGIC_WORD); 727 + dram_info.second_word = cpu_to_le32(DRAM_INFO_SECOND_MAGIC_WORD); 728 + 729 + for (i = IWL_FW_INI_ALLOCATION_ID_DBGC1; 730 + i <= IWL_FW_INI_ALLOCATION_ID_DBGC3; i++) { 731 + ret = iwl_dbg_tlv_update_dram(fwrt, i, &dram_info); 732 + if (!ret) 733 + dram_alloc++; 734 + else 735 + IWL_WARN(fwrt, 736 + "WRT: Failed to set DRAM buffer for alloc id %d, ret=%d\n", 737 + i, ret); 738 + } 739 + if (dram_alloc) { 740 + memcpy(frags->block, &dram_info, sizeof(dram_info)); 741 + IWL_DEBUG_FW(fwrt, "block data after %016x\n", 742 + *((int *)fwrt->trans->dbg.fw_mon_ini[1].frags[0].block)); 701 743 } 702 744 } 703 745 ··· 802 674 }; 803 675 804 676 iwl_trans_send_cmd(fwrt->trans, &cmd); 677 + } 678 + } 679 + 680 + static void iwl_dbg_tlv_apply_config(struct iwl_fw_runtime *fwrt, 681 + struct list_head *config_list) 682 + { 683 + struct iwl_dbg_tlv_node *node; 684 + 685 + list_for_each_entry(node, config_list, list) { 686 + struct iwl_fw_ini_conf_set_tlv *config_list = (void *)node->tlv.data; 687 + u32 type = le32_to_cpu(config_list->set_type); 688 + 689 + switch (type) { 690 + case IWL_FW_INI_CONFIG_SET_TYPE_PERIPH_SCRATCH_HWM: { 691 + u32 debug_token_config = 692 + le32_to_cpu(config_list->addr_val[0].value); 693 + 694 + IWL_DEBUG_FW(fwrt, "WRT: Setting HWM debug token config: %u\n", 695 + debug_token_config); 696 + fwrt->trans->dbg.ucode_preset = debug_token_config; 697 + break; 698 + } 699 + default: 700 + break; 701 + } 805 702 } 806 703 } 807 704 ··· 1149 996 &fwrt->trans->dbg.fw_mon_cfg[i]; 1150 997 u32 dest = le32_to_cpu(fw_mon_cfg->buf_location); 1151 998 1152 - if (dest == IWL_FW_INI_LOCATION_INVALID) 999 + if (dest == IWL_FW_INI_LOCATION_INVALID) { 1000 + failed_alloc |= BIT(i); 1153 1001 continue; 1002 + } 1154 1003 1155 1004 if (*ini_dest == IWL_FW_INI_LOCATION_INVALID) 1156 1005 *ini_dest = dest; ··· 1179 1024 &fwrt->trans->dbg.active_regions[i]; 1180 1025 u32 reg_type; 1181 1026 1182 - if (!*active_reg) 1027 + if (!*active_reg) { 1028 + fwrt->trans->dbg.unsupported_region_msk |= BIT(i); 1183 1029 continue; 1030 + } 1184 1031 1185 1032 reg = (void *)(*active_reg)->data; 1186 1033 reg_type = le32_to_cpu(reg->type); ··· 1208 1051 union iwl_dbg_tlv_tp_data *tp_data, 1209 1052 bool sync) 1210 1053 { 1211 - struct list_head *hcmd_list, *trig_list; 1054 + struct list_head *hcmd_list, *trig_list, *conf_list; 1212 1055 1213 1056 if (!iwl_trans_dbg_ini_valid(fwrt->trans) || 1214 1057 tp_id == IWL_FW_INI_TIME_POINT_INVALID || ··· 1217 1060 1218 1061 hcmd_list = &fwrt->trans->dbg.time_point[tp_id].hcmd_list; 1219 1062 trig_list = &fwrt->trans->dbg.time_point[tp_id].active_trig_list; 1063 + conf_list = &fwrt->trans->dbg.time_point[tp_id].config_list; 1220 1064 1221 1065 switch (tp_id) { 1222 1066 case IWL_FW_INI_TIME_POINT_EARLY: 1223 1067 iwl_dbg_tlv_init_cfg(fwrt); 1068 + iwl_dbg_tlv_apply_config(fwrt, conf_list); 1069 + iwl_dbg_tlv_update_drams(fwrt); 1224 1070 iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); 1225 1071 break; 1226 1072 case IWL_FW_INI_TIME_POINT_AFTER_ALIVE:
+2
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
··· 33 33 * @trig_list: list of triggers 34 34 * @active_trig_list: list of active triggers 35 35 * @hcmd_list: list of host commands 36 + * @config_list: list of configuration 36 37 */ 37 38 struct iwl_dbg_tlv_time_point_data { 38 39 struct list_head trig_list; 39 40 struct list_head active_trig_list; 40 41 struct list_head hcmd_list; 42 + struct list_head config_list; 41 43 }; 42 44 43 45 struct iwl_trans;
+17 -7
drivers/net/wireless/intel/iwlwifi/iwl-debug.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 - * Copyright (C) 2005-2011 Intel Corporation 3 + * Copyright (C) 2005-2011, 2021 Intel Corporation 4 4 */ 5 5 #include <linux/device.h> 6 6 #include <linux/interrupt.h> ··· 31 31 __iwl_fn(crit) 32 32 IWL_EXPORT_SYMBOL(__iwl_crit); 33 33 34 - void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only, 35 - const char *fmt, ...) 34 + void __iwl_err(struct device *dev, enum iwl_err_mode mode, const char *fmt, ...) 36 35 { 37 36 struct va_format vaf = { 38 37 .fmt = fmt, 39 38 }; 40 - va_list args; 39 + va_list args, args2; 41 40 42 41 va_start(args, fmt); 43 - vaf.va = &args; 44 - if (!trace_only) { 45 - if (rfkill_prefix) 42 + switch (mode) { 43 + case IWL_ERR_MODE_RATELIMIT: 44 + if (net_ratelimit()) 45 + break; 46 + fallthrough; 47 + case IWL_ERR_MODE_REGULAR: 48 + case IWL_ERR_MODE_RFKILL: 49 + va_copy(args2, args); 50 + vaf.va = &args2; 51 + if (mode == IWL_ERR_MODE_RFKILL) 46 52 dev_err(dev, "(RFKILL) %pV", &vaf); 47 53 else 48 54 dev_err(dev, "%pV", &vaf); 55 + va_end(args2); 56 + break; 57 + default: 58 + break; 49 59 } 50 60 trace_iwlwifi_err(&vaf); 51 61 va_end(args);
+16 -10
drivers/net/wireless/intel/iwlwifi/iwl-debug.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 5 - * Copyright(c) 2018 - 2020 Intel Corporation 5 + * Copyright(c) 2018 - 2021 Intel Corporation 6 6 * 7 7 * Portions of this file are derived from the ipw3945 project. 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 - * 13 8 *****************************************************************************/ 14 9 15 10 #ifndef __iwl_debug_h__ ··· 22 27 #endif 23 28 } 24 29 30 + enum iwl_err_mode { 31 + IWL_ERR_MODE_REGULAR, 32 + IWL_ERR_MODE_RFKILL, 33 + IWL_ERR_MODE_TRACE_ONLY, 34 + IWL_ERR_MODE_RATELIMIT, 35 + }; 36 + 25 37 struct device; 26 - void __iwl_err(struct device *dev, bool rfkill_prefix, bool only_trace, 27 - const char *fmt, ...) __printf(4, 5); 38 + void __iwl_err(struct device *dev, enum iwl_err_mode mode, const char *fmt, ...) 39 + __printf(3, 4); 28 40 void __iwl_warn(struct device *dev, const char *fmt, ...) __printf(2, 3); 29 41 void __iwl_info(struct device *dev, const char *fmt, ...) __printf(2, 3); 30 42 void __iwl_crit(struct device *dev, const char *fmt, ...) __printf(2, 3); ··· 40 38 #define CHECK_FOR_NEWLINE(f) BUILD_BUG_ON(f[sizeof(f) - 2] != '\n') 41 39 42 40 /* No matter what is m (priv, bus, trans), this will work */ 43 - #define IWL_ERR_DEV(d, f, a...) \ 41 + #define __IWL_ERR_DEV(d, mode, f, a...) \ 44 42 do { \ 45 43 CHECK_FOR_NEWLINE(f); \ 46 - __iwl_err((d), false, false, f, ## a); \ 44 + __iwl_err((d), mode, f, ## a); \ 47 45 } while (0) 46 + #define IWL_ERR_DEV(d, f, a...) \ 47 + __IWL_ERR_DEV(d, IWL_ERR_MODE_REGULAR, f, ## a) 48 48 #define IWL_ERR(m, f, a...) \ 49 49 IWL_ERR_DEV((m)->dev, f, ## a) 50 + #define IWL_ERR_LIMIT(m, f, a...) \ 51 + __IWL_ERR_DEV((m)->dev, IWL_ERR_MODE_RATELIMIT, f, ## a) 50 52 #define IWL_WARN(m, f, a...) \ 51 53 do { \ 52 54 CHECK_FOR_NEWLINE(f); \
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace-data.h
··· 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2015 Intel Deutschland GmbH 6 6 * Copyright(c) 2018 - 2019 Intel Corporation 7 - * 8 - * Contact Information: 9 - * Intel Linux Wireless <linuxwifi@intel.com> 10 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 11 - * 12 7 *****************************************************************************/ 13 8 14 9 #if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace-io.h
··· 3 3 * 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2016-2017 Intel Deutschland GmbH 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #if !defined(__IWLWIFI_DEVICE_TRACE_IO) || defined(TRACE_HEADER_MULTI_READ)
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h
··· 5 5 * Copyright(c) 2015 Intel Mobile Communications GmbH 6 6 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 7 7 * Copyright(c) 2018 Intel Corporation 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 - * 13 8 *****************************************************************************/ 14 9 15 10 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace-msg.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 12 7 #if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace-ucode.h
··· 2 2 /****************************************************************************** 3 3 * 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 - * 6 - * Contact Information: 7 - * Intel Linux Wireless <linuxwifi@intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 5 *****************************************************************************/ 11 6 12 7 #if !defined(__IWLWIFI_DEVICE_TRACE_UCODE) || defined(TRACE_HEADER_MULTI_READ)
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c
··· 3 3 * 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright (C) 2018 Intel Corporation 6 - * 7 - * Contact Information: 8 - * Intel Linux Wireless <linuxwifi@intel.com> 9 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 10 - * 11 6 *****************************************************************************/ 12 7 13 8 #include <linux/module.h>
-5
drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
··· 4 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 5 5 * Copyright(C) 2016 Intel Deutschland GmbH 6 6 * Copyright(c) 2018 Intel Corporation 7 - * 8 - * Contact Information: 9 - * Intel Linux Wireless <linuxwifi@intel.com> 10 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 11 - * 12 7 *****************************************************************************/ 13 8 14 9 #ifndef __IWLWIFI_DEVICE_TRACE
+43 -1
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
··· 31 31 32 32 #define DRV_DESCRIPTION "Intel(R) Wireless WiFi driver for Linux" 33 33 MODULE_DESCRIPTION(DRV_DESCRIPTION); 34 - MODULE_AUTHOR(DRV_AUTHOR); 35 34 MODULE_LICENSE("GPL"); 36 35 37 36 #ifdef CONFIG_IWLWIFI_DEBUGFS ··· 547 548 set_sec_offset(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA, 548 549 IWLAGN_RTC_DATA_LOWER_BOUND); 549 550 return 0; 551 + } 552 + 553 + static void iwl_drv_set_dump_exclude(struct iwl_drv *drv, 554 + enum iwl_ucode_tlv_type tlv_type, 555 + const void *tlv_data, u32 tlv_len) 556 + { 557 + const struct iwl_fw_dump_exclude *fw = tlv_data; 558 + struct iwl_dump_exclude *excl; 559 + 560 + if (tlv_len < sizeof(*fw)) 561 + return; 562 + 563 + if (tlv_type == IWL_UCODE_TLV_SEC_TABLE_ADDR) { 564 + excl = &drv->fw.dump_excl[0]; 565 + 566 + /* second time we find this, it's for WoWLAN */ 567 + if (excl->addr) 568 + excl = &drv->fw.dump_excl_wowlan[0]; 569 + } else if (fw_has_capa(&drv->fw.ucode_capa, 570 + IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG)) { 571 + /* IWL_UCODE_TLV_D3_KEK_KCK_ADDR is regular image */ 572 + excl = &drv->fw.dump_excl[0]; 573 + } else { 574 + /* IWL_UCODE_TLV_D3_KEK_KCK_ADDR is WoWLAN image */ 575 + excl = &drv->fw.dump_excl_wowlan[0]; 576 + } 577 + 578 + if (excl->addr) 579 + excl++; 580 + 581 + if (excl->addr) { 582 + IWL_DEBUG_FW_INFO(drv, "found too many excludes in fw file\n"); 583 + return; 584 + } 585 + 586 + excl->addr = le32_to_cpu(fw->addr) & ~FW_ADDR_CACHE_CONTROL; 587 + excl->size = le32_to_cpu(fw->size); 550 588 } 551 589 552 590 static int iwl_parse_tlv_firmware(struct iwl_drv *drv, ··· 1169 1133 case IWL_UCODE_TLV_TYPE_HCMD: 1170 1134 case IWL_UCODE_TLV_TYPE_REGIONS: 1171 1135 case IWL_UCODE_TLV_TYPE_TRIGGERS: 1136 + case IWL_UCODE_TLV_TYPE_CONF_SET: 1172 1137 if (iwlwifi_mod_params.enable_ini) 1173 1138 iwl_dbg_tlv_alloc(drv->trans, tlv, false); 1174 1139 break; ··· 1202 1165 if (!drv->fw.phy_integration_ver) 1203 1166 return -ENOMEM; 1204 1167 drv->fw.phy_integration_ver_len = tlv_len; 1168 + break; 1169 + case IWL_UCODE_TLV_SEC_TABLE_ADDR: 1170 + case IWL_UCODE_TLV_D3_KEK_KCK_ADDR: 1171 + iwl_drv_set_dump_exclude(drv, tlv_type, 1172 + tlv_data, tlv_len); 1205 1173 break; 1206 1174 default: 1207 1175 IWL_DEBUG_INFO(drv, "unknown TLV: %d\n", tlv_type);
+1 -2
drivers/net/wireless/intel/iwlwifi/iwl-drv.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* 3 - * Copyright (C) 2005-2014, 2020 Intel Corporation 3 + * Copyright (C) 2005-2014, 2020-2021 Intel Corporation 4 4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH 5 5 */ 6 6 #ifndef __iwl_drv_h__ ··· 9 9 10 10 /* for all modules */ 11 11 #define DRV_NAME "iwlwifi" 12 - #define DRV_AUTHOR "Intel Corporation <linuxwifi@intel.com>" 13 12 14 13 /* radio config bits (actual values from NVM definition) */ 15 14 #define NVM_RF_CFG_DASH_MSK(x) (x & 0x3) /* bits 0-1 */
+2 -2
drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 - * Copyright (C) 2005-2014, 2018-2019 Intel Corporation 3 + * Copyright (C) 2005-2014, 2018-2019, 2021 Intel Corporation 4 4 */ 5 5 #include <linux/types.h> 6 6 #include <linux/slab.h> ··· 139 139 { 140 140 int ret; 141 141 142 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 142 + ret = iwl_finish_nic_init(trans); 143 143 if (ret) 144 144 return ret; 145 145
+2 -2
drivers/net/wireless/intel/iwlwifi/iwl-io.c
··· 398 398 return 0; 399 399 } 400 400 401 - int iwl_finish_nic_init(struct iwl_trans *trans, 402 - const struct iwl_cfg_trans_params *cfg_trans) 401 + int iwl_finish_nic_init(struct iwl_trans *trans) 403 402 { 403 + const struct iwl_cfg_trans_params *cfg_trans = trans->trans_cfg; 404 404 u32 poll_ready; 405 405 int err; 406 406
+2 -3
drivers/net/wireless/intel/iwlwifi/iwl-io.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* 3 - * Copyright (C) 2018-2020 Intel Corporation 3 + * Copyright (C) 2018-2021 Intel Corporation 4 4 */ 5 5 #ifndef __iwl_io_h__ 6 6 #define __iwl_io_h__ ··· 52 52 void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask); 53 53 void iwl_force_nmi(struct iwl_trans *trans); 54 54 55 - int iwl_finish_nic_init(struct iwl_trans *trans, 56 - const struct iwl_cfg_trans_params *cfg_trans); 55 + int iwl_finish_nic_init(struct iwl_trans *trans); 57 56 58 57 /* Error handling */ 59 58 int iwl_dump_fh(struct iwl_trans *trans, char **buf);
+17
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
··· 534 534 cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE); 535 535 } 536 536 537 + static const u8 iwl_vendor_caps[] = { 538 + 0xdd, /* vendor element */ 539 + 0x06, /* length */ 540 + 0x00, 0x17, 0x35, /* Intel OUI */ 541 + 0x08, /* type (Intel Capabilities) */ 542 + /* followed by 16 bits of capabilities */ 543 + #define IWL_VENDOR_CAP_IMPROVED_BF_FDBK_HE BIT(0) 544 + IWL_VENDOR_CAP_IMPROVED_BF_FDBK_HE, 545 + 0x00 546 + }; 547 + 537 548 static const struct ieee80211_sband_iftype_data iwl_he_capa[] = { 538 549 { 539 550 .types_mask = BIT(NL80211_IFTYPE_STATION), ··· 792 781 if (fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_BROADCAST_TWT)) 793 782 iftype_data->he_cap.he_cap_elem.mac_cap_info[2] |= 794 783 IEEE80211_HE_MAC_CAP2_BCAST_TWT; 784 + 785 + if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000 && 786 + !is_ap) { 787 + iftype_data->vendor_elems.data = iwl_vendor_caps; 788 + iftype_data->vendor_elems.len = ARRAY_SIZE(iwl_vendor_caps); 789 + } 795 790 } 796 791 797 792 static void iwl_init_he_hw_capab(struct iwl_trans *trans,
+36
drivers/net/wireless/intel/iwlwifi/iwl-prph.h
··· 347 347 #define RADIO_REG_SYS_MANUAL_DFT_0 0xAD4078 348 348 #define RFIC_REG_RD 0xAD0470 349 349 #define WFPM_CTRL_REG 0xA03030 350 + #define WFPM_CTRL_REG_GEN2 0xd03030 351 + #define WFPM_OTP_CFG1_ADDR 0x00a03098 352 + #define WFPM_OTP_CFG1_ADDR_GEN2 0x00d03098 353 + #define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) 354 + #define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) 355 + 350 356 #define WFPM_GP2 0xA030B4 351 357 352 358 /* DBGI SRAM Register details */ ··· 405 399 LMPM_PAGE_PASS_NOTIF_POS = BIT(20), 406 400 }; 407 401 402 + /* 403 + * CRF ID register 404 + * 405 + * type: bits 0-11 406 + * reserved: bits 12-18 407 + * slave_exist: bit 19 408 + * dash: bits 20-23 409 + * step: bits 24-26 410 + * flavor: bits 27-31 411 + */ 412 + #define REG_CRF_ID_TYPE(val) (((val) & 0x00000FFF) >> 0) 413 + #define REG_CRF_ID_SLAVE(val) (((val) & 0x00080000) >> 19) 414 + #define REG_CRF_ID_DASH(val) (((val) & 0x00F00000) >> 20) 415 + #define REG_CRF_ID_STEP(val) (((val) & 0x07000000) >> 24) 416 + #define REG_CRF_ID_FLAVOR(val) (((val) & 0xF8000000) >> 27) 417 + 408 418 #define UREG_CHICK (0xA05C00) 409 419 #define UREG_CHICK_MSI_ENABLE BIT(24) 410 420 #define UREG_CHICK_MSIX_ENABLE BIT(25) 421 + 422 + #define SD_REG_VER 0xa29600 423 + #define SD_REG_VER_GEN2 0x00a2b800 424 + 425 + #define REG_CRF_ID_TYPE_JF_1 0x201 426 + #define REG_CRF_ID_TYPE_JF_2 0x202 427 + #define REG_CRF_ID_TYPE_HR_CDB 0x503 428 + #define REG_CRF_ID_TYPE_HR_NONE_CDB 0x504 429 + #define REG_CRF_ID_TYPE_HR_NONE_CDB_1X1 0x501 430 + #define REG_CRF_ID_TYPE_HR_NONE_CDB_CCP 0x532 431 + #define REG_CRF_ID_TYPE_GF 0x410 432 + #define REG_CRF_ID_TYPE_GF_TC 0xF08 433 + #define REG_CRF_ID_TYPE_MR 0x810 434 + #define REG_CRF_ID_TYPE_FM 0x910 411 435 412 436 #define HPM_DEBUG 0xA03440 413 437 #define PERSISTENCE_BIT BIT(12)
+25 -5
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
··· 363 363 { .arr = x, .size = ARRAY_SIZE(x) } 364 364 365 365 /** 366 + * struct iwl_dump_sanitize_ops - dump sanitization operations 367 + * @frob_txf: Scrub the TX FIFO data 368 + * @frob_hcmd: Scrub a host command, the %hcmd pointer is to the header 369 + * but that might be short or long (&struct iwl_cmd_header or 370 + * &struct iwl_cmd_header_wide) 371 + * @frob_mem: Scrub memory data 372 + */ 373 + struct iwl_dump_sanitize_ops { 374 + void (*frob_txf)(void *ctx, void *buf, size_t buflen); 375 + void (*frob_hcmd)(void *ctx, void *hcmd, size_t buflen); 376 + void (*frob_mem)(void *ctx, u32 mem_addr, void *mem, size_t buflen); 377 + }; 378 + 379 + /** 366 380 * struct iwl_trans_config - transport configuration 367 381 * 368 382 * @op_mode: pointer to the upper layer. ··· 600 586 u32 value); 601 587 602 588 struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans, 603 - u32 dump_mask); 589 + u32 dump_mask, 590 + const struct iwl_dump_sanitize_ops *sanitize_ops, 591 + void *sanitize_ctx); 604 592 void (*debugfs_cleanup)(struct iwl_trans *trans); 605 593 void (*sync_nmi)(struct iwl_trans *trans); 606 594 int (*set_pnvm)(struct iwl_trans *trans, const void *data, u32 len); ··· 739 723 * @debug_info_tlv_list: list of debug info TLVs 740 724 * @time_point: array of debug time points 741 725 * @periodic_trig_list: periodic triggers list 742 - * @domains_bitmap: bitmap of active domains other than 743 - * &IWL_FW_INI_DOMAIN_ALWAYS_ON 726 + * @domains_bitmap: bitmap of active domains other than &IWL_FW_INI_DOMAIN_ALWAYS_ON 727 + * @ucode_preset: preset based on ucode 744 728 */ 745 729 struct iwl_trans_debug { 746 730 u8 n_dest_reg; ··· 774 758 struct list_head periodic_trig_list; 775 759 776 760 u32 domains_bitmap; 761 + u32 ucode_preset; 777 762 }; 778 763 779 764 struct iwl_dma_ptr { ··· 1103 1086 } 1104 1087 1105 1088 static inline struct iwl_trans_dump_data * 1106 - iwl_trans_dump_data(struct iwl_trans *trans, u32 dump_mask) 1089 + iwl_trans_dump_data(struct iwl_trans *trans, u32 dump_mask, 1090 + const struct iwl_dump_sanitize_ops *sanitize_ops, 1091 + void *sanitize_ctx) 1107 1092 { 1108 1093 if (!trans->ops->dump_data) 1109 1094 return NULL; 1110 - return trans->ops->dump_data(trans, dump_mask); 1095 + return trans->ops->dump_data(trans, dump_mask, 1096 + sanitize_ops, sanitize_ctx); 1111 1097 } 1112 1098 1113 1099 static inline struct iwl_device_tx_cmd *
+6 -13
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
··· 395 395 "A-MPDU size limit %d\n", 396 396 lq_sta->pers.dbg_agg_frame_count_lim); 397 397 desc += scnprintf(buff + desc, bufsz - desc, 398 - "valid_tx_ant %s%s%s\n", 398 + "valid_tx_ant %s%s\n", 399 399 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_A) ? "ANT_A," : "", 400 - (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : "", 401 - (iwl_mvm_get_valid_tx_ant(mvm) & ANT_C) ? "ANT_C" : ""); 400 + (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : ""); 402 401 desc += scnprintf(buff + desc, bufsz - desc, 403 402 "last tx rate=0x%X ", 404 403 lq_sta->last_rate_n_flags); ··· 985 986 continue; 986 987 pos += scnprintf(pos, endpos - pos, "Rate[%d]: ", 987 988 (int)(ARRAY_SIZE(stats->last_rates) - i)); 988 - pos += rs_pretty_print_rate(pos, endpos - pos, 989 - stats->last_rates[idx]); 989 + pos += rs_pretty_print_rate_v1(pos, endpos - pos, 990 + stats->last_rates[idx]); 990 991 if (pos < endpos - 1) 991 992 *pos++ = '\n'; 992 993 } ··· 1059 1060 pos += scnprintf(buf + pos, bufsz - pos, "A"); 1060 1061 if (mvm->scan_rx_ant & ANT_B) 1061 1062 pos += scnprintf(buf + pos, bufsz - pos, "B"); 1062 - if (mvm->scan_rx_ant & ANT_C) 1063 - pos += scnprintf(buf + pos, bufsz - pos, "C"); 1064 1063 pos += scnprintf(buf + pos, bufsz - pos, " (%hhx)\n", mvm->scan_rx_ant); 1065 1064 1066 1065 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); ··· 1193 1196 struct ieee80211_tx_info *info; 1194 1197 struct iwl_mac_beacon_cmd beacon_cmd = {}; 1195 1198 u8 rate; 1196 - u16 flags; 1197 1199 int i; 1198 1200 1199 1201 len /= 2; ··· 1239 1243 mvmvif = iwl_mvm_vif_from_mac80211(vif); 1240 1244 info = IEEE80211_SKB_CB(beacon); 1241 1245 rate = iwl_mvm_mac_ctxt_get_lowest_rate(info, vif); 1242 - flags = iwl_mvm_mac80211_idx_to_hwrate(rate); 1243 1246 1244 - if (rate == IWL_FIRST_CCK_RATE) 1245 - flags |= IWL_MAC_BEACON_CCK; 1246 - 1247 - beacon_cmd.flags = cpu_to_le16(flags); 1247 + beacon_cmd.flags = 1248 + cpu_to_le16(iwl_mvm_mac_ctxt_get_beacon_flags(mvm->fw, rate)); 1248 1249 beacon_cmd.byte_cnt = cpu_to_le16((u16)beacon->len); 1249 1250 beacon_cmd.template_id = cpu_to_le32((u32)mvmvif->id); 1250 1251
+14 -1
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
··· 324 324 u8 *ctrl_ch_position) 325 325 { 326 326 u32 freq = peer->chandef.chan->center_freq; 327 + u8 cmd_ver; 327 328 328 329 *channel = ieee80211_frequency_to_channel(freq); 329 330 ··· 345 344 *format_bw = IWL_LOCATION_FRAME_FORMAT_VHT; 346 345 *format_bw |= IWL_LOCATION_BW_80MHZ << LOCATION_BW_POS; 347 346 break; 347 + case NL80211_CHAN_WIDTH_160: 348 + cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, LOCATION_GROUP, 349 + TOF_RANGE_REQ_CMD, 350 + IWL_FW_CMD_VER_UNKNOWN); 351 + 352 + if (cmd_ver >= 13) { 353 + *format_bw = IWL_LOCATION_FRAME_FORMAT_HE; 354 + *format_bw |= IWL_LOCATION_BW_160MHZ << LOCATION_BW_POS; 355 + break; 356 + } 357 + fallthrough; 348 358 default: 349 359 IWL_ERR(mvm, "Unsupported BW in FTM request (%d)\n", 350 360 peer->chandef.width); ··· 1154 1142 static bool iwl_mvm_ftm_resp_size_validation(u8 ver, unsigned int pkt_len) 1155 1143 { 1156 1144 switch (ver) { 1145 + case 9: 1157 1146 case 8: 1158 1147 return pkt_len == sizeof(struct iwl_tof_range_rsp_ntfy_v8); 1159 1148 case 7: ··· 1218 1205 int peer_idx; 1219 1206 1220 1207 if (new_api) { 1221 - if (notif_ver == 8) { 1208 + if (notif_ver >= 8) { 1222 1209 fw_ap = &fw_resp_v8->ap[i]; 1223 1210 iwl_mvm_ftm_pasn_update_pn(mvm, fw_ap); 1224 1211 } else if (notif_ver == 7) {
+12 -3
drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
··· 46 46 } 47 47 48 48 static int iwl_mvm_ftm_responder_set_bw_v2(struct cfg80211_chan_def *chandef, 49 - u8 *format_bw, 50 - u8 *ctrl_ch_position) 49 + u8 *format_bw, u8 *ctrl_ch_position, 50 + u8 cmd_ver) 51 51 { 52 52 switch (chandef->width) { 53 53 case NL80211_CHAN_WIDTH_20_NOHT: ··· 68 68 *format_bw |= IWL_LOCATION_BW_80MHZ << LOCATION_BW_POS; 69 69 *ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef); 70 70 break; 71 + case NL80211_CHAN_WIDTH_160: 72 + if (cmd_ver >= 9) { 73 + *format_bw = IWL_LOCATION_FRAME_FORMAT_HE; 74 + *format_bw |= IWL_LOCATION_BW_160MHZ << LOCATION_BW_POS; 75 + *ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef); 76 + break; 77 + } 78 + fallthrough; 71 79 default: 72 80 return -ENOTSUPP; 73 81 } ··· 148 140 149 141 if (cmd_ver >= 7) 150 142 err = iwl_mvm_ftm_responder_set_bw_v2(chandef, &cmd.format_bw, 151 - &cmd.ctrl_ch_position); 143 + &cmd.ctrl_ch_position, 144 + cmd_ver); 152 145 else 153 146 err = iwl_mvm_ftm_responder_set_bw_v1(chandef, &cmd.format_bw, 154 147 &cmd.ctrl_ch_position);
+26 -10
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 295 295 if (ret) { 296 296 struct iwl_trans *trans = mvm->trans; 297 297 298 + /* SecBoot info */ 298 299 if (trans->trans_cfg->device_family >= 299 300 IWL_DEVICE_FAMILY_22000) { 300 301 IWL_ERR(mvm, ··· 303 302 iwl_read_umac_prph(trans, UMAG_SB_CPU_1_STATUS), 304 303 iwl_read_umac_prph(trans, 305 304 UMAG_SB_CPU_2_STATUS)); 305 + } else if (trans->trans_cfg->device_family >= 306 + IWL_DEVICE_FAMILY_8000) { 307 + IWL_ERR(mvm, 308 + "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", 309 + iwl_read_prph(trans, SB_CPU_1_STATUS), 310 + iwl_read_prph(trans, SB_CPU_2_STATUS)); 311 + } 312 + 313 + /* LMAC/UMAC PC info */ 314 + if (trans->trans_cfg->device_family >= 315 + IWL_DEVICE_FAMILY_9000) { 306 316 IWL_ERR(mvm, "UMAC PC: 0x%x\n", 307 317 iwl_read_umac_prph(trans, 308 318 UREG_UMAC_CURRENT_PC)); ··· 324 312 IWL_ERR(mvm, "LMAC2 PC: 0x%x\n", 325 313 iwl_read_umac_prph(trans, 326 314 UREG_LMAC2_CURRENT_PC)); 327 - } else if (trans->trans_cfg->device_family >= 328 - IWL_DEVICE_FAMILY_8000) { 329 - IWL_ERR(mvm, 330 - "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", 331 - iwl_read_prph(trans, SB_CPU_1_STATUS), 332 - iwl_read_prph(trans, SB_CPU_2_STATUS)); 333 315 } 334 316 335 317 if (ret == -ETIMEDOUT) ··· 1139 1133 { 1140 1134 int ret; 1141 1135 u32 value; 1142 - struct iwl_lari_config_change_cmd_v4 cmd = {}; 1136 + struct iwl_lari_config_change_cmd_v5 cmd = {}; 1143 1137 1144 1138 cmd.config_bitmap = iwl_acpi_get_lari_config_bitmap(&mvm->fwrt); 1145 1139 ··· 1155 1149 if (!ret) 1156 1150 cmd.oem_unii4_allow_bitmap = cpu_to_le32(value); 1157 1151 1152 + ret = iwl_acpi_get_dsm_u32((&mvm->fwrt)->dev, 0, 1153 + DSM_FUNC_ACTIVATE_CHANNEL, 1154 + &iwl_guid, &value); 1155 + if (!ret) 1156 + cmd.chan_state_active_bitmap = cpu_to_le32(value); 1157 + 1158 1158 if (cmd.config_bitmap || 1159 1159 cmd.oem_11ax_allow_bitmap || 1160 - cmd.oem_unii4_allow_bitmap) { 1160 + cmd.oem_unii4_allow_bitmap || 1161 + cmd.chan_state_active_bitmap) { 1161 1162 size_t cmd_size; 1162 1163 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, 1163 1164 REGULATORY_AND_NVM_GROUP, 1164 1165 LARI_CONFIG_CHANGE, 1); 1165 - if (cmd_ver == 4) 1166 + if (cmd_ver == 5) 1167 + cmd_size = sizeof(struct iwl_lari_config_change_cmd_v5); 1168 + else if (cmd_ver == 4) 1166 1169 cmd_size = sizeof(struct iwl_lari_config_change_cmd_v4); 1167 1170 else if (cmd_ver == 3) 1168 1171 cmd_size = sizeof(struct iwl_lari_config_change_cmd_v3); ··· 1185 1170 le32_to_cpu(cmd.config_bitmap), 1186 1171 le32_to_cpu(cmd.oem_11ax_allow_bitmap)); 1187 1172 IWL_DEBUG_RADIO(mvm, 1188 - "sending LARI_CONFIG_CHANGE, oem_unii4_allow_bitmap=0x%x, cmd_ver=%d\n", 1173 + "sending LARI_CONFIG_CHANGE, oem_unii4_allow_bitmap=0x%x, chan_state_active_bitmap=0x%x, cmd_ver=%d\n", 1189 1174 le32_to_cpu(cmd.oem_unii4_allow_bitmap), 1175 + le32_to_cpu(cmd.chan_state_active_bitmap), 1190 1176 cmd_ver); 1191 1177 ret = iwl_mvm_send_cmd_pdu(mvm, 1192 1178 WIDE_ID(REGULATORY_AND_NVM_GROUP,
+30 -8
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
··· 604 604 605 605 ctxt_sta->is_assoc = cpu_to_le32(1); 606 606 607 + if (!mvmvif->authorized && 608 + fw_has_capa(&mvm->fw->ucode_capa, 609 + IWL_UCODE_TLV_CAPA_COEX_HIGH_PRIO)) 610 + ctxt_sta->data_policy |= 611 + cpu_to_le32(COEX_HIGH_PRIORITY_ENABLE); 612 + 607 613 /* 608 614 * allow multicast data frames only as long as the station is 609 615 * authorized, i.e., GTK keys are already installed (if needed) ··· 818 812 return rate; 819 813 } 820 814 815 + u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, u8 rate_idx) 816 + { 817 + u16 flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx); 818 + bool is_new_rate = iwl_fw_lookup_cmd_ver(fw, 819 + LONG_GROUP, 820 + BEACON_TEMPLATE_CMD, 821 + 0) > 10; 822 + 823 + if (rate_idx <= IWL_FIRST_CCK_RATE) 824 + flags |= is_new_rate ? IWL_MAC_BEACON_CCK 825 + : IWL_MAC_BEACON_CCK_V1; 826 + 827 + return flags; 828 + } 829 + 821 830 static void iwl_mvm_mac_ctxt_set_tx(struct iwl_mvm *mvm, 822 831 struct ieee80211_vif *vif, 823 832 struct sk_buff *beacon, ··· 865 844 866 845 rate = iwl_mvm_mac_ctxt_get_lowest_rate(info, vif); 867 846 868 - tx->rate_n_flags |= cpu_to_le32(iwl_mvm_mac80211_idx_to_hwrate(rate)); 847 + tx->rate_n_flags |= 848 + cpu_to_le32(iwl_mvm_mac80211_idx_to_hwrate(mvm->fw, rate)); 869 849 if (rate == IWL_FIRST_CCK_RATE) 870 - tx->rate_n_flags |= cpu_to_le32(RATE_MCS_CCK_MSK); 850 + tx->rate_n_flags |= cpu_to_le32(RATE_MCS_CCK_MSK_V1); 871 851 872 852 } 873 853 ··· 951 929 u16 flags; 952 930 struct ieee80211_chanctx_conf *ctx; 953 931 int channel; 954 - 955 - flags = iwl_mvm_mac80211_idx_to_hwrate(rate); 956 - 957 - if (rate == IWL_FIRST_CCK_RATE) 958 - flags |= IWL_MAC_BEACON_CCK; 932 + flags = iwl_mvm_mac_ctxt_get_beacon_flags(mvm->fw, rate); 959 933 960 934 /* Enable FILS on PSC channels only */ 961 935 rcu_read_lock(); ··· 960 942 WARN_ON(channel == 0); 961 943 if (cfg80211_channel_is_psc(ctx->def.chan) && 962 944 !IWL_MVM_DISABLE_AP_FILS) { 963 - flags |= IWL_MAC_BEACON_FILS; 945 + flags |= iwl_fw_lookup_cmd_ver(mvm->fw, LONG_GROUP, 946 + BEACON_TEMPLATE_CMD, 947 + 0) > 10 ? 948 + IWL_MAC_BEACON_FILS : 949 + IWL_MAC_BEACON_FILS_V1; 964 950 beacon_cmd.short_ssid = 965 951 cpu_to_le32(~crc32_le(~0, vif->bss_conf.ssid, 966 952 vif->bss_conf.ssid_len));
+122 -82
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 145 145 .bandwidths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | 146 146 BIT(NL80211_CHAN_WIDTH_20) | 147 147 BIT(NL80211_CHAN_WIDTH_40) | 148 - BIT(NL80211_CHAN_WIDTH_80), 148 + BIT(NL80211_CHAN_WIDTH_80) | 149 + BIT(NL80211_CHAN_WIDTH_160), 149 150 .preambles = BIT(NL80211_PREAMBLE_LEGACY) | 150 151 BIT(NL80211_PREAMBLE_HT) | 151 152 BIT(NL80211_PREAMBLE_VHT) | ··· 2023 2022 } 2024 2023 2025 2024 sband = mvm->hw->wiphy->bands[chanctx_conf->def.chan->band]; 2026 - own_he_cap = ieee80211_get_he_iftype_cap(sband, vif->type); 2025 + own_he_cap = ieee80211_get_he_iftype_cap(sband, 2026 + ieee80211_vif_type_p2p(vif)); 2027 2027 2028 2028 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); 2029 2029 if (IS_ERR_OR_NULL(sta)) { ··· 3194 3192 if (iwl_mvm_phy_ctx_count(mvm) > 1) 3195 3193 iwl_mvm_teardown_tdls_peers(mvm); 3196 3194 3197 - if (sta->tdls) 3195 + if (sta->tdls) { 3198 3196 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, 3199 3197 NL80211_TDLS_ENABLE_LINK); 3198 + } else { 3199 + /* enable beacon filtering */ 3200 + WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); 3200 3201 3201 - /* enable beacon filtering */ 3202 - WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); 3202 + mvmvif->authorized = 1; 3203 3203 3204 - /* 3205 - * Now that the station is authorized, i.e., keys were already 3206 - * installed, need to indicate to the FW that 3207 - * multicast data frames can be forwarded to the driver 3208 - */ 3209 - iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 3204 + /* 3205 + * Now that the station is authorized, i.e., keys were already 3206 + * installed, need to indicate to the FW that 3207 + * multicast data frames can be forwarded to the driver 3208 + */ 3209 + iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 3210 + } 3210 3211 3211 3212 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, 3212 3213 true); 3213 3214 } else if (old_state == IEEE80211_STA_AUTHORIZED && 3214 3215 new_state == IEEE80211_STA_ASSOC) { 3215 - /* Multicast data frames are no longer allowed */ 3216 - iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 3216 + if (!sta->tdls) { 3217 + /* Multicast data frames are no longer allowed */ 3218 + iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 3217 3219 3218 - /* disable beacon filtering */ 3219 - ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); 3220 - WARN_ON(ret && 3221 - !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, 3222 - &mvm->status)); 3220 + /* 3221 + * Set this after the above iwl_mvm_mac_ctxt_changed() 3222 + * to avoid sending high prio again for a little time. 3223 + */ 3224 + mvmvif->authorized = 0; 3225 + 3226 + /* disable beacon filtering */ 3227 + ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); 3228 + WARN_ON(ret && 3229 + !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, 3230 + &mvm->status)); 3231 + } 3223 3232 ret = 0; 3224 3233 } else if (old_state == IEEE80211_STA_ASSOC && 3225 3234 new_state == IEEE80211_STA_AUTH) { ··· 3352 3339 else 3353 3340 iwl_mvm_protect_session(mvm, vif, duration, 3354 3341 min_duration, 500, false); 3342 + mutex_unlock(&mvm->mutex); 3343 + } 3344 + 3345 + static void iwl_mvm_mac_mgd_complete_tx(struct ieee80211_hw *hw, 3346 + struct ieee80211_vif *vif, 3347 + struct ieee80211_prep_tx_info *info) 3348 + { 3349 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 3350 + 3351 + /* for successful cases (auth/assoc), don't cancel session protection */ 3352 + if (info->success) 3353 + return; 3354 + 3355 + mutex_lock(&mvm->mutex); 3356 + iwl_mvm_stop_session_protection(mvm, vif); 3355 3357 mutex_unlock(&mvm->mutex); 3356 3358 } 3357 3359 ··· 4732 4704 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) 4733 4705 return; 4734 4706 4707 + IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d count = %d (old %d) mode = %d\n", 4708 + mvmvif->id, chsw->count, mvmvif->csa_count, chsw->block_tx); 4709 + 4735 4710 if (chsw->count >= mvmvif->csa_count && chsw->block_tx) { 4736 4711 if (mvmvif->csa_misbehave) { 4737 4712 /* Second time, give up on this AP*/ ··· 4751 4720 if (mvmvif->csa_failed) 4752 4721 goto out_unlock; 4753 4722 4754 - IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d count = %d mode = %d\n", 4755 - mvmvif->id, chsw->count, chsw->block_tx); 4756 4723 WARN_ON(iwl_mvm_send_cmd_pdu(mvm, 4757 4724 WIDE_ID(MAC_CONF_GROUP, 4758 4725 CHANNEL_SWITCH_TIME_EVENT_CMD), ··· 4902 4873 4903 4874 static void iwl_mvm_set_sta_rate(u32 rate_n_flags, struct rate_info *rinfo) 4904 4875 { 4876 + u32 format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK; 4877 + 4905 4878 switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { 4906 4879 case RATE_MCS_CHAN_WIDTH_20: 4907 4880 rinfo->bw = RATE_INFO_BW_20; ··· 4919 4888 break; 4920 4889 } 4921 4890 4922 - if (rate_n_flags & RATE_MCS_HT_MSK) { 4923 - rinfo->flags |= RATE_INFO_FLAGS_MCS; 4924 - rinfo->mcs = u32_get_bits(rate_n_flags, RATE_HT_MCS_INDEX_MSK); 4925 - rinfo->nss = u32_get_bits(rate_n_flags, 4926 - RATE_HT_MCS_NSS_MSK) + 1; 4927 - if (rate_n_flags & RATE_MCS_SGI_MSK) 4928 - rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 4929 - } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 4930 - rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS; 4931 - rinfo->mcs = u32_get_bits(rate_n_flags, 4932 - RATE_VHT_MCS_RATE_CODE_MSK); 4933 - rinfo->nss = u32_get_bits(rate_n_flags, 4934 - RATE_VHT_MCS_NSS_MSK) + 1; 4935 - if (rate_n_flags & RATE_MCS_SGI_MSK) 4936 - rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 4937 - } else if (rate_n_flags & RATE_MCS_HE_MSK) { 4891 + if (format == RATE_MCS_CCK_MSK || 4892 + format == RATE_MCS_LEGACY_OFDM_MSK) { 4893 + int rate = u32_get_bits(rate_n_flags, RATE_LEGACY_RATE_MSK); 4894 + 4895 + /* add the offset needed to get to the legacy ofdm indices */ 4896 + if (format == RATE_MCS_LEGACY_OFDM_MSK) 4897 + rate += IWL_FIRST_OFDM_RATE; 4898 + 4899 + switch (rate) { 4900 + case IWL_RATE_1M_INDEX: 4901 + rinfo->legacy = 10; 4902 + break; 4903 + case IWL_RATE_2M_INDEX: 4904 + rinfo->legacy = 20; 4905 + break; 4906 + case IWL_RATE_5M_INDEX: 4907 + rinfo->legacy = 55; 4908 + break; 4909 + case IWL_RATE_11M_INDEX: 4910 + rinfo->legacy = 110; 4911 + break; 4912 + case IWL_RATE_6M_INDEX: 4913 + rinfo->legacy = 60; 4914 + break; 4915 + case IWL_RATE_9M_INDEX: 4916 + rinfo->legacy = 90; 4917 + break; 4918 + case IWL_RATE_12M_INDEX: 4919 + rinfo->legacy = 120; 4920 + break; 4921 + case IWL_RATE_18M_INDEX: 4922 + rinfo->legacy = 180; 4923 + break; 4924 + case IWL_RATE_24M_INDEX: 4925 + rinfo->legacy = 240; 4926 + break; 4927 + case IWL_RATE_36M_INDEX: 4928 + rinfo->legacy = 360; 4929 + break; 4930 + case IWL_RATE_48M_INDEX: 4931 + rinfo->legacy = 480; 4932 + break; 4933 + case IWL_RATE_54M_INDEX: 4934 + rinfo->legacy = 540; 4935 + } 4936 + return; 4937 + } 4938 + 4939 + rinfo->nss = u32_get_bits(rate_n_flags, 4940 + RATE_MCS_NSS_MSK) + 1; 4941 + rinfo->mcs = format == RATE_MCS_HT_MSK ? 4942 + RATE_HT_MCS_INDEX(rate_n_flags) : 4943 + u32_get_bits(rate_n_flags, RATE_MCS_CODE_MSK); 4944 + 4945 + if (format == RATE_MCS_HE_MSK) { 4938 4946 u32 gi_ltf = u32_get_bits(rate_n_flags, 4939 4947 RATE_MCS_HE_GI_LTF_MSK); 4940 4948 4941 4949 rinfo->flags |= RATE_INFO_FLAGS_HE_MCS; 4942 - rinfo->mcs = u32_get_bits(rate_n_flags, 4943 - RATE_VHT_MCS_RATE_CODE_MSK); 4944 - rinfo->nss = u32_get_bits(rate_n_flags, 4945 - RATE_VHT_MCS_NSS_MSK) + 1; 4946 4950 4947 4951 if (rate_n_flags & RATE_MCS_HE_106T_MSK) { 4948 4952 rinfo->bw = RATE_INFO_BW_HE_RU; ··· 4991 4925 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; 4992 4926 else if (gi_ltf == 2) 4993 4927 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_1_6; 4994 - else if (rate_n_flags & RATE_MCS_SGI_MSK) 4995 - rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; 4996 - else 4928 + else if (gi_ltf == 3) 4997 4929 rinfo->he_gi = NL80211_RATE_INFO_HE_GI_3_2; 4930 + else 4931 + rinfo->he_gi = NL80211_RATE_INFO_HE_GI_0_8; 4998 4932 break; 4999 4933 case RATE_MCS_HE_TYPE_MU: 5000 4934 if (gi_ltf == 0 || gi_ltf == 1) ··· 5014 4948 5015 4949 if (rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK) 5016 4950 rinfo->he_dcm = 1; 5017 - } else { 5018 - switch (u32_get_bits(rate_n_flags, RATE_LEGACY_RATE_MSK)) { 5019 - case IWL_RATE_1M_PLCP: 5020 - rinfo->legacy = 10; 5021 - break; 5022 - case IWL_RATE_2M_PLCP: 5023 - rinfo->legacy = 20; 5024 - break; 5025 - case IWL_RATE_5M_PLCP: 5026 - rinfo->legacy = 55; 5027 - break; 5028 - case IWL_RATE_11M_PLCP: 5029 - rinfo->legacy = 110; 5030 - break; 5031 - case IWL_RATE_6M_PLCP: 5032 - rinfo->legacy = 60; 5033 - break; 5034 - case IWL_RATE_9M_PLCP: 5035 - rinfo->legacy = 90; 5036 - break; 5037 - case IWL_RATE_12M_PLCP: 5038 - rinfo->legacy = 120; 5039 - break; 5040 - case IWL_RATE_18M_PLCP: 5041 - rinfo->legacy = 180; 5042 - break; 5043 - case IWL_RATE_24M_PLCP: 5044 - rinfo->legacy = 240; 5045 - break; 5046 - case IWL_RATE_36M_PLCP: 5047 - rinfo->legacy = 360; 5048 - break; 5049 - case IWL_RATE_48M_PLCP: 5050 - rinfo->legacy = 480; 5051 - break; 5052 - case IWL_RATE_54M_PLCP: 5053 - rinfo->legacy = 540; 5054 - break; 5055 - } 4951 + return; 5056 4952 } 4953 + 4954 + if (rate_n_flags & RATE_MCS_SGI_MSK) 4955 + rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 4956 + 4957 + if (format == RATE_MCS_HT_MSK) { 4958 + rinfo->flags |= RATE_INFO_FLAGS_MCS; 4959 + 4960 + } else if (format == RATE_MCS_VHT_MSK) { 4961 + rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS; 4962 + } 4963 + 5057 4964 } 5058 4965 5059 4966 static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw, ··· 5371 5332 .sta_rc_update = iwl_mvm_sta_rc_update, 5372 5333 .conf_tx = iwl_mvm_mac_conf_tx, 5373 5334 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, 5335 + .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx, 5374 5336 .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, 5375 5337 .flush = iwl_mvm_mac_flush, 5376 5338 .sched_scan_start = iwl_mvm_mac_sched_scan_start,
+11 -2
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 297 297 * see enum &iwl_mvm_low_latency_cause for causes. 298 298 * @low_latency_actual: boolean, indicates low latency is set, 299 299 * as a result from low_latency bit flags and takes force into account. 300 + * @authorized: indicates the AP station was set to authorized 300 301 * @ps_disabled: indicates that this interface requires PS to be disabled 301 302 * @queue_params: QoS params for this MAC 302 303 * @bcast_sta: station used for broadcast packets. Used by the following ··· 331 330 bool monitor_active; 332 331 u8 low_latency: 6; 333 332 u8 low_latency_actual: 1; 333 + u8 authorized:1; 334 334 bool ps_disabled; 335 335 struct iwl_mvm_vif_bf_data bf_data; 336 336 ··· 1445 1443 int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm); 1446 1444 1447 1445 /* Utils */ 1446 + int iwl_mvm_legacy_hw_idx_to_mac80211_idx(u32 rate_n_flags, 1447 + enum nl80211_band band); 1448 1448 int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags, 1449 1449 enum nl80211_band band); 1450 1450 void iwl_mvm_hwrate_to_tx_rate(u32 rate_n_flags, 1451 1451 enum nl80211_band band, 1452 1452 struct ieee80211_tx_rate *r); 1453 - u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx); 1453 + void iwl_mvm_hwrate_to_tx_rate_v1(u32 rate_n_flags, 1454 + enum nl80211_band band, 1455 + struct ieee80211_tx_rate *r); 1456 + u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx); 1454 1457 u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac); 1455 1458 1456 1459 static inline void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) ··· 1636 1629 void *data, int len); 1637 1630 u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct ieee80211_tx_info *info, 1638 1631 struct ieee80211_vif *vif); 1632 + u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, 1633 + u8 rate_idx); 1639 1634 void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm, 1640 1635 __le32 *tim_index, __le32 *tim_size, 1641 1636 u8 *beacon, u32 frame_size); ··· 1741 1732 /* rate scaling */ 1742 1733 int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq); 1743 1734 void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg); 1744 - int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate); 1735 + int rs_pretty_print_rate_v1(char *buf, int bufsz, const u32 rate); 1745 1736 void rs_update_last_rssi(struct iwl_mvm *mvm, 1746 1737 struct iwl_mvm_sta *mvmsta, 1747 1738 struct ieee80211_rx_status *rx_status);
+180 -4
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 29 29 30 30 #define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux" 31 31 MODULE_DESCRIPTION(DRV_DESCRIPTION); 32 - MODULE_AUTHOR(DRV_AUTHOR); 33 32 MODULE_LICENSE("GPL"); 34 33 35 34 static const struct iwl_op_mode_ops iwl_mvm_ops; ··· 725 726 return 0; 726 727 } 727 728 729 + struct iwl_mvm_frob_txf_data { 730 + u8 *buf; 731 + size_t buflen; 732 + }; 733 + 734 + static void iwl_mvm_frob_txf_key_iter(struct ieee80211_hw *hw, 735 + struct ieee80211_vif *vif, 736 + struct ieee80211_sta *sta, 737 + struct ieee80211_key_conf *key, 738 + void *data) 739 + { 740 + struct iwl_mvm_frob_txf_data *txf = data; 741 + u8 keylen, match, matchend; 742 + u8 *keydata; 743 + size_t i; 744 + 745 + switch (key->cipher) { 746 + case WLAN_CIPHER_SUITE_CCMP: 747 + keydata = key->key; 748 + keylen = key->keylen; 749 + break; 750 + case WLAN_CIPHER_SUITE_WEP40: 751 + case WLAN_CIPHER_SUITE_WEP104: 752 + case WLAN_CIPHER_SUITE_TKIP: 753 + /* 754 + * WEP has short keys which might show up in the payload, 755 + * and then you can deduce the key, so in this case just 756 + * remove all FIFO data. 757 + * For TKIP, we don't know the phase 2 keys here, so same. 758 + */ 759 + memset(txf->buf, 0xBB, txf->buflen); 760 + return; 761 + default: 762 + return; 763 + } 764 + 765 + /* scan for key material and clear it out */ 766 + match = 0; 767 + for (i = 0; i < txf->buflen; i++) { 768 + if (txf->buf[i] != keydata[match]) { 769 + match = 0; 770 + continue; 771 + } 772 + match++; 773 + if (match == keylen) { 774 + memset(txf->buf + i - keylen, 0xAA, keylen); 775 + match = 0; 776 + } 777 + } 778 + 779 + /* we're dealing with a FIFO, so check wrapped around data */ 780 + matchend = match; 781 + for (i = 0; match && i < keylen - match; i++) { 782 + if (txf->buf[i] != keydata[match]) 783 + break; 784 + match++; 785 + if (match == keylen) { 786 + memset(txf->buf, 0xAA, i + 1); 787 + memset(txf->buf + txf->buflen - matchend, 0xAA, 788 + matchend); 789 + break; 790 + } 791 + } 792 + } 793 + 794 + static void iwl_mvm_frob_txf(void *ctx, void *buf, size_t buflen) 795 + { 796 + struct iwl_mvm_frob_txf_data txf = { 797 + .buf = buf, 798 + .buflen = buflen, 799 + }; 800 + struct iwl_mvm *mvm = ctx; 801 + 802 + /* embedded key material exists only on old API */ 803 + if (iwl_mvm_has_new_tx_api(mvm)) 804 + return; 805 + 806 + rcu_read_lock(); 807 + ieee80211_iter_keys_rcu(mvm->hw, NULL, iwl_mvm_frob_txf_key_iter, &txf); 808 + rcu_read_unlock(); 809 + } 810 + 811 + static void iwl_mvm_frob_hcmd(void *ctx, void *hcmd, size_t len) 812 + { 813 + /* we only use wide headers for commands */ 814 + struct iwl_cmd_header_wide *hdr = hcmd; 815 + unsigned int frob_start = sizeof(*hdr), frob_end = 0; 816 + 817 + if (len < sizeof(hdr)) 818 + return; 819 + 820 + /* all the commands we care about are in LONG_GROUP */ 821 + if (hdr->group_id != LONG_GROUP) 822 + return; 823 + 824 + switch (hdr->cmd) { 825 + case WEP_KEY: 826 + case WOWLAN_TKIP_PARAM: 827 + case WOWLAN_KEK_KCK_MATERIAL: 828 + case ADD_STA_KEY: 829 + /* 830 + * blank out everything here, easier than dealing 831 + * with the various versions of the command 832 + */ 833 + frob_end = INT_MAX; 834 + break; 835 + case MGMT_MCAST_KEY: 836 + frob_start = offsetof(struct iwl_mvm_mgmt_mcast_key_cmd, igtk); 837 + BUILD_BUG_ON(offsetof(struct iwl_mvm_mgmt_mcast_key_cmd, igtk) != 838 + offsetof(struct iwl_mvm_mgmt_mcast_key_cmd_v1, igtk)); 839 + 840 + frob_end = offsetofend(struct iwl_mvm_mgmt_mcast_key_cmd, igtk); 841 + BUILD_BUG_ON(offsetof(struct iwl_mvm_mgmt_mcast_key_cmd, igtk) < 842 + offsetof(struct iwl_mvm_mgmt_mcast_key_cmd_v1, igtk)); 843 + break; 844 + } 845 + 846 + if (frob_start >= frob_end) 847 + return; 848 + 849 + if (frob_end > len) 850 + frob_end = len; 851 + 852 + memset((u8 *)hcmd + frob_start, 0xAA, frob_end - frob_start); 853 + } 854 + 855 + static void iwl_mvm_frob_mem(void *ctx, u32 mem_addr, void *mem, size_t buflen) 856 + { 857 + const struct iwl_dump_exclude *excl; 858 + struct iwl_mvm *mvm = ctx; 859 + int i; 860 + 861 + switch (mvm->fwrt.cur_fw_img) { 862 + case IWL_UCODE_INIT: 863 + default: 864 + /* not relevant */ 865 + return; 866 + case IWL_UCODE_REGULAR: 867 + case IWL_UCODE_REGULAR_USNIFFER: 868 + excl = mvm->fw->dump_excl; 869 + break; 870 + case IWL_UCODE_WOWLAN: 871 + excl = mvm->fw->dump_excl_wowlan; 872 + break; 873 + } 874 + 875 + BUILD_BUG_ON(sizeof(mvm->fw->dump_excl) != 876 + sizeof(mvm->fw->dump_excl_wowlan)); 877 + 878 + for (i = 0; i < ARRAY_SIZE(mvm->fw->dump_excl); i++) { 879 + u32 start, end; 880 + 881 + if (!excl[i].addr || !excl[i].size) 882 + continue; 883 + 884 + start = excl[i].addr; 885 + end = start + excl[i].size; 886 + 887 + if (end <= mem_addr || start >= mem_addr + buflen) 888 + continue; 889 + 890 + if (start < mem_addr) 891 + start = mem_addr; 892 + 893 + if (end > mem_addr + buflen) 894 + end = mem_addr + buflen; 895 + 896 + memset((u8 *)mem + start - mem_addr, 0xAA, end - start); 897 + } 898 + } 899 + 900 + static const struct iwl_dump_sanitize_ops iwl_mvm_sanitize_ops = { 901 + .frob_txf = iwl_mvm_frob_txf, 902 + .frob_hcmd = iwl_mvm_frob_hcmd, 903 + .frob_mem = iwl_mvm_frob_mem, 904 + }; 905 + 728 906 static struct iwl_op_mode * 729 907 iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, 730 908 const struct iwl_fw *fw, struct dentry *dbgfs_dir) ··· 951 775 mvm->hw = hw; 952 776 953 777 iwl_fw_runtime_init(&mvm->fwrt, trans, fw, &iwl_mvm_fwrt_ops, mvm, 954 - dbgfs_dir); 778 + &iwl_mvm_sanitize_ops, mvm, dbgfs_dir); 955 779 956 780 iwl_mvm_get_acpi_tables(mvm); 957 781 ··· 1044 868 mvm->cmd_ver.range_resp = 1045 869 iwl_fw_lookup_notif_ver(mvm->fw, LOCATION_GROUP, 1046 870 TOF_RANGE_RESPONSE_NOTIF, 5); 1047 - /* we only support up to version 8 */ 1048 - if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 8)) 871 + /* we only support up to version 9 */ 872 + if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 9)) 1049 873 goto out_free; 1050 874 1051 875 /*
+14 -14
drivers/net/wireless/intel/iwlwifi/mvm/power.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 - * Copyright (C) 2012-2014, 2018-2019 Intel Corporation 3 + * Copyright (C) 2012-2014, 2018-2019, 2021 Intel Corporation 4 4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH 5 5 * Copyright (C) 2015-2017 Intel Deutschland GmbH 6 6 */ ··· 128 128 enum ieee80211_ac_numbers ac; 129 129 bool tid_found = false; 130 130 131 + if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) || 132 + cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { 133 + cmd->rx_data_timeout_uapsd = 134 + cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT); 135 + cmd->tx_data_timeout_uapsd = 136 + cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT); 137 + } else { 138 + cmd->rx_data_timeout_uapsd = 139 + cpu_to_le32(IWL_MVM_UAPSD_RX_DATA_TIMEOUT); 140 + cmd->tx_data_timeout_uapsd = 141 + cpu_to_le32(IWL_MVM_UAPSD_TX_DATA_TIMEOUT); 142 + } 143 + 131 144 #ifdef CONFIG_IWLWIFI_DEBUGFS 132 145 /* set advanced pm flag with no uapsd ACs to enable ps-poll */ 133 146 if (mvmvif->dbgfs_pm.use_ps_poll) { ··· 194 181 } 195 182 196 183 cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len; 197 - 198 - if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) || 199 - cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { 200 - cmd->rx_data_timeout_uapsd = 201 - cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT); 202 - cmd->tx_data_timeout_uapsd = 203 - cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT); 204 - } else { 205 - cmd->rx_data_timeout_uapsd = 206 - cpu_to_le32(IWL_MVM_UAPSD_RX_DATA_TIMEOUT); 207 - cmd->tx_data_timeout_uapsd = 208 - cpu_to_le32(IWL_MVM_UAPSD_TX_DATA_TIMEOUT); 209 - } 210 184 211 185 if (cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { 212 186 cmd->heavy_tx_thld_packets =
+12 -4
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
··· 32 32 fw_chains |= IWL_TLC_MNG_CHAIN_A_MSK; 33 33 if (chains & ANT_B) 34 34 fw_chains |= IWL_TLC_MNG_CHAIN_B_MSK; 35 - if (chains & ANT_C) 36 - WARN(false, 37 - "tlc offload doesn't support antenna C. chains: 0x%x\n", 38 - chains); 39 35 40 36 return fw_chains; 41 37 } ··· 310 314 311 315 if (flags & IWL_TLC_NOTIF_FLAG_RATE) { 312 316 char pretty_rate[100]; 317 + 318 + if (iwl_fw_lookup_notif_ver(mvm->fw, DATA_PATH_GROUP, 319 + TLC_MNG_UPDATE_NOTIF, 0) < 3) { 320 + rs_pretty_print_rate_v1(pretty_rate, sizeof(pretty_rate), 321 + le32_to_cpu(notif->rate)); 322 + IWL_DEBUG_RATE(mvm, 323 + "Got rate in old format. Rate: %s. Converting.\n", 324 + pretty_rate); 325 + lq_sta->last_rate_n_flags = 326 + iwl_new_rate_from_v1(le32_to_cpu(notif->rate)); 327 + } else { 313 328 lq_sta->last_rate_n_flags = le32_to_cpu(notif->rate); 329 + } 314 330 rs_pretty_print_rate(pretty_rate, sizeof(pretty_rate), 315 331 lq_sta->last_rate_n_flags); 316 332 IWL_DEBUG_RATE(mvm, "new rate: %s\n", pretty_rate);
+60 -122
drivers/net/wireless/intel/iwlwifi/mvm/rs.c
··· 4 4 * Copyright(c) 2005 - 2014, 2018 - 2021 Intel Corporation. All rights reserved. 5 5 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 6 6 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 7 - * 8 - * Contact Information: 9 - * Intel Linux Wireless <linuxwifi@intel.com> 10 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 11 - * 12 7 *****************************************************************************/ 13 8 #include <linux/kernel.h> 14 9 #include <linux/skbuff.h> ··· 330 335 static inline u8 rs_extract_rate(u32 rate_n_flags) 331 336 { 332 337 /* also works for HT because bits 7:6 are zero there */ 333 - return (u8)(rate_n_flags & RATE_LEGACY_RATE_MSK); 338 + return (u8)(rate_n_flags & RATE_LEGACY_RATE_MSK_V1); 334 339 } 335 340 336 341 static int iwl_hwrate_to_plcp_idx(u32 rate_n_flags) 337 342 { 338 343 int idx = 0; 339 344 340 - if (rate_n_flags & RATE_MCS_HT_MSK) { 341 - idx = rate_n_flags & RATE_HT_MCS_RATE_CODE_MSK; 345 + if (rate_n_flags & RATE_MCS_HT_MSK_V1) { 346 + idx = rate_n_flags & RATE_HT_MCS_RATE_CODE_MSK_V1; 342 347 idx += IWL_RATE_MCS_0_INDEX; 343 348 344 349 /* skip 9M not supported in HT*/ ··· 346 351 idx += 1; 347 352 if ((idx >= IWL_FIRST_HT_RATE) && (idx <= IWL_LAST_HT_RATE)) 348 353 return idx; 349 - } else if (rate_n_flags & RATE_MCS_VHT_MSK || 350 - rate_n_flags & RATE_MCS_HE_MSK) { 354 + } else if (rate_n_flags & RATE_MCS_VHT_MSK_V1 || 355 + rate_n_flags & RATE_MCS_HE_MSK_V1) { 351 356 idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; 352 357 idx += IWL_RATE_MCS_0_INDEX; 353 358 ··· 356 361 idx++; 357 362 if ((idx >= IWL_FIRST_VHT_RATE) && (idx <= IWL_LAST_VHT_RATE)) 358 363 return idx; 359 - if ((rate_n_flags & RATE_MCS_HE_MSK) && 360 - (idx <= IWL_LAST_HE_RATE)) 364 + if ((rate_n_flags & RATE_MCS_HE_MSK_V1) && 365 + idx <= IWL_LAST_HE_RATE) 361 366 return idx; 362 367 } else { 363 368 /* legacy rate format, search for match in table */ ··· 454 459 {0, 0, 0, 0, 971, 0, 1925, 2861, 3779, 5574, 7304, 8147, 8976, 10592, 11640}, 455 460 }; 456 461 457 - /* mbps, mcs */ 458 - static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = { 459 - { "1", "BPSK DSSS"}, 460 - { "2", "QPSK DSSS"}, 461 - {"5.5", "BPSK CCK"}, 462 - { "11", "QPSK CCK"}, 463 - { "6", "BPSK 1/2"}, 464 - { "9", "BPSK 1/2"}, 465 - { "12", "QPSK 1/2"}, 466 - { "18", "QPSK 3/4"}, 467 - { "24", "16QAM 1/2"}, 468 - { "36", "16QAM 3/4"}, 469 - { "48", "64QAM 2/3"}, 470 - { "54", "64QAM 3/4"}, 471 - { "60", "64QAM 5/6"}, 472 - }; 473 - 474 462 #define MCS_INDEX_PER_STREAM (8) 475 - 476 - static const char *rs_pretty_ant(u8 ant) 477 - { 478 - static const char * const ant_name[] = { 479 - [ANT_NONE] = "None", 480 - [ANT_A] = "A", 481 - [ANT_B] = "B", 482 - [ANT_AB] = "AB", 483 - [ANT_C] = "C", 484 - [ANT_AC] = "AC", 485 - [ANT_BC] = "BC", 486 - [ANT_ABC] = "ABC", 487 - }; 488 - 489 - if (ant > ANT_ABC) 490 - return "UNKNOWN"; 491 - 492 - return ant_name[ant]; 493 - } 494 463 495 464 static const char *rs_pretty_lq_type(enum iwl_table_type type) 496 465 { ··· 517 558 rate_str = "BAD_RATE"; 518 559 519 560 sprintf(buf, "(%s|%s|%s)", rs_pretty_lq_type(rate->type), 520 - rs_pretty_ant(rate->ant), rate_str); 561 + iwl_rs_pretty_ant(rate->ant), rate_str); 521 562 return buf; 522 563 } 523 564 ··· 613 654 static inline int get_num_of_ant_from_rate(u32 rate_n_flags) 614 655 { 615 656 return !!(rate_n_flags & RATE_MCS_ANT_A_MSK) + 616 - !!(rate_n_flags & RATE_MCS_ANT_B_MSK) + 617 - !!(rate_n_flags & RATE_MCS_ANT_C_MSK); 657 + !!(rate_n_flags & RATE_MCS_ANT_B_MSK); 618 658 } 619 659 620 660 /* ··· 778 820 int index = rate->index; 779 821 780 822 ucode_rate |= ((rate->ant << RATE_MCS_ANT_POS) & 781 - RATE_MCS_ANT_ABC_MSK); 823 + RATE_MCS_ANT_AB_MSK); 782 824 783 825 if (is_legacy(rate)) { 784 826 ucode_rate |= iwl_rates[index].plcp; 785 827 if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE) 786 - ucode_rate |= RATE_MCS_CCK_MSK; 828 + ucode_rate |= RATE_MCS_CCK_MSK_V1; 787 829 return ucode_rate; 788 830 } 789 831 ··· 798 840 IWL_ERR(mvm, "Invalid HT rate index %d\n", index); 799 841 index = IWL_LAST_HT_RATE; 800 842 } 801 - ucode_rate |= RATE_MCS_HT_MSK; 843 + ucode_rate |= RATE_MCS_HT_MSK_V1; 802 844 803 845 if (is_ht_siso(rate)) 804 846 ucode_rate |= iwl_rates[index].plcp_ht_siso; ··· 811 853 IWL_ERR(mvm, "Invalid VHT rate index %d\n", index); 812 854 index = IWL_LAST_VHT_RATE; 813 855 } 814 - ucode_rate |= RATE_MCS_VHT_MSK; 856 + ucode_rate |= RATE_MCS_VHT_MSK_V1; 815 857 if (is_vht_siso(rate)) 816 858 ucode_rate |= iwl_rates[index].plcp_vht_siso; 817 859 else if (is_vht_mimo2(rate)) ··· 831 873 832 874 ucode_rate |= rate->bw; 833 875 if (rate->sgi) 834 - ucode_rate |= RATE_MCS_SGI_MSK; 876 + ucode_rate |= RATE_MCS_SGI_MSK_V1; 835 877 if (rate->ldpc) 836 - ucode_rate |= RATE_MCS_LDPC_MSK; 878 + ucode_rate |= RATE_MCS_LDPC_MSK_V1; 837 879 838 880 return ucode_rate; 839 881 } ··· 843 885 enum nl80211_band band, 844 886 struct rs_rate *rate) 845 887 { 846 - u32 ant_msk = ucode_rate & RATE_MCS_ANT_ABC_MSK; 888 + u32 ant_msk = ucode_rate & RATE_MCS_ANT_AB_MSK; 847 889 u8 num_of_ant = get_num_of_ant_from_rate(ucode_rate); 848 890 u8 nss; 849 891 ··· 856 898 rate->ant = (ant_msk >> RATE_MCS_ANT_POS); 857 899 858 900 /* Legacy */ 859 - if (!(ucode_rate & RATE_MCS_HT_MSK) && 860 - !(ucode_rate & RATE_MCS_VHT_MSK) && 861 - !(ucode_rate & RATE_MCS_HE_MSK)) { 901 + if (!(ucode_rate & RATE_MCS_HT_MSK_V1) && 902 + !(ucode_rate & RATE_MCS_VHT_MSK_V1) && 903 + !(ucode_rate & RATE_MCS_HE_MSK_V1)) { 862 904 if (num_of_ant == 1) { 863 905 if (band == NL80211_BAND_5GHZ) 864 906 rate->type = LQ_LEGACY_A; ··· 870 912 } 871 913 872 914 /* HT, VHT or HE */ 873 - if (ucode_rate & RATE_MCS_SGI_MSK) 915 + if (ucode_rate & RATE_MCS_SGI_MSK_V1) 874 916 rate->sgi = true; 875 - if (ucode_rate & RATE_MCS_LDPC_MSK) 917 + if (ucode_rate & RATE_MCS_LDPC_MSK_V1) 876 918 rate->ldpc = true; 877 919 if (ucode_rate & RATE_MCS_STBC_MSK) 878 920 rate->stbc = true; 879 921 if (ucode_rate & RATE_MCS_BF_MSK) 880 922 rate->bfer = true; 881 923 882 - rate->bw = ucode_rate & RATE_MCS_CHAN_WIDTH_MSK; 924 + rate->bw = ucode_rate & RATE_MCS_CHAN_WIDTH_MSK_V1; 883 925 884 - if (ucode_rate & RATE_MCS_HT_MSK) { 885 - nss = ((ucode_rate & RATE_HT_MCS_NSS_MSK) >> 886 - RATE_HT_MCS_NSS_POS) + 1; 926 + if (ucode_rate & RATE_MCS_HT_MSK_V1) { 927 + nss = ((ucode_rate & RATE_HT_MCS_NSS_MSK_V1) >> 928 + RATE_HT_MCS_NSS_POS_V1) + 1; 887 929 888 930 if (nss == 1) { 889 931 rate->type = LQ_HT_SISO; ··· 896 938 } else { 897 939 WARN_ON_ONCE(1); 898 940 } 899 - } else if (ucode_rate & RATE_MCS_VHT_MSK) { 941 + } else if (ucode_rate & RATE_MCS_VHT_MSK_V1) { 900 942 nss = ((ucode_rate & RATE_VHT_MCS_NSS_MSK) >> 901 943 RATE_VHT_MCS_NSS_POS) + 1; 902 944 ··· 911 953 } else { 912 954 WARN_ON_ONCE(1); 913 955 } 914 - } else if (ucode_rate & RATE_MCS_HE_MSK) { 956 + } else if (ucode_rate & RATE_MCS_HE_MSK_V1) { 915 957 nss = ((ucode_rate & RATE_VHT_MCS_NSS_MSK) >> 916 958 RATE_VHT_MCS_NSS_POS) + 1; 917 959 ··· 938 980 static int rs_toggle_antenna(u32 valid_ant, struct rs_rate *rate) 939 981 { 940 982 u8 new_ant_type; 941 - 942 - if (!rate->ant || WARN_ON_ONCE(rate->ant & ANT_C)) 943 - return 0; 944 983 945 984 if (!rs_is_valid_ant(valid_ant, rate->ant)) 946 985 return 0; ··· 2507 2552 } 2508 2553 2509 2554 IWL_DEBUG_RATE(mvm, "Best ANT: %s Best RSSI: %d\n", 2510 - rs_pretty_ant(best_ant), best_rssi); 2555 + iwl_rs_pretty_ant(best_ant), best_rssi); 2511 2556 2512 2557 if (best_ant != ANT_A && best_ant != ANT_B) 2513 2558 rate->ant = first_antenna(valid_tx_ant); ··· 2607 2652 lq_sta->pers.chains = rx_status->chains; 2608 2653 lq_sta->pers.chain_signal[0] = rx_status->chain_signal[0]; 2609 2654 lq_sta->pers.chain_signal[1] = rx_status->chain_signal[1]; 2610 - lq_sta->pers.chain_signal[2] = rx_status->chain_signal[2]; 2611 2655 lq_sta->pers.last_rssi = S8_MIN; 2612 2656 2613 2657 for (i = 0; i < ARRAY_SIZE(lq_sta->pers.chain_signal); i++) { ··· 2692 2738 return; 2693 2739 2694 2740 lq_sta = mvm_sta; 2695 - iwl_mvm_hwrate_to_tx_rate(lq_sta->last_rate_n_flags, 2696 - info->band, &info->control.rates[0]); 2741 + iwl_mvm_hwrate_to_tx_rate_v1(lq_sta->last_rate_n_flags, 2742 + info->band, &info->control.rates[0]); 2697 2743 info->control.rates[0].count = 1; 2698 2744 2699 2745 /* Report the optimal rate based on rssi and STA caps if we haven't ··· 2703 2749 optimal_rate = rs_get_optimal_rate(mvm, lq_sta); 2704 2750 last_ucode_rate = ucode_rate_from_rs_rate(mvm, 2705 2751 optimal_rate); 2706 - iwl_mvm_hwrate_to_tx_rate(last_ucode_rate, info->band, 2707 - &txrc->reported_rate); 2752 + iwl_mvm_hwrate_to_tx_rate_v1(last_ucode_rate, info->band, 2753 + &txrc->reported_rate); 2708 2754 } 2709 2755 } 2710 2756 ··· 2863 2909 2864 2910 mvm->drv_rx_stats.success_frames++; 2865 2911 2866 - switch (rate & RATE_MCS_CHAN_WIDTH_MSK) { 2912 + switch (rate & RATE_MCS_CHAN_WIDTH_MSK_V1) { 2867 2913 case RATE_MCS_CHAN_WIDTH_20: 2868 2914 mvm->drv_rx_stats.bw_20_frames++; 2869 2915 break; ··· 2880 2926 WARN_ONCE(1, "bad BW. rate 0x%x", rate); 2881 2927 } 2882 2928 2883 - if (rate & RATE_MCS_HT_MSK) { 2929 + if (rate & RATE_MCS_HT_MSK_V1) { 2884 2930 mvm->drv_rx_stats.ht_frames++; 2885 - nss = ((rate & RATE_HT_MCS_NSS_MSK) >> RATE_HT_MCS_NSS_POS) + 1; 2886 - } else if (rate & RATE_MCS_VHT_MSK) { 2931 + nss = ((rate & RATE_HT_MCS_NSS_MSK_V1) >> RATE_HT_MCS_NSS_POS_V1) + 1; 2932 + } else if (rate & RATE_MCS_VHT_MSK_V1) { 2887 2933 mvm->drv_rx_stats.vht_frames++; 2888 2934 nss = ((rate & RATE_VHT_MCS_NSS_MSK) >> 2889 2935 RATE_VHT_MCS_NSS_POS) + 1; ··· 2896 2942 else if (nss == 2) 2897 2943 mvm->drv_rx_stats.mimo2_frames++; 2898 2944 2899 - if (rate & RATE_MCS_SGI_MSK) 2945 + if (rate & RATE_MCS_SGI_MSK_V1) 2900 2946 mvm->drv_rx_stats.sgi_frames++; 2901 2947 else 2902 2948 mvm->drv_rx_stats.ngi_frames++; ··· 3277 3323 int i; 3278 3324 int num_rates = ARRAY_SIZE(lq_cmd->rs_table); 3279 3325 __le32 ucode_rate_le32 = cpu_to_le32(ucode_rate); 3280 - u8 ant = (ucode_rate & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS; 3326 + u8 ant = (ucode_rate & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 3281 3327 3282 3328 for (i = 0; i < num_rates; i++) 3283 3329 lq_cmd->rs_table[i] = ucode_rate_le32; ··· 3642 3688 IWL_DEBUG_RATE(mvm, "leave\n"); 3643 3689 } 3644 3690 3645 - int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate) 3691 + int rs_pretty_print_rate_v1(char *buf, int bufsz, const u32 rate) 3646 3692 { 3647 3693 3648 - char *type, *bw; 3694 + char *type; 3649 3695 u8 mcs = 0, nss = 0; 3650 - u8 ant = (rate & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS; 3696 + u8 ant = (rate & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 3697 + u32 bw = (rate & RATE_MCS_CHAN_WIDTH_MSK_V1) >> 3698 + RATE_MCS_CHAN_WIDTH_POS; 3651 3699 3652 - if (!(rate & RATE_MCS_HT_MSK) && 3653 - !(rate & RATE_MCS_VHT_MSK) && 3654 - !(rate & RATE_MCS_HE_MSK)) { 3700 + if (!(rate & RATE_MCS_HT_MSK_V1) && 3701 + !(rate & RATE_MCS_VHT_MSK_V1) && 3702 + !(rate & RATE_MCS_HE_MSK_V1)) { 3655 3703 int index = iwl_hwrate_to_plcp_idx(rate); 3656 3704 3657 3705 return scnprintf(buf, bufsz, "Legacy | ANT: %s Rate: %s Mbps", 3658 - rs_pretty_ant(ant), 3706 + iwl_rs_pretty_ant(ant), 3659 3707 index == IWL_RATE_INVALID ? "BAD" : 3660 - iwl_rate_mcs[index].mbps); 3708 + iwl_rate_mcs(index)->mbps); 3661 3709 } 3662 3710 3663 - if (rate & RATE_MCS_VHT_MSK) { 3711 + if (rate & RATE_MCS_VHT_MSK_V1) { 3664 3712 type = "VHT"; 3665 3713 mcs = rate & RATE_VHT_MCS_RATE_CODE_MSK; 3666 3714 nss = ((rate & RATE_VHT_MCS_NSS_MSK) 3667 3715 >> RATE_VHT_MCS_NSS_POS) + 1; 3668 - } else if (rate & RATE_MCS_HT_MSK) { 3716 + } else if (rate & RATE_MCS_HT_MSK_V1) { 3669 3717 type = "HT"; 3670 - mcs = rate & RATE_HT_MCS_INDEX_MSK; 3671 - nss = ((rate & RATE_HT_MCS_NSS_MSK) 3672 - >> RATE_HT_MCS_NSS_POS) + 1; 3673 - } else if (rate & RATE_MCS_HE_MSK) { 3718 + mcs = rate & RATE_HT_MCS_INDEX_MSK_V1; 3719 + nss = ((rate & RATE_HT_MCS_NSS_MSK_V1) 3720 + >> RATE_HT_MCS_NSS_POS_V1) + 1; 3721 + } else if (rate & RATE_MCS_HE_MSK_V1) { 3674 3722 type = "HE"; 3675 3723 mcs = rate & RATE_VHT_MCS_RATE_CODE_MSK; 3676 3724 nss = ((rate & RATE_VHT_MCS_NSS_MSK) ··· 3681 3725 type = "Unknown"; /* shouldn't happen */ 3682 3726 } 3683 3727 3684 - switch (rate & RATE_MCS_CHAN_WIDTH_MSK) { 3685 - case RATE_MCS_CHAN_WIDTH_20: 3686 - bw = "20Mhz"; 3687 - break; 3688 - case RATE_MCS_CHAN_WIDTH_40: 3689 - bw = "40Mhz"; 3690 - break; 3691 - case RATE_MCS_CHAN_WIDTH_80: 3692 - bw = "80Mhz"; 3693 - break; 3694 - case RATE_MCS_CHAN_WIDTH_160: 3695 - bw = "160Mhz"; 3696 - break; 3697 - default: 3698 - bw = "BAD BW"; 3699 - } 3700 - 3701 3728 return scnprintf(buf, bufsz, 3702 3729 "0x%x: %s | ANT: %s BW: %s MCS: %d NSS: %d %s%s%s%s%s", 3703 - rate, type, rs_pretty_ant(ant), bw, mcs, nss, 3704 - (rate & RATE_MCS_SGI_MSK) ? "SGI " : "NGI ", 3730 + rate, type, iwl_rs_pretty_ant(ant), iwl_rs_pretty_bw(bw), mcs, nss, 3731 + (rate & RATE_MCS_SGI_MSK_V1) ? "SGI " : "NGI ", 3705 3732 (rate & RATE_MCS_STBC_MSK) ? "STBC " : "", 3706 - (rate & RATE_MCS_LDPC_MSK) ? "LDPC " : "", 3733 + (rate & RATE_MCS_LDPC_MSK_V1) ? "LDPC " : "", 3707 3734 (rate & RATE_HE_DUAL_CARRIER_MODE_MSK) ? "DCM " : "", 3708 3735 (rate & RATE_MCS_BF_MSK) ? "BF " : ""); 3709 3736 } ··· 3769 3830 lq_sta->active_legacy_rate); 3770 3831 desc += scnprintf(buff + desc, bufsz - desc, "fixed rate 0x%X\n", 3771 3832 lq_sta->pers.dbg_fixed_rate); 3772 - desc += scnprintf(buff + desc, bufsz - desc, "valid_tx_ant %s%s%s\n", 3833 + desc += scnprintf(buff + desc, bufsz - desc, "valid_tx_ant %s%s\n", 3773 3834 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_A) ? "ANT_A," : "", 3774 - (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : "", 3775 - (iwl_mvm_get_valid_tx_ant(mvm) & ANT_C) ? "ANT_C" : ""); 3835 + (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : ""); 3776 3836 desc += scnprintf(buff + desc, bufsz - desc, "lq type %s\n", 3777 3837 (is_legacy(rate)) ? "legacy" : 3778 3838 is_vht(rate) ? "VHT" : "HT"); ··· 3829 3891 3830 3892 desc += scnprintf(buff + desc, bufsz - desc, 3831 3893 " rate[%d] 0x%X ", i, r); 3832 - desc += rs_pretty_print_rate(buff + desc, bufsz - desc, r); 3894 + desc += rs_pretty_print_rate_v1(buff + desc, bufsz - desc, r); 3833 3895 if (desc < bufsz - 1) 3834 3896 buff[desc++] = '\n'; 3835 3897 }
-17
drivers/net/wireless/intel/iwlwifi/mvm/rs.h
··· 5 5 * Copyright(c) 2015 Intel Mobile Communications GmbH 6 6 * Copyright(c) 2017 Intel Deutschland GmbH 7 7 * Copyright(c) 2018 - 2019 Intel Corporation 8 - * 9 - * Contact Information: 10 - * Intel Linux Wireless <linuxwifi@intel.com> 11 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 12 - * 13 8 *****************************************************************************/ 14 9 15 10 #ifndef __rs_h__ ··· 30 35 }; 31 36 32 37 #define IWL_RATE_60M_PLCP 3 33 - 34 - enum { 35 - IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, 36 - IWL_RATE_INVALID = IWL_RATE_COUNT, 37 - }; 38 38 39 39 #define LINK_QUAL_MAX_RETRY_NUM 16 40 40 ··· 200 210 #define is_ht40(rate) ((rate)->bw == RATE_MCS_CHAN_WIDTH_40) 201 211 #define is_ht80(rate) ((rate)->bw == RATE_MCS_CHAN_WIDTH_80) 202 212 #define is_ht160(rate) ((rate)->bw == RATE_MCS_CHAN_WIDTH_160) 203 - 204 - #define IWL_MAX_MCS_DISPLAY_SIZE 12 205 - 206 - struct iwl_rate_mcs_info { 207 - char mbps[IWL_MAX_MCS_DISPLAY_SIZE]; 208 - char mcs[IWL_MAX_MCS_DISPLAY_SIZE]; 209 - }; 210 213 211 214 /** 212 215 * struct iwl_lq_sta_rs_fw - rate and related statistics for RS in FW
+17 -22
drivers/net/wireless/intel/iwlwifi/mvm/rx.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 2 /* 3 - * Copyright (C) 2012-2014, 2018-2020 Intel Corporation 3 + * Copyright (C) 2012-2014, 2018-2021 Intel Corporation 4 4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 5 5 * Copyright (C) 2016-2017 Intel Deutschland GmbH 6 6 */ ··· 103 103 struct iwl_rx_phy_info *phy_info, 104 104 struct ieee80211_rx_status *rx_status) 105 105 { 106 - int energy_a, energy_b, energy_c, max_energy; 106 + int energy_a, energy_b, max_energy; 107 107 u32 val; 108 108 109 109 val = ··· 114 114 energy_b = (val & IWL_RX_INFO_ENERGY_ANT_B_MSK) >> 115 115 IWL_RX_INFO_ENERGY_ANT_B_POS; 116 116 energy_b = energy_b ? -energy_b : S8_MIN; 117 - energy_c = (val & IWL_RX_INFO_ENERGY_ANT_C_MSK) >> 118 - IWL_RX_INFO_ENERGY_ANT_C_POS; 119 - energy_c = energy_c ? -energy_c : S8_MIN; 120 117 max_energy = max(energy_a, energy_b); 121 - max_energy = max(max_energy, energy_c); 122 118 123 - IWL_DEBUG_STATS(mvm, "energy In A %d B %d C %d , and max %d\n", 124 - energy_a, energy_b, energy_c, max_energy); 119 + IWL_DEBUG_STATS(mvm, "energy In A %d B %d , and max %d\n", 120 + energy_a, energy_b, max_energy); 125 121 126 122 rx_status->signal = max_energy; 127 123 rx_status->chains = (le16_to_cpu(phy_info->phy_flags) & ··· 125 129 >> RX_RES_PHY_FLAGS_ANTENNA_POS; 126 130 rx_status->chain_signal[0] = energy_a; 127 131 rx_status->chain_signal[1] = energy_b; 128 - rx_status->chain_signal[2] = energy_c; 129 132 } 130 133 131 134 /* ··· 230 235 mdata->rx.airtime += le16_to_cpu(phy_info->frame_time); 231 236 } 232 237 233 - if (!(rate_n_flags & (RATE_MCS_HT_MSK | RATE_MCS_VHT_MSK))) 238 + if (!(rate_n_flags & (RATE_MCS_HT_MSK_V1 | RATE_MCS_VHT_MSK_V1))) 234 239 return; 235 240 236 241 mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); ··· 244 249 mvmsta->sta_id != mvmvif->ap_sta_id) 245 250 return; 246 251 247 - if (rate_n_flags & RATE_MCS_HT_MSK) { 248 - thr = thresh_tpt[rate_n_flags & RATE_HT_MCS_RATE_CODE_MSK]; 249 - thr *= 1 + ((rate_n_flags & RATE_HT_MCS_NSS_MSK) >> 250 - RATE_HT_MCS_NSS_POS); 252 + if (rate_n_flags & RATE_MCS_HT_MSK_V1) { 253 + thr = thresh_tpt[rate_n_flags & RATE_HT_MCS_RATE_CODE_MSK_V1]; 254 + thr *= 1 + ((rate_n_flags & RATE_HT_MCS_NSS_MSK_V1) >> 255 + RATE_HT_MCS_NSS_POS_V1); 251 256 } else { 252 257 if (WARN_ON((rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK) >= 253 258 ARRAY_SIZE(thresh_tpt))) ··· 257 262 RATE_VHT_MCS_NSS_POS); 258 263 } 259 264 260 - thr <<= ((rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) >> 265 + thr <<= ((rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK_V1) >> 261 266 RATE_MCS_CHAN_WIDTH_POS); 262 267 263 268 mdata->uapsd_nonagg_detect.rx_bytes += len; ··· 450 455 } 451 456 452 457 /* Set up the HT phy flags */ 453 - switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { 458 + switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK_V1) { 454 459 case RATE_MCS_CHAN_WIDTH_20: 455 460 break; 456 461 case RATE_MCS_CHAN_WIDTH_40: ··· 463 468 rx_status->bw = RATE_INFO_BW_160; 464 469 break; 465 470 } 466 - if (!(rate_n_flags & RATE_MCS_CCK_MSK) && 467 - rate_n_flags & RATE_MCS_SGI_MSK) 471 + if (!(rate_n_flags & RATE_MCS_CCK_MSK_V1) && 472 + rate_n_flags & RATE_MCS_SGI_MSK_V1) 468 473 rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; 469 474 if (rate_n_flags & RATE_HT_MCS_GF_MSK) 470 475 rx_status->enc_flags |= RX_ENC_FLAG_HT_GF; 471 - if (rate_n_flags & RATE_MCS_LDPC_MSK) 476 + if (rate_n_flags & RATE_MCS_LDPC_MSK_V1) 472 477 rx_status->enc_flags |= RX_ENC_FLAG_LDPC; 473 - if (rate_n_flags & RATE_MCS_HT_MSK) { 478 + if (rate_n_flags & RATE_MCS_HT_MSK_V1) { 474 479 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 475 480 RATE_MCS_STBC_POS; 476 481 rx_status->encoding = RX_ENC_HT; 477 - rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK; 482 + rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK_V1; 478 483 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 479 - } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 484 + } else if (rate_n_flags & RATE_MCS_VHT_MSK_V1) { 480 485 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 481 486 RATE_MCS_STBC_POS; 482 487 rx_status->nss =
+70 -49
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 240 240 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, 241 241 struct napi_struct *napi, 242 242 struct sk_buff *skb, int queue, 243 - struct ieee80211_sta *sta, 244 - bool csi) 243 + struct ieee80211_sta *sta) 245 244 { 246 245 if (iwl_mvm_check_pn(mvm, skb, queue, sta)) 247 246 kfree_skb(skb); ··· 268 269 (rate_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 269 270 rx_status->chain_signal[0] = energy_a; 270 271 rx_status->chain_signal[1] = energy_b; 271 - rx_status->chain_signal[2] = S8_MIN; 272 272 } 273 273 274 274 static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, ··· 618 620 while ((skb = __skb_dequeue(skb_list))) { 619 621 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, 620 622 reorder_buf->queue, 621 - sta, false); 623 + sta); 622 624 reorder_buf->num_stored--; 623 625 } 624 626 } ··· 1196 1198 } 1197 1199 1198 1200 if (FIELD_GET(IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CRC_OK, phy_data4) && 1199 - (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) != RATE_MCS_CHAN_WIDTH_20) { 1201 + (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK_V1) != RATE_MCS_CHAN_WIDTH_20) { 1200 1202 he_mu->flags1 |= 1201 1203 cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN | 1202 1204 IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN); ··· 1233 1235 * the TSF/timers are not be transmitted in HE-MU. 1234 1236 */ 1235 1237 u8 ru = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK); 1236 - u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; 1238 + u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK_V1; 1237 1239 u8 offs = 0; 1238 1240 1239 1241 rx_status->bw = RATE_INFO_BW_HE_RU; ··· 1288 1290 1289 1291 if (he_mu) 1290 1292 he_mu->flags2 |= 1291 - le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, 1293 + le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK_V1, 1292 1294 rate_n_flags), 1293 1295 IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); 1294 - else if (he_type == RATE_MCS_HE_TYPE_TRIG) 1296 + else if (he_type == RATE_MCS_HE_TYPE_TRIG_V1) 1295 1297 he->data6 |= 1296 1298 cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_KNOWN) | 1297 - le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, 1299 + le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK_V1, 1298 1300 rate_n_flags), 1299 1301 IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW); 1300 1302 } ··· 1506 1508 1507 1509 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> RATE_MCS_STBC_POS; 1508 1510 rx_status->nss = 1509 - ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> 1510 - RATE_VHT_MCS_NSS_POS) + 1; 1511 - rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; 1511 + ((rate_n_flags & RATE_MCS_NSS_MSK) >> 1512 + RATE_MCS_NSS_POS) + 1; 1513 + rx_status->rate_idx = rate_n_flags & RATE_MCS_CODE_MSK; 1512 1514 rx_status->encoding = RX_ENC_HE; 1513 1515 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 1514 1516 if (rate_n_flags & RATE_MCS_BF_MSK) ··· 1560 1562 } 1561 1563 break; 1562 1564 case 3: 1563 - if ((he_type == RATE_MCS_HE_TYPE_SU || 1564 - he_type == RATE_MCS_HE_TYPE_EXT_SU) && 1565 - rate_n_flags & RATE_MCS_SGI_MSK) 1566 - rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; 1567 - else 1568 - rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; 1565 + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; 1569 1566 ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; 1570 1567 break; 1568 + case 4: 1569 + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; 1570 + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; 1571 + break; 1572 + default: 1573 + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_UNKNOWN; 1571 1574 } 1572 1575 1573 1576 he->data5 |= le16_encode_bits(ltf, ··· 1652 1653 struct iwl_mvm_rx_phy_data phy_data = { 1653 1654 .info_type = IWL_RX_PHY_INFO_TYPE_NONE, 1654 1655 }; 1655 - bool csi = false; 1656 + u32 format; 1657 + bool is_sgi; 1656 1658 1657 1659 if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) 1658 1660 return; ··· 1691 1691 phy_data.d2 = desc->v1.phy_data2; 1692 1692 phy_data.d3 = desc->v1.phy_data3; 1693 1693 } 1694 + if (iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP, 1695 + REPLY_RX_MPDU_CMD, 0) < 4) { 1696 + rate_n_flags = iwl_new_rate_from_v1(rate_n_flags); 1697 + IWL_DEBUG_DROP(mvm, "Got old format rate, converting. New rate: 0x%x\n", 1698 + rate_n_flags); 1699 + } 1700 + format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK; 1694 1701 1695 1702 len = le16_to_cpu(desc->mpdu_len); 1696 1703 ··· 1751 1744 break; 1752 1745 } 1753 1746 1754 - if (rate_n_flags & RATE_MCS_HE_MSK) 1747 + if (format == RATE_MCS_HE_MSK) 1755 1748 iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags, 1756 1749 phy_info, queue); 1757 1750 ··· 1768 1761 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 1769 1762 } 1770 1763 /* set the preamble flag if appropriate */ 1771 - if (rate_n_flags & RATE_MCS_CCK_MSK && 1764 + if (format == RATE_MCS_CCK_MSK && 1772 1765 phy_info & IWL_RX_MPDU_PHY_SHORT_PREAMBLE) 1773 1766 rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE; 1774 1767 ··· 1944 1937 } 1945 1938 } 1946 1939 1947 - if (!(rate_n_flags & RATE_MCS_CCK_MSK) && 1948 - rate_n_flags & RATE_MCS_SGI_MSK) 1940 + is_sgi = format == RATE_MCS_HE_MSK ? 1941 + iwl_he_is_sgi(rate_n_flags) : 1942 + rate_n_flags & RATE_MCS_SGI_MSK; 1943 + 1944 + if (!(format == RATE_MCS_CCK_MSK) && is_sgi) 1949 1945 rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; 1950 - if (rate_n_flags & RATE_HT_MCS_GF_MSK) 1951 - rx_status->enc_flags |= RX_ENC_FLAG_HT_GF; 1952 1946 if (rate_n_flags & RATE_MCS_LDPC_MSK) 1953 1947 rx_status->enc_flags |= RX_ENC_FLAG_LDPC; 1954 - if (rate_n_flags & RATE_MCS_HT_MSK) { 1948 + if (format == RATE_MCS_HT_MSK) { 1955 1949 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 1956 - RATE_MCS_STBC_POS; 1950 + RATE_MCS_STBC_POS; 1957 1951 rx_status->encoding = RX_ENC_HT; 1958 - rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK; 1952 + rx_status->rate_idx = RATE_HT_MCS_INDEX(rate_n_flags); 1959 1953 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 1960 - } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 1954 + } else if (format == RATE_MCS_VHT_MSK) { 1961 1955 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 1962 - RATE_MCS_STBC_POS; 1963 - rx_status->nss = 1964 - ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> 1965 - RATE_VHT_MCS_NSS_POS) + 1; 1966 - rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; 1956 + RATE_MCS_STBC_POS; 1957 + rx_status->nss = 1958 + ((rate_n_flags & RATE_MCS_NSS_MSK) >> 1959 + RATE_MCS_NSS_POS) + 1; 1960 + rx_status->rate_idx = rate_n_flags & RATE_MCS_CODE_MSK; 1967 1961 rx_status->encoding = RX_ENC_VHT; 1968 1962 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 1969 1963 if (rate_n_flags & RATE_MCS_BF_MSK) 1970 1964 rx_status->enc_flags |= RX_ENC_FLAG_BF; 1971 - } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) { 1972 - int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, 1973 - rx_status->band); 1965 + } else if (!(format == RATE_MCS_HE_MSK)) { 1966 + int rate = iwl_mvm_legacy_hw_idx_to_mac80211_idx(rate_n_flags, 1967 + rx_status->band); 1974 1968 1975 1969 if (WARN(rate < 0 || rate > 0xFF, 1976 1970 "Invalid rate flags 0x%x, band %d,\n", ··· 2002 1994 2003 1995 if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc)) 2004 1996 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, 2005 - sta, csi); 1997 + sta); 2006 1998 out: 2007 1999 rcu_read_unlock(); 2008 2000 } ··· 2021 2013 struct ieee80211_sta *sta = NULL; 2022 2014 struct sk_buff *skb; 2023 2015 u8 channel, energy_a, energy_b; 2016 + u32 format; 2024 2017 struct iwl_mvm_rx_phy_data phy_data = { 2025 2018 .info_type = le32_get_bits(desc->phy_info[1], 2026 2019 IWL_RX_PHY_DATA1_INFO_TYPE_MASK), 2027 2020 .d0 = desc->phy_info[0], 2028 2021 .d1 = desc->phy_info[1], 2029 2022 }; 2023 + bool is_sgi; 2024 + 2025 + if (iwl_fw_lookup_notif_ver(mvm->fw, DATA_PATH_GROUP, 2026 + RX_NO_DATA_NOTIF, 0) < 2) { 2027 + IWL_DEBUG_DROP(mvm, "Got an old rate format. Old rate: 0x%x\n", 2028 + rate_n_flags); 2029 + rate_n_flags = iwl_new_rate_from_v1(rate_n_flags); 2030 + IWL_DEBUG_DROP(mvm, " Rate after conversion to the new format: 0x%x\n", 2031 + rate_n_flags); 2032 + } 2033 + format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK; 2030 2034 2031 2035 if (unlikely(iwl_rx_packet_payload_len(pkt) < sizeof(*desc))) 2032 2036 return; ··· 2095 2075 break; 2096 2076 } 2097 2077 2098 - if (rate_n_flags & RATE_MCS_HE_MSK) 2078 + if (format == RATE_MCS_HE_MSK) 2099 2079 iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags, 2100 2080 phy_info, queue); 2101 2081 ··· 2111 2091 2112 2092 rcu_read_lock(); 2113 2093 2114 - if (!(rate_n_flags & RATE_MCS_CCK_MSK) && 2115 - rate_n_flags & RATE_MCS_SGI_MSK) 2094 + is_sgi = format == RATE_MCS_HE_MSK ? 2095 + iwl_he_is_sgi(rate_n_flags) : 2096 + rate_n_flags & RATE_MCS_SGI_MSK; 2097 + 2098 + if (!(format == RATE_MCS_CCK_MSK) && is_sgi) 2116 2099 rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; 2117 - if (rate_n_flags & RATE_HT_MCS_GF_MSK) 2118 - rx_status->enc_flags |= RX_ENC_FLAG_HT_GF; 2119 2100 if (rate_n_flags & RATE_MCS_LDPC_MSK) 2120 2101 rx_status->enc_flags |= RX_ENC_FLAG_LDPC; 2121 - if (rate_n_flags & RATE_MCS_HT_MSK) { 2102 + if (format == RATE_MCS_HT_MSK) { 2122 2103 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 2123 2104 RATE_MCS_STBC_POS; 2124 2105 rx_status->encoding = RX_ENC_HT; 2125 - rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK; 2106 + rx_status->rate_idx = RATE_HT_MCS_INDEX(rate_n_flags); 2126 2107 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 2127 - } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 2108 + } else if (format == RATE_MCS_VHT_MSK) { 2128 2109 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 2129 2110 RATE_MCS_STBC_POS; 2130 - rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; 2111 + rx_status->rate_idx = rate_n_flags & RATE_MCS_CODE_MSK; 2131 2112 rx_status->encoding = RX_ENC_VHT; 2132 2113 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 2133 2114 if (rate_n_flags & RATE_MCS_BF_MSK) ··· 2141 2120 rx_status->nss = 2142 2121 le32_get_bits(desc->rx_vec[0], 2143 2122 RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK) + 1; 2144 - } else if (rate_n_flags & RATE_MCS_HE_MSK) { 2123 + } else if (format == RATE_MCS_HE_MSK) { 2145 2124 rx_status->nss = 2146 2125 le32_get_bits(desc->rx_vec[0], 2147 2126 RX_NO_DATA_RX_VEC0_HE_NSTS_MSK) + 1; 2148 2127 } else { 2149 - int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, 2128 + int rate = iwl_mvm_legacy_hw_idx_to_mac80211_idx(rate_n_flags, 2150 2129 rx_status->band); 2151 2130 2152 2131 if (WARN(rate < 0 || rate > 0xFF,
+1 -1
drivers/net/wireless/intel/iwlwifi/mvm/scan.c
··· 163 163 tx_ant = BIT(mvm->scan_last_antenna_idx) << RATE_MCS_ANT_POS; 164 164 165 165 if (band == NL80211_BAND_2GHZ && !no_cck) 166 - return cpu_to_le32(IWL_RATE_1M_PLCP | RATE_MCS_CCK_MSK | 166 + return cpu_to_le32(IWL_RATE_1M_PLCP | RATE_MCS_CCK_MSK_V1 | 167 167 tx_ant); 168 168 else 169 169 return cpu_to_le32(IWL_RATE_6M_PLCP | tx_ant);
+92 -29
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
··· 268 268 int rate_idx = -1; 269 269 u8 rate_plcp; 270 270 u32 rate_flags = 0; 271 + bool is_cck; 271 272 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 272 273 273 274 /* info->control is only relevant for non HW rate control */ ··· 300 299 BUILD_BUG_ON(IWL_FIRST_CCK_RATE != 0); 301 300 302 301 /* Get PLCP rate for tx_cmd->rate_n_flags */ 303 - rate_plcp = iwl_mvm_mac80211_idx_to_hwrate(rate_idx); 302 + rate_plcp = iwl_mvm_mac80211_idx_to_hwrate(mvm->fw, rate_idx); 303 + is_cck = (rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE); 304 304 305 - /* Set CCK flag as needed */ 306 - if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) 307 - rate_flags |= RATE_MCS_CCK_MSK; 305 + /* Set CCK or OFDM flag */ 306 + if (iwl_fw_lookup_cmd_ver(mvm->fw, LONG_GROUP, TX_CMD, 0) > 8) { 307 + if (!is_cck) 308 + rate_flags |= RATE_MCS_LEGACY_OFDM_MSK; 309 + else 310 + rate_flags |= RATE_MCS_CCK_MSK; 311 + } else if (is_cck) { 312 + rate_flags |= RATE_MCS_CCK_MSK_V1; 313 + } 308 314 309 315 return (u32)rate_plcp | rate_flags; 310 316 } ··· 1292 1284 } 1293 1285 #endif /* CONFIG_IWLWIFI_DEBUG */ 1294 1286 1287 + static int iwl_mvm_get_hwrate_chan_width(u32 chan_width) 1288 + { 1289 + switch (chan_width) { 1290 + case RATE_MCS_CHAN_WIDTH_20: 1291 + return 0; 1292 + case RATE_MCS_CHAN_WIDTH_40: 1293 + return IEEE80211_TX_RC_40_MHZ_WIDTH; 1294 + case RATE_MCS_CHAN_WIDTH_80: 1295 + return IEEE80211_TX_RC_80_MHZ_WIDTH; 1296 + case RATE_MCS_CHAN_WIDTH_160: 1297 + return IEEE80211_TX_RC_160_MHZ_WIDTH; 1298 + default: 1299 + return 0; 1300 + } 1301 + } 1302 + 1295 1303 void iwl_mvm_hwrate_to_tx_rate(u32 rate_n_flags, 1296 1304 enum nl80211_band band, 1297 1305 struct ieee80211_tx_rate *r) 1298 1306 { 1299 - if (rate_n_flags & RATE_HT_MCS_GF_MSK) 1300 - r->flags |= IEEE80211_TX_RC_GREEN_FIELD; 1301 - switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { 1302 - case RATE_MCS_CHAN_WIDTH_20: 1303 - break; 1304 - case RATE_MCS_CHAN_WIDTH_40: 1305 - r->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; 1306 - break; 1307 - case RATE_MCS_CHAN_WIDTH_80: 1308 - r->flags |= IEEE80211_TX_RC_80_MHZ_WIDTH; 1309 - break; 1310 - case RATE_MCS_CHAN_WIDTH_160: 1311 - r->flags |= IEEE80211_TX_RC_160_MHZ_WIDTH; 1312 - break; 1313 - } 1307 + u32 format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK; 1308 + u32 rate = format == RATE_MCS_HT_MSK ? 1309 + RATE_HT_MCS_INDEX(rate_n_flags) : 1310 + rate_n_flags & RATE_MCS_CODE_MSK; 1311 + 1312 + r->flags |= 1313 + iwl_mvm_get_hwrate_chan_width(rate_n_flags & 1314 + RATE_MCS_CHAN_WIDTH_MSK); 1315 + 1314 1316 if (rate_n_flags & RATE_MCS_SGI_MSK) 1315 1317 r->flags |= IEEE80211_TX_RC_SHORT_GI; 1316 - if (rate_n_flags & RATE_MCS_HT_MSK) { 1318 + if (format == RATE_MCS_HT_MSK) { 1317 1319 r->flags |= IEEE80211_TX_RC_MCS; 1318 - r->idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK; 1319 - } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 1320 + r->idx = rate; 1321 + } else if (format == RATE_MCS_VHT_MSK) { 1322 + ieee80211_rate_set_vht(r, rate, 1323 + ((rate_n_flags & RATE_MCS_NSS_MSK) >> 1324 + RATE_MCS_NSS_POS) + 1); 1325 + r->flags |= IEEE80211_TX_RC_VHT_MCS; 1326 + } else if (format == RATE_MCS_HE_MSK) { 1327 + /* mac80211 cannot do this without ieee80211_tx_status_ext() 1328 + * but it only matters for radiotap */ 1329 + r->idx = 0; 1330 + } else { 1331 + r->idx = iwl_mvm_legacy_hw_idx_to_mac80211_idx(rate_n_flags, 1332 + band); 1333 + } 1334 + } 1335 + 1336 + void iwl_mvm_hwrate_to_tx_rate_v1(u32 rate_n_flags, 1337 + enum nl80211_band band, 1338 + struct ieee80211_tx_rate *r) 1339 + { 1340 + if (rate_n_flags & RATE_HT_MCS_GF_MSK) 1341 + r->flags |= IEEE80211_TX_RC_GREEN_FIELD; 1342 + 1343 + r->flags |= 1344 + iwl_mvm_get_hwrate_chan_width(rate_n_flags & 1345 + RATE_MCS_CHAN_WIDTH_MSK_V1); 1346 + 1347 + if (rate_n_flags & RATE_MCS_SGI_MSK_V1) 1348 + r->flags |= IEEE80211_TX_RC_SHORT_GI; 1349 + if (rate_n_flags & RATE_MCS_HT_MSK_V1) { 1350 + r->flags |= IEEE80211_TX_RC_MCS; 1351 + r->idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK_V1; 1352 + } else if (rate_n_flags & RATE_MCS_VHT_MSK_V1) { 1320 1353 ieee80211_rate_set_vht( 1321 1354 r, rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK, 1322 1355 ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> ··· 1372 1323 /* 1373 1324 * translate ucode response to mac80211 tx status control values 1374 1325 */ 1375 - static void iwl_mvm_hwrate_to_tx_status(u32 rate_n_flags, 1326 + static void iwl_mvm_hwrate_to_tx_status(const struct iwl_fw *fw, 1327 + u32 rate_n_flags, 1376 1328 struct ieee80211_tx_info *info) 1377 1329 { 1378 1330 struct ieee80211_tx_rate *r = &info->status.rates[0]; 1379 1331 1332 + if (iwl_fw_lookup_notif_ver(fw, LONG_GROUP, 1333 + TX_CMD, 0) > 6) 1334 + rate_n_flags = iwl_new_rate_from_v1(rate_n_flags); 1335 + 1380 1336 info->status.antenna = 1381 - ((rate_n_flags & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS); 1382 - iwl_mvm_hwrate_to_tx_rate(rate_n_flags, info->band, r); 1337 + ((rate_n_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS); 1338 + iwl_mvm_hwrate_to_tx_rate(rate_n_flags, 1339 + info->band, r); 1383 1340 } 1384 1341 1385 1342 static void iwl_mvm_tx_status_check_trigger(struct iwl_mvm *mvm, ··· 1505 1450 /* the FW should have stopped the queue and not 1506 1451 * return this status 1507 1452 */ 1508 - WARN_ON(1); 1453 + IWL_ERR_LIMIT(mvm, 1454 + "FW reported TX filtered, status=0x%x, FC=0x%x\n", 1455 + status, le16_to_cpu(hdr->frame_control)); 1509 1456 info->flags |= IEEE80211_TX_STAT_TX_FILTERED; 1510 1457 break; 1511 1458 default: ··· 1529 1472 iwl_mvm_tx_status_check_trigger(mvm, status, hdr->frame_control); 1530 1473 1531 1474 info->status.rates[0].count = tx_resp->failure_frame + 1; 1532 - iwl_mvm_hwrate_to_tx_status(le32_to_cpu(tx_resp->initial_rate), 1475 + 1476 + iwl_mvm_hwrate_to_tx_status(mvm->fw, 1477 + le32_to_cpu(tx_resp->initial_rate), 1533 1478 info); 1479 + 1480 + /* Don't assign the converted initial_rate, because driver 1481 + * TLC uses this and doesn't support the new FW rate 1482 + */ 1534 1483 info->status.status_driver_data[1] = 1535 1484 (void *)(uintptr_t)le32_to_cpu(tx_resp->initial_rate); 1536 1485 ··· 1898 1835 info->flags |= IEEE80211_TX_STAT_AMPDU; 1899 1836 memcpy(&info->status, &tx_info->status, 1900 1837 sizeof(tx_info->status)); 1901 - iwl_mvm_hwrate_to_tx_status(rate, info); 1838 + iwl_mvm_hwrate_to_tx_status(mvm->fw, rate, info); 1902 1839 } 1903 1840 } 1904 1841 ··· 1919 1856 goto out; 1920 1857 1921 1858 tx_info->band = chanctx_conf->def.chan->band; 1922 - iwl_mvm_hwrate_to_tx_status(rate, tx_info); 1859 + iwl_mvm_hwrate_to_tx_status(mvm->fw, rate, tx_info); 1923 1860 1924 1861 if (!iwl_mvm_has_tlc_offload(mvm)) { 1925 1862 IWL_DEBUG_TX_REPLY(mvm,
+30 -24
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
··· 135 135 return iwl_mvm_send_cmd_status(mvm, &cmd, status); 136 136 } 137 137 138 - #define IWL_DECLARE_RATE_INFO(r) \ 139 - [IWL_RATE_##r##M_INDEX] = IWL_RATE_##r##M_PLCP 138 + int iwl_mvm_legacy_hw_idx_to_mac80211_idx(u32 rate_n_flags, 139 + enum nl80211_band band) 140 + { 141 + int format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK; 142 + int rate = rate_n_flags & RATE_LEGACY_RATE_MSK; 143 + bool is_LB = band == NL80211_BAND_2GHZ; 140 144 141 - /* 142 - * Translate from fw_rate_index (IWL_RATE_XXM_INDEX) to PLCP 143 - */ 144 - static const u8 fw_rate_idx_to_plcp[IWL_RATE_COUNT] = { 145 - IWL_DECLARE_RATE_INFO(1), 146 - IWL_DECLARE_RATE_INFO(2), 147 - IWL_DECLARE_RATE_INFO(5), 148 - IWL_DECLARE_RATE_INFO(11), 149 - IWL_DECLARE_RATE_INFO(6), 150 - IWL_DECLARE_RATE_INFO(9), 151 - IWL_DECLARE_RATE_INFO(12), 152 - IWL_DECLARE_RATE_INFO(18), 153 - IWL_DECLARE_RATE_INFO(24), 154 - IWL_DECLARE_RATE_INFO(36), 155 - IWL_DECLARE_RATE_INFO(48), 156 - IWL_DECLARE_RATE_INFO(54), 157 - }; 145 + if (format == RATE_MCS_LEGACY_OFDM_MSK) 146 + return is_LB ? rate + IWL_FIRST_OFDM_RATE : 147 + rate; 148 + 149 + /* CCK is not allowed in HB */ 150 + return is_LB ? rate : -1; 151 + } 158 152 159 153 int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags, 160 154 enum nl80211_band band) 161 155 { 162 - int rate = rate_n_flags & RATE_LEGACY_RATE_MSK; 156 + int rate = rate_n_flags & RATE_LEGACY_RATE_MSK_V1; 163 157 int idx; 164 158 int band_offset = 0; 165 159 ··· 161 167 if (band != NL80211_BAND_2GHZ) 162 168 band_offset = IWL_FIRST_OFDM_RATE; 163 169 for (idx = band_offset; idx < IWL_RATE_COUNT_LEGACY; idx++) 164 - if (fw_rate_idx_to_plcp[idx] == rate) 170 + if (iwl_fw_rate_idx_to_plcp(idx) == rate) 165 171 return idx - band_offset; 166 172 167 173 return -1; 168 174 } 169 175 170 - u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx) 176 + u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx) 171 177 { 172 - /* Get PLCP rate for tx_cmd->rate_n_flags */ 173 - return fw_rate_idx_to_plcp[rate_idx]; 178 + if (iwl_fw_lookup_cmd_ver(fw, LONG_GROUP, 179 + TX_CMD, 0) > 8) 180 + /* In the new rate legacy rates are indexed: 181 + * 0 - 3 for CCK and 0 - 7 for OFDM. 182 + */ 183 + return (rate_idx >= IWL_FIRST_OFDM_RATE ? 184 + rate_idx - IWL_FIRST_OFDM_RATE : 185 + rate_idx); 186 + 187 + return iwl_fw_rate_idx_to_plcp(rate_idx); 174 188 } 175 189 176 190 u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac) ··· 219 217 return BIT(ffs(mask) - 1); 220 218 } 221 219 220 + #define MAX_ANT_NUM 2 222 221 /* 223 222 * Toggles between TX antennas to send the probe request on. 224 223 * Receives the bitmask of valid TX antennas and the *index* used ··· 407 404 }; 408 405 409 406 lockdep_assert_held(&mvm->mutex); 407 + 408 + if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM) 409 + return false; 410 410 411 411 if (num_of_ant(iwl_mvm_get_valid_rx_ant(mvm)) == 1) 412 412 return false;
+4
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
··· 57 57 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_DRAM; 58 58 dbg_cfg->hwm_base_addr = cpu_to_le64(frag->physical); 59 59 dbg_cfg->hwm_size = cpu_to_le32(frag->size); 60 + dbg_cfg->debug_token_config = cpu_to_le32(trans->dbg.ucode_preset); 61 + IWL_DEBUG_FW(trans, 62 + "WRT: Applying DRAM destination (debug_token_config=%u)\n", 63 + dbg_cfg->debug_token_config); 60 64 IWL_DEBUG_FW(trans, 61 65 "WRT: Applying DRAM destination (alloc_id=%u, num_frags=%u)\n", 62 66 alloc_id,
+151
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 499 499 /* Ma devices */ 500 500 {IWL_PCI_DEVICE(0x2729, PCI_ANY_ID, iwl_ma_trans_cfg)}, 501 501 {IWL_PCI_DEVICE(0x7E40, PCI_ANY_ID, iwl_ma_trans_cfg)}, 502 + {IWL_PCI_DEVICE(0x7F70, PCI_ANY_ID, iwl_ma_trans_cfg)}, 502 503 503 504 /* Bz devices */ 504 505 {IWL_PCI_DEVICE(0x2727, PCI_ANY_ID, iwl_bz_trans_cfg)}, ··· 533 532 IWL_DEV_INFO(0x31DC, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name), 534 533 IWL_DEV_INFO(0xA370, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_name), 535 534 IWL_DEV_INFO(0xA370, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name), 535 + IWL_DEV_INFO(0x54F0, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_160_name), 536 + IWL_DEV_INFO(0x54F0, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name), 536 537 IWL_DEV_INFO(0x51F0, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_160_name), 537 538 IWL_DEV_INFO(0x51F0, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_160_name), 539 + IWL_DEV_INFO(0x51F0, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), 540 + IWL_DEV_INFO(0x51F0, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 541 + IWL_DEV_INFO(0x54F0, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), 542 + IWL_DEV_INFO(0x54F0, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 543 + IWL_DEV_INFO(0x7A70, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), 544 + IWL_DEV_INFO(0x7A70, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 538 545 539 546 IWL_DEV_INFO(0x271C, 0x0214, iwl9260_2ac_cfg, iwl9260_1_name), 547 + IWL_DEV_INFO(0x7E40, 0x1691, iwl_cfg_ma_a0_gf4_a0, iwl_ax411_killer_1690s_name), 548 + IWL_DEV_INFO(0x7E40, 0x1692, iwl_cfg_ma_a0_gf4_a0, iwl_ax411_killer_1690i_name), 540 549 541 550 /* AX200 */ 542 551 IWL_DEV_INFO(0x2723, 0x1653, iwl_ax200_cfg_cc, iwl_ax200_killer_1650w_name), ··· 650 639 IWL_DEV_INFO(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0, NULL), 651 640 IWL_DEV_INFO(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0, NULL), 652 641 642 + /* So with JF */ 643 + IWL_DEV_INFO(0x7A70, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_160_name), 644 + IWL_DEV_INFO(0x7A70, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_160_name), 645 + IWL_DEV_INFO(0x7AF0, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_160_name), 646 + IWL_DEV_INFO(0x7AF0, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_160_name), 647 + 653 648 /* SnJ with HR */ 654 649 IWL_DEV_INFO(0x2725, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0, NULL), 655 650 IWL_DEV_INFO(0x2726, 0x0090, iwlax211_cfg_snj_gf_a0, NULL), ··· 665 648 IWL_DEV_INFO(0x2726, 0x0510, iwlax211_cfg_snj_gf_a0, NULL), 666 649 IWL_DEV_INFO(0x2726, 0x1651, iwl_cfg_snj_hr_b0, iwl_ax201_killer_1650s_name), 667 650 IWL_DEV_INFO(0x2726, 0x1652, iwl_cfg_snj_hr_b0, iwl_ax201_killer_1650i_name), 651 + IWL_DEV_INFO(0x2726, 0x1671, iwlax211_cfg_snj_gf_a0, iwl_ax211_killer_1675s_name), 652 + IWL_DEV_INFO(0x2726, 0x1672, iwlax211_cfg_snj_gf_a0, iwl_ax211_killer_1675i_name), 653 + IWL_DEV_INFO(0x2726, 0x1691, iwlax411_2ax_cfg_sosnj_gf4_a0, iwl_ax411_killer_1690s_name), 654 + IWL_DEV_INFO(0x2726, 0x1692, iwlax411_2ax_cfg_sosnj_gf4_a0, iwl_ax411_killer_1690i_name), 655 + IWL_DEV_INFO(0x7F70, 0x1691, iwlax411_2ax_cfg_sosnj_gf4_a0, iwl_ax411_killer_1690s_name), 656 + IWL_DEV_INFO(0x7F70, 0x1692, iwlax411_2ax_cfg_sosnj_gf4_a0, iwl_ax411_killer_1690i_name), 668 657 669 658 _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 670 659 IWL_CFG_MAC_TYPE_PU, IWL_CFG_ANY, ··· 1135 1112 IWL_CFG_RF_TYPE_MR, IWL_CFG_ANY, 1136 1113 IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB, 1137 1114 iwl_cfg_bz_a0_mr_a0, iwl_bz_name), 1115 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1116 + IWL_CFG_MAC_TYPE_BZ, IWL_CFG_ANY, 1117 + IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, 1118 + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB, 1119 + iwl_cfg_bz_a0_fm_a0, iwl_bz_name), 1120 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1121 + IWL_CFG_MAC_TYPE_GL, IWL_CFG_ANY, 1122 + IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, 1123 + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB, 1124 + iwl_cfg_gl_a0_fm_a0, iwl_bz_name), 1125 + 1138 1126 1139 1127 /* SoF with JF2 */ 1140 1128 _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, ··· 1225 1191 #endif /* CONFIG_IWLMVM */ 1226 1192 }; 1227 1193 1194 + /* 1195 + * In case that there is no OTP on the NIC, get the rf id and cdb info 1196 + * from the prph registers. 1197 + */ 1198 + static int get_crf_id(struct iwl_trans *iwl_trans) 1199 + { 1200 + int ret = 0; 1201 + u32 wfpm_ctrl_addr; 1202 + u32 wfpm_otp_cfg_addr; 1203 + u32 sd_reg_ver_addr; 1204 + u32 cdb = 0; 1205 + u32 val; 1206 + 1207 + if (iwl_trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 1208 + wfpm_ctrl_addr = WFPM_CTRL_REG_GEN2; 1209 + wfpm_otp_cfg_addr = WFPM_OTP_CFG1_ADDR_GEN2; 1210 + sd_reg_ver_addr = SD_REG_VER_GEN2; 1211 + /* Qu/Pu families have other addresses */ 1212 + } else { 1213 + wfpm_ctrl_addr = WFPM_CTRL_REG; 1214 + wfpm_otp_cfg_addr = WFPM_OTP_CFG1_ADDR; 1215 + sd_reg_ver_addr = SD_REG_VER; 1216 + } 1217 + 1218 + if (!iwl_trans_grab_nic_access(iwl_trans)) { 1219 + IWL_ERR(iwl_trans, "Failed to grab nic access before reading crf id\n"); 1220 + ret = -EIO; 1221 + goto out; 1222 + } 1223 + 1224 + /* Enable access to peripheral registers */ 1225 + val = iwl_read_umac_prph_no_grab(iwl_trans, wfpm_ctrl_addr); 1226 + val |= ENABLE_WFPM; 1227 + iwl_write_umac_prph_no_grab(iwl_trans, wfpm_ctrl_addr, val); 1228 + 1229 + /* Read crf info */ 1230 + val = iwl_read_prph_no_grab(iwl_trans, sd_reg_ver_addr); 1231 + 1232 + /* Read cdb info (also contains the jacket info if needed in the future */ 1233 + cdb = iwl_read_umac_prph_no_grab(iwl_trans, wfpm_otp_cfg_addr); 1234 + 1235 + /* Map between crf id to rf id */ 1236 + switch (REG_CRF_ID_TYPE(val)) { 1237 + case REG_CRF_ID_TYPE_JF_1: 1238 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_JF1 << 12); 1239 + break; 1240 + case REG_CRF_ID_TYPE_JF_2: 1241 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_JF2 << 12); 1242 + break; 1243 + case REG_CRF_ID_TYPE_HR_NONE_CDB: 1244 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_HR1 << 12); 1245 + break; 1246 + case REG_CRF_ID_TYPE_HR_CDB: 1247 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_HR2 << 12); 1248 + break; 1249 + case REG_CRF_ID_TYPE_GF: 1250 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_GF << 12); 1251 + break; 1252 + case REG_CRF_ID_TYPE_MR: 1253 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_MR << 12); 1254 + break; 1255 + case REG_CRF_ID_TYPE_FM: 1256 + iwl_trans->hw_rf_id = (IWL_CFG_RF_TYPE_FM << 12); 1257 + break; 1258 + default: 1259 + ret = -EIO; 1260 + IWL_ERR(iwl_trans, 1261 + "Can find a correct rfid for crf id 0x%x\n", 1262 + REG_CRF_ID_TYPE(val)); 1263 + goto out_release; 1264 + 1265 + } 1266 + 1267 + /* Set CDB capabilities */ 1268 + if (cdb & BIT(4)) { 1269 + iwl_trans->hw_rf_id += BIT(28); 1270 + IWL_INFO(iwl_trans, "Adding cdb to rf id\n"); 1271 + } 1272 + 1273 + IWL_INFO(iwl_trans, "Detected RF 0x%x from crf id 0x%x\n", 1274 + iwl_trans->hw_rf_id, REG_CRF_ID_TYPE(val)); 1275 + 1276 + out_release: 1277 + iwl_trans_release_nic_access(iwl_trans); 1278 + 1279 + out: 1280 + return ret; 1281 + } 1282 + 1228 1283 /* PCI registers */ 1229 1284 #define PCI_CFG_RETRY_TIMEOUT 0x041 1230 1285 ··· 1345 1222 1346 1223 trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans); 1347 1224 1225 + /* 1226 + * Let's try to grab NIC access early here. Sometimes, NICs may 1227 + * fail to initialize, and if that happens it's better if we see 1228 + * issues early on (and can reprobe, per the logic inside), than 1229 + * first trying to load the firmware etc. and potentially only 1230 + * detecting any problems when the first interface is brought up. 1231 + */ 1232 + ret = iwl_finish_nic_init(iwl_trans); 1233 + if (ret) 1234 + goto out_free_trans; 1235 + if (iwl_trans_grab_nic_access(iwl_trans)) { 1236 + /* all good */ 1237 + iwl_trans_release_nic_access(iwl_trans); 1238 + } else { 1239 + ret = -EIO; 1240 + goto out_free_trans; 1241 + } 1242 + 1348 1243 iwl_trans->hw_rf_id = iwl_read32(iwl_trans, CSR_HW_RF_ID); 1244 + 1245 + /* 1246 + * The RF_ID is set to zero in blank OTP so read version to 1247 + * extract the RF_ID. 1248 + * This is relevant only for family 9000 and up. 1249 + */ 1250 + if (iwl_trans->trans_cfg->rf_id && 1251 + iwl_trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_9000 && 1252 + !CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id) && get_crf_id(iwl_trans)) 1253 + goto out_free_trans; 1349 1254 1350 1255 for (i = 0; i < ARRAY_SIZE(iwl_dev_info_table); i++) { 1351 1256 const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
+8 -30
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
··· 47 47 48 48 iwl_pcie_apm_config(trans); 49 49 50 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 50 + ret = iwl_finish_nic_init(trans); 51 51 if (ret) 52 52 return ret; 53 53 ··· 131 131 if (trans_pcie->is_down) 132 132 return; 133 133 134 - if (trans->state >= IWL_TRANS_FW_STARTED) { 135 - if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) { 136 - iwl_set_bit(trans, CSR_GP_CNTRL, 137 - CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_REQ); 138 - iwl_poll_bit(trans, CSR_GP_CNTRL, 139 - CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS, 140 - CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS, 141 - 5000); 142 - msleep(100); 143 - iwl_set_bit(trans, CSR_GP_CNTRL, 144 - CSR_GP_CNTRL_REG_FLAG_SW_RESET); 145 - } else if (trans_pcie->fw_reset_handshake) { 134 + if (trans->state >= IWL_TRANS_FW_STARTED) 135 + if (trans_pcie->fw_reset_handshake) 146 136 iwl_trans_pcie_fw_reset_handshake(trans); 147 - } 148 - } 149 137 150 138 trans_pcie->is_down = true; 151 139 ··· 163 175 else 164 176 iwl_pcie_ctxt_info_free(trans); 165 177 166 - /* Make sure (redundant) we've released our request to stay awake */ 167 - if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) 168 - iwl_clear_bit(trans, CSR_GP_CNTRL, 169 - CSR_GP_CNTRL_REG_FLAG_BZ_MAC_ACCESS_REQ); 170 - else 171 - iwl_clear_bit(trans, CSR_GP_CNTRL, 172 - CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 173 - 174 - if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) { 175 - iwl_set_bit(trans, CSR_GP_CNTRL, 176 - CSR_GP_CNTRL_REG_FLAG_SW_RESET); 177 - } 178 178 /* Stop the device, and put it in low power state */ 179 179 iwl_pcie_gen2_apm_stop(trans, false); 180 180 ··· 442 466 443 467 iwl_pcie_set_ltr(trans); 444 468 445 - if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) 469 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) { 470 + iwl_write32(trans, CSR_FUNC_SCRATCH, CSR_FUNC_SCRATCH_INIT_VALUE); 446 471 iwl_set_bit(trans, CSR_GP_CNTRL, 447 472 CSR_GP_CNTRL_REG_FLAG_ROM_START); 448 - else if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) 473 + } else if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 449 474 iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1); 450 - else 475 + } else { 451 476 iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1); 477 + } 452 478 453 479 /* re-check RF-Kill state since we may have missed the interrupt */ 454 480 hw_rfkill = iwl_pcie_check_hw_rf_kill(trans);
+32 -13
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 129 129 static void iwl_trans_pcie_sw_reset(struct iwl_trans *trans) 130 130 { 131 131 /* Reset entire device - do controller reset (results in SHRD_HW_RST) */ 132 - iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); 132 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) 133 + iwl_set_bit(trans, CSR_GP_CNTRL, 134 + CSR_GP_CNTRL_REG_FLAG_SW_RESET); 135 + else 136 + iwl_set_bit(trans, CSR_RESET, 137 + CSR_RESET_REG_FLAG_SW_RESET); 133 138 usleep_range(5000, 6000); 134 139 } 135 140 ··· 311 306 if (trans->trans_cfg->base_params->pll_cfg) 312 307 iwl_set_bit(trans, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); 313 308 314 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 309 + ret = iwl_finish_nic_init(trans); 315 310 if (ret) 316 311 return ret; 317 312 ··· 383 378 384 379 iwl_trans_pcie_sw_reset(trans); 385 380 386 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 381 + ret = iwl_finish_nic_init(trans); 387 382 if (WARN_ON(ret)) { 388 383 /* Release XTAL ON request */ 389 384 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, ··· 463 458 CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS, 464 459 CSR_GP_CNTRL_REG_FLAG_BUS_MASTER_DISABLE_STATUS, 465 460 100); 461 + msleep(100); 466 462 } else { 467 463 iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); 468 464 ··· 1214 1208 } 1215 1209 1216 1210 /* Make sure (redundant) we've released our request to stay awake */ 1217 - iwl_clear_bit(trans, CSR_GP_CNTRL, 1218 - CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1211 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) 1212 + iwl_clear_bit(trans, CSR_GP_CNTRL, 1213 + CSR_GP_CNTRL_REG_FLAG_BZ_MAC_ACCESS_REQ); 1214 + else 1215 + iwl_clear_bit(trans, CSR_GP_CNTRL, 1216 + CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1219 1217 1220 1218 /* Stop the device, and put it in low power state */ 1221 1219 iwl_pcie_apm_stop(trans, false); ··· 1511 1501 iwl_set_bit(trans, CSR_GP_CNTRL, 1512 1502 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1513 1503 1514 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 1504 + ret = iwl_finish_nic_init(trans); 1515 1505 if (ret) 1516 1506 return ret; 1517 1507 ··· 1744 1734 { 1745 1735 int ret; 1746 1736 1747 - ret = iwl_finish_nic_init(trans, trans->trans_cfg); 1737 + ret = iwl_finish_nic_init(trans); 1748 1738 if (ret < 0) 1749 1739 return ret; 1750 1740 ··· 2150 2140 2151 2141 if (trans_pcie->cmd_hold_nic_awake) 2152 2142 goto out; 2153 - 2154 - __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, 2155 - CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 2143 + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) 2144 + __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, 2145 + CSR_GP_CNTRL_REG_FLAG_BZ_MAC_ACCESS_REQ); 2146 + else 2147 + __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, 2148 + CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 2156 2149 /* 2157 2150 * Above we read the CSR_GP_CNTRL register, which will flush 2158 2151 * any previous writes, but we need the write that clears the ··· 3216 3203 return 0; 3217 3204 } 3218 3205 3219 - static struct iwl_trans_dump_data 3220 - *iwl_trans_pcie_dump_data(struct iwl_trans *trans, 3221 - u32 dump_mask) 3206 + static struct iwl_trans_dump_data * 3207 + iwl_trans_pcie_dump_data(struct iwl_trans *trans, 3208 + u32 dump_mask, 3209 + const struct iwl_dump_sanitize_ops *sanitize_ops, 3210 + void *sanitize_ctx) 3222 3211 { 3223 3212 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 3224 3213 struct iwl_fw_error_dump_data *data; ··· 3320 3305 txcmd->caplen = cpu_to_le32(caplen); 3321 3306 memcpy(txcmd->data, cmdq->entries[idx].cmd, 3322 3307 caplen); 3308 + if (sanitize_ops && sanitize_ops->frob_hcmd) 3309 + sanitize_ops->frob_hcmd(sanitize_ctx, 3310 + txcmd->data, 3311 + caplen); 3323 3312 txcmd = (void *)((u8 *)txcmd->data + caplen); 3324 3313 } 3325 3314