Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp945275ybt; Wed, 1 Jul 2020 14:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtvG/YdSmS1k848JAdVyx7T/JuVBXERfJchkdoJV/+kt9byYAh3JSwHDt7W251LT6HY/PT X-Received: by 2002:a17:907:7283:: with SMTP id dt3mr25475423ejc.195.1593637958149; Wed, 01 Jul 2020 14:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593637958; cv=none; d=google.com; s=arc-20160816; b=ikHvNsV6sdwRTXZfQAgYEthsDh4zXGFNJ1kZEjiVgRDfMiBL0xAgwH2H29FzGhWRy0 lWr1bXBunnRlQrVaZ6idDWydh6gGWHXeR2wP/Mjsz6s5uidtYppkeBcL3IQlhaNshHFe ihc/w9XwxmvAw0m6LB9ioa4TpWM5IlajB4o/30zu0neI2vEVn7qmsXRsGCK9aj4ifBfL c/AgNHiCbeQufq1EulF8Y2lh7nx/NTUFBU9nS8+XAtfZtP2sg6se/UeVmk463lAeobuC 9qapMwSFm32ncc/jt4JB7J4PzYdvQ4R/BKiiHYyY+CExcbG60SSez/AVEZxQXVJL3Ovg Icsg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Ka+PnVHK/1B/CrRrAZfYxcFHrqbNySjfxP7d7NkszAU=; b=1K12pnb0BPZFAsxqcM5wL4sr7fpMWVP07BlEXNaHx6TZlWdBOSMdJ9zLjf4rYwkbeD m0E4Gd3XeAekaY1fF50m2UGrM4MnNRpysDCVIdsZxMkjrq8GlZ1y901ZwV0Eq4H1h2RZ dpVti4a1tBibiihw9Gyw/x5hT2Fo8PXzUfeAwZmBVmIEGf60VYcnZGR3JKn23NLE0u42 08KKiG3b8VsNoBZjv3bQYYwfWxHYIgYLo1EmAdcCGxHefqUoJTrunuwYC4EhUzNXYjF+ IqDnQL47I1dXOHDYe01CtJ340zTCUo6uIjODtv/ElRHw4Vy3k9D/EdsBqYlzfj2GiJLZ 8+2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m4oeAeMQ; 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=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 br6si4485275ejb.203.2020.07.01.14.11.54; Wed, 01 Jul 2020 14:12:38 -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=@chromium.org header.s=google header.b=m4oeAeMQ; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725915AbgGAVJA (ORCPT + 99 others); Wed, 1 Jul 2020 17:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbgGAVI7 (ORCPT ); Wed, 1 Jul 2020 17:08:59 -0400 Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ACBCC08C5C1 for ; Wed, 1 Jul 2020 14:08:59 -0700 (PDT) Received: by mail-ua1-x941.google.com with SMTP id b24so702790uak.2 for ; Wed, 01 Jul 2020 14:08:59 -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:mime-version :content-transfer-encoding; bh=Ka+PnVHK/1B/CrRrAZfYxcFHrqbNySjfxP7d7NkszAU=; b=m4oeAeMQkY62Y9pJCbsP2LJM44KZ2NxAjS1RZqeUD+uY9llI00BqEAcix5XIm//OCA Jkj6we/QqJ7VgCfsjBN/PL+RtDETarYm+q4hoYwc6vJ7eAMM76MM0VmSQ3o7uQcC2ulM 503PhAYUeTyD/tn3+KWz/LaZyRGGxgk/LAJOE= 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:mime-version :content-transfer-encoding; bh=Ka+PnVHK/1B/CrRrAZfYxcFHrqbNySjfxP7d7NkszAU=; b=MoWT9Nwugxw8z9eOjkZv3n9Xz0gfX2Hg4V1rqTnsaj8OZNRTDOFh8DiUwsakaloYT3 RVQigmsNxMQwZwjrDA0SuJqn3cnpT4U5RNwvFx4sEhD7QjUiYOqmzvtbIl4oz6rLaMg5 k2h2FJ2u2JlZeEpNmwVqLC39tAad1i48EmtBMZ/AsxjrPlt1oHcmDpenKP+MlHPZsKpi u9Mo5P22hZ70fgDdQZeywdqVU/sBYAy6HcOvxIiNID0/T8zGaNZlv2+10VjK8JHQmG1C FhiQ2ZgJ63OYVe0C0tYQQCzCAehiKZ6CSqHKeFZwxRLtNlv/TO6j/2duVWGJ3uV0In0r oMhw== X-Gm-Message-State: AOAM531r2/Solh+Ef/2MQfjoETHk/lCFHqhTWVK5/fOFfxnrpdixJFJo cuaRm1OMCarbYonhoVVoXvEjjNHAudM= X-Received: by 2002:a9f:260b:: with SMTP id 11mr19897956uag.49.1593637738606; Wed, 01 Jul 2020 14:08:58 -0700 (PDT) Received: from alain.c.googlers.com.com (252.177.243.35.bc.googleusercontent.com. [35.243.177.252]) by smtp.gmail.com with ESMTPSA id d200sm1148839vkd.16.2020.07.01.14.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 14:08:58 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v1] Bluetooth: le_simult_central_peripheral exp feature Date: Wed, 1 Jul 2020 21:08:55 +0000 Message-Id: <20200701210855.351671-1-alainm@chromium.org> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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 at the same time. Signed-off-by: Alain Michaud --- net/bluetooth/mgmt.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 5e9b9728eeac..b34547d7a897 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -3753,10 +3753,16 @@ 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; @@ -3774,6 +3780,13 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, } #endif + if (hdev && test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) && + (hdev->le_states[3] & 0x10)) { + memcpy(rp->features[idx].uuid, le_simult_central_peripheral, + sizeof(le_simult_central_peripheral)); + rp->features[idx].flags = cpu_to_le32(BIT(0)); + } + rp->feature_count = cpu_to_le16(idx); /* After reading the experimental features information, enable -- 2.27.0.212.ge8ba1cc988-goog