diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2008-02-23 09:17:11 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-06 15:30:41 -0500 |
commit | ee3858551ae6d044578f598f8001db5f1a9fd52e (patch) | |
tree | 5a9b61aecccb65210e29850c34801f3cfe6259a9 /net/mac80211/rc80211_pid_algo.c | |
parent | 33b64eb2b1b1759cbdafbe5c59df652f1e7c746e (diff) |
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 <luisca@cozybit.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rc80211_pid_algo.c')
-rw-r--r-- | net/mac80211/rc80211_pid_algo.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ | |||
15 | #include <linux/debugfs.h> | 15 | #include <linux/debugfs.h> |
16 | #include <net/mac80211.h> | 16 | #include <net/mac80211.h> |
17 | #include "ieee80211_rate.h" | 17 | #include "ieee80211_rate.h" |
18 | #ifdef CONFIG_MAC80211_MESH | ||
19 | #include "mesh.h" | ||
20 | #endif | ||
18 | 21 | ||
19 | #include "rc80211_pid.h" | 22 | #include "rc80211_pid.h" |
20 | 23 | ||
@@ -148,6 +151,9 @@ static void rate_control_pid_sample(struct rc_pid_info *pinfo, | |||
148 | struct ieee80211_local *local, | 151 | struct ieee80211_local *local, |
149 | struct sta_info *sta) | 152 | struct sta_info *sta) |
150 | { | 153 | { |
154 | #ifdef CONFIG_MAC80211_MESH | ||
155 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); | ||
156 | #endif | ||
151 | struct rc_pid_sta_info *spinfo = sta->rate_ctrl_priv; | 157 | struct rc_pid_sta_info *spinfo = sta->rate_ctrl_priv; |
152 | struct rc_pid_rateinfo *rinfo = pinfo->rinfo; | 158 | struct rc_pid_rateinfo *rinfo = pinfo->rinfo; |
153 | struct ieee80211_supported_band *sband; | 159 | struct ieee80211_supported_band *sband; |
@@ -178,7 +184,14 @@ static void rate_control_pid_sample(struct rc_pid_info *pinfo, | |||
178 | pf = spinfo->last_pf; | 184 | pf = spinfo->last_pf; |
179 | else { | 185 | else { |
180 | pf = spinfo->tx_num_failed * 100 / spinfo->tx_num_xmit; | 186 | pf = spinfo->tx_num_failed * 100 / spinfo->tx_num_xmit; |
187 | #ifdef CONFIG_MAC80211_MESH | ||
188 | if (pf == 100 && | ||
189 | sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) | ||
190 | mesh_plink_broken(sta); | ||
191 | #endif | ||
181 | pf <<= RC_PID_ARITH_SHIFT; | 192 | pf <<= RC_PID_ARITH_SHIFT; |
193 | sta->fail_avg = ((pf + (spinfo->last_pf << 3)) / 9) | ||
194 | >> RC_PID_ARITH_SHIFT; | ||
182 | } | 195 | } |
183 | 196 | ||
184 | spinfo->tx_num_xmit = 0; | 197 | spinfo->tx_num_xmit = 0; |
@@ -357,6 +370,7 @@ static void rate_control_pid_rate_init(void *priv, void *priv_sta, | |||
357 | 370 | ||
358 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | 371 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; |
359 | sta->txrate_idx = rate_lowest_index(local, sband, sta); | 372 | sta->txrate_idx = rate_lowest_index(local, sband, sta); |
373 | sta->fail_avg = 0; | ||
360 | } | 374 | } |
361 | 375 | ||
362 | static void *rate_control_pid_alloc(struct ieee80211_local *local) | 376 | static void *rate_control_pid_alloc(struct ieee80211_local *local) |