From patchwork Mon Mar 4 22:28:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 2215001 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 21AAA3FCF2 for ; Mon, 4 Mar 2013 22:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932805Ab3CDW3Q (ORCPT ); Mon, 4 Mar 2013 17:29:16 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:51957 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932169Ab3CDW3P (ORCPT ); Mon, 4 Mar 2013 17:29:15 -0500 Received: by mail-wg0-f51.google.com with SMTP id 8so4614628wgl.6 for ; Mon, 04 Mar 2013 14:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ZhVqmhEC0BlnAcld61zwWRqfdoWybO3Jwf/3G2zxSY0=; b=wc67zaEYSueMEH3caWSdEMe7oPI2d0Of9BQO9acuUImTRtN24NBiP3xB42GBQ1eIdm pIA6fcN8+nYNW2osBFxKPHnIWYkzIpea1QzHow86Q5ADrhUubPnQ1MTBM79qxYqUGHM6 e1kxg5hMdnS80tjTXGZ9egIwxLuXGCT/31Amxq+qy5/1ihkFGFibdOS6FZPk2VH2TUxp aASmfBZc6MBcMsu0CUNheWGP4yVk1sEm57NdFk+TR0X5hmXZVytMj6x+A2BYJc97sW4i 0wpxATR8+bVejKapnny+pI5ItTuI4M84IMC8jOFDiM/Prb3M07PGBdshTrmXxPrb4Phm 3ibQ== X-Received: by 10.180.94.69 with SMTP id da5mr14745459wib.30.1362436153801; Mon, 04 Mar 2013 14:29:13 -0800 (PST) Received: from localhost.localdomain (ppp-seco11pa2-46-193-135.194.wb.wifirst.net. [46.193.135.194]) by mx.google.com with ESMTPS id ex15sm17007566wid.5.2013.03.04.14.29.12 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 14:29:13 -0800 (PST) From: Karl Beldan To: Johannes Berg Cc: linux-wireless , Karl Beldan Subject: [PATCH v3 2/2] mac80211: fix the check for mcs rates masking Date: Mon, 4 Mar 2013 23:28:33 +0100 Message-Id: <1362436113-24775-2-git-send-email-karl.beldan@gmail.com> X-Mailer: git-send-email 1.7.9.dirty In-Reply-To: <1362436113-24775-1-git-send-email-karl.beldan@gmail.com> References: <1362436113-24775-1-git-send-email-karl.beldan@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Karl Beldan Currently the mcs bitrates mask rate_idx_mcs_mask is only applied when the pre-ht bitrates mask rate_idx_mask of the same band differs from the default mask. Fix it by comparing the rate_idx_mcs_mask with the driver ht caps, and update the comments accordingly. Signed-off-by: Karl Beldan --- net/mac80211/rate.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index cedc2ef..94daf34 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -455,13 +455,15 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); /* - * Try to enforce the rateidx mask the user wanted. skip this if the - * default mask (allow all rates) is used to save some processing for - * the common case. + * Try to enforce the rateidx masks the user wanted. Skip this if mask + * is the default mask (allow all rates) and mcs_mask does not differ + * from the driver ht caps to save some processing for the common case. */ mask = txrc->rate_idx_mask; mcs_mask = txrc->rate_idx_mcs_mask; - if (mask != (1 << txrc->sband->n_bitrates) - 1) { + if (mask != (1 << txrc->sband->n_bitrates) - 1 || + memcmp(txrc->sband->ht_cap.mcs.rx_mask, txrc->rate_idx_mcs_mask, + sizeof(txrc->rate_idx_mcs_mask))) { if (sta) { /* Filter out rates that the STA does not support */ mask &= sta->sta.supp_rates[info->band];