Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp632669ybt; Fri, 19 Jun 2020 09:47:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzme8sCwbnUi3Devy2wx2V8GXtYrfaWVQhBzsCkiWkmW3N01M6nYxwfRvW4Ecxezoe3k9Is X-Received: by 2002:a17:906:c150:: with SMTP id dp16mr4373549ejc.536.1592585249935; Fri, 19 Jun 2020 09:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592585249; cv=none; d=google.com; s=arc-20160816; b=oL3YvGnaUTZRP9Pdd/s3t8fKcloLeX8qsZlJcJ/CoS6AcZCga9XXXBlf7dUTitn2Zp bpFEW/WTGunjz4fET5NQ6Nv91v6J3Q47v7+DkdkeLsUgluW5ELEBZHid018fktSHsbl9 dAszsu31fTk695SKlC88YjCXj+owVscU1gfeatt9Da3KeUTO5qh5CB/FLG7L/0LGW0fP Lg+yclEoZiWLQ7nDgHZnr0HLn+1FoGca8wJrunqmM63TuX8bzYCYVAl+qg1ZgmTGln5C OR5WR1W/RsoCwTDt01Pfmihc03QY8MVOT+55nU9veV3j5qTK8otducXHR50Ah8Pyby7R I3DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=efHrxvC1iMqOjfBd998QY0KjyjYgv2rFQQGYAUBWp7g=; b=FGkEtNFk9APNB8dhZ+VTVDc+8hFs1YFZKPxygH3SQDP+olYsOK2E13D/iZ51/gsOnm tNOPRSjY5gaKh9HBFdCpPni5nhK4S8WWtm2Ee6Fg5d4PQWxDtVTn90rYONOAxNCQcjQG 0bZHIv8i6YTRwjgdBw0zW0cIs3qoZ6xhC7crZUIt++9MsBt/ITr0fm14Hew5QprNH/6X CZvF2C0VIGyRz28ejc6F+Ay7p+1K+2J7ywryLYjI8R/vp3zJRc12B91YffU3Su+VeeRn kWDV+hzVa/Bi30NpW58YnZXO2q4E3kj14GTDqcnWhUp/PkWiMD8nj5NG+eqej7uvyg5v i45Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dT4eticN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w29si4594648edl.502.2020.06.19.09.47.07; Fri, 19 Jun 2020 09:47:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dT4eticN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404175AbgFSQog (ORCPT + 99 others); Fri, 19 Jun 2020 12:44:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:34060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388437AbgFSOnF (ORCPT ); Fri, 19 Jun 2020 10:43:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 331B321582; Fri, 19 Jun 2020 14:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577785; bh=WY31jg+QTjwpvgTyqbJoQiR6KxR7XceZbkjxg2z4T+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dT4eticNx+oWIRpW7KzqA+KPvdQJdnJZu5upPFHols80qpQ3J+lj8gGIWWby+lDhy BNCVkKcPcWh+/GozV1cAsIAz54B6wZuyeP+xj8gFgEls6bcD7+4Kkr8M3Z6BNPmK9H WGAxNqfLcGrmCb0EnpGTQ3ixqp8gUrYyoHypUmH0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hsin-Yu Chao , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.9 059/128] Bluetooth: Add SCO fallback for invalid LMP parameters error Date: Fri, 19 Jun 2020 16:32:33 +0200 Message-Id: <20200619141623.338855634@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hsin-Yu Chao [ Upstream commit 56b5453a86203a44726f523b4133c1feca49ce7c ] Bluetooth PTS test case HFP/AG/ACC/BI-12-I accepts SCO connection with invalid parameter at the first SCO request expecting AG to attempt another SCO request with the use of "safe settings" for given codec, base on section 5.7.1.2 of HFP 1.7 specification. This patch addresses it by adding "Invalid LMP Parameters" (0x1e) to the SCO fallback case. Verified with below log: < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17 Handle: 256 Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 13 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x0380 3-EV3 may not be used 2-EV5 may not be used 3-EV5 may not be used > HCI Event: Command Status (0x0f) plen 4 Setup Synchronous Connection (0x01|0x0028) ncmd 1 Status: Success (0x00) > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 256 Count: 1 > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 1 > HCI Event: Synchronous Connect Complete (0x2c) plen 17 Status: Invalid LMP Parameters / Invalid LL Parameters (0x1e) Handle: 0 Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC) Link type: eSCO (0x02) Transmission interval: 0x00 Retransmission window: 0x02 RX packet length: 0 TX packet length: 0 Air mode: Transparent (0x03) < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17 Handle: 256 Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 8 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x03c8 EV3 may be used 2-EV3 may not be used 3-EV3 may not be used 2-EV5 may not be used 3-EV5 may not be used > HCI Event: Command Status (0x0f) plen 4 Setup Synchronous Connection (0x01|0x0028) ncmd 1 Status: Success (0x00) > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 5 > HCI Event: Max Slots Change (0x1b) plen 3 Handle: 256 Max slots: 1 > HCI Event: Synchronous Connect Complete (0x2c) plen 17 Status: Success (0x00) Handle: 257 Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC) Link type: eSCO (0x02) Transmission interval: 0x06 Retransmission window: 0x04 RX packet length: 30 TX packet length: 30 Air mode: Transparent (0x03) Signed-off-by: Hsin-Yu Chao Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/hci_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 6f78489fdb13..a8aa3f29f2d6 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3775,6 +3775,7 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev, case 0x11: /* Unsupported Feature or Parameter Value */ case 0x1c: /* SCO interval rejected */ case 0x1a: /* Unsupported Remote Feature */ + case 0x1e: /* Invalid LMP Parameters */ case 0x1f: /* Unspecified error */ case 0x20: /* Unsupported LMP Parameter value */ if (conn->out) { -- 2.25.1