Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4319039rdh; Tue, 28 Nov 2023 19:30:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfnmL7sP2qyAc7fUiYSvoTw6CujiaOsA8dpTjS8KbnKnsdpPkDBNSXQ7k98Wc7KgurQbHo X-Received: by 2002:a17:906:7115:b0:9ff:1dea:83b8 with SMTP id x21-20020a170906711500b009ff1dea83b8mr14352507ejj.38.1701228612389; Tue, 28 Nov 2023 19:30:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701228612; cv=none; d=google.com; s=arc-20160816; b=zYpycQrPAmFDAJWsxMJuaCY/xmidFrGDOuWUq+1TGhcAQIko7FRXmLAhRO2Rn36nVr C+cn43AcodUmKq98Ca+Df1FUkrXDGWQ1fGyGizqyAlLE6o6z4hiS6HIuS95lSoV4JYaa 4Lp1nKX1T0q56QdXPuzJurWrV8qgrUhFTXvidENLGefD0n4WKDzidxLE3hLjkabLJFKF Byn/04GA8ti1yPMxzyiIwuTRQCzsz56fE8UKwX7nl55xzV+LjkHfQBgFdKV/bdwmBBBI Li/D9hTliCb3RkbE1tvteQQzi5/72lx0p23vhxbzSaolT6L7BkY5LcwT7onreWZcJx7j aQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TMxUY4W20UVsApuoA9XSrYF76gY5Ef7Zrgch7FDZ41Y=; fh=AfDQASxntH4C6eYs6UVreFjBfhWyphHmJR+zP0KIXSo=; b=QObLrc2fPmsweW0yuDQ43PbKOTq18YLmf5lzb33xo1C3Xom4BeYfMAf+bG9N4SUb/z V/emH00HHjuDigrSCheQs0lU5d5YIu8JHF8R3GxEvPVkxvyX1pqIdljVDYaPxdWZG+LJ yK4vXFctXNxSamiWL5ii5ptPu73oFym0q16KwPVEjRSN8kh9qzqtMqMCvE4BaKMpgP3U tM5NN1pG+T6HRFsCYbOREwfQXbeh2O6K+WfbCJ+NOJprBnfupW9jwGgr1ys7zXa1fcFA r3OI6Er3+LLZEoip0pMj5NonHU/nkTpYeDdAZxnjkBgw/XoYApjiJW5i+1XaOYMlTJ/w 0Xog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Fq8gJM3a; spf=pass (google.com: domain of linux-bluetooth+bounces-277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mj14-20020a170906af8e00b00a0c533ae6bbsi4160601ejb.629.2023.11.28.19.30.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:30:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Fq8gJM3a; spf=pass (google.com: domain of linux-bluetooth+bounces-277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F34051F20FC7 for ; Wed, 29 Nov 2023 03:30:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 350195680; Wed, 29 Nov 2023 03:30:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Fq8gJM3a" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02941AD for ; Tue, 28 Nov 2023 19:30:02 -0800 (PST) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AT1VGKi010168; Wed, 29 Nov 2023 03:29:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=TMxUY4W20UVsApuoA9XSrYF76gY5Ef7Zrgch7FDZ41Y=; b=Fq8gJM3aa5vgL+o8UsELhR9D1J4xezDCeDni6eLgKT3UDncBpaJWlTG414brilP463vV 1k6PXd49PpiRXLrXKnGTBuI6r0p+4PtidOn8HcPI19UMhbKZ7xsr+7QwwV742cQPefXo kU1Hp5HP6YJX+2HfkRyJq9LpzcqSdpxnqT43BCP212hyPLjQZuAPizpzVe7eISA9ej+9 0NVuJ9sfn2qBUtmaetthcYclgONOMzaZkOFES+QMsbpuwasYpLOxfmfzypY6J6UF8w53 /7cAqiN3emRDz/9sZH7O1WTfZn7z7CEfRECM1DM8aUELsQm9+FTZCR9lgzrGfHG07UMW ew== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3unhrpsqfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 03:29:59 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AT3TwVE013679 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 03:29:58 GMT Received: from [10.253.77.169] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 28 Nov 2023 19:29:57 -0800 Message-ID: Date: Wed, 29 Nov 2023 11:29:55 +0800 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/2] Bluetooth: Support SCO offload for QCA2066 Content-Language: en-US To: Luiz Augusto von Dentz CC: , , References: <1699251565-28759-1-git-send-email-quic_zijuhu@quicinc.com> From: quic_zijuhu In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: -i6ASJlCKUX5YM2OxqTj8ViGACB1yafx X-Proofpoint-ORIG-GUID: -i6ASJlCKUX5YM2OxqTj8ViGACB1yafx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-28_27,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 clxscore=1011 bulkscore=0 suspectscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311290024 On 11/18/2023 12:02 AM, Luiz Augusto von Dentz wrote: > Hi, > > On Mon, Nov 6, 2023 at 9:47 PM quic_zijuhu wrote: >> >> On 11/7/2023 12:16 AM, Luiz Augusto von Dentz wrote: >>> Hi, >>> >>> On Mon, Nov 6, 2023 at 1:19 AM Zijun Hu wrote: >>>> >>>> This patch series are to support SCO offload for QCA2066, ALL BTHOST >>>> needs to do is specifying both Input_Data_Path and Output_Data_Path >>>> as 0x01 for HCI_Enhanced_Setup_Synchronous_Connection, does NOT need >>>> to configure data path by HCI_Configure_Data_Path at all. >>> >>> This part it doesn't need to use HCI_Configure_Data_Path seems to be >>> non-standard, if so it needs to be handled by the driver, also it is >>> probably a good idea to explain how it works, what are the commands >>> used and the result traffic using btmon to collect the HCI trace. >>> >> My change does NOT touch current BT core driver logic at all. i just assign NULL to >> hdev->get_codec_config_data within QCA device driver. so it follows current kernel >> offload design. >> >> BTW, Core spec also does not specify standard procedures for SCO offload since it is >> vendor specific. > > We should probably document the expectation so it is clearer to the > driver what to expect, also the offload must be selected by the > application via socket interface as the HCI routing is the default, so > if the controller defaults to offload that needs fixing. > i will add comments within hci_qca.c to document QC offload usage as you suggested. the controller(firmware) supports both offload or non-offload, if setup SCO/eSCO by HCI_Enhanced_Setup_Synchronous_Connection with data path parameter as 0x00, then controller will use HCI for audio data. if as 0x01, it will use non-HCI such as PCM. From current kernel HFP offload design,if hdev->get_data_path_id() is implemented by device driver. it means HFP offload is ALSO SUPPORTED. whether to use offload or not is decided by user (upper BT application) as shown below: if user wants to use offload, then they must include offload UUID in config option KernelExperimental within /etc/bluetooth/main.conf and use setsockopt to config BT_CODEC. if user does not want to use offload. then they just need to remove offload UUID from option KernelExperimental based on above understanding, i have below points even if out of discussion scope for this change. 1) term data path selection is more suitable than offload for current design. offload related to performing HFP coding/decoding within controller. data path selection related to transferring audio data by HCI or non-HCI such as PCM. 2) perhaps, use setsockopt to config BT_CODEC for offload AS DEFAULT within upper application or BLUEZ, and just ONLY use the config option KernelExperimental to controller if to use offload. > As for this change in specific, the configure data path function can > check if the driver does implement it, so we don't have to check it > before calling avoiding duplicate code. > current checking is simpler and more suitable than below 2 alternatives to prevent send HCI_Configure_Data_Path since they need to take this scenario as error and return error code. even if we indeed can't take vendor special design as error wrongly. alternative 1): check and return error code within configure_datapath_sync(). alternative 2): implement hev->get_codec_config_data by returning error code within device driver hci_qca.c besides, there are no suitable error code for this case. >>>> Zijun Hu (2): >>>> Bluetooth: hci_conn: Check non NULL before calling >>>> hdev->get_codec_config_data() >>>> Bluetooth: qca: Support SCO offload for QCA2066 >>>> >>>> drivers/bluetooth/hci_qca.c | 19 +++++++++++++++++++ >>>> net/bluetooth/hci_conn.c | 2 +- >>>> 2 files changed, 20 insertions(+), 1 deletion(-) >>>> >>>> -- >>>> The Qualcomm Innovation Center >>>> >>> >>> >> > >