From patchwork Sun May 15 14:23:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Chadd X-Patchwork-Id: 9096531 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CD3E79F30C for ; Sun, 15 May 2016 14:23:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC80E202A1 for ; Sun, 15 May 2016 14:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2E3B202AE for ; Sun, 15 May 2016 14:23:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752457AbcEOOX1 (ORCPT ); Sun, 15 May 2016 10:23:27 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:33456 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbcEOOX0 (ORCPT ); Sun, 15 May 2016 10:23:26 -0400 Received: by mail-io0-f176.google.com with SMTP id f89so183197786ioi.0 for ; Sun, 15 May 2016 07:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc; bh=zWSI9zifySz9DoMtkUfYln02pBLUw8guMZQdjrnkJDQ=; b=p02JB9TAOZvDB+wyefc/lDdhMEGDiOm5YQHZb6ow6Muh4USZ5Mib8ubGgj8oZUE1Cu RVv9cIR7YgIz9bjKC7xRNOva25NrfyeInlUYUtQ+Q3UU2Fj+W+arM+GoVODAD9wlWXxv Swo8JnWUtm4jsyNwEMok+w2PqaWdyAblCd/PO8lZHv28oplCYARbvvrdWM4Jl7yiBNJs s7v2KgrlOEU3uhQGm7ReeKOJwCGC4pzU7CqdA38gG6aJ6+Bm3+i0yqiL5Q8peEJq3YMO gS0Rw66lTGqRZlEcsLPbicaDw8YAPKENNkFzxyPWIW5Y/DsqqtHnU49xMOF+EXmctyQs EX4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:cc; bh=zWSI9zifySz9DoMtkUfYln02pBLUw8guMZQdjrnkJDQ=; b=YE6MIuBTbwVMOfIge9PQTMf45c3ON0SpZ3UwXauCG9aYLabva6pLPMn0uSkEGc4rYv EY4zBukmwDZnu0HJjm7/9+mh1ClT6HwXuOgy2h9GjRdaHMc9jgSCZaUNCOPeCtgFA1cg go957gUumjtx2QnNFTDAKGaVZ+oQxbFL+Qu15k3F/mhfZrIwzWwQK2Kmt1aPF5QRpbDj alAsMp11hFDTYmuyZ+FQCR739Pdym2xEczmU0bfAJHSHdDu6RMLuhvOGQZZ0jjcD3oEp LuvNBlmDJPElBo1b3DQCLp2N6OFnxe42Yo5zOqD4nDEHJgyB6jbb47gorFjiiDExtRb7 aeZw== X-Gm-Message-State: AOPr4FUx4uqkWIsKWAldJ1Mky1PA2Q7XayNUfS8IZN5l1AeM2B4UNUt74rXxv7UWmoDZNhh4Wx7zYcYZXtSFDA== MIME-Version: 1.0 X-Received: by 10.36.83.65 with SMTP id n62mr5673549itb.71.1463322205426; Sun, 15 May 2016 07:23:25 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Sun, 15 May 2016 07:23:25 -0700 (PDT) Date: Sun, 15 May 2016 07:23:25 -0700 X-Google-Sender-Auth: xifUQ8zqsEbJKQL0oHKPFW8vxUk Message-ID: Subject: [b43] don't unconditionally fall back to CCK if the rate is 6MB OFDM. From: Adrian Chadd To: b43-dev@lists.infradead.org Cc: "linux-wireless@vger.kernel.org" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Author: Adrian Chadd Date: Sun May 15 07:15:54 2016 -0700 [b43] don't unconditionally fall back to CCK if the rate is 6MB OFDM. Check the current PHY operating mode (gmode) to see if we should fall back from 6MB OFDM to 11MB CCK. For 5GHz operation this isn't allowed. Note, the fallback lookup is only done for RTS rates; normal fallback rates are done via mac80211 and aren't affected by this change. Signed-off-by: Adrian Chadd case B43_CCK_RATE_1MB: @@ -216,8 +216,16 @@ static u8 b43_calc_fallback_rate(u8 bitrate) return B43_CCK_RATE_2MB; case B43_CCK_RATE_11MB: return B43_CCK_RATE_5MB; + + /* + * Don't just fallback to CCK; it may be in 5GHz operation + * and falling back to CCK won't work out very well. + */ case B43_OFDM_RATE_6MB: - return B43_CCK_RATE_5MB; + if (gmode) + return B43_CCK_RATE_5MB; + else + return B43_OFDM_RATE_6MB; case B43_OFDM_RATE_9MB: return B43_OFDM_RATE_6MB; case B43_OFDM_RATE_12MB: @@ -438,7 +446,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, rts_rate = rts_cts_rate ? rts_cts_rate->hw_value : B43_CCK_RATE_1MB; rts_rate_ofdm = b43_is_ofdm_rate(rts_rate); - rts_rate_fb = b43_calc_fallback_rate(rts_rate); + rts_rate_fb = b43_calc_fallback_rate(rts_rate, phy->gmode); rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb); if (rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/broadcom/b43/xmit.c b/drivers/net/wireless/broadcom/b43/xmit.c index f620126..fbf0e92 100644 --- a/drivers/net/wireless/broadcom/b43/xmit.c +++ b/drivers/net/wireless/broadcom/b43/xmit.c @@ -205,7 +205,7 @@ static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate) return control; } -static u8 b43_calc_fallback_rate(u8 bitrate) +static u8 b43_calc_fallback_rate(u8 bitrate, int gmode) { switch (bitrate) {