Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp478922ybr; Fri, 22 May 2020 11:05:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLKjcEoOdsnS75MyxnMpeQ4Xj4jHgZQDREjk9tF8dMwlKAROwsuFekeQoAFY3hzaDg0jop X-Received: by 2002:aa7:d90b:: with SMTP id a11mr4024371edr.159.1590170742748; Fri, 22 May 2020 11:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590170742; cv=none; d=google.com; s=arc-20160816; b=ed9Bi4yEB2oFHCfJszNX+zjsW8GhRrXXxct4B9gDeIvXzb55Z3n3/VkPcXyRSzSEtB rrpb0WpThsZGR28OTjrOibxW8nq90SaZiE49kqG5lQrFVNPZRijddJBb/nf/BOnqfOb6 wVsiPdU+o1KIy6jghEsP/cHpyiOF3oYBG05wt33VAhLfXDmfJTNZ6e2CakDynRK8zgj+ zXGMSmwhvnErx/JpU4B2630xYiPaUPpU7b3ICQBKB7m9Od2Y9BhnPpN5JzopYtZROndA uBEUQNn71Xi0CnjR3WO+j7PAkFGQ1Oy35AYf5KjuxW+zAVCpUjjPrYtTS+74sXx3LAqM F4KQ== 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=HgdlepUGw+YbJ5xvBRN0hoUxYlLgS4iGvNwAy+KbUkM=; b=krOGdnxEHvTYU7hP3zEbbKHmsen3y7xUecNwEZB7chjSCu5K9bSIXK/tY9TPpqbSTR uKxTuIvE6DyrM6oTcQ+ljB0aSJH5pg87c7JSBvlF8SY4dGeG9SB4bakT3brrQj8HJ8LU GFrZUNWLSMQpuHmldTXOzmV36W3dUXm18yDJnHCNjiiS+KEtfAXWg6id1ol3uU1+tMwE LjiEUEpWwX6IKBIDiFYW/w9zikw9UfrN3Ca1HQ2SV9N8dJaoxyNIoOddt67Zi2q12GPP o0BthGVccV7xxsI4MMKVxy8oeY3n8+r/UX8J6WGx5fMSrHpAY/sMGi5jANfIXMhXeVp8 QjmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zk8kZmgt; 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 s13si5469177edj.200.2020.05.22.11.05.09; Fri, 22 May 2020 11:05:42 -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=Zk8kZmgt; 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 S1730806AbgEVSEd (ORCPT + 99 others); Fri, 22 May 2020 14:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730674AbgEVSEc (ORCPT ); Fri, 22 May 2020 14:04:32 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E23DC061A0E for ; Fri, 22 May 2020 11:04:32 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id g25so8856594otp.13 for ; Fri, 22 May 2020 11:04:32 -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=HgdlepUGw+YbJ5xvBRN0hoUxYlLgS4iGvNwAy+KbUkM=; b=Zk8kZmgt0BpinkK3Qj+VYyaSO0zOgz9PQr15cnLHcCRbbV8/TcdnQdIp0SGKSfl7Um DzSUUO3YAuWeVYvW/CBqERjMtp7oovfVH7/wkMaSfuwSQVKFU9dHfoucp1/QzqvB76lx 8ithUd84SNstHPXvGZ1EjryHAZGY+2ninmpSsJfqYzzJLjoPlTqKJhSQ4bLYXXfFz+Ax DhCAuJxdaVXKGJ/EzRdDWht2c2twPec+J4GubJi76aJYkdTFaKkNEXoOeTgmFzA1ClC4 fNsV46jRjHuy1sCAma/vmIxehqi3lBMx3GZJLkDZunqjUpY5dp/uv1xhMJybr8TjGx3f xrrA== 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=HgdlepUGw+YbJ5xvBRN0hoUxYlLgS4iGvNwAy+KbUkM=; b=ZvXr5OaXw2epKnbhdlI2yALa55zNpJPARdtYfyY/vvC5+ieo/vv9QgrJ8CJwf5v705 2I8O8Z5WMRrdesZaX0M2RowRVqy0mt2rIHJtkeL6+Dj8bUH2L6ty76kRZSA+I35iKyhB caDub9Uo3WX4xvR6N/5T0o1Ib9gkobHQXSjkyIEfxHfNv5KnH1kUqtVqUtA88c1BWRdl t5h5pi23QFzFauyUiX116IzAMXDYfsuw/ByHKAgaddVjFntCYg9kh+jHRk4tWxNfN02K fxoqK8DQ6QIm2hbPNG+BPr3q2yWtHaH+YK3V2n9IEjqsgbeopgoBjdtIEmWwVlEUC7Sw OA+w== X-Gm-Message-State: AOAM532isuB4wi/q/EfWJj+K2linCpwIpdm7cmTBVDUmHut0/w5O3jCC wxKgxAcu4JzP3mFpU8AeX6rMBRUyy6Pp8go1ZDU= X-Received: by 2002:a9d:3637:: with SMTP id w52mr10662437otb.177.1590170671784; Fri, 22 May 2020 11:04:31 -0700 (PDT) MIME-Version: 1.0 References: <20200521145757.245774-1-alainm@chromium.org> In-Reply-To: From: Luiz Augusto von Dentz Date: Fri, 22 May 2020 11:04: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 6:04 PM Alain Michaud wro= te: > > > > On Thu., May 21, 2020, 8:14 p.m. Luiz Augusto von Dentz, wrote: >> >> Hi Alain, >> >> On Thu, May 21, 2020 at 4:44 PM Alain Michaud = wrote: >> > >> > 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 paramet= er command. >> >> > > >> > In particular, this command is used to load default paramete= rs for >> >> > > >> > various operations in the kernel. This mechanism is also exp= andable to >> >> > > >> > future values that may be necessary. >> >> > > >> > >> >> > > >> > This will allow bluetoothd to load parameters from a conf fi= le that may >> >> > > >> > be customized for the specific requirements of each platform= s. >> >> > > >> > >> >> > > >> > --- >> >> > > >> > 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 Oc= tet) >> >> > > >> > + Value_Length (1 Octe= t) >> >> > > >> > + Value (0-255 Octets) >> >> > > >> > + } >> >> > > >> > + Parameter2 { } >> >> > > >> > + ... >> >> > > >> > + Return Parameters: >> >> > > >> > + >> >> > > >> > + This command is used to feed the kernel a list of de= fault 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 Inte= rval >> >> > > >> > + 0x000d LE Scanning Interval for auto connec= t >> >> > > >> > + 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 o= n the >> >> > > >> 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 inf= ormation down into the kernel. The hid profile already sends an op, so it'= s relatively trivial to carry that information in so we can apply specific = scanning requirements for that case (which are less aggressive and therefor= e have 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 prof= ile >> >> > > that needs some different parameters than the default can all use= the >> >> > > same command and we don't have to grow this list when a new profi= le >> >> > > want to use different parameters. >> >> > > >> >> > That might be another option indeed. I wonder how far you'd want t= o >> >> > take this to have the profile provide all the values. At some poin= t, >> >> > 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 tha= t >> >> 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 (on= e >> >> 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 pe= r >> >> device rather than a using a globals with per profile exceptions, muc= h >> >> 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= the smaller duty cycle provided by the hid parameters defined in this patc= h), else, we use the passive scanning parameters as we do today. In essence= , with this logic, no aggregation of settings is necessary since it is up t= o the 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? > > It's effectively passive scanning based on what requested it. >> >> >> > Scan parameters are global, they can't be per connection like the conn= ection 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. > > > Today, it's all passive scanning. This would introduce the concept of hid= only passive scanning where we can have a lower scanning duty cycle and sa= ve bandwidth and power. So the intend is to switch passive scanning 'modes', perhaps Im missing an API or policy to do that, or is the indend to do this automagically? It is a little bit hard to follow given that a system can have many different peripherals, each with different scanning requirements, or the idea is to apply HID mode only if there are HID devices paired? >> >> >> >> >> >> >> > > >> >> >> > > >> >> >> > > >> > + 0x0012 LE Scanning Interval for wake scenar= ios >> >> > > >> > + 0x0013 LE Scanning Window for wake scenario= s >> >> > > >> > + 0x0014 LE Scanning Interval for discovery >> >> > > >> > + 0x0015 LE Scanning Window for discovery >> >> > > >> > + 0x0016 LE Scanning Interval for adv monitor= ing >> >> > > >> > + 0x0017 LE Scanning Window for adv monitorin= g >> >> > > >> > + 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 = powered and >> >> > > >> > + all settings will be programmed once powered. Note = that these only >> >> > > >> > + control the default parameters. Higher level Apis m= ay influence the >> >> > > >> > + effective value used. >> >> > > >> > + >> >> > > >> > + This command generates a Command Complete event on s= uccess 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 >> >> >> >> -- >> Luiz Augusto von Dentz --=20 Luiz Augusto von Dentz