Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp650153ybt; Mon, 6 Jul 2020 19:21:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEJIZeMlDvOIq4sMlmSzEP/+yrJwQdavbOTgaK1P6dFoBgf6eI4mpMqPvo72PwapxiHqbJ X-Received: by 2002:a17:907:40f5:: with SMTP id no5mr45088810ejb.149.1594088483347; Mon, 06 Jul 2020 19:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594088483; cv=none; d=google.com; s=arc-20160816; b=mo7bivtFmMZEHIF43n55OmlRSiLL86KUT4ito0ZfgelNBICC+PG99SdlONOaz1Zcpz g7SsnKHVTrUjupTbyMZwPfFQQvRP8jbBX6BEYR9sMZRrUHlfq3jHNdOiIvvqD1LvnzCg 8KmyQMqHHfFdspg4TfA6ktS6PNucILDE8Ltvx3N8nHYA410l/oEbOPA3Tcv7jM5YbbWd K2wttI8jwB08MO9X0WSsCA5DSV/8JA5A12Epvjo3XQiK5RwLrIJaF4BOxeeWPXNqecQF f+9Pv5gR35C58x1zO7HMh4ngiJKVqSafGz0yqxXr7wuqJAbWMW/35CuWS30O/JnCNTf/ 6nMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mPuUrJIlJbDH1FXvjHv4kD8C1vGWoHt9ZrDqXArb4Cw=; b=hNjneqX7E6PFhUQwSFchINjXZ1eW2yNGoI7vDx3bM72V/LkMXnJpt8qkvidSzY+tL0 2KwZXC0HxjAUreuqpjwOWvjhSqX5J5aVFNoPHSKdmK0K1NlEQ/Y8G3oQOTvEWGv0VCX7 TudpBqQyKE7Q/Twk7hdjSC3CQQukKcYrJn2/DWNG8a5VjZFZsaiF+anK+xTe7R5X0iHX zPlv4id3/nX5VHSY3bSNxTZEh4lENjHeZhWeoI3ZcQZuocJZAJumMTtXcT6vwsFlmelQ OsSFKpvB+xMDoijmfmj9/UyZdnUT2EJ+7KRi4G3kiagQnG4pIFJFsICsT+NyBPrJzCkD 0ATQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IfqbSYTG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si16403381ejc.717.2020.07.06.19.20.58; Mon, 06 Jul 2020 19:21:23 -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=@google.com header.s=20161025 header.b=IfqbSYTG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbgGGCUz (ORCPT + 99 others); Mon, 6 Jul 2020 22:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726681AbgGGCUy (ORCPT ); Mon, 6 Jul 2020 22:20:54 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FF5C061755 for ; Mon, 6 Jul 2020 19:20:54 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id m26so23855571lfo.13 for ; Mon, 06 Jul 2020 19:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mPuUrJIlJbDH1FXvjHv4kD8C1vGWoHt9ZrDqXArb4Cw=; b=IfqbSYTGIG9gwzwbE44OSbtKyGpPck0hEAv1buAoqSLx9XuFT6VYMF6URNZgMoBiVs fcRP/sxSx5vXVM09EiloMlK5z+ueSdGYmpXoPDBJqUYzjDk6wGadK4UJ5SCMO4LirWFF p8Dxrr77Fj/cc19xwYj6AQJ69dNL1vIQ+lPxqWmgol0PQqLzhKMCBYqp1MgscP+Xw0Xi wB4S/LkaS2YzXkhSxKlRTLlqjrhBni5Ixuzeyz15TaUni3ZtawbipMA6tyJ3vf5kXhne gqC+87CPJ2N2xit79C38qZwEqyg8XuTsuEVCp8QH8LheGvltqqS1edPnkGYEupbIHtd5 GbYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mPuUrJIlJbDH1FXvjHv4kD8C1vGWoHt9ZrDqXArb4Cw=; b=Ljkk9Pgq/n138BZcK6GDAL2OkZvFd6vGSrTRHIvQilktw4KwDb+OAkZlhgCekaOUDG JOVSCaKMvxtZHVfQrfYnokU50VKkkgon0qpmM+Eta7cJ+YFtiBUNu59koeUHpRRqIII6 apfdHUD5BhSVeQsOU+YbNTZgHBx5DsvYNRmQSJetekavF5paTx6JPPpVGaOH4gvq05Ok KS3KKQWH5bzRAxVhY+m0qG2MuN4xr09hDwNTttpb3xP0Zvyvmd8e2w6MI65slv1w8vrH LprdQMeoHnjuyGfBb5WHMYePOz/2aaCPlFlZG/s6wF+SaQSKEXjf6hEcgMvsLFeHmxbu H5pw== X-Gm-Message-State: AOAM532vz/qE8YimY+RYjLOKvFu4OcyVMOyPweoTbWuwbc65KzurSrr6 ItP36QStRtKzfwKnZKBR+KxOwg50opZupKShlYkj5w== X-Received: by 2002:a19:64c:: with SMTP id 73mr32293247lfg.0.1594088452637; Mon, 06 Jul 2020 19:20:52 -0700 (PDT) MIME-Version: 1.0 References: <20200706154449.3828193-1-alainm@chromium.org> In-Reply-To: <20200706154449.3828193-1-alainm@chromium.org> From: Alain Michaud Date: Mon, 6 Jul 2020 22:20:41 -0400 Message-ID: Subject: Re: [PATCH v3] Bluetooth: le_simult_central_peripheral experimental feature To: Alain Michaud Cc: BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Here is the userspace change associated with this change: https://patchwork.kernel.org/project/bluetooth/list/?series=313771 On Mon, Jul 6, 2020 at 11:44 AM Alain Michaud wrote: > > This patch adds an le_simult_central_peripheral features which allows a > clients to determine if the controller is able to support peripheral and > central connections separately and at the same time. > > Signed-off-by: Alain Michaud > --- > > Changes in v3: > - Back to the original design of V1 and integrated Marcel's feedback. > > Changes in v2: > - Slight change of design based on offline feedback > > net/bluetooth/mgmt.c | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c > index 5e9b9728eeac..b34e6f3c07ec 100644 > --- a/net/bluetooth/mgmt.c > +++ b/net/bluetooth/mgmt.c > @@ -3753,12 +3753,19 @@ static const u8 debug_uuid[16] = { > }; > #endif > > +/* 671b10b5-42c0-4696-9227-eb28d1b049d6 */ > +static const u8 le_simult_central_peripheral[16] = { > + 0xd6, 0x49, 0xb0, 0xd1, 0x28, 0xeb, 0x27, 0x92, > + 0x96, 0x46, 0xc0, 0x42, 0xb5, 0x10, 0x1b, 0x67, > +}; > + > static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, > void *data, u16 data_len) > { > - char buf[42]; > + char buf[44]; > struct mgmt_rp_read_exp_features_info *rp = (void *)buf; > u16 idx = 0; > + u32 flags; > > bt_dev_dbg(hdev, "sock %p", sk); > > @@ -3766,7 +3773,7 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, > > #ifdef CONFIG_BT_FEATURE_DEBUG > if (!hdev) { > - u32 flags = bt_dbg_get() ? BIT(0) : 0; > + flags = bt_dbg_get() ? BIT(0) : 0; > > memcpy(rp->features[idx].uuid, debug_uuid, 16); > rp->features[idx].flags = cpu_to_le32(flags); > @@ -3774,6 +3781,19 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, > } > #endif > > + flags = 0; > + memcpy(rp->features[idx].uuid, le_simult_central_peripheral, > + sizeof(le_simult_central_peripheral)); > + > + if (hdev && test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) && > + (hdev->le_states[4] & 0x08) && /* Central */ > + (hdev->le_states[4] & 0x40) && /* Peripheral */ > + (hdev->le_states[3] & 0x10) /* Simultaneous */) > + flags |= BIT(0); > + > + rp->features[idx].flags = cpu_to_le32(flags); > + idx++; > + > rp->feature_count = cpu_to_le16(idx); > > /* After reading the experimental features information, enable > -- > 2.27.0.212.ge8ba1cc988-goog >