From patchwork Tue May 15 10:08:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10400771 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 0412B601F9 for ; Tue, 15 May 2018 10:08:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0A21262F2 for ; Tue, 15 May 2018 10:08:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D54692865F; Tue, 15 May 2018 10:08:36 +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 83C5D262F2 for ; Tue, 15 May 2018 10:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752606AbeEOKIe (ORCPT ); Tue, 15 May 2018 06:08:34 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36571 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbeEOKId (ORCPT ); Tue, 15 May 2018 06:08:33 -0400 Received: by mail-wr0-f196.google.com with SMTP id p4-v6so15384130wrh.3 for ; Tue, 15 May 2018 03:08:33 -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; bh=sWn3XQZsnNxFNi/t/a5VEKcElz8ikKZn2XiHDgO6YfM=; b=rKlu5cEaocDW8eXOqpUDFln8tkDKev3/CLqTOxMKcnh7ZnatVsif7WxT6E4izc5z5R MlSPTBSvA8Nrj7MQ+ch0yyrWv4Jwabc3FVSNk/Y4mVZx6Hxs0+w0YkYWAY+AzV1DL3oy GXbgKqHDiKsvNLxsDoGnQtsKIJ9AUcX7dlfMy6nlxmy9MwuxZRT5U2melvKt6zHldgDx 4bFbw6ZTXN8sSwQH22eAbKPHJ0yqSGN0nh2im9om3WA/BAfCrwWhDxFhlDG723lHBNG7 yVMorwLApIjkRMaPsxoJbYy3KB3e5Ypy//sSTvyLY4/YU2CDUt6emvIOJvUw6iaX1Ef8 FOJA== X-Gm-Message-State: ALKqPweA+EuucvJe2dRQXLpu0FriNbCsUQq2EvTHnbGi+oIdLp24KzNF XwZ3LyLxPOjegqKeZiNPJvKCsQ== X-Google-Smtp-Source: AB8JxZqa+5g0MJWbLVHoR5WXSpg80gUCLgX/nu8Ypo9RlL8dwjAzWqX2n/DkwMQTYhas39uZ7lLUhA== X-Received: by 2002:adf:92a5:: with SMTP id 34-v6mr9149082wrn.226.1526378912782; Tue, 15 May 2018 03:08:32 -0700 (PDT) Received: from localhost.localdomain ([151.66.25.157]) by smtp.gmail.com with ESMTPSA id s5-v6sm15064078wra.48.2018.05.15.03.08.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 03:08:32 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, luca.bisti@gmail.com, gaetano.catalli@gmail.com Subject: [PATCH] mt76x2: apply coverage class on slot time too Date: Tue, 15 May 2018 12:08:14 +0200 Message-Id: <20180515100814.491-1-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.16.3 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 According to 802.11-2007 17.3.8.6 (slot time), the slot time should be increased by 3 us * coverage class. Taking into account coverage class in slot time configuration allows to increase by an order of magnitude the throughput on a 4Km link in a noisy environment Tested-by: Luca Bisti Tested-by: Gaetano Catalli Signed-off-by: Lorenzo Bianconi Acked-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c index d21e4a7c1bb9..9eeb1d7631c2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c @@ -482,7 +482,10 @@ void mt76x2_set_tx_ackto(struct mt76x2_dev *dev) { u8 ackto, sifs, slottime = dev->slottime; + /* As defined by IEEE 802.11-2007 17.3.8.6 */ slottime += 3 * dev->coverage_class; + mt76_rmw_field(dev, MT_BKOFF_SLOT_CFG, + MT_BKOFF_SLOT_CFG_SLOTTIME, slottime); sifs = mt76_get_field(dev, MT_XIFS_TIME_CFG, MT_XIFS_TIME_CFG_OFDM_SIFS); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c index 81c58f865c64..539dda8a59e2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c @@ -247,8 +247,7 @@ mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int slottime = info->use_short_slot ? 9 : 20; dev->slottime = slottime; - mt76_rmw_field(dev, MT_BKOFF_SLOT_CFG, - MT_BKOFF_SLOT_CFG_SLOTTIME, slottime); + mt76x2_set_tx_ackto(dev); } mutex_unlock(&dev->mutex);