From patchwork Wed Nov 13 17:41:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 3178941 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 9DBF69F43F for ; Wed, 13 Nov 2013 17:41:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9ED342074E for ; Wed, 13 Nov 2013 17:41:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4169820621 for ; Wed, 13 Nov 2013 17:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757277Ab3KMRla (ORCPT ); Wed, 13 Nov 2013 12:41:30 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:51107 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757180Ab3KMRla (ORCPT ); Wed, 13 Nov 2013 12:41:30 -0500 Received: by mail-we0-f175.google.com with SMTP id t60so746157wes.6 for ; Wed, 13 Nov 2013 09:41: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=9a640oETsyIEc+JxR20Ph4XYGVt817gK2zLNJRDX/cc=; b=axbiWF0NExiaoXwJafm29GdlbL6mf2TGAt3YemPs6Ma32a9F/7nZR/c9HJ4RG2US3s GuzVN58EmgaXhGdEo8JI7OOX/G/yHF6Qi1aWphfcyExN1mSwSekxH1K/6IrxnabhcijJ uo2fTYdd1B11ad9fe0r/9EBf+McdjE3Za2tdXFWSbdh4yZLYYn2Cvn3F5+wuG1MkZvPK 2Z80jSuCEZw8UZdAelhnOkWllP6ZRQnY4b1k8/OM8M3Jv+TiLnrc79ETVL9S4wuRvyXm iiMYc2/J5nmP74x3RiS7kbWcBFtJPlXN3u8BpzOoQxDWNqO9vLqCiRuJTSoRfVFatI8K T4Gg== X-Received: by 10.194.47.236 with SMTP id g12mr127640wjn.92.1384364489456; Wed, 13 Nov 2013 09:41:29 -0800 (PST) Received: from magnum.frso.rivierawaves.com (ppp-seco11pa2-46-193-143.43.wb.wifirst.net. [46.193.143.43]) by mx.google.com with ESMTPSA id e1sm57433677wij.6.2013.11.13.09.41.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Nov 2013 09:41:29 -0800 (PST) From: Karl Beldan To: Johannes Berg Cc: Felix Fietkau , linux-wireless , Karl Beldan Subject: [PATCH] mac80211: minstrel_ht: fix rates selection Date: Wed, 13 Nov 2013 18:41:00 +0100 Message-Id: <1384364460-4452-1-git-send-email-karl.beldan@gmail.com> X-Mailer: git-send-email 1.8.2 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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Karl Beldan When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0). Signed-off-by: Karl Beldan --- net/mac80211/rc80211_minstrel_ht.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 88c932e..6c173a2 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -390,7 +390,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) mg->max_prob_rate = i; if (!mi_rates_valid) { mi->max_tp_rate = mi->max_tp_rate2 = - mi->max_prob_rate = i; + mi->max_prob_rate = + group * MCS_GROUP_RATES + i; mi_rates_valid = true; } mg_rates_valid = true;