Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2866821pxk; Sun, 20 Sep 2020 21:24:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL6NcfI87oNH84g2JXEPJqBC7HMEZdg4jPKaPrZt8WJs4iLUlLbB0a8F2w+lC6hncDE718 X-Received: by 2002:a17:906:5611:: with SMTP id f17mr50433027ejq.427.1600662267008; Sun, 20 Sep 2020 21:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600662267; cv=none; d=google.com; s=arc-20160816; b=wL4CfmCbCCwee3vrdukxw4fHZX6b/6fPjGDwZBKXRPWZuuDuzxhNqvspoKbn5RMTqT 2lb4+2UaEg9NRMA0P9mRVcNxFH0DexveGfEpwno2dQgt4cVZt47fCLgcf6IaivVTTTjv jG5xpmpLLgigelcND0M/2CzbNYZXa+JqR44XdfOYbiAEJ9zZmqyalTuryTBMlQG00ePl Ll9+E6J+3VOp5Cazlpg/+NrmqSzty1RNA2O/k0F6sc1bIDDm1/3EN4rX0+W4mRIGpJWi qisWgjRh/neTvFsrHpqZEY/ZmYfzLmStWNMgaZmVfjaL5d4Wlgg8qoR5tC7VcTNx/0LT dWEQ== 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=KBETbgHJRtwnWH3QRJ6V38Ec73b7Ro5YQIkQRswxAOg=; b=hhqGwVQnl7YYpCup6opD1OBklllx0VTSb0d4tLss8traWNLLjGH96EjVzkb7ieiR67 S4cnT5yM713N4qXETY21IhdCUAJnEb1VAb5fHIwFTRSe9u6m5NB6JQXX8oRna5Gq2Eec Jni9uiOy3NVdCIU20ot5C7xErmkoEI9vwXitHPF2UypwMbpV8HR0r+KHM+OWdYvkEPl9 Xfy5rS3MEvb1468OIhREPG6fVOBEU6ps8M+tjvBlbpVoibgBR8xuegnvVT+yIxGo/TUi OpC/S7gt1YlbeRJhlFZn5GiDkpiAD3cTjYbT0QfhVihysAIThMrZG5dvVzWQHKFSgqgg ZxmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tJuzUxiw; 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 gu13si7852588ejb.395.2020.09.20.21.24.02; Sun, 20 Sep 2020 21:24:26 -0700 (PDT) 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=tJuzUxiw; 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 S1726210AbgIUEXe (ORCPT + 99 others); Mon, 21 Sep 2020 00:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgIUEX2 (ORCPT ); Mon, 21 Sep 2020 00:23:28 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF826C0613CF for ; Sun, 20 Sep 2020 21:23:28 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id a16so7811806pfk.2 for ; Sun, 20 Sep 2020 21:23:28 -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=KBETbgHJRtwnWH3QRJ6V38Ec73b7Ro5YQIkQRswxAOg=; b=tJuzUxiw1SA9quuoXjslcjTek27JhLsC98t22DS3rNXHxHyfi9QHtNqsTtmZebk5e2 /HWmclAyu8Ro01J4F3vQdTRr8Jf0YA64+XmaMQB+6hfU3cc2wD9YLcjdKkrHWZtG14JI IBs7U/3kpXNKUjzQ2sW1NLMHCSYlWvjI07HWDrMVWOoHrj5yxKVLXalI12rSBb+l7UaP R8WdyoYjR8SAWLwBiPluWLb6DbrVE/4OZyh04mOKQEDfBySB9lJ+0lEUZvRElvj0g6Qq g2VCB9QK//uRtVAgrUIBlTa4gqWQLqIIygz3Db2uNxtZfm8Oy77jxM6mOenqgIaPRpbP sDNQ== 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=KBETbgHJRtwnWH3QRJ6V38Ec73b7Ro5YQIkQRswxAOg=; b=ALW3U14sFyL2eiIXghH71krrxscImGJe5WsPxtxslMOjYAIr1ZARNTzVq/5d0DbqZ7 lPyIqWtfXW5IIKJtgma1SEJHmtfjLzKKhVNDmlXsu9NXAzj1WqLgIJggASWP9hW9lTic 3lzIDb4SfQ6/If4QBy4kz+OurDy+f9p7z/jeGjJ6bJD1rhyLCseIZNBp/CRHidmv9aVd rloH+SJioR2pUN42ZZJAGmSAbG9Qe9OrPEcJuxRAQXIgiw+XYdMY8ypXMrOV7g0wsIh3 eRhRMb9UWBoEUNsoiY7MFjrC50IrvvjjpCmtvcK7t6nFXHGuERhR09L7F6XwAtxHjQTl D1Ig== X-Gm-Message-State: AOAM532VQln+4kg6YY/nSi/C1C/jB6wtbQRQBC9ya28bJINBWF6YnB5o cXAsNlPshXy5BP74vV7R7l76PRgMcpKAJV+SVSnII/ShmUuaDToRMQWtR+wP8Lim008dSWJkx1Q 47NUL/s/OVapkhkxmN1bG+8kjkxq2IDVKEmJ4FdUfsaRXa7i5RtlUnh14HNWQLUIuhg6HIW/h7A lmfZmjQGcKWVo= 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:a17:902:a418:b029:d1:e598:4009 with SMTP id p24-20020a170902a418b02900d1e5984009mr26109409plq.67.1600662207933; Sun, 20 Sep 2020 21:23:27 -0700 (PDT) Date: Mon, 21 Sep 2020 12:23:07 +0800 In-Reply-To: <20200921122216.v4.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20200921122216.v4.3.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20200921122216.v4.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v4 3/4] Bluetooth: Handle active scan case From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: alainm@chromium.org, mcchou@chromium.org, mmandlik@chromium.orgi, 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-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 d9082019b6386..1fcf6736811e4 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -3085,8 +3085,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