Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3747023pxk; Tue, 29 Sep 2020 05:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyzHkAnB/VHlkjTgRguaHyOc2HeLIWH850SIrxrLPdrPWToV72Nu5vmv1LzSqNYhrgp494 X-Received: by 2002:a17:906:8399:: with SMTP id p25mr3528410ejx.243.1601382228711; Tue, 29 Sep 2020 05:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601382228; cv=none; d=google.com; s=arc-20160816; b=yTIgAwciNOMUrndNj8IuUfQiqoegD1x+DLFlaaAtwudy4BdqP/jWTBpveRiE5nfDh9 5j7tsTVMph7UKv/DzP7UlCN+Jrwm6saRTMxVqx/Ldc2diORxhtHWFj0vvJeywlUv98iC aY88UcAj9VTf3nlw/pd3WhLQ5BsMMashmQxN/OeZNlZmmnXhId295dhbHDvzcxMUY+Z9 uE5c6k38mUJANWnggk8H5y/azrBe67aF3grBbhpJ46NxJMxfdpwjJuK+GpNoQKYUAtuI gSq0HF8NJtiNFViWBnfrDJwOdkHZrGf1ENcrJGsM6umpkyZn8Oo7V5EcYcrvZJY8CVt1 E/Lg== 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=m75O2982+PQQujsmqb8P0g73yWH7B3X1YjQuvuJ3s38=; b=s/eIzLbNRDXCQi1kOkLqKmHoDFiMMXjv6Lm6cyFOQx//V9/mrIj1xQ4MEZDAzgNFmw whVCCATy5kugLCgGJxhEbeLXtpzLgH2gvHwhhVVD9QD22JvZD/aQJzXXoiI2xZayQcLL uCwXpSLE7rvgADptcQJFJS/AunQ3KRtaxn5wtTPxH60rIZ3g4S7cffzj8E9LuPWewxjr owoSKxkcMa6ksTj8MNYnU0S50gs9QXsxvPPN/JL3T+De4XCjGChoUDcew5MVA+WBnv31 eUNutmGZjwTOWNtd9NtVdwj1HyLjA3YCJKrvOObVLnYAeJYzMi/JLSEASJNLPS2mEJJU 1Flg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P0EFlUaq; 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 yd22si2943626ejb.546.2020.09.29.05.23.08; Tue, 29 Sep 2020 05:23:48 -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=P0EFlUaq; 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 S1729803AbgI2MWy (ORCPT + 99 others); Tue, 29 Sep 2020 08:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729801AbgI2LfK (ORCPT ); Tue, 29 Sep 2020 07:35:10 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A3DCC0613D7 for ; Tue, 29 Sep 2020 04:25:57 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id o28so2386373qkm.23 for ; Tue, 29 Sep 2020 04:25:57 -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=m75O2982+PQQujsmqb8P0g73yWH7B3X1YjQuvuJ3s38=; b=P0EFlUaqz03Mx4ll/cRUbZKm0DPRGoRvKrTFutN8HNdiCtTIenEuESdO/ZTFjxPk9U vxeM3le0FTQL1YJQgMEEKP8dPph18/mQKGrYdKdJV4cA+vPrfrkVKdzvCpil94w/d4vg e2rMbo/SW80jIHb9Pw3J0btcxeW5ovaY1X9UkS0I9TNbMT/1Tv4kW65cBcuCIBKRm7ja gySFr6i0waDdV07DPFZmJjaRN2SM6Xio8FaTwqNTtIESERmytHtpu30HPz4wp9wcY+Ua tr+W/MKovNUE9PimMT+3XbyOCKXD2VfDpnBJrqgDl0EMYKQhKE7XlJVgbmGa8QP9Q9C1 0E0g== 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=m75O2982+PQQujsmqb8P0g73yWH7B3X1YjQuvuJ3s38=; b=iebhZKu9Wmeg3wVfVozon5BnJg/WQkgiHEbY4YXDVMV9XgyK+Vdbb65yvHFY2idtWT rB/EVIvDdb92QLxzpTQHwFUUtDyW2ECu4rgpzDGuvOmuh0WS2NeKijWWWh5jpQGNIrjN 8RT5vdMx7tXwoLKZqhgZnlWQx+sj5v66phpLp7zvak1Wb2weN1v/4qnuDAWRfrh46mz6 yoUp1/fAnxHjuRC1BE7Nzhbik1qlvp5zNR5eRUyEakaQEaqVGrW+OsAdyKGd9EL10D6x Lu01FhCeD3uqBnN5s8i0oYZblpnHdU3HgjuKRpt4VZkY8BVQaYUZ7H5WOs5vBx3HbqGi yRCQ== X-Gm-Message-State: AOAM532pfj0ONPvycgTdjIto2KxoBzyZBorPrDUreUsF8Tk2KgGjoxN2 GSwZO/riYfdicgVKU1VewCOD6rYLCAdohD4322CZWhqdsq3x4Sv21ooeWPxWMKRQ5MLxjPU3MFF kwQPWOIk3mPqeC0AElGYjg4lrgVhPEwLCM+XW9NMbwulmVPCNyKs5s9LgzuICl7t5b+Y7jjh+t9 e4WFEhooCCEnI= 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:ad4:55ce:: with SMTP id bt14mr4131043qvb.2.1601378756257; Tue, 29 Sep 2020 04:25:56 -0700 (PDT) Date: Tue, 29 Sep 2020 19:25:25 +0800 In-Reply-To: <20200929192508.v7.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20200929192508.v7.3.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20200929192508.v7.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH v7 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.org, alainm@chromium.org, mcchou@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 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.709.gb0816b6eb0-goog