Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7234068rwn; Tue, 13 Sep 2022 16:42:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QRg/6Zs/Wo+1mTuvd+sLnswKG5R5omeKfLRquk4HoL5nF07okQU9ffjQu17SjnmmoEH/F X-Received: by 2002:a05:6a00:1a8d:b0:547:c564:1614 with SMTP id e13-20020a056a001a8d00b00547c5641614mr299086pfv.71.1663112565778; Tue, 13 Sep 2022 16:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663112565; cv=none; d=google.com; s=arc-20160816; b=biOFiHxJ/xgADYdCeZuyjjaLzNEAo6J7+RU9N/Tkib/8bg7OuHu2NO/7oFKPI5GsJo /s3lIzBZXSgvytShdrpL6XQwK0rTytGVBD6jQ9/qP8D76h9g2lzTJa77cYjvfccYTqB0 uHvl0MLiTku5YJE5ZRsMsJgqmQypoMZlIdfa4QodpUJ2NL9i/MVvu7FgP0M8DexdFuwd jl7PWGo7n/0LeSzpe13+24S6BHnQ2yXeWn0NwAuHoVejfGHwhOn1Plnmgmz6cNPkWLgk qJy5Ab2FpIioEGahMc3CCtdUAHbs9gov6v5wDHbs30Ywt9LtfJ9ljVfFVnCE5D8YkXlN u2Sw== 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=3R3kd3ajupj3cdm7/eN6SOKkue4SpZWOLdvBLhR9NOg=; b=GLTvk5mN21M9mKgQdCB7yWsZoMCgEmhHk8m8Z/hRDIzN9BytAj3mEbLnuyu/arW9Qz Nu1D/43xgSH0Chw/p8PQr5AOmqQbz466sycEHcttTHKsCNR9AhygLGoXIXfSfJF7Sbow zMKtk59p9caX0GUX2YoyAX1vELP9Rwlyf3PgwY8WWTxqoYQ3gSd+n2eDuyf0JOhcOz2B STUYEj5z6Mv5rCzrKnRj09hwzxG7C4bX/FaRk/gRyqUOaEYYpnI5QF6wDJOlUgRLOrJH h8QAHu2pGbUvTADEe4Ko1+iYdUGt4/oJX/piDAnDVQ2eHIZLIif74dfk8NYcQNumz0ES 86ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PD40MUF8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 mw6-20020a17090b4d0600b001fdfa9e8c8asi1565788pjb.169.2022.09.13.16.42.34; Tue, 13 Sep 2022 16:42:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=PD40MUF8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S229874AbiIMXh0 (ORCPT + 99 others); Tue, 13 Sep 2022 19:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiIMXhX (ORCPT ); Tue, 13 Sep 2022 19:37:23 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03F2719B2 for ; Tue, 13 Sep 2022 16:37:22 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id h5-20020a636c05000000b00429fa12cb65so6507821pgc.21 for ; Tue, 13 Sep 2022 16:37:22 -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=3R3kd3ajupj3cdm7/eN6SOKkue4SpZWOLdvBLhR9NOg=; b=PD40MUF8Fbm96f+EH4eN6upE2dgzH6/V5FZ6SzuMdGoEo4HvZK+fJbXAWO9ldkK2lx kzQSobzZo1PkoYHzVvsc4e9FM5Oe0qds/6+zWntw22zR4S8nBVNl0xisR46tkpiuNeF6 Qwjo6rOvh+Hm3kJRwyJmG9pkUFK9aQpTB0G+Wk2x+pNyqN3M8l1Rt0e3yxRZOYGpsM+b zO+qdXeOuJ3TSuFJjZJlMoBRd21LP2UZQ8LZHym5g/lybtCFr/ReZhe7Fyg5JnOf8E2H flQYwuHYKHqFGoR/HQKD4DtAsfVNxH29HqEtp4ooAqIc4K59hP2YIhJfnoLW6OUbii1P tQpw== 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=3R3kd3ajupj3cdm7/eN6SOKkue4SpZWOLdvBLhR9NOg=; b=BcokyW2FMB7bk2xFyrrCuVwI0n/XTghv3E1XfJWjaWfXWO2VCyVxFIqk8LokXd0iLv CAmpGBNU8HxzOpeipbAZJx90orw3KDxcO/v1FVy38cudeX38PIi6l8JRwqdaFEkYL5l4 UC3fxalZditu97drk2v9wY0R2NA8dNM9IiW2W66+YuXyclWKhsYdKqwKcw4s5P8Nrj9Y SqxcE2RX8Zixuj72DGm3z/qLaWlzizk9Cd9TItCOqrqLJ5OkGQBYaIurp+SFqHY+kYVO VJ6SR13kifv0trQSx1GfM2HRExyXmlF2+qsFOROkMR+8RbD3XxN6yl0Pm5zhAW8SG3me ooLA== X-Gm-Message-State: ACgBeo29HImoCNcatUfPRlggAILrdce9svREs6MeHDZU0VVPxQ/25iLy GMKQQdh6KYNWk1UCB+HKKVkpJylfGJkQFmdTfpIHOb2E8ULKcm9wS+qwMH1wgfmCkp9PqGy9EYd qq1G/KG5ztOkBPkZKW/RauSz00WABQcFjfoYo9Xc/GAJF77xZFn+oTHniXqb1CHeI29uSjwpo8B Vz X-Received: from jiangzp-glinux-dev.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4c52]) (user=jiangzp job=sendgmr) by 2002:a17:902:6943:b0:178:4751:a76b with SMTP id k3-20020a170902694300b001784751a76bmr5349334plt.37.1663112241844; Tue, 13 Sep 2022 16:37:21 -0700 (PDT) Date: Tue, 13 Sep 2022 16:37:15 -0700 In-Reply-To: <20220913233715.3323089-1-jiangzp@google.com> Mime-Version: 1.0 References: <20220913233715.3323089-1-jiangzp@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913163710.kernel.v2.1.I54824fdfb8de716a1d7d9eccecbbfb6e45b116a8@changeid> Subject: [kernel PATCH v2 1/1] Bluetooth: hci_sync: allow advertise when scan without RPA 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-bluetooth@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 v2: - Modify title to reduce length within limit 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