Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3605707ioo; Wed, 25 May 2022 04:28:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd6ceo6Jbmpcsq3dhelq0oPmDoNageo0YzW+zkxj5jzDnUFGgEoWZ187mm1w0ICwFPD0RI X-Received: by 2002:a17:90b:811:b0:1df:986b:1168 with SMTP id bk17-20020a17090b081100b001df986b1168mr10060038pjb.15.1653478114280; Wed, 25 May 2022 04:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653478114; cv=none; d=google.com; s=arc-20160816; b=B9sU2AxJfjtc/AZGjUUps4YL0LG4X2sjfCx50ZXznk0FEgz725uCK98CJmGWF4wVvL Tgq1dgLCHNZhCF9Zakd1f6gMa8tuXiq9dBCbN8aT5m1iYjRMVrLPguoSwlRwWkj6KC9H hVcTxQlcC2bPaNhSFG1lg+kLpIDnMV7mzWSa1AFMGHOkHI7HQsSEFWy3BDPXui9gK93v GjUy4Cpsy0/jGcLMXh7HT7The7DlrRikq96nJ2KueyS+qBUAVf7udX5YcUIMS/hNuPhQ 33oKzlb6yzjZ9cwRAQIIY+TcwpSmLylxCaT68rV48O/Eck0MF6GDNZUWOUlzuJ96bKS3 r/JQ== 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=onOqx5Fpa2xZe+G9sIa3BkOaz4cWIfCQZPOA6oQs8qQ=; b=ljU/XZCtTndbrw0psHildFTzFceepTl+gxRHTqmlNAAPen/t6R5RXqHkY6kCHjGUIA q8RXjFxROrx1E0VmKn2q2SLZ6bXEFN/FoPoeK+ijlcinbOrtZKfZamye1X11GIKPAIV1 6YaY8TrCRWlsS6xsSvTIa58nmzRUR08htVGE+g0LP/jC+cN2Tyo2arr80gMunasbKYcZ yoL34sPSwVZd23YFkQhAMoS0GwevJ7Rd01WM3DHvw7Uqv5XXXc3SiGMb12CPQZGPmju1 g78EQ73tChNkMQ6hvLCTAwtZkTuvMnsnPgtVEkEH6izvPrDcs7N6Va6PuAX/+z4L6VDL POCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IXjmgcxb; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl6-20020a17090b384600b001df2b1d9d3dsi896454pjb.123.2022.05.25.04.28.17; Wed, 25 May 2022 04:28:34 -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=@chromium.org header.s=google header.b=IXjmgcxb; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229800AbiEYKue (ORCPT + 99 others); Wed, 25 May 2022 06:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiEYKue (ORCPT ); Wed, 25 May 2022 06:50:34 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F029588 for ; Wed, 25 May 2022 03:50:32 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id w3so11604366plp.13 for ; Wed, 25 May 2022 03:50:32 -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=onOqx5Fpa2xZe+G9sIa3BkOaz4cWIfCQZPOA6oQs8qQ=; b=IXjmgcxbc3bJEpVVSy61Wg++pKXd1UxYPK5nb3b32bZr0DdFpECl/JlkkUrXVaqphj bQgqIp5tJzyKepiEvh4Z46KDO50ksv0+6M7dtWO5dpMRQ9CGE+Ia4hhQ5TvTWlLRPUGA 0PFAR/egqCHVisyZEmKiMEPfh9h/cGoPOST3s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=onOqx5Fpa2xZe+G9sIa3BkOaz4cWIfCQZPOA6oQs8qQ=; b=RT43/dOhWoT8CW6D5YNmtYNOzSx8wECAvg0XzYATLN7lQAg1qI28c40vlWssqFLBZZ rRW8LdqUVEBjVamcJ0avWFcUOPTPO+6FG4tYlLe0VqUd6nhCYgvAceZOPa4Lo023muh+ DMuRuxyxxkUAsAuW4v/Pktvq7GB24GrbyRzDUAjiy+E9Hc//UYa5wjZ3QfCtGMc+Ir+n yTmxdJctH4ofuLO6jf9mV7zO3Ds70e/eUaEmB6G3opjmuCZ5o+N2znSsPBIcvxickIl2 8LEMrWCgmbMGMmL7h9JZdbqxLU5hnIPuN4yR+z8MN1JxTDkq54rQ+bfmC8XisYeAwNpj yLdg== X-Gm-Message-State: AOAM530M28N2bJEu64HVoazd1fuCTQlIb36UVky/Xp2STPEpVAeH7f4m UFRz0JzX/Z5vn53a6koCbQXHu8g04HdJqQ== X-Received: by 2002:a17:902:ec8a:b0:161:7ca5:eced with SMTP id x10-20020a170902ec8a00b001617ca5ecedmr32292930plg.17.1653475831440; Wed, 25 May 2022 03:50:31 -0700 (PDT) Received: from localhost (174.71.80.34.bc.googleusercontent.com. [34.80.71.174]) by smtp.gmail.com with UTF8SMTPSA id a13-20020a17090abe0d00b001cd4989feebsm1203709pjs.55.2022.05.25.03.50.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 03:50:31 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Joseph Hwang Subject: [BlueZ PATCH v5 2/8] lib: Add structures and constants for quality report command and event Date: Wed, 25 May 2022 18:50:09 +0800 Message-Id: <20220525105015.2315987-2-josephsih@chromium.org> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog In-Reply-To: <20220525105015.2315987-1-josephsih@chromium.org> References: <20220525105015.2315987-1-josephsih@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Add the new MGMT struct and constants to lib/mgmt.h. --- Changes in v5: - Use quality_report instead of action in struct mgmt_cp_set_quality_report. - Declare "const uint8_t data[];" Changes in v4: - Combine both MGMT command and event changes in a single patch. - Fix namings of QUALITY_SPEC_AOSP and QUALITY_SPEC_INTEL. - Use "Quality Report" without the prefix "Bluetooth". Changes in v3: - Swap AOSP Bluetooth Quality Report Event and Intel Telemetry Event. Changes in v2: - This is a new patch for adding the new struct and constants. lib/mgmt.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/mgmt.h b/lib/mgmt.h index 922a24367..fd59ef6fa 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -96,6 +96,7 @@ struct mgmt_rp_read_index_list { #define MGMT_SETTING_STATIC_ADDRESS 0x00008000 #define MGMT_SETTING_PHY_CONFIGURATION 0x00010000 #define MGMT_SETTING_WIDEBAND_SPEECH 0x00020000 +#define MGMT_SETTING_QUALITY_REPORT 0x00040000 #define MGMT_OP_READ_INFO 0x0004 struct mgmt_rp_read_info { @@ -757,6 +758,14 @@ struct mgmt_cp_add_adv_patterns_monitor_rssi { struct mgmt_adv_pattern patterns[0]; } __packed; +#define MGMT_OP_SET_QUALITY_REPORT 0x0057 +struct mgmt_cp_set_quality_report { + uint8_t quality_report; +} __packed; +struct mgmt_rp_set_quality_report { + uint32_t current_settings; +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { uint16_t opcode; @@ -1032,6 +1041,15 @@ struct mgmt_ev_adv_monitor_device_lost { struct mgmt_addr_info addr; } __packed; +#define MGMT_EV_QUALITY_REPORT 0x0031 +#define QUALITY_SPEC_AOSP 0x0 +#define QUALITY_SPEC_INTEL 0x1 +struct mgmt_ev_quality_report { + uint8_t quality_spec; + uint32_t data_len; + const uint8_t data[]; +} __packed; + static const char *mgmt_op[] = { "<0x0000>", "Read Version", @@ -1172,6 +1190,7 @@ static const char *mgmt_ev[] = { "Controller Resume", "Advertisement Monitor Device Found", /* 0x002f */ "Advertisement Monitor Device Lost", + "Quality Report", /* 0x0031 */ }; static const char *mgmt_status[] = { -- 2.36.1.124.g0e6072fb45-goog