]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: iwlwiif: mvm: handle the new BT notif
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 29 Jul 2024 17:20:15 +0000 (20:20 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:15:14 +0000 (10:15 +0200)
Iterate all the links and check if any action must be taken.
The new notification impacts only the esr decision.

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.00cfc07879c6.I8491483fda3b5888ea6ffa10fbd17807e443f943@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/coex.c

index 0bfe250c3bc82f106a3d93c3471f0b1d32fa8449..b607961970e97024d29685adff4c77771f3b6e80 100644 (file)
@@ -525,6 +525,35 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
                iwl_mvm_bt_notif_per_link(mvm, vif, data, link_id);
 }
 
+/* must be called under rcu_read_lock */
+static void iwl_mvm_bt_coex_notif_iterator(void *_data, u8 *mac,
+                                          struct ieee80211_vif *vif)
+{
+       struct iwl_mvm *mvm = _data;
+
+       lockdep_assert_held(&mvm->mutex);
+
+       if (vif->type != NL80211_IFTYPE_STATION)
+               return;
+
+       for (int link_id = 0;
+            link_id < IEEE80211_MLD_MAX_NUM_LINKS;
+            link_id++) {
+               struct ieee80211_bss_conf *link_conf =
+                       rcu_dereference_check(vif->link_conf[link_id],
+                                             lockdep_is_held(&mvm->mutex));
+               struct ieee80211_chanctx_conf *chanctx_conf =
+                       rcu_dereference_check(link_conf->chanctx_conf,
+                                             lockdep_is_held(&mvm->mutex));
+
+               if ((!chanctx_conf ||
+                    chanctx_conf->def.chan->band != NL80211_BAND_2GHZ))
+                       continue;
+
+               iwl_mvm_bt_coex_update_link_esr(mvm, vif, link_id);
+       }
+}
+
 static void iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm)
 {
        struct iwl_bt_iterator_data data = {
@@ -634,9 +663,14 @@ void iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm,
        const struct iwl_rx_packet *pkt = rxb_addr(rxb);
        const struct iwl_bt_coex_profile_notif *notif = (const void *)pkt->data;
 
+       lockdep_assert_held(&mvm->mutex);
+
        mvm->last_bt_wifi_loss = *notif;
 
-       /* TODO: Iterate over vifs / links to take that into account */
+       ieee80211_iterate_active_interfaces(mvm->hw,
+                                           IEEE80211_IFACE_ITER_NORMAL,
+                                           iwl_mvm_bt_coex_notif_iterator,
+                                           mvm);
 }
 
 void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,