Commit Graph

85 Commits

Author SHA1 Message Date
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 f934e6e166 wifi: iwlwifi: remove MVM prefix from FW macros
JIRA: https://issues.redhat.com/browse/RHEL-67113

commit cb2b6ce8b2e9289b95d6b997eecdf3083107acad
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon Jul 29 20:20:04 2024 +0300

    wifi: iwlwifi: remove MVM prefix from FW macros
    
    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/20240729201718.939b32f84f46.I293957bf172680871eba24448d9d1870e49100b6@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:56 +01:00
Jose Ignacio Tornos Martinez bcdf22cbb0 wifi: iwlwifi: fix prototype mismatch kernel-doc warnings
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit fa1a1eb21c9caf1ad633d4bd3cb3b9c299c6a3a3
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Jun 25 19:51:20 2024 +0300

    wifi: iwlwifi: fix prototype mismatch kernel-doc warnings
    
    Fix all the prototype mismatch and "wrong kernel-doc identifier"
    warnings, due to typos in or misformatting of the kernel-doc.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20240625194805.6ec65cf9b88c.I7804114d7369f352e80a0e8430f7119af8e210de@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:15 +01:00
Jose Ignacio Tornos Martinez d2f9842d36 wifi: iwlwifi: mvm: remove stale STA link data during restart
JIRA: https://issues.redhat.com/browse/RHEL-50013

commit cc3ba78f202de9752aceb16342ab62bdfbffac7e
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Mon May 13 13:27:08 2024 +0300

    wifi: iwlwifi: mvm: remove stale STA link data during restart
    
    If pre-recovery mac80211 tried to disable a link but this disablement
    failed, then there might be a mismatch between mac80211 assuming the
    link has been disabled and the driver still having the data around.
    During recover itself, that is not a problem, but should the link be
    activated again at a later point, iwlwifi will refuse the activation as
    it detects the inconsistent state.
    
    Solve this corner-case by iterating the station in the restart cleanup
    handler.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240513132416.d2fd60338055.I840d4fdce5fd49fe69896d928b071067e3730259@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:26 +01:00
Jose Ignacio Tornos Martinez 90fd2d852a wifi: iwlwifi: mvm: Activate EMLSR based on traffic volume
JIRA: https://issues.redhat.com/browse/RHEL-50013

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

    wifi: iwlwifi: mvm: Activate EMLSR based on traffic volume
    
    Adjust EMLSR activation to account for traffic levels. By
    tracking the number of RX/TX MPDUs, EMLSR will be activated only when
    traffic volume meets the required threshold.
    
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240505091420.9480f99ac8fc.If9eb946e929a39e10fe5f4638bc8bc3f8976edf1@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 23cb421b39 wifi: iwlwifi: mvm: Add support for removing responder TKs
JIRA: https://issues.redhat.com/browse/RHEL-34696

commit 619a900f279800876e425ce4ef41c4e493bdf7d4
Author: Ilan Peer <ilan.peer@intel.com>
Date:   Wed Jan 31 23:08:16 2024 +0200

    wifi: iwlwifi: mvm: Add support for removing responder TKs
    
    When removing a PASN station, the TK must be removed before
    the station is removed as otherwise the FW would assert.
    
    To handle this, store the key configuration, and use it to remove
    the key when the station is removed.
    
    Signed-off-by: Ilan Peer <ilan.peer@intel.com>
    Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240131230734.3e6364730c04.Ia76dc4a9d399f1f68ac6b157d844b63f74d5159f@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 d710d5995a wifi: iwlwifi: mvm: ensure offloading TID queue exists
JIRA: https://issues.redhat.com/browse/RHEL-28754

commit 78f65fbf421a61894c14a1b91fe2fb4437b3fe5f
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Sun Feb 18 19:51:47 2024 +0200

    wifi: iwlwifi: mvm: ensure offloading TID queue exists
    
    The resume code path assumes that the TX queue for the offloading TID
    has been configured. At resume time it then tries to sync the write
    pointer as it may have been updated by the firmware.
    
    In the unusual event that no packets have been send on TID 0, the queue
    will not have been allocated and this causes a crash. Fix this by
    ensuring the queue exist at suspend time.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://msgid.link/20240218194912.6632e6dc7b35.Ie6e6a7488c9c7d4529f13d48f752b5439d8ac3c4@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-03-18 17:58:19 +01:00
Jose Ignacio Tornos Martinez 88222825d2 wifi: iwlwifi: mvm: simplify the reorder buffer
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit ff8e3a40d78bc414213b2724ad775adf98780a5a
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Tue Oct 17 12:16:47 2023 +0300

    wifi: iwlwifi: mvm: simplify the reorder buffer
    
    The firmware / hardware of devices supporting RSS is able to report
    duplicates and packets that time out inside the reoder buffer. We can
    now remove all the complex logic that was implemented to keep all the Rx
    queues more the less synchronized: we used to send a message to all the
    queues through the firmware to teach the different queues about what is
    the current SSN every 2048 packets.
    
    Now that we rely on the firmware / hardware to detect duplicates, we can
    completely remove the code that did that in the driver and it has been
    reported that this code was spuriously dropping legit packets.
    
    Suggested-by: Sultan Alsawaf <sultan@kerneltoast.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/20231017115047.54cf4d3d5956.Ic06a08c9fb1e1ec315a4b49d632b78b8474dab79@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 0e357e0b75 wifi: iwlwifi: mvm: fix kernel-doc
JIRA: https://issues.redhat.com/browse/RHEL-19746

commit e110bf0c826663fd5afa7fb94207c5127044537b
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Aug 30 11:30:58 2023 +0300

    wifi: iwlwifi: mvm: fix kernel-doc
    
    Fix kernel-doc, adding various documentation, but in some
    cases (notably rate scaling) just removing the erroneous
    comment format.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230830112059.4ce1159b51ab.I2021ae335f6b8e50ee2c1c78a79c5eac1c1aa103@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
2024-02-01 15:28:58 +01:00
Jose Ignacio Tornos Martinez e654669a9b wifi: iwlwifi: make debugfs entries link specific
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 3f244876ef73c8ef5eaeb8f01768a2bf33c4421e
Author: Benjamin Berg <benjamin.berg@intel.com>
Date:   Mon Jun 12 18:51:02 2023 +0300

    wifi: iwlwifi: make debugfs entries link specific
    
    All of the station elements are really elements for the link. Create
    them from the correct callback and return the link specific information
    rather than always using the default link.
    
    Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230612184434.a8e0c40d325e.I374d9433c3b8694667e1ce550d65f6f1f0d23c05@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:28 +01:00
Jose Ignacio Tornos Martinez f0a8ca0a97 wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit fa53608b525fa8d32770783f4f9e59eafd905cc4
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Wed May 24 20:42:06 2023 +0300

    wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
    
    In the following notifications and commands mac_id was replaced
    with link_id:
    * CANCEL_CHANNEL_SWITCH_CMD
    * CHANNEL_SWITCH_START_NOTIF
    * CHANNEL_SWITCH_ERROR_NOTIF
    
    The logic around was not changed, so only adjust handling
    mac/link id.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230524203151.6aa6e394f5fe.Ie9e78918511ca901f9f3966d774fa74a71a186e3@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
Jose Ignacio Tornos Martinez 3e2bf5e465 wifi: iwlwifi: mvm: support PASN for MLO
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit 0945f9762ec3766186a179f7ccd001a3e160e3a0
Author: Avraham Stern <avraham.stern@intel.com>
Date:   Wed May 24 20:42:02 2023 +0300

    wifi: iwlwifi: mvm: support PASN for MLO
    
    When adding a PASN station, the non MLD API was used. This results
    in assert when operating as MLD. Fix it to use the MLD API when
    operating as MLD. For now, the default link is used for the added
    station.
    
    Signed-off-by: Avraham Stern <avraham.stern@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230524203151.7c35dccc8a12.I7bc78cd16d7c750f42fdd60e07e839a860d279d2@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
Jose Ignacio Tornos Martinez 253c7e2fea wifi: iwlwifi: mvm: make internal callback structs const
JIRA: https://issues.redhat.com/browse/RHEL-2907

commit a2906ea60a141e23d9ed635e6306d295d37427e8
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed May 24 20:42:00 2023 +0300

    wifi: iwlwifi: mvm: make internal callback structs const
    
    There's no need for these to be writable, so they can
    be const (and static).
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230524203151.c41eb6687868.I2dac1158e5723187bda1973aa49fde8a794621c8@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
Íñigo Huguet 7fe2cac4e0 wifi: iwlwifi: mvm: remove RS rate init update argument
Bugzilla: https://bugzilla.redhat.com/2196821

commit 15d4183425a6282bd673b6cdd198ec9335503e62
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Mon Apr 17 11:41:29 2023 +0300

    wifi: iwlwifi: mvm: remove RS rate init update argument
    
    Track instead whether or not the station was authorized, that's
    clearer than trying to indicate in the code whether or not the
    full bandwidth should be used via an 'update' argument.
    
    While at it, give rs_fw_rate_init() the iwl_mvm_ prefix.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230417113648.92bd8d36e311.I1877a109104d5ffeaaad6a623e89f0c44decc38e@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:16:16 +02:00
Íñigo Huguet 84d3c2be6d wifi: iwlwifi: mvm: factor out iwl_mvm_sta_fw_id_mask()
Bugzilla: https://bugzilla.redhat.com/2196821

commit 66a588bff29e61345df6d281c56d9864b84eb8cc
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Apr 16 15:47:30 2023 +0300

    wifi: iwlwifi: mvm: factor out iwl_mvm_sta_fw_id_mask()
    
    We are going to need this in more places than just the
    key code, so factor out the functionality of getting
    the FW station ID mask (filtered to a specific link if
    needed) to a separate function that can now be called
    both under RCU and mvm->mutex protection.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230416154301.eff92b93025d.I2c50290a0537d5db3d3460f4d57c78a4712ffb75@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:55 +02:00
Íñigo Huguet 9f28da45cc wifi: iwlwifi: mvm: correctly use link in iwl_mvm_sta_del()
Bugzilla: https://bugzilla.redhat.com/2196821

commit a6ef8a88fc38cc1bf5c440be73fe520d04301424
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Mar 29 10:05:40 2023 +0300

    wifi: iwlwifi: mvm: correctly use link in iwl_mvm_sta_del()
    
    This function can be invoked for both MLO and non-MLO, so
    it must deal with multi-link correctly. Notable, on auth
    timeout, we'd otherwise get a warning due to the erroneous
    deflink usage in MLO cases.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230329100040.b85f6052d51a.Iedfef4b4c4f3ca557aebc0093fdc3f5cfb49b507@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:22 +02:00
Íñigo Huguet ed55272d0d wifi: iwlwifi: mvm: move max_agg_bufsize into host TLC lq_sta
Bugzilla: https://bugzilla.redhat.com/2196821

commit 59c2d94bba838b61733186e490d4febaec8e93a6
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Wed Mar 29 10:05:36 2023 +0300

    wifi: iwlwifi: mvm: move max_agg_bufsize into host TLC lq_sta
    
    This field is used only for host TLC, so it can reside inside
    the corresponding lq_sta struct. Also, TLC lq_sta is cleared
    in iwl_mvm_rs_rate_init() upon association, but max_agg_bufsize
    is set earlier in iwl_mvm_sta_init(). Thus, place this field
    in the persistent part of lq_sta to retain its value.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230329100040.d55361064e39.Ib79d30f27d94607d097f0192af2aacd455a17958@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:21 +02:00
Íñigo Huguet 7f2dc614f5 wifi: iwlwifi: mvm: fix station link data leak
Bugzilla: https://bugzilla.redhat.com/2196821

commit 881d054896f700ca80b3bb2e5ad0b93631bf0113
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed Mar 29 10:05:30 2023 +0300

    wifi: iwlwifi: mvm: fix station link data leak
    
    When we remove the station, we call iwl_mvm_sta_del() which
    returns true if we cannot remove it from the firmware yet,
    which happens if this is the station ID for the AP station
    that's still used because the MAC is still associated.
    
    However, we still must free the link data as the station is
    only kept alive in the firmware, in mac80211 and driver the
    data structures are destroyed.
    
    To fix that, we need to make iwl_mvm_mld_free_sta_link()
    track whether or not the station is still alive in FW, as
    otherwise we might reuse the station ID in the meantime and
    iwl_mvm_mld_rm_sta_from_fw() would reject the later delete
    from the firmware. Add an argument to it for that. Then we
    can use the return value of iwl_mvm_sta_del() for that to
    fix the issue, and call iwl_mvm_mld_rm_sta_from_fw() only
    if we need to not keep the station in FW.
    
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230329100039.1d81d4c71f35.I8fc60ac28ffc1147e9b1250e5e6237b3cb5516ac@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:19 +02:00
Íñigo Huguet 0b25c57463 wifi: iwlwifi: mvm: implement mac80211 callback change_sta_links
Bugzilla: https://bugzilla.redhat.com/2196821

commit 6e4198d35c2e7e107328866c183e14d2b17c740b
Author: Shaul Triebitz <shaul.triebitz@intel.com>
Date:   Wed Mar 29 10:05:18 2023 +0300

    wifi: iwlwifi: mvm: implement mac80211 callback change_sta_links
    
    Add/removed from iwl driver and firmware station links.
    Update the station queues accordingly (which station links
    are connected to the station queues).
    
    Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230329100039.156d1aae5de1.I32973141be1190222169879f8caf7038c1a8f769@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:16 +02:00
Íñigo Huguet b0c1fd6924 wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()
Bugzilla: https://bugzilla.redhat.com/2196821

commit 57974a55d995468a9a476e24693eb741c649b25f
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Tue Mar 28 10:59:09 2023 +0300

    wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()
    
    Move code handling specific state transitions into separate handlers
    and adjust them for MLO. Adjust relevant callbacks as well.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230328104949.5a3f8a849723.I0670d20436858a1cd3c055e03c7528db81292811@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:13 +02:00
Íñigo Huguet 79008de56a wifi: iwlwifi: mvm: adjust internal stations to MLO
Bugzilla: https://bugzilla.redhat.com/2196821

commit 62e0ccb2170e7a20d62d38f781f90a8ef031c450
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Tue Mar 28 10:59:05 2023 +0300

    wifi: iwlwifi: mvm: adjust internal stations to MLO
    
    Internal stations are mcast/bcast and sniffer. They need some link
    specific data like bss id/phy id. Add link_conf as a parameter.
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230328104949.25b013fd30de.I7f9f5906123acae05040cceec470c9acb07b9d42@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:12 +02:00
Íñigo Huguet 434a40595c wifi: iwlwifi: mvm: unite sta_modify_disable_tx flows
Bugzilla: https://bugzilla.redhat.com/2196821

commit 56f4f12ba8f6d8cb52f776dfcd261f2e1040d38c
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 28 10:58:48 2023 +0300

    wifi: iwlwifi: mvm: unite sta_modify_disable_tx flows
    
    These flows are the same in both MLD API and the current API,
    except for the commands that are being sent during this flows.
    Instead of checking each time before calling these floews
    what API we use and then call the correct function, call always the old
    one, which in turn will call the new one in case we're using the MLD
    API.
    
    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/20230328104948.5692d8dea9be.Ib1882b2c2f0b0603abc4b7d4a0ecc45cd1fbf9a7@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:09 +02:00
Íñigo Huguet 73dd2be9df wifi: iwlwifi: mvm: add cancel/remain_on_channel for MLD mode
Bugzilla: https://bugzilla.redhat.com/2196821

commit fe8b2ad361fb92f4b2b7b003c4609a2a7ed1fbda
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 28 10:58:47 2023 +0300

    wifi: iwlwifi: mvm: add cancel/remain_on_channel for MLD mode
    
    Add an MLD version of the remain_on_channel and
    cancel_remain_on_channel callbacks.
    
    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/20230328104948.b51813dbebd4.Ia25bbd63d3138e4759237ce2be0cd0436fe01c0a@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:08 +02:00
Íñigo Huguet cd042acb16 wifi: iwlwifi: mvm: add some new MLD ops
Bugzilla: https://bugzilla.redhat.com/2196821

commit 660eba5af0ddf80f04efd970a63958d23c4d1052
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 28 10:58:45 2023 +0300

    wifi: iwlwifi: mvm: add some new MLD ops
    
    Add MLD version of bss_info_changed/switch_vif_chanctx/
    config_iface_filter and conf_tx() callbacks.
    
    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/20230328104948.9c83c253d610.Ibf2006be9ece87896c17cb43dfe3654ac73d81ff@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:08 +02:00
Íñigo Huguet 38b6ee1587 wifi: iwlwifi: mvm: add sta handling flows for MLD mode
Bugzilla: https://bugzilla.redhat.com/2196821

commit 87f7e2435cb7ddafbc644b759aa1a9dffaab1515
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 28 10:58:44 2023 +0300

    wifi: iwlwifi: mvm: add sta handling flows for MLD mode
    
    In MLD mode we have a new STA cmd. As a result, it is also changes
    the flows of adding/updating/removing and handling state of
    a station. Add these flows.
    
    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/20230328104948.b5548cfd8fe3.I70f9c8f3c95e18d5c9af0a5681e0830893509531@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:08 +02:00
Íñigo Huguet b57a5bcd1e wifi: iwlwifi: mvm: sta preparation for MLO
Bugzilla: https://bugzilla.redhat.com/2196821

commit c8ee33e184e4163586cc6c786d5c14dcdf6f4e07
Author: Gregory Greenman <gregory.greenman@intel.com>
Date:   Tue Mar 28 10:58:42 2023 +0300

    wifi: iwlwifi: mvm: sta preparation for MLO
    
    Split iwl_mvm_sta into general and link specific parts. As a first
    step, all link dependent parameters reside in deflink.
    
    The change was done mostly using the spatch below with some manual
    adjustments.
    
    @iwl_mvm_sta@
    struct iwl_mvm_sta *s;
    identifier var = {sta_id, lq_sta, avg_energy};
    @@
    
    (
      s->
    -    var
    +    deflink.var
    )
    
    Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
    Link: https://lore.kernel.org/r/20230328104948.34eace06d583.I1f8c5e919a71b21030460fbdd220d42401b688b1@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:15:07 +02:00
Íñigo Huguet 53e8fe6a38 wifi: iwlwifi: mvm: refactor iwl_mvm_sta
Bugzilla: https://bugzilla.redhat.com/2196821

commit 2ce1c07a8a54213d60acef267688b1c3a75f2f97
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon Mar 20 12:33:13 2023 +0200

    wifi: iwlwifi: mvm: refactor iwl_mvm_sta
    
    As the new MLD API is introduced, we have a new enumeration
    for the different station types. Since struct iwl_mvm_sta's
    sta_type field will be in use for both new and old API,
    change its type to a unified one, so it can hold both.
    
    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/20230320122330.c8b86d8ddd3e.I9581235860b91654b4f6c3a8797c777702690998@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:14:57 +02:00
Íñigo Huguet 00cc47ba0b wifi: iwlwifi: mvm: add start_ap() and join_ibss() callbacks for MLD mode
Bugzilla: https://bugzilla.redhat.com/2196821

commit f947b62c03b15d14349668384bb365aabe898650
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Mon Mar 20 12:33:09 2023 +0200

    wifi: iwlwifi: mvm: add start_ap() and join_ibss() callbacks for MLD mode
    
    This is another patch in the series adding all the ops
    for the new MLD ieee80211_ops.
    The callbacks added here use the new MLD FW API
    
    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/20230320122330.3eb485c359fc.I28be198ea9389083d5a01f68c92763722613ba9b@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:14:56 +02:00
Íñigo Huguet 4006b75255 wifi: iwlwifi: mvm: add an unassign_vif_chanctx() callback for MLD mode
Bugzilla: https://bugzilla.redhat.com/2196821

commit 6f71e90e65e9bb5d5e12199e19670bb4973a6e39
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 14 19:49:26 2023 +0200

    wifi: iwlwifi: mvm: add an unassign_vif_chanctx() callback for MLD mode
    
    This is another patch in the series adding all the ops
    for the new MLD ieee80211_ops.
    The callback added here uses the new MLD FW API
    
    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/20230314194113.5d4bcd384425.I263eef3aad8efe23a597843fe7c56924038c8fdc@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:14:50 +02:00
Íñigo Huguet 59f77ba109 wifi: iwlwifi: mvm: Add a remove_interface() callback for mld mode
Bugzilla: https://bugzilla.redhat.com/2196821

commit 60efeca1c6a75d7f518c963fa4f3694dcfc1147e
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 14 19:49:22 2023 +0200

    wifi: iwlwifi: mvm: Add a remove_interface() callback for mld mode
    
    As the MLD mode and its new APIs are introduced,
    we've decided to add a new ieee80211_ops dedicated for
    MLD callbacks. Add the MLD remove_interface() callback
    which uses the new MLD APIs.
    
    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/20230314194113.b87c5c0a4b6b.I631173a73d6ffd7232aa539ea8b356a222fac398@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:14:49 +02:00
Íñigo Huguet 28389a2a93 wifi: iwlwifi: mvm: add support for the new STA related commands
Bugzilla: https://bugzilla.redhat.com/2196821

commit 006c152ac9e56ac7871efa995854c3ff8cf6915a
Author: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Date:   Tue Mar 14 19:49:20 2023 +0200

    wifi: iwlwifi: mvm: add support for the new STA related commands
    
    As a part of the new MLD FW API changes, we have new commands for STA
    related operations (add/remove/aux/disable tx).
    Add structures and enum definitions, along with part of the functions
    that sends this commands.
    This functions will be in used and more will be added in the next patches.
    
    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/20230314194113.132873ce015c.I7b12a77e5be066730762e6ceeeaa7190293c3df1@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2023-07-26 13:14:48 +02:00
Íñigo Huguet 1d66275465 iwlwifi: mvm: offload channel switch timing to FW
Bugzilla: https://bugzilla.redhat.com/2059999

commit ad12b23131242714c814de8a3ba4e099674ab6a9
Author: Nathan Errera <nathan.errera@intel.com>
Date:   Fri Jan 28 15:34:21 2022 +0200

    iwlwifi: mvm: offload channel switch timing to FW
    
    Since FW is now in charge of timing the channel switch, there is no need
    to send the add/modify/remove time event command to fw with every (e)CSA
    element.
    However, the driver needs to cancel the channel switch if the CS start
    notification arrives and it does not know about an ongoing channel switch.
    
    Signed-off-by: Nathan Errera <nathan.errera@intel.com>
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Link: https://lore.kernel.org/r/iwlwifi.20220128153013.ac3af0ff22c7.Ie87c62047b71b93b12aa80b5dc5391b4798dbe97@changeid
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2022-05-31 14:50:46 +02:00
Íñigo Huguet e9d3c8f3db iwlwifi: integrate with iwlmei
Bugzilla: https://bugzilla.redhat.com/2059999

Conflicts: minor content conflicts due to later commits already backported
  5283dd677e52a iwlwifi: mvm: retry init flow if failed
  f5cecf1d4c5ff iwlwifi: fix warnings produced by kernel debug options

commit 6d19a5eba5cda26310f83f5ea87eef54e68afc34
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Fri Nov 12 08:28:12 2021 +0200

    iwlwifi: integrate with iwlmei
    
    iwlmei needs to know about the follwing events:
    
    * Association
    * De-association
    * Country Code change
    * SW Rfkill change
    * SAR table changes
    
    iwlmei can take the device away from us, so report the new
    rfkill type when this happens.
    Advertise the required data from the CSME firmware to the
    usersapce: mostly, the AP that the CSME firmware is currently
    associated to in case there is an active link protection
    session.
    Generate the HOST_ASSOC / HOST_DISSASSOC messages.
    
    Don't support WPA1 (non-RSNA) for now.
    Don't support shared wep either.
    We can then determine the AUTH parameter by checking the AKM.
    Feed the cipher from the key installation.
    
    SW Rfkill will be implemented later when cfg80211 will
    allow us to read the SW Rfkill state.
    
    Co-Developed-by: Ayala Beker <ayala.beker@intel.com>
    Signed-off-by: Ayala Beker <ayala.beker@intel.com>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    
    v7: Ayala added her signed-off
        remove pointless function declaration
        fix a bug due to merge conflict in the HOST_ASSOC message
    v8: leave a print if we have a SAP connection on a device we do
        not support (yet)
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211112062814.7502-4-emmanuel.grumbach@intel.com

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
2022-05-31 14:49:38 +02:00
Johannes Berg 5e1688ce91 iwlwifi: mvm: clean up queue sync implementation
When we do queue sync, it's confusing that we have the structures
declared in the FW API header files that aren't really firmware,
and the union is also confusing - especially now in the code that
checks the size on the return.

So rework this: change the type of sync and whether to do it in a
synchronous fashion to arguments, and build the data structure in
the function, so we don't need the union.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.f62833fd9893.I612d7ac1c655ec4880329360e15d207698c750bc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-04-14 12:07:16 +03:00
Johannes Berg 8e99ea8d09 iwlwifi: use SPDX tags
Use SPDX tags instead of the long copyright notices.  Also cleanup
some duplicate copyright notices and combine the years where possible.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-12-10 00:15:31 +02:00
Nathan Errera 2c2c3647cd iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12
ADD_STA_CMD_API_S ver 12 was added in order to properly support
auxiliary activities in CDB NICs. In the new version we don't need
to allocate an aux station at initialization, instead we add an
aux station only when an auxiliary activity that requires a dedicated Tx
queue is needed. For now the only case we need this kind of activity is
when using hot spot 2.0

Signed-off-by: Nathan Errera <nathan.errera@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008180656.700e6e2e3077.Icdd807b6a3ad3fed806449ea0a13f856aa20e632@changeid
2020-10-08 20:09:37 +03:00
Nathan Errera be9ae34ead iwlwifi: mvm: get number of stations from TLV
FW is changing the max number of supported stations. To adapt to the
change we get the max number from the TLV and act according to the new
number.

Signed-off-by: Nathan Errera <nathan.errera@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008180656.863ab470babc.I393223392f36436663c4e66add03fefe77b74e60@changeid
2020-10-08 20:09:25 +03:00
Avraham Stern be82ecd3a5 iwlwifi: mvm: add an option to add PASN station
A FTM responder may do PASN authentication with unassociated stations
to allow secure ranging. In this case, the driver will add an internal
station and install the TK so the FW will accept protected FTM
request frames from this station and will send a protected FTM
response frame.

In addition, the driver needs to configure the HLTK to the FW so
the FW can derive the secure LTF bits. This is left for a later
patch since it is not yet supported by the FW.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200911204056.c915b44ad7dd.I72ef7f9753964555561c27ec503241105eddb14e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-01 21:53:04 +03:00
Sharon f327236df2 iwlwifi: mvm: fix aux station leak
When mvm is initialized we alloc aux station with aux queue.
We later free the station memory when driver is stopped, but we
never free the queue's memory, which casues a leak.

Add a proper de-initialization of the station.

Signed-off-by: Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200529092401.0121c5be55e9.Id7516fbb3482131d0c9dfb51ff20b226617ddb49@changeid
2020-05-29 10:32:37 +03:00
Gregory Greenman f5d88fa334 iwlwifi: mvm: replace RS mutex with a spin_lock
The solution with the worker still had a bug, as in order
to get sta, rcu_read_lock should be used and thus no mutex
can be used inside iwl_mvm_rs_rate_init.

Also, spin_lock is a simpler solution, no need to spawn a
dedicated worker.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30 18:34:24 +02:00
Emmanuel Grumbach c61b655a88 iwlwifi: mvm: add a new RSS sync notification for NSSN sync
We will soon be using a new notification that will be
initiated by the driver, sent to the firmware and sent
back to all the RSS queues by the firmware. This new
notification will be useful to synchronize the NSSN across
all the queues.

For now, don't send the notification, just add the code to
handle it. Later patch will add the code to actually send
it.

While at it, validate the baid coming from the firmware to
avoid accessing an array with a bad index in the driver.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30 18:34:12 +02:00
Emmanuel Grumbach 6b2dbce549 iwlwifi: mvm: prepare the ground for more RSS notifications
We will need a new type of synchronization message going
through all the RSS queues. Prepare the ground for this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30 18:34:12 +02:00
Mordechay Goodstein 0f8084cdc1 iwlwifi: mvm: avoid races in rate init and rate perform
Rate perform uses the lq_sta table to calculate the next rate to scale
while rate init resets the same table,

Rate perform is done in soft irq context in parallel to rate init
that can be called in case we are doing changes like AP changes BW
or moving state for auth to assoc.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30 18:34:10 +02:00
Mordechay Goodstein af2984e9e6 iwlwifi: mvm: add a debugfs entry to set a fixed size AMSDU for all TX packets
The current debugfs entry only limits the max AMSDU for TCP.  Add a new
debugfs entry to allow setting a fixed AMSDU size for all TX packets,
including UDP and ICMP

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29 10:08:06 +03:00
Johannes Berg 475c6bde72 iwlwifi: mvm: fix TX crypto on 22560+ devices
In the old days, we could transmit with HW crypto with an arbitrary
key by filling it into TX_CMD. This was broken first with the advent
of CCMP/GCMP-256 keys which don't fit there.

This was broken *again* with the newer TX_CMD format on 22560+,
where we simply cannot pass key material anymore. However, we forgot
to update all the cases when we get a key from mac80211 and don't
program it into the hardware but still return 0 for HW crypto on TX.

In AP mode with WEP, we tried to fix this by programming the keys
separately for each station later, but this ultimately turns out to
be buggy, for example now it leaks memory when we have more than one
WEP key.

Fix this by simply using only SW crypto for WEP in newer devices by
returning -EOPNOTSUPP instead of trying to program WEP keys later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22 12:49:03 +02:00
Emmanuel Grumbach 28916a165a iwlwifi: mvm: fix AP mode in WEP
Recently we started to send the WEP keys to the firmware so
that we could use hardware Tx encryption also on newer
devices that require the keys to be installed in the firmware
for encryption (as opposed to older devices that can get
the key in the Tx command for each Tx).

When we implemented that, we forgot to remove the key when
we remove a station leading to a situation where a station
that connects and disconnects a lot of times exhausts the
key database inside the firmware.

A fix was made for that, but we always removed the same
key: mvmvif->ap_wep_key which means that we removed the
same key entry in the firmware. This can make sense since
in WEP, the key is the same for all the stations, but the
internal implementation of iwl_mvm_set_sta_key and
iwl_mvm_remove_sta_key assumes that each station uses a
different key in the firmware's key database.

So now we got to the situation where we have a single
ieee80211_key_conf instance that means, a single
ieee80211_key_conf.hw_key_idx index for several stations
and hence for several keys.
ieee80211_key_conf.hw_key_idx is set to 0 when the first
station associates, and then it is overwritten to 1 when
the second station associates which is a buggy of course.
This led to the following message upon the removal of the
second station:

iwlwifi 0000:00:03.0: offset 1 not used in fw key table.
WARNING: CPU: 2 PID: 27883 at net/mac80211/sta_info.c:1122 __sta_info_destroy_part2+0x16b/0x180 [mac80211]
RIP: 0010:__sta_info_destroy_part2+0x16b/0x180 [mac80211]
 Call Trace:
  __sta_info_destroy+0x2a/0x40 [mac80211]
  sta_info_destroy_addr_bss+0x38/0x60 [mac80211]
  ieee80211_del_station+0x1d/0x30 [mac80211]
  nl80211_del_station+0xe0/0x1f0 [cfg80211]

Fix this by copying the ieee80211_key_conf structure for
each and every station. This is the easiest way to properly
remove the keys with the right index. Another solution
would have been to allow several stations to use the same
key offset in the firmware. That would require to change
the way we track keys in iwlmvm and not really worth it.

Also, maintain correctly fw_key_table when we add a key
for the multicast station.
Remove the key when we remove the multicast station.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: 337bfc9881 ("iwlwifi: mvm: set wep key for all stations in soft ap mode")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04 12:27:20 +02:00
Sara Sharon cfbc6c4c5b iwlwifi: mvm: support mac80211 TXQs model
Move to use the new mac80211 TXQs implementation. This has
quite a few benefits for us. We can get rid of the awkward
mapping of DQA to mac80211 queues. We can stop buffering
traffic while waiting for the queue to be allocated. We can
also use mac80211 AMSDUs instead of building it ourselves.

The usage is pretty simple:
Each ieee80211_txq contains iwl_mvm_txq. There is such a
queue for each TID, and one for management frames. We keep
having static AP queues for probes and non-bufferable MMPDUs,
along with broadcast and multicast queues. Those are being
used from the "old" TX invocation path - iwl_mvm_mac_tx.

When there is a new frame in a TXQ, iwl_mvm_mac_wake_tx is
being called, and either invokes the TX path, or allocates
the queue if it does not exist.

Most of the TX path is left untouched, although we can consider
cleaning it up some more, for example get rid of the duplication
of txq_id in both iwl_mvm_txq and iwl_mvm_dqa_txq_info.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Avraham Stern 0dde2440a7 iwlwifi: mvm: toggle tx antenna if tx fails during connection establishment
If tx fails during connection establishment, try another antenna for
the next tx. This will increase the chance to establish connection if
one of the antennas is blocked.  Note that the antenna is toggled even
when failing to tx data frames since connection establishment may use
EAPOLs for 802.1X authentication/ 4 way handshake.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-11 11:06:18 +02:00
Johannes Berg 724fe7710a iwlwifi: mvm: kill INACTIVE queue state
We don't really need this state: instead of having an inactive
state where we can awaken zombie queues again if needed, just
keep them in their normal state unless a new queue is actually
needed and there's no other way of getting one.

We do this here by making the inactivity check not free queues
unless instructed that we now really need to allocate one to a
specific station, and in that case it'll just free the queue
immediately, without doing any inactivity step inbetween.

The only downside is a little bit more processing in this case,
but the code complexity is lower.

Additionally, this fixes a corner case: due to the way the code
worked, we could only ever reuse an inactive queue if it was
the reserved queue for a station, as iwl_mvm_find_free_queue()
would never consider returning an inactive queue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-08 10:49:22 +03:00
Johannes Berg 6fe64d034e iwlwifi: mvm: make iwl_mvm_scd_queue_redirect() static
This function is only used in the file where it's declared,
so just make it static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-08 10:48:55 +03:00