On Sun, 2008-12-07 at 19:17 +0100, Henning Rogge wrote: > + * @NL80211_RATE_INFO_LEGACY: bitrate for 802.11abg (u16, 100kbit/s) Your other patch named this _TOTAL, can you rename it to _BITRATE instead? > + if (!(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS)) { > + struct ieee80211_supported_band *sband; > + sband = sta->local->hw.wiphy->bands[sta->local->hw.conf.channel->band]; > + sinfo->txrate.legacy = sband->bitrates[sta->last_tx_rate.idx].bitrate; > + } > + else { > + sinfo->txrate.mcs = sta->last_tx_rate.idx; > + } Put the else on the same line as the closing brace, please. > --- a/net/wireless/nl80211.c > +++ b/net/wireless/nl80211.c > @@ -14,6 +14,7 @@ > #include <linux/nl80211.h> > #include <linux/rtnetlink.h> > #include <linux/netlink.h> > +#include <net/mac80211.h> > #include <net/genetlink.h> > #include <net/cfg80211.h> > #include "core.h" That has to go. And on your second patch: > +static u16 nl80211_calculate_bitrate(struct rate_info *rate) > +{ > + int modulation, streams, bitrate; > + > + if (!(rate->flags & RATE_INFO_FLAGS_MCS)) > + return rate->legacy; > + > + modulation = rate->mcs & 7; > + streams = rate->mcs >> 3; I don't think this gives correct results for MCS rates 32 through 76, does it? It should at least not calculate anything then. If we did it in userspace then programs could also actually calculate the correct rate as a float, rather than this approximation. Not that it'll matter, I guess. Doesn't anybody know how to do the actual calculation? johannes
Attachment:
signature.asc
Description: This is a digitally signed message part