iw: Fix calculation of maximum supported 802.11n data rate
PATCH 1/1 iw: Fix calculation of maximum supported 802.11n data rate
Fix typo in calculation, binary AND combination of low byte and high byte is always zero.
Signed-off-by Henning Rogge <[email protected]>
--- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
util.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.3
Quoted 2 lines · Henning Rogge
Fix typo in calculation, binary AND combination of low byte and high byte is always zero.
Obviously - applied, thanks.
johannes
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
Quoted 8 lines · Johannes Berg
Quoted 2 lines · Henning Rogge
Fix typo in calculation, binary AND combination of low byte and high byte is always zero.
Obviously - applied, thanks.
johannes