From patchwork Thu Jul 12 08:50:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10521349 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FF46601C2 for ; Thu, 12 Jul 2018 08:50:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53D3B2968F for ; Thu, 12 Jul 2018 08:50:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 521D429695; Thu, 12 Jul 2018 08:50:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63658295E9 for ; Thu, 12 Jul 2018 08:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726584AbeGLI6u (ORCPT ); Thu, 12 Jul 2018 04:58:50 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38253 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbeGLI6u (ORCPT ); Thu, 12 Jul 2018 04:58:50 -0400 Received: by mail-wr1-f65.google.com with SMTP id m1-v6so8106161wrg.5 for ; Thu, 12 Jul 2018 01:50:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0AJCRIVhjtWluVQHWNNB1gWfTexIGxYL+vJ+dotDtNg=; b=JPYnC/qG3BGvLdb/wzeeJqv9i4y50fm1KiDTw7+a07nomdvh+gUQeYdOdKkCMOPfVH UYnyrDzxfGyyWTeh1d1sRuN5vN4BScf/Xx7zF0lVuIva7VIXB5pYQbODPJZeAv5ueQCL 6ZXpfT1CUC8S48CksNdDmA5R7QpSKEOXJTvwCN5ZceCUHfUX2AxjsZg1ohQG/PRlCF6A LxYchFv2FU6j9OUskA27fpdDc1ri2PvcqpbYxJ9g6CEL81tk9Z29w763wGmah6baEer+ hN12yFaNSzSrP7cplJU4DrHRZIE4L/y062AlzhpsHC1psuo8FQJzr+qUO3x1hx+QVhpD DYww== X-Gm-Message-State: AOUpUlF6uWbCV90iqwg0htT9hHSNCuy4vGoVaPPSvmgE+KhSM/GTGiW7 3sL4Uxkv7U2KQed3W5VlupTeN91rS+g= X-Google-Smtp-Source: AAOMgpdFPukuDTgXOBE16SJMN525/sq5qkPmtupyzlRJm611Ep8kV6WdLhmK3oBZ8nNzkmIRJxb5kQ== X-Received: by 2002:a5d:5088:: with SMTP id a8-v6mr1036779wrt.37.1531385411775; Thu, 12 Jul 2018 01:50:11 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id g63-v6sm586342wmf.3.2018.07.12.01.50.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 01:50:11 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mt76x2: fix CCK protection control frame rate Date: Thu, 12 Jul 2018 10:50:01 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use 11M as tx rate for CCK protection control frames Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c index 79ab93613e06..8ab9788464e8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c @@ -84,7 +84,13 @@ mt76x2_write_reg_pairs(struct mt76x2_dev *dev, static void mt76_write_mac_initvals(struct mt76x2_dev *dev) { -#define DEFAULT_PROT_CFG \ +#define DEFAULT_PROT_CFG_CCK \ + (FIELD_PREP(MT_PROT_CFG_RATE, 0x3) | \ + FIELD_PREP(MT_PROT_CFG_NAV, 1) | \ + FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f) | \ + MT_PROT_CFG_RTS_THRESH) + +#define DEFAULT_PROT_CFG_OFDM \ (FIELD_PREP(MT_PROT_CFG_RATE, 0x2004) | \ FIELD_PREP(MT_PROT_CFG_NAV, 1) | \ FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f) | \ @@ -159,8 +165,8 @@ mt76_write_mac_initvals(struct mt76x2_dev *dev) { MT_HT_CTRL_CFG, 0x000001ff }, }; struct mt76x2_reg_pair prot_vals[] = { - { MT_CCK_PROT_CFG, DEFAULT_PROT_CFG }, - { MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG }, + { MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK }, + { MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG_OFDM }, { MT_MM20_PROT_CFG, DEFAULT_PROT_CFG_20 }, { MT_MM40_PROT_CFG, DEFAULT_PROT_CFG_40 }, { MT_GF20_PROT_CFG, DEFAULT_PROT_CFG_20 },