Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3879151pxb; Tue, 10 Nov 2020 02:23:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkM5KgixHV7DjSs2QsprTH/2p+mDyWmW9fZMgZu11wdldOL2E6aJMNr4sVLpCY4d80S1h7 X-Received: by 2002:a17:906:8387:: with SMTP id p7mr18711128ejx.511.1605003795121; Tue, 10 Nov 2020 02:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605003795; cv=none; d=google.com; s=arc-20160816; b=tOVyxf6kuz2u/ZYUACbzz+FCWlFiSTZGE4oofDlG2sslNE0JWeyjVGvJO0YUz1HQ/q GghTgi1R53+VDRxDPXSrLJpCQSsL7jf43juS/KMH+sTxSc/FHPxnFXx4YMS4IDo5VOcN pLfqbZLvKKqdB5xahSlhZhzb/yGO85IvQ1EOkW9pEQEKd7RZ1Oa4sUekjjiuzt/nDR7j XeOo7upgZHppjTjEXTh9iNsKW2d6OI5P2XZdNjnzgDw4L25VQpAfCFibfgAqxfHNqxpQ edLUy7SNiUaqsaIYEUdnTiiIAybP4jtgX+0Fwi+h3eh/N1yJB6butTunmY9QYJaLoEnE pCAg== 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=C95huzuAXxK/Q/ur78yeB7NRb6+ErTiDkKW1OinYBEM=; b=NyM7TX1gnl14zvLTkyzwcgytpXS0xWWw/gwUESQag8FR5BOl9uZK7ziXm6LBvZDivM R4CZr61y7OCQZ6095DKX7pU9be25NSO8pUu43g5yKIk8qrbGnz7RxhWz+AXUr+meweOz x6xoL1OaTXwWl6dga6i/Swy9KxgA8cOehp+g4EEt+8ZXMK0TenhRmKB/6LS4K5BELAaA f92y6A08W7+7YdFXoOZcjfxiac7k/BJ2lquQ4D9PeykL9EHd3LEDFJyxmOAEf8vwOr6F GWBOJCr0nwvHnXXHbQmWH/jW8qxePWqGZ2qcnnpz1T+x+CW9WTvL+NkXdNUUeIgqDrnM Oa2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fN+dlOtt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si8854163ejz.334.2020.11.10.02.22.51; Tue, 10 Nov 2020 02:23:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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=fN+dlOtt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1729909AbgKJKSy (ORCPT + 99 others); Tue, 10 Nov 2020 05:18:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730654AbgKJKSx (ORCPT ); Tue, 10 Nov 2020 05:18:53 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E0EC0613D3 for ; Tue, 10 Nov 2020 02:18:52 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id k7so14244353ybm.13 for ; Tue, 10 Nov 2020 02:18:52 -0800 (PST) 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=C95huzuAXxK/Q/ur78yeB7NRb6+ErTiDkKW1OinYBEM=; b=fN+dlOttk59kV4mLEiOPuNPqRVO5JnVN+aLCHgK4Ide9SzT2SQ3I1Yp3N5t72yFdir 34VUGkP4Cvs7PgQaYEmHpmbygeZ3AOQw1Pcu5X64sVf/KYR3/Zvp+Jtqmky9LNAMiyK9 yHgzL0q3RFCeESLtPDPRlS44QRMGM03aVf5L8qeRpxeY5wq2LY2FbBI5YCagY3N/ML8h 7alq99rz5kLQbnA2mlTGvhGpeRazuasVf4ZJpuJ1N3j4IJGh2yI0rCnyhq2a0ybp/N67 JJaJ8aXsthHSK58MdaYjLmplXIPzz9REb/KjTV4SQfWagMuVv38m6r4oJ1Y95ua6bjPa Kodw== 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=C95huzuAXxK/Q/ur78yeB7NRb6+ErTiDkKW1OinYBEM=; b=QuOjucivFEY15lLv1itj4bvQfG3dSq5ev2V1KOOtuITXn+NJmRM7PBeVgXjeVC+52N Qh5s5DI++b47Qk+bjid9JltjM/AVUmozJBLnwjoXIufY0Jkc3yUacfdQZd9NWDTSNYzt giWW7TJYl/LIbqqXu9uFZR6tt09su/X4Xazkpx3BtNqApLm1jWIWekdvFU/b/FNXBS6J ZTAq2IH5jiZn6tP/S6tiT/qUpOt9Zgx6r1Ony0b/Ls4Pc4CqvcRzuGfqZjy4Qd+Yqyf2 2P7P13ljfHkVf9yhnGh9T6ouYQFo5dGAcIo2kAGRvJZfi/qNb2jPP3/1wf9bbYizuWoi DDZw== X-Gm-Message-State: AOAM5316gsyLbS9nd4m3fKyN1phCniLodcA+nDT9QDKz8Piy1WWzFf8O YoZ2JGYTNC2q75qcKWypLuaZRS1XF04vIzBPLbJFuT57eUYVv3ApU4mRCCOx/HnzGVHy00ufMe9 egBQv2s3J5/mYq0orMcaHNzEFP73ToGZhYCIRT0CyV4xDKo/wbIFkFs/yEjkKgATTwOT5oBO2ak nQidedXIi9t+o= 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:ac23:: with SMTP id w35mr26697654ybi.171.1605003531984; Tue, 10 Nov 2020 02:18:51 -0800 (PST) Date: Tue, 10 Nov 2020 18:17:53 +0800 In-Reply-To: <20201110181740.v8.1.I55fa38874edc240d726c1de6e82b2ce57b64f5eb@changeid> Message-Id: <20201110181740.v8.4.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20201110181740.v8.1.I55fa38874edc240d726c1de6e82b2ce57b64f5eb@changeid> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v8 4/6] Bluetooth: Handle active scan case From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: mmandlik@chromium.org, mcchou@chromium.org, alainm@chromium.org, Howard Chung , "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-bluetooth@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 d943ad2885aa0..172ccbf4f0cd2 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -3099,8 +3099,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.29.2.222.g5d2a92d10f8-goog