linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: minstrel-ht: small clarifications
@ 2014-05-19  9:27 Johannes Berg
  2014-05-19 21:38 ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2014-05-19  9:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: Antonio Quartulli, Felix Fietkau, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Antonio and I were looking over this code and some things
didn't immediately make sense, so we came up with two small
clarifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/rc80211_minstrel_ht.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index bccaf854a309..4e916ad51a20 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -22,7 +22,7 @@
 #define MCS_NBITS (AVG_PKT_SIZE << 3)
 
 /* Number of symbols for a packet with (bps) bits per symbol */
-#define MCS_NSYMS(bps) ((MCS_NBITS + (bps) - 1) / (bps))
+#define MCS_NSYMS(bps) DIV_ROUND_UP(MCS_NBITS, (bps))
 
 /* Transmission time (nanoseconds) for a packet containing (syms) symbols */
 #define MCS_SYMBOL_TIME(sgi, syms)					\
@@ -226,8 +226,9 @@ minstrel_ht_calc_tp(struct minstrel_ht_sta *mi, int group, int rate)
 		nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
 
 	nsecs += minstrel_mcs_groups[group].duration[rate];
-	tp = 1000000 * ((prob * 1000) / nsecs);
 
+	/* prob is scaled - see MINSTREL_FRAC above */
+	tp = 1000000 * ((prob * 1000) / nsecs);
 	mr->cur_tp = MINSTREL_TRUNC(tp);
 }
 
-- 
2.0.0.rc0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: minstrel-ht: small clarifications
  2014-05-19  9:27 [PATCH] mac80211: minstrel-ht: small clarifications Johannes Berg
@ 2014-05-19 21:38 ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2014-05-19 21:38 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Antonio Quartulli, Johannes Berg

On 2014-05-19 11:27, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Antonio and I were looking over this code and some things
> didn't immediately make sense, so we came up with two small
> clarifications.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-19 21:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19  9:27 [PATCH] mac80211: minstrel-ht: small clarifications Johannes Berg
2014-05-19 21:38 ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).