Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp188635pxk; Wed, 9 Sep 2020 02:47:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJSc+XRfus9+i4jk9EuZizMa52lSw884x/Ju9XL7fmArL6DiyGGEzrC7cNrBIhETcIZoNL X-Received: by 2002:a17:906:6d92:: with SMTP id h18mr2686954ejt.405.1599644845807; Wed, 09 Sep 2020 02:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599644845; cv=none; d=google.com; s=arc-20160816; b=qYqyrgvHLbsiw2XO8x1vRxUOnnt1oZUoUm4OGXFZU2CDJ+hyylQdL2RPPi9+z7KECU Dj6jI3y7zrhMuZWhmSwA8y+xx8IZ4Q5XNxUrjiGvmvRHY0N/fH7CdIPJxesTNJP7nuP5 WEulVLja6OGQpCu2Q3F3HmQM2X+S4iTxXNdK1WYtUmPKV3KllZKL6HJWmumRf7ZGPQ+J ZV/8kTTw+IkhPQ6PymoGA8Wgb6y5nqIilBZlVBmrq3WZTWRjmKf30xLn30UKXLaSIaIr UjUAY61nT91eh+PQjxqgN/7eVm7uQy1Crhn7zioEdQVdaNzn8GjEgEESANYA7Q+7MDy9 PzAg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=jlaTjOBgc0QZjU31Izm6AsUUQrjtSK2SvcixEKeEsE8=; b=w/80iMGUQRgS3LnjvLHEt2mJ7MdShwIMzpYld7SbGsIwBTChZe5uyrQ6K6FhydDQ8L tBHI3Gvnst99/QayD2PsTMUvwlELdn35rqULOxR0Fe6GO90kAd3nFvfsifQSEnVhesFh 0MR/iX+Xd8kgQ457uhZEGRj6+29JOpm2T790xgjRQPXHuXlEShDswQgspRdyaD0CxaT5 UyvTneZ3nePwuuNWFHRnSUwHZLHOauu0LVrXlrO5Iv3DLqwRowgpuAYSQ0Ml5rCK8pEE TW2U2YSbtLOdod1uwuzvFzyPHxNw0bkClul3joRlQbyuaPBR/Mn10b9BmeUNuAMpwagJ bLPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lCHL9DHS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md20si1131970ejb.439.2020.09.09.02.47.00; Wed, 09 Sep 2020 02:47:25 -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; dkim=pass header.i=@chromium.org header.s=google header.b=lCHL9DHS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730175AbgIIJpR (ORCPT + 99 others); Wed, 9 Sep 2020 05:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728360AbgIIJma (ORCPT ); Wed, 9 Sep 2020 05:42:30 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF3AC061756 for ; Wed, 9 Sep 2020 02:42:30 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 5so1683131pgl.4 for ; Wed, 09 Sep 2020 02:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jlaTjOBgc0QZjU31Izm6AsUUQrjtSK2SvcixEKeEsE8=; b=lCHL9DHS53o+bnJKp6cYHHdrWZYOKVCR6NbsR2WBJpkMdvT7ap6vGvxUUyAwT/WgDb wauu3XqVuJHpZCvEb6gG93hDYcCML1aTllTQJZBSGrU97UBjtLSTvSdIGjg/1YZddSf0 PgtPlCU6NmuYASDFXLwDqXY2dF20J4mT2Suew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jlaTjOBgc0QZjU31Izm6AsUUQrjtSK2SvcixEKeEsE8=; b=PbNtzQw4QPC6RF+uUYckC3fpuhm4vFO1sDaloN7Q9N4Pf9E7SyCFO/WayhEa3owCtw Dh61+eewBfI2XIErG2UbQOhRDuRmje9O9aCAR7PPMY7ay7kfxM08X047iWa5htJM8hmx fw9i79oiVR/PYTQpHeFCYhNDl49MguAJwEy7zK7HA1SF1Tu8s4LwrYzHF+5xYvXFyeqy lJZ3AxgIWI319X2SjIVh5kv5RmX/hZFZIRfx7c9hrtHzg6LujMWvLhGVDXlLhBIt4bf0 D+IoBVhmHGU8ZHflC9QthZy5wCgNFXXvUEl7vTO67Gb0qemwzWvNgfDxp/hWWFrIjYe4 a8FQ== X-Gm-Message-State: AOAM531iChj6uXjsPmzr6bLyVBnMtAvs5QEA3al9BiT80/X6UDotOQhR Rt8NOk1JGzOITG+XTxznOFYlP6EHJymdOCPZ X-Received: by 2002:a62:3146:0:b029:13e:d13d:a08e with SMTP id x67-20020a6231460000b029013ed13da08emr125438pfx.37.1599644549498; Wed, 09 Sep 2020 02:42:29 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:de4a:3eff:fe7d:ff5f]) by smtp.gmail.com with ESMTPSA id a23sm1692275pgv.86.2020.09.09.02.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 02:42:28 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Joseph Hwang , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 0/2] To support the HFP WBS, a chip vendor may choose a particular Date: Wed, 9 Sep 2020 17:42:00 +0800 Message-Id: <20200909094202.3863687-1-josephsih@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org USB alternate seeting of which the packet size is distinct. The patches are to expose the packet size to user space so that the user space does not need to hard code those values. We have verified this patch on Chromebooks which use - Realtek 8822CE controller with USB alt setting 1 - Intel controller with USB alt setting 6 Our user space audio server, cras, can get the correct packet length from the socket option. Changes in v2: - 1/2: Used sco_mtu instead of a new sco_pkt_len member in hdev. - 1/2: Do not overwrite hdev->sco_mtu in hci_cc_read_buffer_size if it has been set in the USB interface. - 2/2: Used BT_SNDMTU/BT_RCVMTU instead of creating a new opt name. - 2/2: Used the existing conn->mtu instead of creating a new member in struct sco_pinfo. - 2/2: Noted that the old SCO_OPTIONS in sco_sock_getsockopt_old() would just work as it uses sco_pi(sk)->conn->mtu. Joseph Hwang (2): Bluetooth: btusb: define HCI packet sizes of USB Alts Bluetooth: sco: expose WBS packet length in socket option drivers/bluetooth/btusb.c | 43 +++++++++++++++++++++++++++++---------- net/bluetooth/hci_event.c | 7 ++++++- net/bluetooth/sco.c | 6 ++++++ 3 files changed, 44 insertions(+), 12 deletions(-) -- 2.28.0.526.ge36021eeef-goog