From patchwork Tue Aug 11 06:47:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 40630 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7BCvQZ5007089 for ; Tue, 11 Aug 2009 12:57:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754508AbZHKM4S (ORCPT ); Tue, 11 Aug 2009 08:56:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754517AbZHKM4S (ORCPT ); Tue, 11 Aug 2009 08:56:18 -0400 Received: from phoenix3.szarvasnet.hu ([87.101.127.16]:49554 "EHLO phoenix3.szarvasnet.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbZHKM4P (ORCPT ); Tue, 11 Aug 2009 08:56:15 -0400 Received: from mail.szarvas.hu (localhost [127.0.0.1]) by phoenix3.szarvasnet.hu (Postfix) with SMTP id 5B1AD3E4003; Tue, 11 Aug 2009 08:47:31 +0200 (CEST) Received: from localhost.localdomain (catvpool-5d59a614.szarvasnet.hu [93.89.166.20]) by phoenix3.szarvasnet.hu (Postfix) with ESMTP id A8AEA178003; Tue, 11 Aug 2009 08:47:30 +0200 (CEST) From: Gabor Juhos To: Johannes Berg Cc: "linux-wireless@vger.kernel.org" , "Luis R. Rodriguez" , Gabor Juhos Subject: [PATCH] iw: fix typos in MCS set parsing code Date: Tue, 11 Aug 2009 08:47:30 +0200 Message-Id: <1249973250-9235-1-git-send-email-juhosg@openwrt.org> X-Mailer: git-send-email 1.5.3.2 X-Antivirus: avast! (VPS 090810-0, 2009.08.10), Outbound message X-Antivirus-Status: Clean X-VBMS: A151AE3D44F | phoenix3 | 127.0.0.1 | | | Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- info.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/info.c b/info.c index 2db0fc7..542745b 100644 --- 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);