Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5604425rwb; Tue, 22 Nov 2022 02:16:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf6gihO9Rua23LctrtYwJF3CuJGuJwD7B30bXc8qv0hRhgzO0j3Y4+zSAfCZj1df7L8WyaBg X-Received: by 2002:a17:902:e886:b0:185:4ec3:c703 with SMTP id w6-20020a170902e88600b001854ec3c703mr4992059plg.165.1669112207988; Tue, 22 Nov 2022 02:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669112207; cv=none; d=google.com; s=arc-20160816; b=pRJRhiEtPeDyXGmOmU+CKQ16e/bUVn44hOq4JVl7NTjnRZT8FgmDNNFjYg9SCVEF88 Cp7ZEVX4vDeav2bht3s6ffdMo/Yd4CJfIdfJkfH3mVyT5RBGiKgPwI7Ljnms+wqp0Bxm d2VhoD4fFAeslZe3G/JD6u5/hVU20pwuajeu8rwqMikLPRsvCOQaWqp0CuBc28lugkQ6 Xf/wKNahTqUhd6NZuMLfxu/npwxXGnf7f0gwKcX7lxaDc4IQsUcqTl2vrDpQXkMlswow 8zd8yzP2WEQC1cnBiz3+y1PIvYoDZp15a3Ew/+WuOo3ErdyTzW8hXNudelTObJkMNIXA qT3A== 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=IYY2TlXEfwCAr1Kk3iIGQffT6Xzm7I918VkL7q5sPHY=; b=R/ugKi5aCzmO6IZfs17e5W2z4cTsS9g5XBoLu9Iys920hCL1CTLPvpZS2FykmSsRBO LdrFn1+xKHV2lbPJ9xq7/adE9mO/7xWOKTgBxDMOQgPr84HMQYmff2Eubf6OxMvHCZ+1 AZ71EtWL7t67cqJxjfsoidxXBMe68jC02+Dzo8MFztbBk+kXKl/WtSFn5cpQgTvL1ZyF FMm6qFnssS0olD0J3IMhcC9eWAyKP+IAjNxNDhnjruYI7E5GdfeYziFPPo3F9jtSvA3d FEZ/znAJyP1dS446hG+j/hfOjrVGX+fNijtUaKiEC4GYmCFThRXmtlCBskba6eNKi+ar gh4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O9audZpc; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl2-20020a17090b384200b00218a33228e7si8574885pjb.158.2022.11.22.02.16.34; Tue, 22 Nov 2022 02:16:47 -0800 (PST) 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=@intel.com header.s=Intel header.b=O9audZpc; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233305AbiKVKLH (ORCPT + 99 others); Tue, 22 Nov 2022 05:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233169AbiKVKLC (ORCPT ); Tue, 22 Nov 2022 05:11:02 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C955053EEA for ; Tue, 22 Nov 2022 02:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669111859; x=1700647859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n4HQ33z5nrOXbGGIMeRdMYcJ7Biv0C4WPe9UtFDl0cs=; b=O9audZpc/R8TQq0Jx5B7Y2gs2Y12MuYhNlaIBSQPDWP0fDC04o13Xdfi vdI6fP4QzuRgem8lry0Zg5FWoGb3B8XDNbbJyz6zf4prlVYWES8yhB02w U6GD8wyKVGPcY1CJ2nEAsWSC9hxo+3MD1/EeUturFuDyg4VoMdFRSfViu QqUSx64kSEKUV442MGTeZCnCnnDxyLjAjdpy7r9YSGSAQZzYkWrDPNg3l 9yjhqRGB0pIh5f13QH5vfvY4ewro4sdsE55CloQfc7zh/nEt+sXZOIysx pthdms7HKJw3R+fKvAC6GSXWEBnSycWSYP8Z5npVwnJ8VPFENExHSafAQ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="378039375" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208";a="378039375" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 02:10:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672431947" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208";a="672431947" Received: from intel-latitude-e5450.iind.intel.com ([10.224.186.32]) by orsmga008.jf.intel.com with ESMTP; 22 Nov 2022 02:10:58 -0800 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH BlueZ v3 6/7] monitor/att: Add decoding support for CSIP Date: Tue, 22 Nov 2022 15:42:31 +0530 Message-Id: <20221122101232.45320-7-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122101232.45320-1-sathish.narasimman@intel.com> References: <20221122101232.45320-1-sathish.narasimman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 This adds decoding support for CSIS attributes > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84) < ACL Data TX: Handle 3585 flags 0x00 dlen 22 ATT: Read Response (0x0b) len 17 Value: 01761fae703ed681f0c50b34155b6434fb Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84) SIRK: 01761fae703ed681f0c50b34155b6434fb > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x001b Type: Csis Lock (0x2b86) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Handle: 0x001b Type: Csis Lock (0x2b86) CSIP LOCK: 1 > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x001e Type: Csis Rank (0x2b87) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Handle: 0x001e Type: Csis Rank (0x2b87) CSIP Rank: 1 --- monitor/att.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/monitor/att.c b/monitor/att.c index d14cbd165697..6fd740aa4cd4 100644 --- a/monitor/att.c +++ b/monitor/att.c @@ -1733,6 +1733,73 @@ static void pac_context_notify(const struct l2cap_frame *frame) print_pac_context(frame); } +static void csip_rank_read(const struct l2cap_frame *frame) +{ + uint8_t rank; + + if (!l2cap_frame_get_u8((void *)frame, &rank)) { + print_text(COLOR_ERROR, "CSIP Rank: invalid size"); + goto done; + } + print_field(" CSIP Rank: %u", rank); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_lock_read(const struct l2cap_frame *frame) +{ + uint8_t lock; + + if (!l2cap_frame_get_u8((void *)frame, &lock)) { + print_text(COLOR_ERROR, "CSIP LOCK: invalid size"); + goto done; + } + print_field(" CSIP LOCK: %u", lock); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void print_csip_size(const struct l2cap_frame *frame) +{ + uint8_t size; + + if (!l2cap_frame_get_u8((void *)frame, &size)) { + print_text(COLOR_ERROR, "CSIP SIZE: invalid size"); + goto done; + } + print_field(" CSIP SIZE: %u", size); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_size_read(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_size_notify(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_sirk_read(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + +static void csip_sirk_notify(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + static void print_vcs_state(const struct l2cap_frame *frame) { uint8_t vol_set, mute, chng_ctr; @@ -2413,6 +2480,12 @@ struct gatt_handler { GATT_HANDLER(0x2b7d, vol_state_read, NULL, vol_state_notify), GATT_HANDLER(0x2b7e, NULL, vol_cp_write, NULL), GATT_HANDLER(0x2b7f, vol_flag_read, NULL, vol_flag_notify), + + GATT_HANDLER(0x2b84, csip_sirk_read, NULL, csip_sirk_notify), + GATT_HANDLER(0x2b85, csip_size_read, NULL, csip_size_notify), + GATT_HANDLER(0x2b86, csip_lock_read, NULL, NULL), + GATT_HANDLER(0x2b87, csip_rank_read, NULL, NULL), + GATT_HANDLER(0x2b93, mp_name_read, NULL, mp_name_notify), GATT_HANDLER(0x2b96, NULL, NULL, track_changed_notify), GATT_HANDLER(0x2b97, track_title_read, NULL, track_title_notify), -- 2.25.1