Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3632375ybv; Tue, 25 Feb 2020 04:44:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyvwlXZ1ZHIwgEFEM8G+PtnzafydkhLQLmx0Sm2lDzPCLJ4IsOO+WLsa/nw9mRnMlMdR1jK X-Received: by 2002:a9d:51ca:: with SMTP id d10mr44468080oth.76.1582634640990; Tue, 25 Feb 2020 04:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582634640; cv=none; d=google.com; s=arc-20160816; b=heAnKIXW3BgVqV11xkWzAKnJbAXz/SSkfqO+nWlgFbrZygL7ayxJn7rGLrVuE1H4ab HfDKWFaoGx3OT0IxjKblLhg5LNL7BV2ovhS6ezUWyS2DwFxsenJUONuDOEXkno7nMmPD LSDorJ2KDojVrmiArZcd6Ykhu9Mo/eD9g3boY4Bv2NdgLSL9RipaB1HYHEg0o2cNe7gC 12fMHvSN4QrKfTkGqVlpnVWAOBrf8AA4hxw+k36xJhaJtcw55n7wsxC97aIQe+HgCrfn hOd3CzWd2FY6Td0YblH2/vQJRnCjFnp22T1n7d5aO1FkyWo164ZDD0mVxIojpm40a86I 47YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=VKFr7tplQZG+iFv/6D252Xk6cjewOeMSs1sKn25cAxM=; b=sPforsqrh71nfnmh41mXU/DI+J03QTi+KmLPD8G+U6wF3j+FOUIs6v9+S11zMmOIz9 h52tE9G2L9bBl4noXyvqXl2l4HR72C7xVS5/1ho8rTO1joDedwy/5gLDHAo8orTKPUye /JhTq/2XhxBSB47a2UHef8AaWy2GSgHdt8ssHjCOYGdqEH7n8+SSXjn7eDIZ99Wgqq3Z 8sH9xGYRUqhHYtxoHHzEZzyefB9JOJikfCS9zO+rxGFrL2qbS2qvk0RXAderq9OdFA68 XY297vCBIhR73KrATSNMbKerHirMl1co2T2xV4wSM+7FCKU9yIONh37yn1yrq7GeChJD YFSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=qh5DeLBZ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si7357205otl.153.2020.02.25.04.43.41; Tue, 25 Feb 2020 04:44:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=qh5DeLBZ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729932AbgBYM2v (ORCPT + 99 others); Tue, 25 Feb 2020 07:28:51 -0500 Received: from nbd.name ([46.4.11.11]:53752 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729048AbgBYM2u (ORCPT ); Tue, 25 Feb 2020 07:28:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VKFr7tplQZG+iFv/6D252Xk6cjewOeMSs1sKn25cAxM=; b=qh5DeLBZ4pKA3ls7eAsZK+B4ro ijvc8NjWGgQgA+4GEmlLELDyC3fLjmqHGiUqgYMYNo8RXpQwNVSlhBpadx/wKx0RYOcBb8+ziLuWx FNmIvfN3ux1qgVl6UNUMlscfS6IslsceJXjlJ0YoUU56O3+oLFQsHiP8RcHyyZKY4ohg=; Received: from [80.255.7.116] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j6ZKS-0006CK-Vp for linux-wireless@vger.kernel.org; Tue, 25 Feb 2020 13:28:49 +0100 Received: by maeck.local (Postfix, from userid 501) id EFB3A7E3F8B8; Tue, 25 Feb 2020 13:28:47 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 3/3] mt76: mt7603: make dynamic sensitivity adjustment configurable via debugfs Date: Tue, 25 Feb 2020 13:28:47 +0100 Message-Id: <20200225122847.40846-3-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200225122847.40846-1-nbd@nbd.name> References: <20200225122847.40846-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In some cases it may be useful for debugging to disable this feature Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7603/init.c | 1 + drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 3 +++ drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 1 + 4 files changed, 7 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c index a84e801d4cf0..cc7c788abedd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c @@ -123,4 +123,6 @@ void mt7603_init_debugfs(struct mt7603_dev *dev) mt7603_radio_read); debugfs_create_u8("sensitivity_limit", 0600, dir, &dev->sensitivity_limit); + debugfs_create_bool("dynamic_sensitivity", 0600, dir, + &dev->dynamic_sensitivity); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c index 97ba5ddc44bb..f641a8b56b39 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c @@ -541,6 +541,7 @@ int mt7603_register_device(struct mt7603_dev *dev) dev->slottime = 9; dev->sensitivity_limit = 28; + dev->dynamic_sensitivity = true; ret = mt7603_init_hardware(dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index a3daae41f2f4..39b7c5d6e6cd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1727,6 +1727,9 @@ mt7603_false_cca_check(struct mt7603_dev *dev) int min_signal; u32 val; + if (!dev->dynamic_sensitivity) + return; + val = mt76_rr(dev, MT_PHYCTRL_STAT_PD); pd_cck = FIELD_GET(MT_PHYCTRL_STAT_PD_CCK, val); pd_ofdm = FIELD_GET(MT_PHYCTRL_STAT_PD_OFDM, val); diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h index 831a269472b3..7fadf094e9be 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h @@ -142,6 +142,7 @@ struct mt7603_dev { u8 ed_strict_mode; u8 ed_strong_signal; + bool dynamic_sensitivity; s8 sensitivity; u8 sensitivity_limit; -- 2.24.0