From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C43B4C433E9 for ; Fri, 15 Jan 2021 14:11:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E3F622248 for ; Fri, 15 Jan 2021 14:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732948AbhAOOLq (ORCPT ); Fri, 15 Jan 2021 09:11:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729430AbhAOOLp (ORCPT ); Fri, 15 Jan 2021 09:11:45 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97602C0613D3 for ; Fri, 15 Jan 2021 06:11:04 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id w1so6289470pjc.0 for ; Fri, 15 Jan 2021 06:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=sxbXFNvlxcZ0zWe9JfdpzVDlpkQvp0Ywgu4bFclC2Qg=; b=M7CHpcxhKn37K1d/j4RlXmcKVIKO5wvkqclUv0ET/e0OQN1Q7TpgBFKIdqOBwx/ejz O9Ipt/3RNOZ6WV6rjfOmsE+zs/qJH/GhxPj4fEEJGmXUZ0Kzxd0ZR2fKMq7aJ5wCCTaK jrnjfg2NOYOiQjbF+mshm8bP9Q4TjBozIk9rs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=sxbXFNvlxcZ0zWe9JfdpzVDlpkQvp0Ywgu4bFclC2Qg=; b=L+iqrBQQky9aywUjQStvDEAedD/cRfAAldietoMKkOwHndlKK1mF3Dp6S0jozo5CQr QQ27U/uEKoO3CaUMF7KGIWbaK8EwyqvD0kpMc/38wQfXaUjGfikV6o0/9cZIvN2hQ9VH D6EUitlV+f5Z1XQ23NywQCvuhKD8IIM2SInCnIyMuRC8oQPsxLGHmS1K+ZS+o5rwlF4t xCaMvT6oAJqiXokHwu9872XoIcgC/jnDb6gYQS8+mTmbC5nmWR9lm5B39miA6qARZfzs NQ7e2TKGUWJOKmHgS/UFafK0hGEARgvYJNHKgDpA8nO4fyVrQpEj7kwUW/rvw1d9lWzW LWxA== X-Gm-Message-State: AOAM5302r11z8xlnBw7zg2GIOBTPdAk6SBaQbg2iQwbApmYVv67sYUIN Euu9Q+KKfl8SzINlhVcfZQg/thvOUSRBCCxjzVa7y98csWJx2oa/ktJDE6nENXY3TRazeyuMtmC ss87Tk6mNTnABGllbCcVX6+uJd/QKYouvt1MDsl0zQ0Do3AVcepNCwOs+kHGhnlHXbpGukeLTcc MOhWQpS0ulg6gm0nvY X-Google-Smtp-Source: ABdhPJxGhB2odKfadKjoQ9dasBH16p4eooz87Ppy+ql1ChnlB5INyVLQEkWPUIeIw/BeAx18tdGM/g== X-Received: by 2002:a17:90b:e96:: with SMTP id fv22mr10763251pjb.92.1610719863397; Fri, 15 Jan 2021 06:11:03 -0800 (PST) Received: from [10.230.40.117] ([192.19.152.250]) by smtp.gmail.com with ESMTPSA id a31sm8425726pgb.93.2021.01.15.06.10.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jan 2021 06:11:02 -0800 (PST) Subject: Re: [PATCH v2] brcmfmac: add support for CQM RSSI notifications To: =?UTF-8?Q?Alvin_=c5=a0ipraga?= , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo , Andrew Zaborowski Cc: "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" , "SHA-cyfmac-dev-list@infineon.com" , "linux-kernel@vger.kernel.org" References: <20210114163641.2427591-1-alsi@bang-olufsen.dk> From: Arend Van Spriel Message-ID: <2adec5d6-fbc9-680c-01d6-25f83327bf21@broadcom.com> Date: Fri, 15 Jan 2021 15:10:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210114163641.2427591-1-alsi@bang-olufsen.dk> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000052eae005b8f0f1c9" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000052eae005b8f0f1c9 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable + Johannes - netdevs On 1/14/2021 5:36 PM, 'Alvin =C5=A0ipraga' via BRCM80211-DEV-LIST,PDL wrote= : > Add support for CQM RSSI measurement reporting and advertise the > NL80211_EXT_FEATURE_CQM_RSSI_LIST feature. This enables a userspace > supplicant such as iwd to be notified of changes in the RSSI for roaming > and signal monitoring purposes. The more I am looking into this API the less I understand it or at least=20 it raises a couple of questions. Looking into nl80211_set_cqm_rssi() [1]=20 two behaviors are supported: 1) driver is provisioned with a threshold=20 and hysteresis, or 2) driver is provisioned with high and low threshold. The second behavior is used when the driver advertises=20 NL80211_EXT_FEATURE_CQM_RSSI_LIST *and* user-space provides more than=20 one RSSI threshold. In both cases the same driver callback is being used=20 so I wonder what is expected from the driver. Seems to me the driver=20 would need to be able to distinguish between the two behavioral=20 scenarios. As there is no obvious way I assume the driver should behave=20 the same for both cases, but again it is unclear to me what that=20 expected/required behavior is. With behavior 2) some processing is done in cfg80211 itself by=20 cfg80211_cqm_rssi_update() which is called from nl80211_set_cqm_rssi()=20 upon NL80211_CMD_SET_CQM and cfg80211_cqm_rssi_notify() called by=20 driver. If I look at that it matches pretty close what our firmware is=20 doing. The difference is that our firmware avoids RSSI oscillation with=20 a time constraint between RSSI events whereas cfg80211 uses the hysteresis. So before moving forward, I hope Johannes can chime in and clarify=20 things. Added the commit message introducing the extended feature below.=20 It mentions backward compatibility, but it only considers the extended=20 feature setting when user-space provides more than one threshold.=20 However, when the drivers set the extended feature is expects (low,=20 high) and (threshold, hysteresis) if not. So it seems the extended=20 feature should have precedence over the number of thresholds provided by=20 user-space. Regards, Arend [1]=20 https://elixir.bootlin.com/linux/v5.10.7/source/net/wireless/nl80211.c#L114= 79 ---8<----------------------------------------------------------------- commit 4a4b8169501b18c3450ac735a7e277b24886a651 Author: Andrew Zaborowski Date: Fri Feb 10 10:02:31 2017 +0100 cfg80211: Accept multiple RSSI thresholds for CQM Change the SET CQM command's RSSI threshold attribute to accept any number of thresholds as a sorted array. The API should be backwards compatible so that if one s32 threshold value is passed, the old mechanism is enabled. The netlink event generated is the same in both cases. cfg80211 handles an arbitrary number of RSSI thresholds but drivers=20 have to provide a method (set_cqm_rssi_range_config) that configures a rang= e set by a high and a low value. Drivers have to call back when the RSS= I goes out of that range and there's no additional event for each=20 time the range is reconfigured as there was with the current one-threshold API. This method doesn't have a hysteresis parameter because there's no benefit to the cfg80211 code from having the hysteresis be handled by hardware/driver in terms of the number of wakeups. At the same time it would likely be less consistent between drivers if offloaded or done in the drivers. Signed-off-by: Andrew Zaborowski Signed-off-by: Johannes Berg --=20 This electronic communication and the information and any files transmitted= =20 with it, or attached to it, are confidential and are intended solely for=20 the use of the individual or entity to whom it is addressed and may contain= =20 information that is confidential, legally privileged, protected by privacy= =20 laws, or otherwise restricted from disclosure to anyone else. If you are=20 not the intended recipient or the person responsible for delivering the=20 e-mail to the intended recipient, you are hereby notified that any use,=20 copying, distributing, dissemination, forwarding, printing, or copying of= =20 this e-mail is strictly prohibited. If you received this e-mail in error,= =20 please return the e-mail to the sender, delete it from your computer, and= =20 destroy any printed copy of it. --00000000000052eae005b8f0f1c9 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQTAYJKoZIhvcNAQcCoIIQPTCCEDkCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2hMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6tzPFnvXGeOEA4X5xh9wjx9sScVpGR5wkTg1 fgJIXTlrGESmaqXIdPRd9YQ+Yx9xRIIIPu3Jp/bpbiZBKYDJSbr/2Xago7sb9nnfSyjTSnucUcIP ZVChn6hKneVGBI2DT9yyyD3PmCEJmEz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