Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1244244rwd; Tue, 16 May 2023 14:09:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Y8RKbZzbP4cQOPNnHL5BMeCvMLQuX2ddmhAnMPi5nQHx/bkzvC+YqaTqbQaHt78YEL3H1 X-Received: by 2002:a05:6a00:1587:b0:649:76a8:df49 with SMTP id u7-20020a056a00158700b0064976a8df49mr24396574pfk.26.1684271384393; Tue, 16 May 2023 14:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684271384; cv=none; d=google.com; s=arc-20160816; b=y7Oa2WxFkQY0nkvuZHYi6gge43RLuz8fN1k0WzdzSmWme+VqlJ7Wc1zhIUDbn8kG7D fKS2I7r6DzQ3kCXJ8s4uDsC/sggxiVglud32XPIOp8/iFYiJLt6H83fKU0vCaruZdp4D RNNo7Cg4ThNXxLyTJ4L+FWrZSWjrwT2Jwe6P4zj6u3JCZLcUAT+/qYjkHAa0Az16r2cQ ESSEwNslDpUcZIV2q9v/4IprSUAHf1AP9FqMvbBE7wWs46d8gSUj0PKxxmKNzRvDAv8Y oLT2/5Dx1FwuEIUvUF/TLVjFJyqdn3kuWJCCtlsRsCSnKxu3Yn0FEh5tlTe6q+46xobn bUUg== 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=ZuVRdfe+vdnbemUH+HfixQhrLU32J907rWSX23RhRpU5S9QTUHSyUZS6rlCM2+4NOl /tBIoF3roUiM+uspLfn0ATsQ1RyvV31L9yjJJfAy2s0fsVxXZcf83yb+2wUYzB0MDn23 f4qIwyke8kl77Jz/HK5ZOnzDjT66xvysK/64MUc5rN91p3rVyES9OiWl3mQ6lUOQjj/D z5Kh3yCmEsEuNvYaIwwFY+5RBp8pcedEi50EZVN3dSPiIj1y3t5YdC+/Ri+53MWCBXU4 wy75tRO0xgviYgCKvQQE/sj040Kd4DvM2O4zd947ZBqcrU+BvKQtZ7S6aN4gXjYPgGlc mRog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=APvcuB4p; 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 a24-20020aa794b8000000b0063806e9892fsi20562166pfl.243.2023.05.16.14.09.21; Tue, 16 May 2023 14:09:44 -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=APvcuB4p; 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 S229566AbjEPU7a (ORCPT + 99 others); Tue, 16 May 2023 16:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbjEPU73 (ORCPT ); Tue, 16 May 2023 16:59:29 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D934559E0 for ; Tue, 16 May 2023 13:59:28 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-52c6f81193cso10228853a12.1 for ; Tue, 16 May 2023 13:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684270767; x=1686862767; 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=APvcuB4pZo2fjFEYaS1tPeo1cGzYn4+rx8CUc+cfsmWjOsy/V8lxX1KHrzVqeVUhjw 3fSI+Twt8fyDU0g0DvQ0vfmP2bLSMBOXJtLmHOjWMH58bTLlZnEDZcgX/88W036O4DU4 4xNI687LfK5YxZAHPUkr7wfBwdUhxvWJ8qXs4nMvRVo16FShykYxe29bA027T9aNEb6B HoAjq+olF+gH8F0YoPw1PrP/wvNBrJCVb8okqUUPUXvKMquUAOWYchb+OSq5AP5xnnsH ewFKURSg1BekfdlVHOf15TYBHFyOnTjFyAYaLaQgdJcAJmJjCspVID5vMMBAvTUxuvh5 mixQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684270767; x=1686862767; 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=d4ivic6Nn7ivWvKGbTyJTYZFhhrJhsfk4CuXi8waOEKBMaUKSQqUS+QL72gr4CMP/F zyEOootjv33zgIIpG3F8T6AiB0/ect1T+tlO3eTuld7OWs11EzPNNtkNYU7tsPBdMZ2V o/LAfl0Kyn5qols9z8wt85wihL5gdRlnpgs5/XS1TLqtxkzMHj69rPewCd+8kUv4X5wx DqRauG2cN+7Vwv0En40rWRZjKKmuEaQn9yxxn15kg77G5tKi4lP7DHyQuSzB2LmuOgHs EqynmIs7++Bj1vrnRV0Y2Fitp+MQqz1/K0YGfAq85wi3WWW6/4qYH0Y+Z6vxQv0FPTGy eriA== X-Gm-Message-State: AC+VfDzL++jNsCX48pI+45tb/5q81j1NImDNiQKlCVK8v9Y0KAQ8X24K K0tS7TfNvoCtBI+J7vYEeEfzYvYY4g0= X-Received: by 2002:a17:902:8c98:b0:1ad:be4d:5dfe with SMTP id t24-20020a1709028c9800b001adbe4d5dfemr21260402plo.27.1684270767402; Tue, 16 May 2023 13:59:27 -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.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 13:59:26 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 01/10] profile: Add support for experimental flag Date: Tue, 16 May 2023 13:59:15 -0700 Message-Id: <20230516205924.1040506-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