From patchwork Mon Mar 4 18:27:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 2213931 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 7D1833FCF2 for ; Mon, 4 Mar 2013 18:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758256Ab3CDSaI (ORCPT ); Mon, 4 Mar 2013 13:30:08 -0500 Received: from mail-wg0-f47.google.com ([74.125.82.47]:39166 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757858Ab3CDSaG (ORCPT ); Mon, 4 Mar 2013 13:30:06 -0500 Received: by mail-wg0-f47.google.com with SMTP id dr13so4501441wgb.14 for ; Mon, 04 Mar 2013 10:30:05 -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=EY4rTcuDyhLegeldAuZ10OJCqojLRSG+MElGMI8Tmcs=; b=gZAmjHE+VlXaOjedwUQgKUfSflrhVDHigbeM1qKm3a6xx8HBAV7xK0vpdSlOmLRLvV U/nJsy3s/ZMRH6eRir+dXQJ77fdeqDJZUPKeIWKICDvo0M7gWrD4Nh1yPyawNbqFAGz0 ke/UPiq7NY4h2HjHwtkjp9kr+pup/LqxEMun3nHxS2BX0TT1WOsvy4Jc4nRCFcPB4aOp 2x5kG4VBWYe2qnVNKuyFIxqg+6ezOCxYbznxZgrFLGGbyg3MwtICpiGmlWCVf8CLfiAI tWpTFhJcPVMEKq1JVGNxsc5ny5+6n1XDdkg+Ij0d/IN0S5hFwpsknPWQxI1PgBqCmJBo FrLw== X-Received: by 10.194.87.229 with SMTP id bb5mr33793773wjb.32.1362421805572; Mon, 04 Mar 2013 10:30:05 -0800 (PST) Received: from magnum.frso.rivierawaves.com (vpn.rivierawaves.com. [91.151.119.162]) by mx.google.com with ESMTPS id fv2sm17406081wib.6.2013.03.04.10.30.04 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 10:30:04 -0800 (PST) From: Karl Beldan To: Johannes Berg Cc: linux-wireless , Karl Beldan , Karl Beldan Subject: [PATCH v2 2/2] mac80211: fix the check for mcs rates masking Date: Mon, 4 Mar 2013 19:27:15 +0100 Message-Id: <1362421635-28008-2-git-send-email-karl.beldan@gmail.com> X-Mailer: git-send-email 1.7.10.GIT In-Reply-To: <1362421635-28008-1-git-send-email-karl.beldan@gmail.com> References: <1362421635-28008-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. Signed-off-by: Karl Beldan --- net/mac80211/rate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index c1e5f25..28f1936 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];