Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1846716ybk; Thu, 21 May 2020 17:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU9A1Bx8d3SCO2UYMKZ+//vLgEM+MCJgIdQsadow4hh0XABtrU1nr5GyfnmfOCiPWOBEk3 X-Received: by 2002:a17:906:148f:: with SMTP id x15mr5753841ejc.85.1590106510201; Thu, 21 May 2020 17:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590106510; cv=none; d=google.com; s=arc-20160816; b=pOUBn+Eglqjixa/g0VzAzmqWUn/C/3X0X9RJzCF6FDXDwPlsaLAQHdiAevOPifLcyz m5xFb4QdMGSAe4zxfjz5bDhmBrGpxYC9QNpsYiHuWF4cHOQuxYqVRXkPRigTzX+kjHQ1 WONouQoxE5vBc+2s35S0Zi8hze3HZ3DJnoWKU/kFmBLPMjcBxspHAe++QQFYhVaLsHtw MscmuIBmMa21+o47IRgLCzLwPMmNAUl/WWektzikxPw4n+1rKnmvhZElq4H6XzXLhugg vRqgiOFzRzTNkUeN7Yfck3bmQ8U3GwvCNbdo4zEZHVUM+NoJM/6JAbuY1Y3LA6F6ksX6 hjMg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0lwPSEq+cjIFM6vVa/s2uTe29mR0BsE8+j8tJqJVRUE=; b=kuvyPr+mTa/Latxuyr7bDAjIjGySTOxeycdT4H5lcZCwNbld7xSFlvWGWG/Ihdz7EX hWoHCn0V+wx6wKSAKC42u7MdIHRIW97w9AMb83sVmX7JUo2b73rnKsuwORJ1cyk/pOkd L8XaED3ZRV0BNLqpsyHE+NGU3kYCw8A5AgxVVnsSuKZXUvS8mADAi2zTtK3Y32Sh/t7J 8ofp9ZdsRe40Sb/5Nj/uP66MY6Xg6RswOxUV/dvAuqFH6a+Zpf0txuCiwBsCvokb2YFF kCy/PZ9gjyzm7nkPz60FNe9cZmKniD6TL1i7bcjzGGyHWdxnTUtnG5iAEjaFU+vBqGg1 ti3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="iilgCA/I"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si4231063eje.506.2020.05.21.17.14.30; Thu, 21 May 2020 17:15:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=@gmail.com header.s=20161025 header.b="iilgCA/I"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730071AbgEVAOZ (ORCPT + 99 others); Thu, 21 May 2020 20:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729771AbgEVAOY (ORCPT ); Thu, 21 May 2020 20:14:24 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B92DFC061A0E for ; Thu, 21 May 2020 17:14:24 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id r25so7853084oij.4 for ; Thu, 21 May 2020 17:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0lwPSEq+cjIFM6vVa/s2uTe29mR0BsE8+j8tJqJVRUE=; b=iilgCA/Ioaayg/9r4w6+54PFwBCeFs4hwo2xC73652g44KZLKbi6Ezb7o12qEHNL1G 1Kpxf6DZBfUqvrKQB3t/zqwmpR5P2EI37G9o7cYKfQz+smKhmLd/5chTWsUcE4aUhx0T NdbfsrHLh2pPSKcEtKB6Zkeu6RatD8k6oku3S+36IVZ4XIKKFgPGW/idovxz1VX6hM5P SpE80d/+r0DZLj8PMn6LdcNnOyPA3pTvS/NjZFAgJhVyEjzU6u4BjIOUZKBgy+XaIlGx 6NLUfveXs1Fd08kSGPR3tsjArQ3JermrjCYwRwQTd7sR5s2GNc+RC48wwphkncdbtsjG SjSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0lwPSEq+cjIFM6vVa/s2uTe29mR0BsE8+j8tJqJVRUE=; b=fg0JYvtp9qgIENIluY/jcLiwjBl18ZYuFejGkNdti7OOSRXYYxvFf2pD7WwidfD/YI 0nn3tm6YTt9Zg1/ayEdxcYb6LN++16vvZFyAlvPPNe/JT9eyXF4/FhT2r9eoa3FFwxw4 a2nK2dKESwCnx8ghpq93VSn68UVqXqK1co7p3H+8+NHMPcnenu1/TjvTbrid2Eff7VMY Ij7EZIUvfOSVUb6muCVVF3WjckRFf6+QSrB1iXNlOzubLXHNvl6aKPErV9wBEz9zlD5l SA9KGu/NOwIioorq5qNHI/wfBh9OVLsKu04wI6gXSSJ9d09NqPlUj18U+BziidmkojIp ty5Q== X-Gm-Message-State: AOAM5332jO9siHI5YgpGU5tTQkeT+93DG5FgKxMmpgPGSlaphrLxeyr1 6wmzMqc7u0JH2zL5uCMpkTsFu+aStW+XFwFCF5Y= X-Received: by 2002:aca:6747:: with SMTP id b7mr892665oiy.110.1590106463787; Thu, 21 May 2020 17:14:23 -0700 (PDT) MIME-Version: 1.0 References: <20200521145757.245774-1-alainm@chromium.org> In-Reply-To: From: Luiz Augusto von Dentz Date: Thu, 21 May 2020 17:14:11 -0700 Message-ID: Subject: Re: [BlueZ PATCH v3] doc:adding definitions for load default params mgmt op To: Alain Michaud Cc: Alain Michaud , BlueZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, On Thu, May 21, 2020 at 4:44 PM Alain Michaud wro= te: > > Hi Luiz > > On Thu., May 21, 2020, 7:19 p.m. Luiz Augusto von Dentz, wrote: >> >> Hi Alain, >> >> On Thu, May 21, 2020 at 3:28 PM Alain Michaud = wrote: >> > >> > Hi Luiz >> > >> > >> > On Thu, May 21, 2020 at 6:05 PM Luiz Augusto von Dentz >> > wrote: >> > > >> > > Hi Alain, >> > > >> > > On Thu, May 21, 2020 at 1:12 PM Alain Michaud wrote: >> > > > >> > > > Hi Luiz, >> > > > >> > > > >> > > > On Thu, May 21, 2020 at 12:26 PM Luiz Augusto von Dentz wrote: >> > > >> >> > > >> Hi Alain, >> > > >> >> > > >> On Thu, May 21, 2020 at 8:05 AM Alain Michaud wrote: >> > > >> > >> > > >> > This change adds the definition for the load default parameter = command. >> > > >> > In particular, this command is used to load default parameters = for >> > > >> > various operations in the kernel. This mechanism is also expand= able to >> > > >> > future values that may be necessary. >> > > >> > >> > > >> > This will allow bluetoothd to load parameters from a conf file = that may >> > > >> > be customized for the specific requirements of each platforms. >> > > >> > >> > > >> > --- >> > > >> > rebase against current master >> > > >> > >> > > >> > doc/mgmt-api.txt | 62 ++++++++++++++++++++++++++++++++++++++++= ++++++++ >> > > >> > 1 file changed, 62 insertions(+) >> > > >> > >> > > >> > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt >> > > >> > index 6ee01fed8..c6575e654 100644 >> > > >> > --- a/doc/mgmt-api.txt >> > > >> > +++ b/doc/mgmt-api.txt >> > > >> > @@ -3223,6 +3223,68 @@ Set Experimental Feature Command >> > > >> > Invalid Index >> > > >> > >> > > >> > >> > > >> > +Load Default Controller Parameter Command >> > > >> > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D >> > > >> > + >> > > >> > + Command Code: 0x004b >> > > >> > + Controller Index: >> > > >> > + Command Parameters: Parameter_Count (2 Octets) >> > > >> > + Parameter1 { >> > > >> > + Parameter_Type (2 Octet= ) >> > > >> > + Value_Length (1 Octet) >> > > >> > + Value (0-255 Octets) >> > > >> > + } >> > > >> > + Parameter2 { } >> > > >> > + ... >> > > >> > + Return Parameters: >> > > >> > + >> > > >> > + This command is used to feed the kernel a list of defau= lt controller >> > > >> > + parameters. >> > > >> > + >> > > >> > + Currently defined Parameter_Type values are: >> > > >> > + >> > > >> > + 0x0000 BR/EDR Page Scan Type >> > > >> > + 0x0001 BR/EDR Page Scan Interval >> > > >> > + 0x0002 BR/EDR Page Scan Window >> > > >> > + 0x0003 BR/EDR Inquiry Scan Type >> > > >> > + 0x0004 BR/EDR Inquiry Scan Interval >> > > >> > + 0x0005 BR/EDR Inquiry Scan Window >> > > >> > + 0x0006 BR/EDR Link Supervision Timeout >> > > >> > + 0x0007 BR/EDR Page Timeout >> > > >> > + 0x0008 BR/EDR Min Sniff Interval >> > > >> > + 0x0009 BR/EDR Max Sniff Interval >> > > >> > + 0x000a LE Advertisement Min Interval >> > > >> > + 0x000b LE Advertisement Max Interval >> > > >> > + 0x000c LE Multi Advertisement Rotation Interva= l >> > > >> > + 0x000d LE Scanning Interval for auto connect >> > > >> > + 0x000e LE Scanning Window for auto connect >> > > >> > + 0x000f LE Scanning Interval for HID only >> > > >> > + 0x0010 LE Scanning Window for HID only >> > > >> >> > > >> I remember commenting that we don't have profile information on t= he >> > > >> kernel so Im not sure how you are planning to detect the when the >> > > >> device is HID or not? >> > > > >> > > > I expect we'll need to add an Add Device flag to carry that inform= ation down into the kernel. The hid profile already sends an op, so it's r= elatively trivial to carry that information in so we can apply specific sca= nning requirements for that case (which are less aggressive and therefore h= ave less of an impact to Wifi and BT performance). >> > > >> > > Well if we will need to feed that information of the profile type we >> > > might as well just feed the intervals directly, that way any profile >> > > that needs some different parameters than the default can all use th= e >> > > same command and we don't have to grow this list when a new profile >> > > want to use different parameters. >> > > >> > That might be another option indeed. I wonder how far you'd want to >> > take this to have the profile provide all the values. At some point, >> > you'd need some logic that would pick the value that meets all the >> > profile requirements so if one wants w:100, i:200 and another wants >> > w:200: i400, you may need to scan at 100% to meet the requirements of >> > all profiles... I think that with the current proposal, while less >> > flexible, may avoid this complexity/condition.. >> >> Not sure I follow you here, what I had in mind was that the profile >> provides its own settings for scanning but perhaps you are saying that >> in case there are multiple profiles involved we would have to >> aggregate the parameters, well that has to be done either way even if >> we use simple types, in which case there can be multiple defaults (one >> for each profile) that the kernel must aggregate or we do aggregate >> them at userspace and just provide the end result. In the end I guess >> this means that the connect scanning parameters should probably be per >> device rather than a using a globals with per profile exceptions, much >> like connection parameters are per device as well. > > > You got the idea. Aggregation would be needed, but with simple types, we = can have simple logic such as if only hid is added (via the flag, we use th= e smaller duty cycle provided by the hid parameters defined in this patch),= else, we use the passive scanning parameters as we do today. In essence, w= ith this logic, no aggregation of settings is necessary since it is up to t= he platform who set the various values via their .conf file. Well you will need to know when to apply the hid params, so to me it still seems a per device policy, what Im missing? > Scan parameters are global, they can't be per connection like the connect= ion parameters. Not when you are scanning to connect to specifica device, perhaps you want to expand on where each scanning parameter set takes place then. >> >> >> > > >> >> > > >> >> > > >> > + 0x0012 LE Scanning Interval for wake scenarios >> > > >> > + 0x0013 LE Scanning Window for wake scenarios >> > > >> > + 0x0014 LE Scanning Interval for discovery >> > > >> > + 0x0015 LE Scanning Window for discovery >> > > >> > + 0x0016 LE Scanning Interval for adv monitoring >> > > >> > + 0x0017 LE Scanning Window for adv monitoring >> > > >> > + 0x0018 LE Scanning Interval for connect >> > > >> > + 0x0019 LE Scanning Window for connect >> > > >> > + 0x001a LE Min Connection Interval >> > > >> > + 0x001b LE Max Connection Interval >> > > >> > + 0x001c LE Connection Connection Latency >> > > >> > + 0x001d LE Connection Supervision Timeout >> > > >> > + >> > > >> > + This command can be used when the controller is not pow= ered and >> > > >> > + all settings will be programmed once powered. Note tha= t these only >> > > >> > + control the default parameters. Higher level Apis may = influence the >> > > >> > + effective value used. >> > > >> > + >> > > >> > + This command generates a Command Complete event on succ= ess or >> > > >> > + a Command Status event on failure. >> > > >> > + >> > > >> > + Possible errors: Invalid Parameters >> > > >> > + Invalid Index >> > > >> > + >> > > >> > + >> > > >> > Command Complete Event >> > > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >> > > >> > >> > > >> > -- >> > > >> > 2.26.2.761.g0e0b3e54be-goog >> > > >> > >> > > >> >> > > >> >> > > >> -- >> > > >> Luiz Augusto von Dentz >> > > >> > > >> > > >> > > -- >> > > Luiz Augusto von Dentz >> >> >> >> -- >> Luiz Augusto von Dentz --=20 Luiz Augusto von Dentz