Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2598319rwd; Mon, 15 May 2023 14:06:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6XgvHEspgvlNIEx2bg2NDDzT+FKPNOxVZJk3Jf8s9vQ1lr7jIMQHIPZnpHH9wrxBi/4jFD X-Received: by 2002:a05:6a20:3942:b0:102:5e06:1544 with SMTP id r2-20020a056a20394200b001025e061544mr20245056pzg.30.1684184806636; Mon, 15 May 2023 14:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684184806; cv=none; d=google.com; s=arc-20160816; b=GZEGwI1UC1SzCsEgNIvWnvM1ZImNHkasbVVSqWeYO94hRGajFQOVlOEwJWU7XAulLq U/hH7s0TGX+R0tm7Gpeio/wHhpKk5km3KOkYnYNzMYxEZrnvdEBzVDNFJv1833mv18BG iYsr2CT3OXgvBFtZ29keFabUpdT58koLLQUWp3b86+iF9sZzrouQFSYwmRm1w3UpWXE1 pi0MwhhwYNaZ8ttgIqr16DwzaHd0F0F2Ivp1W2kW6VbSIhWHV3p3LVZZs8fOCpR9tJFT jm/FFdeRta9vYLTMakuHVMOSjMpV/g65bGUBQW3qYY84cPMwqpBxFteQwaVRlLVuCY10 d2VQ== 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 :message-id:date:subject:to:from:dkim-signature; bh=gnB5yv9oZNhLgZuBAf3kZHHnyPDEbPfDsi/R/yytOW0=; b=VVNxN92ab4eBLGNG2NZ5atm1eCYiB/V4jcuRdDSLJwJEtj36OGC04U9ihAJ1zbbLtI TFdANMW7rWgZw8k1fk2DFpsyKm9JMcGnr8HO+0tGhjhH/w64ENTK8bBjwwXMJAxHbKUU FFUPE3ducLKD2DosKZPGuBUrQCl+ELhHbIkorBYS/hJQ0c934smeJ4h/sAfB4yItqk65 npqjMmdyXG0jJcnhVjWJj0CHYj2bHr2kEy4Ol5vw82wMKBVSFx2BrIXvJpMLX40vhIJE et9EYXOpUJgznX7Oaz3Zuag8OO+5z2DUVQ8SVXT3stJ9MPQoxMPIMrkWL7CdG/wiCcvR zZ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NmScp0by; 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 w12-20020a63934c000000b0051ba9b9c3f3si16339999pgm.321.2023.05.15.14.06.02; Mon, 15 May 2023 14:06:46 -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=NmScp0by; 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 S244742AbjEOVFu (ORCPT + 99 others); Mon, 15 May 2023 17:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236784AbjEOVFu (ORCPT ); Mon, 15 May 2023 17:05:50 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B32E81991 for ; Mon, 15 May 2023 14:05:48 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-64ab2a37812so691503b3a.1 for ; Mon, 15 May 2023 14:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684184747; x=1686776747; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=gnB5yv9oZNhLgZuBAf3kZHHnyPDEbPfDsi/R/yytOW0=; b=NmScp0by6qPoT6YIURRHO+Ruo2K6rs4p+CScfA1zXNsno3PBOfE9ZGQlbiYJ3baCIz KqVq+Fav8AU3P11qqIBm3dQCg2kuDGHKglhntqvqIQ9PBGtDPjmXFHYg/HYghIPdSOVR o6Kf2QwsxhQKp03KacYoMFp34uXZdgLmdrCyIdL7V4yC2mirzBLHul1DVTp3Bz/AR4V0 kBp8wOfSQ6XV4w/NEEcMa7GRcsKOi7Wm9eIzJ6Gucx+qUg4MuFN+mTuoDHlprSrkNuEb VsbNEps/pwxa4SsFvwGbkg8BW8f3VkLPEYzYkxRPEtM/CegtKZsgr6CtysLgCgpLU4Gt rjuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684184747; x=1686776747; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gnB5yv9oZNhLgZuBAf3kZHHnyPDEbPfDsi/R/yytOW0=; b=hmu1Z0TDTKk7fQ0aC+C/4twecdAuT0VuYid6gvAtEu9+xTSsdKnteJdWILjr07wNE7 O1K9mLeVaJ7h79MSLEpwzu+ZssBl/JvTv1jFyYHQpFBIhcJJVv8ZZXlqxKBbC26ciVFF CnXtele8/d7zAoTAiQj8/A12ZNtmgyX7Zkweif/NcKSWc/KNHmBGjaAebxWeqMIdfqNw zsA9rjuDoRkQG23UCFS5JPNB26b+PrgqquDicYXX+5QM2D/PQhc8FwXpzpU8f+AKZYrU tnYHJ8wZIO+RN3jJmspwC3IJp3D3oS9x1aPIZvn2mX9lW6UeIRldWmic1NkUI24e3Mik SGow== X-Gm-Message-State: AC+VfDwr4cY3gBmEHFQWsawC5xukR8l+HuEr7D6iaaLLgYsVFBV+1Gp8 /IcEwU8HPsMwN1cG1a1vwc91CKMHuSQ= X-Received: by 2002:a17:902:e80b:b0:1a9:57b4:9d5a with SMTP id u11-20020a170902e80b00b001a957b49d5amr46763118plg.31.1684184747093; Mon, 15 May 2023 14:05:47 -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 jb4-20020a170903258400b001a04ff0e2eesm13990050plb.58.2023.05.15.14.05.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 14:05:46 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/7] profile: Add support for experimental flag Date: Mon, 15 May 2023 14:05:39 -0700 Message-Id: <20230515210545.718701-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.1 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_profile so the plugin can indicate drivers that depends on experimental to be enabled. --- src/profile.c | 6 ++++++ src/profile.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/profile.c b/src/profile.c index e1bebf1ee19c..ea188f36b6dd 100644 --- a/src/profile.c +++ b/src/profile.c @@ -775,6 +775,12 @@ static struct btd_profile *btd_profile_find_uuid(const char *uuid) int btd_profile_register(struct btd_profile *profile) { + if (profile->experimental && !(g_dbus_get_flags() & + G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) { + DBG("D-Bus experimental not enabled"); + return -ENOTSUP; + } + profiles = g_slist_append(profiles, profile); return 0; } diff --git a/src/profile.h b/src/profile.h index 6827f848148c..6871f2f0d7d8 100644 --- a/src/profile.h +++ b/src/profile.h @@ -28,6 +28,11 @@ struct btd_profile { */ bool external; + /* Indicates the profile is experimental and shall only be registered + * when experimental has been enabled (see: main.conf:Experimental). + */ + bool experimental; + int (*device_probe) (struct btd_service *service); void (*device_remove) (struct btd_service *service); -- 2.40.1