Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp954667ybh; Tue, 21 Jul 2020 12:00:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjMgHVLfUmtoqlVeO/kYO4tTHmaExce+Q/eO4RG2spTxiunigVFpa/Cg/whoVNypqe9SdF X-Received: by 2002:a17:906:e2ca:: with SMTP id gr10mr25886881ejb.81.1595358037505; Tue, 21 Jul 2020 12:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595358037; cv=none; d=google.com; s=arc-20160816; b=Gnlt3R2ARVJ4GDDkZ0OMxLyv7cb4v5j+VUiCTDRs+DzjepHVzqegn+EutHoM86l0Q3 pITRbQ5FMcRPl+fsKwV0x/6vhta+0ir1Y0ifiHozyaL+9LhgZmKvXO8miK6xjLjwBWm1 CpSW7rndxu/0jojX/8dfa/GRm/ID9Q+mTnO+HMy7qU0eEhyp9UA2wVIz9c9FiStPwv+y 0791K4dK+vQ/7Vb/sw/5Moohdv7neUOZl9FczFXm5vkbw3Ci7StuYCtjA5TemSvSywcq A/LsnVByEU+rAw9P9hUbsYqAo7vsZz6Bm3wada1TiYvSE9zqxQzCs560REVORPbNOAET mKjQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject:dkim-filter; bh=ZafefetCErPqRpHilE8oQaVhlTf2y9cETR6v+2h5Rfs=; b=bUQX9T6PXcFFhg4siE9XrKNI/dMXvJVyFIUJsNEfSdCt2aFXM6vykmkwlkCKnfxSAq Y0CwJv6zuGusWzqRhUGCU0nWFw9N1/kujR8f18eGMRGMYQ90EW4aOs2hZ12KSbLqP3a7 SHMV3KfaB8ao14xzGqrl9Xv14pyqcHf5bzW7IXDU4VNl5wB682d6nAa7xzmYXJy71mqh KC+sEcX1ZpfZUOssyJa+pjvC7XyYG7W/Xo0S9m5BzhXKITxOquqMXnGADiR8YyrREjd9 3628j9flbNA04H8E8ZrNbmJBFqTdKK7zAAKQlIu79RaiL5EIZnCPIOU2X2cR5Z+M8Yt3 BMpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=omprussia.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si13944337ejc.174.2020.07.21.11.59.52; Tue, 21 Jul 2020 12:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=omprussia.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730146AbgGUS40 (ORCPT + 99 others); Tue, 21 Jul 2020 14:56:26 -0400 Received: from mxout03.lancloud.ru ([89.108.73.187]:44372 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbgGUS4Z (ORCPT ); Tue, 21 Jul 2020 14:56:25 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 9268F21BD66F Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH RFC] bluetooth: add support for some old headsets From: Sergey Shtylyov To: Marcel Holtmann CC: Johan Hedberg , Bluetooth Kernel Mailing List , "David S. Miller" , Jakub Kicinski , , "Ildar Kamaletdinov" References: <6f461412-a6c0-aa53-5e74-394e278ee9b1@omprussia.ru> <1834765D-52E6-45B8-9923-778C9182CFA9@holtmann.org> <848144D3-85F9-47F8-8CDA-02457FA7530F@holtmann.org> <0c2a8da1-6071-6597-d0d1-32ce1490aba7@omprussia.ru> Organization: Open Mobile Platform, LLC Message-ID: <6f271bf7-04ee-c971-9c69-de3f696769ed@omprussia.ru> Date: Tue, 21 Jul 2020 21:56:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0c2a8da1-6071-6597-d0d1-32ce1490aba7@omprussia.ru> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [213.87.161.224] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1908.lancloud.ru (fd00:f066::208) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hello! On 7/17/20 10:12 PM, Sergey Shtylyov wrote: >>>>> The MediaTek Bluetooth platform (MT6630 etc.) has a peculiar implementation >>>>> for the eSCO/SCO connection via BT/EDR: the host controller returns error >>>>> code 0x20 (LMP feature not supported) for HCI_Setup_Synchronous_Connection >>>>> (0x0028) command without actually trying to setup connection with a remote >>>>> device in case such device (like Digma BT-14 headset) didn't advertise its >>>>> supported features. Even though this doesn't break compatibility with the >>>>> Bluetooth standard it breaks the compatibility with the Hands-Free Profile >>>>> (HFP). >>>>> >>>>> This patch returns the compatibility with the HFP profile and actually >>>>> tries to check all available connection parameters despite of the specific >>>>> MediaTek implementation. Without it one was unable to establish eSCO/SCO >>>>> connection with some headsets. [...] >>>>> Signed-off-by: Sergey Shtylyov >>>>> >>>>> --- >>>>> This patch is against the 'bluetooth-next.git' repo. >>>>> >>>>> net/bluetooth/hci_event.c | 8 ++++++++ >>>>> 1 file changed, 8 insertions(+) >>>>> >>>>> Index: bluetooth-next/net/bluetooth/hci_event.c >>>>> =================================================================== >>>>> --- bluetooth-next.orig/net/bluetooth/hci_event.c >>>>> +++ bluetooth-next/net/bluetooth/hci_event.c >>>>> @@ -2187,6 +2187,13 @@ static void hci_cs_setup_sync_conn(struc >>>>> if (acl) { >>>>> sco = acl->link; >>>>> if (sco) { >>>>> + if (status == 0x20 && /* Unsupported LMP Parameter value */ >>>>> + sco->out) { > > Actually, I was expecting that you'd tell me to create a HCI quirk for this situation. > I have a patch doing that but I haven't been able to locate the driver in which to set this > quirk flag... And that's no wonder! The BT driver that needs this patch is out-of-tree (and not even open source, it seems) as we have finally ascertained with Ildar... Is there any interest in the "preparatory" patch that lowers the indentation levels in hci_cs_setup_sync_conn()? [...] MBR, Sergei