Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp286991pxb; Wed, 14 Apr 2021 15:38:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8csUZkzrv5t0aCJRCNOcKvDNadz4yBU8N0EakxuNXQkT4AuBdsT7mn+RacWJ92p+58GrF X-Received: by 2002:a17:907:96a9:: with SMTP id hd41mr313553ejc.255.1618439926337; Wed, 14 Apr 2021 15:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618439926; cv=none; d=google.com; s=arc-20160816; b=cGQ/iLF16rRKFZSDkcv/1XjAvb8DmYVvzyVkQuqUcwOw9jXFgckQsh0HuKyf0GQsdN QeLvbYX1yIV1QPLCU2iIEX6qvRG9+cvJbSIdIxvqg64+s3VMV7/mBO2DFdAy/t0RtoD6 kvZNsAItRI1bg2XNdUEQlwRCxq+J2QOF01cB447/dZrX+FoMt/iAOdhhabzHRrlCjFCm V4SoaADMSwkaj9j8iQ/SsE9rQnaRFfnvXpI0n36xYEPlmjdRdOXj8lCVICjApzQlvoN6 RTS5eRTbvymlc2KySEZmeuV4vCFmhPghZWWWH7pK1Akq+npxpDP3K9yfb1DhRw1D3NDQ m4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=rl5QYQpIPmXiI+zgYPxSD9w84lxpM9iE5OeHGwZegp0=; b=fFn89VAh31wulygLIaYpsy5vcoIXsnGyMc803gkvYBUntc5yS9ocTior11KtVPQ/Es 8LS0oz0HTre9KAZGFd+yiuEz4MjOoEXiKdSQpCNakGjaIjeZQufB4UzqrnkO8m1KHr1Y SCe7QCIgCvzx+XhyP7DMrvhNzmGpXkTmMOdmX573NK8PcQUCA24oBrgkMnbCoZFw+XCn LhEdTqPj47PkQzON8VR2ZrYT3yatZgg0hn/MrGCkLYPAUSUAtfsiO8AGV7wE1wDf0j69 xNGHD9qo7MpldOOWFAneAbeZ9S4v3JmfIp/3sluDcLZrkJEt4TdPDL0r3JR18CPMyQLA R00A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si546966ejm.177.2021.04.14.15.37.42; Wed, 14 Apr 2021 15:38:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231645AbhDNKHC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Apr 2021 06:07:02 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:41694 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232032AbhDNKHB (ORCPT ); Wed, 14 Apr 2021 06:07:01 -0400 Received: from mac-pro.holtmann.net (unknown [37.82.212.72]) by mail.holtmann.org (Postfix) with ESMTPSA id B4625CECDF; Wed, 14 Apr 2021 12:14:23 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [Bluez PATCH] btmgmt: Add support to enable LL privacy From: Marcel Holtmann In-Reply-To: Date: Wed, 14 Apr 2021 12:06:37 +0200 Cc: Luiz Augusto von Dentz , "linux-bluetooth@vger.kernel.org" , "Tumkur Narayan, Chethan" , "Srivatsa, Ravishankar" Content-Transfer-Encoding: 8BIT Message-Id: References: <20210405145802.27317-1-sathish.narasimman@intel.com> <588F99C8-E5B4-47D3-84C3-72F9E6FCC9EC@holtmann.org> To: "Narasimman, Sathish" X-Mailer: Apple Mail (2.3654.60.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, >>>> If the Bluetooth controller supports LL privacy this command will be >>>> used to test the same. >>>> "sudo btmgmt power off" >>>> "sudo btmgmt llprivacy on" >>>> "sudo btmgmt power on" >>>> >>>> Signed-off-by: Sathish Narasimman >>>> --- >>>> tools/btmgmt.c | 38 ++++++++++++++++++++++++++++++++++++++ >>>> 1 file changed, 38 insertions(+) >>>> >>>> diff --git a/tools/btmgmt.c b/tools/btmgmt.c index >>>> 93d244ff8ec8..4a53c3768fe9 100644 >>>> --- a/tools/btmgmt.c >>>> +++ b/tools/btmgmt.c >>>> @@ -2261,6 +2261,42 @@ static void cmd_bredr(int argc, char **argv) >>>> cmd_setting(MGMT_OP_SET_BREDR, argc, argv); } >>>> >>>> +static void ll_rpa_resoln_rsp(uint8_t status, uint16_t len, const void *param, >>>> + void *user_data) { >>>> + if (status != 0) >>>> + error("Could not set LL RPA resolution with status 0x%02x (%s)", >>>> + status, mgmt_errstr(status)); >>>> + else >>>> + print("LL RPA Resolution successfully set"); >>>> + >>>> + bt_shell_noninteractive_quit(EXIT_SUCCESS); >>>> +} >>>> + >>>> +static void cmd_set_ll_rpa_resoln(int argc, char **argv) { >>>> + /* 15c0a148-c273-11ea-b3de-0242ac130004 */ >>>> + static const uint8_t rpa_resolution_uuid[16] = { >>>> + 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, 0xde, 0xb3, >>>> + 0xea, 0x11, 0x73, 0xc2, 0x48, 0xa1, 0xc0, 0x15, >>>> + }; >>>> + struct mgmt_cp_set_exp_feature cp; >>>> + uint16_t index; >>>> + >>>> + memset(&cp, 0, sizeof(cp)); >>>> + memcpy(cp.uuid, rpa_resolution_uuid, 16); >>>> + >>>> + index = mgmt_index; >>>> + if (index == MGMT_INDEX_NONE) >>>> + index = 0; >>>> + >>>> + if (parse_setting(argc, argv, &cp.action) == false) >>>> + return bt_shell_noninteractive_quit(EXIT_FAILURE); >>>> + >>>> + mgmt_send(mgmt, MGMT_OP_SET_EXP_FEATURE, index, >>>> + sizeof(cp), &cp, ll_rpa_resoln_rsp, NULL, NULL); } >>>> + >>>> static void cmd_privacy(int argc, char **argv) { >>>> struct mgmt_cp_set_privacy cp; @@ -5243,6 +5279,8 @@ static >>>> const struct bt_shell_menu main_menu = { >>>> cmd_bredr, "Toggle BR/EDR support", }, >>>> { "privacy", "", >>>> cmd_privacy, "Toggle privacy support" }, >>>> + { "llprivacy", "", >>>> + cmd_set_ll_rpa_resoln, "Toggle LL privacy support" }, >>> >>> Let's have it as a parameter of privacy command so when a >>> user enters ll it enables link-layer privacy. >> >> please don’t. The privacy setting means that we start using RPAs. >> >> Also what is wrong with exp-privacy command that I already added. > > Gentle Reminder. gentle reminder of what? Please re-read my response. Regards Marcel