Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1151066ybt; Tue, 7 Jul 2020 08:53:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQGtDJi8WFOKxaRb1WoZDV7x2+aIx3woEMHGjJHOSQL2S1fh9fMAlbyhRNQWyMWShuwSwc X-Received: by 2002:a17:907:2108:: with SMTP id qn8mr43404785ejb.16.1594137192212; Tue, 07 Jul 2020 08:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594137192; cv=none; d=google.com; s=arc-20160816; b=ftvT36I+iXeqdXFQolBafT1IcKsPxX3HcyNK8yo86Ych7gGGv52VTXOgJimde0l/ZP DSLUaBlsVwk8REV1IeOuloJz/Sq5FNRKkbe2kZtpywRSR2ITrZzPa051B4BUsJaD1Sk8 zbsJ3N+8OWUU93HfWBecmjhiKI2NG4MYD55u1/r7BQcjttV/ujp+SAyGna/Z/YK09Do3 T4VcA/099hrEryB7/ZIk60nwj932ztrAhZ+dvzNpCByYdboyR0rrlF4GWeWT9/Pa237M xUT3lyo6TdvD5INYwcudnYNhpvKuJmjjVLtx4Z4uBUxkf559ArQTDiuRbKdvqmqwycKl k2lA== 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=kjHG2fEc32d5jG/RXXsuugh7BBMStXUSYttEp1ymo5Q=; b=LAWCZNOew49qtRlaYlGRhkccnjZitd7IsK3xGVPMehrWzdVco3H5XBgTS/0x+1f9NS /MMNhrvS2RyQiDEcKoN3MwGLWHV3YQwUWM9LxCcliU8Rk4JH6t8mzDSQexcvCRXGWbIA 0maBMDk+qk/n/E/4ofx4qZAdXoZkMWEbcE4CafX3A0YkLtBD7GEQzy/57BgKs/HWaBnJ Oz2I0DyXj5XhKQn3pG0EdSt0FINrVzDu/1zmSQMNOIFxe8/ijWCGTP3EbL02s075usTN IZ3TCeSv/0ZqWowf7eo2cJnquCMh+pERzWsHqsHRt7G8ZoSnNWlKlZYJbKjvpM/O9OM6 C/qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ie10kp3g; 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 dp8si20397338ejc.281.2020.07.07.08.52.48; Tue, 07 Jul 2020 08:53:12 -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=ie10kp3g; 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 S1728456AbgGGPvb (ORCPT + 99 others); Tue, 7 Jul 2020 11:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728029AbgGGPva (ORCPT ); Tue, 7 Jul 2020 11:51:30 -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 6960BC061755 for ; Tue, 7 Jul 2020 08:51:30 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id y18so24997786lfh.11 for ; Tue, 07 Jul 2020 08:51:30 -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=kjHG2fEc32d5jG/RXXsuugh7BBMStXUSYttEp1ymo5Q=; b=ie10kp3godHa5Qm23qDWti0L4tWyZ/zMx7LwRaOf4n3hCjenf5eBVyb10H79rJt0pN Wy9g6BKfZ6Bk9XyVby49F0elUzhUuYCHmmJRKFQLm1ApnVVTN4a3QUN/qVbqAnM03WHS D9Rk1hloRSv+JJjR/x3NJyKRSvnAJElRWZNyrjPFFRwpzXiQTW0QsKNtB1zi/Bi7iCQb u8ojXFlWfW+dpEoGCFEwLKsD0l5ghIGbYOqm2USrYk6aqbHSmFsj2SaYQuuvAO5f0fRl 7vdrIzbrVlPy6u2sOmaU99Of3SbxUsDA8CGJYA7ibxdYr8Wh+GKEzF6I2RdnwmM7PPwE 1Wiw== 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=kjHG2fEc32d5jG/RXXsuugh7BBMStXUSYttEp1ymo5Q=; b=a8ZDqHOmi+/sJKm9qBdikG5Qhdap2NwHIG/kktGkM9yUIdD2kXh51NHJ33Fi0TJnMh 8Da3qqyZb9cTfbMrBehRBumPvwgWt6NaBdbg7TpszLu7esTc/h6cREqdQPvDSRAvd1Kx TCldibieizlesMxTKEOPQv8MIMPKLneVVKVhj4kGLlvPWPZf6B3kFm97w8RfNLI/3sJp +ctt/3hMD00/sU7PCQ+eGXT8Yh/DeQcTv8xzzI3pIXkOTdgaGQrM7GH0ZhjLyWc/9/yQ t7zcWYOVv3KGQAu1+e8eH9FA03F6NSb004jNT29FHlA3iOyQKHWi0Lvkv5lE1N3J/31o iXvA== X-Gm-Message-State: AOAM533x9demcBcsYIHbPcCU02K5gb2X0PmRYFvcRINnVj27ct/Zg4Xv iFLUirZxVQDm5CvlIY5ZnChtboOYOyk46SCpkKQS6XamNwQ= X-Received: by 2002:a19:c78d:: with SMTP id x135mr33396486lff.82.1594137088645; Tue, 07 Jul 2020 08:51:28 -0700 (PDT) MIME-Version: 1.0 References: <20200707154606.52947-1-marcel@holtmann.org> In-Reply-To: <20200707154606.52947-1-marcel@holtmann.org> From: Alain Michaud Date: Tue, 7 Jul 2020 11:51:17 -0400 Message-ID: Subject: Re: [PATCH v5] Bluetooth: le_simult_central_peripheral experimental feature To: Marcel Holtmann 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 Hi Marcel, I'm ok with your modifications. Thanks, Alain On Tue, Jul 7, 2020 at 11:46 AM Marcel Holtmann wrote: > > From: Alain Michaud > > 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 > Signed-off-by: Marcel Holtmann > --- > net/bluetooth/mgmt.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c > index 5e9b9728eeac..d29da80e38fe 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 simult_central_periph_uuid[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,20 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, > } > #endif > > + if (hdev) { > + if (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); > + else > + flags = 0; > + > + memcpy(rp->features[idx].uuid, simult_central_periph_uuid, 16); > + rp->features[idx].flags = cpu_to_le32(flags); > + idx++; > + } > + > rp->feature_count = cpu_to_le16(idx); > > /* After reading the experimental features information, enable > -- > 2.26.2 >