Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1223691pxj; Fri, 18 Jun 2021 02:19:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTi9MeVC/JkBhxaPM1uQIvY1AJM/DwMuMGz6FcdXVxLaLUIN62H0Ajz3wWGCSFIMtYnt3z X-Received: by 2002:aa7:c845:: with SMTP id g5mr3688049edt.306.1624007998943; Fri, 18 Jun 2021 02:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624007998; cv=none; d=google.com; s=arc-20160816; b=Sv8GwY4x9vDXtJdVVhuy9095lJ5GlDsLEVxpR9T4YzLncGQQAT7PNDGPgeTXleAewC l/ml34yuoqG57nqiQf4fDpiFEuxZ0qazOKDPipKzh4YbQ+ytrUer9asMs5dWLkb3fue7 owxNjX6br0I3ZJWuUYv/94wXPn5xUVe2q1vgC7v3a05DDc6KkkaG4RusLcLBAyIUKvx6 3n2z4sGIBBiOVH8+RknkNufiE4/f6+JWGr6NFz0CsdDI0jjAHwA5pP2Ie3/8ETCQAHHT qWSj9LNlnVyGPJ9pde9EP8w5XrJxytLkmh4lmtrl+3G7QmjdZQMYhcSXDeZL0QwUIqh/ Sv4Q== 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:cc:to:from :dkim-signature; bh=bd+JbqqQvFt5UeiAkvRJ3FcKn5AhxTMILl+CgIEd1Q0=; b=xM1qiBclGGicJXehkf6N9g7k8lbDTE+BgjML//YxukSlN1IskVLMFvw+wec8hdGe+K 5YnY/GodRaBP4eEg5XZaiO9BmjhsqBvwoaWJqhdTLfLJURQ/hKFS7X7njpgS2vtYFyq6 ackN2uHRaVvBsIbzlEmLiV+vx8ePESBIF51IAU4Tc7RteJTTWQTz2Zo/JRsGg4Izqa8F uFMgT12nzSB3YKql0F0JBS1R5S+Farj+x8W0/74YJ363r0+38yyGldH4itKscCokICfT bPnAR7VHYtcZgH+wz8fLgwTFVPWaDL54vIT3pHSHbJqKA/dHGbYQIshc7xtVxMM9CzG+ BCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MCsmvuGn; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si1880178eji.692.2021.06.18.02.19.35; Fri, 18 Jun 2021 02:19:58 -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=@chromium.org header.s=google header.b=MCsmvuGn; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232445AbhFRH7q (ORCPT + 99 others); Fri, 18 Jun 2021 03:59:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbhFRH7l (ORCPT ); Fri, 18 Jun 2021 03:59:41 -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 6C3DCC061574 for ; Fri, 18 Jun 2021 00:57:31 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id u190so3309474pgd.8 for ; Fri, 18 Jun 2021 00:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bd+JbqqQvFt5UeiAkvRJ3FcKn5AhxTMILl+CgIEd1Q0=; b=MCsmvuGn+MlgYJj+F2WezfEUiCXPm/dyoKmi/pjPx5t7JYXCW+BVsDjYuFM2lo7pnH Riz5Kwg5mb2E6+EMl7jW+4mJKRT2IwFaVfEUx8mg/WfZfRVKHpmHNlk58IUOYEMSu6p8 5WR57JHzWABwbyjHvc7MqSm8X4sVM1zCu2Ahg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bd+JbqqQvFt5UeiAkvRJ3FcKn5AhxTMILl+CgIEd1Q0=; b=AUk31SnPySe3xKq4x7IvCD2j1V61xFOqSYXp2+L3/4enWQmMPcBcf1ezGn8Bq/wyPC F+Bu+93Puz3EapyXwYWSN6AdcjU5pLW1mAd+6xHC9ajZWWbfcrZdtiL83IY3JR8fS0UM HyGzr88MujmJG1niDfA2yZKdqjWN0qgqawqsqeKDBxUleY3SLcpSgFbEDazn+HCQPjMy JuuqsjiG0VcdpuVFl1EZxdFmDKsnduLOnFXtTZfPqPjiaQRjMnyqMjGsodGf+pwQ5u/z ODetwTFMMHP2tHn52+WkV4THqtAgrOOGArTbVgk5UxiOh6+s4tp+cwih6sd6l30TLVOk VQbQ== X-Gm-Message-State: AOAM530RocEvsVFm/O2wEgQUjTap886qEEI0MD45uh6JFIur+Z2kRLxK omR4XAwUD3r+HADATynmyQCHxB57lS7Qcg== X-Received: by 2002:a62:485:0:b029:2fe:ebfd:7e79 with SMTP id 127-20020a6204850000b02902feebfd7e79mr4032011pfe.44.1624003050752; Fri, 18 Jun 2021 00:57:30 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:6cbb:95eb:e2ae:8479]) by smtp.gmail.com with ESMTPSA id z185sm7879219pgb.4.2021.06.18.00.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:57:30 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: josephsih@google.com, chromeos-bluetooth-upstreaming@chromium.org, Joseph Hwang , Miao-chen Chou Subject: [PATCH v1 2/3] adapter: read quality report feature Date: Fri, 18 Jun 2021 15:57:16 +0800 Message-Id: <20210618155610.v1.2.I7d16f055bc51ac86915c114c671743f49a1fc226@changeid> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog In-Reply-To: <20210618155610.v1.1.I832f2d744fe2cff0d9749e24c9ec27071fa0b4ed@changeid> References: <20210618155610.v1.1.I832f2d744fe2cff0d9749e24c9ec27071fa0b4ed@changeid> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds a new UUID for the quality report experimental feature. When reading the experimental features, it checks if the new feature is supported by the controller and stores the value in the quality_report_supported flag of the adapter. The quality_report_supported flag could be used by the bluetoothd to determine if the quality report feature can be enabled. Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang --- src/adapter.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 98fc78f1e..e2873de46 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -284,6 +284,7 @@ struct btd_adapter { bool is_default; /* true if adapter is default one */ bool le_simult_roles_supported; + bool quality_report_supported; }; typedef enum { @@ -9234,6 +9235,12 @@ static const uint8_t le_simult_central_peripheral_uuid[16] = { 0x96, 0x46, 0xc0, 0x42, 0xb5, 0x10, 0x1b, 0x67, }; +/* 330859bc-7506-492d-9370-9a6f0614037f */ +static const uint8_t quality_report_uuid[16] = { + 0x7f, 0x03, 0x14, 0x06, 0x6f, 0x9a, 0x70, 0x93, + 0x2d, 0x49, 0x06, 0x75, 0xbc, 0x59, 0x08, 0x33, +}; + /* 15c0a148-c273-11ea-b3de-0242ac130004 */ static const uint8_t rpa_resolution_uuid[16] = { 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, 0xde, 0xb3, @@ -9276,6 +9283,14 @@ static void le_simult_central_peripheral_func(struct btd_adapter *adapter, adapter->le_simult_roles_supported = flags & 0x01; } +static void quality_report_func(struct btd_adapter *adapter, uint32_t flags) +{ + adapter->quality_report_supported = le32_to_cpu(flags) & 0x01; + + btd_info(adapter->dev_id, "quality_report_supported %d", + adapter->quality_report_supported); +} + static void set_rpa_resolution_complete(uint8_t status, uint16_t len, const void *param, void *user_data) { @@ -9313,6 +9328,7 @@ static const struct exp_feat { EXP_FEAT(debug_uuid, exp_debug_func), EXP_FEAT(le_simult_central_peripheral_uuid, le_simult_central_peripheral_func), + EXP_FEAT(quality_report_uuid, quality_report_func), EXP_FEAT(rpa_resolution_uuid, rpa_resolution_func), }; -- 2.32.0.288.g62a8d224e6-goog