Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp598149rdb; Thu, 21 Dec 2023 21:45:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQ4AC3nE2iYhHZLQzDmbuEf6GWXr7s/fSr1dDwArafi1WDQmVczR+61VDkPiBXFZWS+VNy X-Received: by 2002:a05:620a:4014:b0:781:2de3:9f41 with SMTP id h20-20020a05620a401400b007812de39f41mr381611qko.38.1703223942405; Thu, 21 Dec 2023 21:45:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703223942; cv=none; d=google.com; s=arc-20160816; b=yKWptdzJczGIa2bcV+cAlvxPiqgb1V6rgVcTizJMJHNhlsqEvA0XHh9uK7owjQDVsZ 8sSWk0AiDXvQwxZvXVkGdeq/Sp5Bg02inZhPexzOYL73X+Im2OxqZiODXOyjxP2c3pBG dXomz+INs71FOQ9UrRdfHnn9yqzY9GQWnZGB5KLoLDVnTMPf/r2/2Sra+vuLWUkI0/uE UE4s4oBNveY/7kWKfJD9M+aZuotjsvvS9lLNsMVqZOUKJuE9/iZ4gTOInCfaXOKUamW8 +G0rW8/TEf82ttkCDDGumg+Oo0QSmIQoN8jAaHth+xZQP5qc44E8xwrOwsEZMb2ja6Eu zJRA== 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=IO+dkAnixD9hpsTyKaQ6W4sS2oMZcVGFzQpHVG50o3s=; fh=j9qDAqT5Uf6bFj88Iqh+k9JK2G/ToXkcYSueOJUzmdc=; b=vxGPf07mv5kzBnqJcYaAYuXUXzRIzoewU4oWfWDMHi3fKG0d28DilIy49KXtrgzoHl 9ZgsE4yacJmJB00vaAWOEBFr7B0pQwaVVbwrKqR68b4tJkOXG14llKmXNAWNyBltjOVR FuSZg7hU8DE2CiRhgegc3DCltxK487z4//JelJXNKzTnrBDItUEFS9KiY/Kj4A/Udiyz 0qQKyEGcETHn1xGX9pQUnUD3VpBn+yx1Z3gwkhbzlk4J6OZESQPexEaT2SPWh04KXDqR T0IaniIwetXa4goFg/ljupIs4PD+pYpcnnJMp1ETb9Gv8LDlFzpYn1wz634bkGOQNGOv FVuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=PPlncuHT; spf=pass (google.com: domain of linux-bluetooth+bounces-702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a20-20020a05620a439400b0077f2dedd50csi4035871qkp.647.2023.12.21.21.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:45:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=PPlncuHT; spf=pass (google.com: domain of linux-bluetooth+bounces-702-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2478D1C24DEF for ; Fri, 22 Dec 2023 05:45:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B2B05686; Fri, 22 Dec 2023 05:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="PPlncuHT" X-Original-To: linux-bluetooth@vger.kernel.org Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.215]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5881D46A8 for ; Fri, 22 Dec 2023 05:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=IO+dk AnixD9hpsTyKaQ6W4sS2oMZcVGFzQpHVG50o3s=; b=PPlncuHTTZ5S4PI0Y4rb3 VOH5lI9FqiY+PbPzCM+YKgXEQP0LVIZ1IcYk4C3HCAWUjOHm7VUBsC+GkqM79YDh u3Q8/IWPNh6SxeJDqk3RC74Ba4hlZCZLwZ1W1lOFCbs0qGVuEkUjY0svpMt7iRAJ Q8CChUhgjZgoGo8Tr7TXno= Received: from WH-D-007635B.QUECTEL.COM (unknown [223.76.229.213]) by zwqz-smtp-mta-g5-0 (Coremail) with SMTP id _____wA3P0JsIoVlI4kACg--.27645S2; Fri, 22 Dec 2023 13:45:17 +0800 (CST) From: 15013537245@163.com To: linux-bluetooth@vger.kernel.org Cc: zhongjun.yu@quectel.com, Clancy Shang Subject: [PATCH] [BlueZ] adapter: Fix airpod device pair fail Date: Fri, 22 Dec 2023 13:45:15 +0800 Message-Id: <20231222054515.1266741-1-15013537245@163.com> X-Mailer: git-send-email 2.25.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-CM-TRANSID:_____wA3P0JsIoVlI4kACg--.27645S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WrykKFW3Jw1kAryxXr1xuFg_yoW8WrWUpr s8Was5Gr4jg3Wagw13WFy7Wr13Cw4kury0qFWay3Z5CFW7XrykX3y3tw10ya1UJa4DXa47 JF1DX3WDG3yUGaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jkzVbUUUUU= X-CM-SenderInfo: rprviiitvtljiuv6il2tof0z/xtbBEhJO12VOBGp4qQAAsN From: Clancy Shang Airpod is performing inquiry scans in BR/EDR and advertising in a unconnectabl mode whit the same public address at the same time. with this featrue, when found airpod device, set the bredr support, fix it pair fail bug. Signed-off-by: Clancy Shang --- src/adapter.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 022390f0d..488355e9c 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -7066,6 +7066,25 @@ static void adapter_msd_notify(struct btd_adapter *adapter, } } +#define APPLE_INC_VENDOR_ID 0x004c + +static bool eir_msd_is_apple_inc(GSList *msd_list) +{ + GSList *msd_l, *msd_next; + + for (msd_l = msd_list; msd_l != NULL; msd_l = msd_next) { + + const struct eir_msd *msd = msd_l->data; + + msd_next = g_slist_next(msd_l); + + if (msd->company == APPLE_INC_VENDOR_ID) + return true; + } + + return false; +} + static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data, int8_t rssi) { @@ -7281,6 +7300,12 @@ void btd_adapter_device_found(struct btd_adapter *adapter, device_update_last_seen(dev, BDADDR_BREDR, !not_connectable); } + if (eir_msd_is_apple_inc(eir_data.msd_list) && (not_connectable == true) + && (bdaddr_type == BDADDR_LE_PUBLIC)) { + device_set_bredr_support(dev); + device_update_last_seen(dev, BDADDR_BREDR, true); + } + if (eir_data.name != NULL && eir_data.name_complete) device_store_cached_name(dev, eir_data.name); -- 2.25.1