Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3556763pxf; Mon, 5 Apr 2021 15:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdM/gW3Y2OsgYnOuxCLUEuEHWmg5hZ7EsqnJy1jtZW4Np4C9+i4tQyRi1FIg1zRw6pib2x X-Received: by 2002:a05:6638:43:: with SMTP id a3mr25016009jap.102.1617662417300; Mon, 05 Apr 2021 15:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617662417; cv=none; d=google.com; s=arc-20160816; b=vqlqAed48wLZ9t4Dre8jB+PFWDdpioA7GSh6pbExZ8O5NrQh6WkkklwVVA3wFH6zx1 55V43NGaVK8qOkMzRaK/nE4pKkWdtmyy05jMbbdFFEKGxfZTIdbXhHs2LUoHdolVQFHm eM1i4v0vlIzayaadxQzw0VC1DOgHu0XVdh1QJLWURsqwJ7c76A+ccUMhzCj0doibm6aU g7z1lNtOo9BT7rJ0zA2Sevjfot3qkn4Y9Mx8Z8M0vH0jhYwQ45RrCmxRrukS/rqeYOnW ADCvk5AZfQJDz4X7wsnRkJ/1hTjV/0Eu/jqZXS+hJQLY/TsRmVX3CCvhGBUlhzOKkGxZ MZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=5y001g3ufFOOqkCsP54jGm0W0DdRrrrvP/dh2CFdcT0=; b=y3/4EVMdKSbdl7J+yg/j8RVtknHbEjuY2trlLa9v6uqOBPnego5MtX9l/yfJWXW76L eWOPfRL7rSXBKu9ItBmPBwt+7DEcL8vIDFZSs2bONn2ZVBBq6i8MDb16Nd6D+sWpt7+5 X8Lozp7qDwT8PFuyIvQiBuKK4y2Q5XEzr2Id53juEpQy132IPqak33P+jVSHMtXHqlpX 8bOglxFGP6Oo6Ehc46RAdbGHuEgK8g1qnaRmEAlD/tG8vBswsuGVUeqi2AWlzvJUOkc8 YCz2ZpS0S4x4FyymCcStR8Sxcol62kvBNroH4EO1ExxF7w4I+EKQgmgfnyWQTEG/os8S WTMQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si15433472iow.42.2021.04.05.15.39.48; Mon, 05 Apr 2021 15:40:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236209AbhDEOte (ORCPT + 99 others); Mon, 5 Apr 2021 10:49:34 -0400 Received: from mga11.intel.com ([192.55.52.93]:40222 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235948AbhDEOte (ORCPT ); Mon, 5 Apr 2021 10:49:34 -0400 IronPort-SDR: cII/k8LvclC8lbwkHM+t/tCesWtw28IkYVUIAIRrg7GaOE/81qBYLkaYruFSPhAzGO42gb7fPt P6wefZnyfUsQ== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="189642577" X-IronPort-AV: E=Sophos;i="5.81,306,1610438400"; d="scan'208";a="189642577" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 07:49:28 -0700 IronPort-SDR: ND7SK95XtCym53ElE5FLQ1axlkfEw0PLqlGyC8QiZETctgRKl6ecDMh8LqPehOzNnr6oieH+YV +6GEP23XaEhw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,306,1610438400"; d="scan'208";a="414316882" Received: from nsathish-latitude-7480.iind.intel.com ([10.224.186.105]) by fmsmga008.fm.intel.com with ESMTP; 05 Apr 2021 07:49:26 -0700 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: chethan.tumkur.narayan@intel.com, ravishankar.srivatsa@intel.com, Sathish Narasimman Subject: [Bluez PATCH] btmgmt: Add support to enable LL privacy Date: Mon, 5 Apr 2021 20:28:02 +0530 Message-Id: <20210405145802.27317-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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" }, { "class", " ", cmd_class, "Set device major/minor class" }, { "disconnect", "[-t type] ", -- 2.17.1