Commit a76d5e0a authored by Johannes Berg's avatar Johannes Berg

mac80211: mesh: move fail_avg into mesh struct

This value is only used in mesh, so move it into the new mesh
sub-struct of the station info.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f9a060f4
...@@ -308,8 +308,9 @@ void ieee80211s_update_metric(struct ieee80211_local *local, ...@@ -308,8 +308,9 @@ void ieee80211s_update_metric(struct ieee80211_local *local,
failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK); failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK);
/* moving average, scaled to 100 */ /* moving average, scaled to 100 */
sta->fail_avg = ((80 * sta->fail_avg + 5) / 100 + 20 * failed); sta->mesh->fail_avg =
if (sta->fail_avg > 95) ((80 * sta->mesh->fail_avg + 5) / 100 + 20 * failed);
if (sta->mesh->fail_avg > 95)
mesh_plink_broken(sta); mesh_plink_broken(sta);
} }
...@@ -325,7 +326,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local, ...@@ -325,7 +326,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local,
u32 tx_time, estimated_retx; u32 tx_time, estimated_retx;
u64 result; u64 result;
if (sta->fail_avg >= 100) if (sta->mesh->fail_avg >= 100)
return MAX_METRIC; return MAX_METRIC;
sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo); sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo);
...@@ -333,7 +334,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local, ...@@ -333,7 +334,7 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local,
if (WARN_ON(!rate)) if (WARN_ON(!rate))
return MAX_METRIC; return MAX_METRIC;
err = (sta->fail_avg << ARITH_SHIFT) / 100; err = (sta->mesh->fail_avg << ARITH_SHIFT) / 100;
/* bitrate is in units of 100 Kbps, while we need rate in units of /* bitrate is in units of 100 Kbps, while we need rate in units of
* 1Mbps. This will be corrected on tx_time computation. * 1Mbps. This will be corrected on tx_time computation.
......
...@@ -290,6 +290,7 @@ struct ieee80211_fast_tx { ...@@ -290,6 +290,7 @@ struct ieee80211_fast_tx {
* @nonpeer_pm: STA power save mode towards non-peer neighbors * @nonpeer_pm: STA power save mode towards non-peer neighbors
* @processed_beacon: set to true after peer rates and capabilities are * @processed_beacon: set to true after peer rates and capabilities are
* processed * processed
* @fail_avg: moving percentage of failed MSDUs
*/ */
struct mesh_sta { struct mesh_sta {
struct timer_list plink_timer; struct timer_list plink_timer;
...@@ -312,6 +313,9 @@ struct mesh_sta { ...@@ -312,6 +313,9 @@ struct mesh_sta {
enum nl80211_mesh_power_mode local_pm; enum nl80211_mesh_power_mode local_pm;
enum nl80211_mesh_power_mode peer_pm; enum nl80211_mesh_power_mode peer_pm;
enum nl80211_mesh_power_mode nonpeer_pm; enum nl80211_mesh_power_mode nonpeer_pm;
/* moving percentage of failed MSDUs */
unsigned int fail_avg;
}; };
/** /**
...@@ -369,7 +373,6 @@ struct mesh_sta { ...@@ -369,7 +373,6 @@ struct mesh_sta {
* @tx_filtered_count: number of frames the hardware filtered for this STA * @tx_filtered_count: number of frames the hardware filtered for this STA
* @tx_retry_failed: number of frames that failed retry * @tx_retry_failed: number of frames that failed retry
* @tx_retry_count: total number of retries for frames to this STA * @tx_retry_count: total number of retries for frames to this STA
* @fail_avg: moving percentage of failed MSDUs
* @tx_packets: number of RX/TX MSDUs * @tx_packets: number of RX/TX MSDUs
* @tx_bytes: number of bytes transmitted to this STA * @tx_bytes: number of bytes transmitted to this STA
* @tid_seq: per-TID sequence numbers for sending to this STA * @tid_seq: per-TID sequence numbers for sending to this STA
...@@ -470,8 +473,6 @@ struct sta_info { ...@@ -470,8 +473,6 @@ struct sta_info {
/* Updated from TX status path only, no locking requirements */ /* Updated from TX status path only, no locking requirements */
unsigned long tx_filtered_count; unsigned long tx_filtered_count;
unsigned long tx_retry_failed, tx_retry_count; unsigned long tx_retry_failed, tx_retry_count;
/* moving percentage of failed MSDUs */
unsigned int fail_avg;
/* Updated from TX path only, no locking requirements */ /* Updated from TX path only, no locking requirements */
u64 tx_packets[IEEE80211_NUM_ACS]; u64 tx_packets[IEEE80211_NUM_ACS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment