Commit Graph

363 Commits

Author SHA1 Message Date
Jose Ignacio Tornos Martinez 6d9fee5c3c wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit cac9544cecf6d0aa1ad629ba8f403b05b8bee005
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 19:17:03 2024 +0300

    wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP
    
    Replace the ifdef CONFIG_PM by CONFIG_PM_SLEEP. CONFIG_PM was useful
    when we had CONFIG_PM_RUNTIME but that was removed long ago.
    Use PM_SLEEP consistently across the driver.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825191257.44e47ba584de.I64f985d0405345252b76b7157291b79677abd64d@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:58:09 +01:00
Jose Ignacio Tornos Martinez 52fbc5dfdb wifi: iwlwifi: mvm: remove mvm prefix from iwl_mvm_tx_resp*
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 5b0c478378e5c82c4c372cf194a2438f8743abcf
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun Sep 1 07:17:55 2024 +0300

    wifi: iwlwifi: mvm: remove mvm prefix from iwl_mvm_tx_resp*
    
    These are not mvm specific
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Link: https://patch.msgid.link/20240901071542.22e28b56da2c.Ib859a05ed133fa5a1426c5feffa8999a18bba6f2@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:58:04 +01:00
Jose Ignacio Tornos Martinez da7b564c0d wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAX
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit b61ed2b80911f981fa500252012330c54b9af5a0
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun Sep 1 07:17:52 2024 +0300

    wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAX
    
    This isn't mvm specific.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Link: https://patch.msgid.link/20240901071542.5d71a0a2b56c.I7e0fe636d914852963e7a2f5e6037d0c3e367145@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:58:04 +01:00
Jose Ignacio Tornos Martinez 3d99756637 wifi: iwlwifi: use default command queue watchdog timeout
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 7921c411490ca8b091068a41de873d79d065aab1
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Aug 8 23:22:45 2024 +0300

    wifi: iwlwifi: use default command queue watchdog timeout
    
    We used to have the opmode configuring it to the trans according to the
    debug tlv value (FW_DBG_TRIGGER_TXQ_TIMERS).
    But this debug is not used, so trans can just have the default value
    hardcoded.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240808232017.87af3f063025.I2222981ead13f6a917f2d4b116c5b94200dc9e51@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:58:00 +01:00
Jose Ignacio Tornos Martinez 46e635d99a wifi: iwlwifi: mvm: handle the new EML OMN failure notification
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit a08cf01905dfd7884d41db782667420500bdd90e
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 09:00:54 2024 +0300

    wifi: iwlwifi: mvm: handle the new EML OMN failure notification
    
    Take the proper action upon EML OMN frame failure.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825090005.01ff45fa69db.I9f2d3ea851050f6031ac07bbe69eb38000fd5683@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:58:00 +01:00
Jose Ignacio Tornos Martinez 799f1cde48 wifi: iwlwifi: mvm: handle the new missed beacons notification
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 313e32f60d5439a19b0684d3be1fe50c77ef382d
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Thu Aug 8 23:22:40 2024 +0300

    wifi: iwlwifi: mvm: handle the new missed beacons notification
    
    Use the same handler for both types and just convert the old version to
    the new. Drop the unused fields from the old one and fake the new
    fields.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240808232017.a64ffc998569.I7d181052b1a69c331d07263f20c1e00cbc0bc891@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:59 +01:00
Jose Ignacio Tornos Martinez 431bdb6dbc wifi: iwlwifi: mvm: rename iwl_missed_beacons_notif
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 658b8b56c1296322a9a064c8e8cb73ea8a44f635
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Thu Aug 8 23:22:38 2024 +0300

    wifi: iwlwifi: mvm: rename iwl_missed_beacons_notif
    
    A new version is coming up. Rename the current struct to include the
    current version.
    
    s/iwl_missed_beacons_notif/iwl_missed_beacons_notif_v4
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240808232017.b5c3a83a05ef.I698611582b5ca8395f42a535c51f7230307e2c6f@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:59 +01:00
Jose Ignacio Tornos Martinez e8dfce0bb3 wifi: iwlwifi: mvm: Offload RLC/SMPS functionality to firmware
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit b2a7c91bf93865a34e04707ef600c1c363d79125
Author: Daniel Gabay <daniel.gabay@intel.com>
Date:   Thu Aug 8 23:22:37 2024 +0300

    wifi: iwlwifi: mvm: Offload RLC/SMPS functionality to firmware
    
    Currently, the driver handles SMPS decisions by tracking AP
    capabilities, BT coexistence changes, sending necessary SMPS
    frames to the AP, and updating firmware with RX chain info
    using the RLC_CONFIG_CMD.
    
    Starting with version 3 of the RLC_CONFIG_CMD, the firmware
    takes over this responsibility. It now tracks SMPS, sends
    frames, and configures the RLC.
    
    In this patch:
    1. Stop sending RLC_CONFIG_CMD when firmware supports RLC
       offload (version 3), as rlc.rx_chain_info is not needed by
       firmware, and no other field in the cmd is used.
    2. Prevent the driver from forwarding any SMPS requests to
       mac80211, i.e., the driver should not transmit SMPS frames
       to the AP as firmware handles that.
    3. Set NL80211_FEATURE_DYNAMIC_SMPS and NL80211_FEATURE_STATIC_SMPS
       conditionally based on RLC version.
    
    Signed-off-by: Daniel Gabay <daniel.gabay@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/20240808232017.45da23be1f65.I0d46db82dd990a82e8a66876fe2f5310bc9513be@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:59 +01:00
Jose Ignacio Tornos Martinez e788414acd wifi: iwlwifi: Enable channel puncturing for US/CAN from bios
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit b312e357207c53270bd9b99e0bfd5dd9bf183078
Author: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
Date:   Mon Jul 29 20:20:17 2024 +0300

    wifi: iwlwifi: Enable channel puncturing for US/CAN from bios
    
    Add support for enabling channel puncturing for US/CAN based
    on BIOS configuration through UEFI
    
    Signed-off-by: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240729201718.828f3ecf5118.I5561ab8c7cd48ad4e5d6daf21b037bf88c619a4a@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:58 +01:00
Jose Ignacio Tornos Martinez 8968d75ffe wifi: iwlwifi: mvm: start to support the new BT profile notification
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit b85b397a9ece4cdde2e18424b822702220094c83
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Mon Jul 29 20:20:14 2024 +0300

    wifi: iwlwifi: mvm: start to support the new BT profile notification
    
    We have a new notification the BT profile. It contains almost nothing,
    only the wifi loss information. Copy this into mvm. We still need to
    iterate over the vifs / links to use this data.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240729201718.637499f3a85a.I8bf654cf5d8aa038100273876c936845ecc338f7@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:57 +01:00
Jose Ignacio Tornos Martinez 6c5c6b61c2 wifi: iwlwifi: mvm: s/iwl_bt_coex_profile_notif/iwl_bt_coex_prof_old_notif
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 1c9c5aebb5db162515ebb719e0f6cf1292e9c40e
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Mon Jul 29 20:20:13 2024 +0300

    wifi: iwlwifi: mvm: s/iwl_bt_coex_profile_notif/iwl_bt_coex_prof_old_notif
    
    The iwl_bt_coex_profile_notif is now being obsoleted. It'll be replaced
    by a new notification coming with a non-legacy group. Rename it to avoid
    confusion.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240729201718.dc29fd0d7817.I5881fce86ec8b76ae98d2948265434b8e7d860c1@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-11-22 10:57:57 +01:00
Jose Ignacio Tornos Martinez 9864ee60d3 wifi: iwlwifi: mvm: pause TCM when the firmware is stopped
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 0668ebc8c2282ca1e7eb96092a347baefffb5fe7
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 19:17:10 2024 +0300

    wifi: iwlwifi: mvm: pause TCM when the firmware is stopped
    
    Not doing so will make us send a host command to the transport while the
    firmware is not alive, which will trigger a WARNING.
    
    bad state = 0
    WARNING: CPU: 2 PID: 17434 at drivers/net/wireless/intel/iwlwifi/iwl-trans.c:115 iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi]
    RIP: 0010:iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi]
    Call Trace:
     <TASK>
     iwl_mvm_send_cmd+0x40/0xc0 [iwlmvm]
     iwl_mvm_config_scan+0x198/0x260 [iwlmvm]
     iwl_mvm_recalc_tcm+0x730/0x11d0 [iwlmvm]
     iwl_mvm_tcm_work+0x1d/0x30 [iwlmvm]
     process_one_work+0x29e/0x640
     worker_thread+0x2df/0x690
     ? rescuer_thread+0x540/0x540
     kthread+0x192/0x1e0
     ? set_kthread_struct+0x90/0x90
     ret_from_fork+0x22/0x30
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825191257.5abe71ca1b6b.I97a968cb8be1f24f94652d9b110ecbf6af73f89e@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:44 +01:00
Jose Ignacio Tornos Martinez 4382313a68 wifi: iwlwifi: mvm: take the mutex before running link selection
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit cd6f46c2fdb82e80ca248549c1f3ebe08b4a63ab
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 19:17:07 2024 +0300

    wifi: iwlwifi: mvm: take the mutex before running link selection
    
    iwl_mvm_select_links is called by the link selection worker and it
    requires the mutex.
    Take it in the link selection worker.
    This logic used to run from iwl_mvm_rx_umac_scan_complete_notif which
    had the mvm->mutex held. This was changed to run in a worker holding the
    wiphy mutex, but we also need the mvm->mutex.
    
    Fixes: 2e194efa3809 ("wifi: iwlwifi: mvm: Fix race in scan completion")
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Reviewed-by: Ilan Peer <ilan.peer@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825191257.0cacecd5db1e.Iaca38a078592b69bdd06549daf63408ccf1810e4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:43 +01:00
Jose Ignacio Tornos Martinez 860ce34398 wifi: iwlwifi: mvm: fix hibernation
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit cb347bd29d0d106213a0cf4f86b72dffd08d3454
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Aug 25 19:17:02 2024 +0300

    wifi: iwlwifi: mvm: fix hibernation
    
    Fast resume is a feature that was recently introduced to speed up the
    resume time. It basically keeps the firmware alive while the system
    is suspended and that avoids starting again the whole device.
    
    This flow can't work for hibernation, since when the system boots,
    before the frozen image is loaded, the kernel may touch the device. As a
    result, we can't assume the device is in the exact same state as before
    the hibernation.
    
    Detect that we are resuming from hibernation through the PCI device and
    forbid the fast resume flow. We also need to shut down the device
    cleanly when that happens.
    
    In addition, in case the device is power gated during S3, we won't be
    able to keep the device alive. Detect this situation with BE200 at least
    with the help of the CSR_FUNC_SCRATCH register and reset the device upon
    resume if it was power gated during S3.
    
    Fixes: e8bb19c1d590 ("wifi: iwlwifi: support fast resume")
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240825191257.24eb3b19e74f.I3837810318dbef0a0a773cf4c4fcf89cdc6fdbd3@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:43 +01:00
Jose Ignacio Tornos Martinez 7a5d929116 wifi: iwlwifi: mvm: remove init_dbg module parameter
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 3778a17ab054313a5513e3341eaff49aea65a88a
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Jun 25 19:51:12 2024 +0300

    wifi: iwlwifi: mvm: remove init_dbg module parameter
    
    This is no longer used
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Link: https://patch.msgid.link/20240625194805.17a1484f2485.I095c7482ac517111081f8ff40312b48ffdd7ff94@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:14 +01:00
Jose Ignacio Tornos Martinez 813b6fd2f1 wifi: iwlwifi: mvm: rename 'pldr_sync'
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 67c638675dcdad588aeb71e67dde77b48a53a320
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Jun 18 19:44:11 2024 +0300

    wifi: iwlwifi: mvm: rename 'pldr_sync'
    
    PLDR (product level device reset) is a Windows term, and
    is something the driver triggers there, AFAICT.
    
    Really what 'pldr_sync' here wants to capture is whether
    or not the firmware will/may do a product reset during
    initialization, which makes the device drop off the bus,
    requiring a rescan. If this is the case, obviously the
    init will fail/time out, so we don't want to report all
    kinds of errors etc., hence this tracking variable.
    
    Rename it to 'fw_product_reset' to capture the meaning
    better.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240618194245.ccf849642af8.I01dded6b2393771b7baf8b4b17336784d987c7c2@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:13 +01:00
Jose Ignacio Tornos Martinez 33df5cdb38 wifi: iwlwifi: mvm: use ROC for P2P device activities
JIRA: https://issues.redhat.com/browse/RHEL-50013

Conflicts:
  - drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
    Parallel branches, context diff because d792011b6c28 ("wifi: iwlwifi:
    mvm: unlock mvm mutex") was already applied.

commit 54d96912caf6bb1e6682cfdb225a67cb80545557
Author: Shaul Triebitz <shaul.triebitz@intel.com>
Date:   Wed Jun 5 14:07:39 2024 +0300

    wifi: iwlwifi: mvm: use ROC for P2P device activities
    
    This is the first step towards removing the P2P Device MAC.
    Use ROC (which uses the AUX MAC) for P2P Device
    discoveribility and action frames.
    
    Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240605140556.8c90e457abbd.I8e340759ecb299e05b1809f3d8060429c6cbbd01@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:18:03 +01:00
Jose Ignacio Tornos Martinez 042aa976c5 wifi: iwlwifi: move amsdu_size parsing to iwlwifi
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 5860c6f59220a15bf7b6cfc674a6cbb6dc861df8
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon May 27 19:06:14 2024 +0300

    wifi: iwlwifi: move amsdu_size parsing to iwlwifi
    
    The code that is parsing the amsdu_size module parameter and mapping it
    to the corresponding Rx buffer size is common to all opmodes.
    Move it into a function in iwlwifi, as preparation to a new op mode we
    are working on.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240527190228.a3430d32923d.Iab3c22ef0df685f72f22dafc47021f0dc7bd6fa5@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:54 +01:00
Jose Ignacio Tornos Martinez 3e44e34738 wifi: iwlwifi: remove redundant prints
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit e506f8e755158560c151b1768a954e3c6c28bb34
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon May 27 19:06:13 2024 +0300

    wifi: iwlwifi: remove redundant prints
    
    Upon start, the different opmodes are currently printing:
    1. HW rev, which is already print by iwlwifi
    2. The HW name (e.g. "Intel(R) Wi-Fi 7 BE201 320MHz")
    
    cleanup things such as the hw rev won't be printed again, the HW name will
    be printed by iwlwifi instead of each opmode.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Link: https://msgid.link/20240527190228.5c589c7abed0.I3590c4ee0ee99d1b207852c32d25d326afb327dd@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:54 +01:00
Jose Ignacio Tornos Martinez 8bb1cc12a5 wifi: iwlwifi: move code from iwl-eeprom-parse to dvm
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 6584b9d0aa3234bd8af419e46de1a9648cd34116
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun May 12 15:25:03 2024 +0300

    wifi: iwlwifi: move code from iwl-eeprom-parse to dvm
    
    Move code that is DVM only to dvm.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240512152312.9a1b6ef116e0.I217a513f544d5288a7760d265f51419e81abfd9d@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:47 +01:00
Jose Ignacio Tornos Martinez 6c52684a71 wifi: iwlwifi: mvm: add mvm-specific guard
JIRA: https://issues.redhat.com/browse/RHEL-50013

Conflicts:
  - drivers/net/wireless/intel/iwlwifi/mvm/tt.c
    context diff because 0728c810873e1 was already applied.

commit 3f3126515fbee0e364f8218f6171c091d8e2555e
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun May 12 15:24:58 2024 +0300

    wifi: iwlwifi: mvm: add mvm-specific guard
    
    Add and use an mvm-specific guard for the mvm mutex.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240512152312.7391425b3af2.I1b109f56753dd3f35602dd2c5cf6e1e35aee313d@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:47 +01:00
Jose Ignacio Tornos Martinez 64ca872017 wifi: iwlwifi: mvm: add a of print of a few commands
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit bc4867aabfead3d8eb64827208f59bc1d517e213
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun May 12 07:30:57 2024 +0300

    wifi: iwlwifi: mvm: add a of print of a few commands
    
    This is needed for debugging.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240512072733.65fc46e2ffbc.I19d4ef2cc06bfee7d9644a376d39399f0f6eaa15@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:45 +01:00
Jose Ignacio Tornos Martinez a51a0ba900 wifi: iwlwifi: remove fw_running op
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 37733bffda3285d18bd1d72c14b3a1cf39c56a5e
Author: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Date:   Fri May 10 17:06:40 2024 +0300

    wifi: iwlwifi: remove fw_running op
    
    fw_running assumes that memory can be retrieved only after alive.
    This assumption is no longer true as we support dump before alive.
    To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED
    bit in trans status is set before dumping instead of the prior check.
    
    Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
    Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:44 +01:00
Jose Ignacio Tornos Martinez 35e116c062 wifi: iwlwifi: mvm: check vif for NULL/ERR_PTR before dereference
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 4130c67cd123a36c902cbe9ce5a2efbc33eb18c0
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Wed Jul 3 06:43:15 2024 +0300

    wifi: iwlwifi: mvm: check vif for NULL/ERR_PTR before dereference
    
    iwl_mvm_get_bss_vif might return a NULL or ERR_PTR. Some of the callers
    check only the NULL case, and some doesn't check at all.
    
    Some of the callers even have a pointer to the mvmvif of the bss vif,
    so we don't even need to call this function, and can simply get the vif
    from mvmvif. Do it for those cases, and for the others - properly check
    if IS_ERR_OR_NULL
    
    Fixes: ec0d43d26f2c ("wifi: iwlwifi: mvm: Activate EMLSR based on traffic volume")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240703064027.a661f8c65aac.I45cf09b01af8ee3d55828863958ead741ea43b7f@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:30 +01:00
Jose Ignacio Tornos Martinez 7c6ea399cc wifi: iwlwifi: mvm: don't wake up rx_sync_waitq upon RFKILL
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit e715c9302b1c6fae990b9898a80fac855549d1f0
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Wed Jul 3 06:43:16 2024 +0300

    wifi: iwlwifi: mvm: don't wake up rx_sync_waitq upon RFKILL
    
    Since we now want to sync the queues even when we're in RFKILL, we
    shouldn't wake up the wait queue since we still expect to get all the
    notifications from the firmware.
    
    Fixes: 4d08c0b3357c ("wifi: iwlwifi: mvm: handle BA session teardown in RF-kill")
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240703064027.be7a9dbeacde.I5586cb3ca8d6e44f79d819a48a0c22351ff720c9@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:29 +01:00
Jose Ignacio Tornos Martinez cf7537cc6c wifi: iwlwifi: mvm: record and return channel survey information
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit fc612222416ce206e01d7509b013bad41a051d83
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Mon May 6 10:04:13 2024 +0300

    wifi: iwlwifi: mvm: record and return channel survey information
    
    While doing a passive scan, the firmware will report per-channel survey
    information. This information is primarily useful for hostapd when doing
    an ACS (Automatic Channel Selection). Collect this information and add
    it to the result set when getting the survey information.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.9287591a5999.I54a3f9f6480d3694e67eea1cb4f5853beace2780@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:22 +01:00
Jose Ignacio Tornos Martinez 5a3ae26714 wifi: iwlwifi: mvm: add the firmware API for channel survey
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 97320888cb1582312bb171f4d8b5adc96e630333
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Mon May 6 10:04:12 2024 +0300

    wifi: iwlwifi: mvm: add the firmware API for channel survey
    
    When requested, the firmware can return per-channel survey information
    generally used for ACS (automatic channel selection). Add the API for
    this, which consists of a flag and a new channel survey notification.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.1facde532676.I3864ac4bc0fecb7fd5136e85c07585ab7100234b@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:22 +01:00
Jose Ignacio Tornos Martinez ee7ead78bd wifi: iwlwifi: mvm: Fix race in scan completion
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 2e194efa38093f5f216802f08afc5b4b0a615ccf
Author: Ilan Peer <ilan.peer@intel.com>
Date:   Mon May 6 10:04:11 2024 +0300

    wifi: iwlwifi: mvm: Fix race in scan completion
    
    The move of the scan complete notification handling to the wiphy worker
    introduced a race between scan complete notification and scan abort:
    
    - The wiphy lock is held, e.g., for rfkill handling etc.
    - Scan complete notification is received but not handled yet.
    - Scan abort is triggered, and scan abort is sent to the FW. Once the
      scan abort command is sent successfully, the flow synchronously waits
      for the scan complete notification. However, as the scan complete
      notification was already received but not processed yet, this hangs for
      a second and continues leaving the scan status in an inconsistent
      state.
    - Once scan complete handling is started (when the wiphy lock is not held)
      since the scan status is not an inconsistent state, a warning is issued
      and the scan complete notification is not handled.
    
    To fix this issue, switch back the scan complete notification to be
    asynchronously handling, and only move the link selection logic to
    a worker (which was the original reason for the move to use wiphy lock).
    
    While at it, refactor some prints to improve debug data.
    
    Fixes: 07bf5297d392 ("wifi: iwlwifi: mvm: Implement new link selection algorithm")
    Signed-off-by: Ilan Peer <ilan.peer@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.1f484a86324b.I63ed445a47f144546948c74ae6df85587fdb4ce3@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:22 +01:00
Jose Ignacio Tornos Martinez 1401a16df9 wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit a1efeb823084020c31412cc8f2b5d110ad3e58a3
Author: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Date:   Sun May 5 09:19:57 2024 +0300

    wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active
    
    When there's an active link in a non-station vif, the station vif is
    not allowed to enter EMLSR
    
    Note that blocking EMLSR by calling iwl_mvm_block_esr() we will schedule
    an exit from EMLSR worker, but the worker cannot run before the
    activation of the non-BSS link, as ieee80211_remain_on_channel already
    holds the wiphy mutex.
    
    Handle that by explicitly calling ieee80211_set_active_links()
    to leave EMLSR, and then doing iwl_mvm_block_esr() only for
    consistency and to avoid re-entering it before ready.
    
    Note that a call to ieee80211_set_active_links requires to release the
    mvm mutex, but that's ok since we still hold the wiphy lock. The only
    thing that might race here is the ESR_MODE_NOTIF, so this changes its
    handler to run under the wiphy lock.
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Co-developed-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.916193759f8a.Idf3a3caf5cdc3e69c81710b7ceb57e87f2de87e4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:20 +01:00
Jose Ignacio Tornos Martinez 67d443008c wifi: iwlwifi: mvm: consider FWs recommendation for EMLSR
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit e619ad55b9fd535b266a9fbcdc48cc3a3e08d746
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun May 5 09:19:51 2024 +0300

    wifi: iwlwifi: mvm: consider FWs recommendation for EMLSR
    
    FW sends a notification indicating whether activating EMLSR mode is
    recommended or not.
    Support the notification and enter EMLSR only if recommended.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.2fd3387882eb.I7a8a5b24658744ed732bfc03b1872c9298483d62@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:17:19 +01:00
Jose Ignacio Tornos Martinez d2b497879f wifi: iwlwifi: mvm: exit EMLSR upon missed beacon
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 48ac6c8ed719478ab8b3035406319c7c98a8f134
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:54:06 2024 +0300

    wifi: iwlwifi: mvm: exit EMLSR upon missed beacon
    
    In case of more than 6 missed beacons on one of the links,
    exit EMLSR by deactivating that link.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240416134215.f9111c79cb53.Ie95ea60149a9bc4367f6b338b37c8635051351ba@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:16:58 +01:00
Jose Ignacio Tornos Martinez d0af52b7da wifi: iwlwifi: mvm: Implement new link selection algorithm
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 07bf5297d392069021055800ef48a1106a5c85b5
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:54:03 2024 +0300

    wifi: iwlwifi: mvm: Implement new link selection algorithm
    
    Replaces the current logic with a new algorithm based on the link
    grading introduced in a previous patch.
    
    The new selection algorithm will be invoked upon successful scan to ensure
    it has the necessary updated data it needs.
    
    This update delegates the selection logic as the primary link
    determiner in EMLSR mode, storing it in mvmvif to avoid repeated
    calculations, as the result may vary.
    
    Additionally, includes tests for iwl_mvm_valid_link_pair to validate
    link pairs for EMLSR.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240416134215.309fb1b3fe44.I5baf0c293c89a5a28bd1a6386bf9ca6d2bf61ab8@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:16:57 +01:00
Jose Ignacio Tornos Martinez ec5c9dd74e wifi: iwlwifi: mvm: send ap_tx_power_constraints cmd to FW in AP mode
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit bde2f9b420f69297455df7fb68792e486c04a9b4
Author: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Date:   Tue Apr 16 13:53:57 2024 +0300

    wifi: iwlwifi: mvm: send ap_tx_power_constraints cmd to FW in AP mode
    
    Send AP_TX_POWER_CONSTRAINTS_CMD with no local maximum transmit
    power constraint to FW and FW will update the TPE element with
    required tx power limits.
    
    Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240416134215.b6af4ecfcfe8.I07e8db349190e0c58c468c18477d8551288ac069@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-10-29 08:16:56 +01:00
Jose Ignacio Tornos Martinez 5f44cc6942 wifi: iwlwifi: don't use TRUE/FALSE with bool
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 8efadbc3882b8f9084869c5da9660d49cd62c060
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Feb 8 18:58:40 2024 +0200

    wifi: iwlwifi: don't use TRUE/FALSE with bool
    
    With C99 bool we really also should use true/false, not the
    upper-case variants, wherever they may actually be coming
    from. Fix that.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240208185302.5732dd306ee9.Ifc07c026ac3779429e3dc949e96c9437e89f7bf9@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:32 +02:00
Jose Ignacio Tornos Martinez 473a3b6998 wifi: iwlwifi: mvm: don't abort queue sync in CT-kill
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 0dd2b42c2c096e39da4c35927db4ed1f6c587bea
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Feb 5 21:21:03 2024 +0200

    wifi: iwlwifi: mvm: don't abort queue sync in CT-kill
    
    CT kill should stop doing a lot of TX etc. to cool down the
    NIC, but we don't stop all commands from going to the NIC,
    and as such we shouldn't abort queue sync, since it can get
    confused if we do, warning that we do it twice at the same
    time etc. Only stop it when we'd also not send it in the
    first place.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240205211151.4e0745e2cd97.I311dc623ce68de6a2da3c21c8d84a387844f714a@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:23 +02:00
Jose Ignacio Tornos Martinez 85171bccde wifi: mac80211: introduce 'channel request'
JIRA: https://issues.redhat.com/browse/RHEL-34696

Conflicts:
    - drivers/net/wireless/rsi/rsi_91x_mac80211.c
      drivers/net/wireless/silabs/wfx/sta.c
      Skip hunks of unsupported drivers silabs and rsi.

commit 6092077ad09ce880c61735c314060f0bd79ae4aa
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Jan 29 19:34:40 2024 +0100

    wifi: mac80211: introduce 'channel request'
    
    For channel contexts, mac80211 currently uses the cfg80211
    chandef struct (control channel, center freq(s), width) to
    define towards drivers and internally how these behave. In
    fact, there are _two_ such structs used, where the min_def
    can reduce bandwidth according to the stations connected.
    
    Unfortunately,  with EHT this is longer be sufficient,  at
    least not for all hardware.  EHT requires that non-AP STAs
    that are connected to an AP with a lower bandwidth than it
    (the AP) advertises (e.g. 160 MHz STA connected to 320 MHz
    AP) still be able to receive downlink OFDMA and respond to
    trigger frames for uplink OFDMA  that specify the position
    and bandwidth  for the non-AP STA  relative to the channel
    the AP is using.  Therefore, they need to be aware of this,
    and at least for some hardware (e.g. Intel) this awareness
    is in the hardware. As a result, use of the "same" channel
    may need to be split over  two channel contexts where they
    differ by the AP being used.
    
    As a first step,  introduce a concept of a channel request
    ('chanreq') for each interface,  to control the context it
    requests.   This step does nothing but reorganise the code,
    so that later the AP's chandef can be added to the request
    in order to handle the EHT case described above.
    
    Link: https://msgid.link/20240129194108.2e88e48bd2e9.I4256183debe975c5ed71621611206fdbb69ba330@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:15 +02:00
Jose Ignacio Tornos Martinez ab826aae60 wifi: iwlwifi: read SPLC from UEFI
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 18f523654d4943c87da3ec512dad74828be764e4
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Feb 1 16:17:26 2024 +0200

    wifi: iwlwifi: read SPLC from UEFI
    
    Try to read the SPLC table from UEFI first,
    and if the WIFI UEFI tables are unlocked or the
    table doesn't exist - try to read it from ACPI
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://msgid.link/20240201155157.3d9d835b6edb.I7ea262df9431ced787b77c87149c6d7bddb7e7d6@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:06 +02:00
Jose Ignacio Tornos Martinez a344a74c69 wifi: iwlwifi: prepare for reading SPLC from UEFI
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit a51d1cf5ad64a17230cf90e1770d363c5cbc0d5c
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Feb 1 16:17:25 2024 +0200

    wifi: iwlwifi: prepare for reading SPLC from UEFI
    
    As the iwl_bios_get_x() functions are now generated using a macro,
    and this macro requires the all iwl_acpi_get_x() to have the same
    prototype, change iwl_acpi_get_pwr_limit() to return a int
    and the actuall power limit will be filled in a pointer function
    parameter.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://msgid.link/20240201155157.4cce81198afe.Ice8b1b97a68da9ec7b5a4799ddb668642198e1af@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:06 +02:00
Jose Ignacio Tornos Martinez e9239690f1 wifi: iwlwifi: read SAR tables from UEFI
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 427661e4c48887ea2a226cd972e574ae7686fb95
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Wed Jan 31 10:24:39 2024 +0200

    wifi: iwlwifi: read SAR tables from UEFI
    
    All the regulatory tables will be read from UEFI, and
    only if it doesn't exist - they will be read from ACPI.
    Read SAR tables (WRDS, EWRD and WGDS) from UEFI.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://msgid.link/20240131091413.533b687e1efb.Icb316291e593c8d53f41fdea2d083367dc97e3c4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:19:03 +02:00
Jose Ignacio Tornos Martinez 4ad1084dfd wifi: iwlwifi: fix some kernel-doc issues
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 8a41c017409198dd4de5a4c522cd5ae4810a5911
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Jan 28 08:53:50 2024 +0200

    wifi: iwlwifi: fix some kernel-doc issues
    
    Add return descriptions, move description contents after
    (parameter) sections and fix short descriptions.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240128084842.02ac00f67239.I4ad17097badfcbb82ccdb8c126f61a6f3170798e@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:18:59 +02:00
Jose Ignacio Tornos Martinez 09dc9158b5 wifi: iwlwifi: disable eSR when BT is active
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 10159a45666bf127afe8d7c654351d542e7fcb42
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Wed Jan 31 22:56:32 2024 +0200

    wifi: iwlwifi: disable eSR when BT is active
    
    eSR should be disabled when BT Coex is active and:
    - LB link is the primary link.
    - LB link is the secondary link and the predicted BT penalty
      (the wifi loss rate caused by BT interference) is higher
      than a given threshold.
    If one of the conditions above is no longer true then re-enable eSR.
    
    In order to implement this, add support for version 5 of
    BT_PROFILE_NOTIFICATION, in which the bt penalty is provided
    by FW.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://msgid.link/20240131225342.b922b6485af8.I7d808ce535a7372aca9cb85c045755e6788a4904@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:18:58 +02:00
Jose Ignacio Tornos Martinez b7c33ca1db wifi: iwlwifi: add support for a wiphy_work rx handler
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit fdccafad7e9b49e75fb484c5aa29954d34f3c63a
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Jan 23 20:08:23 2024 +0200

    wifi: iwlwifi: add support for a wiphy_work rx handler
    
    The wiphy_work infra ensures that the entire worker will run
    with the wiphy mutex. It is useful to have RX handlers
    running as a wiphy_work, when we don't want the handler to
    run in parallel with mac80211 work (to avoid races).
    
    For example - BT notification can disable eSR starting from the next
    patch.
    In ieee80211_set_active_links we first check that eSR is
    allowed, (drv_can_activate_links) and then activate it.
    If the BT notif was received after drv_can_activate_links
    (which returned true), and before the activation - eSR will be
    activated when it shouldn't.
    If BT notif is handled with the wiphy mutex, it can't run in
    parallel to ieee80211_set_active_links, which also holds that
    mutex.
    
    Add the necessary infrastructure here, for use in the next commit.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240123200528.ce83d16cdec8.I35ef53fa23f58b9ec17924099238b61deafcecd7@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:18:52 +02:00
Jose Ignacio Tornos Martinez bb0f5f7171 wifi: iwlwifi: remove async command callback
JIRA: https://issues.redhat.com/browse/RHEL-28754

commit 14c1b6f430e3582b3ef2ce1e3016de829b520f77
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Dec 7 04:50:15 2023 +0200

    wifi: iwlwifi: remove async command callback
    
    There's only one user of this code, which is STA unblock
    during sleep for uAPSD on really old devices. Instead of
    having this all through the API with calls up and down,
    just implemented a special-case CMD_BLOCK_TXQS flag for
    this, it's only needed in the old gen1 transport.
    
    While at it, fix a complain that lockdep would have, as
    we lock the cmd queue and then the TXQs in the reclaim
    by using spin_lock_nested(). We no longer need to disable
    BHs in iwl_trans_pcie_block_txq_ptrs() since it's called
    with them disabled already.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20231207044813.2bd95e0570fc.I16486dbc82570d2f73a585872f5394698627310d@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-03-18 17:57:57 +01:00
Jose Ignacio Tornos Martinez 8dab02856b wifi: iwlwifi: fix system commands group ordering
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit e257da5715365b853439243f89cf5d8a9d382355
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun Nov 12 16:36:20 2023 +0200

    wifi: iwlwifi: fix system commands group ordering
    
    The commands should be sorted inside the group definition.
    Fix the ordering so we won't get following warning:
    WARN_ON(iwl_cmd_groups_verify_sorted(trans_cfg))
    
    Link: https://lore.kernel.org/regressions/2fa930bb-54dd-4942-a88d-05a47c8e9731@gmail.com/
    Link: https://lore.kernel.org/linux-wireless/CAHk-=wix6kqQ5vHZXjOPpZBfM7mMm9bBZxi2Jh7XnaKCqVf94w@mail.gmail.com/
    Fixes: b6e3d1ba4fcf ("wifi: iwlwifi: mvm: implement new firmware API for statistics")
    Tested-by: Niklāvs Koļesņikovs <pinkflames.linux@gmail.com>
    Tested-by: Damian Tometzki <damian@riscv-rocks.de>
    Acked-by: Kalle Valo <kvalo@kernel.org>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:57 +01:00
Jose Ignacio Tornos Martinez 44be87f5b8 wifi: iwlwifi: mvm: show dump even for pldr_sync
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit d6144e2725cdbfd55ce2d402deec4b2c46582ad9
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Oct 22 17:55:54 2023 +0300

    wifi: iwlwifi: mvm: show dump even for pldr_sync
    
    Worst case it's extra (garbage) data, best case we see why
    things failed ... Seems the trade-off is better if we print
    it.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231022173519.30e614ecd540.I47324f555ebcf22d0dd0afa94e7ca0af53a9fdba@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:53 +01:00
Jose Ignacio Tornos Martinez 6e9192e5cc wifi: iwlwifi: mvm: implement new firmware API for statistics
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit b6e3d1ba4fcf02176846d03a930203d8133c0aaf
Author: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Date:   Sun Oct 22 17:55:47 2023 +0300

    wifi: iwlwifi: mvm: implement new firmware API for statistics
    
    The new firmware API uses a new command and notification,
    the command configures in which statistics types driver is
    interested and the notification is sent periodically.
    An additional change in the API is that most of the statistics
    data is accumulated and reported by the firmware per MLO link.
    Implement new command and notification handlers and adjust to
    per-link statistics.
    
    Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231022173519.8cc7df0ebff2.If1dcb57145841c5b3c68ed112bbfcd0201f7acc3@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:52 +01:00
Jose Ignacio Tornos Martinez 3c3807fb54 wifi: iwlwifi: mvm: implement ROC version 3
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit 67ac248e4db0a754ee85a7e41fa363b330df00e5
Author: Shaul Triebitz <shaul.triebitz@intel.com>
Date:   Wed Oct 11 13:07:22 2023 +0300

    wifi: iwlwifi: mvm: implement ROC version 3
    
    Define the new API for ROC command and notification.
    Use ROC version 3 command and notificaiton for hotspot.
    
    Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231011130030.0cff02aecc16.If0a89ddc6b2339988ff51efa6709d4a883569969@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:49 +01:00
Jose Ignacio Tornos Martinez ad49babf55 wifi: iwlwifi: fw: increase fw_version string size
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit c3745ee2e3506b75051f9d427cba24d95f75d6bf
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Thu Oct 12 15:41:48 2023 +0300

    wifi: iwlwifi: fw: increase fw_version string size
    
    In reality 64 bytes are enough to hold fw version string,
    but some compilers can complain (with W=1) that output may be
    truncated when building this string with snprintf.
    Increase the size to avoid this sort of warnings and state
    explicitely that we want the size to be trancated to 32 bytes.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Tested-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20231012153950.f4465b4b4e2b.Idced2e8d63c492872edcde1a3ce2cdd6cc0f8eb7@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:48 +01:00
Jose Ignacio Tornos Martinez 844fbe9f4e wifi: iwlwifi: mvm: support set_antenna()
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit 4ea1ed1d14d86173ff4298b1d8fcb60946602f93
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Thu Sep 21 11:57:59 2023 +0300

    wifi: iwlwifi: mvm: support set_antenna()
    
    set_antenna() is supported only when the device is not started in
    mac80211 which translates to the firmware not being loaded in iwlwifi.
    
    The tricky part is that iwlwifi populates the sband data during its boot
    and doesn't touch this data afterwards, but if the antenna settings
    forbid MIMO, we need to update the sband data.
    
    Rework the nvm parsing code to allow to get an existing nvm_data and
    modify the sband with additional constraints (tx / rx chains masks).
    
    Suggested-by: Ben Greear <greearb@candelatech.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230921110726.81d94d630c95.I9473da818cbeeb51b2f89dcc59b00019113e7f55@changeid
    [add bugfix from Benjamin for iwl_mvm_get_valid_rx_ant()]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:14 +01:00
Jose Ignacio Tornos Martinez 41420a234a wifi: iwlwifi: mvm: make "pldr_sync" mode effective
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit bdd940613b4d0daf09a431096bf7d63aa55dee16
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Sep 13 14:56:43 2023 +0300

    wifi: iwlwifi: mvm: make "pldr_sync" mode effective
    
    If the device initialized with ME active, this would indeed
    work, since the NVM information would be obtained from ME.
    However, in the much more likely case that ME isn't active
    and the firmware takes actions requiring the sync, this was
    not working correctly when the firmware is only run at init
    to obtain NVM data, since mac80211 isn't even initialized.
    
    Fix this by moving the 'pldr_sync' handling to a different
    place.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230913145231.45a94d480e56.Id9277f1df6a63ab0dfca0d0c0f448c759e1b8e73@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:29:02 +01:00