mac80211: move station statistics into sub-structs
Group station statistics by where they're (mostly) updated (TX, RX and TX-status) and group them into sub-structs of the struct sta_info. Also rename the variables since the grouping now makes it obvious where they belong. This makes it easier to identify where the statistics are updated in the code, and thus easier to think about them. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -60,7 +60,9 @@ static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata,
|
||||
{
|
||||
s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold;
|
||||
return rssi_threshold == 0 ||
|
||||
(sta && (s8) -ewma_signal_read(&sta->avg_signal) > rssi_threshold);
|
||||
(sta &&
|
||||
(s8)-ewma_signal_read(&sta->rx_stats.avg_signal) >
|
||||
rssi_threshold);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,7 +392,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
|
||||
rates = ieee80211_sta_get_rates(sdata, elems, band, &basic_rates);
|
||||
|
||||
spin_lock_bh(&sta->mesh->plink_lock);
|
||||
sta->last_rx = jiffies;
|
||||
sta->rx_stats.last_rx = jiffies;
|
||||
|
||||
/* rates and capabilities don't change during peering */
|
||||
if (sta->mesh->plink_state == NL80211_PLINK_ESTAB &&
|
||||
|
Reference in New Issue
Block a user