Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4468551rdh; Wed, 29 Nov 2023 02:17:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRzPPWzhudH8Chf1HgLpmjtMlhWXBqH5OUoZjz6020aZ2c0Z6QuO65lsiODk0oqUixUMoF X-Received: by 2002:a05:6871:292:b0:1fa:1eb6:45aa with SMTP id i18-20020a056871029200b001fa1eb645aamr18258828oae.10.1701253076896; Wed, 29 Nov 2023 02:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701253076; cv=none; d=google.com; s=arc-20160816; b=zGVfxEbSl2TmSy3UxHwCsOYQXHJ7gcoMmwOl9yNEXRN5CbelO6ndfZHW8GMocWnMc2 c9HyYuXWwIR+b0XZ/0xRk9KhigzHZtFMgXZe4JTCRpPhzmxqoDFtDmGDxjzYd5IRZPun v4GU+a1Cucv/0JEg7L6p03S5mwrtEH29zew/U9DvDvGjh1b3/q9XlBnjjsNCTYd6krKi GeGWKE3lJPPJPxGT6kNTcIJc1g712fNZxS84iUuKN6Pbos90nCNHjTtB0vkglw0djwnV P5iT/ok+fzW/W1Po5DnS308u83MGrXjW/R52wJavQC9eLz8lPBC9HumTcp1H4QkDZ15/ NOlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ua09gyS538w1NmsXuogSYiXcLvSV2cQSxsajdmkDKfs=; fh=XS1mZVHhMJAl6UDpP/hxe0G6QSlPlHiVcjzYN3A74sg=; b=RgHtABqYUMRJoICVfo7z/t+m1sjqVW3litnkM0kgJKT/7sVClgagzlKEROPuKpQESC 5Z2l3uMoldzow9O5i/nEqI8AzU0XMagmpiVemmCS3olyyPYeE+a5m2HeYfNQkUeByuER P5Ajv8nF9SbLomAeiLKPJPDdrdQyxOE7IbiwU6wU25ttCfD5EZUthbpvmAa5P6IEjvvt IoN5AMQdeVC0nkAY+JEo93E+1EDo6fiIMdxXz3cUtq7B6fu4BuFDC+3pX7IWAk76svkj 1lY+YxwULqu7ZKnfdawaUWxQbcRUE6CFlI9QB4NuMUjotiCG9ZkjHxCq+CDfKX9oLx0q Viig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=a4VzV1yk; spf=pass (google.com: domain of linux-bluetooth+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a186-20020a6390c3000000b005b99697d854si13387975pge.673.2023.11.29.02.17.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 02:17:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=a4VzV1yk; spf=pass (google.com: domain of linux-bluetooth+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6504B28342B for ; Wed, 29 Nov 2023 10:17:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50D511A5AB; Wed, 29 Nov 2023 10:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b="a4VzV1yk" X-Original-To: linux-bluetooth@vger.kernel.org X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 29 Nov 2023 02:17:47 PST Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AA619BB for ; Wed, 29 Nov 2023 02:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1673; q=dns/txt; s=iport; t=1701253068; x=1702462668; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=azuRch+ty4GbnhjoW5vaRLF5YbSYGRYMJbc2P04cDqs=; b=a4VzV1ykX+FGYSoPEZJEyR7N+/lx/SzUhD5X3Fy1zJLxo6Xqkd9VSq3t 5E7q/9JqUcTluhij60fz5kkmEPpWanZjDdtehXhWAHGj0FDA2bNUqluZt ImEGuLny6yOfXizNS7t6rAxy0RcI61f0VYI3oZTKF68t3CMhKN5OzDSvi E=; X-CSE-ConnectionGUID: cJ2fvtKGT+Gg7ZdfloZufA== X-CSE-MsgGUID: nwtWPhITR2+4UqRUMiZDvQ== X-IronPort-AV: E=Sophos;i="6.04,235,1695686400"; d="scan'208";a="9768502" Received: from aer-iport-nat.cisco.com (HELO aer-core-7.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 10:16:42 +0000 Received: from pwaago-threadripper.rd.cisco.com ([10.47.29.164]) by aer-core-7.cisco.com (8.15.2/8.15.2) with ESMTP id 3ATAGgAp070729; Wed, 29 Nov 2023 10:16:42 GMT From: =?UTF-8?q?Per=20Waag=C3=B8?= To: linux-bluetooth@vger.kernel.org Cc: =?UTF-8?q?Per=20Waag=C3=B8?= Subject: [PATCH BlueZ] adapter: Enable SSP after enabling BREDR Date: Wed, 29 Nov 2023 11:16:27 +0100 Message-ID: <20231129101627.1742015-1-pwaago@cisco.com> X-Mailer: git-send-email 2.42.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.47.29.164, [10.47.29.164] X-Outbound-Node: aer-core-7.cisco.com When enabling Secure Simple Pairing, the kernel first checks if BREDR is enabled. If it's not, enabling SSP fails. Therefore, it is necessary to make sure that BREDR is enabled before enabling SSP. Without this fix, bluetoothd would start without SSP enabled if started in dual or bredr mode after it had been run in le mode. --- src/adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 2c3cf7600..86fff72bc 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -10229,12 +10229,12 @@ static void read_info_complete(uint8_t status, uint16_t length, switch (btd_opts.mode) { case BT_MODE_DUAL: - if (missing_settings & MGMT_SETTING_SSP) - set_mode(adapter, MGMT_OP_SET_SSP, 0x01); if (missing_settings & MGMT_SETTING_LE) set_mode(adapter, MGMT_OP_SET_LE, 0x01); if (missing_settings & MGMT_SETTING_BREDR) set_mode(adapter, MGMT_OP_SET_BREDR, 0x01); + if (missing_settings & MGMT_SETTING_SSP) + set_mode(adapter, MGMT_OP_SET_SSP, 0x01); break; case BT_MODE_BREDR: if (!(adapter->supported_settings & MGMT_SETTING_BREDR)) { @@ -10243,10 +10243,10 @@ static void read_info_complete(uint8_t status, uint16_t length, goto failed; } - if (missing_settings & MGMT_SETTING_SSP) - set_mode(adapter, MGMT_OP_SET_SSP, 0x01); if (missing_settings & MGMT_SETTING_BREDR) set_mode(adapter, MGMT_OP_SET_BREDR, 0x01); + if (missing_settings & MGMT_SETTING_SSP) + set_mode(adapter, MGMT_OP_SET_SSP, 0x01); if (adapter->current_settings & MGMT_SETTING_LE) set_mode(adapter, MGMT_OP_SET_LE, 0x00); break; -- 2.42.1