From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 649C0C433E1 for ; Wed, 19 Aug 2020 18:23:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 328BB20786 for ; Wed, 19 Aug 2020 18:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597861394; bh=qy/ZEjEhG1i+wvQPbJtGZ9T5kPpw8NHao4bG1dxNlns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=JtuQ/RKQmhHg5DOsXVaspdg64P9nD+jJE971/6SZ06OCcOlqvhpbWDokNikfxHnXo Ggld1VAToT3dzzincUJ9X+amemZ0Go36azG0MvLR3BXKQe7SyRM2krP0dXstND0UnB 8BpvbEVuUn7ziAnBiv3BnHgN65U8kvhxoEqsKbPI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbgHSSXL (ORCPT ); Wed, 19 Aug 2020 14:23:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbgHSSXJ (ORCPT ); Wed, 19 Aug 2020 14:23:09 -0400 Received: from pali.im (pali.im [31.31.79.79]) (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 AB6BE20758; Wed, 19 Aug 2020 18:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597861388; bh=qy/ZEjEhG1i+wvQPbJtGZ9T5kPpw8NHao4bG1dxNlns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JPzbGLOI8lD/e6rSmRoXD3w+zE23xhVb8yRK2e9oKUHzr8OR98pJFBbBmA0Nj2Aiy cZW+xhiPKr9jpgAH2uRYwykye0AJi+f8RkpVzVNL9NOGgf4Ek+/Bm25GGJqmXmDI2j r3FExyclO1T94xuXOTBfHDN8iugHJ72WxtziqkXg= Received: by pali.im (Postfix) id 9552E582; Wed, 19 Aug 2020 20:23:06 +0200 (CEST) Date: Wed, 19 Aug 2020 20:23:06 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Luiz Augusto von Dentz Cc: Joseph Hwang , "linux-bluetooth@vger.kernel.org" , Marcel Holtmann , Joseph Hwang , ChromeOS Bluetooth Upstreaming , Alain Michaud , Abhishek Pandit-Subedi , "David S. Miller" , Jakub Kicinski , Johan Hedberg , Linux Kernel Mailing List , "open list:NETWORKING [GENERAL]" Subject: Re: [PATCH v1 2/2] Bluetooth: sco: expose WBS packet length in socket option Message-ID: <20200819182306.wvyht6ocyqpo75tp@pali> References: <20200813084129.332730-1-josephsih@chromium.org> <20200813164059.v1.2.I03247d3813c6dcbcdbeab26d068f9fd765edb1f5@changeid> <20200819143716.iimo4l3uul7lrpjn@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wednesday 19 August 2020 11:21:00 Luiz Augusto von Dentz wrote: > Hi Pali, > > On Wed, Aug 19, 2020 at 7:37 AM Pali Rohár wrote: > > > > On Friday 14 August 2020 12:56:05 Luiz Augusto von Dentz wrote: > > > Hi Joseph, > > > > > > On Thu, Aug 13, 2020 at 1:42 AM Joseph Hwang wrote: > > > > > > > > It is desirable to expose the wideband speech packet length via > > > > a socket option to the user space so that the user space can set > > > > the value correctly in configuring the sco connection. > > > > > > > > Reviewed-by: Alain Michaud > > > > Reviewed-by: Abhishek Pandit-Subedi > > > > Signed-off-by: Joseph Hwang > > > > --- > > > > > > > > include/net/bluetooth/bluetooth.h | 2 ++ > > > > net/bluetooth/sco.c | 8 ++++++++ > > > > 2 files changed, 10 insertions(+) > > > > > > > > diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h > > > > index 9125effbf4483d..922cc03143def4 100644 > > > > --- a/include/net/bluetooth/bluetooth.h > > > > +++ b/include/net/bluetooth/bluetooth.h > > > > @@ -153,6 +153,8 @@ struct bt_voice { > > > > > > > > #define BT_SCM_PKT_STATUS 0x03 > > > > > > > > +#define BT_SCO_PKT_LEN 17 > > > > + > > > > __printf(1, 2) > > > > void bt_info(const char *fmt, ...); > > > > __printf(1, 2) > > > > diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c > > > > index dcf7f96ff417e6..97e4e7c7b8cf62 100644 > > > > --- a/net/bluetooth/sco.c > > > > +++ b/net/bluetooth/sco.c > > > > @@ -67,6 +67,7 @@ struct sco_pinfo { > > > > __u32 flags; > > > > __u16 setting; > > > > __u8 cmsg_mask; > > > > + __u32 pkt_len; > > > > struct sco_conn *conn; > > > > }; > > > > > > > > @@ -267,6 +268,8 @@ static int sco_connect(struct sock *sk) > > > > sco_sock_set_timer(sk, sk->sk_sndtimeo); > > > > } > > > > > > > > + sco_pi(sk)->pkt_len = hdev->sco_pkt_len; > > > > + > > > > done: > > > > hci_dev_unlock(hdev); > > > > hci_dev_put(hdev); > > > > @@ -1001,6 +1004,11 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, > > > > err = -EFAULT; > > > > break; > > > > > > > > + case BT_SCO_PKT_LEN: > > > > + if (put_user(sco_pi(sk)->pkt_len, (u32 __user *)optval)) > > > > + err = -EFAULT; > > > > + break; > > > > > > Couldn't we expose this via BT_SNDMTU/BT_RCVMTU? > > > > Hello! > > > > There is already SCO_OPTIONS sock option, uses struct sco_options and > > contains 'mtu' member. > > > > I think that instead of adding new sock option, existing SCO_OPTIONS > > option should be used. > > We are moving away from type specific options to so options like > BT_SNDMTU/BT_RCVMTU should be supported in all socket types. Yes, this make sense. But I guess that SCO_OPTIONS should be provided for backward compatibility as it is already used by lot of userspace applications. So for me it looks like that BT_SNDMTU/BT_RCVMTU should return same value as SCO_OPTIONS. > > > > > > default: > > > > err = -ENOPROTOOPT; > > > > break; > > > > -- > > > > 2.28.0.236.gb10cc79966-goog > > > > > > > > > > > > > -- > > > Luiz Augusto von Dentz > > > > -- > Luiz Augusto von Dentz