Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp595466pxy; Sat, 14 Aug 2021 17:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhKQhoy/WQIO63TkQnmPiDhdBcJxRY5pjAb5X0QoMSyPNh9+fDr825TsQhog4jHgVs+Khe X-Received: by 2002:a17:906:150c:: with SMTP id b12mr9252448ejd.275.1628986435433; Sat, 14 Aug 2021 17:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628986435; cv=none; d=google.com; s=arc-20160816; b=R4VksxzaCE8Igdeq7W8gnNg7VipcJatjYi/661kepdoeHe4XwGUbx+9tv4ZM8cALiV rfjPJOn02evn82i/xpqSxx8EJCqKwPWiz67Qu7udxFJhEl7JIEMCNADuWE7ylam+Q7oX MBATgdXApJoJQFWQyQoyvakPV7qwhLML4hJjI/BGinXJf0ll1AmL50/9LnWlFGeaynnP MqJz5gYdysT7K8EzO41VJJgvDtDeNmr0K6VnzJ8h8XGPdeR/XKeK9EPJefC6l/zTSu7I uLMPonHWgJZ5KgnacvarZkyeS22rmEfZXT47aK4bgSRArknr3CUEtcBqDZfKVbb1ktc/ quiQ== 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; bh=H+SGWWV7G2qxTXO9D/AzEsygIZ/xlL6ORlyG9XQeKoc=; b=PbP/8ViZM3qQLWMJq6NGeKMk+qGF1dc95EQd+RtnShj84OYJBqgcc9jilZP7soWBlm EVK9hSDqdRNTr4TFugsLL2m/OJ9MHqBRrPIxLlhOk7Me5A28i4DPXfSA+9xBJ+K4glMW s3L2/6JUCFTJUkBJe9T4a1RYx57clT2xJ2dCIcX9l5XYPy4qkaduza4/SdC0SCd9/2zX B02yXkZrmgpfzi2w5r3ihpYzj+ijp1oqyO9uYOR49Ryi++1BYfL+BkQk5sV2/V7DBkzv 6+ggKOVH80GVrI/ygNy9zQYcPu/vp7ddnbU9gl69UCg5w4qu9QWs8JVw2sZRr+Z77A92 veDQ== 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 s14si5925717edw.68.2021.08.14.17.13.11; Sat, 14 Aug 2021 17:13:55 -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 S233237AbhHOAMM (ORCPT + 99 others); Sat, 14 Aug 2021 20:12:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:41698 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbhHOAMM (ORCPT ); Sat, 14 Aug 2021 20:12:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10076"; a="215738509" X-IronPort-AV: E=Sophos;i="5.84,322,1620716400"; d="scan'208";a="215738509" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2021 17:11:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,322,1620716400"; d="scan'208";a="592006598" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmsmga001.fm.intel.com with ESMTP; 14 Aug 2021 17:11:41 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: luiz.von.dentz@intel.com, Kiran K Subject: [PATCH] mgmt: Set offload codec mgmt feature Date: Sun, 15 Aug 2021 05:45:50 +0530 Message-Id: <20210815001550.24643-1-kiran.k@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Signed-off-by: Kiran K --- tools/btmgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 7d908238156d..c5f55ae1290c 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -2554,6 +2554,48 @@ static void cmd_privacy(int argc, char **argv) } } +static void exp_offload_rsp(uint8_t status, uint16_t len, const void *param, + void *user_data) +{ + if (status != 0) + error("Set offload codec feature failed with status 0x%02x (%s)", + status, mgmt_errstr(status)); + else + print("Offload codec feature successfully set"); + + bt_shell_noninteractive_quit(EXIT_SUCCESS); +} + +static void cmd_exp_offload_codecs(int argc, char **argv) +{ + /* a6695ace-ee7f-4fb9-881a-5fac66c629af */ + static const uint8_t uuid[16] = { + 0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, 0x1a, 0x88, + 0xb9, 0x4f, 0x7f, 0xee, 0xce, 0x5a, 0x69, 0xa6, + }; + + struct mgmt_cp_set_exp_feature cp; + uint8_t val; + uint16_t index; + + if (parse_setting(argc, argv, &val) == false) + return bt_shell_noninteractive_quit(EXIT_FAILURE); + + index = mgmt_index; + if (index == MGMT_INDEX_NONE) + index = 0; + + memset(&cp, 0, sizeof(cp)); + memcpy(cp.uuid, uuid, 16); + cp.action = val; + + if (mgmt_send(mgmt, MGMT_OP_SET_EXP_FEATURE, index, + sizeof(cp), &cp, exp_offload_rsp, NULL, NULL) == 0) { + error("Unable to send offload codecs feature cmd"); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } +} + static void class_rsp(uint16_t op, uint16_t id, uint8_t status, uint16_t len, const void *param) { @@ -5595,6 +5637,8 @@ static const struct bt_shell_menu main_menu = { cmd_exp_privacy, "Set LL privacy feature" }, { "exp-quality", "", cmd_exp_quality, "Set bluetooth quality report feature" }, + { "exp-offload", "", + cmd_exp_offload_codecs, "Toggle codec support support" }, { "read-sysconfig", NULL, cmd_read_sysconfig, "Read System Configuration" }, { "set-sysconfig", "<-v|-h> [options...]", -- 2.17.1