Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp259187pxk; Wed, 23 Sep 2020 02:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLZLthNZZTFobiPFhWdGAwXw7O6OU6uBftX0RxJkXOa6WmbJFeAbkHYDD2BIlDBmG272PR X-Received: by 2002:a17:906:a398:: with SMTP id k24mr9137999ejz.316.1600853098383; Wed, 23 Sep 2020 02:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600853098; cv=none; d=google.com; s=arc-20160816; b=YOZXE0KsaaDSn7gkzPrcVnBNinX+M3ySzjPw3qOclxUtpUZFvek2wzHe5i1O1OzaQp O6kbwkCjp3HrFWmvp58fsFZ54pguD/xqznnu6w8nCRRhHTWBJavXVEehXK1bu+EAkA1F Y0nkUYK3yYkjG7yt/hBlzEzgEMj7SfbFI5juvxymsTkmW7Lcbjr45m7O/PmXjIsZ4+yv jjlYMe2biLWJc6lwSxM2WGroqleAwHPjrWqRYXdGqvxMKB0Mh2gixQ42q5ZfLkrbBIWO zdnDtOjCpTpgNZ0bffkD7uppkzTf8VvOf7ibjRxiSvx0/ORe56GUQAB9SbgHhUssjDGA 7BvA== 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:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=OYN0waWCzIpz4ouqNQwOPc0HvVqV4aulKVgXstFC8pM=; b=F9u8vfqkmxfi3e+IpUCI0jqKwl0Vbmo8YslSp6LcM07tw1Ycn7hM2ospirHutMDWD/ vqSrB8Rh9AH43Q2rGrIavQog12ZdRZyzpT16OuTDQcI6d/ItbkJuuKizo/GsAFU+e9vH HUYT++UeccikZn/Fd73F8+lDJh0uioTFgjEz7USdavAu6BIq6Ogswb0ero8VvaMJyj3j Aga7uizZ7xSO8FuNjApTJQSDD3kbKiWAyHXE8eevAvJcnBC2j7XFJpogB89jFClaiN/T sie/ZFmJNCvl4QVYwsvMwkMGZEM6DNrtu7/OBmNwDgwsFtlWiZl9Y0tNKRPEhkq38fek VPRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UTEylZUZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx20si12380651ejb.469.2020.09.23.02.24.35; Wed, 23 Sep 2020 02:24:58 -0700 (PDT) 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=@google.com header.s=20161025 header.b=UTEylZUZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbgIWJWq (ORCPT + 99 others); Wed, 23 Sep 2020 05:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgIWJWp (ORCPT ); Wed, 23 Sep 2020 05:22:45 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C70C0613D4 for ; Wed, 23 Sep 2020 02:22:45 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id r9so18704350ybd.20 for ; Wed, 23 Sep 2020 02:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=OYN0waWCzIpz4ouqNQwOPc0HvVqV4aulKVgXstFC8pM=; b=UTEylZUZ5updRxJyyE1aYQG2MB/kp+pzMWY5DhOtjk4PMP63yPQX5Vh2r0Nx4gPB/1 V9zrBiDN+pQkVLjlflvjNSdooxWO4yGD3nHAzZ7CQNQ/gkOk2/DccLeqY0U7p37oAanE HYrMNwgimP/NEksULzdrBxeNR8m+30WlcQf8eUzLQ3oteCOE7BPiRlV0qCmZ77rX7QZJ 1w2brV8qQ6HMyZXR6jkJdQsLRBEcefQT3hIXJlOu5K21VItm12/SvWm552hMC42DmvFz hYfl3JtNg2oaINdq4AZSFZzhyIHN4rU3btDdpttPcGEmxPsuGmWKTBXc8BqQ3zcFnme6 4sbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=OYN0waWCzIpz4ouqNQwOPc0HvVqV4aulKVgXstFC8pM=; b=il6v3cmqa3iqlWmrtqze64qFOpVYNbecwAum57uXBfowZOIwuX/3jymcGuG1pkrgKu sPG5X+Ekg/4pO1+OyKLN9vuhvusu9RWsvfBYp6CbTg8lXxQyvIqsLxs5PJbNXPngA5bT zlz+hnmq6cZ8Mqp1WMAOdMr4UJywzLveKaRM6vsS+t/8HQ7Vub9UPv/+++R5d+Uqic1S /qB8bQLpFIus498LbIICD8KPno/RkYYxhooG3SbzHLB1ehC3KIitwNLnuD01KJ6OqqYD ep8OEp17yxCK0YeUm7j1LRsBNQUJo9vK8b1clCAyZTVPcL+p41jNZ/0N8u8Qkk1Qs/9A 47mw== X-Gm-Message-State: AOAM531SlRYHsXKJN3QWIIo0+YrtU7YPaHAPO9qMYvE7mM8ZSfisWncC iQyQUXfjuPQxt7i4LisLN0T0Pk8CZiCehpRE9Q== Sender: "howardchung via sendgmr" X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:f693:9fff:fef4:4e45]) (user=howardchung job=sendgmr) by 2002:a25:8746:: with SMTP id e6mr11266110ybn.89.1600852964527; Wed, 23 Sep 2020 02:22:44 -0700 (PDT) Date: Wed, 23 Sep 2020 17:22:31 +0800 In-Reply-To: <20200923172129.v5.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20200923172129.v5.3.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20200923172129.v5.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v5 3/4] Bluetooth: Handle active scan case From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: mmandlik@chromium.orgi, mcchou@chromium.org, alainm@chromium.org, Howard Chung , Manish Mandlik , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds code to handle the active scan during interleave scan. The interleave scan will be canceled when users start active scan, and it will be restarted after active scan stopped. Signed-off-by: Howard Chung Reviewed-by: Alain Michaud Reviewed-by: Manish Mandlik --- (no changes since v1) net/bluetooth/hci_request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index db44680fbe9c9..4048c82d4257f 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -3083,8 +3083,10 @@ static int active_scan(struct hci_request *req, unsigned long opt) * running. Thus, we should temporarily stop it in order to set the * discovery scanning parameters. */ - if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) + if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { hci_req_add_le_scan_disable(req, false); + cancel_interleave_scan(hdev); + } /* All active scans will be done with either a resolvable private * address (when privacy feature has been enabled) or non-resolvable -- 2.28.0.681.g6f77f65b4e-goog