Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1353469rwe; Thu, 1 Sep 2022 17:31:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Af68ZvwpeXULk+5VlS23yhu9cF/QuKjrob+BUgpxx1hV1pn09kf2hQAtCocusWfxMxS2C X-Received: by 2002:a17:907:7205:b0:739:1735:8b9a with SMTP id dr5-20020a170907720500b0073917358b9amr24891334ejc.244.1662078706697; Thu, 01 Sep 2022 17:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662078706; cv=none; d=google.com; s=arc-20160816; b=fpG4VgnpEUPjjsVHqzNcjU7j0mDEMjC/Qz9nMh7HDwg6H41PcYccG+RT1BwQXMdooT VE3ZVz8YwEEYHE6eZ+wWZp/ENbzT7FbbuNC4w5+3dMSRL2A9sJ9Nfvz2YpG8ZT1n2Q0t F+K2s6Vp++tKO4hlDbhHaB1lx9Emw+c1v2dPX4Ugagtn26L4dCxtf1BjuUgcQueC06E+ k4RY5sRXU06qXCOeWL3XmOnniIgqYSu0+9LfKSxWzyANbnsAnyjb0avVIW6S5RjQdU+y HYemmc6/WlSnozyIlY7esbLz/A0wQ1YgRgmOsIq9BTqDAEfswmH1ybW8GFtYuxJp9Uae A/BA== 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=sNx64mG9XeE6HyPYXQSn8k/iXLoWHAOBZBM7roZm538=; b=Cdy/tD4aA8xKoyGF7/c5NQ6H1jdITnZNIdUA+wgHnCLyXuY2lDiiYZKbRqqUdJZRIR 7LWJhUtxVuAj4q8cFe7y4mALuHZ2cu6obZDzAKYp6lKJz8qymVe4kOM/TUxBATKnUiTo erMm5JRCQGGJjyNl3sP5TrOAsiIcwAo1fPQjZuzIhIESOzagkBYZ67oLE+odKox20bcE L2KVkrwrwVDmWupL0+0m4iQVqoo8CBEN4d74SwmVkDTGQrccAvGeSug8a7fMYZM7sndO TLtJF1Lr5q3wZmQ87fEVOyZfRrULgomjpQgUvc9xgImfV34sNbuy8V2MESky2ayikkTP If9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kKn0jsNP; 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 hq32-20020a1709073f2000b0072b11a2a2afsi747817ejc.57.2022.09.01.17.31.06; Thu, 01 Sep 2022 17:31:46 -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=20210112 header.b=kKn0jsNP; 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 S233715AbiIBA1W (ORCPT + 99 others); Thu, 1 Sep 2022 20:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232199AbiIBA1V (ORCPT ); Thu, 1 Sep 2022 20:27:21 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EDD395ADE for ; Thu, 1 Sep 2022 17:27:20 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id z3-20020a17090abd8300b001fd803e34f1so4004470pjr.1 for ; Thu, 01 Sep 2022 17:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=sNx64mG9XeE6HyPYXQSn8k/iXLoWHAOBZBM7roZm538=; b=kKn0jsNP13YF+/i6SaAjZUtRzdQ+C6ZJVlLYgB4wlRwwX7Ry7X+f8kamLuddVVFXb9 nTyM+/JqU7v+r93wAsdvbdhqP7FzabXzHsdg1FPlXYZH2cvYwkPFzxXWrc4IMfgtJlun MLHjVOSgwRoAjXnHI3Q5/V/9pnMWSY3YE94MJWCvMmkp3mrIhnY4FfVMQ7D53wdQxuIv q/v0Ofu4mPTvP2/0hkbZO5TqOMsjgvZHDqEk8IK3ZeWmjgyzC7lbEMzG49sX3OMhTcCb K9pVCLmFvwPwm2QBrKhHMuNONvWqexMDDxZyQAvjF9BYNCcowUpng879dZXttx6bfbCs 9kTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=sNx64mG9XeE6HyPYXQSn8k/iXLoWHAOBZBM7roZm538=; b=t7GhA0O1vabfbEDTStwvFwghj/3EtvpPXRGRIkXEGOrHlfMjE2WuXJKvtTQkMJUwW5 0+NlRPDWHEHCwKfwzBv6eaLRc/eZIfoShT+BQPjHCayzoKHkKEHtZYWa8rJUiXzHTodL TKc2KUBhJncBGzcw6bqOKJ6ny4CgI1noeE+KJvqWW/Jf8iZwnJrP3Lsg01oJRDL+WYun a7ba/O/nE/1GfLxGR7SsLfxiq8uw7c0Jt78hugvMptCkyKJeDkmrbIjE8s2/XT9PMUOW 2bpl7wmrphfqJHFekIsN07drClv5gVHmRXZjW31xaa3nRuFEWTm7nCq9W0IzkMsyMQo9 Hwnw== X-Gm-Message-State: ACgBeo1a3zsJe/1zRje3621xkR0mMV0Oco2ctq0dwVuyv4BZFrIGvb9G IkaxB4oekK90k8MDRk0HTR31zjEk80A= X-Received: by 2002:a17:90a:e655:b0:1fe:4ec3:aba with SMTP id ep21-20020a17090ae65500b001fe4ec30abamr1823100pjb.182.1662078439154; Thu, 01 Sep 2022 17:27:19 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id l10-20020a63da4a000000b0042c0ffa0e62sm137154pgj.47.2022.09.01.17.27.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 17:27:18 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: hci_sync: Fix hci_read_buffer_size_sync Date: Thu, 1 Sep 2022 17:27:17 -0700 Message-Id: <20220902002717.1823748-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.2 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 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 hci_read_buffer_size_sync shall not use HCI_OP_LE_READ_BUFFER_SIZE_V2 sinze that is LE specific, instead it is hci_le_read_buffer_size_sync version that shall use it. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216382 Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_sync.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index fa433896ddc7..41b6d19c70b0 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3339,12 +3339,6 @@ static const struct hci_init_stage amp_init2[] = { /* Read Buffer Size (ACL mtu, max pkt, etc.) */ static int hci_read_buffer_size_sync(struct hci_dev *hdev) { - /* Use Read LE Buffer Size V2 if supported */ - if (hdev->commands[41] & 0x20) - return __hci_cmd_sync_status(hdev, - HCI_OP_LE_READ_BUFFER_SIZE_V2, - 0, NULL, HCI_CMD_TIMEOUT); - return __hci_cmd_sync_status(hdev, HCI_OP_READ_BUFFER_SIZE, 0, NULL, HCI_CMD_TIMEOUT); } @@ -3558,6 +3552,12 @@ static const struct hci_init_stage hci_init2[] = { /* Read LE Buffer Size */ static int hci_le_read_buffer_size_sync(struct hci_dev *hdev) { + /* Use Read LE Buffer Size V2 if supported */ + if (hdev->commands[41] & 0x20) + return __hci_cmd_sync_status(hdev, + HCI_OP_LE_READ_BUFFER_SIZE_V2, + 0, NULL, HCI_CMD_TIMEOUT); + return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL, HCI_CMD_TIMEOUT); } -- 2.37.2