Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2783946rwb; Mon, 19 Sep 2022 09:52:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ifoQ3vGPdEeIbuuQbYqKgqQApV1WN/f3NMUOqQ6BGom38ENAD3gCLuxxbyMxc05U8WMaA X-Received: by 2002:a17:907:2e02:b0:77c:405e:e740 with SMTP id ig2-20020a1709072e0200b0077c405ee740mr13210144ejc.139.1663606373877; Mon, 19 Sep 2022 09:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663606373; cv=none; d=google.com; s=arc-20160816; b=fX3HbKU9ZHVen68VPZ3mLFMnZM/mZGCXRpgo+dwQOGJv4Y/ndGlnlVL8HG6ctMzwYG 2hjCdwrUUYYEe8v7HMLBxqWgwaZ1tqHQYw0HpY8/hgmoffRjhi8vmOMmkgbuevubJSPZ gJREGakKDye55rR76a36MdxbRZYmpAI2nHcUnkdf5EOIIwqQqmX4yD51T+OBsKXT3jbg GyauPEencpIlD8hdgS+7cbcT58qZQn10DPHNz3mz5TGAwQMYkgJP73BwLx5N4fSlSv8S NVsCSpHP+I6Iu8OgYLM6xDKV95zgfMrQYxNF/OzIfBLW7akG7V3pH4N5e1HJPAlI+Ph7 r8Yw== 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 :feedback-id:dkim-signature:dkim-signature; bh=K5EvS7vP8L6M31QM3zmyMgApIJPVaOglFG1TvndhbBw=; b=HyyDuCbOdgwYmr9/E9yQMUQyfZWcikCI6xzOiIzjUDFcSHGe1vBX61AmPeWiByir7F iUze7SnlBvufF1UgcwFxzYc8jfg5NTxO3Ot0QjHR0ZzWpJJL5Z20jQoBktvO0DTXrUae 420vbgV9cr2Q3TjDLRygEcwvPNm1pky1WHt0dIZejJ6oLO2fUyqIBOeHc9l3lV/ERDf5 t7PHNFx0LIkJevsCmKEKct0us16JMHqmUt9zObTDJBtvIuShWW9HmpH9L+tSYX81baCz mt+LT2w2qqD+Vta6BF89Ut+OHWiaqrRtjkCHJdSIkXKBqYQ1Wmk9OqHcy4XALc8HfXPe fLvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=m6kIL4i0; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kR5Bzz9c; 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=svenpeter.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i40-20020a0564020f2800b0045366941d4csi9083884eda.424.2022.09.19.09.52.23; Mon, 19 Sep 2022 09:52:53 -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=@svenpeter.dev header.s=fm2 header.b=m6kIL4i0; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kR5Bzz9c; 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=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbiISQua (ORCPT + 99 others); Mon, 19 Sep 2022 12:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbiISQt4 (ORCPT ); Mon, 19 Sep 2022 12:49:56 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D381FCF5; Mon, 19 Sep 2022 09:49:47 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 96BE65C03E7; Mon, 19 Sep 2022 12:49:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 19 Sep 2022 12:49:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1663606186; x= 1663692586; bh=K5EvS7vP8L6M31QM3zmyMgApIJPVaOglFG1TvndhbBw=; b=m 6kIL4i0AX7Y+QbPyrfAQbkpnc710+D3qXsWg9AoWYBNK5BlE9aJvSJHsDuvGraXU xaLcRHeaCeAOT0uh/j0kuAWFrQL9ZDYg3hzBLxmae1QJipFY7QmjN25moUdes5j4 FupjAXmJ6LpRjh6fA+9kB2as22LmBBcjyRbErCda3SA35VFDZglhb631Scdw+2uj 7860xrECNzIqN/OM2NDbE5UzZn1pEhQPQTep3/th7huBVbArBBZnHRXxEURGMeVh sjNLxxQZhaybkE2aHa/ythGAklLZgf8GvGpWwXYkCr7emSoK93eA6UQpUwaJqVI3 WlW5XfF+k0h3cVUf/BizA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1663606186; x=1663692586; bh=K5EvS7vP8L6M3 1QM3zmyMgApIJPVaOglFG1TvndhbBw=; b=kR5Bzz9cWGSRkxYtO0zBmK2f/iFjm 4e3OMtsG/jDd0RVAB/SEMypxzwlw38Q+7TfTEIVRaL7XpQy/zsPlPA9JfMDFoGsc 8PR+bWni6TVUCNmiFt7MGQa+YZeiMPZGMxMDDSn9BgmU3ABp8+2iKzIMsMDfh3Ml 1av58S34SGukv6w6Ny4XgcT200Uik3SqWfZy4tr04HSyQaX1keY7r0BVSNyCkd/O g6YITj87h3bpi/ofU7aOZZ/effdML61bKKBqgcwoVtDHF5WNV3LAX2M7IsqSOTRz u01pavh6PzsjFe7nZzyi9n5fXGxYhQTwfkH+IWcQ5XeDvSoqV+IT11ywA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvjedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuvhgv nhcurfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrth htvghrnhepjeeiheehkeegvdejhfevkeejgfdutdefhfethedtieffleekieeuudefleek jeegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepsh hvvghnsehsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Sep 2022 12:49:44 -0400 (EDT) From: Sven Peter To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Sven Peter , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Krzysztof Kozlowski , Paolo Abeni , Rob Herring , Hector Martin , Alyssa Rosenzweig , asahi@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/7] Bluetooth: Add quirk to disable MWS Transport Configuration Date: Mon, 19 Sep 2022 18:48:33 +0200 Message-Id: <20220919164834.62739-7-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220919164834.62739-1-sven@svenpeter.dev> References: <20220919164834.62739-1-sven@svenpeter.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 Broadcom 4378/4387 controllers found in Apple Silicon Macs claim to support getting MWS Transport Layer Configuration, < HCI Command: Read Local Supported... (0x04|0x0002) plen 0 > HCI Event: Command Complete (0x0e) plen 68 Read Local Supported Commands (0x04|0x0002) ncmd 1 Status: Success (0x00) [...] Get MWS Transport Layer Configuration (Octet 30 - Bit 3)] [...] , but then don't actually allow the required command: > HCI Event: Command Complete (0x0e) plen 15 Get MWS Transport Layer Configuration (0x05|0x000c) ncmd 1 Status: Command Disallowed (0x0c) Number of transports: 0 Baud rate list: 0 entries 00 00 00 00 00 00 00 00 00 00 Signed-off-by: Sven Peter --- new commit in v3 since this now fails loudly since 6.0-rc4 include/net/bluetooth/hci.h | 10 ++++++++++ net/bluetooth/hci_sync.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 75dcd818cf04..33d83d5ab84b 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -273,6 +273,16 @@ enum { * during the hdev->setup vendor callback. */ HCI_QUIRK_BROKEN_EXT_SCAN, + + /* + * When this quirk is set, the HCI_OP_GET_MWS_TRANSPORT_CONFIG command is + * disabled. This is required for some Broadcom controllers which + * erroneously claim to support MWS Transport Layer Configuration. + * + * This quirk can be set before hci_register_dev is called or + * during the hdev->setup vendor callback. + */ + HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, }; /* HCI device flags */ diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index fbd5613eebfc..791b37344ed6 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3939,6 +3939,8 @@ static int hci_get_mws_transport_config_sync(struct hci_dev *hdev) { if (!(hdev->commands[30] & 0x08)) return 0; + if (test_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks)) + return 0; return __hci_cmd_sync_status(hdev, HCI_OP_GET_MWS_TRANSPORT_CONFIG, 0, NULL, HCI_CMD_TIMEOUT); -- 2.25.1