Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3691314pxk; Tue, 29 Sep 2020 03:56:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYxAw4N8wmeiCZB67irlfZhn3ItXpWLgQ8tpFlqJ0z0d6OJ4+NqQf8FXcRpccc3ZvYKXvo X-Received: by 2002:a50:fd19:: with SMTP id i25mr2607024eds.142.1601377011525; Tue, 29 Sep 2020 03:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601377011; cv=none; d=google.com; s=arc-20160816; b=AsFEBaQH1o7+QpxqzZFnw6hyFA7e8Zt1gdwqhCHMy30icEpJiJfJZ8ob7vM6HJkeEv iomFMvjsgZXrPJuxIdPB2k6cZK+UC5eMqvM3OyJPQL75ihxBPk7zmzs1B0eZwx+4uHX8 DuVlZX0kL/HRtJMyTmATFhm0ynzL7jTP0JkSEoJYym/56EQzvnwdLPYvvin3xT/6iUje Vf4mwKzRUw/2CmFgbjZZl2jQjJtlXZAxxO1emm1vB66YnjFShKvDu7RBZLfOwMFNo2eH +wWxC/eVie7yWB4QeFfE7cN9QQIzO00Dj2zmdqzF9P2BY1RKg+Jz8KzQQCYA+tKhZzae GG7A== 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=+EMiw7AaqKMTc7moeMEEbaeFth4p8VcNu3tluYaRH/E=; b=wYUU7SBGUPr5wEiyikDZxbXx/+cgfWfjBuL4VaufPoHl+8uIITidjipD3lS16FIMeV aOjpVBT+neLef2T4r7uLl8VHbjbjnfUZTDMG72f0TiB9QH7n+vYM4fp8FJDh5FvgnSnm xCO4u0fgerXDjtj/yH2Hkqsn7FhW5yWHAfctWdT23Wsap0jYeY9ivYxcE/x71qvkETS6 lfUPgUZCCE8JwUY7ERA/pB6j1fRjVhBbPNFqlXPgYNE0f55hAxtrlPaWFBj+tdC8z7Ps ohQmnroxhRVz8kmRK9fu/nzSylvf6h+vQgSqQBNR7AJBVOcHibI8vEojCcXDXUnc7DPl g+6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cinaYxH3; 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 d21si2602635edn.173.2020.09.29.03.56.12; Tue, 29 Sep 2020 03:56:51 -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=cinaYxH3; 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 S1725497AbgI2K4L (ORCPT + 99 others); Tue, 29 Sep 2020 06:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgI2K4L (ORCPT ); Tue, 29 Sep 2020 06:56:11 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBA8C061755 for ; Tue, 29 Sep 2020 03:56:10 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 140so4422051ybf.2 for ; Tue, 29 Sep 2020 03:56:10 -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=+EMiw7AaqKMTc7moeMEEbaeFth4p8VcNu3tluYaRH/E=; b=cinaYxH3W1pTZymurBfk1cJTsO+Me+skJdMlZSAKxagEhxPA0GY+KgMy2PNeKu5oKp MTRRk6jefJAoO0mFBIj8IPnunsiex5a5ovz5UasqIfbgYWk3mmtYxsjryDmJC6A4UgTQ gKU/p2Cym1tO+1Spa3Exmd3idGA1l8Dft+8OKTzGRm1gwfl+aIufS7GbcusXu09FilJk 1/W6MY/tXAabCvyQ+nN4kOD0ReZXHA9i89si/87hXmekkzgGvKzDGTktv2Y8oLMIwUgJ AFaRNGLjI/yfb7H1OKEqQUQwzeMSdhwm15Q0xwvrpijSZLD7bgCaaoeKPcWIyMtKtgwM ppLg== 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=+EMiw7AaqKMTc7moeMEEbaeFth4p8VcNu3tluYaRH/E=; b=FbZbBAa4cT/ibM9l+6VQYBkg5cdWDekuJlYuMTtec1Gcsc39yHaCMKUQ1wTpufG93s XW4yGddMKIcdgLOC5Ll88gbMODih/J8gFP6VCCIcr9RG6jr5+bt0lrKG3sK1Q1V7CW9r 5UKFyaOquxToHFuCDeohs/d1HnBZ6jCYRjylKmG2D6xIk02bRGlNM25P3Z91WRFC5EVG f65wV9FA9DjtDP6gheTqNDte0C1Njj+Q+glG54zSoUKaYOG6pYR56UmaEcsrm2gZpQeO riwCU7FVTeh664zYw2GVMIgDpKew2/Kxft/vpTdWS3VtxJHsfDfCskDfa4A1AfnUw3q2 9esw== X-Gm-Message-State: AOAM530AY8nQGvpo3biY0cnxpFbqybR+ImV37mxaX0Y93qnbLhrAWJS8 QnOE3MNfdysBDudG3/uBLT6O+Nbu884u8y3OMr9XLKxTSSQS865AT/HICUTv/ltJOZ6OKw/6cX4 U1EhWBlquvFOQuCBTW5Qy4rlt/Lvo/48SGsN6l3gLRJCy+AwI4p7Kf/NF9y6bFNlHxtgzoMt7Ua V5kgqTUcxwU0Y= 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:a25:3b14:: with SMTP id i20mr4651510yba.351.1601376970005; Tue, 29 Sep 2020 03:56:10 -0700 (PDT) Date: Tue, 29 Sep 2020 18:56:02 +0800 Message-Id: <20200929185522.BlueZ.v5.1.I1f083629d41c747a33a3937fbc199ea37dccde12@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [BlueZ PATCH v5 1/3] core: Add params to set interleaving durations From: Howard Chung To: linux-bluetooth@vger.kernel.org Cc: mmandlik@chromium.org, luiz.dentz@gmail.com, alainm@chromium.org, mcchou@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 v5: - Fix compile warning Changes in v4: - Change type of EnableAdvMonInterleaveScan default to u8 - Add a patch for doc/mgmt-api.txt 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 c0053000ac19..f072541aad35 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -4418,6 +4418,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 95d4b9665193..713eab8e03ae 100644 --- a/src/hcid.h +++ b/src/hcid.h @@ -80,6 +80,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 77be776686a8..38f193a093df 100644 --- a/src/main.c +++ b/src/main.c @@ -110,6 +110,8 @@ static const char *controller_options[] = { "LEConnectionLatency", "LEConnectionSupervisionTimeout", "LEAutoconnecttimeout", + "AdvMonAllowlistScanDuration", + "AdvMonNoFilterScanDuration", NULL }; @@ -421,6 +423,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.709.gb0816b6eb0-goog