]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: Fix calculation of maximum supported 802.11n data rate
authorHenning Rogge <hrogge@gmail.com>
Wed, 10 Dec 2014 09:23:20 +0000 (10:23 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 12 Dec 2014 11:07:14 +0000 (12:07 +0100)
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>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
util.c

diff --git a/util.c b/util.c
index 92ce87916abc219eb08b49e2791346c1d1e3b159..7b51b23910110c2d63a816ac4a9c59f9793dbfcb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -601,7 +601,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;