Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2831146pxk; Mon, 28 Sep 2020 00:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZa5Kac3EfhizP2t6uuYiqdULForNIxunOA4OosRgTRufcRCFYplu6qfeQSAxogX8uLu/q X-Received: by 2002:a05:6402:7d2:: with SMTP id u18mr322609edy.69.1601278958526; Mon, 28 Sep 2020 00:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601278958; cv=none; d=google.com; s=arc-20160816; b=Yn/RqlPH1rbmebEJK+5oRWFhbeYXfnyYstdmtWAmc71AUXimfAOI3zPsAEz6fwsaZF AR+nEky2GVNghku4+wEi1TZ87GKGfy114e5B8Gf2LZCAlSOn6V5VSM/QEcdl2y32rSMu 32fEd2Xeq88bkzUrenfaxX5qxixmFxvaLjBOkfoKGJSOpfC8a78FCyGMMaUMGm8s7IwK 1CsUnJoNTag47RTmWzghqP97OAMDo4xsILCq2YSRrJDm1JrVtdFOND/SeT7I/k+Vxad/ 2/rjyND/+OQKzPWcw4LFimN64pM9V2HrOMm2L77z5VV0UWsVCYsDzTI2mQm0iIBVHFu+ l77g== 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=LnYyc18RpyZXfH3eYCX5VYCtOkU29PcLyQoSCYNoJww9MUPMyjINUR33hTO+pqh/gK S6payWnKrGex8pI+haZkkM6GoeeixXnSbB2UnuZoIaHmjDh4AinYD0y/vkDW2jm6D6V1 CenUVqqx36tDrgsN5HyjoE+SiYw8ib3QP9a09AJxRV+MKet3xLOBfR8AwxfCO0hJ4bOY gsnZo6oY9yfqOdxetAgk5njMjNEU4HuUohZ+9Y7UpainHN5sFjXCU+CQO42CV9jH0UbT 0GwOXXVDhGSYr6yiWKtLBbLLogT+4SWWgJt7/zZvbhFf6d4JCQHKR6Vy9VRwV0i+AAly 1M5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AJ6VRbDP; 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 rh6si108567ejb.709.2020.09.28.00.42.14; Mon, 28 Sep 2020 00:42:38 -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=AJ6VRbDP; 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 S1726693AbgI1Hlg (ORCPT + 99 others); Mon, 28 Sep 2020 03:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbgI1Hlf (ORCPT ); Mon, 28 Sep 2020 03:41:35 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82EBAC0613D5 for ; Mon, 28 Sep 2020 00:41:35 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id w3so78261qtn.16 for ; Mon, 28 Sep 2020 00:41:35 -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=AJ6VRbDPC7e8smY4eGXu9zYa/IX0MLfCd6bcLc93w842F9ZclCRQhVODpSB3qxUaXS 3q5zTjxBUavZMzrU21HiiY1Rnqxls24W+X2mg2OEZlSLv8jpaUBB6hz/U7bi5xoBMFTb vBfBQB97GAT4qoBrwgPsBFBG5WuuxbRrNX746+CZKMXZogMgWWU5FJlV48QFlfQLAvHm vBiC0/c6vDW4ATubViknB0rQzgL9JHhk2FQgBKCNcwapfHzfnHG4yFGzV9R1rBKgSbXi F6mOKdaNYV+pWJXtQdfADTJXN4eJI1vHC3IlDk4UgXCvP6HN2aB7mWcXfWVejiT7xF1y GbpQ== 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=fqECim6oYyMxy/aIn+/QKHsZTyshhO+0E2ngqh3iTf9nbcHuaPTaYoHzKEQs1m11J0 mxkdUuqMtNYDHqZVtg0DAzTksPmgQKN03bQVP4d682JVju13h+SgDIdIv/Mdp/nFfZeJ D++Fzi2juHUlbmYSdfh9VCf6v8iLi+yLbCEF9wz4WE8aDQ8Gar6CSW+j27zQZumMI7PS j4w7z1bRTMW7ybAZPEg07ERRmeBAVczApd5qUZZqWutkG9CnapEDxPquFEdLw7145epN DSOtJInrvGv1K8uIV0ietiDXA3OSDtXpwQ2AtDgIrk+TFbSm1BQ5y9emaYoAvTmkBFtj h/mA== X-Gm-Message-State: AOAM532TyfOaNg5MMU6XlZiI0yKKK+QLcPCvL9y9iE2BxT5u2F/nyH86 xRHcZfqZ0S8gZnWMoQt5bszOSe9UoE9ESvM6CRN4aafED+x3jq45HT1vhkYAXx2sylVCw/vivsM S7ugFBetDjMY7ukLuLenYDKfNfTf6MwJlFb63dg5zT7h0yz0gG5/zuv3IxlHbEnzPTsbYZ/I2Od 5+BIrUjpAX7C4= 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:a0c:b343:: with SMTP id a3mr10507577qvf.41.1601278894603; Mon, 28 Sep 2020 00:41:34 -0700 (PDT) Date: Mon, 28 Sep 2020 15:41:20 +0800 In-Reply-To: <20200928154107.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20200928154107.v6.3.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20200928154107.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v6 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 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