From 9087baccab9fd25de7f383fb4a385fee95c6c3f1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 5 Jan 2015 17:46:52 -0800 Subject: [PATCH] tools: Handle the broken behavior of host features max page value --- tools/hciconfig.c | 3 +++ tools/hcitool.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 8ec1e8aa2..17c740b52 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -624,6 +624,9 @@ static void cmd_features(int ctl, int hdev, char *opt) exit(1); } + if (max_page < 1 && (features[6] & LMP_SIMPLE_PAIR)) + max_page = 1; + print_dev_hdr(&di); printf("\tFeatures%s: 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x " "0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x\n", diff --git a/tools/hcitool.c b/tools/hcitool.c index 648a0f7d6..0bd416fe7 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -967,6 +967,9 @@ static void cmd_info(int dev_id, int argc, char **argv) hci_read_remote_ext_features(dd, handle, 0, &max_page, features, 20000); + if (max_page < 1 && (features[6] & LMP_SIMPLE_PAIR)) + max_page = 1; + printf("\tFeatures%s: 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x " "0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x\n", (max_page > 0) ? " page 0" : "", -- 2.47.3