Commit Graph

61 Commits

Author SHA1 Message Date
Jose Ignacio Tornos Martinez 87a98f15ca wifi: iwlwifi: mvm: properly set the rates in link cmd
JIRA: https://issues.redhat.com/browse/RHEL-67113

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

    wifi: iwlwifi: mvm: properly set the rates in link cmd
    
    When a channel ctx is assigned to a link, we set the
    LINK_CONTEXT_MODIFY_RATES_INFO to indicate that the rate fields are now
    valid. But then we always take the rates of 2.4 GHz regardless of actual
    used band.
    This is because we are getting the band from bss_conf->chanctx_conf, but
    this is assigned only after drv_assign_vif_chanctx returns, so we take
    the bands of 2.4 GHz.
    Fix it by taking the band from the iwl_mvm_link_info::phy_ctxt instead,
    as this has already assigned in this point.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Link: https://patch.msgid.link/20240901071542.11c2d3609609.I8fa59e29b6bb38e5d06f3536d54dfb2c5d5bab11@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:05 +01:00
Jose Ignacio Tornos Martinez bac4345046 wifi: iwlwifi: mvm: tell the firmware about CSA with mode=1
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit 07fb53783be80ca14f08b07d83ed88727db48aac
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Sep 1 07:17:51 2024 +0300

    wifi: iwlwifi: mvm: tell the firmware about CSA with mode=1
    
    When we de-activate a link because it started a CSA with mode=1, we want
    to tell the firmware it can no longer transmit any frame for that link.
    The firmware will do that on its own if the CSA indication (beacon /
    action frame) was  received on that same link, but with MLO, things got
    more complex and the firmware can't track cross link CSA.
    
    Tell the firmware if we de-activate a link because of CSA with mode=1 to
    prevent it from transmitting, even if it is only an NDP PM=1 frame that
    is part of the de-activation flow.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240901071542.4bef89d438d4.If7147a7a84054e67c05414c753d73f4e2e0e6e37@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 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 a7c6b06046 wifi: iwlwifi: mvm: set ul_mu_data_disable when needed
JIRA: https://issues.redhat.com/browse/RHEL-67113

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

    wifi: iwlwifi: mvm: set ul_mu_data_disable when needed
    
    The firmware needs to know what we had in the HE CAP, propagate that
    setting to the firmware through the LINK command.
    
    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.fef270d2995b.I328237837df30e1cb98764987eaaf8e8993e058c@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 e00a412b9f wifi: iwlwifi: mvm: add missing string for ROC EMLSR block
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 5fdbde79eafe45888f41f6947132f63e8d39f485
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Jul 3 12:58:58 2024 +0300

    wifi: iwlwifi: mvm: add missing string for ROC EMLSR block
    
    This should be labeled for the debug output, add the missing
    string.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240703125541.03d428f4ff4d.I858f17a5173fe8337cea4e7665fec00dbb15e514@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:23 +01:00
Jose Ignacio Tornos Martinez d8a59af538 wifi: iwlwifi: mvm: simplify EMLSR blocking
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit f27579ff8b9344226db63a902dc9e9cbddf07b74
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Jul 3 12:58:51 2024 +0300

    wifi: iwlwifi: mvm: simplify EMLSR blocking
    
    If EMLSR is already blocked for the same reason that
    it's blocked for again, there's no need to actually
    do any work, so exit early from the function. Also,
    print the state after modifying it, so it's clearer.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240703125541.6995464f0bac.Iac9fe3546ca0a0d6bc6666c822a667ab257419a9@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:22 +01:00
Jose Ignacio Tornos Martinez 9cae3855ed wifi: iwlwifi: mvm: fix re-enabling EMLSR
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit bd40215b19d255b433a91a8bb8088937e5db4284
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Wed Jun 5 14:05:06 2024 +0300

    wifi: iwlwifi: mvm: fix re-enabling EMLSR
    
    When EMLSR gets unblocked, the current code checks if the last exit was
    due to an EXIT reason (as opposed to a BLOCKING one), and if so, it
    does nothing, as in this case a MLO scan was scheduled to run in 30
    seconds.
    
    But the code doesn't consider the time that passed from the last exit,
    so if immediately after the exit a blocker occurred (e.g. non-BSS
    interface), and lasts for more than 30 seconds, then the MLO scan and the
    following link selection will decide not to enter EMLSR, and when the
    unblocking event finally happens, the reason is still set to the EXIT one,
    so it will do nothing, and we will not have the chance to re-enable EMLSR.
    
    Fix this by checking also the time that has passed since the last exit,
    only if it is less than 30 seconds, we can count on the scheduled MLO
    scan.
    
    Note that clearing the reason itself can't be done since it is needed
    for the EMLSR prevention mechanism.
    
    Fixes: 2f33561ea8f9 ("wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240605140327.58556fc4cfa9.I4c55b3cd9f20b21b37f28258d0fb6842ba413966@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 899fe83f7e wifi: iwlwifi: mvm: use only beacon BSS load for active links
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit d9b7531fe98a0c2a0387270557cf0a514c28dd28
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon May 27 19:06:08 2024 +0300

    wifi: iwlwifi: mvm: use only beacon BSS load for active links
    
    For active links, don't take information that may have been
    received in probe responses, as those are not protected. For
    inactive links, there may not be a choice.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240527190228.6947dc462fa9.I2076961211d6785c8a15b4308e0e87a413148222@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:53 +01:00
Jose Ignacio Tornos Martinez c6213fc83b wifi: iwlwifi: mvm: don't skip link selection
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 46144103ace2863e26f4e911aa45200753b7dbca
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun May 12 15:24:59 2024 +0300

    wifi: iwlwifi: mvm: don't skip link selection
    
    If we exit EMLSR due to a IWL_MVM_ESR_EXIT*, a MLO scan followed by a
    link selection is scheduled with a delay of 30 seconds.
    If during that 30 seconds EMLSR was blocked and unblocked
    (IWL_MVM_ESR_BLOCKED*), we would still want to get the needed data from
    the MLO scan and select link accordingly, and not return immediately to
    EMLSR.
    
    Fixes: 2f33561ea8f9 ("wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240512152312.caab27a8dd8f.I63f67e213d5e05416f71513a8d914917d59aa44f@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 2cebbce62b wifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 9574c7592c5080a3e1f3fdfe658bd13083a04cb5
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Sun May 12 07:31:10 2024 +0300

    wifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false
    
    When AUTO_EML is set to false, this change ignores the exit criteria,
    for testing purposes. Currently, if AUTO_EML is disabled, the
    driver will not select a link or enter EMLSR, but will still exit if one
    of the criteria is not fulfilled.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240512072733.10a0b5da6ec2.I46fd578a3ef6cdbf14fdc4dfa97b4be008fe68e3@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:46 +01:00
Jose Ignacio Tornos Martinez 0dbec572d0 wifi: iwlwifi: mvm: don't track used links separately
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit ed93faf01797d83b3347168adae93e6eb5fc1d9c
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun May 12 07:31:07 2024 +0300

    wifi: iwlwifi: mvm: don't track used links separately
    
    We track which link is using which FW link ID, so there
    really isn't a need to separately track which link IDs
    are in use. Remove that code and check the table when
    looking for a new link ID to use.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240512072733.1a67d8af815f.Ie642c12dce3ab55c688abd9a25918569e83e558a@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:46 +01:00
Jose Ignacio Tornos Martinez 2480a73ead wifi: iwlwifi: mvm: exit EMLSR if secondary link is not used
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit df966c93f5a9c060df525272d9c1eb37795a88f5
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon May 6 10:04:17 2024 +0300

    wifi: iwlwifi: mvm: exit EMLSR if secondary link is not used
    
    Exit EMLSR mode if the secondary link is not used enough for Rx/Tx
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240506095953.99ad1d71e9b9.Ide825433488ec809773efdc36937e3089d0012df@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:23 +01:00
Jose Ignacio Tornos Martinez a22690058d wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 05fe96061d175a9ee71e9cd0a4636237d08a79ef
Author: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Date:   Mon May 6 10:04:10 2024 +0300

    wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth
    
    When validating a link pair for EMLSR, add a print for invalid link
    pair due to bandwidth
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.9e57ad898cf4.Id8edfd5e3774ea6475d5f4178ab7ea75a870ef95@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:21 +01:00
Jose Ignacio Tornos Martinez 0287421dfc wifi: iwlwifi: mvm: add a debugfs for reading EMLSR blocking reasons
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit ff907d97448689806526ee889aa937fd682a626a
Author: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Date:   Mon May 6 10:04:09 2024 +0300

    wifi: iwlwifi: mvm: add a debugfs for reading EMLSR blocking reasons
    
    Add a reading for all active EMLSR blocking reasons for testing
    purposes.
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.6d494a335e81.Ic0fa6a9636e3c1a3b1420e85e704a19d4a56e8d9@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:21 +01:00
Jose Ignacio Tornos Martinez e8157c36d5 wifi: iwlwifi: mvm: Add active EMLSR blocking reasons prints
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 05f10dad0380027cfc3e6f2ef818748c86b9d23e
Author: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Date:   Mon May 6 10:04:08 2024 +0300

    wifi: iwlwifi: mvm: Add active EMLSR blocking reasons prints
    
    Upon adding/removing an EMLSR blocking reason add to the print
    the EMLSR disabling mask
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240506095953.1e34fe2c3e51.Ia7db0392d81818ceb70a7b199d3f5fa8a4ad198d@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:21 +01:00
Jose Ignacio Tornos Martinez d63a726c2c wifi: iwlwifi: Print EMLSR states name
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 966a4d9bd3070c7458cf0719fa118b8a0ed7602e
Author: Daniel Gabay <daniel.gabay@intel.com>
Date:   Sun May 5 09:19:58 2024 +0300

    wifi: iwlwifi: Print EMLSR states name
    
    This is useful for debug instead of looking for the hex value.
    
    Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.f3509cf652f2.Ic086b6b2132ffe249b3c4bdd24c673ce7fd1b614@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 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 fe7cd91dca wifi: iwlwifi: mvm: fix typo in debug print
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: fix typo in debug print
    
    Change EMSLR to EMLSR
    
    Fixes: 6cf7df9f013f ("wifi: iwlwifi: mvm: Add helper functions to update EMLSR status")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.db629302bfdc.I135e28b89fab3b614ad8758c0305834934f8c0af@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 1d5d0412ae wifi: iwlwifi: mvm: exit EMLSR when CSA happens
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 2f876f910b34061b0c4bb744dee3174c9881da1f
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun May 5 09:19:55 2024 +0300

    wifi: iwlwifi: mvm: exit EMLSR when CSA happens
    
    If CSA is happening, then exit EMLSR to keep the better link,
    which is the primary link unless that's doing the CSA with
    quiet. This is done because we can't transmit the OMN frame
    on a quiet link, but want to exit EMLSR during CSA for better
    beacon reception, so we can follow the switch accurately.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.3ffff9577f08.I2620971fa5aef789e0d4a588def4c2621e8bed5b@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 9596b803c3 wifi: iwlwifi: mvm: Disable/enable EMLSR due to link's bandwidth/band
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: Disable/enable EMLSR due to link's bandwidth/band
    
    Enable EMLSR when bandwidth settings meet the criteria in
    both band and width, otherwise disable.
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.4e473d4f7f5c.I3adf5619b60bfba8af0cd7eae9dac947419603b6@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 8e94f5a5d4 wifi: iwlwifi: mvm: avoid always prefering single-link
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: avoid always prefering single-link
    
    The new link selection algorithm uses defaults values for BSS load if
    the BSS Load element was not published by the AP.
    For 6 GHz, that value is 0. So if the best link is 6 GHz, the EMLSR
    grade to always be equal to the grade of the best link,
    and then the best link grade is getting a bonus of 10 percent, meaning
    that we will never activate EMLSR.
    Change the logic to not give a bonus for the best link.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.4614e6891dbd.Ie40eae0dd99d82ba60dea5b6dbcd42dcdf16b90d@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 a5ef47ed75 wifi: iwlwifi: mvm: don't always unblock EMLSR
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: don't always unblock EMLSR
    
    When an event occurs to unblock EMLSR, the code attempts to re-enable
    EMLSR. However, the current implementation always tries to activate
    EMLSR, regardless of whether the blocker was set before the unblocking
    event or not. If EMLSR was already unblocked, there is no need to
    re-activate it.
    
    Fixes: 6cf7df9f013f ("wifi: iwlwifi: mvm: Add helper functions to update EMLSR status")
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.eb861402dac9.I6a1d9f774f5551cfab60ea37b71a62640496af9b@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 10b5518ab3 wifi: iwlwifi: mvm: Always allow entering EMLSR from debugfs
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: Always allow entering EMLSR from debugfs
    
    EMLSR can't be activated from mac80211. Except for the debugfs, which is
    intended for testing purposes. Currently we don't allow entering EMLSR
    from debugfs if EMLSR is blocked, i.e. if mvmvif::esr_disable_reason is
    not 0. But we need a way to activate EMLSR regardless of the vif being
    blocked, for testing. Remove the check of esr_disable_reason
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.bc3c24d9e0e6.Iad60e22a0d7e2b2b989051e1140b6dc98bef7bcc@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 ac7a3b55de wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR
    
    If the reason for exiting EMLSR was a blocking reason, wait for the
    corresponding unblocking event:
    - if there is an ongoing scan - do nothing. Link selection will be
      triggered at the end of it.
    - If more than 30 seconds passed since the exit, trigger MLO scan, which
      will trigger link selection
    - If less then 30 seconds passed since exit, reuse the latest link
      selection result
    
    If the reason for exiting EMLSR was an exit reason (IWL_MVM_EXIT_*),
    schedule MLO scan in 30 seconds.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Ilan Peer <ilan.peer@intel.com>
    Link: https://msgid.link/20240505091420.6a808c4ae8f5.Ia79605838eb6deee9358bec633ef537f2653db92@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 40f355d004 wifi: iwlwifi: cleanup EMLSR when BT is active handling
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: cleanup EMLSR when BT is active handling
    
    BT Coex disables EMLSR only for a 2.4 GHz link, but doesn't block the
    vif from using EMLSR with a different link pair. In addition, storing it
    in mvmvif:disable_esr_reason requires extracting the BT Coex bit before
    checking if EMLSR is blocked or not for a specific vif.
    
    Therefore, change the BT Coex bit to be an exit reason and not a
    blocker. On link selection, EMLSR mode will be re-calculated for the 2.4
    GHz link instead of checking that bit.
    
    While at it, move the relevant function declarations to the EMLSR
    functions area in mvm.h
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.a2e93b67c895.I183a0039ef076613144648cc46fbe9ab3d47c574@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 79e17d2cdb wifi: iwlwifi: mvm: Don't allow EMLSR when the RSSI is low
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 30ce039094b5e5842f78ec8525235cd74b9848a7
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:54:11 2024 +0300

    wifi: iwlwifi: mvm: Don't allow EMLSR when the RSSI is low
    
    If the RSSI of a link is low enough, don't use it for EMLSR.
    If EMLSR is already active and the RSSI of one of the links gets low,
    exit EMLSR by deactivating that link.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240416134215.73263c000263.Ieb2b18855a2719b5e18ad2fa8a3e855ca4e23938@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 711bb77fc9 wifi: iwlwifi: mvm: disable EMLSR when we suspend with wowlan
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 54fa45dd2c47d04ab36d644ea1c4cee14c06abb2
Author: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Date:   Tue Apr 16 13:54:10 2024 +0300

    wifi: iwlwifi: mvm: disable EMLSR when we suspend with wowlan
    
    We can't be an EMLSR while suspended with wowlan. De-activate the
    secondary link upon wowlan entring.
    
    Set the blocking reason upon suspension and clear it upon resume.
    
    Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240416134215.6ea884b3f095.I84233cb1c79ba538defafb8ddb983c47f04a400a@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 b98071c8e9 wifi: iwlwifi: mvm: don't recompute EMLSR mode in can_activate_links
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: don't recompute EMLSR mode in can_activate_links
    
    mac80211 invokes the driver callback drv_can_activate_links() from
    ieee80211_set_active_links to verify it can activate the desired link
    combination.
    However, ieee80211_set_active_links is called with more than one link in
    2 cases:
    - After driver's link selection decided to enter EMLSR
    - From debugfs, for testing purposes.
    For both cases there is no need to recompute all the considerations
    determining whether to activate EMLSR.
    Instead, only check if the vif is not blocked 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.202cf5a9ef2c.I65e4698b730a8652ad8d1c01420aabb41a1d04fd@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 dcd5fff0dc wifi: iwlwifi: mvm: implement EMLSR prevention mechanism.
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: implement EMLSR prevention mechanism.
    
    Address scenarios where repeated entry and exit from EMLSR occur, such as
    encountering missed beacons on a specific link,
    while still discovering that link during a scan.
    
    To mitigate this, introduce the EMLSR prevention mechanism, which operates
    as follows:
    - On each exit from EMLSR event, record the timestamp and the exit
      reason.
    - If two consecutive exits happen for the same reason within a
      400-second window, enforce a 300-second EMLSR prevention.
    - If a third exit for the same reason occurs within 400 seconds from the
      second exit, enforce an extended EMLSR prevention of 600 seconds.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240416134215.d820ee98b300.I6406db40cf25eabdba602afd783466473b909216@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 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 3ec420a5b9 wifi: iwlwifi: mvm: Add helper functions to update EMLSR status
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 6cf7df9f013f44b1f94da75e3e01410231535430
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:54:04 2024 +0300

    wifi: iwlwifi: mvm: Add helper functions to update EMLSR status
    
    There are reasons for which we need to exit EMLSR, but not to block it
    completely, and there are reasons for which we need to block EMLSR.
    
    For both reason types we have the enum iwl_mvm_esr_state, when the
    blocking reasons are stored in the `mvmvif::esr_disable_reason` bitmap.
    
    This change introduces the APIs to use in the different cases:
    - iwl_mvm_exit_esr - will exit from EMLSR mode.
    - iwl_mvm_block_esr - will update the bitmap and exit EMLSR, to
      be used for the blocking reasons only.
    - iwl_mvm_unblock_esr - will update the bitmap. To be used for the
      blocking reasons only.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240416134215.d54142a75876.I552926065521f5f848c37b0bd845494bd7865fb7@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 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 f83df81d01 wifi: iwlwifi: mvm: move EMLSR/links code
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 1b9b7d37c87c17b98d293e1317238373f296ebab
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:54:02 2024 +0300

    wifi: iwlwifi: mvm: move EMLSR/links code
    
    The functions that are link related, so they should be in link.c and
    not in mld-mac80211.c. Move them.
    Also move the different prototypes to the right place in mvm.h
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240416134215.e7c368256fa0.I6b15805a7c8a75d1814f1a829601daf4d3788731@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 56519ca483 wifi: iwlwifi: mvm: implement link grading
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit 2887af4d22f90bcddd3ff9a6eb93ecdaab3acd94
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Apr 16 13:53:58 2024 +0300

    wifi: iwlwifi: mvm: implement link grading
    
    For selecting what link(s) out of the usable ones
    to activate, calculate a grade for a given link.
    
    Calculation of a link grade is done as follows:
    1. get the estimated throughput according to the RSSI of the link, this
       will be the base grade
    2. get the channel load from the BSS Load Element, subtracting the load
       caused by us. Apply the factor on the grade.
    3. puncturing factor: calculate the percentage of the punctured
       subchannels (out of the total subchannels). Apply this on the grade.
    
    The link grading will be used by the link selection mechanism in a later
    patch.
    
    Also add KUnit tests for it.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Reviewed-by: Johannes Berg <johannes.berg@intel.com>
    Link: https://msgid.link/20240416134215.a6799dbd5643.If137ca6dc443606c7d8c99ec1fc38b325003a7c1@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 fbe9a33afa wifi: iwlwifi: mvm: fix link ID management
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 91112fc6212a9be6f3be636d885df9c17395e1a4
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sat Apr 20 15:44:36 2024 +0200

    wifi: iwlwifi: mvm: fix link ID management
    
    On older (pre-MLD API) devices, we started also calling
    iwl_mvm_set_link_mapping()/iwl_mvm_unset_link_mapping(),
    but of course not also iwl_mvm_remove_link(). Since the
    link ID was only released in iwl_mvm_remove_link() this
    causes us to run out of FW link IDs very quickly. Fix
    it by releasing the link ID correctly.
    
    Fixes: a8b5d4809b50 ("wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW")
    Link: https://msgid.link/20240420154435.dce72db5d5e3.Ic40b454b24f1c7b380a1eedf67455d9cf2f58541@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:20:05 +02:00
Jose Ignacio Tornos Martinez b1bd3cbab6 wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit a8b5d4809b503da668966a8187b9872e6c85291c
Author: Ilan Peer <ilan.peer@intel.com>
Date:   Mon Mar 11 08:28:05 2024 +0200

    wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW
    
    In the non MLD firmware flows, although the deflink is used, the mapping
    of link ID to BSS configuration was missing, which causes flows that need
    this mapping to crash.
    
    Fix this by adding the link ID to BSS configuration mapping to non MLD
    flows as well.
    
    Signed-off-by: Ilan Peer <ilan.peer@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240311081938.0b5c361e8f0c.Ib11f41815d2efa5d1ec57f855de4c8563142987b@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-06-17 09:20:02 +02:00
Jose Ignacio Tornos Martinez c7dc9dd7b9 wifi: iwlwifi: mvm: support PHY context version 6
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 9a43c1902e56231fcf11780d7e2015638ff43cca
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Feb 18 19:51:44 2024 +0200

    wifi: iwlwifi: mvm: support PHY context version 6
    
    Fill the new puncture mask in the PHY context command if
    supported. In this case, also don't send it in the link
    context command.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240218194912.16d9f5fc41df.I9eeb55787d8483f820f5790e8874761f598da314@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:40 +02:00
Jose Ignacio Tornos Martinez 148e1dcf78 wifi: cfg80211/mac80211: move puncturing into chandef
JIRA: https://issues.redhat.com/browse/RHEL-34696

Conflicts:
    - drivers/net/wireless/ath/ath12k/mac.c
      Context diff due to parallel branches.

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

    wifi: cfg80211/mac80211: move puncturing into chandef
    
    Aloka originally suggested that puncturing should be part of
    the chandef, so that it's treated correctly. At the time, I
    disagreed and it ended up not part of the chandef, but I've
    now realized that this was wrong. Even for clients, the RX,
    and perhaps more importantly, CCA configuration needs to take
    puncturing into account.
    
    Move puncturing into the chandef, and adjust all the code
    accordingly. Also add a few tests for puncturing in chandef
    compatibility checking.
    
    Link: https://lore.kernel.org/linux-wireless/20220214223051.3610-1-quic_alokad@quicinc.com/
    Suggested-by: Aloka Dixit <quic_alokad@quicinc.com>
    Link: https://msgid.link/20240129194108.307183a5d2e5.I4d7fe2f126b2366c1312010e2900dfb2abffa0f6@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:17 +02:00
Jose Ignacio Tornos Martinez fed10743fe wifi: iwlwifi: support link command version 2
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 4dde4ff0eadd6cde43aa5f39fbea36355f9f6e44
Author: Shaul Triebitz <shaul.triebitz@intel.com>
Date:   Thu Feb 1 16:17:29 2024 +0200

    wifi: iwlwifi: support link command version 2
    
    In version 2, listen_lmac becomes reserved.
    
    Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240201155157.df1890aba2fd.Icad9ba10f8bab770adc6a559b2c7bff5cccbffe9@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 6bfd69234e wifi: iwlwifi: mvm: Return success if link could not be removed
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit ac139aa3483c2a20adfd78d950def062820aece1
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Tue Oct 17 12:16:45 2023 +0300

    wifi: iwlwifi: mvm: Return success if link could not be removed
    
    iwl_mvm_remove_link would return an error if the link could not be
    removed. However, doing so prevents recovery if a link was not uploaded
    to the FW in the first place and the link_info was not allocated or
    fw_link_id is not set.
    
    Returning success means that we can still try to continue with adding
    new links in change_vif_links.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231017115047.f89bc05aadf6.Idc8fbd671362d962c02b1df87fa6258733631580@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 717ee4f38f wifi: iwlwifi: mvm: fix size check for fw_link_id
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit e25bd1853cc8308158d97e5b3696ea3689fa0840
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Tue Oct 17 12:16:44 2023 +0300

    wifi: iwlwifi: mvm: fix size check for fw_link_id
    
    Check that fw_link_id does not exceed the size of link_id_to_link_conf
    array. There's no any codepath that can cause that, but it's still
    safer to verify in case fw_link_id gets corrupted.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231017115047.3385bd11f423.I2d30fdb464f951c648217553c47901857a0046c7@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 3ba33f2f21 wifi: iwlwifi: mvm: don't add dummy phy context
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit f3276ff0d498a364dfdff74cc1825b5f6e27f472
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Wed Oct 11 13:07:24 2023 +0300

    wifi: iwlwifi: mvm: don't add dummy phy context
    
    From its very first stages of development, iwlmvm added all the PHY
    context immediately upon firmware boot. Then, all we needed to do is to
    modify the contexts. This was fine if the addition of a PHY context that
    we don't need is free. This was true until now. Newer devices will run
    calibrations upon the addition of a PHY context.
    
    Change the way we work with PHY context in iwlmvm. Fortunately, we
    already have all the ref counting in place so that it is not very hard
    to do.
    
    Also, since we now remove the PHY context before the link is removed
    (but after it has been de-activated of course), it'll confuse the
    firmware if we put the late phy_id into the LINK command that removes
    the link. Change this to put an invalid phy_id just like we do when we
    add a link that has no PHY context yet.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231011130030.55a1a78719be.I2032a7d227b57f4fc4370a2793476d47538404fd@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 aa9a6c1ab3 wifi: iwlwifi: mvm: Correctly set link configuration
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit 35b9281fb710ea9fa47dca56774f4a9606fe9154
Author: Ilan Peer <ilan.peer@intel.com>
Date:   Wed Oct 4 12:36:34 2023 +0300

    wifi: iwlwifi: mvm: Correctly set link configuration
    
    In case the link puncturing is changed such that the channel
    is no longer punctured, configure the FW correctly indicating
    the EHT parameters changed (with a 0 punctured map).
    
    Allow EHT parameters configuration only when the link really
    supports EHT.
    
    Fixes: 55eb1c5fa4b2 ("wifi: iwlwifi: mvm: add support for the new LINK command")
    Signed-off-by: Ilan Peer <ilan.peer@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231004123422.2666ef86e032.I4b0e95722660acc5345ceefba7e8866a69572e8e@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:47 +01:00
Jose Ignacio Tornos Martinez e5849b88fe wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit 84ef7cbe90e9e54c71c1da4e645ba34e1b33da77
Author: Ilan Peer <ilan.peer@intel.com>
Date:   Wed Oct 4 12:36:30 2023 +0300

    wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface
    
    It is not necessary to keep the P2P Device bound/linked to a PHY
    context when there is no active ROC.
    
    Modify the P2P Device flows so the binding/linking would be done
    only while ROC is active. With this change the switch_phy_ctxt()
    is no longer needed so remove it.
    
    Signed-off-by: Ilan Peer <ilan.peer@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20231004123422.c5b83b4bf9de.Ia80daf3ba0b5fec7d0919247fcbdbdb58bddf02b@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:47 +01:00
Jose Ignacio Tornos Martinez d785e79a01 wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit e119e740b1899169a19cf3cd43993a7d88c63bc6
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Tue Jun 20 13:03:51 2023 +0300

    wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware
    
    We need to work on the right link there.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230620125813.8762a90e8857.Ic5b8e96140a449fd1ed7008907d67fc36fe98506@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:47 +01:00
Jose Ignacio Tornos Martinez 1d645800cc wifi: iwlwifi: handle eSR transitions
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 12bacfc2c065319d87a0580cd65375cea8204aba
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Jun 15 09:47:17 2023 +0300

    wifi: iwlwifi: handle eSR transitions
    
    There several transitions to handle in eSR mode:
    * SMPS should be disabled when in eSR mode
    * indicate to the fw whether the new added link should use the
      listen lmac or the main lmac
    * RLC is offloaded when in eSR mode; adjust RLC command accordingly
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230615094410.fb6409f44aca.I502460dec15e0b76035ad3cd809afa4ac16e9fe1@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:36 +01:00
Jose Ignacio Tornos Martinez 413a37c87e wifi: iwlwifi: fix max number of fw active links
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 823a970831c73ca2910da1f5c827c9ce4efa0c02
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Thu Jun 15 09:47:16 2023 +0300

    wifi: iwlwifi: fix max number of fw active links
    
    The max active links that are supported by the FW is hard coded.
    This is wrong since this value is HW-dependent. Fix this by
    determining according to the actual HW.
    
    Also remove a redundant check that the number of active links
    doesn't exceeds the maximum.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230615094410.e78ad74c6715.I68b26911c0a312d72eaf25344b448d03b1c61f4e@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:36 +01:00
Jose Ignacio Tornos Martinez 84ddb35517 wifi: iwlwifi: mvm: always send spec link ID in link commands
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit ed0c34333dfb2e4a6bd9e25613040aaf9d48fb9d
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Jun 14 12:41:30 2023 +0300

    wifi: iwlwifi: mvm: always send spec link ID in link commands
    
    The firmware technically only needs this when the link is
    newly added, but it's much easier for debugging if it's
    always available, so include 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/20230614123446.daecd0e626f7.I0f8a16a6d80a283c9f947c9bb0fc50a7c6853948@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:35 +01:00
Jose Ignacio Tornos Martinez 052b8f31b4 wifi: iwlwifi: use array as array argument
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 77e1f3f369e5f89235d539059bf6c7fa1645f350
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Jun 14 12:41:29 2023 +0300

    wifi: iwlwifi: use array as array argument
    
    When calling iwl_mvm_set_fw_qos_params() we explicitly pass
    a pointer to the first array element, but the function will
    treat it as an array. Simplify and clarify the code and pass
    the array instead.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230614123446.6fb4a9743b1b.I801007d207f6539a9e0996366ec593e2038b1f90@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:35 +01:00
Jose Ignacio Tornos Martinez c134a2c7f1 wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 3f3022694f62476df562244ee2a72819e98eec89
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Wed May 24 20:42:05 2023 +0300

    wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
    
    The firmware added new fields to be able to pass the link_id as the AP
    knows it and the esr_transition_timeout.
    For now, pass only the link_id since we don't have access to the
    esr_transition_timeout yet.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230524203151.bf80ce717458.Icd4174911227c00cd12783fe1f517ae8097809b9@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2023-11-27 15:01:11 +01:00