diff mbox

iw: Fix calculation of maximum supported 802.11n data rate

Message ID 1418203400-6451-1-git-send-email-hrogge@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Henning Rogge Dec. 10, 2014, 9:23 a.m. UTC
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(-)

Comments

Johannes Berg Dec. 12, 2014, 11:07 a.m. UTC | #1
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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Henning Rogge Dec. 12, 2014, 1:22 p.m. UTC | #2
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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;