Julian Calaby wrote: > On Tue, Aug 25, 2009 at 04:51, Arnd > Hannemann<hannemann@xxxxxxxxxxxxxxxxxxx> wrote: >> An integer overflow in the minstrel debug code prevented the >> throughput to be displayed correctly. This patch fixes that, >> by permutating operations like proposed by Pavel Roskin. >> >> Signed-off-by: Arnd Hannemann <hannemann@xxxxxxxxxxxxxxxxxxx> >> --- >> net/mac80211/rc80211_minstrel_debugfs.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/net/mac80211/rc80211_minstrel_debugfs.c b/net/mac80211/rc80211_minstrel_debugfs.c >> index 98f4807..3d72ec5 100644 >> --- a/net/mac80211/rc80211_minstrel_debugfs.c >> +++ b/net/mac80211/rc80211_minstrel_debugfs.c >> @@ -83,7 +83,7 @@ minstrel_stats_open(struct inode *inode, struct file *file) >> p += sprintf(p, "%3u%s", mr->bitrate / 2, >> (mr->bitrate & 1 ? ".5" : " ")); >> >> - tp = ((mr->cur_tp * 96) / 18000) >> 10; >> + tp = mr->cur_tp / ((18000 << 10) / 96); > > Sorry about being so late, but wouldn't: > > tp = ((mr->cur_tp * 2) / 375) >> 10; > > also work? (Assuming that the numbers in the constant aren't important) I needed a while to figure out why those constants are used, but finally they made some sense, so I think its best to preserve them. mr->cur_tp is the time to send one 1200 byte packet (9600 bits), the loss probelity is scaled between 0-18000 to reduce rounding error. > > or even: > > tp = (mr->cur_tp / 375) >> 9; See above. Best regards, Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html