linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Joseph Hwang <josephsih@chromium.org>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Marcel Holtmann" <marcel@holtmann.org>,
	"Pali Rohár" <pali@kernel.org>,
	"ChromeOS Bluetooth Upstreaming"
	<chromeos-bluetooth-upstreaming@chromium.org>,
	"Joseph Hwang" <josephsih@google.com>,
	"Miao-chen Chou" <mcchou@chromium.org>
Subject: Re: [BlueZ PATCH v5 3/3] adapter: set quality report feature
Date: Tue, 29 Jun 2021 13:25:01 -0700	[thread overview]
Message-ID: <CABBYNZJH3Lih+yNdxdre_5zXp4CuNAzek73cTVub0h0rno3YCA@mail.gmail.com> (raw)
In-Reply-To: <20210629154652.BlueZ.v5.3.I5b72c623fb8b002a5e1f000149b362af3c01ab98@changeid>

Hi Joseph,

On Tue, Jun 29, 2021 at 12:47 AM Joseph Hwang <josephsih@chromium.org> wrote:
>
> This patch adds the function to enable/disable the quality report
> experimental feature in the controller through MGMT_OP_SET_EXP_FEATURE.
>
> A user space process can enable/disable the quality report feature
> by sending a property changed signal to the bluetoothd. The bluetoothd
> can set up the signal handlers to handle the signal in a file under
> plugins/ to call this function.
>
> Note that the bluetoothd calls the experimental feature only when
> the quality_report_supported flag is true.
>
> Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
> ---
>
> (no changes since v1)
>
>  src/adapter.c | 36 ++++++++++++++++++++++++++++++++++++
>  src/adapter.h |  2 ++
>  2 files changed, 38 insertions(+)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index e2873de46..829d9806b 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -9332,6 +9332,42 @@ static const struct exp_feat {
>         EXP_FEAT(rpa_resolution_uuid, rpa_resolution_func),
>  };
>
> +/* A user space process can enable/disable the quality report feature
> + * by sending a property changed signal to the bluetoothd. The bluetoothd
> + * can set up the signal handlers in a file under plugins/ to call
> + * this function.
> + */
> +void btd_adapter_update_kernel_quality_report(uint8_t action)
> +{
> +       struct mgmt_cp_set_exp_feature cp;
> +       struct btd_adapter *adapter;
> +
> +       adapter = btd_adapter_get_default();
> +       if (!adapter) {
> +               info("No default adapter. Skip enabling quality report.");
> +               return;
> +       }
> +
> +       if (!adapter->quality_report_supported) {
> +               info("quality report feature not supported.");
> +               return;
> +       }
> +
> +       memset(&cp, 0, sizeof(cp));
> +       memcpy(cp.uuid, quality_report_uuid, 16);
> +
> +       cp.action = action;
> +       if (cp.action > 1) {
> +               error("Unexpected quality report action %u", cp.action);
> +               return;
> +       }
> +
> +       mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE, adapter->dev_id,
> +                       sizeof(cp), &cp, NULL, NULL, NULL);
> +       info("update kernel quality report default adapter %d enable %d",
> +               adapter->dev_id, cp.action);
> +}
> +
>  static void read_exp_features_complete(uint8_t status, uint16_t length,
>                                         const void *param, void *user_data)
>  {
> diff --git a/src/adapter.h b/src/adapter.h
> index 60b5e3bcc..001f784e4 100644
> --- a/src/adapter.h
> +++ b/src/adapter.h
> @@ -240,3 +240,5 @@ enum kernel_features {
>  };
>
>  bool btd_has_kernel_features(uint32_t feature);
> +
> +void btd_adapter_update_kernel_quality_report(uint8_t action);

I rather not have these function exposed if there is no upstream code
using it because this may appear on the likes of static analyzer as
something that is never used, also the current policy is that all
experimental features are to be enabled with -E or if experimental is
set on main.conf, also note that experimental features do persist so I
think in the long run we might want to have an interface in the core
to expose the controls of each experimental feature separately, with
that we could replace the current policy of -E to enable all
experimental features to actually enable the interface and then
persist the features that upper layer would like to have enabled in
the storage.

> --
> 2.32.0.93.g670b81a890-goog
>


-- 
Luiz Augusto von Dentz

  reply	other threads:[~2021-06-29 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  7:47 [BlueZ PATCH v5 1/3] monitor: add new Intel extended telemetry events Joseph Hwang
2021-06-29  7:47 ` [BlueZ PATCH v5 2/3] adapter: read quality report feature Joseph Hwang
2021-06-29 20:27   ` Luiz Augusto von Dentz
2021-06-29  7:47 ` [BlueZ PATCH v5 3/3] adapter: set " Joseph Hwang
2021-06-29 20:25   ` Luiz Augusto von Dentz [this message]
2021-06-29  8:40 ` [BlueZ,v5,1/3] monitor: add new Intel extended telemetry events bluez.test.bot
2021-07-13  2:08 ` [BlueZ PATCH v5 1/3] " Joseph Hwang
2021-07-14 22:21   ` Luiz Augusto von Dentz
2021-07-15 10:00     ` Joseph Hwang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABBYNZJH3Lih+yNdxdre_5zXp4CuNAzek73cTVub0h0rno3YCA@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=josephsih@chromium.org \
    --cc=josephsih@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mcchou@chromium.org \
    --cc=pali@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).