Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7160664rwn; Tue, 13 Sep 2022 15:06:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4a6mQCNvxVIBhuXXqUI9TH5or7/PlUY9SpDQWJ3OOHRRNimjDzxeJmcamDW7iB2oAvIW4V X-Received: by 2002:a63:6bc5:0:b0:41c:26d2:81e2 with SMTP id g188-20020a636bc5000000b0041c26d281e2mr28946606pgc.522.1663106782253; Tue, 13 Sep 2022 15:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663106782; cv=none; d=google.com; s=arc-20160816; b=RrFL/1lzpZ64WLpW5p4fs5uQjCKgKoakpGaozZNs0+yDpJmupEm6TowSVPSrJuaeZY z30/G2TyZbSk+t6mqI5wzuFtTf8CZyCIq/OtZixIvS5SJEgZIfsv/xTuPcdsVs6l6fra ls+MA2vy/AAXzruM1vQ4K/MhHz+DlZz87FsUjZW6jYPSgnHDeF2Az1t67O/vYyKeNKme DMTlTBozWgJ0EWIB/c8eAZIXxGuZtZIe/T8KNziTUgmXpSi75RuNj8LavBA7UWOxQqff KYiuhNsm6Z067ol7QxExBSvokOMbJD8RonZ/W1ivacUmF/B3MRvkVYloy0CFWSh3Af7g LjKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=0/mpIJ2sZEnqGQU+eeGOiHwYV7wmza8JoOszk+ZskGw=; b=TjmuHxhzxhBAkQhqahMsBBSqBDdaUTpgnEBdYuOB1aGU3Cdq4u56NM475sLqzyJDVQ 6Tt2mHdr8dUQogs7k/+T6lVSBKM+Ft9u7Gws4ntiz+uC++lTS7xg4PkC5M3fJjIke1qD LkBVB7iEeuabhfr76MQkWPW6gu84EJheDWZQ3a1+kV11xx9vUNYxCW+mzxO9rfzvkdqO dnHs9WnzacnekBwiLzt3uI1CWfs5lkVyJyfRS4j/wd3JpEvdzsw3mxHSEMPefFjy+9Ej kpG6Gang4dPA2FAWbGoxLX1hziEnxyChAipN4oR9xkq2u1NmUu+R4Wipc9LYiSbcfKny ykEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=La2UwnxA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b0016c44b7c8c5si14381838plr.11.2022.09.13.15.06.07; Tue, 13 Sep 2022 15:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=La2UwnxA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S229717AbiIMWEu (ORCPT + 99 others); Tue, 13 Sep 2022 18:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiIMWEo (ORCPT ); Tue, 13 Sep 2022 18:04:44 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32843B4A9 for ; Tue, 13 Sep 2022 15:04:43 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id 2-20020a17090a0b8200b001fdb8fd5f29so6140754pjr.8 for ; Tue, 13 Sep 2022 15:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=0/mpIJ2sZEnqGQU+eeGOiHwYV7wmza8JoOszk+ZskGw=; b=La2UwnxAwzAIGGTRGxRY2aTrW3UyWe1vYGqQwnejHW/RqXhDz1yh045Mn5/TmsTyFn PREzALzxxhe7wqsvV2a1r5msIKw6sh1z8ZWKRJ5DNUVYmntdMUA9YrYV6j06/m7A080i epGrr40YmEFv3o+fBQzzB1Fpr3Qy9Iky4VNXrVsFtYVHU3yNQpO1m5j53EiNBDM0dpz8 nIxflgGMf6LG82a3G3gUhuBwzMrWb9jsiGf4tFbXP9duQ1vMSiKDLe8GBCuZ7atCjw+E Keh51/YMhMoHFIqCkDl8sZLYfh3Kt73sC5xg2D6iUPAyZJ9hbWyA3JmmMvVIsSfHi40e 2WJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=0/mpIJ2sZEnqGQU+eeGOiHwYV7wmza8JoOszk+ZskGw=; b=YSoOx1jCUITJuv88W24Cke+4tnB8fr5Yy62Zg76Y+VpcZHywJ0zRuPxRlctbS6t0u3 5nS1mOq2i55HHzbv7V+1UlgkIWrTLQQjeMi5UW560KGyLh6ndMDwBz6c6Ope/JMxo3fQ 0cLlq+X/SefkEHmj7BofKACdDjXyCCjZMLFMloj35kVYJ0CAxUOs7MyJ6cMb4lRY6gRV LsZqGlrYFSc31eczWhe6QN12qHMXmT4gHhcltUmhD2zkDEi8Bup986QA1v8yD+ds1B2W +0PwEDo9Wy2iUza6NDBntK9g5ZiA6Sl/We/hjoub+yo5fuiago/ColmCbIwj/NCxwL9R 3INQ== X-Gm-Message-State: ACrzQf3fTb88Wj/JPCkFcfnQH4lKTlSiPxRbaO6M8MgBUD3taDv9U7+R mPBDPSWHJWPfpvr2RO+8bMKM8gNQsBxg X-Received: from jiangzp-glinux-dev.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4c52]) (user=jiangzp job=sendgmr) by 2002:a17:90b:1b12:b0:200:5dbd:adff with SMTP id nu18-20020a17090b1b1200b002005dbdadffmr1364786pjb.43.1663106682689; Tue, 13 Sep 2022 15:04:42 -0700 (PDT) Date: Tue, 13 Sep 2022 15:04:33 -0700 In-Reply-To: <20220913220433.3308871-1-jiangzp@google.com> Mime-Version: 1.0 References: <20220913220433.3308871-1-jiangzp@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913150420.kernel.v1.1.I54824fdfb8de716a1d7d9eccecbbfb6e45b116a8@changeid> Subject: [kernel PATCH v1 1/1] Bluetooth: hci_sync: allow advertising during active scan without privacy From: Zhengping Jiang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org Cc: Zhengping Jiang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Address resolution will be paused during active scan to allow any advertising reports reach the host. If LL privacy is enabled, advertising will rely on the controller to generate new RPA. If host is not using RPA, there is no need to stop advertising during active scan because there is no need to generate RPA in the controller. Signed-off-by: Zhengping Jiang --- Changes in v1: - Check privacy flag when disable advertising net/bluetooth/hci_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 41b6d19c70b06..422f7c6911d9f 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -5351,7 +5351,7 @@ static int hci_active_scan_sync(struct hci_dev *hdev, uint16_t interval) /* Pause advertising since active scanning disables address resolution * which advertising depend on in order to generate its RPAs. */ - if (use_ll_privacy(hdev)) { + if (use_ll_privacy(hdev) && hci_dev_test_flag(hdev, HCI_PRIVACY)) { err = hci_pause_advertising_sync(hdev); if (err) { bt_dev_err(hdev, "pause advertising failed: %d", err); -- 2.37.2.789.g6183377224-goog