]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix typos in MCS set parsing code
authorGabor Juhos <juhosg@openwrt.org>
Tue, 11 Aug 2009 06:47:30 +0000 (08:47 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 11 Aug 2009 06:51:13 +0000 (08:51 +0200)
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.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
info.c

diff --git a/info.c b/info.c
index 2db0fc73500a7d7c88cbde71d19d6c632dafc3f6..542745b86398a6ffdf1058a2c1df23eb42f7036f 100644 (file)
--- a/info.c
+++ b/info.c
@@ -159,8 +159,8 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
                        max_rx_supp_data_rate = ((mcs[10] >> 8) & ((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] | ((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));
 
                        if (max_rx_supp_data_rate)
                                printf("\t\tHT Max RX data rate: %d Mbps\n", max_rx_supp_data_rate);