linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iw: Fix calculation of maximum supported 802.11n data rate
@ 2014-12-10  9:23 Henning Rogge
  2014-12-12 11:07 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Rogge @ 2014-12-10  9:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: Henning Rogge, Johannes Berg, Henning Rogge

Fix typo in calculation, binary AND combination of low byte
and high byte is always zero.

Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
---
 util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util.c b/util.c
index ce4b0ac..c61955c 100644
--- a/util.c
+++ b/util.c
@@ -594,7 +594,7 @@ void print_ht_mcs(const __u8 *mcs)
 	unsigned int tx_max_num_spatial_streams, max_rx_supp_data_rate;
 	bool tx_mcs_set_defined, tx_mcs_set_equal, tx_unequal_modulation;
 
-	max_rx_supp_data_rate = (mcs[10] & ((mcs[11] & 0x3) << 8));
+	max_rx_supp_data_rate = (mcs[10] | ((mcs[11] & 0x3) << 8));
 	tx_mcs_set_defined = !!(mcs[12] & (1 << 0));
 	tx_mcs_set_equal = !(mcs[12] & (1 << 1));
 	tx_max_num_spatial_streams = ((mcs[12] >> 2) & 3) + 1;
-- 
1.9.3


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

* Re: [PATCH] iw: Fix calculation of maximum supported 802.11n data rate
  2014-12-10  9:23 [PATCH] iw: Fix calculation of maximum supported 802.11n data rate Henning Rogge
@ 2014-12-12 11:07 ` Johannes Berg
  2014-12-12 13:22   ` Henning Rogge
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2014-12-12 11:07 UTC (permalink / raw)
  To: Henning Rogge; +Cc: linux-wireless, Henning Rogge

On Wed, 2014-12-10 at 10:23 +0100, Henning Rogge wrote:
> Fix typo in calculation, binary AND combination of low byte
> and high byte is always zero.

Obviously - applied, thanks.

johannes


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

* Re: [PATCH] iw: Fix calculation of maximum supported 802.11n data rate
  2014-12-12 11:07 ` Johannes Berg
@ 2014-12-12 13:22   ` Henning Rogge
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Rogge @ 2014-12-12 13:22 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org, Henning Rogge

Hi,

the bug was caught by Coverity (I use parts of the "iw" code in a
different project to talk to nl802.11).

Maybe it would be interesting to register the "iw" project with Coverity.

Henning

On Fri, Dec 12, 2014 at 12:07 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Wed, 2014-12-10 at 10:23 +0100, Henning Rogge wrote:
>> Fix typo in calculation, binary AND combination of low byte
>> and high byte is always zero.
>
> Obviously - applied, thanks.
>
> johannes
>

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

end of thread, other threads:[~2014-12-12 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10  9:23 [PATCH] iw: Fix calculation of maximum supported 802.11n data rate Henning Rogge
2014-12-12 11:07 ` Johannes Berg
2014-12-12 13:22   ` Henning Rogge

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).