From patchwork Wed Dec 10 09:23:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Rogge X-Patchwork-Id: 5467671 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B8C149F1D4 for ; Wed, 10 Dec 2014 09:23:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECE4220115 for ; Wed, 10 Dec 2014 09:23:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFEDB200E8 for ; Wed, 10 Dec 2014 09:23:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbaLJJXc (ORCPT ); Wed, 10 Dec 2014 04:23:32 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:33829 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbaLJJXb (ORCPT ); Wed, 10 Dec 2014 04:23:31 -0500 Received: by mail-wg0-f51.google.com with SMTP id x12so2994204wgg.38 for ; Wed, 10 Dec 2014 01:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Q+IWg+bMXEUOW08t51B3avQNSwN9HfhDi8ZnTrCCuKo=; b=JXkZy2La2XB/gF1PIe8DJ6dYPU9USMQxYSzixXFmFG1mbel7UYiLRIzz7qRKApPTIo 1xnrw4hGomx7/mW3QroCTEB1nsgnu92SLHwrxFqWE6o1V8InoVrsrxfkfdhl24A2AIso 69WOiWekG4YwFTOrhP/ER/jwo5ovP8kWRWMMFTcbn7b2N2W24/8YcJYQ01+HhGoV2/55 cuh/dfq54XmMd1fyPqjpmcEwYAL3MMjNDJkqX9hynIPhEPxX5U2ah4IdXlY2dCIJFG08 5Z7uD7FJjYs5lxCUFZXyz35S6civ5ispQHzulTWs2Mh5LfuSdFe8UrykHjLe69MvJkPW 4lSA== X-Received: by 10.180.103.162 with SMTP id fx2mr11311384wib.42.1418203409573; Wed, 10 Dec 2014 01:23:29 -0800 (PST) Received: from desktop.fritz.box (static-87-79-93-195.netcologne.de. [87.79.93.195]) by mx.google.com with ESMTPSA id cq4sm5041564wjc.35.2014.12.10.01.23.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 01:23:29 -0800 (PST) From: Henning Rogge To: linux-wireless@vger.kernel.org Cc: Henning Rogge , Johannes Berg , Henning Rogge Subject: [PATCH] iw: Fix calculation of maximum supported 802.11n data rate Date: Wed, 10 Dec 2014 10:23:20 +0100 Message-Id: <1418203400-6451-1-git-send-email-hrogge@gmail.com> X-Mailer: git-send-email 1.9.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix typo in calculation, binary AND combination of low byte and high byte is always zero. Signed-off-by: Henning Rogge --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;