Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18100538rwd; Tue, 27 Jun 2023 11:36:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SLbUoyWrAiIQ+JIpbItowR+7qfn3Z9ChZSnBKFEpdk1dOLKBmGVsLiTNU3a2QprZToRYK X-Received: by 2002:a05:6512:3e0e:b0:4fb:393:26c3 with SMTP id i14-20020a0565123e0e00b004fb039326c3mr6176596lfv.15.1687890976078; Tue, 27 Jun 2023 11:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687890976; cv=none; d=google.com; s=arc-20160816; b=AluiXGhAjmP+Ap2sv/MmU+HCmFH/xG/yhWIudf/IgK57aJwifRcpy/h3unz79/ijr5 L/uub/hv9FVoC3iSlECvh+txMQKcKpYOew5Ztqdd7/YMiUALJehdctHL9vtpYzgIuDB7 X5mcEir4d4KBZjDlCe3SLuD/FlN0uS1qwZ2OD+YhWOsOPKa1GK+ZlSBcojF7vu3PZIQd GCYQcfcglKl8cVoSGxWTo4nVuCQnLVaRliZPy13r5FgSH0FacS5YZb27VMispH0uZp2F Lu6r45OiqsQjBx1cjDJdGIHAEErDEmX5/eZQwLbQiSyVzDlwM7Cc0I6U2vy8xFIkPpS/ 2p+Q== 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=G3DxDLP4ztWSHylATKMTFx64DJDNnIk64xtNy3EbVLc=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=LufVANr0bOGRM23OBpIpiI+CzM/bbrQfV7K8rObeDvHlLTJZ3OHcQfiHFSeI3YXB8Q KuctsHhK+vrlZLPGRMCljyIzyRRv9WJuyoV6H3SpUPBtPW2LZ32JnMfpkmQ1pT70rlI1 MpqemHv7t7Ttlvn1NkN8GuxkacWcGOYDHPCbMuLoGnNUFX+KJdD8pMJZ9/rkpZn62JTf 4OmaXulLisEAsRbBPnxGJF6r34rcG7cJ/PXvusDZ2oaXvzKSmc9RCnrFjBiBYJUwgBOn Il6vviheP4JUpqCKa8BiQEmvkO19aricf5bhMEl9pP/oSw+cOIVOChjsxytAJPDW5zfE ee3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UjyPhxmx; 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 h11-20020a50ed8b000000b0051d9df53acasi2254124edr.236.2023.06.27.11.35.39; Tue, 27 Jun 2023 11:36:16 -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=UjyPhxmx; 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 S231519AbjF0Sf2 (ORCPT + 99 others); Tue, 27 Jun 2023 14:35:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230113AbjF0SfS (ORCPT ); Tue, 27 Jun 2023 14:35:18 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D8A12D54 for ; Tue, 27 Jun 2023 11:34:53 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-7836e80b303so65322439f.0 for ; Tue, 27 Jun 2023 11:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687890888; x=1690482888; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=G3DxDLP4ztWSHylATKMTFx64DJDNnIk64xtNy3EbVLc=; b=UjyPhxmxQsfnfoWIFHHuA5pctgniFaHZ/DOM1xzT76OYUvsJbaIwACxGFMOMC0G5YV Cut0HwgaI6MaePsnv2iZWZEg7w36imCtKzyB9Ews5S97qmvc6PMF79V4bsNnRepoW0DQ K6AxGzw/2k4U4IYRs1LOlj4xIxGvBNmlhHxH3ScksA5yjdZ++Qf8Zv7AYURpRhwRCjrL B+DZp8Bi9/iLhcH/pm8syECiJ7wndtl0N1T0hmnsKML5VxegTUvJ81D/I7RaFhdHm3mt ze7qxKsk6c+kyfo2aCwApFMbksbKoNFRpKAsA6GRmrrlG6XLA9NCHGUEnDJn0OtQTTMA lSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687890888; x=1690482888; 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=G3DxDLP4ztWSHylATKMTFx64DJDNnIk64xtNy3EbVLc=; b=gWdjQh3pYiNRNnQNA35wMMIIO7TK8WRLnjrRDukve/0ybwi53iRhnGZkVpwXNHw+JU Le8M/nbsydPCNCHIFH5/Wrh4AHmpSpz+3JUzeu00vBpQByVL3PYvkraDcmmlvxzexXcn PiQQcrkrKwdqyhNc9rETA7qCuvOwI0fX0ejtA3RvE0GnHu2kpUIzFmLAcDnWXbuQmrVT 1dSG0SsdGJiDcT6We0deZGSQfPAAFhEuXyLDEfEsRgrEaB1XE/LjezbK9meEUCHmzNf1 5+4eT4t5pcSyfhbaM3n/Y4wVgxa3VUN2fhGqAAcrFrSw5v0lak4FXuP+q3gVabhPC6X8 KcHA== X-Gm-Message-State: AC+VfDyfhq+S+9n2Qv81H9xpr9CKLSGQflNW4O8ObsH6BGB62PTobbqW LCWCZLZ5SPCserEQ+RipLYhjx3f1iO0y9yjb X-Received: by 2002:a05:6602:22cd:b0:783:63f9:55b9 with SMTP id e13-20020a05660222cd00b0078363f955b9mr5118576ioe.16.1687890888400; Tue, 27 Jun 2023 11:34:48 -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 s5-20020a02cf25000000b004266f6fa389sm2632106jar.175.2023.06.27.11.34.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 11:34:47 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] shared/bap: Fix parsing of vendor specific codecs Date: Tue, 27 Jun 2023 11:34:46 -0700 Message-Id: <20230627183446.2488049-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, URIBL_BLOCKED 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 While parsing vendor specific codecs cid and vid fields need to be converted using le16_to_cpu. --- src/shared/bap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 270f0fd645a2..55f61d91a3aa 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2953,6 +2953,11 @@ static void bap_parse_pacs(struct bt_bap *bap, uint8_t type, return; } + if (p->codec.id == 0xff) { + p->codec.cid = le16_to_cpu(p->codec.cid); + p->codec.vid = le16_to_cpu(p->codec.vid); + } + pac = NULL; if (!bap_print_cc(iov.iov_base, p->cc_len, bap->debug_func, -- 2.40.1