Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5185678pxu; Tue, 22 Dec 2020 10:18:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkvhoaRvph3iq+in8fUJotB+4fYSAQ6U3X5wk5B5mSno/pUrJgwqagiegxYOZk3JxkV3J+ X-Received: by 2002:aa7:cd44:: with SMTP id v4mr21366883edw.156.1608661117933; Tue, 22 Dec 2020 10:18:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608661117; cv=none; d=google.com; s=arc-20160816; b=Keh4tNAiwqLwOJ9PgxRIpg02m79aiIDvEirW4/PvtTgWlC+txPTTC6y10fWfLTWdGP wCYphFZXw5a9AexXmJrjUBKYBG0vB+h5qBvN7T0pfcwMx48pDS2Nbno1iYwu6glo61ey x2VoC/gOGfoni8XP9Y68H2VzlBbSIgjptTcnufvN3swiI80pC36gK15gP+YHTtxH/VHO lQLOJNXOMUgtqoOZ0JNntw8TzZ6a6ic4baN+mfHyrANM/PtVN7zgpMqXhKkPHjO6zgsR ucdyVR6Pca8OiNpvbGqr5fuBVa4FgG4jOMLm0EJtU8M01Gza21S8httE365GOZMHv0HX i30Q== 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:cc:to:from:dkim-signature; bh=n0bpRNUW0sMX67i76nSxzJVA0UXv2Ge/HrRVpArz6Og=; b=RSS2zZ3z6Q4v6albKcnR8aoi6+ecc2k8NMaaMGZmitUtCs+804ttmrx14ETdrhfRNq 2zGEm3QMJUUiqIdHECQxzce/1FxdcU38OAJw4GrLoc8Yy1ZEnveyR2Z/RCj07ovKvAAE wTQFsqzhnEpBhrN5iSewQzdXp6UFT4l0dKTI/QmLDuT87zneLMNNFxVHNujNQX6WAHRQ V684Vx+qdqtCvXfNZqNks2IVumgZNYCrPxIVMuKaCe6IBPa3N544wDS0vYyo/Y12WSu5 hFPwDltB3NiqtuFqTOcZ1feZKfVdAIIiCBkum301c5s7x3ieUpZ249rpsX7olc65a8UP HbUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lKRfKAiP; 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 c1si11672583edk.605.2020.12.22.10.18.10; Tue, 22 Dec 2020 10:18:37 -0800 (PST) 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=lKRfKAiP; 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 S1728098AbgLVSRP (ORCPT + 99 others); Tue, 22 Dec 2020 13:17:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728070AbgLVSRP (ORCPT ); Tue, 22 Dec 2020 13:17:15 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F183CC0613D6 for ; Tue, 22 Dec 2020 10:16:34 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id c79so8922392pfc.2 for ; Tue, 22 Dec 2020 10:16:34 -0800 (PST) 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=n0bpRNUW0sMX67i76nSxzJVA0UXv2Ge/HrRVpArz6Og=; b=lKRfKAiPlfWevqIDZpQSTkPSL/bZXtYdbMRQIw4G8nvyx8Vn5G4bekPGEX1q/WUrY/ Lo+2s1XFmkvboKIQ7jQGoWz2ZktBkV72EuStOBXiebt7ZtJndehOLBpY6DPSn4/vs1dX p1iD6aGW57yuLqmVW6CQ36mgpNOjIohIXgPGs= 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=n0bpRNUW0sMX67i76nSxzJVA0UXv2Ge/HrRVpArz6Og=; b=WZYjM9N6ZYJ7j0mJiVdlydpk23r6cIyQbC9RAi4OHRnVuViAH1BIQmD9dDXIDcRLed my2y74aA4mDG7hTWQqdCkMMusQq9O77d2aw1qwVNPK5lBFQJ3YvHGuUc0RlDXJNF1J7q YCG3W/oKjCLpluyVo0RE5ZyvbiYRpHoZCqRrvUrj67lzfLWb/Czgv36Oo+8O7tbyqBPD LtcJe33hOE7EhNFrX8eQ42aVtlPXIrCijCSwgXeWPPU5tTKXJDEwnRLt1r1ZiGo5ocrS 2V7D1O2VmicWBEspSM18QpgED4A8iLtY0b75/61aZs13wwBWg5M8L1wKaH7MSCYFzcRj VABw== X-Gm-Message-State: AOAM531MTvNqLX2mxBsi0aYZ9lgGYBGKq6Dt6Mk7/r5qllxxfyJsa9Aj FLUvp9SmEfcD1022+k//BccUYg== X-Received: by 2002:a62:184e:0:b029:19e:c636:17f9 with SMTP id 75-20020a62184e0000b029019ec63617f9mr20599968pfy.23.1608660994487; Tue, 22 Dec 2020 10:16:34 -0800 (PST) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:7220:84ff:fe09:2b94]) by smtp.gmail.com with ESMTPSA id 193sm21107111pfz.36.2020.12.22.10.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 10:16:33 -0800 (PST) From: Abhishek Pandit-Subedi To: marcel@holtmann.org, linux-bluetooth@vger.kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi , Daniel Winkler , Johan Hedberg , Luiz Augusto von Dentz , linux-kernel@vger.kernel.org Subject: [PATCH] Bluetooth: btrtl: Enable central-peripheral role Date: Tue, 22 Dec 2020 10:16:27 -0800 Message-Id: <20201222101603.1.I94935e7936550207ae745d3670890541c792c35e@changeid> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the central-peripheral role on RTL8822CE. This enables creating connections while there is an existing connection in the slave role. This change can be confirmed in userspace via `bluetoothctl show` which will now show "Roles: central-peripheral". Reviewed-by: Daniel Winkler Signed-off-by: Abhishek Pandit-Subedi --- drivers/bluetooth/btrtl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 94df4e94999d5c8..1abf6a4d672734f 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -714,13 +714,24 @@ int btrtl_setup_realtek(struct hci_dev *hdev) ret = btrtl_download_firmware(hdev, btrtl_dev); - btrtl_free(btrtl_dev); - /* Enable controller to do both LE scan and BR/EDR inquiry * simultaneously. */ set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); + /* Enable central-peripheral role (able to create new connections with + * an existing connection in slave role). + */ + switch (btrtl_dev->ic_info->lmp_subver) { + case RTL_ROM_LMP_8822B: + set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); + break; + default: + rtl_dev_dbg(hdev, "Central-peripheral role not enabled."); + break; + } + + btrtl_free(btrtl_dev); return ret; } EXPORT_SYMBOL_GPL(btrtl_setup_realtek); -- 2.29.2.729.g45daf8777d-goog