Merge tag 'afs-fixes-20220802' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowe...
[linux-2.6-microblaze.git] / net / mac80211 / mesh_hwmp.c
index 45e7c1b..9b1ce7c 100644 (file)
@@ -310,7 +310,12 @@ void ieee80211s_update_metric(struct ieee80211_local *local,
                        LINK_FAIL_THRESH)
                mesh_plink_broken(sta);
 
-       sta_set_rate_info_tx(sta, &sta->deflink.tx_stats.last_rate, &rinfo);
+       /* use rate info set by the driver directly if present */
+       if (st->n_rates)
+               rinfo = sta->deflink.tx_stats.last_rate_info;
+       else
+               sta_set_rate_info_tx(sta, &sta->deflink.tx_stats.last_rate, &rinfo);
+
        ewma_mesh_tx_rate_avg_add(&sta->mesh->tx_rate_avg,
                                  cfg80211_calculate_bitrate(&rinfo));
 }
@@ -927,7 +932,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
 
        baselen = (u8 *) mgmt->u.action.u.mesh_action.variable - (u8 *) mgmt;
        elems = ieee802_11_parse_elems(mgmt->u.action.u.mesh_action.variable,
-                                      len - baselen, false, mgmt->bssid, NULL);
+                                      len - baselen, false, NULL);
        if (!elems)
                return;