Commit graph

170 commits

Author SHA1 Message Date
Linus Torvalds
cd2e103d57 hardening fixes for v6.16-rc1 (take 2)
- randstruct: gcc-plugin: Fix attribute addition with GCC 15
 
 - ubsan: integer-overflow: depend on BROKEN to keep this out of CI
 
 - overflow: Introduce __DEFINE_FLEX for having no initializer
 
 - wifi: iwlwifi: mld: Work around Clang loop unrolling bug
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRSPkdeREjth1dHnSE2KwveOeQkuwUCaDx5RgAKCRA2KwveOeQk
 u4KjAP9tpSeAc2cKb2ZeuVV2dVSf689jR/fxPbgyy2yWIJrPogD/bsFs+LTCXnwB
 /Rk838ZZJEB0eXKoKk/LKmaN2UMSMgQ=
 =6m7/
 -----END PGP SIGNATURE-----

Merge tag 'hardening-v6.16-rc1-fix1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull hardening fixes from Kees Cook:

 - randstruct: gcc-plugin: Fix attribute addition with GCC 15

 - ubsan: integer-overflow: depend on BROKEN to keep this out of CI

 - overflow: Introduce __DEFINE_FLEX for having no initializer

 - wifi: iwlwifi: mld: Work around Clang loop unrolling bug

[ Take two after a jump scare due to some repo rewriting by 'b4' - Linus ]

* tag 'hardening-v6.16-rc1-fix1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  randstruct: gcc-plugin: Fix attribute addition
  overflow: Introduce __DEFINE_FLEX for having no initializer
  ubsan: integer-overflow: depend on BROKEN to keep this out of CI
  wifi: iwlwifi: mld: Work around Clang loop unrolling bug
2025-06-01 11:37:01 -07:00
Kees Cook
368556dd23 wifi: iwlwifi: mld: Work around Clang loop unrolling bug
The nested loop in iwl_mld_send_proto_offload() confuses Clang into
thinking there could be a final loop iteration past the end of the
"nsc" array (which is only 4 entries). The FORTIFY checking in memcmp()
(via ipv6_addr_cmp()) notices this (due to the available bytes in the
out-of-bounds position of &nsc[4] being 0), and errors out, failing
the build. For some reason (likely due to architectural loop unrolling
configurations), this is only exposed on ARM builds currently. Due to
Clang's lack of inline tracking[1], the warning is not very helpful:

include/linux/fortify-string.h:719:4: error: call to '__read_overflow' declared with 'error' attribute: detected read beyond size of object (1st parameter)
  719 |                         __read_overflow();
      |                         ^
1 error generated.

But this was tracked down to iwl_mld_send_proto_offload()'s
ipv6_addr_cmp() call.

An upstream Clang bug has been filed[2] to track this. For now fix the
build by explicitly bounding the inner loop by "n_nsc", which is what
"c" is already limited to.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2076
Link: https://github.com/llvm/llvm-project/pull/73552 [1]
Link: https://github.com/llvm/llvm-project/issues/136603 [2]
Link: https://lore.kernel.org/r/20250421204153.work.935-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
2025-05-27 12:26:00 -07:00
Johannes Berg
06c4b20368 iwlwifi features, notably a rework of the transport configuration
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQM3A3Pv7vbm9vtjWbacY7uyt+OfQUCaCWcpwAKCRDacY7uyt+O
 fQC8AP9PG7xm0iI+yTCcfXlp+/tmLf32Zam61kmy7vun7tTtUQEAiaymIDNsyEK5
 gDxzyT2xiZx/Q40gF9587Y2BLYHAugo=
 =XsKe
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-2025-05-15' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Miri Korenblit says:
====================
iwlwifi features, notably a rework of the transport configuration
====================

Link: https://patch.msgid.link/MW5PR11MB5810DD2655DE461E98A618DDA390A@MW5PR11MB5810.namprd11.prod.outlook.com/
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2025-05-15 14:09:59 +02:00
Miri Korenblit
379f7682d0 wifi: iwlwifi: mld: allow 2 ROCs on the same vif
In the current code, if an ROC is started on a vif that already has an
active ROC we reject it and warn.

But really there is no such limitation. The actual limitation is to not
have 2 ROCs of the same type simultaneously.

Add a helper function to find a vif that has an active ROC of a given
type, and only if one exist - reject the ROC.

This allows also to remove bss_roc_vif.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.1f8c55198578.I17cb191596ed4e97a4854108f8ca5ca197662a62@changeid
2025-05-15 09:53:37 +03:00
Miri Korenblit
1c97c73cda wifi: iwlwifi: use normal versioning convention for iwl_tx_cmd
We have iwl_tx_cmd for devices older than 22000, iwl_tx_cmd_gen2 for
22000 devices, and iwl_tx_cmd_gen3 ax210 and up.

But the convention for all other APIs is to have the latest version
without any prefix and the older ones - with a _vX prefix,
where X is the highest version that this struct support.

The  term 'gen' was introduced as the name of the (back then) new
transport, and should not be used as a device name (for that we have the
actual names: 22000, ax210, etc.)

Now as a new transport, called 'gen3', is going to be written and it can
be confused with this API.

Move iwl_tx_cmd to use the regular versioning convention.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.806e40c8f767.Ibc0e95e43a6fa6d47f72823bf804314d5db84618@changeid
2025-05-15 09:53:37 +03:00
Somashekhar Puttagangaiah
6ed7430bdd wifi: iwlwifi: mld: add debug log instead of warning
During link selection if the links does not meet the valid grade
criteria then add debug log instead of warning.

Signed-off-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.2593268ca988.I9786126cd1078caec8587b166a7f8735300c951d@changeid
2025-05-12 17:15:35 +03:00
Johannes Berg
a10bcb99e5 wifi: iwlwifi: mvm/mld: allow puncturing use in 5 GHz
It was decided this was supported after all, so remove
the restriction.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-15-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:43:18 +03:00
Pagadala Yesu Anjaneyulu
305e4e6b86 wifi: iwlwifi: mld: add support for ROC on BSS
add support for remain on channel on BSS vif for iwlmld.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-14-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:43:12 +03:00
Pagadala Yesu Anjaneyulu
2903fe335e wifi: iwlwifi: mld: Block EMLSR only when ready to enter ROC
If one of the stages in starting a ROC failed,
the ROC will not start nor end so EMLSR will stay blocked forever.

Block EMLSR once all ROC conditions are validated and
clear EMLSR blocked reasons in mld_vif cleanup.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-13-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:43:04 +03:00
Pagadala Yesu Anjaneyulu
35a29b14c8 wifi: iwlwifi: mld: move aux_sta member from iwl_mld_link to iwl_mld_vif
This change reflects the correct ownership of aux_sta,
as it is not a property of the link but rather of the virtual interface.
Updated the initialization, cleanup and access logic for the aux_sta member
to align with its new location within iwl_mld_vif.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:42:59 +03:00
Pagadala Yesu Anjaneyulu
db8c12f7c3 wifi: iwlwifi: mld: Fix ROC activity cleanup in iwl_mld_vif
The roc_activity member in the iwl_mld_vif structure was previously
set to zero during cleanup as was present in struct_group, which
incorrectly indicated ROC_ACTIVITY_HOTSPOT.
To fix this issue, remove roc_activity member from struct_group.
Notify mac80211 of ROC expiration during vif cleanup to maintain
synchronization between the driver and mac80211.
While on it, update it's type to enum iwl_roc_activity.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:42:55 +03:00
Pagadala Yesu Anjaneyulu
6f47182ccd wifi: iwlwifi: mld: Correct comments for cleanup functions
Update comments to accurately reflect the purpose of the
iwl_mld_cleanup_link and iwl_cleanup_mld functions.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-10-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:42:49 +03:00
Johannes Berg
589ceda64c wifi: iwlwifi: rename iwl_cfg to iwl_rf_cfg
With all the cleanups now, we can rename the structure to
better indicate the functionality. For older devices this
isn't quite accurate, of course, but it's better to have a
name that reflects future use for maintenance.

Add some kernel-doc while at it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-9-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-10 21:42:44 +03:00
Johannes Berg
857ecb8524 wifi: iwlwifi: cfg: move MAC parameters to MAC data
There are a number of MAC parameters that are in the iwl_cfg
(which is the last config matched to the MAC/RF combination).
This isn't necessary, there are many more of those than MACs,
so move (most of) the data into the MAC family config struct.

Note that DCCM information remains for use by older devices,
and on 9000 series it'll be in struct iwl_cfg but be ignored
when the CRF is in a Qu/So platform.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-15-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:38:47 +03:00
Johannes Berg
264e744fec wifi: iwlwifi: rename struct iwl_base_params
These are (going to be) base MAC parameters that are identical
even for different platforms with the same MAC, so rename the
structure accordingly, calling it iwl_family_base_params.

Also rename the pointer to it so the dereferencing is a bit
shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:38:35 +03:00
Johannes Berg
c96a364910 wifi: iwlwifi: rename cfg_trans_params to mac_cfg
Since 9000 series devices, the devices are split into MAC and
CRF parts. Currently, "struct iwl_cfg" reflects some MAC and
some RF parameters, but we want to clean this up and move the
MAC data to what's now "struct iwl_cfg_trans_params". As the
first step, to reflect the intent, rename this structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-9-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:37:54 +03:00
Johannes Berg
8b24b32ee6 wifi: iwlwifi: pass trans to iwl_parse_nvm_mcc_info()
There's no need to pass various different pointers when
the transport is already established, so just pass that
instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:37:49 +03:00
Johannes Berg
81ca8c5fae wifi: iwlwifi: cfg: inline HT params
With just a handful of values in two bytes, the params are
smaller than the pointer to them. Inline them and save some
space.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-14-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:37:06 +03:00
Benjamin Berg
83128399f3 wifi: iwlwifi: mld: call thermal exit without wiphy lock held
The driver must not hold the wiphy mutex when unregistering the thermal
devices. Do not hold the lock for the call to iwl_mld_thermal_exit and
only do a lock/unlock to cancel the ct_kill_exit_wk work.

The problem is that iwl_mld_tzone_get_temp needs to take the wiphy lock
while the thermal code is holding its own locks already. When
unregistering the device, the reverse would happen as the driver was
calling thermal_cooling_device_unregister with the wiphy mutex already
held.

It is not likely to trigger this deadlock as it can only happen if the
thermal code is polling the temperature while the driver is being
unloaded. However, lockdep reported it so fix it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:52 +03:00
Miri Korenblit
1437d6c4f2 wifi: iwlwifi: mld: avoid init-after-queue
rx_omi::finished_work is initialized when the containing link is.
If the worker was queued and then an error happened, we will get to
iwl_mld_init_link from the reconfig and initialize the work after it was
queued.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:44 +03:00
Benjamin Berg
2d81aefc59 wifi: iwlwifi: mld: use a radio/system specific power budget
Different hardware has a different maximum power consumption and the
BIOS can also define a power limit for the device. Add code to select
an appropriate maximum power budget for the device and configure that
instead of using a hardcoded table.

This removes the old table. It does not work with the variable upper
limit and the there should be no consumer that requires these exact step
values.

This considerably increases the power budget for some devices and can
prevent throttling in high traffic situations.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-10-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:40 +03:00
Benjamin Berg
09019058f6 wifi: iwlwifi: fix thermal code compilation with -Werror=cast-qual
The compare_temps function in both mvm and mld dropped the const
qualifier in a cast in a way that makes -Werror=cast-qual unhappy. Add
the const to the cast to fix this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:30 +03:00
Yedidya Benshimol
df6146a029 wifi: iwlwifi: Add a new version for mac config command
Add a new version of mac configuration command
which includes UHR support indication.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:10 +03:00
Yedidya Benshimol
a1346ceab5 wifi: iwlwifi: Add a new version for sta config command
Add a new version of sta configuration command
which includes these wifi8 features:

1. LDPC X2 CW size support indication
2. Indication if ICF frame is needed instead of RTS
3. support for MIC padding delays for protected control frames

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-4-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:36:06 +03:00
Miri Korenblit
2d4f827901 wifi: iwlwifi: mld: remove one more error in unallocated BAID
Since the FW is the one to assign an ID to a BA, it can happen that
the FW sends a bar_frame_release_notif before the driver had the chance to
allocate the BAID.

Convert the IWL_FW_CHECK into a regular debug print.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-09 15:35:46 +03:00
Johannes Berg
dabc88cb3b wifi: iwlwifi: handle v3 rates
For UHR, a version 3 of the rate API is being added, which
increases the number of bits used for MCSes by shifting the
NSS bit up. Handle that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250505215513.84cde65a603f.Ic3119ef77cbc6461abd2a6bda104c0d236adcc8d@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-07 06:08:02 +03:00
Pagadala Yesu Anjaneyulu
871197bf7b wifi: iwlwifi: mld: add RFI_CONFIG_CMD to iwl_mld_system_names array
Add RFI_CONFIG_CMD into the names array to facilitate the
display of this command name when sending it to the firmware.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250505215513.da89484cb838.I755709232f5e441ca159bdc5a151bac73d9744d3@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-07 06:08:02 +03:00
Johannes Berg
beda255463 wifi: iwlwifi: make iwl_uefi_get_uats_table() return void
This sets both fwrt->uats_valid and returns 0, but in the
static inline it returns 0 without setting uats_valid,
which is confusing and the iwlmvm code misbehaves in this
case.

Since it already sets uats_valid, just remove the extra
return value.

Reported-by: Bjoern A. Zeeb <bz@FreeBSD.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250505215513.e981a7911228.Ic94b5e03e2053a08b84cabeb58ce3b6598fd9fc6@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-07 06:08:02 +03:00
Avraham Stern
f1699ad585 wifi: iwlwifi: mld: add debugfs for using ptp clock time for monitor interface
Add a debugfs option to use the ptp clock time for Rx device
timestamps on a monitor interface. This can be useful for e.g.
synchronizing multiple NICs or reporting the timestamp in the
system clock instead of the GP2.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20250505215513.fffe6718fbca.I75f034005851a2d0c8ba5b015b9fdcad8a7c550d@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-07 06:08:01 +03:00
Miri Korenblit
befaea3040 wifi: iwlwifi: mld: don't check the TPT counters when scanning
If there is an ongoing scan that lasts long, the MPDU counters may not
increase enough due the device being busy with scanning and not
because we are in a low throughput scenario.

In that case we don't want to block EMLSR.
Instead, stop checking the counters from the moment we started
scanning, and when the scan ends - clear the counters and schedule a
check in 5 seconds, as usual.

Note that this is only done for regular scan since MLO scan is too short
to affect the counters, and scheduled scan is mainly used when we are
not connected.

Also note that we only stop checking whether to block EMLSR, and not if to
unblock.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250505215512.330ea440d19c.Ib10dae0b7a0cb0e10c59a9edf5ff7af0f065ac60@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2025-05-07 06:08:01 +03:00
Johannes Berg
7217522af7 wifi: iwlwifi: mld: don't report bad EHT rate to mac80211
In EHT, we shouldn't report a legacy rate to mac80211, that
might just be confusing. Set it to zero, since it's only
really relevant for radiotap.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.8baf4efec182.Idc0cabf1919c05b35dc2341c08ea88a7157614c4@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
e74e6c0495 wifi: iwlwifi: mld: build HT/VHT injected rate in v2
Instead of building the injected rate in version 1 of the
format and then converting, build it in version 2 directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.0e6e4ae4469f.Ib49eda9a3083b2e0f0bcaff08ad784e151978307@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
3c204b693d wifi: iwlwifi: rename modulation type values
The modulation type values aren't masks, they're just values.
Rename them from RATE_MCS_CCK_* to RATE_MCS_MOD_TYPE_*.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.aa79635dd4e6.Ie97a01fee1ef4aedf8a2e5447489793ce8c15ca0@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
3a68ae0fa2 wifi: iwlwifi: remove sku_id from trans
This is ephemeral data that's passed from the alive
response to the PNVM loading, so it doesn't need to
be stored. Pass it around instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.fe8be4454007.I24824f35620b21fe49e9243818c7188e431af48e@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
cf9aabf44b wifi: iwlwifi: trans: move ext_32khz_clock_valid to config
This value is used for the device start, so it's really
part of the configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.637ed7514587.I6c8fdeb3e2078a5fe9b755391e3ef7258ef2b279@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
b8311ad5d4 wifi: iwlwifi: move STEP config into trans->conf
This really belongs there, it's needed early, so move it. Remove
the related but dead iwl_trans_pcie_ctx_info_gen3_set_step() while
at it. In iwlmld move the calls since they do part of the trans
configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.a4681ee11dd7.I6434a13d51932e984bb07695bc1cb931ebdcd27c@changeid
2025-05-07 06:08:01 +03:00
Johannes Berg
08e77d5edf wifi: iwlwifi: rework transport configuration
Instead of having a trans_configure method that copies all
the data, just have the users set up the configuration in
the transport directly. This simplifies the code on both
sides. While doing so also move some value from the trans
struct into the conf struct because they are configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.e2a2535ecfd0.I21653103ff02afc5a4d97a41b68021f053985e37@changeid
2025-05-07 06:08:00 +03:00
Johannes Berg
d586137848 wifi: iwlwifi: trans: collect device information
Add a new device information 'info' substruct to the transport
that's const and can only be set by a special helper, and move
some information there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224232.cd80cb55403c.Ic18524b66d655fad734bf97192a54d9cfa9fdf1f@changeid
2025-05-07 06:08:00 +03:00
Johannes Berg
d43c01d303 wifi: iwlwifi: trans: remove SCD base address validation
We pass this parameter around a lot of places just to
validate what the firmware told us against the hardware
with a warning, which seems to never trigger. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224232.5405014d7f88.I3b74a1fd51a39c6df5674f2994189092d1635e7f@changeid
2025-05-07 06:08:00 +03:00
Johannes Berg
a94d018996 wifi: iwlwifi: pass full FW info to transport
The code currently passes only the specific image that should
be loaded, but then has to pass the IML (image loader) out of
band, which is confusing. Pass the full FW data together with
desired image type, and use the IML from that.

This also cleans up the code in the various sub-drivers a bit
as they no longer have to look up and check for the image.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224231.eac4006e81c5.Iebadc56bb2762e5f4d71f66bb2609d74b33daf11@changeid
2025-05-07 06:08:00 +03:00
Somashekhar Puttagangaiah
9babfb5f1f wifi: iwlwifi: handle reasons recommended by FW for leaving EMLSR
FW sends new notification version 2 indicating whether activating EMLSR
mode is recommended or not. If recommendation is to leave EMLSR or force
leave then FW sends the reason. Add debug log for the reason sent by FW.

Signed-off-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224231.0582726248a4.I9d1d00eb98d10a3a742cb3e06665ce10e5ec93f0@changeid
2025-05-07 06:08:00 +03:00
Johannes Berg
7aeec8c8d6 wifi: iwlwifi: remove PM mode and send-in-D3
Simplify the logic here by tracking only suspended as a
status bit, and remove CMD_SEND_IN_D3 completely. There
is no value, since the op-mode sets the state and also
sends the commands.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224231.cc3360761f1e.I72261afc42cee8983198b4660b7d38b7df7963da@changeid
2025-05-07 06:08:00 +03:00
Jakub Kicinski
9daaf19786 wireless features, notably
* stack
    - free SKBTX_WIFI_STATUS flag
    - fixes for VLAN multicast in multi-link
    - improve codel parameters (revert some old twiddling)
  * ath12k
    - Enable AHB support for IPQ5332.
    - Add monitor interface support to QCN9274.
    - Add MLO support to WCN7850.
    - Add 802.11d scan offload support to WCN7850.
  * ath11k
    - Restore hibernation support
  * iwlwifi
    - EMLSR on two 5 GHz links
  * mwifiex
    - cleanups/refactoring
 
 along with many other small features/cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEpeA8sTs3M8SN2hR410qiO8sPaAAFAmgaSmcACgkQ10qiO8sP
 aAA4hA//f/nfeLTAnhON53mDlqxa55/2bw9XSH7pOIOasVBWxmuYxhWfn5uiZluI
 zOGlBO7vtJYvPrVHEHSuPWMNCQ+ieL2ShRSP5BBfy3KBYdD4gKKAd95WoiXmRVp4
 d13OYtF9msFbVXOZYMyxMHmzIrWlBQIokjOSjqjSBeYRnD8U0GRemiSecugWo/qI
 bE7xcZuTgKBy+gr7242017DcUjWBdWcsp1C6C+COZm/KrSihQ0SQ4PIcOZgPsZjl
 COGextZltbWW56qnlp6QC394V+Vhah+Owcz3Qqz9zZ7hzJnuPo+DnpPMShhRGruL
 /IgqKhzcuye5UUJJl8nD768x6ebClchkcBC+A/hfjk5UYVl/oZxA1Bw5fC2O+5VU
 ycDMHr1Qu/yEE2rbwIJPGNOZ7NisqJFF07CPFuygKjBGNnp7I5S7H6UJsKRi5MuZ
 0CXHiFMhuHgWLmDFauIa66XI1JpqIzQgbZSjqVYFKRqwEz3yRKwihwDzZy1m6pDQ
 NhMFedQznFkMSJ+m020IOxxXYPy98PHcus+TZWL4os0SJTfEycEUWJZnlJ47Bb25
 Z9IF1OER2I4giMKxUVKRoDq0SGStbZODwqxrVCRD261Um9ybbfDdRbDeDOmvY+Gu
 jEmE6tscWbRfDvCS2M+xIg+MAcVHJq5gO4S8RopMSJlFHY/T/uE=
 =s9mS
 -----END PGP SIGNATURE-----

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

Johannes Berg says:

====================
wireless features, notably

 * stack
   - free SKBTX_WIFI_STATUS flag
   - fixes for VLAN multicast in multi-link
   - improve codel parameters (revert some old twiddling)
 * ath12k
   - Enable AHB support for IPQ5332.
   - Add monitor interface support to QCN9274.
   - Add MLO support to WCN7850.
   - Add 802.11d scan offload support to WCN7850.
 * ath11k
   - Restore hibernation support
 * iwlwifi
   - EMLSR on two 5 GHz links
 * mwifiex
   - cleanups/refactoring

along with many other small features/cleanups

* tag 'wireless-next-2025-05-06' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (177 commits)
  Revert "wifi: iwlwifi: clean up config macro"
  wifi: iwlwifi: move phy_filters to fw_runtime
  wifi: iwlwifi: pcie: make sure to lock rxq->read
  wifi: iwlwifi: add definitions for iwl_mac_power_cmd version 2
  wifi: iwlwifi: clean up config macro
  wifi: iwlwifi: mld: simplify iwl_mld_rx_fill_status()
  wifi: iwlwifi: mld: rx: simplify channel handling
  wifi: iwlwifi: clean up band in RX metadata
  wifi: iwlwifi: mld: skip unknown FW channel load values
  wifi: iwlwifi: define API for external FSEQ images
  wifi: iwlwifi: mld: allow EMLSR on separated 5 GHz subbands
  wifi: iwlwifi: mld: use cfg80211_chandef_get_width()
  wifi: iwlwifi: mld: fix iwl_mld_emlsr_disallowed_with_link() return
  wifi: iwlwifi: mld: clarify variable type
  wifi: iwlwifi: pcie: add support for the reset handshake in MSI
  wifi: mac80211_hwsim: Prevent tsf from setting if beacon is disabled
  wifi: mac80211: restructure tx profile retrieval for MLO MBSSID
  wifi: nl80211: add link id of transmitted profile for MLO MBSSID
  wifi: ieee80211: Add helpers to fetch EMLSR delay and timeout values
  wifi: mac80211: update ML STA with EML capabilities
  ...

====================

Link: https://patch.msgid.link/20250506174656.119970-3-johannes@sipsolutions.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-05-06 19:04:42 -07:00
Johannes Berg
21dccdfaf6 wifi: iwlwifi: mld: set rx_mpdu_cmd_hdr_size
Set rx_mpdu_cmd_hdr_size so that tracing will correctly include
the frame header.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.caf1d8e2bae3.I82d89bc8d128f78159a8a11b1573574dacdeb99e@changeid
2025-05-06 22:22:11 +03:00
Avraham Stern
ac5215a7d1 wifi: iwlwifi: mld: force the responder to use the full bandwidth
When a soft AP is started, it may not use the full configured
bandwidth (e.g. if no station is connected). As a result, the
responder will not support the configured bandwidth. Since the
responder supports ranging with unassociated stations, there is
no indication to the driver when the full bandwidth should be enabled.
Fix it by configuring the AP to always use the full bandwidth when a
responder is supported.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.620fe8099fff.Id50675f4d4c524b0a7ee602c48af538a327010e0@changeid
2025-05-06 22:22:11 +03:00
Avraham Stern
94f086a4db wifi: iwlwifi: mld: start AP with the correct bandwidth
When a channel context is added, it is still not assigned to the link
and the link is not yet active. As a result, the channel context
min_def is used when the AP is started, even when the full bandwidth
should be used.
Fix it by updating the PHY channel context when the link is already
active so the full bandwidth is used when needed.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.30b043b10fb1.I62c2aa58687e4796b759fa68132122119a337b49@changeid
2025-05-06 22:22:11 +03:00
Daniel Gabay
a4911d0178 wifi: iwlwifi: mld: add monitor internal station
This is needed for TX injection over monitor interface.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.5ec460d3f1c2.Ic8456efb4cdd722dcd9c4910a1569ef9d3e4e066@changeid
2025-05-06 22:22:11 +03:00
Emmanuel Grumbach
64667ab856 wifi: iwlwifi: mld: support for COMPRESSED_BA_RES_API_S_VER_7
The rate format changed but since we don't use the rate, just claim
support for this new API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.c4be90e242ff.Ie8a0f0d6320613bd8c5cb6c82a063069fffa3b67@changeid
2025-05-06 22:22:11 +03:00
Johannes Berg
abbcea13bc wifi: iwlwifi: mld: handle SW reset w/o NIC error
For the upcoming TOP reset, the sw_reset() method may be
called without nic_error() before it. In this case, also
abort any still pending scans and set in_hw_restart.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250430155443.b732ff4e9f31.I3948c2d892f1ee82b3a6bf9f123be02a1eaa82e5@changeid
2025-05-06 20:23:38 +03:00
Miri Korenblit
bd795a65c2 wifi: iwlwifi: mld: support iwl_mac_power_cmd version 2
This version fixes the issue that was worked around by
iwl_mld_smps_wa. So for FWs with the new version don't do the
workaround, and set new bit added in this version when appropriate.
While at it, rename iwl_mld_smps_wa to iwl_mld_smps_workaround.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250430155443.77fdb18d1ee0.I93688612ac4f6ec99da9bc54bee16554ef40a40b@changeid
2025-05-06 20:23:31 +03:00