linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: Re: [PATCH] iw: fix typos in MCS set parsing code
Date: Tue, 11 Aug 2009 09:20:34 +0200	[thread overview]
Message-ID: <4A811BC2.4060303@openwrt.org> (raw)
In-Reply-To: <1249973644.5903.14.camel@johannes.local>

Johannes Berg írta:
> On Tue, 2009-08-11 at 08:47 +0200, Gabor Juhos wrote:
>> The current code uses wrong binary operator for masking,
>> and the shift values for the 'tx_max_num_spatial_streams' and
>> 'tx_unequal_modulation' fields are off-by-one.
> 
>> -			tx_max_num_spatial_streams = (mcs[12] | ((1 << 3) | (1 << 4))) + 1;
>> -			tx_unequal_modulation = !!(mcs[12] & (1 << 5));
>> +			tx_max_num_spatial_streams = (mcs[12] & ((1 << 2) | (1 << 3))) + 1;
>> +			tx_unequal_modulation = !!(mcs[12] & (1 << 4));
> 
> Are you sure? The "Supported MCS Set" field is defined as a series of
> _bits_, and the bits are transmitted the other way around within each
> byte.

Yes, I'm sure. Here are the relevant definitions from <linux/ieee80211.h>:

#define IEEE80211_HT_MCS_TX_DEFINED             0x01
#define IEEE80211_HT_MCS_TX_RX_DIFF             0x02
/* value 0 == 1 stream etc */
#define IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK    0x0C
#define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT   2
#define         IEEE80211_HT_MCS_TX_MAX_STREAMS 4
#define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION  0x10

Gabor


      reply	other threads:[~2009-08-11 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11  6:47 [PATCH] iw: fix typos in MCS set parsing code Gabor Juhos
2009-08-11  6:54 ` Johannes Berg
2009-08-11  7:20   ` Gabor Juhos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A811BC2.4060303@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).