Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2817916pxb; Sun, 29 Aug 2021 04:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn92ePQ2OitegVMOdhuex8SP3w/cUiBM50N1HB/5gO1ZX2x+iUM5qbgBZb2ecwGsnn3hgi X-Received: by 2002:a92:ca89:: with SMTP id t9mr13284487ilo.178.1630237250130; Sun, 29 Aug 2021 04:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630237250; cv=none; d=google.com; s=arc-20160816; b=VPOyTgmk7tE4kjxL43+6iNrzn1GnA28/4HXmF/7rQPXSHtZh8xYg8i4JmLj8YyzI03 C84VlektjjFOxdp2e0Rxh6/t3v3qJDwe8daP65ADkxYQirNt7VhIvjTbTZEaUUCvNtDL LdG5aczRWHlppDOPqZvhF7E/zFOkHWFxBriyTqF49g+t76Nf01Krz6hNSIMuelK5gi2Q R21auwURLCYnGbJPwuzGuBiv2E2ApsdLcBmblRM3EbjfA75o+aihs5HcvA3nXxE88gIW KDFKPwu+5MyHItsBzoCxjrJwTnE8bK0jH07SCEdYum34CkJAuyeEoyrsmGYecpTirKFC 0+iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=+ikE8RNXTwG+UIcBpFIUF3Wvhaay8G/x0xqbx3cp6xc=; b=rDWbYLuWG8xkfPSjq4e0e/yo3Xb7Z8axUOhauGlMGIkpULXXd2NFf+qI4sQ6MThnla 0BViWb6wVFtXroKrNrflhhWr7tt3nml/7FahT1cp1VCdxubagaAJk+v39DLP258SuAzC 6S4EtFDX0g17odubQpWTm55VoeDjn58IbV6VLgbmSPsV1m/34WjMQ4vREt5rAGUibj5O 2lRbYqqFAokWeeQFgS61w3t8xrTSO1ts45jnb86adpgFPv2Fcv+6sLBxZqQL3BlZN05o bfaX7CQiMp4fPixasd69j7MUuX4+PQ7Fk45G1Ov2CRVIRL2qG+mt3XsNRxySao8q6K0l zKmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ryTIDJ89; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si11354777ilp.119.2021.08.29.04.40.36; Sun, 29 Aug 2021 04:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ryTIDJ89; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235203AbhH2LlY (ORCPT + 99 others); Sun, 29 Aug 2021 07:41:24 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:13904 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235182AbhH2LlX (ORCPT ); Sun, 29 Aug 2021 07:41:23 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630237231; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=+ikE8RNXTwG+UIcBpFIUF3Wvhaay8G/x0xqbx3cp6xc=; b=ryTIDJ89HN9TOwTnO63SlQz2X6TYc8MQTkRxs9+pZl/vGiupWyniYOAuVE+J5VBdY4YpnGuR Heen7IdvFNtB/hi249f0VdPx407vsvN9g6ImWFOwuJ8pT1E7DPZgYN90aozalLYrxru9s7AK zcuhgEHOdiOdmW4TmR4jr9tUS6s= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 612b722b825e13c54a338de8 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 29 Aug 2021 11:40:27 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 14B1CC43460; Sun, 29 Aug 2021 11:40:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from tykki (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1C09DC4338F; Sun, 29 Aug 2021 11:40:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 1C09DC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Ping-Ke Shih Cc: , , , Subject: Re: [PATCH 3/4] rtw88: support adaptivity for ETSI/JP DFS region References: <20210802063140.25670-1-pkshih@realtek.com> <20210802063140.25670-4-pkshih@realtek.com> Date: Sun, 29 Aug 2021 14:40:12 +0300 In-Reply-To: <20210802063140.25670-4-pkshih@realtek.com> (Ping-Ke Shih's message of "Mon, 2 Aug 2021 14:31:39 +0800") Message-ID: <87ilzo4gyr.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Ping-Ke Shih writes: > From: Zong-Zhe Yang > > Add Energy Detected CCA (EDCCA) mechanism to detect energy on the channel. > And EDCCA support adaptivity mode now. From MIC Ordinance Regulating Radio > Equipment article 49.20, ETSI EN-300-328 and EN-301-893, the device should > be able to dynamically pause TX activity when energy detected on the air. > According to ETSI/JP DFS region, driver will set corresponding threshold > and stop TX activity if the detected energy exceeds the threshold. For now, > we support it on 8822b and 8822c first. > > By default, EDCCA mechanism is turned on. For ETSI/JP DFS region, it will > turn to adaptivity mode. However, with adaptivity, if environment is too > nosiy, TX may often be halted. So, a debugfs for EDCCA is added. It can > show what EDCCA mode is used currently. And EDCCA mechanism can be turned > on/off through the debugfs while debugging. > > Signed-off-by: Zong-Zhe Yang > Signed-off-by: Ping-Ke Shih [...] > +static ssize_t rtw_debugfs_set_edcca_enable(struct file *filp, > + const char __user *buffer, > + size_t count, loff_t *loff) > +{ > + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; > + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; > + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; > + bool input; > + int err; > + > + err = kstrtobool_from_user(buffer, count, &input); > + if (err) > + return err; > + > + rtw_edcca_enabled = input; > + rtw_phy_adaptivity_set_mode(rtwdev); > + > + return count; > +} > + > +static int rtw_debugfs_get_edcca_enable(struct seq_file *m, void *v) > +{ > + struct rtw_debugfs_priv *debugfs_priv = m->private; > + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; > + struct rtw_dm_info *dm_info = &rtwdev->dm_info; > + > + seq_printf(m, "EDCCA %s: EDCCA mode %d\n", > + rtw_edcca_enabled ? "enabled" : "disabled", > + dm_info->edcca_mode); > + return 0; > +} [...] > --- a/drivers/net/wireless/realtek/rtw88/main.c > +++ b/drivers/net/wireless/realtek/rtw88/main.c > @@ -23,6 +23,7 @@ EXPORT_SYMBOL(rtw_disable_lps_deep_mode); > bool rtw_bf_support = true; > unsigned int rtw_debug_mask; > EXPORT_SYMBOL(rtw_debug_mask); > +bool rtw_edcca_enabled = true; You are making rtw_edcca_enabled per driver, should it instead be per device? If something is changed via debugfs the assumption is that the value is per device. For example, let's say you have two rtw88 devices attached on the same system, device A and B. If a user changes edcca via debugfs on device A it will also change the state in device B. Is that the desired functionality? If yes, I think you should add a comment to rtw_edcca_enabled explaining that. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches