Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1245316rwd; Tue, 16 May 2023 14:10:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AsOW/6uQ3XReahgJ3dbB93gsUX5F+lA0u8tZhJRojRatTIVkIOV6BV3dGTKGRBoY5cH90 X-Received: by 2002:a17:902:dac7:b0:1ac:9103:45aa with SMTP id q7-20020a170902dac700b001ac910345aamr37073812plx.49.1684271448484; Tue, 16 May 2023 14:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684271448; cv=none; d=google.com; s=arc-20160816; b=EyZ392TFjYtywTv9xRAbCK/JtlfM3XJF//0zmRBl2at1MEMltLPqBs2Bf+c9fEi102 8xbK3N3ts237aFOyk9d1vn2N03VKPm1dSbrLIT4ySQFrI8CVecD8OW+wXEAc9zcNBoZm mO1+ggvWXQ3NJY7r4xMoRK1FvnlWDZolblMs/uUlndtvCbtrBU9J+F2ogVzXJtHBOUV5 Jjg3y4M/zOUYQSd2iWz4YoJjUxwumPWRkSOpfhd4/EDVN+6upHZyWHNtAypCuNegNTd2 nYRudOj/I/scPB4VjV8wK59TConDczJt2bfOwpmi8olDtnkomkRv40hr6I9p5dbxgQUm CZAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OgDPveaF1MKTU1yCjzGD+PxL+UXDSV/Fo3bJbJP/EvU=; b=gyfedRBMiaZr/CGuRF6mO6SQ9kEUzonJ1edEbUsCEsepmkOOTSSiU8ApQqqgDN7E7D J747EoN1AaGMjrs5PuQg7Myce5CCxvdOAYh9gRThLlq99eTOirCcwn1Ojl7dW6bqAKRw e08f8f10cM0ySLmXHTPM/6OTnJnU+4CWvBacU2/q2sGaDtw6NJbV50HS5rvkRE+xMeCg YT9kTR5NffFXLstCD9sW3hdza3oR7WbzoQyEzdXEBv3G2SniGx8Hs0HvW8lptY4fyXl1 r50mqiDEMbTD3Baoqq5jxHJUqdS/rnI+0sxpu0l1pG0q8FV/OK5w4q2AY6QMJZE6/uY1 DYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BxzhYOo8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v202-20020a6361d3000000b0051b15b58764si18846160pgb.343.2023.05.16.14.10.08; Tue, 16 May 2023 14:10:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BxzhYOo8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230008AbjEPU7r (ORCPT + 99 others); Tue, 16 May 2023 16:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjEPU7q (ORCPT ); Tue, 16 May 2023 16:59:46 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF3865B87 for ; Tue, 16 May 2023 13:59:40 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1ae3fe67980so1280285ad.3 for ; Tue, 16 May 2023 13:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684270779; x=1686862779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OgDPveaF1MKTU1yCjzGD+PxL+UXDSV/Fo3bJbJP/EvU=; b=BxzhYOo8B2GEXcd6aH9MTpDZDG+sYBrZMJe/EhApcSFEQ8eyfj1YuSwj/ncB5xzwJX ENz/hsu33BZnsYry+WbCKYkYyr4gHpIeFRM3wFEHziafuRb8BG7BZAer1XHCvRhXv9it Bz5UM5/MgnBHQekBvVcMpajzSlDB6NiEKhxa3GItXhJ5I+kWoDO0f324oE9jZP9Owmcz iKqdsnmNf1vAfJeX6Ex3Y/zJm/ZFF78SuUzjpDOlOzVdz914Hdfkgfh2y+rF/XcM/7NP PIAfwCBM8fUU0O53OmteErVW17Kaj7AQs3KETyEfMemI+ypwj5XpFmERv5ilNdnUymT+ 8yrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684270779; x=1686862779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OgDPveaF1MKTU1yCjzGD+PxL+UXDSV/Fo3bJbJP/EvU=; b=Erg0AmwQypIl2WtOCoAGuTwcB6jodk5pFqob6khDopw/BJrfU613jDrpuEVKMfwygq 4zBYoSwwC1ETCjfgiJiw06VngaxK0RI/1jDpP5zW7k33YCY8L41aifxOPPqo0ikxgyrU sSST2pURRuhflafq3W6izFWWvr5ZwVowAsPaWDyOeRNw43Qo/tMq71OchR6JKmKTNmxc yh9szXlO+MbapAMHTWhgcl6/DSJO9x2fdJN3au6hTNeDO6IzFLKn05qh+RGDvEojYCJ8 dYinZIRaSdJL+FQjYLQLm++hmNOjh2TWYVOrSsrTScYTN9Utcqb5op7v+nUMaCkYbnx9 R2dw== X-Gm-Message-State: AC+VfDw7Ovpf0YPnpTNQ9qn0IA2/6Wx3acJ8TGxSQvNsVhJrm7+4VUvp Qg1bjELHSY3MkiTm45ko+iJPI1+7XQo= X-Received: by 2002:a17:902:d4cf:b0:1ac:6b92:70c8 with SMTP id o15-20020a170902d4cf00b001ac6b9270c8mr47747774plg.48.1684270779415; Tue, 16 May 2023 13:59:39 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id t16-20020a1709028c9000b001acad024c8asm14272237plo.40.2023.05.16.13.59.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 13:59:38 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 08/10] adapter: Add support for experimental flag Date: Tue, 16 May 2023 13:59:22 -0700 Message-Id: <20230516205924.1040506-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230516205924.1040506-1-luiz.dentz@gmail.com> References: <20230516205924.1040506-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds experimental field to btd_adapter_driver so the plugin can indicate drivers that depends on experimental to be enabled. --- src/adapter.c | 6 ++++++ src/adapter.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index cc7f891d96d9..74ed52468b81 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -7447,6 +7447,12 @@ static void adapter_stop(struct btd_adapter *adapter) int btd_register_adapter_driver(struct btd_adapter_driver *driver) { + if (driver->experimental && !(g_dbus_get_flags() & + G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) { + DBG("D-Bus experimental not enabled"); + return -ENOTSUP; + } + adapter_drivers = g_slist_append(adapter_drivers, driver); if (driver->probe == NULL) diff --git a/src/adapter.h b/src/adapter.h index a45ac1bab00e..32e49a933b13 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -127,6 +127,11 @@ struct btd_adapter_driver { struct btd_device *device); void (*device_resolved)(struct btd_adapter *adapter, struct btd_device *device); + + /* Indicates the driver is experimental and shall only be registered + * when experimental has been enabled (see: main.conf:Experimental). + */ + bool experimental; }; void device_resolved_drivers(struct btd_adapter *adapter, -- 2.40.1