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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'wireless-next-2025-07-17' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next

Johannes Berg says:

====================
Another set of changes, notably:
- cfg80211: fix double-free introduced earlier
- mac80211: fix RCU iteration in CSA
- iwlwifi: many cleanups (unused FW APIs, PCIe code, WoWLAN)
- mac80211: some work around how FIPS affects wifi, which was
wrong (RC4 is used by TKIP, not only WEP)
- cfg/mac80211: improvements for unsolicated probe response
handling

* tag 'wireless-next-2025-07-17' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (64 commits)
wifi: cfg80211: fix double free for link_sinfo in nl80211_station_dump()
wifi: cfg80211: fix off channel operation allowed check for MLO
wifi: mac80211: use RCU-safe iteration in ieee80211_csa_finish
wifi: mac80211_hwsim: Update comments in header
wifi: mac80211: parse unsolicited broadcast probe response data
wifi: cfg80211: parse attribute to update unsolicited probe response template
wifi: mac80211: don't use TPE data from assoc response
wifi: mac80211: handle WLAN_HT_ACTION_NOTIFY_CHANWIDTH async
wifi: mac80211: simplify __ieee80211_rx_h_amsdu() loop
wifi: mac80211: don't mark keys for inactive links as uploaded
wifi: mac80211: only assign chanctx in reconfig
wifi: mac80211_hwsim: Declare support for AP scanning
wifi: mac80211: clean up cipher suite handling
wifi: mac80211: don't send keys to driver when fips_enabled
wifi: cfg80211: Fix interface type validation
wifi: mac80211: remove ieee80211_link_unreserve_chanctx() return value
wifi: mac80211: don't unreserve never reserved chanctx
mwl8k: Add missing check after DMA map
wifi: mac80211: make VHT opmode NSS ignore a debug message
wifi: iwlwifi: remove support of several iwl_ppag_table_cmd versions
...
====================

Link: https://patch.msgid.link/20250717094610.20106-47-johannes@sipsolutions.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Paolo Abeni 44eb62e1 8a2a6bb0

+1039 -1352
+1
drivers/net/wireless/intel/iwlwifi/Makefile
··· 22 22 # MAC configurations 23 23 iwlwifi-$(CONFIG_IWLMVM) += cfg/9000.o cfg/22000.o 24 24 iwlwifi-$(CONFIG_IWLMVM) += cfg/ax210.o 25 + iwlwifi-$(CONFIG_IWLMVM) += cfg/bz.o cfg/sc.o 25 26 iwlwifi-$(CONFIG_IWLMLD) += cfg/bz.o cfg/sc.o cfg/dr.o 26 27 # RF configurations 27 28 iwlwifi-$(CONFIG_IWLMVM) += cfg/rf-jf.o cfg/rf-hr.o cfg/rf-gf.o
-24
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
··· 19 19 #define IWL_22000_SMEM_OFFSET 0x400000 20 20 #define IWL_22000_SMEM_LEN 0xD0000 21 21 22 - #define IWL_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0" 23 - #define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0" 24 - #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0" 25 - #define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0" 26 - #define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0" 27 - #define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0" 28 22 #define IWL_CC_A_FW_PRE "iwlwifi-cc-a0" 29 23 30 - #define IWL_QU_B_HR_B_MODULE_FIRMWARE(api) \ 31 - IWL_QU_B_HR_B_FW_PRE "-" __stringify(api) ".ucode" 32 - #define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \ 33 - IWL_QUZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 34 - #define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \ 35 - IWL_QUZ_A_JF_B_FW_PRE "-" __stringify(api) ".ucode" 36 - #define IWL_QU_C_HR_B_MODULE_FIRMWARE(api) \ 37 - IWL_QU_C_HR_B_FW_PRE "-" __stringify(api) ".ucode" 38 - #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \ 39 - IWL_QU_B_JF_B_FW_PRE "-" __stringify(api) ".ucode" 40 - #define IWL_QU_C_JF_B_MODULE_FIRMWARE(api) \ 41 - IWL_QU_C_JF_B_FW_PRE "-" __stringify(api) ".ucode" 42 24 #define IWL_CC_A_MODULE_FIRMWARE(api) \ 43 25 IWL_CC_A_FW_PRE "-" __stringify(api) ".ucode" 44 26 ··· 114 132 const char iwl_ax201_killer_1650i_name[] = 115 133 "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)"; 116 134 117 - MODULE_FIRMWARE(IWL_QU_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 118 - MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 119 - MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 120 - MODULE_FIRMWARE(IWL_QU_C_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 121 - MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 122 - MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 123 135 MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
+1 -33
drivers/net/wireless/intel/iwlwifi/cfg/ax210.c
··· 13 13 #define IWL_AX210_UCODE_API_MAX 89 14 14 15 15 /* Lowest firmware API version supported */ 16 - #define IWL_AX210_UCODE_API_MIN 77 16 + #define IWL_AX210_UCODE_API_MIN 89 17 17 18 18 /* Memory offsets and lengths */ 19 19 #define IWL_AX210_SMEM_OFFSET 0x400000 20 20 #define IWL_AX210_SMEM_LEN 0xD0000 21 - 22 - #define IWL_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0" 23 - #define IWL_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0" 24 - #define IWL_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0" 25 - #define IWL_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0" 26 - #define IWL_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0" 27 - #define IWL_MA_A_HR_B_FW_PRE "iwlwifi-ma-a0-hr-b0" 28 - #define IWL_MA_A_GF_A_FW_PRE "iwlwifi-ma-a0-gf-a0" 29 - #define IWL_MA_A_GF4_A_FW_PRE "iwlwifi-ma-a0-gf4-a0" 30 - #define IWL_MA_B_HR_B_FW_PRE "iwlwifi-ma-b0-hr-b0" 31 - #define IWL_MA_B_GF_A_FW_PRE "iwlwifi-ma-b0-gf-a0" 32 - #define IWL_MA_B_GF4_A_FW_PRE "iwlwifi-ma-b0-gf4-a0" 33 - 34 - #define IWL_SO_A_JF_B_MODULE_FIRMWARE(api) \ 35 - IWL_SO_A_JF_B_FW_PRE "-" __stringify(api) ".ucode" 36 - #define IWL_SO_A_HR_B_MODULE_FIRMWARE(api) \ 37 - IWL_SO_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 38 - #define IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(api) \ 39 - IWL_MA_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 40 - #define IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(api) \ 41 - IWL_MA_B_HR_B_FW_PRE "-" __stringify(api) ".ucode" 42 21 43 22 static const struct iwl_family_base_params iwl_ax210_base = { 44 23 .num_of_queues = 512, ··· 122 143 .integrated = true, 123 144 .umac_prph_offset = 0x300000 124 145 }; 125 - 126 - MODULE_FIRMWARE(IWL_SO_A_JF_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX)); 127 - MODULE_FIRMWARE(IWL_SO_A_HR_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX)); 128 - IWL_FW_AND_PNVM(IWL_SO_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX); 129 - IWL_FW_AND_PNVM(IWL_TY_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX); 130 - MODULE_FIRMWARE(IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX)); 131 - IWL_FW_AND_PNVM(IWL_MA_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX); 132 - IWL_FW_AND_PNVM(IWL_MA_A_GF4_A_FW_PRE, IWL_AX210_UCODE_API_MAX); 133 - MODULE_FIRMWARE(IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX)); 134 - IWL_FW_AND_PNVM(IWL_MA_B_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX); 135 - IWL_FW_AND_PNVM(IWL_MA_B_GF4_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
-9
drivers/net/wireless/intel/iwlwifi/cfg/bz.c
··· 19 19 #define IWL_BZ_SMEM_OFFSET 0x400000 20 20 #define IWL_BZ_SMEM_LEN 0xD0000 21 21 22 - #define IWL_BZ_A_HR_B_FW_PRE "iwlwifi-bz-a0-hr-b0" 23 - #define IWL_BZ_A_GF_A_FW_PRE "iwlwifi-bz-a0-gf-a0" 24 - #define IWL_BZ_A_GF4_A_FW_PRE "iwlwifi-bz-a0-gf4-a0" 25 22 #define IWL_BZ_A_FM_B_FW_PRE "iwlwifi-bz-a0-fm-b0" 26 23 #define IWL_BZ_A_FM_C_FW_PRE "iwlwifi-bz-a0-fm-c0" 27 24 #define IWL_BZ_A_FM4_B_FW_PRE "iwlwifi-bz-a0-fm4-b0" 28 25 #define IWL_GL_B_FM_B_FW_PRE "iwlwifi-gl-b0-fm-b0" 29 26 #define IWL_GL_C_FM_C_FW_PRE "iwlwifi-gl-c0-fm-c0" 30 - 31 - #define IWL_BZ_A_HR_B_MODULE_FIRMWARE(api) \ 32 - IWL_BZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 33 27 34 28 static const struct iwl_family_base_params iwl_bz_base = { 35 29 .num_of_queues = 512, ··· 101 107 .low_latency_xtal = true, 102 108 }; 103 109 104 - MODULE_FIRMWARE(IWL_BZ_A_HR_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX)); 105 - IWL_FW_AND_PNVM(IWL_BZ_A_GF_A_FW_PRE, IWL_BZ_UCODE_API_MAX); 106 - IWL_FW_AND_PNVM(IWL_BZ_A_GF4_A_FW_PRE, IWL_BZ_UCODE_API_MAX); 107 110 IWL_FW_AND_PNVM(IWL_BZ_A_FM_B_FW_PRE, IWL_BZ_UCODE_API_MAX); 108 111 IWL_FW_AND_PNVM(IWL_BZ_A_FM_C_FW_PRE, IWL_BZ_UCODE_API_MAX); 109 112 IWL_FW_AND_PNVM(IWL_BZ_A_FM4_B_FW_PRE, IWL_BZ_UCODE_API_MAX);
+31
drivers/net/wireless/intel/iwlwifi/cfg/rf-gf.c
··· 5 5 */ 6 6 #include "iwl-config.h" 7 7 8 + /* Highest firmware API version supported */ 9 + #define IWL_GF_UCODE_API_MAX 100 10 + 11 + /* Lowest firmware API version supported */ 12 + #define IWL_GF_UCODE_API_MIN 98 13 + 14 + #define IWL_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0" 15 + #define IWL_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0" 16 + #define IWL_MA_A_GF_A_FW_PRE "iwlwifi-ma-a0-gf-a0" 17 + #define IWL_MA_B_GF_A_FW_PRE "iwlwifi-ma-b0-gf-a0" 18 + #define IWL_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0" 19 + #define IWL_MA_A_GF4_A_FW_PRE "iwlwifi-ma-a0-gf4-a0" 20 + #define IWL_MA_B_GF4_A_FW_PRE "iwlwifi-ma-b0-gf4-a0" 21 + #define IWL_BZ_A_GF_A_FW_PRE "iwlwifi-bz-a0-gf-a0" 22 + #define IWL_BZ_A_GF4_A_FW_PRE "iwlwifi-bz-a0-gf4-a0" 23 + #define IWL_SC_A_GF_A_FW_PRE "iwlwifi-sc-a0-gf-a0" 24 + #define IWL_SC_A_GF4_A_FW_PRE "iwlwifi-sc-a0-gf4-a0" 25 + 8 26 /* NVM versions */ 9 27 #define IWL_GF_NVM_VERSION 0x0a1d 10 28 ··· 40 22 .nvm_ver = IWL_GF_NVM_VERSION, 41 23 .nvm_type = IWL_NVM_EXT, 42 24 .num_rbds = IWL_NUM_RBDS_HE, 25 + .ucode_api_min = IWL_GF_UCODE_API_MIN, 26 + .ucode_api_max = IWL_GF_UCODE_API_MAX, 43 27 }; 44 28 45 29 const char iwl_ax210_killer_1675w_name[] = ··· 60 40 const char iwl_ax210_name[] = "Intel(R) Wi-Fi 6E AX210 160MHz"; 61 41 const char iwl_ax211_name[] = "Intel(R) Wi-Fi 6E AX211 160MHz"; 62 42 const char iwl_ax411_name[] = "Intel(R) Wi-Fi 6E AX411 160MHz"; 43 + 44 + IWL_FW_AND_PNVM(IWL_SO_A_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 45 + IWL_FW_AND_PNVM(IWL_TY_A_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 46 + IWL_FW_AND_PNVM(IWL_MA_A_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 47 + IWL_FW_AND_PNVM(IWL_MA_B_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 48 + IWL_FW_AND_PNVM(IWL_MA_A_GF4_A_FW_PRE, IWL_GF_UCODE_API_MAX); 49 + IWL_FW_AND_PNVM(IWL_MA_B_GF4_A_FW_PRE, IWL_GF_UCODE_API_MAX); 50 + IWL_FW_AND_PNVM(IWL_BZ_A_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 51 + IWL_FW_AND_PNVM(IWL_BZ_A_GF4_A_FW_PRE, IWL_GF_UCODE_API_MAX); 52 + IWL_FW_AND_PNVM(IWL_SC_A_GF_A_FW_PRE, IWL_GF_UCODE_API_MAX); 53 + IWL_FW_AND_PNVM(IWL_SC_A_GF4_A_FW_PRE, IWL_GF_UCODE_API_MAX);
+48 -1
drivers/net/wireless/intel/iwlwifi/cfg/rf-hr.c
··· 5 5 */ 6 6 #include "iwl-config.h" 7 7 8 + /* Highest firmware API version supported */ 9 + #define IWL_HR_UCODE_API_MAX 100 10 + 11 + /* Lowest firmware API version supported */ 12 + #define IWL_HR_UCODE_API_MIN 98 13 + 14 + #define IWL_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0" 15 + #define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0" 16 + #define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0" 17 + #define IWL_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0" 18 + #define IWL_MA_A_HR_B_FW_PRE "iwlwifi-ma-a0-hr-b0" 19 + #define IWL_MA_B_HR_B_FW_PRE "iwlwifi-ma-b0-hr-b0" 20 + #define IWL_BZ_A_HR_B_FW_PRE "iwlwifi-bz-a0-hr-b0" 21 + #define IWL_SC_A_HR_A_FW_PRE "iwlwifi-sc-a0-hr-b0" 22 + #define IWL_SC_A_HR_B_FW_PRE "iwlwifi-sc-a0-hr-b0" 23 + 24 + #define IWL_QU_B_HR_B_MODULE_FIRMWARE(api) \ 25 + IWL_QU_B_HR_B_FW_PRE "-" __stringify(api) ".ucode" 26 + #define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \ 27 + IWL_QUZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 28 + #define IWL_QU_C_HR_B_MODULE_FIRMWARE(api) \ 29 + IWL_QU_C_HR_B_FW_PRE "-" __stringify(api) ".ucode" 30 + #define IWL_SO_A_HR_B_MODULE_FIRMWARE(api) \ 31 + IWL_SO_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 32 + #define IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(api) \ 33 + IWL_MA_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 34 + #define IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(api) \ 35 + IWL_MA_B_HR_B_FW_PRE "-" __stringify(api) ".ucode" 36 + #define IWL_BZ_A_HR_B_MODULE_FIRMWARE(api) \ 37 + IWL_BZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 38 + #define IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(api) \ 39 + IWL_SC_A_HR_A_FW_PRE "-" __stringify(api) ".ucode" 40 + #define IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(api) \ 41 + IWL_SC_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 42 + 8 43 /* NVM versions */ 9 44 #define IWL_HR_NVM_VERSION 0x0a1d 10 45 ··· 55 20 }, \ 56 21 .num_rbds = IWL_NUM_RBDS_HE, \ 57 22 .nvm_ver = IWL_HR_NVM_VERSION, \ 58 - .nvm_type = IWL_NVM_EXT 23 + .nvm_type = IWL_NVM_EXT, \ 24 + .ucode_api_min = IWL_HR_UCODE_API_MIN, \ 25 + .ucode_api_max = IWL_HR_UCODE_API_MAX 59 26 60 27 const struct iwl_rf_cfg iwl_rf_hr1 = { 61 28 IWL_DEVICE_HR, ··· 77 40 const char iwl_ax200_name[] = "Intel(R) Wi-Fi 6 AX200 160MHz"; 78 41 const char iwl_ax201_name[] = "Intel(R) Wi-Fi 6 AX201 160MHz"; 79 42 const char iwl_ax203_name[] = "Intel(R) Wi-Fi 6 AX203"; 43 + 44 + MODULE_FIRMWARE(IWL_QU_B_HR_B_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 45 + MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 46 + MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 47 + MODULE_FIRMWARE(IWL_SO_A_HR_B_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 48 + MODULE_FIRMWARE(IWL_MA_A_HR_B_FW_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 49 + MODULE_FIRMWARE(IWL_MA_B_HR_B_FW_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 50 + MODULE_FIRMWARE(IWL_BZ_A_HR_B_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 51 + MODULE_FIRMWARE(IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX)); 52 + MODULE_FIRMWARE(IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(IWL_HR_UCODE_API_MAX));
+28 -1
drivers/net/wireless/intel/iwlwifi/cfg/rf-jf.c
··· 5 5 */ 6 6 #include "iwl-config.h" 7 7 8 + /* Highest firmware API version supported */ 9 + #define IWL_JF_UCODE_API_MAX 77 10 + 11 + /* Lowest firmware API version supported */ 12 + #define IWL_JF_UCODE_API_MIN 77 13 + 14 + #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0" 15 + #define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0" 16 + #define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0" 17 + #define IWL_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0" 18 + 19 + #define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \ 20 + IWL_QUZ_A_JF_B_FW_PRE "-" __stringify(api) ".ucode" 21 + #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \ 22 + IWL_QU_B_JF_B_FW_PRE "-" __stringify(api) ".ucode" 23 + #define IWL_QU_C_JF_B_MODULE_FIRMWARE(api) \ 24 + IWL_QU_C_JF_B_FW_PRE "-" __stringify(api) ".ucode" 25 + #define IWL_SO_A_JF_B_MODULE_FIRMWARE(api) \ 26 + IWL_SO_A_JF_B_FW_PRE "-" __stringify(api) ".ucode" 27 + 8 28 /* NVM versions */ 9 29 #define IWL_JF_NVM_VERSION 0x0a1d 10 30 ··· 76 56 BIT(NL80211_BAND_5GHZ), \ 77 57 }, \ 78 58 .nvm_ver = IWL_JF_NVM_VERSION, \ 79 - .nvm_type = IWL_NVM_EXT 59 + .nvm_type = IWL_NVM_EXT, \ 60 + .ucode_api_min = IWL_JF_UCODE_API_MIN, \ 61 + .ucode_api_max = IWL_JF_UCODE_API_MAX 80 62 81 63 const struct iwl_rf_cfg iwl_rf_jf = { 82 64 IWL_DEVICE_JF, ··· 104 82 "Killer(R) Wireless-AC 1550i Wireless Network Adapter (9560NGW) 160MHz"; 105 83 const char iwl9560_killer_1550s_name[] = 106 84 "Killer(R) Wireless-AC 1550s Wireless Network Adapter (9560D2W) 160MHz"; 85 + 86 + MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_JF_UCODE_API_MAX)); 87 + MODULE_FIRMWARE(IWL_QU_C_JF_B_MODULE_FIRMWARE(IWL_JF_UCODE_API_MAX)); 88 + MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_JF_UCODE_API_MAX)); 89 + MODULE_FIRMWARE(IWL_SO_A_JF_B_MODULE_FIRMWARE(IWL_JF_UCODE_API_MAX));
-13
drivers/net/wireless/intel/iwlwifi/cfg/sc.c
··· 24 24 25 25 #define IWL_SC_A_FM_B_FW_PRE "iwlwifi-sc-a0-fm-b0" 26 26 #define IWL_SC_A_FM_C_FW_PRE "iwlwifi-sc-a0-fm-c0" 27 - #define IWL_SC_A_HR_A_FW_PRE "iwlwifi-sc-a0-hr-b0" 28 - #define IWL_SC_A_HR_B_FW_PRE "iwlwifi-sc-a0-hr-b0" 29 - #define IWL_SC_A_GF_A_FW_PRE "iwlwifi-sc-a0-gf-a0" 30 - #define IWL_SC_A_GF4_A_FW_PRE "iwlwifi-sc-a0-gf4-a0" 31 27 #define IWL_SC_A_WH_A_FW_PRE "iwlwifi-sc-a0-wh-a0" 32 28 #define IWL_SC2_A_FM_C_FW_PRE "iwlwifi-sc2-a0-fm-c0" 33 29 #define IWL_SC2_A_WH_A_FW_PRE "iwlwifi-sc2-a0-wh-a0" 34 30 #define IWL_SC2F_A_FM_C_FW_PRE "iwlwifi-sc2f-a0-fm-c0" 35 31 #define IWL_SC2F_A_WH_A_FW_PRE "iwlwifi-sc2f-a0-wh-a0" 36 - 37 - #define IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(api) \ 38 - IWL_SC_A_HR_A_FW_PRE "-" __stringify(api) ".ucode" 39 - #define IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(api) \ 40 - IWL_SC_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 41 32 42 33 static const struct iwl_family_base_params iwl_sc_base = { 43 34 .num_of_queues = 512, ··· 98 107 99 108 IWL_FW_AND_PNVM(IWL_SC_A_FM_B_FW_PRE, IWL_SC_UCODE_API_MAX); 100 109 IWL_FW_AND_PNVM(IWL_SC_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX); 101 - MODULE_FIRMWARE(IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX)); 102 - MODULE_FIRMWARE(IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX)); 103 - IWL_FW_AND_PNVM(IWL_SC_A_GF_A_FW_PRE, IWL_SC_UCODE_API_MAX); 104 - IWL_FW_AND_PNVM(IWL_SC_A_GF4_A_FW_PRE, IWL_SC_UCODE_API_MAX); 105 110 IWL_FW_AND_PNVM(IWL_SC_A_WH_A_FW_PRE, IWL_SC_UCODE_API_MAX); 106 111 IWL_FW_AND_PNVM(IWL_SC2_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX); 107 112 IWL_FW_AND_PNVM(IWL_SC2_A_WH_A_FW_PRE, IWL_SC_UCODE_API_MAX);
+6 -6
drivers/net/wireless/intel/iwlwifi/dvm/eeprom.c
··· 679 679 ret = iwl_poll_bits(trans, CSR_HW_IF_CONFIG_REG, 680 680 CSR_HW_IF_CONFIG_REG_EEPROM_OWN_SEM, 681 681 IWL_EEPROM_SEM_TIMEOUT); 682 - if (ret >= 0) { 682 + if (!ret) { 683 683 IWL_DEBUG_EEPROM(trans->dev, 684 684 "Acquired semaphore after %d tries.\n", 685 685 count+1); 686 - return ret; 686 + return 0; 687 687 } 688 688 } 689 689 ··· 799 799 ret = iwl_poll_bits(trans, CSR_EEPROM_REG, 800 800 CSR_EEPROM_REG_READ_VALID_MSK, 801 801 IWL_EEPROM_ACCESS_TIMEOUT); 802 - if (ret < 0) { 802 + if (ret) { 803 803 IWL_ERR(trans, "Time out reading OTP[%d]\n", addr); 804 804 return ret; 805 805 } ··· 941 941 return -ENOMEM; 942 942 943 943 ret = iwl_eeprom_verify_signature(trans, nvm_is_otp); 944 - if (ret < 0) { 944 + if (ret) { 945 945 IWL_ERR(trans, "EEPROM not found, EEPROM_GP=0x%08x\n", gp); 946 946 goto err_free; 947 947 } 948 948 949 949 /* Make sure driver (instead of uCode) is allowed to read EEPROM */ 950 950 ret = iwl_eeprom_acquire_semaphore(trans); 951 - if (ret < 0) { 951 + if (ret) { 952 952 IWL_ERR(trans, "Failed to acquire EEPROM semaphore.\n"); 953 953 goto err_free; 954 954 } ··· 994 994 ret = iwl_poll_bits(trans, CSR_EEPROM_REG, 995 995 CSR_EEPROM_REG_READ_VALID_MSK, 996 996 IWL_EEPROM_ACCESS_TIMEOUT); 997 - if (ret < 0) { 997 + if (ret) { 998 998 IWL_ERR(trans, 999 999 "Time out reading EEPROM[%d]\n", addr); 1000 1000 goto err_unlock;
-15
drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
··· 82 82 struct iwl_umac_alive umac_data; 83 83 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */ 84 84 85 - struct iwl_alive_ntf_v4 { 86 - __le16 status; 87 - __le16 flags; 88 - struct iwl_lmac_alive lmac_data[2]; 89 - struct iwl_umac_alive umac_data; 90 - } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_4 */ 91 - 92 - struct iwl_alive_ntf_v5 { 93 - __le16 status; 94 - __le16 flags; 95 - struct iwl_lmac_alive lmac_data[2]; 96 - struct iwl_umac_alive umac_data; 97 - struct iwl_sku_id sku_id; 98 - } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_5 */ 99 - 100 85 struct iwl_imr_alive_info { 101 86 __le64 base_addr; 102 87 __le32 size;
+2 -3
drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
··· 573 573 WOWLAN_KEK_KCK_MATERIAL = 0xe4, 574 574 575 575 /** 576 - * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status_v6, 577 - * &struct iwl_wowlan_status_v7, &struct iwl_wowlan_status_v9 or 578 - * &struct iwl_wowlan_status_v12 576 + * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status_v6 or 577 + * &struct iwl_wowlan_status_v7 579 578 */ 580 579 WOWLAN_GET_STATUSES = 0xe5, 581 580
-114
drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
··· 456 456 union iwl_all_tsc_rsc all_tsc_rsc; 457 457 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */ 458 458 459 - struct iwl_wowlan_rsc_tsc_params_cmd_v4 { 460 - struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 params; 461 - __le32 sta_id; 462 - } __packed; /* ALL_TSC_RSC_API_S_VER_4 */ 463 - 464 459 struct iwl_wowlan_rsc_tsc_params_cmd { 465 460 __le64 ucast_rsc[IWL_MAX_TID_COUNT]; 466 461 __le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT]; ··· 715 720 } __packed; /* WOWLAN_STATUSES_API_S_VER_7 */ 716 721 717 722 /** 718 - * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10) 719 - * @gtk: GTK data 720 - * @igtk: IGTK data 721 - * @replay_ctr: GTK rekey replay counter 722 - * @pattern_number: number of the matched pattern 723 - * @non_qos_seq_ctr: non-QoS sequence counter to use next. 724 - * Reserved if the struct has version >= 10. 725 - * @qos_seq_ctr: QoS sequence counters to use next 726 - * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 727 - * @num_of_gtk_rekeys: number of GTK rekeys 728 - * @transmitted_ndps: number of transmitted neighbor discovery packets 729 - * @received_beacons: number of received beacons 730 - * @wake_packet_length: wakeup packet length 731 - * @wake_packet_bufsize: wakeup packet buffer size 732 - * @tid_tear_down: bit mask of tids whose BA sessions were closed 733 - * in suspend state 734 - * @reserved: unused 735 - * @wake_packet: wakeup packet 736 - */ 737 - struct iwl_wowlan_status_v9 { 738 - struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM]; 739 - struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 740 - __le64 replay_ctr; 741 - __le16 pattern_number; 742 - __le16 non_qos_seq_ctr; 743 - __le16 qos_seq_ctr[8]; 744 - __le32 wakeup_reasons; 745 - __le32 num_of_gtk_rekeys; 746 - __le32 transmitted_ndps; 747 - __le32 received_beacons; 748 - __le32 wake_packet_length; 749 - __le32 wake_packet_bufsize; 750 - u8 tid_tear_down; 751 - u8 reserved[3]; 752 - u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 753 - } __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */ 754 - 755 - /** 756 - * struct iwl_wowlan_status_v12 - WoWLAN status 757 - * @gtk: GTK data 758 - * @igtk: IGTK data 759 - * @replay_ctr: GTK rekey replay counter 760 - * @pattern_number: number of the matched pattern 761 - * @non_qos_seq_ctr: non-QoS sequence counter to use next. 762 - * Reserved if the struct has version >= 10. 763 - * @qos_seq_ctr: QoS sequence counters to use next 764 - * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 765 - * @num_of_gtk_rekeys: number of GTK rekeys 766 - * @transmitted_ndps: number of transmitted neighbor discovery packets 767 - * @received_beacons: number of received beacons 768 - * @wake_packet_length: wakeup packet length 769 - * @wake_packet_bufsize: wakeup packet buffer size 770 - * @tid_tear_down: bit mask of tids whose BA sessions were closed 771 - * in suspend state 772 - * @reserved: unused 773 - * @wake_packet: wakeup packet 774 - */ 775 - struct iwl_wowlan_status_v12 { 776 - struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM]; 777 - struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 778 - __le64 replay_ctr; 779 - __le16 pattern_number; 780 - __le16 non_qos_seq_ctr; 781 - __le16 qos_seq_ctr[8]; 782 - __le32 wakeup_reasons; 783 - __le32 num_of_gtk_rekeys; 784 - __le32 transmitted_ndps; 785 - __le32 received_beacons; 786 - __le32 wake_packet_length; 787 - __le32 wake_packet_bufsize; 788 - u8 tid_tear_down; 789 - u8 reserved[3]; 790 - u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 791 - } __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_12 */ 792 - 793 - /** 794 723 * struct iwl_wowlan_info_notif_v1 - WoWLAN information notification 795 724 * @gtk: GTK data 796 725 * @igtk: IGTK data ··· 750 831 u8 station_id; 751 832 u8 reserved2[2]; 752 833 } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */ 753 - 754 - /** 755 - * struct iwl_wowlan_info_notif_v2 - WoWLAN information notification 756 - * @gtk: GTK data 757 - * @igtk: IGTK data 758 - * @replay_ctr: GTK rekey replay counter 759 - * @pattern_number: number of the matched patterns 760 - * @reserved1: reserved 761 - * @qos_seq_ctr: QoS sequence counters to use next 762 - * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 763 - * @num_of_gtk_rekeys: number of GTK rekeys 764 - * @transmitted_ndps: number of transmitted neighbor discovery packets 765 - * @received_beacons: number of received beacons 766 - * @tid_tear_down: bit mask of tids whose BA sessions were closed 767 - * in suspend state 768 - * @station_id: station id 769 - * @reserved2: reserved 770 - */ 771 - struct iwl_wowlan_info_notif_v2 { 772 - struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM]; 773 - struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 774 - __le64 replay_ctr; 775 - __le16 pattern_number; 776 - __le16 reserved1; 777 - __le16 qos_seq_ctr[8]; 778 - __le32 wakeup_reasons; 779 - __le32 num_of_gtk_rekeys; 780 - __le32 transmitted_ndps; 781 - __le32 received_beacons; 782 - u8 tid_tear_down; 783 - u8 station_id; 784 - u8 reserved2[2]; 785 - } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_2 */ 786 834 787 835 /* MAX MLO keys of non-active links that can arrive in the notification */ 788 836 #define WOWLAN_MAX_MLO_KEYS 18
+18 -2
drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
··· 125 125 TLC_MNG_UPDATE_NOTIF = 0xF7, 126 126 127 127 /** 128 + * @BEACON_FILTER_IN_NOTIF: &struct iwl_beacon_filter_notif 129 + */ 130 + BEACON_FILTER_IN_NOTIF = 0xF8, 131 + 132 + /** 128 133 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification 129 134 */ 130 135 STA_PM_NOTIF = 0xFD, ··· 700 695 } __packed; /* SEC_KEY_CMD_API_S_VER_1 */ 701 696 702 697 /** 703 - * struct iwl_omi_send_status_notif - OMI status notification 698 + * struct iwl_omi_send_status_notif_v1 - OMI status notification 704 699 * @success: indicates that the OMI was sent successfully 705 700 * (currently always set) 706 701 */ 707 - struct iwl_omi_send_status_notif { 702 + struct iwl_omi_send_status_notif_v1 { 708 703 __le32 success; 709 704 } __packed; /* OMI_SEND_STATUS_NTFY_API_S_VER_1 */ 705 + 706 + /** 707 + * struct iwl_omi_send_status_notif - OMI status notification 708 + * @success: indicates that the OMI was sent successfully 709 + * (currently always set) 710 + * @sta_id: sta_id to which the OMI was sent 711 + */ 712 + struct iwl_omi_send_status_notif { 713 + __le32 success; 714 + __le32 sta_id; 715 + } __packed; /* OMI_SEND_STATUS_NTFY_API_S_VER_2 */ 710 716 711 717 #endif /* __iwl_fw_api_datapath_h__ */
+1
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
··· 787 787 /* Activate UNII-1 (5.2GHz) for World Wide */ 788 788 #define ACTIVATE_5G2_IN_WW_MASK BIT(4) 789 789 #define CHAN_STATE_ACTIVE_BITMAP_CMD_V11 0x1F 790 + #define CHAN_STATE_ACTIVE_BITMAP_CMD_V12 0x7F 790 791 791 792 /** 792 793 * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
+2 -2
drivers/net/wireless/intel/iwlwifi/fw/api/offload.h
··· 3 3 * Copyright (C) 2012-2014 Intel Corporation 4 4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 5 5 * Copyright (C) 2016-2017 Intel Deutschland GmbH 6 - * Copyright (C) 2021-2024 Intel Corporation 6 + * Copyright (C) 2021-2025 Intel Corporation 7 7 */ 8 8 #ifndef __iwl_fw_api_offload_h__ 9 9 #define __iwl_fw_api_offload_h__ ··· 19 19 20 20 /** 21 21 * @WOWLAN_INFO_NOTIFICATION: Notification in 22 - * &struct iwl_wowlan_info_notif_v1, &struct iwl_wowlan_info_notif_v2, 22 + * &struct iwl_wowlan_info_notif_v1, iwl_wowlan_info_notif_v3, 23 23 * or &struct iwl_wowlan_info_notif 24 24 */ 25 25 WOWLAN_INFO_NOTIFICATION = 0xFD,
+4 -77
drivers/net/wireless/intel/iwlwifi/fw/api/power.h
··· 255 255 u8 reserved[3]; 256 256 } __packed; 257 257 258 - /** 259 - * struct iwl_reduce_tx_power_cmd - TX power reduction command 260 - * REDUCE_TX_POWER_CMD = 0x9f 261 - * @flags: (reserved for future implementation) 262 - * @mac_context_id: id of the mac ctx for which we are reducing TX power. 263 - * @pwr_restriction: TX power restriction in dBms. 264 - */ 265 - struct iwl_reduce_tx_power_cmd { 266 - u8 flags; 267 - u8 mac_context_id; 268 - __le16 pwr_restriction; 269 - } __packed; /* TX_REDUCED_POWER_API_S_VER_1 */ 270 - 271 258 enum iwl_dev_tx_power_cmd_mode { 272 259 IWL_TX_POWER_MODE_SET_LINK = 0, 273 260 IWL_TX_POWER_MODE_SET_DEVICE = 1, ··· 329 342 } __packed; /* TX_REDUCED_POWER_API_S_VER_5 */ 330 343 331 344 /** 332 - * struct iwl_dev_tx_power_cmd_v6 - TX power reduction command version 6 333 - * @per_chain: per chain restrictions 334 - * @enable_ack_reduction: enable or disable close range ack TX power 335 - * reduction. 336 - * @per_chain_restriction_changed: is per_chain_restriction has changed 337 - * from last command. used if set_mode is 338 - * IWL_TX_POWER_MODE_SET_SAR_TIMER. 339 - * note: if not changed, the command is used for keep alive only. 340 - * @reserved: reserved (padding) 341 - * @timer_period: timer in milliseconds. if expires FW will change to default 342 - * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER 343 - */ 344 - struct iwl_dev_tx_power_cmd_v6 { 345 - __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; 346 - u8 enable_ack_reduction; 347 - u8 per_chain_restriction_changed; 348 - u8 reserved[2]; 349 - __le32 timer_period; 350 - } __packed; /* TX_REDUCED_POWER_API_S_VER_6 */ 351 - 352 - /** 353 - * struct iwl_dev_tx_power_cmd_v7 - TX power reduction command version 7 354 - * @per_chain: per chain restrictions 355 - * @enable_ack_reduction: enable or disable close range ack TX power 356 - * reduction. 357 - * @per_chain_restriction_changed: is per_chain_restriction has changed 358 - * from last command. used if set_mode is 359 - * IWL_TX_POWER_MODE_SET_SAR_TIMER. 360 - * note: if not changed, the command is used for keep alive only. 361 - * @reserved: reserved (padding) 362 - * @timer_period: timer in milliseconds. if expires FW will change to default 363 - * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER 364 - * @flags: reduce power flags. 365 - */ 366 - struct iwl_dev_tx_power_cmd_v7 { 367 - __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; 368 - u8 enable_ack_reduction; 369 - u8 per_chain_restriction_changed; 370 - u8 reserved[2]; 371 - __le32 timer_period; 372 - __le32 flags; 373 - } __packed; /* TX_REDUCED_POWER_API_S_VER_7 */ 374 - 375 - /** 376 345 * struct iwl_dev_tx_power_cmd_v8 - TX power reduction command version 8 377 346 * @per_chain: per chain restrictions 378 347 * @enable_ack_reduction: enable or disable close range ack TX power ··· 372 429 * @v3: version 3 part of the command 373 430 * @v4: version 4 part of the command 374 431 * @v5: version 5 part of the command 375 - * @v6: version 6 part of the command 376 - * @v7: version 7 part of the command 377 432 * @v8: version 8 part of the command 378 433 */ 379 434 struct iwl_dev_tx_power_cmd_v3_v8 { ··· 381 440 struct iwl_dev_tx_power_cmd_v3 v3; 382 441 struct iwl_dev_tx_power_cmd_v4 v4; 383 442 struct iwl_dev_tx_power_cmd_v5 v5; 384 - struct iwl_dev_tx_power_cmd_v6 v6; 385 - struct iwl_dev_tx_power_cmd_v7 v7; 386 443 struct iwl_dev_tx_power_cmd_v8 v8; 387 444 }; 388 445 }; ··· 571 632 /** 572 633 * union iwl_ppag_table_cmd - union for all versions of PPAG command 573 634 * @v1: command version 1 structure. 574 - * @v2: command version from 2 to 6 are same structure as v2. 575 - * but has a different format of the flags bitmap 635 + * @v2: command version 5 structure. 576 636 * @v3: command version 7 structure. 577 637 * @v1.flags: values from &enum iwl_ppag_flags 578 638 * @v1.gain: table of antenna gain values per chain and sub-band ··· 592 654 __le32 flags; 593 655 s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; 594 656 s8 reserved[2]; 595 - } __packed v2; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_2, VER3, VER4, 596 - * VER5, VER6 597 - */ 657 + } __packed v2; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_5 */ 598 658 struct { 599 659 struct bios_value_u32 ppag_config_info; 600 660 s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; ··· 600 664 } __packed v3; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_7 */ 601 665 } __packed; 602 666 603 - #define IWL_PPAG_CMD_V4_MASK (IWL_PPAG_ETSI_MASK | IWL_PPAG_CHINA_MASK) 604 - #define IWL_PPAG_CMD_V5_MASK (IWL_PPAG_CMD_V4_MASK | \ 667 + #define IWL_PPAG_CMD_V1_MASK (IWL_PPAG_ETSI_MASK | IWL_PPAG_CHINA_MASK) 668 + #define IWL_PPAG_CMD_V5_MASK (IWL_PPAG_CMD_V1_MASK | \ 605 669 IWL_PPAG_ETSI_LPI_UHB_MASK | \ 606 670 IWL_PPAG_USA_LPI_UHB_MASK) 607 - 608 - #define IWL_PPAG_CMD_V6_MASK (IWL_PPAG_CMD_V5_MASK | \ 609 - IWL_PPAG_ETSI_VLP_UHB_MASK | \ 610 - IWL_PPAG_ETSI_SP_UHB_MASK | \ 611 - IWL_PPAG_USA_VLP_UHB_MASK | \ 612 - IWL_PPAG_USA_SP_UHB_MASK | \ 613 - IWL_PPAG_CANADA_LPI_UHB_MASK | \ 614 - IWL_PPAG_CANADA_VLP_UHB_MASK | \ 615 - IWL_PPAG_CANADA_SP_UHB_MASK) 616 671 617 672 #define MCC_TO_SAR_OFFSET_TABLE_ROW_SIZE 26 618 673 #define MCC_TO_SAR_OFFSET_TABLE_COL_SIZE 13
+23 -1
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
··· 194 194 }; 195 195 196 196 enum iwl_rx_mpdu_mac_phy_band { 197 + /* whether or not this is MAC or LINK depends on the API */ 197 198 IWL_RX_MPDU_MAC_PHY_BAND_MAC_MASK = 0x0f, 199 + IWL_RX_MPDU_MAC_PHY_BAND_LINK_MASK = 0x0f, 198 200 IWL_RX_MPDU_MAC_PHY_BAND_PHY_MASK = 0x30, 199 201 IWL_RX_MPDU_MAC_PHY_BAND_BAND_MASK = 0xc0, 200 202 }; ··· 673 671 */ 674 672 __le16 phy_info; 675 673 /** 676 - * @mac_phy_band: MAC ID, PHY ID, band; 674 + * @mac_phy_band: MAC/link ID, PHY ID, band; 677 675 * see &enum iwl_rx_mpdu_mac_phy_band 678 676 */ 679 677 u8 mac_phy_band; ··· 1020 1018 u8 reserved[3]; 1021 1019 struct iwl_rfh_queue_data data[]; 1022 1020 } __packed; /* RFH_QUEUE_CONFIG_API_S_VER_1 */ 1021 + 1022 + /** 1023 + * struct iwl_beacon_filter_notif_v1 - beacon filter notification 1024 + * @average_energy: average energy for the received beacon 1025 + * @mac_id: MAC ID the beacon was received for 1026 + */ 1027 + struct iwl_beacon_filter_notif_v1 { 1028 + __le32 average_energy; 1029 + __le32 mac_id; 1030 + } __packed; /* BEACON_FILTER_IN_NTFY_API_S_VER_1 */ 1031 + 1032 + /** 1033 + * struct iwl_beacon_filter_notif - beacon filter notification 1034 + * @average_energy: average energy for the received beacon 1035 + * @link_id: link ID the beacon was received for 1036 + */ 1037 + struct iwl_beacon_filter_notif { 1038 + __le32 average_energy; 1039 + __le32 link_id; 1040 + } __packed; /* BEACON_FILTER_IN_NTFY_API_S_VER_2 */ 1023 1041 1024 1042 #endif /* __iwl_fw_api_rx_h__ */
+3 -3
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 2978 2978 int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, 2979 2979 enum iwl_fw_dbg_trigger trig_type) 2980 2980 { 2981 - if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) 2981 + if (!iwl_trans_device_enabled(fwrt->trans)) 2982 2982 return -EIO; 2983 2983 2984 2984 if (iwl_trans_dbg_ini_valid(fwrt->trans)) { ··· 3180 3180 goto out; 3181 3181 } 3182 3182 3183 - if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) { 3183 + if (!iwl_trans_device_enabled(fwrt->trans)) { 3184 3184 IWL_ERR(fwrt, "Device is not enabled - cannot dump error\n"); 3185 3185 goto out; 3186 3186 } 3187 3187 3188 3188 /* there's no point in fw dump if the bus is dead */ 3189 - if (test_bit(STATUS_TRANS_DEAD, &fwrt->trans->status)) { 3189 + if (iwl_trans_is_dead(fwrt->trans)) { 3190 3190 IWL_ERR(fwrt, "Skip fw error dump since bus is dead\n"); 3191 3191 goto out; 3192 3192 }
+6
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c
··· 389 389 " %d: %d\n", 390 390 IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT, 391 391 has_capa); 392 + has_capa = fw_has_capa(&fw->ucode_capa, 393 + IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE) ? 1 : 0; 394 + seq_printf(seq, 395 + " %d: %d\n", 396 + IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE, 397 + has_capa); 392 398 seq_puts(seq, "fw_api_ver:\n"); 393 399 } 394 400
+2 -2
drivers/net/wireless/intel/iwlwifi/fw/dump.c
··· 199 199 IWL_ERR(trans, "HW error, resetting before reading\n"); 200 200 201 201 /* reset the device */ 202 - err = iwl_trans_sw_reset(trans, true); 202 + err = iwl_trans_sw_reset(trans); 203 203 if (err) 204 204 return; 205 205 ··· 490 490 struct iwl_pc_data *pc_data; 491 491 u8 count; 492 492 493 - if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) { 493 + if (!iwl_trans_device_enabled(fwrt->trans)) { 494 494 IWL_ERR(fwrt, 495 495 "DEVICE_ENABLED bit is not set. Aborting dump.\n"); 496 496 return;
+3
drivers/net/wireless/intel/iwlwifi/fw/file.h
··· 407 407 * for CA from BIOS. 408 408 * @IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT: supports %TAS_UHB_ALLOWED_CANADA 409 409 * @IWL_UCODE_TLV_CAPA_EXT_FSEQ_IMAGE_SUPPORT: external FSEQ image support 410 + * @IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE: Firmware has capability of 411 + * handling raw DSM table data. 410 412 * 411 413 * @NUM_IWL_UCODE_TLV_CAPA: number of bits used 412 414 */ ··· 519 517 * during assert handling even if the dump isn't split 520 518 */ 521 519 IWL_UCODE_TLV_CAPA_RESET_DURING_ASSERT = (__force iwl_ucode_tlv_capa_t)(4 * 32 + 0), 520 + IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE = (__force iwl_ucode_tlv_capa_t)(4 * 32 + 1), 522 521 NUM_IWL_UCODE_TLV_CAPA 523 522 /* 524 523 * This construction make both sparse (which cannot increment the previous
+32 -23
drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
··· 344 344 num_sub_bands = IWL_NUM_SUB_BANDS_V1; 345 345 gain = cmd->v1.gain[0]; 346 346 *cmd_size = sizeof(cmd->v1); 347 - cmd->v1.flags = cpu_to_le32(fwrt->ppag_flags); 347 + cmd->v1.flags = cpu_to_le32(fwrt->ppag_flags & IWL_PPAG_CMD_V1_MASK); 348 348 if (fwrt->ppag_bios_rev >= 1) { 349 349 /* in this case FW supports revision 0 */ 350 350 IWL_DEBUG_RADIO(fwrt, 351 351 "PPAG table rev is %d, send truncated table\n", 352 352 fwrt->ppag_bios_rev); 353 353 } 354 - } else if (cmd_ver >= 2 && cmd_ver <= 6) { 354 + } else if (cmd_ver == 5) { 355 355 num_sub_bands = IWL_NUM_SUB_BANDS_V2; 356 356 gain = cmd->v2.gain[0]; 357 357 *cmd_size = sizeof(cmd->v2); 358 - cmd->v2.flags = cpu_to_le32(fwrt->ppag_flags); 358 + cmd->v2.flags = cpu_to_le32(fwrt->ppag_flags & IWL_PPAG_CMD_V5_MASK); 359 359 if (fwrt->ppag_bios_rev == 0) { 360 360 /* in this case FW supports revisions 1,2 or 3 */ 361 361 IWL_DEBUG_RADIO(fwrt, ··· 378 378 "PPAG MODE bits were read from bios: %d\n", 379 379 fwrt->ppag_flags); 380 380 381 - if (cmd_ver == 6) 382 - cmd->v1.flags &= cpu_to_le32(IWL_PPAG_CMD_V6_MASK); 383 - else if (cmd_ver == 5) 384 - cmd->v1.flags &= cpu_to_le32(IWL_PPAG_CMD_V5_MASK); 385 - else if (cmd_ver < 5) 386 - cmd->v1.flags &= cpu_to_le32(IWL_PPAG_CMD_V4_MASK); 387 - 388 - if ((cmd_ver == 1 && 389 - !fw_has_capa(&fwrt->fw->ucode_capa, 390 - IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) || 391 - (cmd_ver == 2 && fwrt->ppag_bios_rev >= 2)) { 381 + if (cmd_ver == 1 && 382 + !fw_has_capa(&fwrt->fw->ucode_capa, 383 + IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) { 392 384 cmd->v1.flags &= cpu_to_le32(IWL_PPAG_ETSI_MASK); 393 385 IWL_DEBUG_RADIO(fwrt, "masking ppag China bit\n"); 394 386 } else { ··· 571 579 { 572 580 int ret; 573 581 u32 value; 582 + bool has_raw_dsm_capa = fw_has_capa(&fwrt->fw->ucode_capa, 583 + IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE); 574 584 u8 cmd_ver = iwl_fw_lookup_cmd_ver(fwrt->fw, 575 585 WIDE_ID(REGULATORY_AND_NVM_GROUP, 576 586 LARI_CONFIG_CHANGE), 1); ··· 587 593 cmd->config_bitmap = iwl_get_lari_config_bitmap(fwrt); 588 594 589 595 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_11AX_ENABLEMENT, &value); 590 - if (!ret) 596 + if (!ret) { 597 + if (!has_raw_dsm_capa) 598 + value &= DSM_11AX_ALLOW_BITMAP; 591 599 cmd->oem_11ax_allow_bitmap = cpu_to_le32(value); 600 + } 592 601 593 602 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII4_CHAN, &value); 594 603 if (!ret) { 595 - value &= DSM_UNII4_ALLOW_BITMAP; 604 + if (!has_raw_dsm_capa) 605 + value &= DSM_UNII4_ALLOW_BITMAP; 596 606 597 607 /* Since version 9, bits 4 and 5 are supported 598 - * regardless of this capability. 608 + * regardless of this capability, By pass this masking 609 + * if firmware has capability of accepting raw DSM table. 599 610 */ 600 - if (cmd_ver < 9 && 611 + if (!has_raw_dsm_capa && cmd_ver < 9 && 601 612 !fw_has_capa(&fwrt->fw->ucode_capa, 602 613 IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA)) 603 614 value &= ~(DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK | ··· 613 614 614 615 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ACTIVATE_CHANNEL, &value); 615 616 if (!ret) { 616 - if (cmd_ver < 8) 617 + if (!has_raw_dsm_capa) 618 + value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V12; 619 + 620 + if (!has_raw_dsm_capa && cmd_ver < 8) 617 621 value &= ~ACTIVATE_5G2_IN_WW_MASK; 618 622 619 623 /* Since version 12, bits 5 and 6 are supported 620 - * regardless of this capability. 624 + * regardless of this capability, By pass this masking 625 + * if firmware has capability of accepting raw DSM table. 621 626 */ 622 - if (cmd_ver < 12 && 627 + if (!has_raw_dsm_capa && cmd_ver < 12 && 623 628 !fw_has_capa(&fwrt->fw->ucode_capa, 624 629 IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA)) 625 630 value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V11; ··· 636 633 cmd->oem_uhb_allow_bitmap = cpu_to_le32(value); 637 634 638 635 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_FORCE_DISABLE_CHANNELS, &value); 639 - if (!ret) 636 + if (!ret) { 637 + if (!has_raw_dsm_capa) 638 + value &= DSM_FORCE_DISABLE_CHANNELS_ALLOWED_BITMAP; 640 639 cmd->force_disable_channels_bitmap = cpu_to_le32(value); 640 + } 641 641 642 642 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENERGY_DETECTION_THRESHOLD, 643 643 &value); 644 - if (!ret) 644 + if (!ret) { 645 + if (!has_raw_dsm_capa) 646 + value &= DSM_EDT_ALLOWED_BITMAP; 645 647 cmd->edt_bitmap = cpu_to_le32(value); 648 + } 646 649 647 650 ret = iwl_bios_get_wbem(fwrt, &value); 648 651 if (!ret)
+4
drivers/net/wireless/intel/iwlwifi/fw/regulatory.h
··· 159 159 DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK |\ 160 160 DSM_VALUE_UNII4_CANADA_EN_MSK) 161 161 162 + #define DSM_11AX_ALLOW_BITMAP 0xF 163 + #define DSM_EDT_ALLOWED_BITMAP 0x7ffff0 164 + #define DSM_FORCE_DISABLE_CHANNELS_ALLOWED_BITMAP 0x7FF 165 + 162 166 enum iwl_dsm_values_rfi { 163 167 DSM_VALUE_RFI_DLVR_DISABLE = BIT(0), 164 168 DSM_VALUE_RFI_DDR_DISABLE = BIT(1),
+7 -3
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
··· 301 301 const struct iwl_family_base_params *base = trans->mac_cfg->base; 302 302 const struct iwl_rf_cfg *cfg = trans->cfg; 303 303 304 - if (!base->ucode_api_max) { 304 + /* if the MAC doesn't have range or if its range it higher than the RF's */ 305 + if (!base->ucode_api_max || 306 + (cfg->ucode_api_max && base->ucode_api_min > cfg->ucode_api_max)) { 305 307 *api_min = cfg->ucode_api_min; 306 308 *api_max = cfg->ucode_api_max; 307 309 return; 308 310 } 309 311 310 - if (!cfg->ucode_api_max) { 312 + /* if the RF doesn't have range or if its range it higher than the MAC's */ 313 + if (!cfg->ucode_api_max || 314 + (base->ucode_api_max && cfg->ucode_api_min > base->ucode_api_max)) { 311 315 *api_min = base->ucode_api_min; 312 316 *api_max = base->ucode_api_max; 313 317 return; ··· 1545 1541 if (!IS_ERR(op_mode)) 1546 1542 return op_mode; 1547 1543 1548 - if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status)) 1544 + if (iwl_trans_is_dead(drv->trans)) 1549 1545 break; 1550 1546 1551 1547 #ifdef CONFIG_IWLWIFI_DEBUGFS
+1 -1
drivers/net/wireless/intel/iwlwifi/iwl-io.c
··· 54 54 55 55 do { 56 56 if ((iwl_read32(trans, addr) & mask) == (bits & mask)) 57 - return t; 57 + return 0; 58 58 udelay(IWL_POLL_INTERVAL); 59 59 t += IWL_POLL_INTERVAL; 60 60 } while (t < timeout);
+15 -63
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
··· 663 663 .phy_cap_info[9] = 664 664 IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | 665 665 IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB | 666 + IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU | 667 + IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU | 666 668 (IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED << 667 669 IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS), 668 670 .phy_cap_info[10] = ··· 693 691 .has_eht = true, 694 692 .eht_cap_elem = { 695 693 .mac_cap_info[0] = 696 - IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS | 697 - IEEE80211_EHT_MAC_CAP0_OM_CONTROL | 698 - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | 699 - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 | 700 - IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC, 701 - .mac_cap_info[1] = 702 - IEEE80211_EHT_MAC_CAP1_UNSOL_EPCS_PRIO_ACCESS, 694 + IEEE80211_EHT_MAC_CAP0_OM_CONTROL, 703 695 .phy_cap_info[0] = 704 696 IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | 705 697 IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI | 706 - IEEE80211_EHT_PHY_CAP0_PARTIAL_BW_UL_MU_MIMO | 707 698 IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE | 708 699 IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK, 709 700 .phy_cap_info[1] = 710 701 IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK | 711 702 IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK, 712 703 .phy_cap_info[3] = 713 - IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK | 714 - IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK | 715 - IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK | 716 - IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK | 717 - IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK | 718 - IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK | 719 - IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK, 704 + IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK, 720 705 721 706 .phy_cap_info[4] = 722 - IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO | 723 - IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP | 724 707 IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI, 725 708 .phy_cap_info[5] = 726 709 FIELD_PREP_CONST(IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK, 727 710 IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US) | 728 - IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK | 729 711 IEEE80211_EHT_PHY_CAP5_TX_LESS_242_TONE_RU_SUPP | 730 - IEEE80211_EHT_PHY_CAP5_RX_LESS_242_TONE_RU_SUPP, 731 - .phy_cap_info[6] = 732 - IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK | 733 - IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP, 712 + IEEE80211_EHT_PHY_CAP5_RX_LESS_242_TONE_RU_SUPP | 713 + IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF, 734 714 .phy_cap_info[8] = 735 715 IEEE80211_EHT_PHY_CAP8_RX_1024QAM_WIDER_BW_DL_OFDMA | 736 716 IEEE80211_EHT_PHY_CAP8_RX_4096QAM_WIDER_BW_DL_OFDMA, ··· 780 796 IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | 781 797 IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242, 782 798 .phy_cap_info[9] = 799 + IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU | 783 800 IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 784 801 << IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS, 785 802 }, ··· 807 822 .has_eht = true, 808 823 .eht_cap_elem = { 809 824 .mac_cap_info[0] = 810 - IEEE80211_EHT_MAC_CAP0_OM_CONTROL | 811 - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | 812 - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2, 825 + IEEE80211_EHT_MAC_CAP0_OM_CONTROL, 813 826 .phy_cap_info[0] = 814 827 IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | 815 828 IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI, ··· 1022 1039 cpu_to_le16(IEEE80211_HE_MCS_NOT_SUPPORTED << 2); 1023 1040 } 1024 1041 1042 + /* prior RFs don't have HE, HR RF doesn't have this, later have it */ 1043 + if (CSR_HW_RFID_TYPE(trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_HR1 || 1044 + CSR_HW_RFID_TYPE(trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_HR2) 1045 + iftype_data->he_cap.he_cap_elem.phy_cap_info[9] &= 1046 + ~(IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU | 1047 + IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU); 1048 + 1025 1049 if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210 && !is_ap) 1026 1050 iftype_data->he_cap.he_cap_elem.phy_cap_info[2] |= 1027 1051 IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO; 1028 - 1029 - switch (CSR_HW_RFID_TYPE(trans->info.hw_rf_id)) { 1030 - case IWL_CFG_RF_TYPE_GF: 1031 - case IWL_CFG_RF_TYPE_FM: 1032 - case IWL_CFG_RF_TYPE_WH: 1033 - case IWL_CFG_RF_TYPE_PE: 1034 - iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |= 1035 - IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU; 1036 - if (!is_ap) 1037 - iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |= 1038 - IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU; 1039 - break; 1040 - } 1041 - 1042 - if (CSR_HW_REV_TYPE(trans->info.hw_rev) == IWL_CFG_MAC_TYPE_GL && 1043 - iftype_data->eht_cap.has_eht) { 1044 - iftype_data->eht_cap.eht_cap_elem.mac_cap_info[0] &= 1045 - ~(IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | 1046 - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2); 1047 - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[3] &= 1048 - ~(IEEE80211_EHT_PHY_CAP0_PARTIAL_BW_UL_MU_MIMO | 1049 - IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK | 1050 - IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK | 1051 - IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK | 1052 - IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK | 1053 - IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK | 1054 - IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK); 1055 - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[4] &= 1056 - ~(IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO | 1057 - IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP); 1058 - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[5] &= 1059 - ~IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK; 1060 - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[6] &= 1061 - ~(IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK | 1062 - IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP); 1063 - iftype_data->eht_cap.eht_cap_elem.phy_cap_info[5] |= 1064 - IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF; 1065 - } 1066 1052 1067 1053 if (fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_BROADCAST_TWT)) 1068 1054 iftype_data->he_cap.he_cap_elem.mac_cap_info[2] |=
+6 -3
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
··· 419 419 { 420 420 might_sleep(); 421 421 422 - iwl_trans_pcie_op_mode_leave(trans); 422 + if (trans->mac_cfg->gen2) 423 + iwl_trans_pcie_gen2_op_mode_leave(trans); 424 + else 425 + iwl_trans_pcie_op_mode_leave(trans); 423 426 424 427 cancel_delayed_work_sync(&trans->restart.wk); 425 428 ··· 498 495 } 499 496 IWL_EXPORT_SYMBOL(iwl_trans_set_pmi); 500 497 501 - int iwl_trans_sw_reset(struct iwl_trans *trans, bool retake_ownership) 498 + int iwl_trans_sw_reset(struct iwl_trans *trans) 502 499 { 503 - return iwl_trans_pcie_sw_reset(trans, retake_ownership); 500 + return iwl_trans_pcie_sw_reset(trans, true); 504 501 } 505 502 IWL_EXPORT_SYMBOL(iwl_trans_sw_reset); 506 503
+16 -1
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
··· 1096 1096 1097 1097 void iwl_trans_set_pmi(struct iwl_trans *trans, bool state); 1098 1098 1099 - int iwl_trans_sw_reset(struct iwl_trans *trans, bool retake_ownership); 1099 + int iwl_trans_sw_reset(struct iwl_trans *trans); 1100 1100 1101 1101 void iwl_trans_set_bits_mask(struct iwl_trans *trans, u32 reg, 1102 1102 u32 mask, u32 value); ··· 1228 1228 if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) 1229 1229 return 2 * result; 1230 1230 return result; 1231 + } 1232 + 1233 + static inline void iwl_trans_suppress_cmd_error_once(struct iwl_trans *trans) 1234 + { 1235 + set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &trans->status); 1236 + } 1237 + 1238 + static inline bool iwl_trans_device_enabled(struct iwl_trans *trans) 1239 + { 1240 + return test_bit(STATUS_DEVICE_ENABLED, &trans->status); 1241 + } 1242 + 1243 + static inline bool iwl_trans_is_dead(struct iwl_trans *trans) 1244 + { 1245 + return test_bit(STATUS_TRANS_DEAD, &trans->status); 1231 1246 } 1232 1247 1233 1248 /*****************************************************
+17 -7
drivers/net/wireless/intel/iwlwifi/mld/ap.c
··· 294 294 if (ret) 295 295 return ret; 296 296 297 + mld_vif->ap_ibss_active = true; 298 + 299 + if (vif->p2p && mld->p2p_device_vif) { 300 + ret = iwl_mld_mac_fw_action(mld, mld->p2p_device_vif, 301 + FW_CTXT_ACTION_MODIFY); 302 + if (ret) { 303 + mld_vif->ap_ibss_active = false; 304 + goto rm_mcast; 305 + } 306 + } 307 + 297 308 ret = iwl_mld_add_bcast_sta(mld, vif, link); 298 309 if (ret) 299 - goto rm_mcast; 310 + goto update_p2p_dev; 300 311 301 312 /* Those keys were configured by the upper layers before starting the 302 313 * AP. Now that it is started and the bcast and mcast sta were added to ··· 321 310 iwl_mld_vif_update_low_latency(mld, vif, true, 322 311 LOW_LATENCY_VIF_TYPE); 323 312 324 - mld_vif->ap_ibss_active = true; 325 - 326 - if (vif->p2p && mld->p2p_device_vif) 327 - return iwl_mld_mac_fw_action(mld, mld->p2p_device_vif, 328 - FW_CTXT_ACTION_MODIFY); 329 - 330 313 /* When the channel context was added, the link is not yet active, so 331 314 * min_def is always used. Update the PHY again here in case def should 332 315 * actually be used. ··· 331 326 return 0; 332 327 rm_bcast: 333 328 iwl_mld_remove_bcast_sta(mld, vif, link); 329 + update_p2p_dev: 330 + mld_vif->ap_ibss_active = false; 331 + if (vif->p2p && mld->p2p_device_vif) 332 + iwl_mld_mac_fw_action(mld, mld->p2p_device_vif, 333 + FW_CTXT_ACTION_MODIFY); 334 334 rm_mcast: 335 335 iwl_mld_remove_mcast_sta(mld, vif, link); 336 336 return ret;
+6 -2
drivers/net/wireless/intel/iwlwifi/mld/coex.c
··· 24 24 void iwl_mld_handle_bt_coex_notif(struct iwl_mld *mld, 25 25 struct iwl_rx_packet *pkt) 26 26 { 27 - const struct iwl_bt_coex_profile_notif *notif = (const void *)pkt->data; 27 + const struct iwl_bt_coex_profile_notif *notif = (void *)pkt->data; 28 28 const struct iwl_bt_coex_profile_notif zero_notif = {}; 29 29 /* zeroed structure means that BT is OFF */ 30 30 bool bt_is_active = memcmp(notif, &zero_notif, sizeof(*notif)); 31 31 32 - mld->last_bt_notif = *notif; 32 + if (bt_is_active == mld->bt_is_active) 33 + return; 34 + 33 35 IWL_DEBUG_INFO(mld, "BT was turned %s\n", bt_is_active ? "ON" : "OFF"); 36 + 37 + mld->bt_is_active = bt_is_active; 34 38 35 39 iwl_mld_emlsr_check_bt(mld); 36 40 }
+39 -73
drivers/net/wireless/intel/iwlwifi/mld/d3.c
··· 647 647 } 648 648 649 649 static void 650 - iwl_mld_d3_update_mcast_key(struct iwl_mld *mld, 651 - struct ieee80211_vif *vif, 652 - struct iwl_mld_wowlan_status *wowlan_status, 653 - struct ieee80211_key_conf *key, 654 - struct iwl_mld_mcast_key_data *key_data) 655 - { 656 - if (key->keyidx != key_data->id && 657 - (key->keyidx < 4 || key->keyidx > 5)) { 658 - IWL_ERR(mld, 659 - "Unexpected keyId mismatch. Old keyId:%d, New keyId:%d\n", 660 - key->keyidx, key_data->id); 661 - return; 662 - } 663 - 664 - /* All installed keys are sent by the FW, even weren't 665 - * rekeyed during D3. 666 - * We remove an existing key if it has the same index as 667 - * a new key and a rekey has occurred during d3 668 - */ 669 - if (wowlan_status->num_of_gtk_rekeys && key_data->len) { 670 - if (key->keyidx == 4 || key->keyidx == 5) { 671 - struct iwl_mld_vif *mld_vif = 672 - iwl_mld_vif_from_mac80211(vif); 673 - struct iwl_mld_link *mld_link; 674 - int link_id = vif->active_links ? 675 - __ffs(vif->active_links) : 0; 676 - 677 - mld_link = iwl_mld_link_dereference_check(mld_vif, 678 - link_id); 679 - if (WARN_ON(!mld_link)) 680 - return; 681 - 682 - if (mld_link->igtk == key) 683 - mld_link->igtk = NULL; 684 - mld->num_igtks--; 685 - } 686 - 687 - ieee80211_remove_key(key); 688 - return; 689 - } 690 - 691 - iwl_mld_set_key_rx_seq(key, key_data); 692 - } 693 - 694 - static void 695 650 iwl_mld_update_ptk_rx_seq(struct iwl_mld *mld, 696 651 struct iwl_mld_wowlan_status *wowlan_status, 697 652 struct ieee80211_sta *sta, ··· 714 759 715 760 data->gtk_cipher = key->cipher; 716 761 status_idx = key->keyidx == wowlan_status->gtk[1].id; 717 - iwl_mld_d3_update_mcast_key(data->mld, vif, wowlan_status, key, 718 - &wowlan_status->gtk[status_idx]); 762 + iwl_mld_set_key_rx_seq(key, &wowlan_status->gtk[status_idx]); 719 763 break; 720 764 case WLAN_CIPHER_SUITE_BIP_GMAC_128: 721 765 case WLAN_CIPHER_SUITE_BIP_GMAC_256: ··· 726 772 return; 727 773 728 774 data->igtk_cipher = key->cipher; 729 - iwl_mld_d3_update_mcast_key(data->mld, vif, 730 - wowlan_status, 731 - key, &wowlan_status->igtk); 775 + if (key->keyidx == wowlan_status->igtk.id) 776 + iwl_mld_set_key_rx_seq(key, &wowlan_status->igtk); 732 777 } 733 778 if (key->keyidx == 6 || key->keyidx == 7) { 734 779 if (WARN_ON(data->bigtk_cipher && ··· 736 783 737 784 data->bigtk_cipher = key->cipher; 738 785 status_idx = key->keyidx == wowlan_status->bigtk[1].id; 739 - iwl_mld_d3_update_mcast_key(data->mld, vif, 740 - wowlan_status, key, 741 - &wowlan_status->bigtk[status_idx]); 786 + iwl_mld_set_key_rx_seq(key, &wowlan_status->bigtk[status_idx]); 742 787 } 743 788 break; 744 789 default: ··· 746 795 data->num_keys++; 747 796 } 748 797 749 - static bool 798 + static void 750 799 iwl_mld_add_mcast_rekey(struct ieee80211_vif *vif, 751 800 struct iwl_mld *mld, 752 801 struct iwl_mld_mcast_key_data *key_data, ··· 773 822 BUILD_BUG_ON(sizeof(conf.key) < sizeof(key_data->key)); 774 823 775 824 if (!key_data->len) 776 - return true; 825 + return; 777 826 778 827 switch (cipher) { 779 828 case WLAN_CIPHER_SUITE_CCMP: ··· 805 854 memcpy(conf.conf.key, key_data->key, conf.conf.keylen); 806 855 key_config = ieee80211_gtk_rekey_add(vif, &conf.conf, link_id); 807 856 if (IS_ERR(key_config)) 808 - return false; 857 + return; 809 858 810 859 iwl_mld_set_key_rx_seq(key_config, key_data); 811 860 ··· 813 862 if (key_config->keyidx == 4 || key_config->keyidx == 5) { 814 863 struct iwl_mld_link *mld_link = 815 864 iwl_mld_link_from_mac80211(link_conf); 816 - mld_link->igtk = key_config; 817 - mld->num_igtks++; 865 + 866 + /* If we had more than one rekey, mac80211 will tell us to 867 + * remove the old and add the new so we will update the IGTK in 868 + * drv_set_key 869 + */ 870 + if (mld_link->igtk && mld_link->igtk != key_config) { 871 + /* mark the old IGTK as not in FW */ 872 + mld_link->igtk->hw_key_idx = STA_KEY_IDX_INVALID; 873 + mld_link->igtk = key_config; 874 + } 818 875 } 819 - return true; 876 + 877 + /* Also keep track of the new BIGTK */ 878 + if ((key_config->keyidx == 6 || key_config->keyidx == 7) && 879 + vif->type == NL80211_IFTYPE_STATION) { 880 + struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif); 881 + 882 + rcu_assign_pointer(mld_vif->bigtks[key_config->keyidx - 6], key_config); 883 + } 820 884 } 821 885 822 886 static void ··· 843 877 int i; 844 878 845 879 for (i = 0; i < ARRAY_SIZE(wowlan_status->gtk); i++) 846 - if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 847 - &wowlan_status->gtk[i], 848 - link_conf, 849 - key_iter_data->gtk_cipher)) 850 - return; 880 + iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 881 + &wowlan_status->gtk[i], 882 + link_conf, 883 + key_iter_data->gtk_cipher); 851 884 852 - if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 853 - &wowlan_status->igtk, 854 - link_conf, key_iter_data->igtk_cipher)) 855 - return; 885 + iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 886 + &wowlan_status->igtk, 887 + link_conf, key_iter_data->igtk_cipher); 856 888 857 889 for (i = 0; i < ARRAY_SIZE(wowlan_status->bigtk); i++) 858 - if (!iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 859 - &wowlan_status->bigtk[i], 860 - link_conf, 861 - key_iter_data->bigtk_cipher)) 862 - return; 890 + iwl_mld_add_mcast_rekey(vif, key_iter_data->mld, 891 + &wowlan_status->bigtk[i], 892 + link_conf, 893 + key_iter_data->bigtk_cipher); 863 894 } 864 895 865 896 static bool ··· 1814 1851 goto err; 1815 1852 } 1816 1853 1854 + mld->fw_status.resuming = true; 1817 1855 mld->fw_status.in_d3 = false; 1818 1856 mld->scan.last_start_time_jiffies = jiffies; 1819 1857 ··· 1890 1926 mld->fw_status.in_hw_restart = true; 1891 1927 ret = 1; 1892 1928 out: 1929 + mld->fw_status.resuming = false; 1930 + 1893 1931 if (resume_data.wowlan_status) { 1894 1932 kfree(resume_data.wowlan_status->wake_packet); 1895 1933 kfree(resume_data.wowlan_status);
+1 -1
drivers/net/wireless/intel/iwlwifi/mld/debugfs.c
··· 86 86 87 87 if (count == 6 && !strcmp(buf, "nolog\n")) { 88 88 mld->fw_status.do_not_dump_once = true; 89 - set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &mld->trans->status); 89 + iwl_trans_suppress_cmd_error_once(mld->trans); 90 90 } 91 91 92 92 /* take the return value to make compiler happy - it will
+12
drivers/net/wireless/intel/iwlwifi/mld/key.c
··· 129 129 bool tkip = key->cipher == WLAN_CIPHER_SUITE_TKIP; 130 130 int max_key_len = sizeof(cmd.u.add.key); 131 131 132 + #ifdef CONFIG_PM_SLEEP 133 + /* If there was a rekey in wowlan, FW already has the key */ 134 + if (mld->fw_status.resuming) 135 + return 0; 136 + #endif 137 + 132 138 if (WARN_ON(!sta_mask)) 133 139 return -EINVAL; 134 140 ··· 165 159 .u.remove.key_id = cpu_to_le32(keyidx), 166 160 .u.remove.key_flags = cpu_to_le32(key_flags), 167 161 }; 162 + 163 + #ifdef CONFIG_PM_SLEEP 164 + /* If there was a rekey in wowlan, FW already removed the key */ 165 + if (mld->fw_status.resuming) 166 + return; 167 + #endif 168 168 169 169 if (WARN_ON(!sta_mask)) 170 170 return;
+49 -1
drivers/net/wireless/intel/iwlwifi/mld/link.c
··· 649 649 void iwl_mld_handle_omi_status_notif(struct iwl_mld *mld, 650 650 struct iwl_rx_packet *pkt) 651 651 { 652 + int ver = iwl_fw_lookup_notif_ver(mld->fw, DATA_PATH_GROUP, 653 + OMI_SEND_STATUS_NOTIF, 1); 652 654 struct ieee80211_link_sta *link_sta; 653 655 struct iwl_mld_link *mld_link; 654 656 struct ieee80211_vif *vif; 655 657 656 - vif = iwl_mld_get_omi_bw_reduction_pointers(mld, &link_sta, &mld_link); 658 + if (ver == 2) { 659 + const struct iwl_omi_send_status_notif *notif = 660 + (const void *)pkt->data; 661 + u32 sta_id = le32_to_cpu(notif->sta_id); 662 + struct iwl_mld_vif *mld_vif; 663 + 664 + if (IWL_FW_CHECK(mld, sta_id >= mld->fw->ucode_capa.num_stations, 665 + "Invalid station %d\n", sta_id)) 666 + return; 667 + 668 + link_sta = wiphy_dereference(mld->wiphy, 669 + mld->fw_id_to_link_sta[sta_id]); 670 + if (IWL_FW_CHECK(mld, !link_sta, "Station does not exist\n")) 671 + return; 672 + 673 + vif = iwl_mld_sta_from_mac80211(link_sta->sta)->vif; 674 + mld_vif = iwl_mld_vif_from_mac80211(vif); 675 + 676 + mld_link = iwl_mld_link_dereference_check(mld_vif, 677 + link_sta->link_id); 678 + if (WARN(!mld_link, "Link %d does not exist\n", 679 + link_sta->link_id)) 680 + return; 681 + } else { 682 + vif = iwl_mld_get_omi_bw_reduction_pointers(mld, &link_sta, 683 + &mld_link); 684 + } 657 685 if (IWL_FW_CHECK(mld, !vif, "unexpected OMI notification\n")) 658 686 return; 659 687 ··· 811 783 { 812 784 mld_link->vif = link->vif; 813 785 mld_link->link_id = link->link_id; 786 + mld_link->average_beacon_energy = 0; 814 787 815 788 iwl_mld_init_internal_sta(&mld_link->bcast_sta); 816 789 iwl_mld_init_internal_sta(&mld_link->mcast_sta); ··· 1245 1216 return grade; 1246 1217 } 1247 1218 EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mld_get_link_grade); 1219 + 1220 + void iwl_mld_handle_beacon_filter_notif(struct iwl_mld *mld, 1221 + struct iwl_rx_packet *pkt) 1222 + { 1223 + const struct iwl_beacon_filter_notif *notif = (const void *)pkt->data; 1224 + u32 link_id = le32_to_cpu(notif->link_id); 1225 + struct ieee80211_bss_conf *link_conf = 1226 + iwl_mld_fw_id_to_link_conf(mld, link_id); 1227 + struct iwl_mld_link *mld_link; 1228 + 1229 + if (IWL_FW_CHECK(mld, !link_conf, "invalid link ID %d\n", link_id)) 1230 + return; 1231 + 1232 + mld_link = iwl_mld_link_from_mac80211(link_conf); 1233 + if (WARN_ON_ONCE(!mld_link)) 1234 + return; 1235 + 1236 + mld_link->average_beacon_energy = le32_to_cpu(notif->average_energy); 1237 + }
+6
drivers/net/wireless/intel/iwlwifi/mld/link.h
··· 41 41 * @mcast_sta: station used for multicast packets. Used in AP, GO and IBSS. 42 42 * @mon_sta: station used for TX injection in monitor interface. 43 43 * @link_id: over the air link ID 44 + * @average_beacon_energy: average beacon energy for beacons received during 45 + * client connections 44 46 * @ap_early_keys: The firmware cannot install keys before bcast/mcast STAs, 45 47 * but higher layers work differently, so we store the keys here for 46 48 * later installation. ··· 87 85 88 86 /* we can only have 2 GTK + 2 IGTK + 2 BIGTK active at a time */ 89 87 struct ieee80211_key_conf *ap_early_keys[6]; 88 + u32 average_beacon_energy; 90 89 bool silent_deactivation; 91 90 struct iwl_probe_resp_data __rcu *probe_resp_data; 92 91 }; ··· 152 149 void iwl_mld_omi_ap_changed_bw(struct iwl_mld *mld, 153 150 struct ieee80211_bss_conf *link_conf, 154 151 enum ieee80211_sta_rx_bandwidth bw); 152 + 153 + void iwl_mld_handle_beacon_filter_notif(struct iwl_mld *mld, 154 + struct iwl_rx_packet *pkt); 155 155 156 156 #endif /* __iwl_mld_link_h__ */
+11 -55
drivers/net/wireless/intel/iwlwifi/mld/mcc.c
··· 15 15 16 16 /* It is the caller's responsibility to free the pointer returned here */ 17 17 static struct iwl_mcc_update_resp_v8 * 18 - iwl_mld_parse_mcc_update_resp_v8(const struct iwl_rx_packet *pkt) 18 + iwl_mld_copy_mcc_resp(const struct iwl_rx_packet *pkt) 19 19 { 20 20 const struct iwl_mcc_update_resp_v8 *mcc_resp_v8 = (const void *)pkt->data; 21 21 int n_channels = __le32_to_cpu(mcc_resp_v8->n_channels); ··· 34 34 35 35 /* It is the caller's responsibility to free the pointer returned here */ 36 36 static struct iwl_mcc_update_resp_v8 * 37 - iwl_mld_parse_mcc_update_resp_v5_v6(const struct iwl_rx_packet *pkt) 38 - { 39 - const struct iwl_mcc_update_resp_v4 *mcc_resp_v4 = (const void *)pkt->data; 40 - struct iwl_mcc_update_resp_v8 *resp_cp; 41 - int n_channels = __le32_to_cpu(mcc_resp_v4->n_channels); 42 - int resp_len; 43 - 44 - if (iwl_rx_packet_payload_len(pkt) != 45 - struct_size(mcc_resp_v4, channels, n_channels)) 46 - return ERR_PTR(-EINVAL); 47 - 48 - resp_len = struct_size(resp_cp, channels, n_channels); 49 - resp_cp = kzalloc(resp_len, GFP_KERNEL); 50 - if (!resp_cp) 51 - return ERR_PTR(-ENOMEM); 52 - 53 - resp_cp->status = mcc_resp_v4->status; 54 - resp_cp->mcc = mcc_resp_v4->mcc; 55 - resp_cp->cap = cpu_to_le32(le16_to_cpu(mcc_resp_v4->cap)); 56 - resp_cp->source_id = mcc_resp_v4->source_id; 57 - resp_cp->geo_info = mcc_resp_v4->geo_info; 58 - resp_cp->n_channels = mcc_resp_v4->n_channels; 59 - memcpy(resp_cp->channels, mcc_resp_v4->channels, 60 - n_channels * sizeof(__le32)); 61 - 62 - return resp_cp; 63 - } 64 - 65 - /* It is the caller's responsibility to free the pointer returned here */ 66 - static struct iwl_mcc_update_resp_v8 * 67 37 iwl_mld_update_mcc(struct iwl_mld *mld, const char *alpha2, 68 38 enum iwl_mcc_source src_id) 69 39 { 70 - int resp_ver = iwl_fw_lookup_notif_ver(mld->fw, LONG_GROUP, 71 - MCC_UPDATE_CMD, 0); 72 40 struct iwl_mcc_update_cmd mcc_update_cmd = { 73 41 .mcc = cpu_to_le16(alpha2[0] << 8 | alpha2[1]), 74 42 .source_id = (u8)src_id, ··· 61 93 62 94 pkt = cmd.resp_pkt; 63 95 64 - /* For Wifi-7 radios, we get version 8 65 - * For Wifi-6E radios, we get version 6 66 - * For Wifi-6 radios, we get version 5, but 5, 6, and 4 are compatible. 67 - */ 68 - switch (resp_ver) { 69 - case 5: 70 - case 6: 71 - resp_cp = iwl_mld_parse_mcc_update_resp_v5_v6(pkt); 72 - break; 73 - case 8: 74 - resp_cp = iwl_mld_parse_mcc_update_resp_v8(pkt); 75 - break; 76 - default: 77 - IWL_FW_CHECK_FAILED(mld, "Unknown MCC_UPDATE_CMD version %d\n", resp_ver); 78 - resp_cp = ERR_PTR(-EINVAL); 79 - } 80 - 96 + resp_cp = iwl_mld_copy_mcc_resp(pkt); 81 97 if (IS_ERR(resp_cp)) 82 98 goto exit; 83 99 ··· 129 177 130 178 mld->mcc_src = resp->source_id; 131 179 132 - if (!iwl_puncturing_is_allowed_in_bios(mld->bios_enable_puncturing, 133 - le16_to_cpu(resp->mcc))) 134 - ieee80211_hw_set(mld->hw, DISALLOW_PUNCTURING); 135 - else 136 - __clear_bit(IEEE80211_HW_DISALLOW_PUNCTURING, mld->hw->flags); 180 + /* FM is the earliest supported and later always do puncturing */ 181 + if (CSR_HW_RFID_TYPE(mld->trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_FM) { 182 + if (!iwl_puncturing_is_allowed_in_bios(mld->bios_enable_puncturing, 183 + le16_to_cpu(resp->mcc))) 184 + ieee80211_hw_set(mld->hw, DISALLOW_PUNCTURING); 185 + else 186 + __clear_bit(IEEE80211_HW_DISALLOW_PUNCTURING, 187 + mld->hw->flags); 188 + } 137 189 138 190 out: 139 191 kfree(resp);
+2 -1
drivers/net/wireless/intel/iwlwifi/mld/mld.c
··· 255 255 HCMD_NAME(ESR_MODE_NOTIF), 256 256 HCMD_NAME(MONITOR_NOTIF), 257 257 HCMD_NAME(TLC_MNG_UPDATE_NOTIF), 258 + HCMD_NAME(BEACON_FILTER_IN_NOTIF), 258 259 HCMD_NAME(MU_GROUP_MGMT_NOTIF), 259 260 }; 260 261 ··· 631 630 enum iwl_fw_error_type type) 632 631 { 633 632 struct iwl_mld *mld = IWL_OP_MODE_GET_MLD(op_mode); 634 - bool trans_dead = test_bit(STATUS_TRANS_DEAD, &mld->trans->status); 633 + bool trans_dead = iwl_trans_is_dead(mld->trans); 635 634 636 635 if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL) 637 636 IWL_ERR(mld, "Command queue full!\n");
+4 -2
drivers/net/wireless/intel/iwlwifi/mld/mld.h
··· 127 127 * cleanup using iwl_mld_free_internal_sta 128 128 * @netdetect: indicates the FW is in suspend mode with netdetect configured 129 129 * @p2p_device_vif: points to the p2p device vif if exists 130 + * @bt_is_active: indicates that BT is active 130 131 * @dev: pointer to device struct. For printing purposes 131 132 * @trans: pointer to the transport layer 132 133 * @cfg: pointer to the device configuration ··· 150 149 * @running: true if the firmware is running 151 150 * @do_not_dump_once: true if firmware dump must be prevented once 152 151 * @in_d3: indicates FW is in suspend mode and should be resumed 152 + * @resuming: indicates the driver is resuming from wowlan 153 153 * @in_hw_restart: indicates that we are currently in restart flow. 154 154 * rather than restarted. Should be unset upon restart. 155 155 * @radio_kill: bitmap of radio kill status ··· 190 188 * @ptp_data: data of the PTP clock 191 189 * @time_sync: time sync data. 192 190 * @ftm_initiator: FTM initiator data 193 - * @last_bt_notif: last received BT Coex notif 194 191 */ 195 192 struct iwl_mld { 196 193 /* Add here fields that need clean up on restart */ ··· 214 213 bool netdetect; 215 214 #endif /* CONFIG_PM_SLEEP */ 216 215 struct ieee80211_vif *p2p_device_vif; 217 - struct iwl_bt_coex_profile_notif last_bt_notif; 216 + bool bt_is_active; 218 217 ); 219 218 struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_STATION_COUNT_MAX]; 220 219 /* And here fields that survive a fw restart */ ··· 238 237 do_not_dump_once:1, 239 238 #ifdef CONFIG_PM_SLEEP 240 239 in_d3:1, 240 + resuming:1, 241 241 #endif 242 242 in_hw_restart:1; 243 243
+10 -58
drivers/net/wireless/intel/iwlwifi/mld/mlo.c
··· 689 689 #undef RSSI_THRESHOLD 690 690 } 691 691 692 - #define IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH -69 693 - #define IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH -63 694 - #define IWL_MLD_BT_COEX_WIFI_LOSS_THRESH 7 695 - 696 - VISIBLE_IF_IWLWIFI_KUNIT 697 - bool 698 - iwl_mld_bt_allows_emlsr(struct iwl_mld *mld, struct ieee80211_bss_conf *link, 699 - bool check_entry) 700 - { 701 - int bt_penalty, rssi_thresh; 702 - s32 link_rssi; 703 - 704 - if (WARN_ON_ONCE(!link->bss)) 705 - return false; 706 - 707 - link_rssi = MBM_TO_DBM(link->bss->signal); 708 - rssi_thresh = check_entry ? 709 - IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH : 710 - IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH; 711 - /* No valid RSSI - force to take low rssi */ 712 - if (!link_rssi) 713 - link_rssi = rssi_thresh - 1; 714 - 715 - if (link_rssi > rssi_thresh) 716 - bt_penalty = max(mld->last_bt_notif.wifi_loss_mid_high_rssi[PHY_BAND_24][0], 717 - mld->last_bt_notif.wifi_loss_mid_high_rssi[PHY_BAND_24][1]); 718 - else 719 - bt_penalty = max(mld->last_bt_notif.wifi_loss_low_rssi[PHY_BAND_24][0], 720 - mld->last_bt_notif.wifi_loss_low_rssi[PHY_BAND_24][1]); 721 - 722 - IWL_DEBUG_EHT(mld, "BT penalty for link-id %0X is %d\n", 723 - link->link_id, bt_penalty); 724 - return bt_penalty < IWL_MLD_BT_COEX_WIFI_LOSS_THRESH; 725 - } 726 - EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mld_bt_allows_emlsr); 727 - 728 692 static u32 729 693 iwl_mld_emlsr_disallowed_with_link(struct iwl_mld *mld, 730 694 struct ieee80211_vif *vif, ··· 703 739 if (WARN_ON_ONCE(!conf)) 704 740 return IWL_MLD_EMLSR_EXIT_INVALID; 705 741 706 - if (link->chandef->chan->band == NL80211_BAND_2GHZ && 707 - !iwl_mld_bt_allows_emlsr(mld, conf, true)) 742 + if (link->chandef->chan->band == NL80211_BAND_2GHZ && mld->bt_is_active) 708 743 ret |= IWL_MLD_EMLSR_EXIT_BT_COEX; 709 744 710 745 if (link->signal < ··· 1041 1078 struct ieee80211_vif *vif) 1042 1079 { 1043 1080 struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif); 1044 - const struct iwl_bt_coex_profile_notif zero_notif = {}; 1045 1081 struct iwl_mld *mld = mld_vif->mld; 1046 1082 struct ieee80211_bss_conf *link; 1047 1083 unsigned int link_id; 1048 - const struct iwl_bt_coex_profile_notif *notif = &mld->last_bt_notif; 1049 1084 1050 1085 if (!iwl_mld_vif_has_emlsr_cap(vif)) 1051 1086 return; 1052 1087 1053 - /* zeroed structure means that BT is OFF */ 1054 - if (!memcmp(notif, &zero_notif, sizeof(*notif))) { 1088 + if (!mld->bt_is_active) { 1055 1089 iwl_mld_retry_emlsr(mld, vif); 1056 1090 return; 1057 1091 } 1058 1092 1059 - for_each_vif_active_link(vif, link, link_id) { 1060 - bool emlsr_active, emlsr_allowed; 1093 + /* BT is turned ON but we are not in EMLSR, nothing to do */ 1094 + if (!iwl_mld_emlsr_active(vif)) 1095 + return; 1061 1096 1097 + /* In EMLSR and BT is turned ON */ 1098 + 1099 + for_each_vif_active_link(vif, link, link_id) { 1062 1100 if (WARN_ON(!link->chanreq.oper.chan)) 1063 1101 continue; 1064 1102 1065 - if (link->chanreq.oper.chan->band != NL80211_BAND_2GHZ) 1066 - continue; 1067 - 1068 - emlsr_active = iwl_mld_emlsr_active(vif); 1069 - emlsr_allowed = iwl_mld_bt_allows_emlsr(mld, link, 1070 - !emlsr_active); 1071 - if (emlsr_allowed && !emlsr_active) { 1072 - iwl_mld_retry_emlsr(mld, vif); 1073 - return; 1074 - } 1075 - 1076 - if (!emlsr_allowed && emlsr_active) { 1077 - iwl_mld_exit_emlsr(mld, vif, 1078 - IWL_MLD_EMLSR_EXIT_BT_COEX, 1103 + if (link->chanreq.oper.chan->band == NL80211_BAND_2GHZ) { 1104 + iwl_mld_exit_emlsr(mld, vif, IWL_MLD_EMLSR_EXIT_BT_COEX, 1079 1105 iwl_mld_get_primary_link(vif)); 1080 1106 return; 1081 1107 }
-4
drivers/net/wireless/intel/iwlwifi/mld/mlo.h
··· 163 163 u32 iwl_mld_emlsr_pair_state(struct ieee80211_vif *vif, 164 164 struct iwl_mld_link_sel_data *a, 165 165 struct iwl_mld_link_sel_data *b); 166 - 167 - bool iwl_mld_bt_allows_emlsr(struct iwl_mld *mld, 168 - struct ieee80211_bss_conf *link, 169 - bool entry_criteria); 170 166 #endif 171 167 172 168 void iwl_mld_start_ignoring_tpt_updates(struct iwl_mld *mld);
+7 -2
drivers/net/wireless/intel/iwlwifi/mld/notif.c
··· 349 349 CMD_VERSIONS(time_sync_confirm_notif, 350 350 CMD_VER_ENTRY(1, iwl_time_msmt_cfm_notify)) 351 351 CMD_VERSIONS(omi_status_notif, 352 - CMD_VER_ENTRY(1, iwl_omi_send_status_notif)) 353 - CMD_VERSIONS(ftm_resp_notif, CMD_VER_ENTRY(9, iwl_tof_range_rsp_ntfy)) 352 + CMD_VER_ENTRY(1, iwl_omi_send_status_notif_v1) 353 + CMD_VER_ENTRY(2, iwl_omi_send_status_notif)) 354 + CMD_VERSIONS(ftm_resp_notif, CMD_VER_ENTRY(10, iwl_tof_range_rsp_ntfy)) 355 + CMD_VERSIONS(beacon_filter_notif, CMD_VER_ENTRY(2, iwl_beacon_filter_notif)) 354 356 355 357 DEFINE_SIMPLE_CANCELLATION(session_prot, iwl_session_prot_notif, mac_link_id) 356 358 DEFINE_SIMPLE_CANCELLATION(tlc, iwl_tlc_update_notif, sta_id) ··· 370 368 mac_id) 371 369 #define iwl_mld_cancel_omi_status_notif iwl_mld_always_cancel 372 370 DEFINE_SIMPLE_CANCELLATION(ftm_resp, iwl_tof_range_rsp_ntfy, request_id) 371 + DEFINE_SIMPLE_CANCELLATION(beacon_filter, iwl_beacon_filter_notif, link_id) 373 372 374 373 /** 375 374 * DOC: Handlers for fw notifications ··· 463 460 time_sync_confirm_notif, RX_HANDLER_ASYNC) 464 461 RX_HANDLER_OF_LINK(DATA_PATH_GROUP, OMI_SEND_STATUS_NOTIF, 465 462 omi_status_notif) 463 + RX_HANDLER_OF_LINK(DATA_PATH_GROUP, BEACON_FILTER_IN_NOTIF, 464 + beacon_filter_notif) 466 465 RX_HANDLER_OF_FTM_REQ(LOCATION_GROUP, TOF_RANGE_RESPONSE_NOTIF, 467 466 ftm_resp_notif) 468 467 };
+1 -9
drivers/net/wireless/intel/iwlwifi/mld/power.c
··· 377 377 u16 u_tx_power = tx_power == IWL_DEFAULT_MAX_TX_POWER ? 378 378 IWL_DEV_MAX_TX_POWER : 8 * tx_power; 379 379 struct iwl_dev_tx_power_cmd cmd = { 380 - /* Those fields sit on the same place for v9 and v10 */ 381 380 .common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_LINK), 382 381 .common.pwr_restriction = cpu_to_le16(u_tx_power), 383 382 }; 384 - u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id, 385 - IWL_FW_CMD_VER_UNKNOWN); 386 - int len = sizeof(cmd.common); 383 + int len = sizeof(cmd.common) + sizeof(cmd.v10); 387 384 388 385 if (WARN_ON(!mld_link)) 389 386 return -ENODEV; 390 387 391 388 cmd.common.link_id = cpu_to_le32(mld_link->fw_id); 392 - 393 - if (cmd_ver == 10) 394 - len += sizeof(cmd.v10); 395 - else if (cmd_ver == 9) 396 - len += sizeof(cmd.v9); 397 389 398 390 return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len); 399 391 }
+39 -63
drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
··· 71 71 static int iwl_mld_geo_sar_init(struct iwl_mld *mld) 72 72 { 73 73 u32 cmd_id = WIDE_ID(PHY_OPS_GROUP, PER_CHAIN_LIMIT_OFFSET_CMD); 74 - union iwl_geo_tx_power_profiles_cmd cmd; 75 - u16 len; 76 - u32 n_bands; 77 - __le32 sk = cpu_to_le32(0); 78 - int ret; 79 - u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id, 80 - IWL_FW_CMD_VER_UNKNOWN); 81 - 82 - BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, ops) != 83 - offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, ops)); 84 - 85 - cmd.v4.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES); 86 - 87 74 /* Only set to South Korea if the table revision is 1 */ 88 - if (mld->fwrt.geo_rev == 1) 89 - sk = cpu_to_le32(1); 75 + __le32 sk = cpu_to_le32(mld->fwrt.geo_rev == 1 ? 1 : 0); 76 + union iwl_geo_tx_power_profiles_cmd cmd = { 77 + .v5.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES), 78 + .v5.table_revision = sk, 79 + }; 80 + int ret; 90 81 91 - if (cmd_ver == 5) { 92 - len = sizeof(cmd.v5); 93 - n_bands = ARRAY_SIZE(cmd.v5.table[0]); 94 - cmd.v5.table_revision = sk; 95 - } else if (cmd_ver == 4) { 96 - len = sizeof(cmd.v4); 97 - n_bands = ARRAY_SIZE(cmd.v4.table[0]); 98 - cmd.v4.table_revision = sk; 99 - } else { 100 - return -EOPNOTSUPP; 101 - } 102 - 103 - BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, table) != 104 - offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, table)); 105 - /* the table is at the same position for all versions, so set use v4 */ 106 - ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v4.table[0][0], 107 - n_bands, BIOS_GEO_MAX_PROFILE_NUM); 82 + ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v5.table[0][0], 83 + ARRAY_SIZE(cmd.v5.table[0]), 84 + BIOS_GEO_MAX_PROFILE_NUM); 108 85 109 86 /* It is a valid scenario to not support SAR, or miss wgds table, 110 87 * but in that case there is no need to send the command. ··· 89 112 if (ret) 90 113 return 0; 91 114 92 - return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len); 115 + return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, sizeof(cmd.v5)); 93 116 } 94 117 95 118 int iwl_mld_config_sar_profile(struct iwl_mld *mld, int prof_a, int prof_b) ··· 97 120 u32 cmd_id = REDUCE_TX_POWER_CMD; 98 121 struct iwl_dev_tx_power_cmd cmd = { 99 122 .common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS), 123 + .v10.flags = cpu_to_le32(mld->fwrt.reduced_power_flags), 100 124 }; 101 - __le16 *per_chain; 102 125 int ret; 103 - u16 len = sizeof(cmd.common); 104 - u32 n_subbands; 105 - u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id, 106 - IWL_FW_CMD_VER_UNKNOWN); 107 - 108 - if (cmd_ver == 10) { 109 - len += sizeof(cmd.v10); 110 - n_subbands = IWL_NUM_SUB_BANDS_V2; 111 - per_chain = &cmd.v10.per_chain[0][0][0]; 112 - cmd.v10.flags = 113 - cpu_to_le32(mld->fwrt.reduced_power_flags); 114 - } else if (cmd_ver == 9) { 115 - len += sizeof(cmd.v9); 116 - n_subbands = IWL_NUM_SUB_BANDS_V1; 117 - per_chain = &cmd.v9.per_chain[0][0]; 118 - } else { 119 - return -EOPNOTSUPP; 120 - } 121 126 122 127 /* TODO: CDB - support IWL_NUM_CHAIN_TABLES_V2 */ 123 - ret = iwl_sar_fill_profile(&mld->fwrt, per_chain, 124 - IWL_NUM_CHAIN_TABLES, 125 - n_subbands, prof_a, prof_b); 128 + ret = iwl_sar_fill_profile(&mld->fwrt, &cmd.v10.per_chain[0][0][0], 129 + IWL_NUM_CHAIN_TABLES, IWL_NUM_SUB_BANDS_V2, 130 + prof_a, prof_b); 126 131 /* return on error or if the profile is disabled (positive number) */ 127 132 if (ret) 128 133 return ret; 129 134 130 - return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len); 135 + return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, 136 + sizeof(cmd.common) + sizeof(cmd.v10)); 131 137 } 132 138 133 139 int iwl_mld_init_sar(struct iwl_mld *mld) ··· 198 238 struct iwl_lari_config_change_cmd cmd = { 199 239 .config_bitmap = iwl_get_lari_config_bitmap(fwrt), 200 240 }; 241 + bool has_raw_dsm_capa = fw_has_capa(&fwrt->fw->ucode_capa, 242 + IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE); 201 243 int ret; 202 244 u32 value; 203 245 204 246 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_11AX_ENABLEMENT, &value); 205 - if (!ret) 247 + if (!ret) { 248 + if (!has_raw_dsm_capa) 249 + value &= DSM_11AX_ALLOW_BITMAP; 206 250 cmd.oem_11ax_allow_bitmap = cpu_to_le32(value); 251 + } 207 252 208 253 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII4_CHAN, &value); 209 - if (!ret) 210 - cmd.oem_unii4_allow_bitmap = 211 - cpu_to_le32(value &= DSM_UNII4_ALLOW_BITMAP); 254 + if (!ret) { 255 + if (!has_raw_dsm_capa) 256 + value &= DSM_UNII4_ALLOW_BITMAP; 257 + cmd.oem_unii4_allow_bitmap = cpu_to_le32(value); 258 + } 212 259 213 260 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ACTIVATE_CHANNEL, &value); 214 - if (!ret) 261 + if (!ret) { 262 + if (!has_raw_dsm_capa) 263 + value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V12; 215 264 cmd.chan_state_active_bitmap = cpu_to_le32(value); 265 + } 216 266 217 267 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_6E, &value); 218 268 if (!ret) 219 269 cmd.oem_uhb_allow_bitmap = cpu_to_le32(value); 220 270 221 271 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_FORCE_DISABLE_CHANNELS, &value); 222 - if (!ret) 272 + if (!ret) { 273 + if (!has_raw_dsm_capa) 274 + value &= DSM_FORCE_DISABLE_CHANNELS_ALLOWED_BITMAP; 223 275 cmd.force_disable_channels_bitmap = cpu_to_le32(value); 276 + } 224 277 225 278 ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENERGY_DETECTION_THRESHOLD, 226 279 &value); 227 - if (!ret) 280 + if (!ret) { 281 + if (!has_raw_dsm_capa) 282 + value &= DSM_EDT_ALLOWED_BITMAP; 228 283 cmd.edt_bitmap = cpu_to_le32(value); 284 + } 229 285 230 286 ret = iwl_bios_get_wbem(fwrt, &value); 231 287 if (!ret)
+65 -8
drivers/net/wireless/intel/iwlwifi/mld/rx.c
··· 143 143 } 144 144 EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mld_pass_packet_to_mac80211); 145 145 146 - static void iwl_mld_fill_signal(struct iwl_mld *mld, 146 + static bool iwl_mld_used_average_energy(struct iwl_mld *mld, int link_id, 147 + struct ieee80211_hdr *hdr, 148 + struct ieee80211_rx_status *rx_status) 149 + { 150 + struct ieee80211_bss_conf *link_conf; 151 + struct iwl_mld_link *mld_link; 152 + 153 + if (unlikely(!hdr || link_id < 0)) 154 + return false; 155 + 156 + if (likely(!ieee80211_is_beacon(hdr->frame_control))) 157 + return false; 158 + 159 + /* 160 + * if link ID is >= valid ones then that means the RX 161 + * was on the AUX link and no correction is needed 162 + */ 163 + if (link_id >= mld->fw->ucode_capa.num_links) 164 + return false; 165 + 166 + /* for the link conf lookup */ 167 + guard(rcu)(); 168 + 169 + link_conf = rcu_dereference(mld->fw_id_to_bss_conf[link_id]); 170 + if (!link_conf) 171 + return false; 172 + 173 + mld_link = iwl_mld_link_from_mac80211(link_conf); 174 + if (!mld_link) 175 + return false; 176 + 177 + /* 178 + * If we know the link by link ID then the frame was 179 + * received for the link, so by filtering it means it 180 + * was from the AP the link is connected to. 181 + */ 182 + 183 + /* skip also in case we don't have it (yet) */ 184 + if (!mld_link->average_beacon_energy) 185 + return false; 186 + 187 + IWL_DEBUG_STATS(mld, "energy override by average %d\n", 188 + mld_link->average_beacon_energy); 189 + rx_status->signal = -mld_link->average_beacon_energy; 190 + return true; 191 + } 192 + 193 + static void iwl_mld_fill_signal(struct iwl_mld *mld, int link_id, 194 + struct ieee80211_hdr *hdr, 147 195 struct ieee80211_rx_status *rx_status, 148 196 struct iwl_mld_rx_phy_data *phy_data) 149 197 { ··· 207 159 IWL_DEBUG_STATS(mld, "energy in A %d B %d, and max %d\n", 208 160 energy_a, energy_b, max_energy); 209 161 162 + if (iwl_mld_used_average_energy(mld, link_id, hdr, rx_status)) 163 + return; 164 + 210 165 rx_status->signal = max_energy; 211 - rx_status->chains = 212 - (rate_n_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 166 + rx_status->chains = u32_get_bits(rate_n_flags, RATE_MCS_ANT_AB_MSK); 213 167 rx_status->chain_signal[0] = energy_a; 214 168 rx_status->chain_signal[1] = energy_b; 215 169 } ··· 1210 1160 } 1211 1161 #endif 1212 1162 1213 - static void iwl_mld_rx_fill_status(struct iwl_mld *mld, struct sk_buff *skb, 1163 + /* Note: hdr can be NULL */ 1164 + static void iwl_mld_rx_fill_status(struct iwl_mld *mld, int link_id, 1165 + struct ieee80211_hdr *hdr, 1166 + struct sk_buff *skb, 1214 1167 struct iwl_mld_rx_phy_data *phy_data, 1215 1168 int queue) 1216 1169 { ··· 1235 1182 phy_data->phy_info & IWL_RX_MPDU_PHY_SHORT_PREAMBLE) 1236 1183 rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE; 1237 1184 1238 - iwl_mld_fill_signal(mld, rx_status, phy_data); 1185 + iwl_mld_fill_signal(mld, link_id, hdr, rx_status, phy_data); 1239 1186 1240 1187 /* This may be overridden by iwl_mld_rx_he() to HE_RU */ 1241 1188 switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { ··· 1786 1733 struct sk_buff *skb; 1787 1734 size_t mpdu_desc_size = sizeof(*mpdu_desc); 1788 1735 bool drop = false; 1789 - u8 crypto_len = 0, band; 1736 + u8 crypto_len = 0, band, link_id; 1790 1737 u32 pkt_len = iwl_rx_packet_payload_len(pkt); 1791 1738 u32 mpdu_len; 1792 1739 enum iwl_mld_reorder_result reorder_res; ··· 1875 1822 SCHED_SCAN_PASS_ALL_STATE_FOUND; 1876 1823 } 1877 1824 1878 - iwl_mld_rx_fill_status(mld, skb, &phy_data, queue); 1825 + link_id = u8_get_bits(mpdu_desc->mac_phy_band, 1826 + IWL_RX_MPDU_MAC_PHY_BAND_LINK_MASK); 1827 + 1828 + iwl_mld_rx_fill_status(mld, link_id, hdr, skb, &phy_data, queue); 1879 1829 1880 1830 if (iwl_mld_rx_crypto(mld, sta, hdr, rx_status, mpdu_desc, queue, 1881 1831 le32_to_cpu(pkt->len_n_flags), &crypto_len)) ··· 2091 2035 rx_status->freq = ieee80211_channel_to_frequency(channel, 2092 2036 rx_status->band); 2093 2037 2094 - iwl_mld_rx_fill_status(mld, skb, &phy_data, queue); 2038 + /* link ID is ignored for NULL header */ 2039 + iwl_mld_rx_fill_status(mld, -1, NULL, skb, &phy_data, queue); 2095 2040 2096 2041 /* No more radiotap info should be added after this point. 2097 2042 * Mark it as mac header for upper layers to know where
+1 -1
drivers/net/wireless/intel/iwlwifi/mld/scan.c
··· 359 359 struct ieee80211_scan_ies *ies, int n_channels) 360 360 { 361 361 return ((n_ssids <= PROBE_OPTION_MAX) && 362 - (n_channels <= mld->fw->ucode_capa.n_scan_channels) & 362 + (n_channels <= mld->fw->ucode_capa.n_scan_channels) && 363 363 (ies->common_ie_len + ies->len[NL80211_BAND_2GHZ] + 364 364 ies->len[NL80211_BAND_5GHZ] + ies->len[NL80211_BAND_6GHZ] <= 365 365 iwl_mld_scan_max_template_size()));
+1 -1
drivers/net/wireless/intel/iwlwifi/mld/tests/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 - iwlmld-tests-y += module.o hcmd.o utils.o link.o rx.o agg.o link-selection.o emlsr_with_bt.o 2 + iwlmld-tests-y += module.o hcmd.o utils.o link.o rx.o agg.o link-selection.o 3 3 4 4 ccflags-y += -I$(src)/../ 5 5 obj-$(CONFIG_IWLWIFI_KUNIT_TESTS) += iwlmld-tests.o
-140
drivers/net/wireless/intel/iwlwifi/mld/tests/emlsr_with_bt.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 - /* 3 - * KUnit tests for link selection functions 4 - * 5 - * Copyright (C) 2025 Intel Corporation 6 - */ 7 - #include <kunit/static_stub.h> 8 - 9 - #include "utils.h" 10 - #include "mld.h" 11 - #include "mlo.h" 12 - 13 - static const struct emlsr_with_bt_test_case { 14 - const char *desc; 15 - struct { 16 - struct iwl_bt_coex_profile_notif notif; 17 - s32 signal; 18 - bool check_entry; 19 - } input; 20 - bool emlsr_allowed; 21 - } emlsr_with_bt_cases[] = { 22 - { 23 - .desc = "BT penalty(exit) with low rssi 4.5: emlsr allowed", 24 - .input = { 25 - .notif.wifi_loss_low_rssi[1] = {4, 5}, 26 - .notif.wifi_loss_mid_high_rssi[1] = {7, 9}, 27 - .signal = -69, 28 - .check_entry = false, 29 - }, 30 - .emlsr_allowed = true, 31 - }, 32 - { 33 - .desc = "BT penalty(exit) from high rssi 5: emlsr allowed", 34 - .input = { 35 - .notif.wifi_loss_low_rssi[1] = {7, 9}, 36 - .notif.wifi_loss_mid_high_rssi[1] = {5, 5}, 37 - .signal = -68, 38 - .check_entry = false, 39 - }, 40 - .emlsr_allowed = true, 41 - }, 42 - { 43 - .desc = "BT penalty(exit) with low rssi 8: emlsr not allowed", 44 - .input = { 45 - .notif.wifi_loss_low_rssi[1] = {7, 9}, 46 - .notif.wifi_loss_mid_high_rssi[1] = {4, 5}, 47 - .signal = -69, 48 - .check_entry = false, 49 - }, 50 - .emlsr_allowed = false, 51 - }, 52 - { 53 - .desc = "BT penalty(exit) from high rssi 9: emlsr not allowed", 54 - .input = { 55 - .notif.wifi_loss_low_rssi[1] = {4, 5}, 56 - .notif.wifi_loss_mid_high_rssi[1] = {9, 9}, 57 - .signal = -68, 58 - .check_entry = false, 59 - }, 60 - .emlsr_allowed = false, 61 - }, 62 - { 63 - .desc = "BT penalty(entry) with low rssi 4.5: emlsr allowed", 64 - .input = { 65 - .notif.wifi_loss_low_rssi[1] = {4, 5}, 66 - .notif.wifi_loss_mid_high_rssi[1] = {7, 9}, 67 - .signal = -63, 68 - .check_entry = true, 69 - }, 70 - .emlsr_allowed = true, 71 - }, 72 - { 73 - .desc = "BT penalty(entry) from high rssi 5: emlsr allowed", 74 - .input = { 75 - .notif.wifi_loss_low_rssi[1] = {7, 9}, 76 - .notif.wifi_loss_mid_high_rssi[1] = {5, 5}, 77 - .signal = -62, 78 - .check_entry = false, 79 - }, 80 - .emlsr_allowed = true, 81 - }, 82 - { 83 - .desc = "BT penalty(entry) with low rssi 8: emlsr not allowed", 84 - .input = { 85 - .notif.wifi_loss_low_rssi[1] = {7, 9}, 86 - .notif.wifi_loss_mid_high_rssi[1] = {4, 5}, 87 - .signal = -63, 88 - .check_entry = false, 89 - }, 90 - .emlsr_allowed = true, 91 - }, 92 - { 93 - .desc = "BT penalty(entry) from high rssi 9: emlsr not allowed", 94 - .input = { 95 - .notif.wifi_loss_low_rssi[1] = {4, 5}, 96 - .notif.wifi_loss_mid_high_rssi[1] = {9, 9}, 97 - .signal = -62, 98 - .check_entry = true, 99 - }, 100 - .emlsr_allowed = false, 101 - }, 102 - }; 103 - 104 - KUNIT_ARRAY_PARAM_DESC(emlsr_with_bt, emlsr_with_bt_cases, desc); 105 - 106 - static void test_emlsr_with_bt(struct kunit *test) 107 - { 108 - struct iwl_mld *mld = test->priv; 109 - const struct emlsr_with_bt_test_case *test_param = 110 - (const void *)(test->param_value); 111 - struct ieee80211_vif *vif = 112 - iwlmld_kunit_add_vif(true, NL80211_IFTYPE_STATION); 113 - struct ieee80211_bss_conf *link = iwlmld_kunit_add_link(vif, 1); 114 - bool actual_value = false; 115 - 116 - KUNIT_ALLOC_AND_ASSERT(test, link->bss); 117 - 118 - /* Extract test case parameters */ 119 - link->bss->signal = DBM_TO_MBM(test_param->input.signal); 120 - memcpy(&mld->last_bt_notif, &test_param->input.notif, 121 - sizeof(struct iwl_bt_coex_profile_notif)); 122 - 123 - actual_value = iwl_mld_bt_allows_emlsr(mld, link, 124 - test_param->input.check_entry); 125 - /* Assert that the returned value matches the expected emlsr_allowed */ 126 - KUNIT_EXPECT_EQ(test, actual_value, test_param->emlsr_allowed); 127 - } 128 - 129 - static struct kunit_case emlsr_with_bt_test_cases[] = { 130 - KUNIT_CASE_PARAM(test_emlsr_with_bt, emlsr_with_bt_gen_params), 131 - {}, 132 - }; 133 - 134 - static struct kunit_suite emlsr_with_bt = { 135 - .name = "iwlmld-emlsr-with-bt-tests", 136 - .test_cases = emlsr_with_bt_test_cases, 137 - .init = iwlmld_kunit_test_init, 138 - }; 139 - 140 - kunit_test_suite(emlsr_with_bt);
+51 -118
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 211 211 } 212 212 213 213 struct wowlan_key_rsc_tsc_data { 214 - struct iwl_wowlan_rsc_tsc_params_cmd_v4 *rsc_tsc; 214 + struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 *rsc_tsc; 215 215 bool have_rsc_tsc; 216 216 }; 217 217 ··· 236 236 u64 pn64; 237 237 238 238 tkip_sc = 239 - data->rsc_tsc->params.all_tsc_rsc.tkip.unicast_rsc; 239 + data->rsc_tsc->all_tsc_rsc.tkip.unicast_rsc; 240 240 tkip_tx_sc = 241 - &data->rsc_tsc->params.all_tsc_rsc.tkip.tsc; 241 + &data->rsc_tsc->all_tsc_rsc.tkip.tsc; 242 242 243 243 pn64 = atomic64_read(&key->tx_pn); 244 244 tkip_tx_sc->iv16 = cpu_to_le16(TKIP_PN_TO_IV16(pn64)); 245 245 tkip_tx_sc->iv32 = cpu_to_le32(TKIP_PN_TO_IV32(pn64)); 246 246 } else { 247 247 tkip_sc = 248 - data->rsc_tsc->params.all_tsc_rsc.tkip.multicast_rsc; 248 + data->rsc_tsc->all_tsc_rsc.tkip.multicast_rsc; 249 249 } 250 250 251 251 /* ··· 269 269 u64 pn64; 270 270 271 271 aes_sc = 272 - data->rsc_tsc->params.all_tsc_rsc.aes.unicast_rsc; 272 + data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc; 273 273 aes_tx_sc = 274 - &data->rsc_tsc->params.all_tsc_rsc.aes.tsc; 274 + &data->rsc_tsc->all_tsc_rsc.aes.tsc; 275 275 276 276 pn64 = atomic64_read(&key->tx_pn); 277 277 aes_tx_sc->pn = cpu_to_le64(pn64); 278 278 } else { 279 279 aes_sc = 280 - data->rsc_tsc->params.all_tsc_rsc.aes.multicast_rsc; 280 + data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc; 281 281 } 282 282 283 283 /* ··· 480 480 else 481 481 ret = 0; 482 482 kfree(data.rsc); 483 - } else if (ver == 4 || ver == 2 || ver == IWL_FW_CMD_VER_UNKNOWN) { 483 + } else if (ver == 2 || ver == IWL_FW_CMD_VER_UNKNOWN) { 484 484 struct wowlan_key_rsc_tsc_data data = {}; 485 - int size; 486 485 487 486 data.rsc_tsc = kzalloc(sizeof(*data.rsc_tsc), GFP_KERNEL); 488 487 if (!data.rsc_tsc) 489 488 return -ENOMEM; 490 - 491 - if (ver == 4) { 492 - size = sizeof(*data.rsc_tsc); 493 - data.rsc_tsc->sta_id = 494 - cpu_to_le32(mvm_link->ap_sta_id); 495 - } else { 496 - /* ver == 2 || ver == IWL_FW_CMD_VER_UNKNOWN */ 497 - size = sizeof(data.rsc_tsc->params); 498 - } 499 489 500 490 ieee80211_iter_keys(mvm->hw, vif, 501 491 iwl_mvm_wowlan_get_rsc_tsc_data, ··· 493 503 494 504 if (data.have_rsc_tsc) 495 505 ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_TSC_RSC_PARAM, 496 - CMD_ASYNC, size, 506 + CMD_ASYNC, 507 + sizeof(data.rsc_tsc), 497 508 data.rsc_tsc); 498 509 else 499 510 ret = 0; ··· 1680 1689 } 1681 1690 1682 1691 static void iwl_mvm_convert_key_counters(struct iwl_wowlan_status_data *status, 1683 - union iwl_all_tsc_rsc *sc) 1692 + union iwl_all_tsc_rsc *sc, u8 key_idx) 1684 1693 { 1685 1694 int i; 1686 1695 ··· 1695 1704 &status->gtk_seq[0].aes.seq[i]); 1696 1705 } 1697 1706 status->gtk_seq[0].valid = true; 1698 - status->gtk_seq[0].key_id = -1; 1707 + status->gtk_seq[0].key_id = key_idx; 1699 1708 1700 1709 /* PTK TX counter */ 1701 1710 status->ptk.tkip.tx_pn = (u64)le16_to_cpu(sc->tkip.tsc.iv16) | ··· 1786 1795 if (!status->gtk_seq[i].valid) 1787 1796 continue; 1788 1797 1789 - /* Handle the case where we know the key ID */ 1790 - if (status->gtk_seq[i].key_id == key->keyidx) { 1791 - s8 new_key_id = -1; 1792 - 1793 - if (status->num_of_gtk_rekeys) 1794 - new_key_id = status->gtk[0].flags & 1795 - IWL_WOWLAN_GTK_IDX_MASK; 1796 - 1797 - /* Don't install a new key's value to an old key */ 1798 - if (new_key_id != key->keyidx) 1799 - iwl_mvm_set_key_rx_seq_idx(key, status, i); 1800 - continue; 1801 - } 1802 - 1803 - /* handle the case where we didn't, last key only */ 1804 - if (status->gtk_seq[i].key_id == -1 && 1805 - (!status->num_of_gtk_rekeys)) 1798 + if (status->gtk_seq[i].key_id == key->keyidx) 1806 1799 iwl_mvm_set_key_rx_seq_idx(key, status, i); 1807 1800 } 1808 1801 } ··· 1876 1901 struct ieee80211_key_conf *key, 1877 1902 struct iwl_multicast_key_data *key_data) 1878 1903 { 1879 - if (status->num_of_gtk_rekeys && key_data->len) { 1880 - /* remove rekeyed key */ 1881 - ieee80211_remove_key(key); 1882 - } else { 1883 - struct ieee80211_key_seq seq; 1904 + struct ieee80211_key_seq seq; 1884 1905 1885 - iwl_mvm_d3_set_igtk_bigtk_ipn(key_data, 1886 - &seq, 1887 - key->cipher); 1888 - ieee80211_set_key_rx_seq(key, 0, &seq); 1889 - } 1906 + iwl_mvm_d3_set_igtk_bigtk_ipn(key_data, &seq, key->cipher); 1907 + ieee80211_set_key_rx_seq(key, 0, &seq); 1890 1908 } 1891 1909 1892 1910 static void iwl_mvm_d3_update_keys(struct ieee80211_hw *hw, ··· 1920 1952 return; 1921 1953 } 1922 1954 keyidx = key->keyidx; 1923 - /* The current key is always sent by the FW, even if it wasn't 1924 - * rekeyed during D3. 1925 - * We remove an existing key if it has the same index as 1926 - * a new key 1955 + /* 1956 + * Update the seq even if there was a rekey. If there was a 1957 + * rekey, we will update again after replacing the key 1927 1958 */ 1928 - if (status->num_of_gtk_rekeys && 1929 - ((status->gtk[0].len && keyidx == status->gtk[0].id) || 1930 - (status->gtk[1].len && keyidx == status->gtk[1].id))) { 1931 - ieee80211_remove_key(key); 1932 - } else { 1933 - iwl_mvm_set_key_rx_seq(key, data->status); 1934 - } 1959 + if ((status->gtk[0].len && keyidx == status->gtk[0].id) || 1960 + (status->gtk[1].len && keyidx == status->gtk[1].id)) 1961 + iwl_mvm_set_key_rx_seq(key, status); 1935 1962 break; 1936 1963 case WLAN_CIPHER_SUITE_BIP_GMAC_128: 1937 1964 case WLAN_CIPHER_SUITE_BIP_GMAC_256: ··· 1990 2027 sizeof(status->gtk[i].key)); 1991 2028 1992 2029 key = ieee80211_gtk_rekey_add(vif, conf, link_id); 1993 - if (IS_ERR(key)) 2030 + if (IS_ERR(key)) { 2031 + /* FW may send also the old keys */ 2032 + if (PTR_ERR(key) == -EALREADY) 2033 + continue; 1994 2034 return false; 2035 + } 1995 2036 1996 2037 for (j = 0; j < ARRAY_SIZE(status->gtk_seq); j++) { 1997 2038 if (!status->gtk_seq[j].valid || ··· 2015 2048 struct ieee80211_vif *vif, u32 cipher, 2016 2049 struct iwl_multicast_key_data *key_data) 2017 2050 { 2051 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 2018 2052 DEFINE_RAW_FLEX(struct ieee80211_key_conf, conf, key, 2019 2053 WOWLAN_KEY_MAX_SIZE); 2020 2054 struct ieee80211_key_conf *key_config; 2021 2055 struct ieee80211_key_seq seq; 2022 2056 int link_id = vif->active_links ? __ffs(vif->active_links) : -1; 2057 + s8 keyidx = key_data->id; 2023 2058 2024 2059 conf->cipher = cipher; 2025 - conf->keyidx = key_data->id; 2060 + conf->keyidx = keyidx; 2026 2061 2027 2062 if (!key_data->len) 2028 2063 return true; ··· 2051 2082 memcpy(conf->key, key_data->key, conf->keylen); 2052 2083 2053 2084 key_config = ieee80211_gtk_rekey_add(vif, conf, link_id); 2054 - if (IS_ERR(key_config)) 2055 - return false; 2085 + if (IS_ERR(key_config)) { 2086 + /* FW may send also the old keys */ 2087 + return PTR_ERR(key_config) == -EALREADY; 2088 + } 2056 2089 ieee80211_set_key_rx_seq(key_config, 0, &seq); 2057 2090 2058 - if (key_config->keyidx == 4 || key_config->keyidx == 5) { 2059 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 2091 + if (keyidx == 4 || keyidx == 5) { 2060 2092 struct iwl_mvm_vif_link_info *mvm_link; 2061 2093 2062 2094 link_id = link_id < 0 ? 0 : link_id; 2063 2095 mvm_link = mvmvif->link[link_id]; 2096 + if (mvm_link->igtk) 2097 + mvm_link->igtk->hw_key_idx = STA_KEY_IDX_INVALID; 2064 2098 mvm_link->igtk = key_config; 2065 2099 } 2100 + 2101 + if (vif->type == NL80211_IFTYPE_STATION && (keyidx == 6 || keyidx == 7)) 2102 + rcu_assign_pointer(mvmvif->bcn_prot.keys[keyidx - 6], 2103 + key_config); 2066 2104 2067 2105 return true; 2068 2106 } ··· 2186 2210 2187 2211 status->gtk[0].len = data->key_len; 2188 2212 status->gtk[0].flags = data->key_flags; 2213 + status->gtk[0].id = status->gtk[0].flags & IWL_WOWLAN_GTK_IDX_MASK; 2189 2214 2190 2215 memcpy(status->gtk[0].key, data->key, sizeof(data->key)); 2191 2216 ··· 2357 2380 } 2358 2381 2359 2382 static void 2360 - iwl_mvm_parse_wowlan_info_notif_v2(struct iwl_mvm *mvm, 2361 - struct iwl_wowlan_info_notif_v2 *data, 2383 + iwl_mvm_parse_wowlan_info_notif_v1(struct iwl_mvm *mvm, 2384 + struct iwl_wowlan_info_notif_v1 *data, 2362 2385 struct iwl_wowlan_status_data *status, 2363 2386 u32 len) 2364 2387 { ··· 2443 2466 2444 2467 iwl_mvm_parse_wowlan_status_common(v6) 2445 2468 iwl_mvm_parse_wowlan_status_common(v7) 2446 - iwl_mvm_parse_wowlan_status_common(v9) 2447 - iwl_mvm_parse_wowlan_status_common(v12) 2448 2469 2449 2470 static struct iwl_wowlan_status_data * 2450 2471 iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm, u8 sta_id) ··· 2498 2523 v6->gtk.tkip_mic_key, 2499 2524 sizeof(v6->gtk.tkip_mic_key)); 2500 2525 2501 - iwl_mvm_convert_key_counters(status, &v6->gtk.rsc.all_tsc_rsc); 2526 + iwl_mvm_convert_key_counters(status, &v6->gtk.rsc.all_tsc_rsc, 2527 + v6->gtk.key_index); 2502 2528 2503 2529 /* hardcode the key length to 16 since v6 only supports 16 */ 2504 2530 status->gtk[0].len = 16; ··· 2510 2534 * currently used key. 2511 2535 */ 2512 2536 status->gtk[0].flags = v6->gtk.key_index | BIT(7); 2537 + status->gtk[0].id = v6->gtk.key_index; 2513 2538 } else if (notif_ver == 7) { 2514 2539 struct iwl_wowlan_status_v7 *v7 = (void *)cmd.resp_pkt->data; 2515 2540 ··· 2518 2541 if (!status) 2519 2542 goto out_free_resp; 2520 2543 2521 - iwl_mvm_convert_key_counters(status, &v7->gtk[0].rsc.all_tsc_rsc); 2544 + iwl_mvm_convert_key_counters(status, &v7->gtk[0].rsc.all_tsc_rsc, 2545 + v7->gtk[0].key_flags & IWL_WOWLAN_GTK_IDX_MASK); 2522 2546 iwl_mvm_convert_gtk_v2(status, &v7->gtk[0]); 2523 2547 iwl_mvm_convert_igtk(status, &v7->igtk[0]); 2524 - } else if (notif_ver == 9 || notif_ver == 10 || notif_ver == 11) { 2525 - struct iwl_wowlan_status_v9 *v9 = (void *)cmd.resp_pkt->data; 2526 - 2527 - /* these three command versions have same layout and size, the 2528 - * difference is only in a few not used (reserved) fields. 2529 - */ 2530 - status = iwl_mvm_parse_wowlan_status_common_v9(mvm, v9, len); 2531 - if (!status) 2532 - goto out_free_resp; 2533 - 2534 - iwl_mvm_convert_key_counters(status, &v9->gtk[0].rsc.all_tsc_rsc); 2535 - iwl_mvm_convert_gtk_v2(status, &v9->gtk[0]); 2536 - iwl_mvm_convert_igtk(status, &v9->igtk[0]); 2537 - 2538 - status->tid_tear_down = v9->tid_tear_down; 2539 - } else if (notif_ver == 12) { 2540 - struct iwl_wowlan_status_v12 *v12 = (void *)cmd.resp_pkt->data; 2541 - 2542 - status = iwl_mvm_parse_wowlan_status_common_v12(mvm, v12, len); 2543 - if (!status) 2544 - goto out_free_resp; 2545 - 2546 - iwl_mvm_convert_key_counters_v5(status, &v12->gtk[0].sc); 2547 - iwl_mvm_convert_gtk_v3(status, v12->gtk); 2548 - iwl_mvm_convert_igtk(status, &v12->igtk[0]); 2549 - 2550 - status->tid_tear_down = v12->tid_tear_down; 2551 2548 } else { 2552 2549 IWL_ERR(mvm, 2553 2550 "Firmware advertises unknown WoWLAN status response %d!\n", ··· 3048 3097 break; 3049 3098 } 3050 3099 3051 - if (wowlan_info_ver < 2) { 3100 + if (wowlan_info_ver == 1) { 3052 3101 struct iwl_wowlan_info_notif_v1 *notif_v1 = 3053 3102 (void *)pkt->data; 3054 - struct iwl_wowlan_info_notif_v2 *notif_v2; 3055 3103 3056 - notif_v2 = kmemdup(notif_v1, sizeof(*notif_v2), GFP_ATOMIC); 3057 - 3058 - if (!notif_v2) 3059 - return false; 3060 - 3061 - notif_v2->tid_tear_down = notif_v1->tid_tear_down; 3062 - notif_v2->station_id = notif_v1->station_id; 3063 - memset_after(notif_v2, 0, station_id); 3064 - iwl_mvm_parse_wowlan_info_notif_v2(mvm, notif_v2, 3065 - d3_data->status, 3066 - len); 3067 - kfree(notif_v2); 3068 - 3069 - } else if (wowlan_info_ver == 2) { 3070 - struct iwl_wowlan_info_notif_v2 *notif_v2 = 3071 - (void *)pkt->data; 3072 - 3073 - iwl_mvm_parse_wowlan_info_notif_v2(mvm, notif_v2, 3104 + iwl_mvm_parse_wowlan_info_notif_v1(mvm, notif_v1, 3074 3105 d3_data->status, 3075 3106 len); 3076 3107 } else if (wowlan_info_ver == 3) {
+1 -1
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
··· 1134 1134 1135 1135 if (count == 6 && !strcmp(buf, "nolog\n")) { 1136 1136 set_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, &mvm->status); 1137 - set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &mvm->trans->status); 1137 + iwl_trans_suppress_cmd_error_once(mvm->trans); 1138 1138 } 1139 1139 1140 1140 /* take the return value to make compiler happy - it will fail anyway */
+20 -47
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 121 121 return false; 122 122 123 123 palive = (void *)pkt->data; 124 + 125 + umac = &palive->umac_data; 126 + lmac1 = &palive->lmac_data[0]; 127 + lmac2 = &palive->lmac_data[1]; 128 + status = le16_to_cpu(palive->status); 129 + 130 + BUILD_BUG_ON(sizeof(palive->sku_id.data) != 131 + sizeof(alive_data->sku_id)); 132 + memcpy(alive_data->sku_id, palive->sku_id.data, 133 + sizeof(palive->sku_id.data)); 134 + 135 + IWL_DEBUG_FW(mvm, "Got sku_id: 0x0%x 0x0%x 0x0%x\n", 136 + le32_to_cpu(alive_data->sku_id[0]), 137 + le32_to_cpu(alive_data->sku_id[1]), 138 + le32_to_cpu(alive_data->sku_id[2])); 139 + 124 140 mvm->trans->dbg.imr_data.imr_enable = 125 141 le32_to_cpu(palive->imr.enabled); 126 142 mvm->trans->dbg.imr_data.imr_size = ··· 184 168 IWL_DEBUG_FW(mvm, "platform id: 0x%llx\n", 185 169 palive_v8->platform_id); 186 170 } 187 - } 188 - 189 - if (version >= 5) { 190 - struct iwl_alive_ntf_v5 *palive; 191 - 192 - if (pkt_len < sizeof(*palive)) 193 - return false; 194 - 195 - palive = (void *)pkt->data; 196 - umac = &palive->umac_data; 197 - lmac1 = &palive->lmac_data[0]; 198 - lmac2 = &palive->lmac_data[1]; 199 - status = le16_to_cpu(palive->status); 200 - 201 - BUILD_BUG_ON(sizeof(palive->sku_id.data) != 202 - sizeof(alive_data->sku_id)); 203 - memcpy(alive_data->sku_id, palive->sku_id.data, 204 - sizeof(palive->sku_id.data)); 205 - 206 - IWL_DEBUG_FW(mvm, "Got sku_id: 0x0%x 0x0%x 0x0%x\n", 207 - le32_to_cpu(alive_data->sku_id[0]), 208 - le32_to_cpu(alive_data->sku_id[1]), 209 - le32_to_cpu(alive_data->sku_id[2])); 210 - } else if (iwl_rx_packet_payload_len(pkt) == sizeof(struct iwl_alive_ntf_v4)) { 211 - struct iwl_alive_ntf_v4 *palive; 212 - 213 - if (pkt_len < sizeof(*palive)) 214 - return false; 215 - 216 - palive = (void *)pkt->data; 217 - umac = &palive->umac_data; 218 - lmac1 = &palive->lmac_data[0]; 219 - lmac2 = &palive->lmac_data[1]; 220 - status = le16_to_cpu(palive->status); 221 171 } else if (iwl_rx_packet_payload_len(pkt) == 222 172 sizeof(struct iwl_alive_ntf_v3)) { 223 173 struct iwl_alive_ntf_v3 *palive3; ··· 870 888 len = sizeof(cmd_v9_v10.v9); 871 889 n_subbands = IWL_NUM_SUB_BANDS_V1; 872 890 per_chain = &cmd_v9_v10.v9.per_chain[0][0]; 873 - } else if (cmd_ver >= 7) { 874 - len = sizeof(cmd.v7); 891 + } else if (cmd_ver == 8) { 892 + len = sizeof(cmd.v8); 875 893 n_subbands = IWL_NUM_SUB_BANDS_V2; 876 - per_chain = cmd.v7.per_chain[0][0]; 877 - cmd.v7.flags = cpu_to_le32(mvm->fwrt.reduced_power_flags); 878 - if (cmd_ver == 8) 879 - len = sizeof(cmd.v8); 880 - } else if (cmd_ver == 6) { 881 - len = sizeof(cmd.v6); 882 - n_subbands = IWL_NUM_SUB_BANDS_V2; 883 - per_chain = cmd.v6.per_chain[0][0]; 894 + per_chain = cmd.v8.per_chain[0][0]; 895 + cmd.v8.flags = cpu_to_le32(mvm->fwrt.reduced_power_flags); 884 896 } else if (fw_has_api(&mvm->fw->ucode_capa, 885 897 IWL_UCODE_TLV_API_REDUCE_TX_POWER)) { 886 898 len = sizeof(cmd.v5); ··· 1437 1461 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL); 1438 1462 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[i], NULL); 1439 1463 } 1440 - 1441 - for (i = 0; i < IWL_FW_MAX_LINK_ID + 1; i++) 1442 - RCU_INIT_POINTER(mvm->link_id_to_link_conf[i], NULL); 1443 1464 1444 1465 mvm->tdls_cs.peer.sta_id = IWL_INVALID_STA; 1445 1466
+6 -56
drivers/net/wireless/intel/iwlwifi/mvm/link.c
··· 18 18 HOW(EXIT_COEX) \ 19 19 HOW(EXIT_BANDWIDTH) \ 20 20 HOW(EXIT_CSA) \ 21 - HOW(EXIT_LINK_USAGE) \ 22 - HOW(EXIT_FAIL_ENTRY) 21 + HOW(EXIT_LINK_USAGE) 23 22 24 23 static const char *const iwl_mvm_esr_states_names[] = { 25 24 #define NAME_ENTRY(x) [ilog2(IWL_MVM_ESR_##x)] = #x, ··· 49 50 #undef NAME_PR 50 51 } 51 52 52 - static u32 iwl_mvm_get_free_fw_link_id(struct iwl_mvm *mvm, 53 - struct iwl_mvm_vif *mvm_vif) 54 - { 55 - u32 i; 56 - 57 - lockdep_assert_held(&mvm->mutex); 58 - 59 - for (i = 0; i < ARRAY_SIZE(mvm->link_id_to_link_conf); i++) 60 - if (!rcu_access_pointer(mvm->link_id_to_link_conf[i])) 61 - return i; 62 - 63 - return IWL_MVM_FW_LINK_ID_INVALID; 64 - } 65 - 66 53 static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm, 67 54 struct iwl_link_config_cmd *cmd, 68 55 enum iwl_ctxt_action action) ··· 65 80 return ret; 66 81 } 67 82 68 - int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 69 - struct ieee80211_bss_conf *link_conf) 83 + void iwl_mvm_set_link_fw_id(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 84 + struct ieee80211_bss_conf *link_conf) 70 85 { 71 86 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 72 87 struct iwl_mvm_vif_link_info *link_info = 73 88 mvmvif->link[link_conf->link_id]; 74 89 75 - if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) { 76 - link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm, 77 - mvmvif); 78 - if (link_info->fw_link_id >= 79 - ARRAY_SIZE(mvm->link_id_to_link_conf)) 80 - return -EINVAL; 81 - 82 - rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id], 83 - link_conf); 84 - } 85 - 86 - return 0; 90 + if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) 91 + link_info->fw_link_id = mvmvif->id; 87 92 } 88 93 89 94 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ··· 85 110 struct iwl_link_config_cmd cmd = {}; 86 111 unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD); 87 112 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1); 88 - int ret; 89 113 90 114 if (WARN_ON_ONCE(!link_info)) 91 115 return -EINVAL; 92 116 93 - ret = iwl_mvm_set_link_mapping(mvm, vif, link_conf); 94 - if (ret) 95 - return ret; 117 + iwl_mvm_set_link_fw_id(mvm, vif, link_conf); 96 118 97 119 /* Update SF - Disable if needed. if this fails, SF might still be on 98 120 * while many macs are bound, which is forbidden - so fail the binding. ··· 346 374 return ret; 347 375 } 348 376 349 - int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 350 - struct ieee80211_bss_conf *link_conf) 351 - { 352 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 353 - struct iwl_mvm_vif_link_info *link_info = 354 - mvmvif->link[link_conf->link_id]; 355 - 356 - /* mac80211 thought we have the link, but it was never configured */ 357 - if (WARN_ON(!link_info || 358 - link_info->fw_link_id >= 359 - ARRAY_SIZE(mvm->link_id_to_link_conf))) 360 - return -EINVAL; 361 - 362 - RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id], 363 - NULL); 364 - return 0; 365 - } 366 - 367 377 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 368 378 struct ieee80211_bss_conf *link_conf) 369 379 { ··· 354 400 struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; 355 401 struct iwl_link_config_cmd cmd = {}; 356 402 int ret; 357 - 358 - ret = iwl_mvm_unset_link_mapping(mvm, vif, link_conf); 359 - if (ret) 360 - return 0; 361 403 362 404 cmd.link_id = cpu_to_le32(link_info->fw_link_id); 363 405 link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
+13 -21
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
··· 1586 1586 u32 id = le32_to_cpu(mb->link_id); 1587 1587 union iwl_dbg_tlv_tp_data tp_data = { .fw_pkt = pkt }; 1588 1588 u32 mac_type; 1589 - int link_id = -1; 1589 + int link_id; 1590 1590 u8 notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP, 1591 1591 MISSED_BEACONS_NOTIFICATION, 1592 1592 0); ··· 1602 1602 if (new_notif_ver) 1603 1603 notif_ver = new_notif_ver; 1604 1604 1605 - /* before version four the ID in the notification refers to mac ID */ 1606 - if (notif_ver < 4) { 1607 - vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false); 1608 - bss_conf = &vif->bss_conf; 1609 - } else { 1610 - bss_conf = iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, id, false); 1611 - 1612 - if (!bss_conf) 1613 - return; 1614 - 1615 - vif = bss_conf->vif; 1616 - link_id = bss_conf->link_id; 1617 - } 1618 - 1619 1605 IWL_DEBUG_INFO(mvm, 1620 1606 "missed bcn %s_id=%u, consecutive=%u (%u)\n", 1621 1607 notif_ver < 4 ? "mac" : "link", ··· 1609 1623 le32_to_cpu(mb->consec_missed_beacons), 1610 1624 le32_to_cpu(mb->consec_missed_beacons_since_last_rx)); 1611 1625 1626 + /* 1627 + * starting from version 4 the ID is link ID, but driver 1628 + * uses link ID == MAC ID, so always treat as MAC ID 1629 + */ 1630 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false); 1612 1631 if (!vif) 1613 1632 return; 1614 1633 1634 + bss_conf = &vif->bss_conf; 1635 + link_id = bss_conf->link_id; 1615 1636 mac_type = iwl_mvm_get_mac_type(vif); 1616 1637 1617 1638 IWL_DEBUG_INFO(mvm, "missed beacon mac_type=%u,\n", mac_type); ··· 1868 1875 } else { 1869 1876 struct iwl_channel_switch_start_notif *notif = (void *)pkt->data; 1870 1877 u32 link_id = le32_to_cpu(notif->link_id); 1871 - struct ieee80211_bss_conf *bss_conf = 1872 - iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, link_id, true); 1873 1878 1874 - if (!bss_conf) 1879 + /* we use link ID == MAC ID */ 1880 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, link_id, true); 1881 + if (!vif) 1875 1882 goto out_unlock; 1876 1883 1877 1884 id = link_id; 1878 - mac_link_id = bss_conf->link_id; 1879 - vif = bss_conf->vif; 1880 - csa_active = bss_conf->csa_active; 1885 + mac_link_id = vif->bss_conf.link_id; 1886 + csa_active = vif->bss_conf.csa_active; 1881 1887 } 1882 1888 1883 1889 mvmvif = iwl_mvm_vif_from_mac80211(vif);
+7 -14
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 165 165 mvm->lar_regdom_set = true; 166 166 mvm->mcc_src = src_id; 167 167 168 - if (!iwl_puncturing_is_allowed_in_bios(mvm->bios_enable_puncturing, 169 - le16_to_cpu(resp->mcc))) 170 - ieee80211_hw_set(mvm->hw, DISALLOW_PUNCTURING); 171 - else 172 - __clear_bit(IEEE80211_HW_DISALLOW_PUNCTURING, mvm->hw->flags); 173 - 174 168 iwl_mei_set_country_code(__le16_to_cpu(resp->mcc)); 175 169 176 170 out: ··· 1515 1521 len = sizeof(cmd_v9_v10.v9); 1516 1522 else if (cmd_ver == 8) 1517 1523 len = sizeof(cmd.v8); 1518 - else if (cmd_ver == 7) 1519 - len = sizeof(cmd.v7); 1520 - else if (cmd_ver == 6) 1521 - len = sizeof(cmd.v6); 1522 1524 else if (fw_has_api(&mvm->fw->ucode_capa, 1523 1525 IWL_UCODE_TLV_API_REDUCE_TX_POWER)) 1524 1526 len = sizeof(cmd.v5); ··· 1765 1775 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) 1766 1776 return; 1767 1777 1778 + mvmvif->deflink.average_beacon_energy = 0; 1779 + 1768 1780 INIT_DELAYED_WORK(&mvmvif->csa_work, 1769 1781 iwl_mvm_channel_switch_disconnect_wk); 1770 1782 ··· 1804 1812 1805 1813 vif->driver_flags = IEEE80211_VIF_REMOVE_AP_AFTER_DISASSOC; 1806 1814 1807 - ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf); 1808 - if (ret) 1809 - goto out; 1815 + iwl_mvm_set_link_fw_id(mvm, vif, &vif->bss_conf); 1810 1816 1811 1817 /* 1812 1818 * Not much to do here. The stack will not allow interface ··· 2005 2015 mvm->monitor_on = false; 2006 2016 2007 2017 out: 2008 - iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); 2009 2018 if (vif->type == NL80211_IFTYPE_AP || 2010 2019 vif->type == NL80211_IFTYPE_ADHOC) { 2011 2020 iwl_mvm_dealloc_int_sta(mvm, &mvmvif->deflink.mcast_sta); ··· 4606 4617 struct ieee80211_key_conf *key) 4607 4618 { 4608 4619 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 4620 + 4621 + /* When resuming from wowlan, FW already knows about the newest keys */ 4622 + if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) 4623 + return 0; 4609 4624 4610 4625 guard(mvm)(mvm); 4611 4626 return __iwl_mvm_mac_set_key(hw, cmd, vif, sta, key);
+8 -23
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 304 304 * @mcast_sta: multicast station 305 305 * @phy_ctxt: phy context allocated to this link, if any 306 306 * @bf_data: beacon filtering data 307 + * @average_beacon_energy: average beacon energy for beacons received during 308 + * client connections 307 309 */ 308 310 struct iwl_mvm_vif_link_info { 309 311 u8 bssid[ETH_ALEN]; ··· 344 342 u16 mgmt_queue; 345 343 346 344 struct iwl_mvm_link_bf_data bf_data; 345 + u32 average_beacon_energy; 347 346 }; 348 347 349 348 /** ··· 377 374 * preventing the enablement of EMLSR 378 375 * @IWL_MVM_ESR_EXIT_CSA: CSA happened, so exit EMLSR 379 376 * @IWL_MVM_ESR_EXIT_LINK_USAGE: Exit EMLSR due to low tpt on secondary link 380 - * @IWL_MVM_ESR_EXIT_FAIL_ENTRY: Exit EMLSR due to entry failure 381 377 */ 382 378 enum iwl_mvm_esr_state { 383 379 IWL_MVM_ESR_BLOCKED_PREVENTION = 0x1, ··· 392 390 IWL_MVM_ESR_EXIT_BANDWIDTH = 0x80000, 393 391 IWL_MVM_ESR_EXIT_CSA = 0x100000, 394 392 IWL_MVM_ESR_EXIT_LINK_USAGE = 0x200000, 395 - IWL_MVM_ESR_EXIT_FAIL_ENTRY = 0x400000, 396 393 }; 397 394 398 395 #define IWL_MVM_BLOCK_ESR_REASONS 0xffff ··· 1180 1179 1181 1180 struct ieee80211_vif __rcu *vif_id_to_mac[NUM_MAC_INDEX_DRIVER]; 1182 1181 1183 - struct ieee80211_bss_conf __rcu *link_id_to_link_conf[IWL_FW_MAX_LINK_ID + 1]; 1184 - 1185 1182 u8 *error_recovery_buf; 1186 1183 1187 1184 #ifdef CONFIG_IWLWIFI_LEDS ··· 1371 1372 struct iwl_mvm_acs_survey *acs_survey; 1372 1373 1373 1374 bool statistics_clear; 1374 - u32 bios_enable_puncturing; 1375 1375 }; 1376 1376 1377 1377 /* Extract MVM priv from op_mode and _hw */ ··· 1483 1485 return rcu_dereference(mvm->vif_id_to_mac[vif_id]); 1484 1486 1485 1487 return rcu_dereference_protected(mvm->vif_id_to_mac[vif_id], 1486 - lockdep_is_held(&mvm->mutex)); 1487 - } 1488 - 1489 - static inline struct ieee80211_bss_conf * 1490 - iwl_mvm_rcu_fw_link_id_to_link_conf(struct iwl_mvm *mvm, u8 link_id, bool rcu) 1491 - { 1492 - if (IWL_FW_CHECK(mvm, link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf), 1493 - "erroneous FW link ID: %d\n", link_id)) 1494 - return NULL; 1495 - 1496 - if (rcu) 1497 - return rcu_dereference(mvm->link_id_to_link_conf[link_id]); 1498 - 1499 - return rcu_dereference_protected(mvm->link_id_to_link_conf[link_id], 1500 1488 lockdep_is_held(&mvm->mutex)); 1501 1489 } 1502 1490 ··· 2077 2093 struct iwl_rx_cmd_buffer *rxb); 2078 2094 void iwl_mvm_channel_switch_error_notif(struct iwl_mvm *mvm, 2079 2095 struct iwl_rx_cmd_buffer *rxb); 2096 + void iwl_mvm_rx_beacon_filter_notif(struct iwl_mvm *mvm, 2097 + struct iwl_rx_cmd_buffer *rxb); 2098 + 2080 2099 /* Bindings */ 2081 2100 int iwl_mvm_binding_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 2082 2101 int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); ··· 2087 2100 2088 2101 /* Links */ 2089 2102 void iwl_mvm_init_link(struct iwl_mvm_vif_link_info *link); 2090 - int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2091 - struct ieee80211_bss_conf *link_conf); 2103 + void iwl_mvm_set_link_fw_id(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2104 + struct ieee80211_bss_conf *link_conf); 2092 2105 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2093 2106 struct ieee80211_bss_conf *link_conf); 2094 2107 int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2095 2108 struct ieee80211_bss_conf *link_conf, 2096 2109 u32 changes, bool active); 2097 - int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2098 - struct ieee80211_bss_conf *link_conf); 2099 2110 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 2100 2111 struct ieee80211_bss_conf *link_conf); 2101 2112 int iwl_mvm_disable_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+19 -45
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 161 161 iwl_mvm_get_primary_link(vif)); 162 162 } 163 163 164 - static void iwl_mvm_rx_esr_trans_fail_notif(struct iwl_mvm *mvm, 165 - struct iwl_rx_cmd_buffer *rxb) 166 - { 167 - struct iwl_rx_packet *pkt = rxb_addr(rxb); 168 - struct iwl_esr_trans_fail_notif *notif = (void *)pkt->data; 169 - struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm); 170 - u8 fw_link_id = le32_to_cpu(notif->link_id); 171 - struct ieee80211_bss_conf *bss_conf; 172 - 173 - if (IS_ERR_OR_NULL(vif)) 174 - return; 175 - 176 - IWL_DEBUG_INFO(mvm, "Failed to %s eSR on link %d, reason %d\n", 177 - le32_to_cpu(notif->activation) ? "enter" : "exit", 178 - le32_to_cpu(notif->link_id), 179 - le32_to_cpu(notif->err_code)); 180 - 181 - /* we couldn't go back to single link, disconnect */ 182 - if (!le32_to_cpu(notif->activation)) { 183 - iwl_mvm_connection_loss(mvm, vif, "emlsr exit failed"); 184 - return; 185 - } 186 - 187 - bss_conf = iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, fw_link_id, false); 188 - if (IWL_FW_CHECK(mvm, !bss_conf, 189 - "FW reported failure to activate EMLSR on a non-existing link: %d\n", 190 - fw_link_id)) 191 - return; 192 - 193 - /* 194 - * We failed to activate the second link and enter EMLSR, we need to go 195 - * back to single link. 196 - */ 197 - iwl_mvm_exit_esr(mvm, vif, IWL_MVM_ESR_EXIT_FAIL_ENTRY, 198 - bss_conf->link_id); 199 - } 200 - 201 164 static void iwl_mvm_rx_monitor_notif(struct iwl_mvm *mvm, 202 165 struct iwl_rx_cmd_buffer *rxb) 203 166 { ··· 489 526 RX_HANDLER_GRP(SCAN_GROUP, CHANNEL_SURVEY_NOTIF, 490 527 iwl_mvm_rx_channel_survey_notif, RX_HANDLER_ASYNC_LOCKED, 491 528 struct iwl_umac_scan_channel_survey_notif), 492 - RX_HANDLER_GRP(MAC_CONF_GROUP, EMLSR_TRANS_FAIL_NOTIF, 493 - iwl_mvm_rx_esr_trans_fail_notif, 494 - RX_HANDLER_ASYNC_LOCKED_WIPHY, 495 - struct iwl_esr_trans_fail_notif), 529 + RX_HANDLER_GRP(DATA_PATH_GROUP, BEACON_FILTER_IN_NOTIF, 530 + iwl_mvm_rx_beacon_filter_notif, 531 + RX_HANDLER_ASYNC_LOCKED, 532 + /* same size as v1 */ 533 + struct iwl_beacon_filter_notif), 496 534 }; 497 535 #undef RX_HANDLER 498 536 #undef RX_HANDLER_GRP ··· 624 660 HCMD_NAME(STA_REMOVE_CMD), 625 661 HCMD_NAME(STA_DISABLE_TX_CMD), 626 662 HCMD_NAME(ROC_CMD), 627 - HCMD_NAME(EMLSR_TRANS_FAIL_NOTIF), 628 663 HCMD_NAME(ROC_NOTIF), 629 664 HCMD_NAME(CHANNEL_SWITCH_ERROR_NOTIF), 630 665 HCMD_NAME(MISSED_VAP_NOTIF), ··· 664 701 HCMD_NAME(ESR_MODE_NOTIF), 665 702 HCMD_NAME(MONITOR_NOTIF), 666 703 HCMD_NAME(THERMAL_DUAL_CHAIN_REQUEST), 704 + HCMD_NAME(BEACON_FILTER_IN_NOTIF), 667 705 HCMD_NAME(STA_PM_NOTIF), 668 706 HCMD_NAME(MU_GROUP_MGMT_NOTIF), 669 707 HCMD_NAME(RX_QUEUES_NOTIFICATION), ··· 1361 1397 } 1362 1398 } 1363 1399 1364 - mvm->bios_enable_puncturing = iwl_uefi_get_puncturing(&mvm->fwrt); 1365 - 1366 1400 if (iwl_mvm_has_new_tx_api(mvm)) { 1367 1401 /* 1368 1402 * If we have the new TX/queue allocation API initialize them ··· 2017 2055 2018 2056 if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL) 2019 2057 IWL_ERR(mvm, "Command queue full!\n"); 2020 - else if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) && 2058 + else if (!iwl_trans_is_dead(mvm->trans) && 2021 2059 !test_and_clear_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, 2022 2060 &mvm->status)) 2023 2061 iwl_mvm_dump_nic_error_log(mvm); ··· 2119 2157 iwl_dbg_tlv_time_point(&mvm->fwrt, tp_id, tp_data); 2120 2158 } 2121 2159 2160 + static void iwl_mvm_dump(struct iwl_op_mode *op_mode) 2161 + { 2162 + struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); 2163 + struct iwl_fw_runtime *fwrt = &mvm->fwrt; 2164 + 2165 + if (!iwl_trans_fw_running(fwrt->trans)) 2166 + return; 2167 + 2168 + iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_USER_TRIGGER, NULL); 2169 + } 2170 + 2122 2171 #ifdef CONFIG_PM_SLEEP 2123 2172 static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode) 2124 2173 { ··· 2192 2219 IWL_MVM_COMMON_OPS, 2193 2220 .rx = iwl_mvm_rx_mq, 2194 2221 .rx_rss = iwl_mvm_rx_mq_rss, 2222 + .dump = iwl_mvm_dump, 2195 2223 };
+11 -13
drivers/net/wireless/intel/iwlwifi/mvm/rx.c
··· 877 877 u32 rx_bytes[MAC_INDEX_AUX] = {}; 878 878 int fw_link_id; 879 879 880 - for (fw_link_id = 0; fw_link_id < ARRAY_SIZE(mvm->link_id_to_link_conf); 880 + /* driver uses link ID == MAC ID */ 881 + for (fw_link_id = 0; fw_link_id < ARRAY_SIZE(mvm->vif_id_to_mac); 881 882 fw_link_id++) { 882 883 struct iwl_stats_ntfy_per_link *link_stats; 883 - struct ieee80211_bss_conf *bss_conf; 884 - struct iwl_mvm_vif *mvmvif; 885 884 struct iwl_mvm_vif_link_info *link_info; 885 + struct iwl_mvm_vif *mvmvif; 886 + struct ieee80211_vif *vif; 886 887 int link_id; 887 888 int sig; 888 889 889 - bss_conf = iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, fw_link_id, 890 - false); 891 - if (!bss_conf) 890 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, fw_link_id, false); 891 + if (!vif) 892 892 continue; 893 893 894 - if (bss_conf->vif->type != NL80211_IFTYPE_STATION) 894 + if (vif->type != NL80211_IFTYPE_STATION) 895 895 continue; 896 896 897 - link_id = bss_conf->link_id; 897 + link_id = vif->bss_conf.link_id; 898 898 if (link_id >= ARRAY_SIZE(mvmvif->link)) 899 899 continue; 900 900 901 - mvmvif = iwl_mvm_vif_from_mac80211(bss_conf->vif); 901 + mvmvif = iwl_mvm_vif_from_mac80211(vif); 902 902 link_info = mvmvif->link[link_id]; 903 903 if (!link_info) 904 904 continue; ··· 916 916 917 917 if (link_info->phy_ctxt && 918 918 link_info->phy_ctxt->channel->band == NL80211_BAND_2GHZ) 919 - iwl_mvm_bt_coex_update_link_esr(mvm, bss_conf->vif, 920 - link_id); 919 + iwl_mvm_bt_coex_update_link_esr(mvm, vif, link_id); 921 920 922 921 /* make sure that beacon statistics don't go backwards with TCM 923 922 * request to clear statistics ··· 926 927 mvmvif->link[link_id]->beacon_stats.num_beacons; 927 928 928 929 sig = -le32_to_cpu(link_stats->beacon_filter_average_energy); 929 - iwl_mvm_update_link_sig(bss_conf->vif, sig, link_info, 930 - bss_conf); 930 + iwl_mvm_update_link_sig(vif, sig, link_info, &vif->bss_conf); 931 931 932 932 if (WARN_ONCE(mvmvif->id >= MAC_INDEX_AUX, 933 933 "invalid mvmvif id: %d", mvmvif->id))
+85 -6
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 246 246 ieee80211_rx_napi(mvm->hw, sta, skb, napi); 247 247 } 248 248 249 + static bool iwl_mvm_used_average_energy(struct iwl_mvm *mvm, 250 + struct iwl_rx_mpdu_desc *desc, 251 + struct ieee80211_hdr *hdr, 252 + struct ieee80211_rx_status *rx_status) 253 + { 254 + struct iwl_mvm_vif *mvm_vif; 255 + struct ieee80211_vif *vif; 256 + u32 id; 257 + 258 + if (unlikely(!hdr || !desc)) 259 + return false; 260 + 261 + if (likely(!ieee80211_is_beacon(hdr->frame_control))) 262 + return false; 263 + 264 + /* for the link conf lookup */ 265 + guard(rcu)(); 266 + 267 + /* MAC or link ID depending on FW, but driver has them equal */ 268 + id = u8_get_bits(desc->mac_phy_band, 269 + IWL_RX_MPDU_MAC_PHY_BAND_MAC_MASK); 270 + 271 + /* >= means AUX MAC/link ID, no energy correction needed then */ 272 + if (id >= ARRAY_SIZE(mvm->vif_id_to_mac)) 273 + return false; 274 + 275 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true); 276 + if (!vif) 277 + return false; 278 + 279 + mvm_vif = iwl_mvm_vif_from_mac80211(vif); 280 + 281 + /* 282 + * If we know the MAC by MAC or link ID then the frame was 283 + * received for the link, so by filtering it means it was 284 + * from the AP the link is connected to. 285 + */ 286 + 287 + /* skip also in case we don't have it (yet) */ 288 + if (!mvm_vif->deflink.average_beacon_energy) 289 + return false; 290 + 291 + IWL_DEBUG_STATS(mvm, "energy override by average %d\n", 292 + mvm_vif->deflink.average_beacon_energy); 293 + rx_status->signal = -mvm_vif->deflink.average_beacon_energy; 294 + return true; 295 + } 296 + 249 297 static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm, 298 + struct iwl_rx_mpdu_desc *desc, 299 + struct ieee80211_hdr *hdr, 250 300 struct ieee80211_rx_status *rx_status, 251 301 u32 rate_n_flags, int energy_a, 252 302 int energy_b) 253 303 { 254 304 int max_energy; 255 - u32 rate_flags = rate_n_flags; 256 305 257 306 energy_a = energy_a ? -energy_a : S8_MIN; 258 307 energy_b = energy_b ? -energy_b : S8_MIN; ··· 310 261 IWL_DEBUG_STATS(mvm, "energy In A %d B %d, and max %d\n", 311 262 energy_a, energy_b, max_energy); 312 263 264 + if (iwl_mvm_used_average_energy(mvm, desc, hdr, rx_status)) 265 + return; 266 + 313 267 rx_status->signal = max_energy; 314 - rx_status->chains = 315 - (rate_flags & RATE_MCS_ANT_AB_MSK) >> RATE_MCS_ANT_POS; 268 + rx_status->chains = u32_get_bits(rate_n_flags, RATE_MCS_ANT_AB_MSK); 316 269 rx_status->chain_signal[0] = energy_a; 317 270 rx_status->chain_signal[1] = energy_b; 318 271 } ··· 1957 1906 /* 1958 1907 * Note: requires also rx_status->band to be prefilled, as well 1959 1908 * as phy_data (apart from phy_data->info_type) 1909 + * Note: desc/hdr may be NULL 1960 1910 */ 1961 1911 static void iwl_mvm_rx_fill_status(struct iwl_mvm *mvm, 1912 + struct iwl_rx_mpdu_desc *desc, 1913 + struct ieee80211_hdr *hdr, 1962 1914 struct sk_buff *skb, 1963 1915 struct iwl_mvm_rx_phy_data *phy_data, 1964 1916 int queue) ··· 2016 1962 2017 1963 rx_status->freq = ieee80211_channel_to_frequency(phy_data->channel, 2018 1964 rx_status->band); 2019 - iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags, 1965 + iwl_mvm_get_signal_strength(mvm, desc, hdr, rx_status, rate_n_flags, 2020 1966 phy_data->energy_a, phy_data->energy_b); 2021 1967 2022 1968 /* using TLV format and must be after all fixed len fields */ ··· 2269 2215 goto out; 2270 2216 } 2271 2217 2272 - iwl_mvm_rx_fill_status(mvm, skb, &phy_data, queue); 2218 + iwl_mvm_rx_fill_status(mvm, desc, hdr, skb, &phy_data, queue); 2273 2219 2274 2220 if (sta) { 2275 2221 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); ··· 2499 2445 rx_status->band = phy_data.channel > 14 ? NL80211_BAND_5GHZ : 2500 2446 NL80211_BAND_2GHZ; 2501 2447 2502 - iwl_mvm_rx_fill_status(mvm, skb, &phy_data, queue); 2448 + iwl_mvm_rx_fill_status(mvm, NULL, NULL, skb, &phy_data, queue); 2503 2449 2504 2450 /* no more radio tap info should be put after this point. 2505 2451 * ··· 2601 2547 iwl_mvm_release_frames_from_notif(mvm, napi, baid, nssn, queue); 2602 2548 out: 2603 2549 rcu_read_unlock(); 2550 + } 2551 + 2552 + void iwl_mvm_rx_beacon_filter_notif(struct iwl_mvm *mvm, 2553 + struct iwl_rx_cmd_buffer *rxb) 2554 + { 2555 + struct iwl_rx_packet *pkt = rxb_addr(rxb); 2556 + /* MAC or link ID in v1/v2, but driver has the IDs equal */ 2557 + struct iwl_beacon_filter_notif *notif = (void *)pkt->data; 2558 + u32 id = le32_to_cpu(notif->link_id); 2559 + struct iwl_mvm_vif *mvm_vif; 2560 + struct ieee80211_vif *vif; 2561 + 2562 + /* >= means AUX MAC/link ID, no energy correction needed then */ 2563 + if (IWL_FW_CHECK(mvm, id >= ARRAY_SIZE(mvm->vif_id_to_mac), 2564 + "invalid link ID %d\n", id)) 2565 + return; 2566 + 2567 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false); 2568 + if (!vif) 2569 + return; 2570 + 2571 + mvm_vif = iwl_mvm_vif_from_mac80211(vif); 2572 + 2573 + mvm_vif->deflink.average_beacon_energy = 2574 + le32_to_cpu(notif->average_energy); 2604 2575 }
+2 -2
drivers/net/wireless/intel/iwlwifi/mvm/scan.c
··· 836 836 int n_channels) 837 837 { 838 838 return ((n_ssids <= PROBE_OPTION_MAX) && 839 - (n_channels <= mvm->fw->ucode_capa.n_scan_channels) & 839 + (n_channels <= mvm->fw->ucode_capa.n_scan_channels) && 840 840 (ies->common_ie_len + 841 841 ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] + 842 842 ies->len[NL80211_BAND_6GHZ] <= ··· 3547 3547 if (!(mvm->scan_status & type)) 3548 3548 return 0; 3549 3549 3550 - if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) { 3550 + if (!iwl_trans_device_enabled(mvm->trans)) { 3551 3551 ret = 0; 3552 3552 goto out; 3553 3553 }
+2 -23
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 958 958 { 959 959 struct iwl_rx_packet *pkt = rxb_addr(rxb); 960 960 struct iwl_session_prot_notif *notif = (void *)pkt->data; 961 - unsigned int ver = 962 - iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, 963 - SESSION_PROTECTION_NOTIF, 2); 964 961 int id = le32_to_cpu(notif->mac_link_id); 965 962 struct ieee80211_vif *vif; 966 963 struct iwl_mvm_vif *mvmvif; 967 - unsigned int notif_link_id; 968 964 969 965 rcu_read_lock(); 970 966 971 - if (ver <= 2) { 972 - vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true); 973 - } else { 974 - struct ieee80211_bss_conf *link_conf = 975 - iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, id, true); 976 - 977 - if (!link_conf) 978 - goto out_unlock; 979 - 980 - notif_link_id = link_conf->link_id; 981 - vif = link_conf->vif; 982 - } 983 - 967 + /* note we use link ID == MAC ID */ 968 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true); 984 969 if (!vif) 985 970 goto out_unlock; 986 971 987 972 mvmvif = iwl_mvm_vif_from_mac80211(vif); 988 - 989 - if (WARN(ver > 2 && mvmvif->time_event_data.link_id >= 0 && 990 - mvmvif->time_event_data.link_id != notif_link_id, 991 - "SESSION_PROTECTION_NOTIF was received for link %u, while the current time event is on link %u\n", 992 - notif_link_id, mvmvif->time_event_data.link_id)) 993 - goto out_unlock; 994 973 995 974 /* The vif is not a P2P_DEVICE, maintain its time_event_data */ 996 975 if (vif->type != NL80211_IFTYPE_P2P_DEVICE) {
+2 -2
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 501 501 {IWL_PCI_DEVICE(0x2729, PCI_ANY_ID, iwl_ma_mac_cfg)}, 502 502 {IWL_PCI_DEVICE(0x7E40, PCI_ANY_ID, iwl_ma_mac_cfg)}, 503 503 #endif /* CONFIG_IWLMVM */ 504 - #if IS_ENABLED(CONFIG_IWLMLD) 504 + #if IS_ENABLED(CONFIG_IWLMVM) || IS_ENABLED(CONFIG_IWLMLD) 505 505 /* Bz devices */ 506 506 {IWL_PCI_DEVICE(0x272b, PCI_ANY_ID, iwl_gl_mac_cfg)}, 507 507 {IWL_PCI_DEVICE(0xA840, 0x0000, iwl_bz_mac_cfg)}, ··· 546 546 {IWL_PCI_DEVICE(0xD340, PCI_ANY_ID, iwl_sc_mac_cfg)}, 547 547 {IWL_PCI_DEVICE(0x6E70, PCI_ANY_ID, iwl_sc_mac_cfg)}, 548 548 {IWL_PCI_DEVICE(0xD240, PCI_ANY_ID, iwl_sc_mac_cfg)}, 549 - #endif /* CONFIG_IWLMLD */ 549 + #endif /* CONFIG_IWLMVM || CONFIG_IWLMLD */ 550 550 551 551 {0} 552 552 };
+1
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/internal.h
··· 1091 1091 void iwl_trans_pcie_stop_device(struct iwl_trans *trans); 1092 1092 1093 1093 /* common functions that are used by gen2 transport */ 1094 + void iwl_trans_pcie_gen2_op_mode_leave(struct iwl_trans *trans); 1094 1095 int iwl_pcie_gen2_apm_init(struct iwl_trans *trans); 1095 1096 void iwl_pcie_apm_config(struct iwl_trans *trans); 1096 1097 int iwl_pcie_prepare_card_hw(struct iwl_trans *trans);
+20
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c
··· 630 630 mutex_unlock(&trans_pcie->mutex); 631 631 return ret; 632 632 } 633 + 634 + void iwl_trans_pcie_gen2_op_mode_leave(struct iwl_trans *trans) 635 + { 636 + struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 637 + 638 + mutex_lock(&trans_pcie->mutex); 639 + 640 + /* disable interrupts - don't enable HW RF kill interrupt */ 641 + iwl_disable_interrupts(trans); 642 + 643 + iwl_pcie_gen2_apm_stop(trans, true); 644 + 645 + iwl_disable_interrupts(trans); 646 + 647 + iwl_pcie_disable_ict(trans); 648 + 649 + mutex_unlock(&trans_pcie->mutex); 650 + 651 + iwl_pcie_synchronize_irqs(trans); 652 + }
+6 -6
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c
··· 392 392 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); 393 393 } 394 394 395 - if (ret < 0) 395 + if (ret) 396 396 IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n"); 397 397 398 398 IWL_DEBUG_INFO(trans, "stop master\n"); ··· 495 495 CSR_HW_IF_CONFIG_REG_PCI_OWN_SET, 496 496 HW_READY_TIMEOUT); 497 497 498 - if (ret >= 0) 498 + if (!ret) 499 499 iwl_set_bit(trans, CSR_MBOX_SET_REG, CSR_MBOX_SET_REG_OS_ALIVE); 500 500 501 - IWL_DEBUG_INFO(trans, "hardware%s ready\n", ret < 0 ? " not" : ""); 501 + IWL_DEBUG_INFO(trans, "hardware%s ready\n", ret ? " not" : ""); 502 502 return ret; 503 503 } 504 504 ··· 512 512 513 513 ret = iwl_pcie_set_hw_ready(trans); 514 514 /* If the card is ready, exit 0 */ 515 - if (ret >= 0) { 515 + if (!ret) { 516 516 trans->csme_own = false; 517 517 return 0; 518 518 } ··· 530 530 531 531 do { 532 532 ret = iwl_pcie_set_hw_ready(trans); 533 - if (ret >= 0) { 533 + if (!ret) { 534 534 trans->csme_own = false; 535 535 return 0; 536 536 } ··· 2353 2353 * and do not save/restore SRAM when power cycling. 2354 2354 */ 2355 2355 ret = iwl_poll_bits_mask(trans, CSR_GP_CNTRL, poll, mask, 15000); 2356 - if (unlikely(ret < 0)) { 2356 + if (unlikely(ret)) { 2357 2357 u32 cntrl = iwl_read32(trans, CSR_GP_CNTRL); 2358 2358 2359 2359 if (silent) {
+6 -7
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c
··· 25 25 #include "iwl-op-mode.h" 26 26 #include "internal.h" 27 27 #include "fw/api/tx.h" 28 + #include "fw/dbg.h" 28 29 #include "pcie/utils.h" 29 30 30 31 /*************** DMA-QUEUE-GENERAL-FUNCTIONS ***** ··· 592 591 593 592 /* Wait for DMA channels to be idle */ 594 593 ret = iwl_poll_bits(trans, FH_TSSR_TX_STATUS_REG, mask, 5000); 595 - if (ret < 0) 594 + if (ret) 596 595 IWL_ERR(trans, 597 596 "Failing on timeout while stopping DMA channel %d [0x%08x]\n", 598 597 ch, iwl_read32(trans, FH_TSSR_TX_STATUS_REG)); ··· 1639 1638 /* If a Tx command is being handled and it isn't in the actual 1640 1639 * command queue then there a command routing bug has been introduced 1641 1640 * in the queue management code. */ 1642 - if (WARN(txq_id != trans->conf.cmd_queue, 1643 - "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n", 1644 - txq_id, trans->conf.cmd_queue, sequence, txq->read_ptr, 1645 - txq->write_ptr)) { 1646 - iwl_print_hex_error(trans, pkt, 32); 1641 + if (IWL_FW_CHECK(trans, txq_id != trans->conf.cmd_queue, 1642 + "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d pkt=%*phN\n", 1643 + txq_id, trans->conf.cmd_queue, sequence, txq->read_ptr, 1644 + txq->write_ptr, 32, pkt)) 1647 1645 return; 1648 - } 1649 1646 1650 1647 spin_lock_bh(&txq->lock); 1651 1648
+2
drivers/net/wireless/intel/iwlwifi/pcie/utils.h
··· 6 6 #ifndef __iwl_pcie_utils_h__ 7 7 #define __iwl_pcie_utils_h__ 8 8 9 + #include "iwl-io.h" 10 + 9 11 void iwl_trans_pcie_dump_regs(struct iwl_trans *trans, struct pci_dev *pdev); 10 12 11 13 static inline void _iwl_trans_set_bits_mask(struct iwl_trans *trans,
+4
drivers/net/wireless/marvell/mwl8k.c
··· 1227 1227 1228 1228 addr = dma_map_single(&priv->pdev->dev, skb->data, 1229 1229 MWL8K_RX_MAXSZ, DMA_FROM_DEVICE); 1230 + if (dma_mapping_error(&priv->pdev->dev, addr)) { 1231 + kfree_skb(skb); 1232 + break; 1233 + } 1230 1234 1231 1235 rxq->rxd_count++; 1232 1236 rx = rxq->tail++;
+2 -1
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 5384 5384 NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE | 5385 5385 NL80211_FEATURE_STATIC_SMPS | 5386 5386 NL80211_FEATURE_DYNAMIC_SMPS | 5387 - NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR; 5387 + NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR | 5388 + NL80211_FEATURE_AP_SCAN; 5388 5389 wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS); 5389 5390 wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_BEACON_PROTECTION); 5390 5391 wiphy_ext_feature_set(hw->wiphy,
+7 -7
drivers/net/wireless/virtual/mac80211_hwsim.h
··· 62 62 * @HWSIM_CMD_TX_INFO_FRAME: Transmission info report from user space to 63 63 * kernel, uses: 64 64 * %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_FLAGS, 65 - * %HWSIM_ATTR_TX_INFO, %WSIM_ATTR_TX_INFO_FLAGS, 65 + * %HWSIM_ATTR_TX_INFO, %HWSIM_ATTR_TX_INFO_FLAGS, 66 66 * %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE 67 67 * @HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters, 68 68 * returns the radio ID (>= 0) or negative on errors, if successful ··· 126 126 * space 127 127 * @HWSIM_ATTR_TX_INFO: ieee80211_tx_rate array 128 128 * @HWSIM_ATTR_COOKIE: sk_buff cookie to identify the frame 129 - * @HWSIM_ATTR_CHANNELS: u32 attribute used with the %HWSIM_CMD_CREATE_RADIO 129 + * @HWSIM_ATTR_CHANNELS: u32 attribute used with the %HWSIM_CMD_NEW_RADIO 130 130 * command giving the number of channels supported by the new radio 131 131 * @HWSIM_ATTR_RADIO_ID: u32 attribute used with %HWSIM_CMD_DESTROY_RADIO 132 132 * only to destroy a radio 133 - * @HWSIM_ATTR_REG_HINT_ALPHA2: alpha2 for regulatoro driver hint 133 + * @HWSIM_ATTR_REG_HINT_ALPHA2: alpha2 for regulatory driver hint 134 134 * (nla string, length 2) 135 135 * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute) 136 136 * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute) 137 137 * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag) 138 - * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO 138 + * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_NEW_RADIO 139 139 * command to force use of channel contexts even when only a 140 140 * single channel is supported 141 - * @HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE: used with the %HWSIM_CMD_CREATE_RADIO 141 + * @HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE: used with the %HWSIM_CMD_NEW_RADIO 142 142 * command to force radio removal when process that created the radio dies 143 143 * @HWSIM_ATTR_RADIO_NAME: Name of radio, e.g. phy666 144 144 * @HWSIM_ATTR_NO_VIF: Do not create vif (wlanX) when creating radio. 145 - * @HWSIM_ATTR_PAD: padding attribute for 64-bit values, ignore 146 145 * @HWSIM_ATTR_FREQ: Frequency at which packet is transmitted or received. 146 + * @HWSIM_ATTR_PAD: padding attribute for 64-bit values, ignore 147 147 * @HWSIM_ATTR_TX_INFO_FLAGS: additional flags for corresponding 148 148 * rates of %HWSIM_ATTR_TX_INFO 149 149 * @HWSIM_ATTR_PERM_ADDR: permanent mac address of new radio ··· 151 151 * @HWSIM_ATTR_CIPHER_SUPPORT: u32 array of supported cipher types 152 152 * @HWSIM_ATTR_MLO_SUPPORT: claim MLO support (exact parameters TBD) for 153 153 * the new radio 154 - * @HWSIM_ATTR_PMSR_SUPPORT: nested attribute used with %HWSIM_CMD_CREATE_RADIO 154 + * @HWSIM_ATTR_PMSR_SUPPORT: nested attribute used with %HWSIM_CMD_NEW_RADIO 155 155 * to provide peer measurement capabilities. (nl80211_peer_measurement_attrs) 156 156 * @HWSIM_ATTR_PMSR_REQUEST: nested attribute used with %HWSIM_CMD_START_PMSR 157 157 * to provide details about peer measurement request (nl80211_peer_measurement_attrs)
+5 -1
include/net/cfg80211.h
··· 633 633 const struct ieee80211_sband_iftype_data *data; 634 634 int i; 635 635 636 - if (WARN_ON(iftype >= NL80211_IFTYPE_MAX)) 636 + if (WARN_ON(iftype >= NUM_NL80211_IFTYPES)) 637 637 return NULL; 638 638 639 639 if (iftype == NL80211_IFTYPE_AP_VLAN) ··· 1526 1526 * @n_counter_offsets_beacon: number of csa counters the beacon (tail) 1527 1527 * @n_counter_offsets_presp: number of csa counters in the probe response 1528 1528 * @beacon_after: beacon data to be used on the new channel 1529 + * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters 1529 1530 * @radar_required: whether radar detection is required on the new channel 1530 1531 * @block_tx: whether transmissions should be blocked while changing 1531 1532 * @count: number of beacons until switch ··· 1541 1540 unsigned int n_counter_offsets_beacon; 1542 1541 unsigned int n_counter_offsets_presp; 1543 1542 struct cfg80211_beacon_data beacon_after; 1543 + struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; 1544 1544 bool radar_required; 1545 1545 bool block_tx; 1546 1546 u8 count; ··· 1557 1555 * @counter_offset_beacon: offsets of the counters within the beacon (tail) 1558 1556 * @counter_offset_presp: offsets of the counters within the probe response 1559 1557 * @beacon_next: beacon data to be used after the color change 1558 + * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters 1560 1559 * @count: number of beacons until the color change 1561 1560 * @color: the color used after the change 1562 1561 * @link_id: defines the link on which color change is expected during MLO. ··· 1568 1565 u16 counter_offset_beacon; 1569 1566 u16 counter_offset_presp; 1570 1567 struct cfg80211_beacon_data beacon_next; 1568 + struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; 1571 1569 u8 count; 1572 1570 u8 color; 1573 1571 u8 link_id;
+13 -1
net/mac80211/cfg.c
··· 3841 3841 */ 3842 3842 struct ieee80211_link_data *iter; 3843 3843 3844 - for_each_sdata_link(local, iter) { 3844 + for_each_sdata_link_rcu(local, iter) { 3845 3845 if (iter->sdata == sdata || 3846 3846 rcu_access_pointer(iter->conf->tx_bss_conf) != tx_bss_conf) 3847 3847 continue; ··· 4186 4186 err = -EOPNOTSUPP; 4187 4187 goto out; 4188 4188 } 4189 + 4190 + err = ieee80211_set_unsol_bcast_probe_resp(sdata, 4191 + &params->unsol_bcast_probe_resp, 4192 + link_data, link_conf, &changed); 4193 + if (err) 4194 + goto out; 4189 4195 4190 4196 chanctx = container_of(conf, struct ieee80211_chanctx, conf); 4191 4197 ··· 5133 5127 err = -EBUSY; 5134 5128 goto out; 5135 5129 } 5130 + 5131 + err = ieee80211_set_unsol_bcast_probe_resp(sdata, 5132 + &params->unsol_bcast_probe_resp, 5133 + link, link_conf, &changed); 5134 + if (err) 5135 + goto out; 5136 5136 5137 5137 err = ieee80211_set_color_change_beacon(link, params, &changed); 5138 5138 if (err)
+9 -9
net/mac80211/chan.c
··· 910 910 conf = rcu_dereference_protected(link->conf->chanctx_conf, 911 911 lockdep_is_held(&local->hw.wiphy->mtx)); 912 912 913 - if (conf) { 913 + if (conf && !local->in_reconfig) { 914 914 curr_ctx = container_of(conf, struct ieee80211_chanctx, conf); 915 915 916 916 drv_unassign_vif_chanctx(local, sdata, link->conf, curr_ctx); ··· 930 930 931 931 /* succeeded, so commit it to the data structures */ 932 932 conf = &new_ctx->conf; 933 - list_add(&link->assigned_chanctx_list, 934 - &new_ctx->assigned_links); 933 + if (!local->in_reconfig) 934 + list_add(&link->assigned_chanctx_list, 935 + &new_ctx->assigned_links); 935 936 } 936 937 } else { 937 938 ret = 0; ··· 1109 1108 __ieee80211_link_copy_chanctx_to_vlans(link, clear); 1110 1109 } 1111 1110 1112 - int ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link) 1111 + void ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link) 1113 1112 { 1114 1113 struct ieee80211_sub_if_data *sdata = link->sdata; 1115 1114 struct ieee80211_chanctx *ctx = link->reserved_chanctx; ··· 1117 1116 lockdep_assert_wiphy(sdata->local->hw.wiphy); 1118 1117 1119 1118 if (WARN_ON(!ctx)) 1120 - return -EINVAL; 1119 + return; 1121 1120 1122 1121 list_del(&link->reserved_chanctx_list); 1123 1122 link->reserved_chanctx = NULL; ··· 1125 1124 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { 1126 1125 if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) { 1127 1126 if (WARN_ON(!ctx->replace_ctx)) 1128 - return -EINVAL; 1127 + return; 1129 1128 1130 1129 WARN_ON(ctx->replace_ctx->replace_state != 1131 1130 IEEE80211_CHANCTX_WILL_BE_REPLACED); ··· 1141 1140 ieee80211_free_chanctx(sdata->local, ctx, false); 1142 1141 } 1143 1142 } 1144 - 1145 - return 0; 1146 1143 } 1147 1144 1148 1145 static struct ieee80211_chanctx * ··· 1933 1934 if (ret < 0) 1934 1935 goto out; 1935 1936 1936 - __ieee80211_link_release_channel(link, false); 1937 + if (!local->in_reconfig) 1938 + __ieee80211_link_release_channel(link, false); 1937 1939 1938 1940 ctx = ieee80211_find_chanctx(local, link, chanreq, mode); 1939 1941 /* Note: context is now reserved */
+4 -1
net/mac80211/driver-ops.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Copyright 2015 Intel Deutschland GmbH 4 - * Copyright (C) 2022-2024 Intel Corporation 4 + * Copyright (C) 2022-2025 Intel Corporation 5 5 */ 6 6 #include <net/mac80211.h> 7 7 #include "ieee80211_i.h" ··· 514 514 if (WARN_ON(key->link_id >= 0 && sdata->vif.active_links && 515 515 !(sdata->vif.active_links & BIT(key->link_id)))) 516 516 return -ENOLINK; 517 + 518 + if (fips_enabled) 519 + return -EOPNOTSUPP; 517 520 518 521 trace_drv_set_key(local, cmd, sdata, sta, key); 519 522 ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
+4
net/mac80211/driver-ops.h
··· 8 8 #ifndef __MAC80211_DRIVER_OPS 9 9 #define __MAC80211_DRIVER_OPS 10 10 11 + #include <linux/fips.h> 11 12 #include <net/mac80211.h> 12 13 #include "ieee80211_i.h" 13 14 #include "trace.h" ··· 901 900 lockdep_assert_wiphy(local->hw.wiphy); 902 901 903 902 if (!check_sdata_in_driver(sdata)) 903 + return; 904 + 905 + if (fips_enabled) 904 906 return; 905 907 906 908 trace_drv_set_rekey_data(local, sdata, data);
+39 -1
net/mac80211/ht.c
··· 9 9 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 10 10 * Copyright 2007-2010, Intel Corporation 11 11 * Copyright 2017 Intel Deutschland GmbH 12 - * Copyright(c) 2020-2024 Intel Corporation 12 + * Copyright(c) 2020-2025 Intel Corporation 13 13 */ 14 14 15 15 #include <linux/ieee80211.h> ··· 603 603 } 604 604 /* this might change ... don't want non-open drivers using it */ 605 605 EXPORT_SYMBOL_GPL(ieee80211_request_smps); 606 + 607 + void ieee80211_ht_handle_chanwidth_notif(struct ieee80211_local *local, 608 + struct ieee80211_sub_if_data *sdata, 609 + struct sta_info *sta, 610 + struct link_sta_info *link_sta, 611 + u8 chanwidth, enum nl80211_band band) 612 + { 613 + enum ieee80211_sta_rx_bandwidth max_bw, new_bw; 614 + struct ieee80211_supported_band *sband; 615 + struct sta_opmode_info sta_opmode = {}; 616 + 617 + lockdep_assert_wiphy(local->hw.wiphy); 618 + 619 + if (chanwidth == IEEE80211_HT_CHANWIDTH_20MHZ) 620 + max_bw = IEEE80211_STA_RX_BW_20; 621 + else 622 + max_bw = ieee80211_sta_cap_rx_bw(link_sta); 623 + 624 + /* set cur_max_bandwidth and recalc sta bw */ 625 + link_sta->cur_max_bandwidth = max_bw; 626 + new_bw = ieee80211_sta_cur_vht_bw(link_sta); 627 + 628 + if (link_sta->pub->bandwidth == new_bw) 629 + return; 630 + 631 + link_sta->pub->bandwidth = new_bw; 632 + sband = local->hw.wiphy->bands[band]; 633 + sta_opmode.bw = 634 + ieee80211_sta_rx_bw_to_chan_width(link_sta); 635 + sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED; 636 + 637 + rate_control_rate_update(local, sband, link_sta, 638 + IEEE80211_RC_BW_CHANGED); 639 + cfg80211_sta_opmode_change_notify(sdata->dev, 640 + sta->addr, 641 + &sta_opmode, 642 + GFP_KERNEL); 643 + }
+22 -3
net/mac80211/ieee80211_i.h
··· 1226 1226 if ((_link = wiphy_dereference((_local)->hw.wiphy, \ 1227 1227 ___sdata->link[___link_id]))) 1228 1228 1229 + /* 1230 + * for_each_sdata_link_rcu() must be used under RCU read lock. 1231 + */ 1232 + #define for_each_sdata_link_rcu(_local, _link) \ 1233 + /* outer loop just to define the variables ... */ \ 1234 + for (struct ieee80211_sub_if_data *___sdata = NULL; \ 1235 + !___sdata; \ 1236 + ___sdata = (void *)~0 /* always stop */) \ 1237 + list_for_each_entry_rcu(___sdata, &(_local)->interfaces, list) \ 1238 + if (ieee80211_sdata_running(___sdata)) \ 1239 + for (int ___link_id = 0; \ 1240 + ___link_id < ARRAY_SIZE((___sdata)->link); \ 1241 + ___link_id++) \ 1242 + if ((_link = rcu_dereference((___sdata)->link[___link_id]))) 1243 + 1229 1244 #define for_each_link_data(sdata, __link) \ 1230 1245 struct ieee80211_sub_if_data *__sdata = sdata; \ 1231 1246 for (int __link_id = 0; \ ··· 1417 1402 bool probe_req_reg; 1418 1403 bool rx_mcast_action_reg; 1419 1404 unsigned int filter_flags; /* FIF_* */ 1420 - 1421 - bool wiphy_ciphers_allocated; 1422 1405 1423 1406 struct cfg80211_chan_def dflt_chandef; 1424 1407 bool emulate_chanctx; ··· 2219 2206 enum nl80211_smps_mode 2220 2207 ieee80211_smps_mode_to_smps_mode(enum ieee80211_smps_mode smps); 2221 2208 2209 + void ieee80211_ht_handle_chanwidth_notif(struct ieee80211_local *local, 2210 + struct ieee80211_sub_if_data *sdata, 2211 + struct sta_info *sta, 2212 + struct link_sta_info *link_sta, 2213 + u8 chanwidth, enum nl80211_band band); 2214 + 2222 2215 /* VHT */ 2223 2216 void 2224 2217 ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, ··· 2716 2697 bool radar_required); 2717 2698 int __must_check 2718 2699 ieee80211_link_use_reserved_context(struct ieee80211_link_data *link); 2719 - int ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link); 2700 + void ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link); 2720 2701 2721 2702 int __must_check 2722 2703 ieee80211_link_change_chanreq(struct ieee80211_link_data *link,
+29
net/mac80211/iface.c
··· 1557 1557 } 1558 1558 } 1559 1559 } else if (ieee80211_is_action(mgmt->frame_control) && 1560 + mgmt->u.action.category == WLAN_CATEGORY_HT) { 1561 + switch (mgmt->u.action.u.ht_smps.action) { 1562 + case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: { 1563 + u8 chanwidth = mgmt->u.action.u.ht_notify_cw.chanwidth; 1564 + struct ieee80211_rx_status *status; 1565 + struct link_sta_info *link_sta; 1566 + struct sta_info *sta; 1567 + 1568 + sta = sta_info_get_bss(sdata, mgmt->sa); 1569 + if (!sta) 1570 + break; 1571 + 1572 + status = IEEE80211_SKB_RXCB(skb); 1573 + if (!status->link_valid) 1574 + link_sta = &sta->deflink; 1575 + else 1576 + link_sta = rcu_dereference_protected(sta->link[status->link_id], 1577 + lockdep_is_held(&local->hw.wiphy->mtx)); 1578 + if (link_sta) 1579 + ieee80211_ht_handle_chanwidth_notif(local, sdata, sta, 1580 + link_sta, chanwidth, 1581 + status->band); 1582 + break; 1583 + } 1584 + default: 1585 + WARN_ON(1); 1586 + break; 1587 + } 1588 + } else if (ieee80211_is_action(mgmt->frame_control) && 1560 1589 mgmt->u.action.category == WLAN_CATEGORY_VHT) { 1561 1590 switch (mgmt->u.action.u.vht_group_notif.action_code) { 1562 1591 case WLAN_VHT_ACTION_OPMODE_NOTIF: {
+2 -1
net/mac80211/key.c
··· 510 510 } else { 511 511 if (!new->local->wowlan) 512 512 ret = ieee80211_key_enable_hw_accel(new); 513 - else 513 + else if (link_id < 0 || !sdata->vif.active_links || 514 + BIT(link_id) & sdata->vif.active_links) 514 515 new->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 515 516 } 516 517
+15 -50
net/mac80211/main.c
··· 5 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 6 6 * Copyright 2013-2014 Intel Mobile Communications GmbH 7 7 * Copyright (C) 2017 Intel Deutschland GmbH 8 - * Copyright (C) 2018-2024 Intel Corporation 8 + * Copyright (C) 2018-2025 Intel Corporation 9 9 */ 10 10 11 11 #include <net/mac80211.h> ··· 1025 1025 1026 1026 static int ieee80211_init_cipher_suites(struct ieee80211_local *local) 1027 1027 { 1028 - bool have_wep = !fips_enabled; /* FIPS does not permit the use of RC4 */ 1029 1028 bool have_mfp = ieee80211_hw_check(&local->hw, MFP_CAPABLE); 1030 - int r = 0, w = 0; 1031 - u32 *suites; 1032 1029 static const u32 cipher_suites[] = { 1033 - /* keep WEP first, it may be removed below */ 1030 + /* keep WEP and TKIP first, they may be removed below */ 1034 1031 WLAN_CIPHER_SUITE_WEP40, 1035 1032 WLAN_CIPHER_SUITE_WEP104, 1036 1033 WLAN_CIPHER_SUITE_TKIP, ··· 1043 1046 WLAN_CIPHER_SUITE_BIP_GMAC_256, 1044 1047 }; 1045 1048 1046 - if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) || 1047 - local->hw.wiphy->cipher_suites) { 1048 - /* If the driver advertises, or doesn't support SW crypto, 1049 - * we only need to remove WEP if necessary. 1050 - */ 1051 - if (have_wep) 1052 - return 0; 1049 + if (ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) && fips_enabled) { 1050 + dev_err(local->hw.wiphy->dev.parent, 1051 + "Drivers with SW_CRYPTO_CONTROL cannot work with FIPS\n"); 1052 + return -EINVAL; 1053 + } 1053 1054 1054 - /* well if it has _no_ ciphers ... fine */ 1055 - if (!local->hw.wiphy->n_cipher_suites) 1056 - return 0; 1055 + if (WARN_ON(ieee80211_hw_check(&local->hw, SW_CRYPTO_CONTROL) && 1056 + !local->hw.wiphy->cipher_suites)) 1057 + return -EINVAL; 1057 1058 1058 - /* Driver provides cipher suites, but we need to exclude WEP */ 1059 - suites = kmemdup_array(local->hw.wiphy->cipher_suites, 1060 - local->hw.wiphy->n_cipher_suites, 1061 - sizeof(u32), GFP_KERNEL); 1062 - if (!suites) 1063 - return -ENOMEM; 1064 - 1065 - for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { 1066 - u32 suite = local->hw.wiphy->cipher_suites[r]; 1067 - 1068 - if (suite == WLAN_CIPHER_SUITE_WEP40 || 1069 - suite == WLAN_CIPHER_SUITE_WEP104) 1070 - continue; 1071 - suites[w++] = suite; 1072 - } 1073 - } else { 1059 + if (fips_enabled || !local->hw.wiphy->cipher_suites) { 1074 1060 /* assign the (software supported and perhaps offloaded) 1075 1061 * cipher suites 1076 1062 */ ··· 1063 1083 if (!have_mfp) 1064 1084 local->hw.wiphy->n_cipher_suites -= 4; 1065 1085 1066 - if (!have_wep) { 1067 - local->hw.wiphy->cipher_suites += 2; 1068 - local->hw.wiphy->n_cipher_suites -= 2; 1086 + /* FIPS does not permit the use of RC4 */ 1087 + if (fips_enabled) { 1088 + local->hw.wiphy->cipher_suites += 3; 1089 + local->hw.wiphy->n_cipher_suites -= 3; 1069 1090 } 1070 - 1071 - /* not dynamically allocated, so just return */ 1072 - return 0; 1073 1091 } 1074 - 1075 - local->hw.wiphy->cipher_suites = suites; 1076 - local->hw.wiphy->n_cipher_suites = w; 1077 - local->wiphy_ciphers_allocated = true; 1078 1092 1079 1093 return 0; 1080 1094 } ··· 1625 1651 ieee80211_led_exit(local); 1626 1652 destroy_workqueue(local->workqueue); 1627 1653 fail_workqueue: 1628 - if (local->wiphy_ciphers_allocated) { 1629 - kfree(local->hw.wiphy->cipher_suites); 1630 - local->wiphy_ciphers_allocated = false; 1631 - } 1632 1654 kfree(local->int_scan_req); 1633 1655 return result; 1634 1656 } ··· 1694 1724 enum nl80211_band band; 1695 1725 1696 1726 mutex_destroy(&local->iflist_mtx); 1697 - 1698 - if (local->wiphy_ciphers_allocated) { 1699 - kfree(local->hw.wiphy->cipher_suites); 1700 - local->wiphy_ciphers_allocated = false; 1701 - } 1702 1727 1703 1728 idr_for_each(&local->ack_status_frames, 1704 1729 ieee80211_free_ack_frame, NULL);
+30 -6
net/mac80211/mlme.c
··· 1214 1214 1215 1215 static int ieee80211_config_bw(struct ieee80211_link_data *link, 1216 1216 struct ieee802_11_elems *elems, 1217 - bool update, u64 *changed, 1218 - const char *frame) 1217 + bool update, u64 *changed, u16 stype) 1219 1218 { 1220 1219 struct ieee80211_channel *channel = link->conf->chanreq.oper.chan; 1221 1220 struct ieee80211_sub_if_data *sdata = link->sdata; 1222 1221 struct ieee80211_chan_req chanreq = {}; 1223 1222 struct cfg80211_chan_def ap_chandef; 1224 1223 enum ieee80211_conn_mode ap_mode; 1224 + const char *frame; 1225 1225 u32 vht_cap_info = 0; 1226 1226 u16 ht_opmode; 1227 1227 int ret; 1228 + 1229 + switch (stype) { 1230 + case IEEE80211_STYPE_BEACON: 1231 + frame = "beacon"; 1232 + break; 1233 + case IEEE80211_STYPE_ASSOC_RESP: 1234 + frame = "assoc response"; 1235 + break; 1236 + case IEEE80211_STYPE_REASSOC_RESP: 1237 + frame = "reassoc response"; 1238 + break; 1239 + case IEEE80211_STYPE_ACTION: 1240 + /* the only action frame that gets here */ 1241 + frame = "ML reconf response"; 1242 + break; 1243 + default: 1244 + return -EINVAL; 1245 + } 1228 1246 1229 1247 /* don't track any bandwidth changes in legacy/S1G modes */ 1230 1248 if (link->u.mgd.conn.mode == IEEE80211_CONN_MODE_LEGACY || ··· 1292 1274 ieee80211_min_bw_limit_from_chandef(&chanreq.oper)) 1293 1275 ieee80211_chandef_downgrade(&chanreq.oper, NULL); 1294 1276 1295 - if (ap_chandef.chan->band == NL80211_BAND_6GHZ && 1277 + /* TPE element is not present in (re)assoc/ML reconfig response */ 1278 + if (stype == IEEE80211_STYPE_BEACON && 1279 + ap_chandef.chan->band == NL80211_BAND_6GHZ && 1296 1280 link->u.mgd.conn.mode >= IEEE80211_CONN_MODE_HE) { 1297 1281 ieee80211_rearrange_tpe(&elems->tpe, &ap_chandef, 1298 1282 &chanreq.oper); ··· 2581 2561 if (!local->ops->abort_channel_switch) 2582 2562 return; 2583 2563 2584 - ieee80211_link_unreserve_chanctx(link); 2564 + if (rcu_access_pointer(link->conf->chanctx_conf)) 2565 + ieee80211_link_unreserve_chanctx(link); 2585 2566 2586 2567 ieee80211_vif_unblock_queues_csa(sdata); 2587 2568 ··· 5368 5347 /* check/update if AP changed anything in assoc response vs. scan */ 5369 5348 if (ieee80211_config_bw(link, elems, 5370 5349 link_id == assoc_data->assoc_link_id, 5371 - changed, "assoc response")) { 5350 + changed, 5351 + le16_to_cpu(mgmt->frame_control) & 5352 + IEEE80211_FCTL_STYPE)) { 5372 5353 ret = false; 5373 5354 goto out; 5374 5355 } ··· 7565 7542 7566 7543 changed |= ieee80211_recalc_twt_req(sdata, sband, link, link_sta, elems); 7567 7544 7568 - if (ieee80211_config_bw(link, elems, true, &changed, "beacon")) { 7545 + if (ieee80211_config_bw(link, elems, true, &changed, 7546 + IEEE80211_STYPE_BEACON)) { 7569 7547 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 7570 7548 WLAN_REASON_DEAUTH_LEAVING, 7571 7549 true, deauth_buf);
+14 -44
net/mac80211/rx.c
··· 3033 3033 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 3034 3034 __le16 fc = hdr->frame_control; 3035 3035 struct sk_buff_head frame_list; 3036 - ieee80211_rx_result res; 3037 3036 struct ethhdr ethhdr; 3038 3037 const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source; 3039 3038 ··· 3094 3095 while (!skb_queue_empty(&frame_list)) { 3095 3096 rx->skb = __skb_dequeue(&frame_list); 3096 3097 3097 - res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); 3098 - switch (res) { 3098 + switch (ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb)) { 3099 3099 case RX_QUEUED: 3100 - continue; 3101 - case RX_CONTINUE: 3102 3100 break; 3101 + case RX_CONTINUE: 3102 + if (ieee80211_frame_allowed(rx, fc)) { 3103 + ieee80211_deliver_skb(rx); 3104 + break; 3105 + } 3106 + fallthrough; 3103 3107 default: 3104 - goto free; 3108 + dev_kfree_skb(rx->skb); 3105 3109 } 3106 - 3107 - if (!ieee80211_frame_allowed(rx, fc)) 3108 - goto free; 3109 - 3110 - ieee80211_deliver_skb(rx); 3111 - continue; 3112 - 3113 - free: 3114 - dev_kfree_skb(rx->skb); 3115 3110 } 3116 3111 3117 3112 return RX_QUEUED; ··· 3580 3587 goto handled; 3581 3588 } 3582 3589 case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: { 3583 - struct ieee80211_supported_band *sband; 3584 3590 u8 chanwidth = mgmt->u.action.u.ht_notify_cw.chanwidth; 3585 - enum ieee80211_sta_rx_bandwidth max_bw, new_bw; 3586 - struct sta_opmode_info sta_opmode = {}; 3591 + 3592 + if (chanwidth != IEEE80211_HT_CHANWIDTH_20MHZ && 3593 + chanwidth != IEEE80211_HT_CHANWIDTH_ANY) 3594 + goto invalid; 3587 3595 3588 3596 /* If it doesn't support 40 MHz it can't change ... */ 3589 3597 if (!(rx->link_sta->pub->ht_cap.cap & 3590 - IEEE80211_HT_CAP_SUP_WIDTH_20_40)) 3598 + IEEE80211_HT_CAP_SUP_WIDTH_20_40)) 3591 3599 goto handled; 3592 3600 3593 - if (chanwidth == IEEE80211_HT_CHANWIDTH_20MHZ) 3594 - max_bw = IEEE80211_STA_RX_BW_20; 3595 - else 3596 - max_bw = ieee80211_sta_cap_rx_bw(rx->link_sta); 3597 - 3598 - /* set cur_max_bandwidth and recalc sta bw */ 3599 - rx->link_sta->cur_max_bandwidth = max_bw; 3600 - new_bw = ieee80211_sta_cur_vht_bw(rx->link_sta); 3601 - 3602 - if (rx->link_sta->pub->bandwidth == new_bw) 3603 - goto handled; 3604 - 3605 - rx->link_sta->pub->bandwidth = new_bw; 3606 - sband = rx->local->hw.wiphy->bands[status->band]; 3607 - sta_opmode.bw = 3608 - ieee80211_sta_rx_bw_to_chan_width(rx->link_sta); 3609 - sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED; 3610 - 3611 - rate_control_rate_update(local, sband, rx->link_sta, 3612 - IEEE80211_RC_BW_CHANGED); 3613 - cfg80211_sta_opmode_change_notify(sdata->dev, 3614 - rx->sta->addr, 3615 - &sta_opmode, 3616 - GFP_ATOMIC); 3617 - goto handled; 3601 + goto queue; 3618 3602 } 3619 3603 default: 3620 3604 goto invalid;
+3 -2
net/mac80211/vht.c
··· 672 672 sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED; 673 673 } 674 674 } else { 675 - pr_warn_ratelimited("Ignoring NSS change in VHT Operating Mode Notification from %pM with invalid nss %d", 676 - link_sta->pub->addr, nss); 675 + sdata_dbg(sdata, 676 + "Ignore NSS change to invalid %d in VHT opmode notif from %pM", 677 + nss, link_sta->pub->addr); 677 678 } 678 679 } 679 680
+44 -7
net/wireless/nl80211.c
··· 7451 7451 struct wireless_dev *wdev; 7452 7452 u8 mac_addr[ETH_ALEN]; 7453 7453 int sta_idx = cb->args[2]; 7454 + bool sinfo_alloc = false; 7454 7455 int err, i; 7455 7456 7456 7457 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL); ··· 7480 7479 err = -ENOMEM; 7481 7480 goto out_err; 7482 7481 } 7482 + sinfo_alloc = true; 7483 7483 } 7484 7484 7485 7485 err = rdev_dump_station(rdev, wdev->netdev, sta_idx, ··· 7492 7490 7493 7491 if (sinfo.valid_links) 7494 7492 cfg80211_sta_set_mld_sinfo(&sinfo); 7493 + 7494 + /* reset the sinfo_alloc flag as nl80211_send_station() 7495 + * always releases sinfo 7496 + */ 7497 + sinfo_alloc = false; 7495 7498 7496 7499 if (nl80211_send_station(skb, NL80211_CMD_NEW_STATION, 7497 7500 NETLINK_CB(cb->skb).portid, ··· 7512 7505 cb->args[2] = sta_idx; 7513 7506 err = skb->len; 7514 7507 out_err: 7515 - cfg80211_sinfo_release_content(&sinfo); 7508 + if (sinfo_alloc) 7509 + cfg80211_sinfo_release_content(&sinfo); 7516 7510 wiphy_unlock(&rdev->wiphy); 7517 7511 7518 7512 return err; ··· 9769 9761 { 9770 9762 unsigned int link_id; 9771 9763 bool all_ok = true; 9764 + int radio_idx; 9772 9765 9773 9766 lockdep_assert_wiphy(wdev->wiphy); 9774 9767 ··· 9779 9770 if (!cfg80211_beaconing_iface_active(wdev)) 9780 9771 return true; 9781 9772 9773 + radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy, chan); 9774 + 9782 9775 /* 9783 - * FIXME: check if we have a free HW resource/link for chan 9776 + * FIXME: check if we have a free radio/link for chan 9784 9777 * 9785 9778 * This, as well as the FIXME below, requires knowing the link 9786 9779 * capabilities of the hardware. ··· 9791 9780 /* we cannot leave radar channels */ 9792 9781 for_each_valid_link(wdev, link_id) { 9793 9782 struct cfg80211_chan_def *chandef; 9783 + int link_radio_idx; 9794 9784 9795 9785 chandef = wdev_chandef(wdev, link_id); 9796 9786 if (!chandef || !chandef->chan) 9797 9787 continue; 9798 9788 9789 + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) 9790 + continue; 9791 + 9799 9792 /* 9800 - * FIXME: don't require all_ok, but rather check only the 9801 - * correct HW resource/link onto which 'chan' falls, 9802 - * as only that link leaves the channel for doing 9803 - * the off-channel operation. 9793 + * chandef->chan is a radar channel. If the radio/link onto 9794 + * which this radar channel falls is the same radio/link onto 9795 + * which the input 'chan' falls, off-channel operation should 9796 + * not be allowed. Hence, set 'all_ok' to false. 9804 9797 */ 9805 9798 9806 - if (chandef->chan->flags & IEEE80211_CHAN_RADAR) 9799 + link_radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy, 9800 + chandef->chan); 9801 + if (link_radio_idx == radio_idx) { 9807 9802 all_ok = false; 9803 + break; 9804 + } 9808 9805 } 9809 9806 9810 9807 if (all_ok) ··· 11013 10994 11014 10995 if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX]) 11015 10996 params.block_tx = true; 10997 + 10998 + if ((wdev->iftype == NL80211_IFTYPE_AP || 10999 + wdev->iftype == NL80211_IFTYPE_P2P_GO) && 11000 + info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { 11001 + err = nl80211_parse_unsol_bcast_probe_resp( 11002 + rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], 11003 + &params.unsol_bcast_probe_resp); 11004 + if (err) 11005 + goto free; 11006 + } 11016 11007 11017 11008 params.link_id = link_id; 11018 11009 err = rdev_channel_switch(rdev, dev, &params); ··· 16824 16795 } 16825 16796 16826 16797 params.counter_offset_presp = offset; 16798 + } 16799 + 16800 + if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { 16801 + err = nl80211_parse_unsol_bcast_probe_resp( 16802 + rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], 16803 + &params.unsol_bcast_probe_resp); 16804 + if (err) 16805 + goto out; 16827 16806 } 16828 16807 16829 16808 params.link_id = nl80211_link_id(info->attrs);