Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1269353ybl; Fri, 23 Aug 2019 16:35:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNEE3PZ/zNyRq2QGT4hrzBajJBJAHLPoqVIBRkDlxwjpnOWUjm+zkL/eeBjx1yNFKjafqi X-Received: by 2002:a65:4546:: with SMTP id x6mr6002346pgr.266.1566603345595; Fri, 23 Aug 2019 16:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603345; cv=none; d=google.com; s=arc-20160816; b=xExEht6C3nDQH8imSuY6MPlnz6apill0zvpgbl57YXgnsOkP7m7T+B7gdng62zHfRT P/IFZtFlfswsh98UIUTqVBmYwHQ+Hp8XAoFkL2EpV+X82txCy68ESzpgaVpqVIjg+2TT f7Xcnq3qI3zPwBbVQa1YjxfzVV3WwRSRY9DcqurazxqcXvRthGXYao0EKPMTgFhTg729 hBJVL+mBW4oWjifDUZcmSKlXiskJXunxpGg0x2YcbwRWJBw+T2M85xCK8r4omyqBDgDK LCVEDupU1jHTVQKTDF8OYi6Yek7OOJq4bOjFQr2jk2iMekhJVdxxCWUukUYchyYEEHjC Upog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature; bh=JusjIKfneT/PNqU+0Q/IZqEmKuoVKkvstBuxtJXwDZc=; b=fKDznio/T5cRNRIx0dzmrrRETel0YAh1NBS7OY9Uky69ko23z38cxKahVQnn1DnYqL 7ksRTPR1DWLZ9m5a7IPbyzOGwPrwCIpHiNrUpfB+GXyrzhGQ+lsTWFVaMS1bxsXeIO3g VDFP8uQiVc4oGpJ+vwvl8SZzVPQAcGyK847GVrZPh02pwd/t3sWQ0KuNbX3mRQYjkA1r gXLp+NbBiUFUIBzdI8E0bR4MFRFJyy6txKY7XrAIPXSZ9aZmXgl89+Oh6mAnTZkXCJ+n Aic1lQlolDjz4C44708RSlb+6ZQ8urIvNLCKaW3uefb13YquGbLtn0MMvXVa5MnxRdYt 5UiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mAjryWWp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w190si3128296pgd.229.2019.08.23.16.35.25; Fri, 23 Aug 2019 16:35:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mAjryWWp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbfHWRu2 (ORCPT + 99 others); Fri, 23 Aug 2019 13:50:28 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34161 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbfHWRu1 (ORCPT ); Fri, 23 Aug 2019 13:50:27 -0400 Received: by mail-io1-f68.google.com with SMTP id s21so22061697ioa.1 for ; Fri, 23 Aug 2019 10:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=JusjIKfneT/PNqU+0Q/IZqEmKuoVKkvstBuxtJXwDZc=; b=mAjryWWp9gEIxFroP4Uo8OF62F76ngVsgd2wwiwc1Y7eYOLkwv+TVYTLW2uewNZma1 aH0wZ7XNjtnRMPpMjIvLYIXI/hyiXN81Cuikz6kGcxZIAMEceKMbp1T77BzXTmcUgxUK GsTwynB8l8KjBufnLv+/UMNU0IkqpAwJ8Hgy7w0pIisPYH4iku6JuUi/WS/5cXi9SzHx vSjng4zuo3nlzaAKh/7pTgMRJx/BADx36oWDsuJW+O8hXNr2ZeR7/e0Bmr7LTm/UpMUL Ln8OdIq2AAYmGskFkK2pveHOJRZcb6G7vu7wMvM4JYFK5sMjcv1vjKd7VXTOhys1Lbdx HrYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=JusjIKfneT/PNqU+0Q/IZqEmKuoVKkvstBuxtJXwDZc=; b=rQpVUmeHwjjHIGsjDkHI8w3jYXY++pi0DVSQ7NyNXQZhwnWtsJcYU3V6/2Pex92tnc prR5UEEP6CZr/BWUYeUlSDWUzXM8oRLD1dYvT7LYQgO1OEzULHhdB/p3a+OPxsJGR9hr n4OdeB3UQoSUQUNEvr2zYTWbcpqWWjLIY8nJ5gmSsal4bx1k5ydp/MLy16YHU7krMXjG +nyz0AT5tuJpkW94b4MrLOJZ9iGWaUjBg4chK8jV5b7jfozJG9fAqcWILPKEQfCADpoe xqjojTHb8FYXWz+onX1mVorodDOv4+OOVJqSzBy0/3lk2M1/NO+eiCMlMlB9ouhFVD5A w1QA== X-Gm-Message-State: APjAAAVwDBpHuqnKLp98eOQPRxTGIvB8KzgFWXssdFCBgBN84JRh0xJe h9E1URe4HwY1gk9fz4A/PZBShidV X-Received: by 2002:a5e:c311:: with SMTP id a17mr576684iok.140.1566582626631; Fri, 23 Aug 2019 10:50:26 -0700 (PDT) Received: from [10.1.1.187] ([8.39.228.178]) by smtp.gmail.com with ESMTPSA id y25sm5603438iol.59.2019.08.23.10.50.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2019 10:50:25 -0700 (PDT) Reply-To: Carey Sonsino Subject: Re: [PATCH 1/1] bluetooth: update default BLE connection interval bounds To: Andreas Kemnade Cc: Marcel Holtmann , Johan Hedberg , Jamie Mccrae , "linux-bluetooth@vger.kernel.org" References: <1c707bb9-999b-7ca3-3c91-7b183dacfdd5@gmail.com> <20190823154559.1f203fac@aktux> From: Carey Sonsino Message-ID: Date: Fri, 23 Aug 2019 11:50:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190823154559.1f203fac@aktux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Well that is certainly a problem. According to the bluetooth core spec (5.1), section 4.5.2 Supervision timeout:     The connSupervisionTimeout shall be a multiple of 10 ms in the range of 100 ms to 32.0 s and it shall be larger than (1 + connSlaveLatency ) * connInterval * 2. So in theory that value should be able to go up to 3200 (ms * the 10ms multiple = 32000ms).  I see that le_supv_timeout is set to 0x2a (42 *10ms = 420ms) so that explains the value in the error you're seeing, but I'm not sure what effect it would have to set the value to 0xc80 (3200) -- kind of seems like a bad idea.  I haven't played around with the supervision timeout, and I'm not sure if le_supv_timeout/supervision_timeout specifies the exact value to use or if it's a maximum and the actual value is calculated based upon the negotiated connection interval and slave latency as shown above. Will have to look into that and the other issues with the patch (commit message length & tabs). Carey On 8/23/19 7:45 AM, Andreas Kemnade wrote: > Hi, > > On Tue, 20 Aug 2019 11:01:41 -0600 > Carey Sonsino wrote: > >> Update the default BLE connection interval min/max bounds to the full >> range of permitted values (6-3200, corresponding to 7.25-4000ms). >> >> Commit c49a8682fc5d298d44e8d911f4fa14690ea9485e introduced a bounds >> check on connection interval update requests, but the default min/max >> values were left at 24-40 (30-50ms) which caused problems for devices >> that want to negotiate connection intervals outside of those bounds. >> >> Setting the default min/max connection interval to the full allowable >> range in the bluetooth specification restores the default Linux behavior >> of allowing remote devices to negotiate their desired connection >> interval, while still permitting the system administrator to later >> narrow the range. >> >> Fixes c49a8682fc5d: (validate BLE connection interval updates) >> > Trying pair XX:XX:XX:XX:XX:XX in bluetoothctl > leads to create connection commands containing > le_conn_max_interval > le_supv_timeout (4000ms > 420ms) which the > controller does not like and is imho not allowed. > > < HCI Command: LE Create Connection (0x08|0x000d) plen 25 > bdaddr XX:XX:XX:XX:XX:XX type 0 > interval 96 window 96 initiator_filter 0 > own_bdaddr_type 0 min_interval 6 max_interval 3200 > latency 0 supervision_to 42 min_ce 0 max_ce 0 >> HCI Event: Command Status (0x0f) plen 4 > LE Create Connection (0x08|0x000d) status 0x12 ncmd 1 > Error: Invalid HCI Command Parameters > > >> Signed-off-by: Carey Sonsino >> >> --- >> >> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c >> index 04bc79359a17..f4f2f712c527 100644 >> --- a/net/bluetooth/hci_core.c >> +++ b/net/bluetooth/hci_core.c >> @@ -3181,8 +3181,8 @@ struct hci_dev *hci_alloc_dev(void) >>      hdev->le_adv_max_interval = 0x0800; >>      hdev->le_scan_interval = 0x0060; >>      hdev->le_scan_window = 0x0030; >> -    hdev->le_conn_min_interval = 0x0018; >> -    hdev->le_conn_max_interval = 0x0028; >> +    hdev->le_conn_min_interval = 0x0006; >> +    hdev->le_conn_max_interval = 0x0c80; >>      hdev->le_conn_latency = 0x0000; >>      hdev->le_supv_timeout = 0x002a; >>      hdev->le_def_tx_len = 0x001b; > hmm, what happened with the tabs here? I needed to manually apply it. > > Regards, > Andreas >