Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1491724rwi; Thu, 27 Oct 2022 16:58:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ObVKmyidKhJABiZC5z9V2BgoF3JHY2Rk2EI06HhGA2f8Xxnpe44YQjKDShTpQLteMzEZO X-Received: by 2002:a17:902:ec86:b0:185:483e:e4ec with SMTP id x6-20020a170902ec8600b00185483ee4ecmr52464826plg.164.1666915116872; Thu, 27 Oct 2022 16:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666915116; cv=none; d=google.com; s=arc-20160816; b=lx1oCN7juFnU/I843F5rlw4PMRsQEUKKSqH85zTapGgtxtjzXxY37irxCBgwHRYvzq nLAupV+bwehVmjvif6wYfpmBCt7IRsQkQFQtqe8Fv1G67BtAL4/dlUSO7Xs/cifIoIEY Wz6xg+fWEn8unEYVt2df74ZwlaqKcfxZUkG2/trzExGW/Vs9dZcoQLkSDAPRNABGYOFc hZfB9GVbATvH7Stio6sGNQLOo6ib5UwiQZ8q2894GaqOnorFVWnH7IOuE5WNIyeMHsQt sQAORWaR7V3Q73t/6Yn3T9vgiuNS/uQN+KDi0td29AHbTfp2E59IEvI44rwEhwSOUA8E tQuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=5pQcjZ2AoGE1iTsgc2FGFzyNM0oaVKvF+dWfv0kyF6g=; b=Z+O/qCFVIXN0BCaRo4bbPDhA48lSwiyL7eSbl6hDD14G0KjhSUHT1BmiA0rfQHuI3h oZmy6pQzeQCm21bu71YNw9kiodvU9s4NTp+tjtO0FOmTE6ZmVzK5YneqTKPGltDk4v0e 6bk5PkGwpu8bEQ8yG1fzfZ/gRGGQUIz2+9FsmEx9H1480rWpbYvmwj2/wP1B7jQkyuuu lGMZEozTMiL4aK0VH24n5TqyfaEuJWl4ziJMujhW2kXzNo7bp5CELidgVCoAlQP7Wzhb PbTQ7B4/cH5rXTM8Mtc2szG0BBvZj94KZNkPSJ/tosGl8bSTxZ4UVgVHRhgb92UPk9FV oLaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qqx2j4I7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a631243000000b0043882f4027asi3258138pgs.314.2022.10.27.16.58.07; Thu, 27 Oct 2022 16:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qqx2j4I7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232906AbiJ0XZd (ORCPT + 99 others); Thu, 27 Oct 2022 19:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235092AbiJ0XZc (ORCPT ); Thu, 27 Oct 2022 19:25:32 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E3F7CAA1 for ; Thu, 27 Oct 2022 16:25:31 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id 3-20020a17090a0f8300b00212d5cd4e5eso8182241pjz.4 for ; Thu, 27 Oct 2022 16:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=5pQcjZ2AoGE1iTsgc2FGFzyNM0oaVKvF+dWfv0kyF6g=; b=qqx2j4I7jc8g566JCH7Aov1/FhXYmQEJafyWs1Vk507ZlJ2yGgsYuYDSUIz/d8Rdku Mz4Hy1E5yl35cXH99rYZuicRXVWJWk3gaEWUmPRMpTONvFYjsDBc3HmTXa1qo2IA79Qv VP/Nfa/KqrZwjqdLN3akpBWmOVX9HFhVVcj00XdAY30WIewWz1wdEXgDTERPCYft8nPy o2vaeEhtOOXd421zrT6yCeiGn3lF2hR2cXFLgaFaYsXtD3BwcDMLdpveIWmCOHBi/wdF m2a4Wt6xxXuU0DRyiUTyg7fbg5MEcQTizDGbKl9+0xDHJe9cDF2AoUfnZ8z8mnmgn478 uJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5pQcjZ2AoGE1iTsgc2FGFzyNM0oaVKvF+dWfv0kyF6g=; b=5rEjhb7IEQbbdYgsUiZHNRjvxzM5JknL1H65+tOXIH5q3fDUZiNBsWBzacX5OVixQQ 542bazkeFGDrTEEki6sqqHFRgTtb30gSNAbEA6UotW3vWm1uUepdkQIl1SWVa6pDjLmu ADjfkEy0jWJjfHkgKbD3hZ5MKbA+xJD3b4OrdEqaL4k9lGCDeUD0A36D9rZZvsnSOGL9 2/8+ZNksibDowREKjyJsdrixrZewA/BLVEEbk/hWy5Nv/MsYgvDF2Mf5SFUrTbEZXD3S C+Tv+2Z2D+kx4rXwF5DsF7sS8j2X4S2mUDMazFKsZYMZZaLZkaP0qTfQ6JGLU0KH2Bwv ODLA== X-Gm-Message-State: ACrzQf3kLUmk1piEiIrHfkOhf2cNmFOQ2319gNUCE4wv0DggAnK4LVYV 98Zl3h4RPrXSMJa0cuefnEyndSNLNOM= X-Received: by 2002:a17:903:4ca:b0:179:d21f:f04b with SMTP id jm10-20020a17090304ca00b00179d21ff04bmr52554172plb.7.1666913129978; Thu, 27 Oct 2022 16:25:29 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id 11-20020a170902e9cb00b00186b9196cbesm1695858plk.249.2022.10.27.16.25.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 16:25:29 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: Add CONFIG_BT_LE_L2CAP_ECRED Date: Thu, 27 Oct 2022 16:25:28 -0700 Message-Id: <20221027232528.1996093-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds CONFIG_BT_LE_L2CAP_ECRED which can be used to enable L2CAP Enhanced Credit Flow Control Mode by default, previously it was only possible to set it via module parameter (e.g. bluetooth.enable_ecred=1). Since L2CAP ECRED mode is required by the likes of EATT which is recommended for LE Audio this enables it by default. Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/Kconfig | 11 +++++++++++ net/bluetooth/l2cap_core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index ae3bdc6dfc92..da7cac0a1b71 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig @@ -78,6 +78,17 @@ config BT_LE Bluetooth Low Energy includes support low-energy physical layer available with Bluetooth version 4.0 or later. +config BT_LE_L2CAP_ECRED + bool "Bluetooth L2CAP Enhanced Credit Flow Control" + depends on BT_LE + default y + help + Bluetooth Low Energy L2CAP Enhanced Credit Flow Control available with + Bluetooth version 5.2 or later. + + This can be overridden by passing bluetooth.enable_ecred=[1|0] + on the kernel commandline. + config BT_6LOWPAN tristate "Bluetooth 6LoWPAN support" depends on BT_LE && 6LOWPAN diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 1fbe087d6ae4..ef725ed41303 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -45,7 +45,7 @@ #define LE_FLOWCTL_MAX_CREDITS 65535 bool disable_ertm; -bool enable_ecred; +bool enable_ecred = IS_ENABLED(CONFIG_BT_LE_L2CAP_ECRED); static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN | L2CAP_FEAT_UCD; -- 2.37.3