Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2868661pxk; Sun, 20 Sep 2020 21:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3msianuxTyxzHb7Q6aQO3ztXMq7Z4S98FaNcfragSbeZ3YTVNnQ8QNhEjY8eBkbVbZlDS X-Received: by 2002:aa7:da10:: with SMTP id r16mr51861249eds.333.1600662571107; Sun, 20 Sep 2020 21:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600662571; cv=none; d=google.com; s=arc-20160816; b=PKXVefhBqmjGoPRe4DOBRJVtqjtPjo5UNgVRld6aK2lT5j7k0TrXgL+mRSPx+Qxq/v IJF+SyVmzrADLja6t+ImkY17cLVRMqZRhoa5/YBMCFiQUG230NatFREINuIcHHh1id+9 k7xS2U30C1xoXKeNlmr3rtNjZsd4L8aVvXZcKGU70evTosE35FQZY2gEmvNsXq0b4SSN g+Ro5Zkfz3R8V0yGORGSxoQ/Ziq6VjHsXBQvidkg2ImmK88mFoFHEt3wrhVNRO4JjPoP XlmmV8SWGgf3h51SncwPBUSuhcB1LLzDUzH2xEc3I2tC/wxpttyHZ75eGxXYsrrf6FJB a65w== 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:mime-version:message-id:date :sender:dkim-signature; bh=fC9C6NlE7ABAb/uqOE5M5b3A+T5ojcafIgUq12Ln5lA=; b=pScsgngNkHMzLPUkl3HRsXggh8CS5sj2tYpZHczl913o91wlr7KZd/HotmHEZoafU7 AJtP1VIUmCBeOfiqKEtchKWU99hKA/onKuEEvKTsVNCEX5P+cieKJV4CZLJGvUIuCoA1 tEtIoEP7PgH1qJ1zq21CISb+CdCttZ9O12TkHCD51gnS/7w4J9OFAPoD3zPL4Pw3JZh+ CuhmuCx4ewyLLk8CIS3CZLYDbDTkrnb92XLSyM7Lo+btmrHhyERMbLbwIPJrCFFBVhl6 KB9xD5IL/lQ3T13AFBELZnszHfIZwKKcHhL6q/xemzXn2xcGrxgOejUSKr2PwP4qGOSs pdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qhDWnzfO; 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 r28si7602650edi.80.2020.09.20.21.29.06; Sun, 20 Sep 2020 21:29:31 -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=qhDWnzfO; 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 S1726338AbgIUE2d (ORCPT + 99 others); Mon, 21 Sep 2020 00:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbgIUE2d (ORCPT ); Mon, 21 Sep 2020 00:28:33 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B2C1C061755 for ; Sun, 20 Sep 2020 21:28:33 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id a16so12025651qtj.7 for ; Sun, 20 Sep 2020 21:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=fC9C6NlE7ABAb/uqOE5M5b3A+T5ojcafIgUq12Ln5lA=; b=qhDWnzfOcDtYQw+no0IcMQyNUUEor4MAOuTA/mq2GZggIG38AXuHtVXDB+ZnCou2Hd I+Ahu+HI66UYI0SB16kXe67Ig9fErqxxCUWdZ2WXszokxrwEHhQbh/2uidptAgYCMY1y XaGxZwz0LU19Co3ScHClqkUSR5b/lhf8v7bcDbUkMrCh2VzPwIWUsId+W3wQDh+okEIp V6um9u4ooNsloi/eBYRqpekX+CieQr3ENgJAUwqq30b0fw2JSEM71APtL8L/i4Mzp+Z2 x5qlMnW0xOcosnnajUMp+Z4Bnk7MK4NXM41HGp44JAgcxYW6iA2b8l3k3a54dBIRtJgy aqYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=fC9C6NlE7ABAb/uqOE5M5b3A+T5ojcafIgUq12Ln5lA=; b=kTTS0z7IyMdJ8oNg70nGK0UIfUIrGSEtmjfCg+YmMI1i89a5F5AWkKkVCQRgqiGzM2 03zMdGloi5MbqfYGkKRPf77dajYsfyAraq/CclNARJpAKvA29qKc3pMMGlyu/7qHToUk OZZHkhueOHWgLPTcdL3Y9TcVHXEFoTgS1+f8ejUGVrNY5zv3cWXxIWortQuy+uH8lxwg TtSFJKFRYuHSfV/JkribIeAxiUUEzz6jYQH7Fu1NQdttx9F62mHxUcxopiggcFva3ntF 7ELal9JnmbABpgeRGrBQcZUei/dNBgvmIE9UkcCTUX7C/rFehHcCFjZheKq68ILoOp0O yzCw== X-Gm-Message-State: AOAM530mlDNZXcJ9t7Cm7EUGpu1/t1mIZqQmA9SqXQlry5jMWNjcIEaN 447Y0AYuoOyvoJHryXaJZJ/W8+De6W2th3S6El5G4/CWaSm4tOOg1DODXpmXlxpkV8bdu4FHWWy i4Y5YmVs+CLp818glYerchStXntpTUNmf65ZjIQNgOHJQEY/Iposa+jEpv7+ah/Z5XciE9V+8WR GqEf+6YS4qimo= 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:43e5:: with SMTP id f5mr44353106qvu.12.1600662511449; Sun, 20 Sep 2020 21:28:31 -0700 (PDT) Date: Mon, 21 Sep 2020 12:28:23 +0800 Message-Id: <20200921042824.1265006-1-howardchung@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [BlueZ PATCH v3 1/2] core: Add params to set interleaving durations From: Howard Chung To: linux-bluetooth@vger.kernel.org Cc: mcchou@chromium.org, mmandlik@chromium.org, luiz.dentz@gmail.com, alainm@chromium.org, Howard Chung Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds parameters to control the durations of allowlist scan and no-filter scan when the kernel is doing interleaving scan. --- Changes in v3: - Set EnableAdvMonInterleaveScan default to Disable Changes in v2: - Fix typo in the commit title src/adapter.c | 18 ++++++++++++++++++ src/hcid.h | 3 +++ src/main.c | 10 ++++++++++ src/main.conf | 7 +++++++ 4 files changed, 38 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index b2bd8b3f1d01..c0e95b48a1c4 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -4431,6 +4431,24 @@ static void load_default_system_params(struct btd_adapter *adapter) len += sizeof(params[i].u16); } + if (main_opts.default_params.advmon_allowlist_scan_duration) { + params[i].entry.type = 0x001d; + params[i].entry.length = sizeof(params[i].u16); + params[i].u16 = + main_opts.default_params.advmon_allowlist_scan_duration; + ++i; + len += sizeof(params[i].u16); + } + + if (main_opts.default_params.advmon_no_filter_scan_duration) { + params[i].entry.type = 0x001e; + params[i].entry.length = sizeof(params[i].u16); + params[i].u16 = + main_opts.default_params.advmon_no_filter_scan_duration; + ++i; + len += sizeof(params[i].u16); + } + err = mgmt_send(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG, adapter->dev_id, len, params, NULL, NULL, NULL); if (!err) diff --git a/src/hcid.h b/src/hcid.h index 3624ba6ea163..c3e5fe803543 100644 --- a/src/hcid.h +++ b/src/hcid.h @@ -93,6 +93,9 @@ struct main_opts { uint16_t le_conn_latency; uint16_t le_conn_lsto; uint16_t le_autoconnect_timeout; + + uint16_t advmon_allowlist_scan_duration; + uint16_t advmon_no_filter_scan_duration; } default_params; diff --git a/src/main.c b/src/main.c index 038f867b5a6d..e222ed3bf855 100644 --- a/src/main.c +++ b/src/main.c @@ -123,6 +123,8 @@ static const char *controller_options[] = { "LEConnectionLatency", "LEConnectionSupervisionTimeout", "LEAutoconnecttimeout", + "AdvMonAllowlistScanDuration", + "AdvMonNoFilterScanDuration", NULL }; @@ -434,6 +436,14 @@ static void parse_controller_config(GKeyFile *config) &main_opts.default_params.le_autoconnect_timeout, 0x0001, 0x4000}, + { "AdvMonAllowlistScanDuration", + &main_opts.default_params.advmon_allowlist_scan_duration, + 1, + 10000}, + { "AdvMonNoFilterScanDuration", + &main_opts.default_params.advmon_no_filter_scan_duration, + 1, + 10000}, }; uint16_t i; diff --git a/src/main.conf b/src/main.conf index 8d85702d4316..3b341f44c9cf 100644 --- a/src/main.conf +++ b/src/main.conf @@ -152,6 +152,13 @@ #LEConnectionSupervisionTimeout= #LEAutoconnecttimeout= +# Scan duration during interleaving scan. Only used when scanning for ADV +# monitors. The units are msec. +# Default: 300 +#AdvMonAllowlistScanDuration= +# Default: 500 +#AdvMonNoFilterScanDuration= + [GATT] # GATT attribute cache. # Possible values: -- 2.28.0.681.g6f77f65b4e-goog