* [BlueZ PATCH v2 1/2] core: Add params to set interleaving durations
@ 2020-09-18 4:14 Howard Chung
2020-09-18 4:14 ` [BlueZ PATCH v2 2/2] core: Add param to disable interleave scan Howard Chung
0 siblings, 1 reply; 3+ messages in thread
From: Howard Chung @ 2020-09-18 4:14 UTC (permalink / raw)
To: linux-bluetooth; +Cc: mmandlik, mcchou, alainm, luiz.dentz, Howard Chung
This patch adds parameters to control the durations of allowlist scan
and no-filter scan when the kernel is doing interleaving scan.
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [BlueZ PATCH v2 2/2] core: Add param to disable interleave scan
2020-09-18 4:14 [BlueZ PATCH v2 1/2] core: Add params to set interleaving durations Howard Chung
@ 2020-09-18 4:14 ` Howard Chung
2020-09-18 17:27 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 3+ messages in thread
From: Howard Chung @ 2020-09-18 4:14 UTC (permalink / raw)
To: linux-bluetooth; +Cc: mmandlik, mcchou, alainm, luiz.dentz, Howard Chung
This patch adds parameter to enable/disable the interleave scan feature.
---
(no changes since v1)
src/adapter.c | 9 +++++++++
src/hcid.h | 1 +
src/main.c | 6 ++++++
src/main.conf | 6 ++++++
4 files changed, 22 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index c0e95b48a1c4..a2c782e308bb 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4449,6 +4449,15 @@ static void load_default_system_params(struct btd_adapter *adapter)
len += sizeof(params[i].u16);
}
+ if (main_opts.default_params.enable_advmon_interleave_scan != 0xFFFF) {
+ params[i].entry.type = 0x001f;
+ params[i].entry.length = sizeof(params[i].u16);
+ params[i].u16 =
+ main_opts.default_params.enable_advmon_interleave_scan;
+ ++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 c3e5fe803543..c6717be62c48 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -96,6 +96,7 @@ struct main_opts {
uint16_t advmon_allowlist_scan_duration;
uint16_t advmon_no_filter_scan_duration;
+ uint16_t enable_advmon_interleave_scan;
} default_params;
diff --git a/src/main.c b/src/main.c
index e222ed3bf855..3433130bc419 100644
--- a/src/main.c
+++ b/src/main.c
@@ -125,6 +125,7 @@ static const char *controller_options[] = {
"LEAutoconnecttimeout",
"AdvMonAllowlistScanDuration",
"AdvMonNoFilterScanDuration",
+ "EnableAdvMonInterleaveScan",
NULL
};
@@ -444,6 +445,10 @@ static void parse_controller_config(GKeyFile *config)
&main_opts.default_params.advmon_no_filter_scan_duration,
1,
10000},
+ { "EnableAdvMonInterleaveScan",
+ &main_opts.default_params.enable_advmon_interleave_scan,
+ 0,
+ 1},
};
uint16_t i;
@@ -711,6 +716,7 @@ static void init_defaults(void)
main_opts.default_params.num_entries = 0;
main_opts.default_params.br_page_scan_type = 0xFFFF;
main_opts.default_params.br_scan_type = 0xFFFF;
+ main_opts.default_params.enable_advmon_interleave_scan = 0xFFFF;
if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
return;
diff --git a/src/main.conf b/src/main.conf
index 3b341f44c9cf..c300a3b81086 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -159,6 +159,12 @@
# Default: 500
#AdvMonNoFilterScanDuration=
+# Enable/Disable Advertisement Monitor interleave scan for power saving.
+# 0: disable
+# 1: enable
+# Defaults to 1
+#EnableAdvMonInterleaveScan=
+
[GATT]
# GATT attribute cache.
# Possible values:
--
2.28.0.681.g6f77f65b4e-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [BlueZ PATCH v2 2/2] core: Add param to disable interleave scan
2020-09-18 4:14 ` [BlueZ PATCH v2 2/2] core: Add param to disable interleave scan Howard Chung
@ 2020-09-18 17:27 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2020-09-18 17:27 UTC (permalink / raw)
To: Howard Chung
Cc: linux-bluetooth, Manish Mandlik, Miao-chen Chou, Alain Michaud
Hi Howard,
On Thu, Sep 17, 2020 at 9:14 PM Howard Chung <howardchung@google.com> wrote:
>
> This patch adds parameter to enable/disable the interleave scan feature.
> ---
>
> (no changes since v1)
>
> src/adapter.c | 9 +++++++++
> src/hcid.h | 1 +
> src/main.c | 6 ++++++
> src/main.conf | 6 ++++++
> 4 files changed, 22 insertions(+)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index c0e95b48a1c4..a2c782e308bb 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -4449,6 +4449,15 @@ static void load_default_system_params(struct btd_adapter *adapter)
> len += sizeof(params[i].u16);
> }
>
> + if (main_opts.default_params.enable_advmon_interleave_scan != 0xFFFF) {
> + params[i].entry.type = 0x001f;
> + params[i].entry.length = sizeof(params[i].u16);
> + params[i].u16 =
> + main_opts.default_params.enable_advmon_interleave_scan;
> + ++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 c3e5fe803543..c6717be62c48 100644
> --- a/src/hcid.h
> +++ b/src/hcid.h
> @@ -96,6 +96,7 @@ struct main_opts {
>
> uint16_t advmon_allowlist_scan_duration;
> uint16_t advmon_no_filter_scan_duration;
> + uint16_t enable_advmon_interleave_scan;
> } default_params;
>
>
> diff --git a/src/main.c b/src/main.c
> index e222ed3bf855..3433130bc419 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -125,6 +125,7 @@ static const char *controller_options[] = {
> "LEAutoconnecttimeout",
> "AdvMonAllowlistScanDuration",
> "AdvMonNoFilterScanDuration",
> + "EnableAdvMonInterleaveScan",
> NULL
> };
>
> @@ -444,6 +445,10 @@ static void parse_controller_config(GKeyFile *config)
> &main_opts.default_params.advmon_no_filter_scan_duration,
> 1,
> 10000},
> + { "EnableAdvMonInterleaveScan",
> + &main_opts.default_params.enable_advmon_interleave_scan,
> + 0,
> + 1},
> };
> uint16_t i;
>
> @@ -711,6 +716,7 @@ static void init_defaults(void)
> main_opts.default_params.num_entries = 0;
> main_opts.default_params.br_page_scan_type = 0xFFFF;
> main_opts.default_params.br_scan_type = 0xFFFF;
> + main_opts.default_params.enable_advmon_interleave_scan = 0xFFFF;
>
> if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
> return;
> diff --git a/src/main.conf b/src/main.conf
> index 3b341f44c9cf..c300a3b81086 100644
> --- a/src/main.conf
> +++ b/src/main.conf
> @@ -159,6 +159,12 @@
> # Default: 500
> #AdvMonNoFilterScanDuration=
>
> +# Enable/Disable Advertisement Monitor interleave scan for power saving.
> +# 0: disable
> +# 1: enable
> +# Defaults to 1
> +#EnableAdvMonInterleaveScan=
This should probably ve defaulting to false until we consider the
interface stable and document how this feature works.
> [GATT]
> # GATT attribute cache.
> # Possible values:
> --
> 2.28.0.681.g6f77f65b4e-goog
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-18 17:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 4:14 [BlueZ PATCH v2 1/2] core: Add params to set interleaving durations Howard Chung
2020-09-18 4:14 ` [BlueZ PATCH v2 2/2] core: Add param to disable interleave scan Howard Chung
2020-09-18 17:27 ` Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.