Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4369790ybi; Sat, 6 Jul 2019 03:43:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6PnY7FiTZuK5nvxgG3fAWn2E953JuGP3Tdi1tJtEkmqyjodjVCsnomsI6z1PTrphkjR24 X-Received: by 2002:a17:902:7612:: with SMTP id k18mr3208875pll.48.1562409796670; Sat, 06 Jul 2019 03:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562409796; cv=none; d=google.com; s=arc-20160816; b=Him+eUO+2GXZ79wBT8MoaMoDL4oyPOUTfEp8m67XQx7wzesBDj0cncv1NCv+8Lg9Sw AowUZZgMMQEdqal6iqDZJbqc5M9qkvN/INcVn6nvFBRNP1Ob6ccQORt9LgGbzdKzLgyl tKvR9B8bA0uF9f7W1z7uZLTEWsQ7tCJp7RclD3vic0HLDhoiJW5lHu2RuNklZRa8eK1W zUhS7ZIz9Gkgu9GrF2gXnbo+ohqhRjklLcFNiiH+NPQ/NpJZd/7/j5Pl6AqYHbJkxSYd YsEOoGCBfkuTYwax/V5kbG5mkGruMDlqRFGIbb7jrSPSNjnbMLaedkyLgY9ngDZvDok6 zaYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=seIUvCtU/RImHMZv5WHj0eKcYMI7aByWRXXoH2GfqUA=; b=YA/0ApCTbHuNDhfLAabZIeCgVOcCuhZM1O3pLXpij77VlCuQtgqrSwlOMwzZFuLerv CrcckbG1tp+ZDJFAQ4nAEe/gourqPKpG+KqI3BnIIqpk7BbvO2jyPUzdGG/PRe6YcFm4 jbfyyiYa9lc27fhxhL6BAXws252kcMvyZfSe0BmpH7vyGwWeJQHHrEAUZxV9Ps66npQs Iui0rLhnmxp0pgRNNEdE+ASmqRdG8ijzfK2KCA9Xustuhp+83v/ma4cf4Wmy6PUazngt auWikg+/r4sOnT3dsZa6XvxMSZ4QO3oSMGwqe2pdredrgmS1X/nXKA761yT0Dex3F4fR GHwg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si2119910pgo.283.2019.07.06.03.43.00; Sat, 06 Jul 2019 03:43:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbfGFKmU convert rfc822-to-8bit (ORCPT + 99 others); Sat, 6 Jul 2019 06:42:20 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:54090 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbfGFKmU (ORCPT ); Sat, 6 Jul 2019 06:42:20 -0400 Received: from [192.168.0.113] (CMPC-089-239-107-172.CNet.Gawex.PL [89.239.107.172]) by mail.holtmann.org (Postfix) with ESMTPSA id 085FECEFAE; Sat, 6 Jul 2019 12:50:51 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH] Fast advertising interval From: Marcel Holtmann In-Reply-To: <1561108931-9568-1-git-send-email-spoorthix.k@intel.com> Date: Sat, 6 Jul 2019 12:42:18 +0200 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <1561108931-9568-1-git-send-email-spoorthix.k@intel.com> To: SpoorthiX K X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Spoorthi, > Implemented as per Core Spec 5.0 > > Signed-off-by: Spoorthi Ravishankar Koppad > --- > include/net/bluetooth/hci_core.h | 2 ++ > net/bluetooth/hci_request.c | 33 ++++++++++++++++++++++++--------- > 2 files changed, 26 insertions(+), 9 deletions(-) > > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > index aed17df..9b19992 100644 > --- a/include/net/bluetooth/hci_core.h > +++ b/include/net/bluetooth/hci_core.h > @@ -1510,6 +1510,8 @@ struct hci_mgmt_chan { > #define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 > #define DISCOV_BREDR_INQUIRY_LEN 0x08 > #define DISCOV_LE_RESTART_DELAY msecs_to_jiffies(200) /* msec */ > +#define DISCOV_LE_FAST_ADV_INT_MIN 100 /* msec */ > +#define DISCOV_LE_FAST_ADV_INT_MAX 150 /* msec */ > > void mgmt_fill_version_info(void *ver); > int mgmt_new_settings(struct hci_dev *hdev); > diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c > index d4f5bfa..c077b06 100644 > --- a/net/bluetooth/hci_request.c > +++ b/net/bluetooth/hci_request.c > @@ -1177,8 +1177,10 @@ void __hci_req_enable_advertising(struct hci_request *req) > bool connectable; > u32 flags; > > + BT_INFO("Entered __hci_req_enable_advertising"); > flags = get_adv_instance_flags(hdev, hdev->cur_adv_instance); > > + these two don’t belong in this patch. > /* If the "connectable" instance flag was not set, then choose between > * ADV_IND and ADV_NONCONN_IND based on the global connectable setting. > */ > @@ -1208,15 +1210,28 @@ void __hci_req_enable_advertising(struct hci_request *req) > return; > > memset(&cp, 0, sizeof(cp)); > - cp.min_interval = cpu_to_le16(hdev->le_adv_min_interval); > - cp.max_interval = cpu_to_le16(hdev->le_adv_max_interval); > - > - if (connectable) > - cp.type = LE_ADV_IND; > - else if (get_cur_adv_instance_scan_rsp_len(hdev)) > - cp.type = LE_ADV_SCAN_IND; > - else > - cp.type = LE_ADV_NONCONN_IND; > + BT_INFO("__hci_req_enable_advertising”); This is debug code. Please remove it. > + > + if (connectable) { > + BT_INFO("set adv min and max"); > + cp.type = LE_ADV_IND; The indentation is borked here and the BT_INFO also doesn’t belong here. > + cp.min_interval = cpu_to_le16(hdev->le_adv_min_interval); > + cp.max_interval = cpu_to_le16(hdev->le_adv_max_interval); > + } else { > + if (get_cur_adv_instance_scan_rsp_len(hdev)) > + cp.type = LE_ADV_SCAN_IND; > + else > + cp.type = LE_ADV_NONCONN_IND; > + > + if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) || > + hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) { > + BT_INFO("Check HCI_DISCOVERABLE or HCI_LIMITED_DISCOVERABLE”); Same as above. No BT_INFO here please. > + cp.min_interval = > + cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MIN); > + cp.max_interval = > + cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MAX); > + } > + } > > cp.own_address_type = own_addr_type; > cp.channel_map = hdev->le_adv_channel_map; Regards Marcel