]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mac80211: backport API change for sta rate control update
authorFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 11:40:50 +0000 (12:40 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 11 Apr 2025 08:41:12 +0000 (10:41 +0200)
Helps stay in sync with mt76 upstream development

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 files changed:
package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch [deleted file]
package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch
package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
package/kernel/mac80211/patches/ath11k/923-wifi-ath11k-update-hif_and-pci_ops-for-QCN6122.patch
package/kernel/mac80211/patches/ath11k/924-wifi-ath11k-add-multipd-support-for-QCN6122.patch
package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch
package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch
package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch [new file with mode: 0644]
package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch
package/kernel/mt76/patches/100-api_update.patch [new file with mode: 0644]

diff --git a/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch b/package/kernel/ath10k-ct/patches/003-ath10k-ct-make-it-compatible-with-the-old-LTS-kernel.patch
deleted file mode 100644 (file)
index 632a419..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Shiji Yang <yangshiji66@outlook.com>
-Date: Fri, 28 Mar 2025 19:56:06 +0800
-Subject: [PATCH] ath10k-ct: make it compatible with the old LTS kernel
-
-Rollback some APIs to fix compilation errors.
-
-Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
----
- ath10k-6.14/ahb.c | 2 +-
- ath10k-6.14/mac.c | 5 ++---
- 2 files changed, 3 insertions(+), 4 deletions(-)
-
---- a/ath10k-6.14/ahb.c
-+++ b/ath10k-6.14/ahb.c
-@@ -842,7 +842,7 @@ static struct platform_driver ath10k_ahb
-               .of_match_table = ath10k_ahb_of_match,
-       },
-       .probe = ath10k_ahb_probe,
--      .remove = ath10k_ahb_remove,
-+      .remove_new = ath10k_ahb_remove,
- };
- int ath10k_ahb_init(void)
---- a/ath10k-6.14/mac.c
-+++ b/ath10k-6.14/mac.c
-@@ -9607,10 +9607,9 @@ exit:
- static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
-                                struct ieee80211_vif *vif,
--                               struct ieee80211_link_sta *link_sta,
-+                               struct ieee80211_sta *sta,
-                                u32 changed)
- {
--      struct ieee80211_sta *sta = link_sta->sta;
-       struct ath10k *ar = hw->priv;
-       struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
-       struct ath10k_vif *arvif = (void *)vif->drv_priv;
-@@ -10603,7 +10602,7 @@ static const struct ieee80211_ops ath10k
-       .reconfig_complete              = ath10k_reconfig_complete,
-       .get_survey                     = ath10k_get_survey,
-       .set_bitrate_mask               = ath10k_mac_op_set_bitrate_mask,
--      .link_sta_rc_update             = ath10k_sta_rc_update,
-+      .sta_rc_update                  = ath10k_sta_rc_update,
-       .offset_tsf                     = ath10k_offset_tsf,
-       .get_tsf                        = ath10k_get_tsf,
-       .ampdu_action                   = ath10k_ampdu_action,
index b13bc3349820a5a1745d0de04d4b797dc0094330..aa953c00fb216e1dbedb947e39a197aa05d1a69c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -9919,6 +9919,21 @@ static int ath10k_mac_init_rd(struct ath
+@@ -9920,6 +9920,21 @@ static int ath10k_mac_init_rd(struct ath
        return 0;
  }
  
@@ -22,7 +22,7 @@
  int ath10k_mac_register(struct ath10k *ar)
  {
        static const u32 cipher_suites[] = {
-@@ -10281,6 +10296,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10282,6 +10297,12 @@ int ath10k_mac_register(struct ath10k *a
  
        ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
index fc41f5f151163b404a4deea737a67441ac5e3d7a..4f555d704e0b96f0d97f3f0455a6a5c0eb7abb97 100644 (file)
@@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
        if (ret)
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10297,7 +10297,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10298,7 +10298,7 @@ int ath10k_mac_register(struct ath10k *a
        ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS
index b9cdae7e1f9303d66995ee9bf689b5d6c7334ccf..d14f25104ebe0750aa46b1b0a51aa27f67d45c5b 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
 
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10089,7 +10089,6 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10090,7 +10090,6 @@ int ath10k_mac_register(struct ath10k *a
        ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
        ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
        ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
index 109daf02f239812e33ccadfc820c22eb464e8ce9..81aee57546ee4453d3934d277b3a865a713426ac 100644 (file)
@@ -41,7 +41,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
                                }
                        } else {
                                ab->qmi.target_mem[idx].paddr = 0;
-@@ -2292,6 +2296,7 @@ static int ath11k_qmi_load_file_target_m
+@@ -2295,6 +2299,7 @@ static int ath11k_qmi_load_file_target_m
        struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
        struct qmi_txn txn;
        const u8 *temp = data;
@@ -49,7 +49,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
        void __iomem *bdf_addr = NULL;
        int ret = 0;
        u32 remaining = len;
-@@ -2303,7 +2308,9 @@ static int ath11k_qmi_load_file_target_m
+@@ -2306,7 +2311,9 @@ static int ath11k_qmi_load_file_target_m
        memset(&resp, 0, sizeof(resp));
  
        if (ab->hw_params.fixed_bdf_addr) {
index 9c9caef4f220b3cf048375ccf5c8c2b83526a5d8..8497c3a8c99c9eb507408066a81a9da57ce366ce 100644 (file)
@@ -91,9 +91,9 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
  #endif /* _HIF_H_ */
 --- a/drivers/net/wireless/ath/ath11k/qmi.c
 +++ b/drivers/net/wireless/ath/ath11k/qmi.c
-@@ -2184,6 +2184,8 @@ static int ath11k_qmi_request_device_inf
-       ab->mem = bar_addr_va;
-       ab->mem_len = resp.bar_size;
+@@ -2187,6 +2187,8 @@ static int ath11k_qmi_request_device_inf
+       if (!ab->hw_params.ce_remap)
+               ab->mem_ce = ab->mem;
  
 +      ath11k_hif_config_static_window(ab);
 +
index e6170a74e42bba544f48ad51e5b2e734fb4b0e1d..5b0c58dd947717c2c6304d55d0d06786d17778e4 100644 (file)
@@ -89,7 +89,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
  /* SMBIOS type containing Board Data File Name Extension */
  #define ATH11K_SMBIOS_BDF_EXT_TYPE 0xF8
  
-@@ -945,6 +948,7 @@ struct ath11k_base {
+@@ -951,6 +954,7 @@ struct ath11k_base {
        struct list_head peers;
        wait_queue_head_t peer_mapping_wq;
        u8 mac_addr[ETH_ALEN];
index d89fb92e223c169285ef1b62bc03d00601c230a3..8cb7bd6b08b0b8cdfe9df7953c88497a51b9452e 100644 (file)
@@ -132,7 +132,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
  };
  
  /* HTT definitions */
-@@ -1712,5 +1718,6 @@ void ath11k_dp_shadow_init_timer(struct
+@@ -1689,5 +1695,6 @@ void ath11k_dp_shadow_init_timer(struct
                                 struct ath11k_hp_update_timer *update_timer,
                                 u32 interval, u32 ring_id);
  void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab);
index caa4e20f971a0c40ea8f5354396f2f887e159447..2afd7f8b0e52802dbc1bdbd2870687a79b180a4f 100644 (file)
@@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
        return ret;
  }
  
-@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12
+@@ -5995,7 +6010,7 @@ static int ath12k_mac_start(struct ath12
  
        /* TODO: Do we need to enable ANI? */
  
@@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
  
        ar->num_started_vdevs = 0;
        ar->num_created_vdevs = 0;
-@@ -6174,6 +6189,9 @@ static void ath12k_mac_stop(struct ath12
+@@ -6175,6 +6190,9 @@ static void ath12k_mac_stop(struct ath12
        cancel_delayed_work_sync(&ar->scan.timeout);
        cancel_work_sync(&ar->regd_update_work);
        cancel_work_sync(&ar->ab->rfkill_work);
@@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
  
        spin_lock_bh(&ar->data_lock);
        list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
-@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off
+@@ -6421,6 +6439,117 @@ static void ath12k_mac_op_update_vif_off
        ath12k_mac_update_vif_offload(arvif);
  }
  
@@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
  static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
  {
        struct ath12k_hw *ah = ar->ah;
-@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct
+@@ -6535,6 +6664,7 @@ static int ath12k_mac_vdev_create(struct
                                    arvif->vdev_id, ret);
                        goto err_peer_del;
                }
@@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
                break;
        case WMI_VDEV_TYPE_STA:
                param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
-@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct
+@@ -6573,6 +6703,13 @@ static int ath12k_mac_vdev_create(struct
                                    arvif->vdev_id, ret);
                        goto err_peer_del;
                }
@@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
                break;
        default:
                break;
-@@ -6912,6 +7049,11 @@ static void ath12k_mac_op_remove_interfa
+@@ -6913,6 +7050,11 @@ static void ath12k_mac_op_remove_interfa
        ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
                   arvif->vdev_id);
  
@@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
        if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
                ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
                if (ret)
-@@ -7752,6 +7894,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
+@@ -7753,6 +7895,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
            ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
                ath12k_mac_monitor_stop(ar);
  
@@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
        mutex_unlock(&ar->conf_mutex);
  }
  
-@@ -8290,6 +8440,14 @@ ath12k_mac_op_reconfig_complete(struct i
+@@ -8291,6 +8441,14 @@ ath12k_mac_op_reconfig_complete(struct i
                ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
                            ar->pdev->pdev_id);
  
@@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
                if (ab->is_reset) {
                        recovery_count = atomic_inc_return(&ab->recovery_count);
  
-@@ -9339,6 +9497,9 @@ static void ath12k_mac_setup(struct ath1
+@@ -9340,6 +9498,9 @@ static void ath12k_mac_setup(struct ath1
  
        INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
        skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
diff --git a/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch b/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch
new file mode 100644 (file)
index 0000000..0ccdfb9
--- /dev/null
@@ -0,0 +1,548 @@
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Mon, 7 Oct 2024 15:00:54 +0300
+Subject: [PATCH] wifi: mac80211: call rate_control_rate_update() for link STA
+
+In order to update the right link information, call the update
+rate_control_rate_update() with the right link_sta, and then
+pass that through to the driver's sta_rc_update() method. The
+software rate control still doesn't support it, but that'll be
+skipped by not having a rate control ref.
+
+Since it now operates on a link sta, rename the driver method.
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
+Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+
+--- a/drivers/net/wireless/ath/ath10k/mac.c
++++ b/drivers/net/wireless/ath/ath10k/mac.c
+@@ -8507,9 +8507,10 @@ exit:
+ static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+-                               struct ieee80211_sta *sta,
++                               struct ieee80211_link_sta *link_sta,
+                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct ath10k *ar = hw->priv;
+       struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
+       struct ath10k_vif *arvif = (void *)vif->drv_priv;
+@@ -9450,7 +9451,7 @@ static const struct ieee80211_ops ath10k
+       .reconfig_complete              = ath10k_reconfig_complete,
+       .get_survey                     = ath10k_get_survey,
+       .set_bitrate_mask               = ath10k_mac_op_set_bitrate_mask,
+-      .sta_rc_update                  = ath10k_sta_rc_update,
++      .link_sta_rc_update             = ath10k_sta_rc_update,
+       .offset_tsf                     = ath10k_offset_tsf,
+       .ampdu_action                   = ath10k_ampdu_action,
+       .get_et_sset_count              = ath10k_debug_get_et_sset_count,
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -5079,9 +5079,10 @@ static void ath11k_mac_op_sta_set_4addr(
+ static void ath11k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
+                                       struct ieee80211_vif *vif,
+-                                      struct ieee80211_sta *sta,
++                                      struct ieee80211_link_sta *link_sta,
+                                       u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct ath11k *ar = hw->priv;
+       struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
+       struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+@@ -9708,7 +9709,7 @@ static const struct ieee80211_ops ath11k
+       .sta_state                      = ath11k_mac_op_sta_state,
+       .sta_set_4addr                  = ath11k_mac_op_sta_set_4addr,
+       .sta_set_txpwr                  = ath11k_mac_op_sta_set_txpwr,
+-      .sta_rc_update                  = ath11k_mac_op_sta_rc_update,
++      .link_sta_rc_update             = ath11k_mac_op_sta_rc_update,
+       .conf_tx                        = ath11k_mac_op_conf_tx,
+       .set_antenna                    = ath11k_mac_op_set_antenna,
+       .get_antenna                    = ath11k_mac_op_get_antenna,
+--- a/drivers/net/wireless/ath/ath12k/mac.c
++++ b/drivers/net/wireless/ath/ath12k/mac.c
+@@ -4740,9 +4740,10 @@ out:
+ static void ath12k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
+                                       struct ieee80211_vif *vif,
+-                                      struct ieee80211_sta *sta,
++                                      struct ieee80211_link_sta *link_sta,
+                                       u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct ath12k *ar;
+       struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta);
+       struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+@@ -8684,7 +8685,7 @@ static const struct ieee80211_ops ath12k
+       .set_rekey_data                 = ath12k_mac_op_set_rekey_data,
+       .sta_state                      = ath12k_mac_op_sta_state,
+       .sta_set_txpwr                  = ath12k_mac_op_sta_set_txpwr,
+-      .sta_rc_update                  = ath12k_mac_op_sta_rc_update,
++      .link_sta_rc_update             = ath12k_mac_op_sta_rc_update,
+       .conf_tx                        = ath12k_mac_op_conf_tx,
+       .set_antenna                    = ath12k_mac_op_set_antenna,
+       .get_antenna                    = ath12k_mac_op_get_antenna,
+--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
++++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+@@ -1357,8 +1357,10 @@ static int ath9k_htc_sta_remove(struct i
+ static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
+                                   struct ieee80211_vif *vif,
+-                                  struct ieee80211_sta *sta, u32 changed)
++                                  struct ieee80211_link_sta *link_sta,
++                                  u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv;
+       if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
+@@ -1883,7 +1885,7 @@ struct ieee80211_ops ath9k_htc_ops = {
+       .sta_add            = ath9k_htc_sta_add,
+       .sta_remove         = ath9k_htc_sta_remove,
+       .conf_tx            = ath9k_htc_conf_tx,
+-      .sta_rc_update      = ath9k_htc_sta_rc_update,
++      .link_sta_rc_update = ath9k_htc_sta_rc_update,
+       .bss_info_changed   = ath9k_htc_bss_info_changed,
+       .set_key            = ath9k_htc_set_key,
+       .get_tsf            = ath9k_htc_get_tsf,
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+@@ -4248,8 +4248,9 @@ int iwl_mvm_mac_set_rts_threshold(struct
+ }
+ void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+-                         struct ieee80211_sta *sta, u32 changed)
++                         struct ieee80211_link_sta *link_sta, u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+       if (changed & (IEEE80211_RC_BW_CHANGED |
+@@ -6574,7 +6575,7 @@ const struct ieee80211_ops iwl_mvm_hw_op
+       .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
+       .release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
+       .set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
+-      .sta_rc_update = iwl_mvm_sta_rc_update,
++      .link_sta_rc_update = iwl_mvm_sta_rc_update,
+       .conf_tx = iwl_mvm_mac_conf_tx,
+       .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
+       .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+@@ -1413,7 +1413,7 @@ const struct ieee80211_ops iwl_mvm_mld_h
+       .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
+       .release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
+       .set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
+-      .sta_rc_update = iwl_mvm_sta_rc_update,
++      .link_sta_rc_update = iwl_mvm_sta_rc_update,
+       .conf_tx = iwl_mvm_mld_mac_conf_tx,
+       .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
+       .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+@@ -2914,7 +2914,7 @@ iwl_mvm_mac_release_buffered_frames(stru
+                                   bool more_data);
+ int iwl_mvm_mac_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
+ void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+-                         struct ieee80211_sta *sta, u32 changed);
++                         struct ieee80211_link_sta *link_sta, u32 changed);
+ void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw,
+                               struct ieee80211_vif *vif,
+                               struct ieee80211_prep_tx_info *info);
+--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+@@ -1163,9 +1163,10 @@ static void mt7915_sta_rc_work(void *dat
+ static void mt7915_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+-                               struct ieee80211_sta *sta,
++                               struct ieee80211_link_sta *link_sta,
+                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct mt7915_phy *phy = mt7915_hw_phy(hw);
+       struct mt7915_dev *dev = phy->dev;
+       struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
+@@ -1709,7 +1710,7 @@ const struct ieee80211_ops mt7915_ops =
+       .stop_ap = mt7915_stop_ap,
+       .sta_state = mt76_sta_state,
+       .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
+-      .sta_rc_update = mt7915_sta_rc_update,
++      .link_sta_rc_update = mt7915_sta_rc_update,
+       .set_key = mt7915_set_key,
+       .ampdu_action = mt7915_ampdu_action,
+       .set_rts_threshold = mt7915_set_rts_threshold,
+--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
+@@ -1060,9 +1060,10 @@ static void mt7996_sta_rc_work(void *dat
+ static void mt7996_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+-                               struct ieee80211_sta *sta,
++                               struct ieee80211_link_sta *link_sta,
+                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct mt7996_phy *phy = mt7996_hw_phy(hw);
+       struct mt7996_dev *dev = phy->dev;
+@@ -1472,7 +1473,7 @@ const struct ieee80211_ops mt7996_ops =
+       .sta_add = mt7996_sta_add,
+       .sta_remove = mt7996_sta_remove,
+       .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
+-      .sta_rc_update = mt7996_sta_rc_update,
++      .link_sta_rc_update = mt7996_sta_rc_update,
+       .set_key = mt7996_set_key,
+       .ampdu_action = mt7996_ampdu_action,
+       .set_rts_threshold = mt7996_set_rts_threshold,
+--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
++++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
+@@ -928,8 +928,10 @@ static int rtw_ops_set_sar_specs(struct
+ static void rtw_ops_sta_rc_update(struct ieee80211_hw *hw,
+                                 struct ieee80211_vif *vif,
+-                                struct ieee80211_sta *sta, u32 changed)
++                                struct ieee80211_link_sta *link_sta,
++                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct rtw_dev *rtwdev = hw->priv;
+       struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
+@@ -973,7 +975,7 @@ const struct ieee80211_ops rtw_ops = {
+       .reconfig_complete      = rtw_reconfig_complete,
+       .hw_scan                = rtw_ops_hw_scan,
+       .cancel_hw_scan         = rtw_ops_cancel_hw_scan,
+-      .sta_rc_update          = rtw_ops_sta_rc_update,
++      .link_sta_rc_update     = rtw_ops_sta_rc_update,
+       .set_sar_specs          = rtw_ops_set_sar_specs,
+ #ifdef CONFIG_PM
+       .suspend                = rtw_ops_suspend,
+--- a/drivers/net/wireless/realtek/rtw89/mac80211.c
++++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
+@@ -1290,8 +1290,10 @@ out:
+ static void rtw89_ops_sta_rc_update(struct ieee80211_hw *hw,
+                                   struct ieee80211_vif *vif,
+-                                  struct ieee80211_sta *sta, u32 changed)
++                                  struct ieee80211_link_sta *link_sta,
++                                  u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct rtw89_dev *rtwdev = hw->priv;
+       rtw89_phy_ra_update_sta(rtwdev, sta, changed);
+@@ -1594,7 +1596,7 @@ const struct ieee80211_ops rtw89_ops = {
+       .remain_on_channel              = rtw89_ops_remain_on_channel,
+       .cancel_remain_on_channel       = rtw89_ops_cancel_remain_on_channel,
+       .set_sar_specs          = rtw89_ops_set_sar_specs,
+-      .sta_rc_update          = rtw89_ops_sta_rc_update,
++      .link_sta_rc_update     = rtw89_ops_sta_rc_update,
+       .set_tid_config         = rtw89_ops_set_tid_config,
+ #ifdef CONFIG_PM
+       .suspend                = rtw89_ops_suspend,
+--- a/drivers/net/wireless/ti/wlcore/main.c
++++ b/drivers/net/wireless/ti/wlcore/main.c
+@@ -5789,9 +5789,10 @@ static int wlcore_op_cancel_remain_on_ch
+ static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw,
+                                   struct ieee80211_vif *vif,
+-                                  struct ieee80211_sta *sta,
++                                  struct ieee80211_link_sta *link_sta,
+                                   u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
+       wl1271_debug(DEBUG_MAC80211, "mac80211 sta_rc_update");
+@@ -6052,7 +6053,7 @@ static const struct ieee80211_ops wl1271
+       .assign_vif_chanctx = wlcore_op_assign_vif_chanctx,
+       .unassign_vif_chanctx = wlcore_op_unassign_vif_chanctx,
+       .switch_vif_chanctx = wlcore_op_switch_vif_chanctx,
+-      .sta_rc_update = wlcore_op_sta_rc_update,
++      .link_sta_rc_update = wlcore_op_sta_rc_update,
+       .sta_statistics = wlcore_op_sta_statistics,
+       .get_expected_throughput = wlcore_op_get_expected_throughput,
+       CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
+--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
++++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
+@@ -2594,10 +2594,11 @@ static void mac80211_hwsim_link_info_cha
+ static void
+ mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif,
+-                           struct ieee80211_sta *sta,
++                           struct ieee80211_link_sta *link_sta,
+                            u32 changed)
+ {
+       struct mac80211_hwsim_data *data = hw->priv;
++      struct ieee80211_sta *sta = link_sta->sta;
+       u32 bw = U32_MAX;
+       int link_id;
+@@ -2607,7 +2608,6 @@ mac80211_hwsim_sta_rc_update(struct ieee
+            link_id++) {
+               enum nl80211_chan_width confbw = NL80211_CHAN_WIDTH_20_NOHT;
+               struct ieee80211_bss_conf *vif_conf;
+-              struct ieee80211_link_sta *link_sta;
+               link_sta = rcu_dereference(sta->link[link_id]);
+@@ -2659,7 +2659,7 @@ static int mac80211_hwsim_sta_add(struct
+       hwsim_check_magic(vif);
+       hwsim_set_sta_magic(sta);
+-      mac80211_hwsim_sta_rc_update(hw, vif, sta, 0);
++      mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0);
+       if (sta->valid_links) {
+               WARN(hweight16(sta->valid_links) > 1,
+@@ -3961,7 +3961,7 @@ out:
+       .link_info_changed = mac80211_hwsim_link_info_changed,  \
+       .tx_last_beacon = mac80211_hwsim_tx_last_beacon,        \
+       .sta_notify = mac80211_hwsim_sta_notify,                \
+-      .sta_rc_update = mac80211_hwsim_sta_rc_update,          \
++      .link_sta_rc_update = mac80211_hwsim_sta_rc_update,     \
+       .conf_tx = mac80211_hwsim_conf_tx,                      \
+       .get_survey = mac80211_hwsim_get_survey,                \
+       CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)      \
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -4075,8 +4075,8 @@ struct ieee80211_prep_tx_info {
+  *    in @sta_state.
+  *    The callback can sleep.
+  *
+- * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
+- *    used to transmit to the station. The changes are advertised with bits
++ * @link_sta_rc_update: Notifies the driver of changes to the bitrates that can
++ *    be used to transmit to the station. The changes are advertised with bits
+  *    from &enum ieee80211_rate_control_changed and the values are reflected
+  *    in the station data. This callback should only be used when the driver
+  *    uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since
+@@ -4560,10 +4560,10 @@ struct ieee80211_ops {
+       void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
+                                  struct ieee80211_vif *vif,
+                                  struct ieee80211_sta *sta);
+-      void (*sta_rc_update)(struct ieee80211_hw *hw,
+-                            struct ieee80211_vif *vif,
+-                            struct ieee80211_sta *sta,
+-                            u32 changed);
++      void (*link_sta_rc_update)(struct ieee80211_hw *hw,
++                                 struct ieee80211_vif *vif,
++                                 struct ieee80211_link_sta *link_sta,
++                                 u32 changed);
+       void (*sta_rate_tbl_update)(struct ieee80211_hw *hw,
+                                   struct ieee80211_vif *vif,
+                                   struct ieee80211_sta *sta);
+--- a/net/mac80211/chan.c
++++ b/net/mac80211/chan.c
+@@ -467,7 +467,7 @@ static void ieee80211_chan_bw_change(str
+                               continue;
+                       link_sta->pub->bandwidth = new_sta_bw;
+-                      rate_control_rate_update(local, sband, sta, link_id,
++                      rate_control_rate_update(local, sband, link_sta,
+                                                IEEE80211_RC_BW_CHANGED);
+               }
+       }
+--- a/net/mac80211/driver-ops.c
++++ b/net/mac80211/driver-ops.c
+@@ -181,9 +181,10 @@ int drv_sta_set_txpwr(struct ieee80211_l
+       return ret;
+ }
+-void drv_sta_rc_update(struct ieee80211_local *local,
+-                     struct ieee80211_sub_if_data *sdata,
+-                     struct ieee80211_sta *sta, u32 changed)
++void drv_link_sta_rc_update(struct ieee80211_local *local,
++                          struct ieee80211_sub_if_data *sdata,
++                          struct ieee80211_link_sta *link_sta,
++                          u32 changed)
+ {
+       sdata = get_bss_sdata(sdata);
+       if (!check_sdata_in_driver(sdata))
+@@ -193,10 +194,10 @@ void drv_sta_rc_update(struct ieee80211_
+               (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
+                sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
+-      trace_drv_sta_rc_update(local, sdata, sta, changed);
+-      if (local->ops->sta_rc_update)
+-              local->ops->sta_rc_update(&local->hw, &sdata->vif,
+-                                        sta, changed);
++      trace_drv_link_sta_rc_update(local, sdata, link_sta, changed);
++      if (local->ops->link_sta_rc_update)
++              local->ops->link_sta_rc_update(&local->hw, &sdata->vif,
++                                             link_sta, changed);
+       trace_drv_return_void(local);
+ }
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -594,9 +594,9 @@ int drv_sta_set_txpwr(struct ieee80211_l
+                     struct ieee80211_sub_if_data *sdata,
+                     struct sta_info *sta);
+-void drv_sta_rc_update(struct ieee80211_local *local,
+-                     struct ieee80211_sub_if_data *sdata,
+-                     struct ieee80211_sta *sta, u32 changed);
++void drv_link_sta_rc_update(struct ieee80211_local *local,
++                          struct ieee80211_sub_if_data *sdata,
++                          struct ieee80211_link_sta *link_sta, u32 changed);
+ static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
+                                          struct ieee80211_sub_if_data *sdata,
+--- a/net/mac80211/ibss.c
++++ b/net/mac80211/ibss.c
+@@ -1072,7 +1072,8 @@ static void ieee80211_update_sta_info(st
+               if (sta->sta.deflink.rx_nss != rx_nss)
+                       changed |= IEEE80211_RC_NSS_CHANGED;
+-              drv_sta_rc_update(local, sdata, &sta->sta, changed);
++              drv_link_sta_rc_update(local, sdata, &sta->sta.deflink,
++                                     changed);
+       }
+       rcu_read_unlock();
+--- a/net/mac80211/mesh_plink.c
++++ b/net/mac80211/mesh_plink.c
+@@ -489,7 +489,7 @@ static void mesh_sta_info_init(struct ie
+       if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
+               rate_control_rate_init(sta);
+       else
+-              rate_control_rate_update(local, sband, sta, 0, changed);
++              rate_control_rate_update(local, sband, &sta->deflink, changed);
+ out:
+       spin_unlock_bh(&sta->mesh->plink_lock);
+ }
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -93,16 +93,15 @@ void rate_control_tx_status(struct ieee8
+ void rate_control_rate_update(struct ieee80211_local *local,
+                             struct ieee80211_supported_band *sband,
+-                            struct sta_info *sta, unsigned int link_id,
++                            struct link_sta_info *link_sta,
+                             u32 changed)
+ {
+       struct rate_control_ref *ref = local->rate_ctrl;
++      struct sta_info *sta = link_sta->sta;
+       struct ieee80211_sta *ista = &sta->sta;
+       void *priv_sta = sta->rate_ctrl_priv;
+       struct ieee80211_chanctx_conf *chanctx_conf;
+-      WARN_ON(link_id != 0);
+-
+       if (ref && ref->ops->rate_update) {
+               rcu_read_lock();
+@@ -120,7 +119,8 @@ void rate_control_rate_update(struct iee
+       }
+       if (sta->uploaded)
+-              drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
++              drv_link_sta_rc_update(local, sta->sdata, link_sta->pub,
++                                     changed);
+ }
+ int ieee80211_rate_control_register(const struct rate_control_ops *ops)
+--- a/net/mac80211/rate.h
++++ b/net/mac80211/rate.h
+@@ -32,8 +32,7 @@ void rate_control_tx_status(struct ieee8
+ void rate_control_rate_init(struct sta_info *sta);
+ void rate_control_rate_update(struct ieee80211_local *local,
+                             struct ieee80211_supported_band *sband,
+-                            struct sta_info *sta,
+-                            unsigned int link_id,
++                            struct link_sta_info *link_sta,
+                             u32 changed);
+ static inline void *rate_control_alloc_sta(struct rate_control_ref *ref,
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -3568,7 +3568,7 @@ ieee80211_rx_h_action(struct ieee80211_r
+                       sband = rx->local->hw.wiphy->bands[status->band];
+-                      rate_control_rate_update(local, sband, rx->sta, 0,
++                      rate_control_rate_update(local, sband, rx->link_sta,
+                                                IEEE80211_RC_SMPS_CHANGED);
+                       cfg80211_sta_opmode_change_notify(sdata->dev,
+                                                         rx->sta->addr,
+@@ -3605,7 +3605,7 @@ ieee80211_rx_h_action(struct ieee80211_r
+                               ieee80211_sta_rx_bw_to_chan_width(rx->link_sta);
+                       sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED;
+-                      rate_control_rate_update(local, sband, rx->sta, 0,
++                      rate_control_rate_update(local, sband, rx->link_sta,
+                                                IEEE80211_RC_BW_CHANGED);
+                       cfg80211_sta_opmode_change_notify(sdata->dev,
+                                                         rx->sta->addr,
+--- a/net/mac80211/tdls.c
++++ b/net/mac80211/tdls.c
+@@ -1342,7 +1342,8 @@ static void iee80211_tdls_recalc_chanctx
+                       bw = min(bw, ieee80211_sta_cap_rx_bw(&sta->deflink));
+                       if (bw != sta->sta.deflink.bandwidth) {
+                               sta->sta.deflink.bandwidth = bw;
+-                              rate_control_rate_update(local, sband, sta, 0,
++                              rate_control_rate_update(local, sband,
++                                                       &sta->deflink,
+                                                        IEEE80211_RC_BW_CHANGED);
+                               /*
+                                * if a TDLS peer BW was updated, we need to
+--- a/net/mac80211/trace.h
++++ b/net/mac80211/trace.h
+@@ -945,31 +945,34 @@ TRACE_EVENT(drv_sta_set_txpwr,
+       )
+ );
+-TRACE_EVENT(drv_sta_rc_update,
++TRACE_EVENT(drv_link_sta_rc_update,
+       TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata,
+-               struct ieee80211_sta *sta,
++               struct ieee80211_link_sta *link_sta,
+                u32 changed),
+-      TP_ARGS(local, sdata, sta, changed),
++      TP_ARGS(local, sdata, link_sta, changed),
+       TP_STRUCT__entry(
+               LOCAL_ENTRY
+               VIF_ENTRY
+               STA_ENTRY
+               __field(u32, changed)
++              __field(u32, link_id)
+       ),
+       TP_fast_assign(
+               LOCAL_ASSIGN;
+               VIF_ASSIGN;
+-              STA_ASSIGN;
++              STA_NAMED_ASSIGN(link_sta->sta);
+               __entry->changed = changed;
++              __entry->link_id = link_sta->link_id;
+       ),
+       TP_printk(
+-              LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " changed: 0x%x",
+-              LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
++              LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " (link %d) changed: 0x%x",
++              LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->link_id,
++              __entry->changed
+       )
+ );
+--- a/net/mac80211/vht.c
++++ b/net/mac80211/vht.c
+@@ -766,8 +766,7 @@ void ieee80211_vht_handle_opmode(struct
+       if (changed > 0) {
+               ieee80211_recalc_min_chandef(sdata, link_sta->link_id);
+-              rate_control_rate_update(local, sband, link_sta->sta,
+-                                       link_sta->link_id, changed);
++              rate_control_rate_update(local, sband, link_sta, changed);
+       }
+ }
index ef8a36a9af7ae53cc899daf6dcb28dc01a04e6fa..626f2facaf5d51852aa8dd764eb12d8a1692b822 100644 (file)
@@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
 --- a/net/wireless/trace.h
 +++ b/net/wireless/trace.h
-@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
+@@ -1322,19 +1322,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
  );
  
  TRACE_EVENT(rdev_set_monitor_channel,
diff --git a/package/kernel/mt76/patches/100-api_update.patch b/package/kernel/mt76/patches/100-api_update.patch
new file mode 100644 (file)
index 0000000..ad3c067
--- /dev/null
@@ -0,0 +1,46 @@
+--- a/mt7915/main.c
++++ b/mt7915/main.c
+@@ -1224,9 +1224,10 @@ static void mt7915_sta_rc_work(void *dat
+ static void mt7915_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+-                               struct ieee80211_sta *sta,
++                               struct ieee80211_link_sta *link_sta,
+                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct mt7915_phy *phy = mt7915_hw_phy(hw);
+       struct mt7915_dev *dev = phy->dev;
+       struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
+@@ -1770,7 +1771,7 @@ const struct ieee80211_ops mt7915_ops =
+       .stop_ap = mt7915_stop_ap,
+       .sta_state = mt76_sta_state,
+       .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
+-      .sta_rc_update = mt7915_sta_rc_update,
++      .link_sta_rc_update = mt7915_sta_rc_update,
+       .set_key = mt7915_set_key,
+       .ampdu_action = mt7915_ampdu_action,
+       .set_rts_threshold = mt7915_set_rts_threshold,
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -1491,9 +1491,10 @@ static void mt7996_sta_rc_work(void *dat
+ static void mt7996_sta_rc_update(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
+-                               struct ieee80211_sta *sta,
++                               struct ieee80211_link_sta *link_sta,
+                                u32 changed)
+ {
++      struct ieee80211_sta *sta = link_sta->sta;
+       struct mt7996_dev *dev = mt7996_hw_dev(hw);
+       mt7996_sta_rc_work(&changed, sta);
+@@ -1938,7 +1939,7 @@ const struct ieee80211_ops mt7996_ops =
+       .link_info_changed = mt7996_link_info_changed,
+       .sta_state = mt7996_sta_state,
+       .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove,
+-      .sta_rc_update = mt7996_sta_rc_update,
++      .link_sta_rc_update = mt7996_sta_rc_update,
+       .set_key = mt7996_set_key,
+       .ampdu_action = mt7996_ampdu_action,
+       .set_rts_threshold = mt7996_set_rts_threshold,