Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1108402pxx; Fri, 30 Oct 2020 02:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7CX3WzDHzxV6dq8uMXBoLXU2mohiZeHpekjjsEQHpz0QGAR0tqm9MQVvLe2rZ3ivvMrwn X-Received: by 2002:a17:906:400f:: with SMTP id v15mr1405355ejj.378.1604049044460; Fri, 30 Oct 2020 02:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604049044; cv=none; d=google.com; s=arc-20160816; b=zTmfnTwQWeF3RkOzg1f0baMK5pqjkzJlmc5v1KcljP69/FteYOepQH/P72+6Epyol8 rIH4PFaDxzWfz9+d+kffCT4urhtuLuCAZtddRtPS45qHDe4k284HWCAvF15YhE8flLWs 2IuOT2AovdYFiKKfGCyRVasBJ1OU4a8Rs0W2xfgH2OcqkrlfeCse/YiODmvnOgN6nub1 dLxCs3OV5gc/XczWc8CrG09a4VPbIuFSG7NNKSAh1GLdfW4s7P9phE70YUl/KLN9w/+d 7cCZmFgq0RPGz2MlbcysyJ7YXQFllNnG4IwXN2dDrNiKtVmY5PrSmfnMW2FVLEV2uFDf 3Kxg== 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=d0ULAdnRkpP0tiJ9/bir4TO+qpr79/0IK0rveQZPnt0=; b=uAhCVyb+jxepAg/xK9Vr9dF8O+UVp52sEvrwtzFrZ7vcQOgd5bCI8EFLG7ZHIXAeuu JzWxnbPYGRux1fDCG3eivbH6HFl9GWa+olI9kBXLWnVCqQ3WgIm78a83X0aADnHYkrFp Ky5l4jUGULcxPIuBMEDZ7VJo+Jg49ZJ5MyUJ7n/ooe3UyFtgowLfyMX9klw3rIIvVELX Ia5b8PDlthkVm8SKpwPMzxSyBPwgTfF3NQQ6FclaW18+C003A4Ni7XSo/9t4JhsM30V1 xpNDGvOLoGpw8+gD1uxa5rZl1UpD/RAe99nKBmJ/ytPwHW12tnWcz5qtvBRTGJX+Yf0V PjHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tyXPfxub; 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 j10si4326796ejs.577.2020.10.30.02.10.20; Fri, 30 Oct 2020 02:10:44 -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=tyXPfxub; 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 S1726226AbgJ3JIs (ORCPT + 99 others); Fri, 30 Oct 2020 05:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbgJ3JIq (ORCPT ); Fri, 30 Oct 2020 05:08:46 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4828EC0613D5 for ; Fri, 30 Oct 2020 02:08:46 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id j17so199066qvi.21 for ; Fri, 30 Oct 2020 02:08:46 -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=d0ULAdnRkpP0tiJ9/bir4TO+qpr79/0IK0rveQZPnt0=; b=tyXPfxubkKIRGg/KIZF9G5IRxo7TciRnhlKJPHOrHk1Cp9Y68QDQqneATMSHTq0gyi S+QCQc8RTvIudCaw2/UUbd7r/3AntfelNY9TVZr2IWTp5nfAE130BYPLMCmlj/vUV3IV Ki/fWMMBnv04KzC/R7VUXYzGtqrsnilkpUNgDLkA+UFnU9t9xL3EJI1TreQGaCDcevIL JvNahGyYMCegBP3W99HX8+mVWI405Ion/TuoGLVmULNK+5+ooCXCT4+QgimRdoD9oAcM MpdKi5uIDcxTqE4DAHQxc5us2j6Evxz42dS0bpzu8mwaMiY8zEeS3lYJKiYdpHo1ZCQs oDHQ== 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=d0ULAdnRkpP0tiJ9/bir4TO+qpr79/0IK0rveQZPnt0=; b=iKCnBEwFpvepE7bEyHxG25On3Zz633pu96tjITVQJ6EVQfAONCux64gpm/l+QAXtZF SiYIYU5H7AynFckrOqVVD5QmHbDs+Isa4G/J40jOa4kuw2128u2dxzpgEiP1/KAM5s0w 3MLIikg8AM9ceofaZXUb5reSj7vTJYlJ6uwHefkIgcFN1CGL5AWElNvMQI2Ls0m+SJSN v0w4GcCz5DsgsWHzzQUVxXNdw2ntn3FITgofXF5ZwXgFTJ3keqyNXOevczRRaz5V8Fbw Fw5cQO5yqNUv6dPlQa8w8JeNPLdgJS6YligfLgXzcWLlvfShOiIv/enM8ePlKZCIIBGu T88Q== X-Gm-Message-State: AOAM532Euyp8P16hyqiiBGwqzcUsYkNawIJzxHtqz+il4p+K6yDOm2KS brPSMmofjUolWvOFz0QilvberhpYt/EYoCNzjsi33fEdViYU8ja/B48V7Tw+krnWbJ2Q/8BOybl wDFwSBP2TEde5AVjJ63lhpHzoKYbd2VDjGYce/M5lclZ52yplZyNThWGGNh/wGSYtbh3fDdNL4L W20kAX/2q41q0= 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:db13:: with SMTP id d19mr7898374qvk.23.1604048925295; Fri, 30 Oct 2020 02:08:45 -0700 (PDT) Date: Fri, 30 Oct 2020 17:08:25 +0800 In-Reply-To: <20201030163529.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20201030163529.v6.3.I21e5741249e78c560ca377499ba06b56c7214985@changeid> Mime-Version: 1.0 References: <20201030163529.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v6 3/5] 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, mmandlik@chromium.orgi, mcchou@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-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 b615b981be9d6..396960ef54a13 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -3092,8 +3092,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.1.341.ge80a0c044ae-goog