Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4701217pxv; Tue, 29 Jun 2021 13:28:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJe4sGiI+vvsjvFYFhuYqf7KNYtgAjBretP5O2lwDB5MkrM5UHD+b1nRkQakobuB/Uwg3s X-Received: by 2002:a17:907:2bd1:: with SMTP id gv17mr31395173ejc.15.1624998496925; Tue, 29 Jun 2021 13:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624998496; cv=none; d=google.com; s=arc-20160816; b=V5T2hpPAx0fvO0ITmOaujDubn/Mhjju+D8K+Tb58HgRXLkmNvnYIVgcjmzxjDXF6kR 0LUY2TxpQJGIn4qUBKiS37BlWNRJv0I6iWaPLgC6gURidKnjBwyPm4GD16iIonxpwLsQ R4rCvLi0pzAQHIflv0xhp3j78X9CaW8guqCIBxzTRxBFBMcI9S2qlVeAcA3LTXJvRBMt /AXTnVW4XTPxkNGKHqd5ADzPNGciIwVy+oF5b9n7i3TSLTq2eaQY3Xq+pzfTH1rzJeeq QlRAx0HDyN2pX9fIT1p6v4/Bp+H4UdeJ5f4ylECZICCBrYLlnSVRYNKbswkk5dE0UBA9 WUKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=L7AbbAbaZz43i7sv1H4l16IhYXIFrDz8xbRFAkERY/A=; b=kIp3uErkfryizO8oAp1r0LNH7xM6KJNAAh161fq6QaIPkCn4jJyzbQqW7mOBvfCZgx RbOJ4EKMJFCj9BRsjVQxH2nMQ+NeGmH1CrjcalSvBZbMQv3/1+yOhD0/Mb7JHczDMIOk G+8F2wX9Wa0+o+6prnq/083zCl8r0xdqKU5E7Z9LolvHT7kLbMdJnoCWqjTwrPt0gaOb 0/dX+xkTuUSKrzReRf4R0N2DdRjo8xb4PChikPEaj7O2RuQuMig6qsog9BlWZc2h2Zp9 ZNqRDA7xHNfqitlmZH/vLCd5ajcF5lh7pTP0l9HlikqnkWdgR2KKKIlekLO8f7z1R0+t i1Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=spLWIwqD; 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 ia23si18846692ejc.8.2021.06.29.13.27.17; Tue, 29 Jun 2021 13:28:16 -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=spLWIwqD; 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 S234073AbhF2U1n (ORCPT + 99 others); Tue, 29 Jun 2021 16:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233801AbhF2U1m (ORCPT ); Tue, 29 Jun 2021 16:27:42 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C099C061760 for ; Tue, 29 Jun 2021 13:25:14 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id i18so935615yba.13 for ; Tue, 29 Jun 2021 13:25:14 -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; bh=L7AbbAbaZz43i7sv1H4l16IhYXIFrDz8xbRFAkERY/A=; b=spLWIwqDSeifKc6USDHRU34VlHGXuHvYJxgARFWFD2Td+AnfH84GTsAmz1s+LzZAU3 /Uk3lkoIrkRXi3bdbIfJCCJOwRT/9QKZIO2voiDuCaJhgg/kjDQ/n4tdFmgLav43qixg i8N1AJkcHvxoNLMfwnfyMxIPvUuMXQzfKrOrzs+3qUaypYaG4+gv6lDFmsTWAxNzXSvf ZOxwHhjDGDEObeqeUvkuKE93CzEO0AgPa13vmDISBX29O3MAvrQQhdRCbB8hwPFYIi56 bn/X7vb4Ye4QbvqRMHXYIjPyMLBUCcvjNjA/aUqlvjAAUxxWmWh1MVtmtV+4DlsKRcqU 80IQ== 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; bh=L7AbbAbaZz43i7sv1H4l16IhYXIFrDz8xbRFAkERY/A=; b=seRw2vQzBmh2f6mCttlaYdF4jvCSRijPu9N65QzAT8N4ar3YBustQe75Ay2H46pKVV 6cQaJ/isYWIvsB2r/MfgreAkPkXbMuuDiJCXaFaQB/2jg4GWEl+eRVOSuoW/Y3CYHRaH al2liUmloqogwJSrYWGKuwZOl79EmaGQ57IO3wikTnIdNgK06Rd14c3edtq+0QeVZW7T EAploOd8F/Gs9jfbj87lDz0b/R2+HZY04PVqbBjCUI0FytthDPvbJJ7jHkK8wE2/yTzd ejKlZJK+11GyR73aOfbtK1g1ganvLlpMmvpul0NjwmrIpvvlgEPPzoMTUK3fZKqQ0Idq G21w== X-Gm-Message-State: AOAM533IDY7JnT/tQ+qMgz6R8IaLwlQQzmenUN74dbqYoPJ3fsVzM0mn JsrBcsDfNGDfJZYDRjjVHrz/PfhR4LsMS+9B1JI= X-Received: by 2002:a25:b216:: with SMTP id i22mr12554629ybj.264.1624998312675; Tue, 29 Jun 2021 13:25:12 -0700 (PDT) MIME-Version: 1.0 References: <20210629154652.BlueZ.v5.1.I832f2d744fe2cff0d9749e24c9ec27071fa0b4ed@changeid> <20210629154652.BlueZ.v5.3.I5b72c623fb8b002a5e1f000149b362af3c01ab98@changeid> In-Reply-To: <20210629154652.BlueZ.v5.3.I5b72c623fb8b002a5e1f000149b362af3c01ab98@changeid> From: Luiz Augusto von Dentz Date: Tue, 29 Jun 2021 13:25:01 -0700 Message-ID: Subject: Re: [BlueZ PATCH v5 3/3] adapter: set quality report feature To: Joseph Hwang Cc: "linux-bluetooth@vger.kernel.org" , Marcel Holtmann , =?UTF-8?Q?Pali_Roh=C3=A1r?= , ChromeOS Bluetooth Upstreaming , Joseph Hwang , Miao-chen Chou Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Joseph, On Tue, Jun 29, 2021 at 12:47 AM Joseph Hwang 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 > --- > > (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