From ee3858551ae6d044578f598f8001db5f1a9fd52e Mon Sep 17 00:00:00 2001 From: Luis Carlos Cobo Date: Sat, 23 Feb 2008 15:17:11 +0100 Subject: mac80211: mesh data structures and first mesh changes Includes integration in struct sta_info of mesh peer link elements, previously on their own mesh peer link table. Signed-off-by: Luis Carlos Cobo Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/rc80211_pid_algo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'net/mac80211/rc80211_pid_algo.c') diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index 9762803e4876..4a51647a41af 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c @@ -15,6 +15,9 @@ #include #include #include "ieee80211_rate.h" +#ifdef CONFIG_MAC80211_MESH +#include "mesh.h" +#endif #include "rc80211_pid.h" @@ -148,6 +151,9 @@ static void rate_control_pid_sample(struct rc_pid_info *pinfo, struct ieee80211_local *local, struct sta_info *sta) { +#ifdef CONFIG_MAC80211_MESH + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); +#endif struct rc_pid_sta_info *spinfo = sta->rate_ctrl_priv; struct rc_pid_rateinfo *rinfo = pinfo->rinfo; struct ieee80211_supported_band *sband; @@ -178,7 +184,14 @@ static void rate_control_pid_sample(struct rc_pid_info *pinfo, pf = spinfo->last_pf; else { pf = spinfo->tx_num_failed * 100 / spinfo->tx_num_xmit; +#ifdef CONFIG_MAC80211_MESH + if (pf == 100 && + sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) + mesh_plink_broken(sta); +#endif pf <<= RC_PID_ARITH_SHIFT; + sta->fail_avg = ((pf + (spinfo->last_pf << 3)) / 9) + >> RC_PID_ARITH_SHIFT; } spinfo->tx_num_xmit = 0; @@ -357,6 +370,7 @@ static void rate_control_pid_rate_init(void *priv, void *priv_sta, sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; sta->txrate_idx = rate_lowest_index(local, sband, sta); + sta->fail_avg = 0; } static void *rate_control_pid_alloc(struct ieee80211_local *local) -- cgit v1.2.3