Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4099435pxf; Tue, 6 Apr 2021 07:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt+Qv6EO/l5B81Ozan0kypCkbf9Mx+7AaZbhRxkHpIojaa/FxpUrIPHd23FRgj72f05L9+ X-Received: by 2002:a05:6e02:4:: with SMTP id h4mr13715407ilr.137.1617721016633; Tue, 06 Apr 2021 07:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617721016; cv=none; d=google.com; s=arc-20160816; b=pNRQBJjCUMNawOY5+rjhBPGIA9JN0s29UAPba/HZMr5SoK6FF+emVZjbWUPom3yKn5 laKvL0Vda+2827o2q8StqAp58Q4z3ugAAiN/6Ruc3m4Pgwrs88S8oMzCfW8Qr7hriGb2 rJBhj28bYOs5HCargufFY85JHHcLwSNuJIEmuY+pupZotOA1yIy1d2UHwuvoH8DkD75d vwKQGRKK/c0QpkxM8QsWlZNn2AgtAruC7HP8VvBKPU4oyRWicJs6c76ri2jkwWG8UZCH uSzKCf5ZKs4WOIqMS8T+S1ij9yKumcGsPEY1nVnOA8kffnCvTzbT9WuPku74dvh3Nfby r4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2L/NKKxc/QCQ+L+gM6vaooYvk4fG9nyap4uuHy5XjMA=; b=Xd4tqJr6PuinFyeASKMNB156yrO2RBPbrBCxtQaUQZ7t59BpuIJ6nPZhGzQJwKid0S mwIs7eY5BizYX+GjP6GP1Ermd0eC8b637cxYZhiDwLXsjulHttPI/rRoMID+uHAwg/Py eD1Vy7S8LgUWUzRzJhnH/gNh7SaD9gmuc0CmLSKoZv0GiFFqLb1c/FAG4HpW385uXnml jizvhtM2/t2BnfZk0+kNQU+pYrAt/bRXo0C9ohx/2Dd/8fILym0OWexZKqmA6MZOsPg1 Qubp492FY0ks+LyYSjb/RSpmqhIRsLHgVnxlOgxa/fhJwiABJx7+0GhubjmVw+Mu/OYl TxHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JVdYylND; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si17641208iow.42.2021.04.06.07.56.28; Tue, 06 Apr 2021 07:56:56 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JVdYylND; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239649AbhDFDIc (ORCPT + 99 others); Mon, 5 Apr 2021 23:08:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238646AbhDFDIc (ORCPT ); Mon, 5 Apr 2021 23:08:32 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1436DC061574 for ; Mon, 5 Apr 2021 20:08:24 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 125-20020a4a1a830000b02901b6a144a417so3342262oof.13 for ; Mon, 05 Apr 2021 20:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2L/NKKxc/QCQ+L+gM6vaooYvk4fG9nyap4uuHy5XjMA=; b=JVdYylND5zZ9VlKWYKmVMgNfU0QnVcfBs5bdkC8LolWWtokPONoSOgkzKAQv1Xc9Mo 7bzUbAdpRP6C6rFg8EnsW38rwyBXxPFwvJU46aGlUDoqKNMRXzWDc+2WKuPljea9WwS5 Gd+biLdizWtecfsZFXwN3Aiu5rSS0Y01O6PZVMa+Uwp/6iECwEOe9NEBQNIzr0U96CgJ TJblORXR6D8KHHxSjOTjBVTVP7lQigTPmM66/ATLYgMY0L8rFbWz8xzh7PjjUSUO33/4 DVetlQvCk886AfrEcZ0lzNKAAcR8WREc1shy3REsPiW2NogSbVCcU4gfbfNK+ox69470 p/EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2L/NKKxc/QCQ+L+gM6vaooYvk4fG9nyap4uuHy5XjMA=; b=bOZ+42aiSvuo6F2eJz7QZR/q8lMg/ZKE5mrgkceHRP22eDN/kUUvpynZMKdS2n/Ndd dt6mZM6JmTef1Dgm6vEJjLNrZN6DK6Nxfc90JEexx9cjtZKZanzYrisE+u67NkQe9hLU n9F/ujoZSDFLP0Scu/mBkxU35PdJPn6bR3Gaw8Eqped9AI2gbSWPLu775/0Z+Z3//Q6H rgRX56EIv84op2dKkYnpIGaG2qLDVlAdnezFFFKpU5QYQhGg/0HJHEYYiwLT5I1CMl9a EaOm0ybZniOPLt9d7LbklcZCGwXCu8C11SwRpzvf3NxGezi0cm8nCiXahzCC/uROpF1m nDCA== X-Gm-Message-State: AOAM531pSwf/mOOifqU6rbVpIIryQewJvsMggMO+XgJz2aL6oDGK/n1O uL46sE6+R01ClQflfwh+vN26BVlcFu/4Ijkdy4A= X-Received: by 2002:a4a:c316:: with SMTP id c22mr24956887ooq.65.1617678503412; Mon, 05 Apr 2021 20:08:23 -0700 (PDT) MIME-Version: 1.0 References: <20210405145802.27317-1-sathish.narasimman@intel.com> In-Reply-To: <20210405145802.27317-1-sathish.narasimman@intel.com> From: Luiz Augusto von Dentz Date: Mon, 5 Apr 2021 20:08:13 -0700 Message-ID: Subject: Re: [Bluez PATCH] btmgmt: Add support to enable LL privacy To: Sathish Narasimman Cc: "linux-bluetooth@vger.kernel.org" , Chethan T N , "Srivatsa, Ravishankar" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, On Mon, Apr 5, 2021 at 3:40 PM Sathish Narasimman wrote: > > 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. > { "class", " ", > cmd_class, "Set device major/minor class" }, > { "disconnect", "[-t type] ", > -- > 2.17.1 > -- Luiz Augusto von Dentz