Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp187020pxk; Wed, 9 Sep 2020 02:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0kHlGrBFPwvDjlE4PEKuLBXC4cLG4Dr2YycK/NXrleHqoS5VhyALTjrnJlpoLP1hRhE2K X-Received: by 2002:a17:906:d9d9:: with SMTP id qk25mr2698679ejb.51.1599644640719; Wed, 09 Sep 2020 02:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599644640; cv=none; d=google.com; s=arc-20160816; b=T5AgPod7/Ewgfq1D6dZvJjsKflYIYvSILQTX8MGWEYc/Uul2Z0NZZqdF0yJns3B6QJ UedRpM1j+39fJ28MhKuS61BygQ7XYdyRHvoCkyxzIl7OReGsjbTEgfuHltsMjQ4SAvnZ QGprzlnTv9O8AhJLhVl+ySa2gBAhPgi+X9BwjVIHMVJbP9rfWcWza0/hf8iBHhLVEubj ed1ZETkSifvqzfZTHvx8Mbhsc2v2bPNlKCzi5QM/7LjK4q0uQeynI2RtNlmfvthVKRWo uVKXpJokqnLhDpUJgPa6tUMSSYxKUTke3u8YUY0PBZ1BhN1n6+z4P/5F2iOp0U0u29KN 9Oww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cJ2b5yC6U6sZBSPpf2NMndA3c8MuYwyg/EbWONDGDEQ=; b=ys1HpkfCzxnxw94hPFCKTNVkFE+gyk4QqM6/Gseb1pfCEShj3W1zmI110suS5vsyjW qdBDFMEjQa4sYxvjeniPJ+11gcDfU//L/f4C04QgPi5IaNWrEkrfxzahhs5TZGNcD4jd AGMv2uJQOCcVMqCEzgKw92GXipc/PfcNxuTKLWQcNko1aF1ic9U35p8IUWGJv0D27lr2 HhabEh1AJy+F2IZ6MoTa6rbpSxDlgIcZ8/ufXPHsDxvmxlPD6x2NEBFQUSswhJVu82C3 M6OK0PIf/qNEnQB/vq3IjrE6EMrQ5o/mJaGuThL/pfpVmzhhqH/qnx04+uO+koycSuH3 79FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lRr0iV7j; 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; 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 r25si1452296edc.505.2020.09.09.02.43.37; Wed, 09 Sep 2020 02:44:00 -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=@chromium.org header.s=google header.b=lRr0iV7j; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730175AbgIIJnC (ORCPT + 99 others); Wed, 9 Sep 2020 05:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgIIJml (ORCPT ); Wed, 9 Sep 2020 05:42:41 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3065C0613ED for ; Wed, 9 Sep 2020 02:42:39 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id v196so1802536pfc.1 for ; Wed, 09 Sep 2020 02:42:39 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=cJ2b5yC6U6sZBSPpf2NMndA3c8MuYwyg/EbWONDGDEQ=; b=lRr0iV7jW0zq00Y+PI9+C7cOPYDyM1oIQtYgXGw2Jok5nCprEdhOZiwh5Vp+h7I5bK sDVm/tVXX/1Feq/Yn7thUALZCMh8wcsS13njzNpVOyy+NKgPOQxkgpwOHjheAOj5H8PN jPS12IkBQ5rM8aOk+DU5/JDyzG2RLZTleokG0= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cJ2b5yC6U6sZBSPpf2NMndA3c8MuYwyg/EbWONDGDEQ=; b=jrcf+ZPoTU3IHq+SrjJo8Vb0CdDl5g+zHl4gCJ6QiE2SllcuKj0y1twY8rrhbYyX2X vOLPEbSrTZZpRLnciEcZ60YtBrtzWyVWBwuRKdRUkyxhhS0U7WNfGTVcYzRzWQ1359ER iXzmYdzBDSMAb+apauXmRTOikp/4KsLMMFG1XopDvFG+xrw6UZmrIVowYrvZwHPkoHTn JjVIXpI3TtOIt/G7mKjyNBGZc1/S3cA+JWA4QYRv4+PXNKX7Vjsr0hKymPYOVVAd1Mw5 Ov4r6+tJrflmkfLEGSEni+/PgzUlMUf8Z0ASgzVj9/UO//b7s9tAXEGIgP5Ax9Y0nLfU 4+cw== X-Gm-Message-State: AOAM530zgiSm63eK0qq4zh7VCTJaxp3RyMLt0Gnjs3EVTolVslAQtrpX MHXffqECmvFz0k2P44Hf3pKkZg== X-Received: by 2002:a17:902:9349:b029:d0:cb2d:f26c with SMTP id g9-20020a1709029349b02900d0cb2df26cmr156960plp.5.1599644559530; Wed, 09 Sep 2020 02:42:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 02:42:39 -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 , Alain Michaud , Abhishek Pandit-Subedi , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 2/2] Bluetooth: sco: expose WBS packet length in socket option Date: Wed, 9 Sep 2020 17:42:02 +0800 Message-Id: <20200909174129.v2.2.I03247d3813c6dcbcdbeab26d068f9fd765edb1f5@changeid> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200909094202.3863687-1-josephsih@chromium.org> References: <20200909094202.3863687-1-josephsih@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- (no changes since v1) net/bluetooth/sco.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index dcf7f96ff417e6..79ffcdef0b7ad5 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -1001,6 +1001,12 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, err = -EFAULT; break; + case BT_SNDMTU: + case BT_RCVMTU: + if (put_user(sco_pi(sk)->conn->mtu, (u32 __user *)optval)) + err = -EFAULT; + break; + default: err = -ENOPROTOOPT; break; -- 2.28.0.526.ge36021eeef-goog