Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6130131rwl; Thu, 29 Dec 2022 07:57:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtL5G2c7AX/cYq71eu1jh+qplNcPv++F4mnkRxHOSKHhYHsuNHzVObkh0jO/9ibzZ4IVZAw X-Received: by 2002:a17:906:eca6:b0:7c1:524d:2bec with SMTP id qh6-20020a170906eca600b007c1524d2becmr24328008ejb.39.1672329465510; Thu, 29 Dec 2022 07:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672329465; cv=none; d=google.com; s=arc-20160816; b=eg3xM+NANasUQC9uo3P0auXkgi8GWtNoBV+KW+hgoYp+NRf/3pUyqtE+zlYaw4N6O+ CvAm71wF1lCg27q2nIrNGZUMOw1vSf+n1g7DMXkNrV3M2lPT1a5GAY3/iVv3sxLDr7Om /a9hofuIcZfUnmkMveMITTS9t3eofF3LmfyP10TQDckwypAOObnXArst22Tepyo0QSmF OUjz5HfWNul7Ids7C932TO+CWcNQ1gqPGVLizqeJjUf+lBpGrrNXs1lID+2kunfXec4T gaGam+ebtME7bLx3RZgCIxpWuPq8v+2o4knkGApdTIg+IdtAOf7GhOhaedhWevc+/urx ZXgA== 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=wRCcL/e5RF36R2LZy6Dv18F+61GrzBuVEpAIfPWENzI=; b=lKB5WC2194HkKAd8Wzzh3Gvz2ZAuNEkRJseR7V94lfWvajjMGcV3i+DEuNmxyNZubb N/6JBGR2Kz1hGRSJ/ergqYYlkKARHymos8RB3ZBv/HgGcwXCMsgVX+OaEOlKV2kwKOZp 5L9SUSuvTILWWZ8YF1blK9b+DTEn/hpLQwBAHDwxq6G9NsHeEt/1N3tZ6DSCLRQbjiof yhnFoXaYX9LmOqYNGzmVLDOZRdNDeIGzFaJhjnm0clhwTnciPH5jBX/KLXD4Gck4KY0q BwdRQKSI/nSlDZHMBPK5jkjG1h0Cgm3pd1JlMGtw1CHeTJ3aPP0YDMnQnVnSDgZjlXbo lAWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dy+TnMdk; 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 nb38-20020a1709071ca600b007bf9de4fe93si14757461ejc.154.2022.12.29.07.57.18; Thu, 29 Dec 2022 07:57:45 -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=dy+TnMdk; 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 S233621AbiL2P5D (ORCPT + 99 others); Thu, 29 Dec 2022 10:57:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233726AbiL2P4g (ORCPT ); Thu, 29 Dec 2022 10:56:36 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6571513F8C for ; Thu, 29 Dec 2022 07:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672329284; x=1703865284; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=haZ63aeQDXjvGiKaqek1vC51gPQbXGUp5JwCERsunkY=; b=dy+TnMdk4aXJD3zHXzd+hwqWGPU9pyDNGWWOoeYbPdGxhrxNWNeKPxYB YMU47c4Djk/tryvtSE1yYz9TTWiKhD8oVq2WRLGc1tDWBaM5KbjDWQ/IX OHqGcSfUp1wedFc/S2jlzaJg5QL9BMSLJNIml7KC6kLEHbEB33fa//g5v v/6/4YA7BwaZnoNgU5n9jYY5hsiEi73CfjZWqnpMN2BbkDtD0tudZ//Yr DjaE3XdNtTpPxKihBJGFEKwY/j58ROD4g0+je8YVoPxgzxkH9AgWBLP5+ 4uz3SK7mXfShPYZNrQBn/8Ha34wZ5ZdreMKF+Pw5mYprkj8c3B3wtCCAB w==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="321139290" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="321139290" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 07:54:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="686024317" X-IronPort-AV: E=Sophos;i="5.96,284,1665471600"; d="scan'208";a="686024317" Received: from tester-latitude-7480.iind.intel.com ([10.224.186.122]) by orsmga001.jf.intel.com with ESMTP; 29 Dec 2022 07:54:42 -0800 From: Abhay Maheta To: linux-bluetooth@vger.kernel.org Cc: Abhay Maheta , Abhay Maheta Subject: [PATCH BlueZ v3 1/6] shared/bap: Fix handling for Company ID and Vendor Codec ID Date: Thu, 29 Dec 2022 21:22:55 +0530 Message-Id: <20221229155257.341327-2-abhay.maheshbhai.maheta@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229155257.341327-1-abhay.maheshbhai.maheta@intel.com> References: <20221229155257.341327-1-abhay.maheshbhai.maheta@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 fixes for handing for Company ID and Vendor Codec ID while adding PAC record to database and responding to Attribute Read Request for Sink/Source PAC Characteristics. --- src/shared/bap.c | 5 +++++ src/shared/bap.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 2919f243f..0cafb75e6 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -344,6 +344,8 @@ static void pac_foreach(void *data, void *user_data) p = util_iov_push(iov, sizeof(*p)); p->codec.id = pac->codec.id; + p->codec.cid = pac->codec.cid; + p->codec.vid = pac->codec.vid; if (pac->data) { p->cc_len = pac->data->iov_len; @@ -2383,6 +2385,9 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, if (!bdb) return NULL; + if ((id != 0xff) && ((cid != 0U) || (vid != 0U))) + return NULL; + codec.id = id; codec.cid = cid; codec.vid = vid; diff --git a/src/shared/bap.h b/src/shared/bap.h index 3558d0445..47a15636c 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -39,8 +39,8 @@ struct bt_bap_stream; struct bt_bap_codec { uint8_t id; - uint16_t vid; uint16_t cid; + uint16_t vid; } __packed; struct bt_ltv { -- 2.25.1