Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp387531ybt; Wed, 17 Jun 2020 03:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydw3Ivpo9Hvt43P9N+vuX1z1Umipf17CPpe1pjNxZFb7MMCjb4K/FkyLElA5Hfp+rypjdB X-Received: by 2002:a17:906:f1ca:: with SMTP id gx10mr6710843ejb.542.1592390568048; Wed, 17 Jun 2020 03:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592390568; cv=none; d=google.com; s=arc-20160816; b=w3LrnLYg9ttNpzpGPfQC9s/cZkUiw3MhRxl0Wuz7LpzpVB1MbAYvM0EVlzzkbG6JjZ CjT7VomMjuCwLSd/xIUG2Z7k4Z9P6nTFYys/kWnyXOL9r+rQiSVOOQdKFnoiEdWh5tl8 1asE9SIE666tOKd55rWQkhCkQsck92XsCcQ/u3/bFd1qJMlHfOIubUGRRIAxFBTtIw2Q fbIdfXwDNzBeMjY03nDdm09YluCuufMtPmLp0ZehTSuvnkS1PV/iIcy77kUES6EJ68r5 CLZBpGwiiy+REcNbKjWhYZ8ZipGZlGMpMXlKsi+IxSS5KHQBortR9AjbwqSGx+DAGP3L kEtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=Imv5XFti+uVFbDGgZGCrxUFVkeGxKvB2SZlZitpbqWM=; b=BkPbNDRkA2+9ihjtVxhdosEE3HxnZSNNosVVLRoIzTXeG5c+/HI4vukXR+fQurfIqC AmToMdxrQc63GpxzPp1oN3pYFROBkETcwD2iCkUNPBlGP6uZ0N8fn2z35qt+BUpVmag0 PmHxioSm6n0DTIyJbQnCspvKQDA05zt3aLLfTRA+uFwXFArl7ajNPBnLblKhXyRI2gzG BeLwYIlLzGfxKanj/M8JMuGgynASZb8Uq5C71HQj5/oKMkYwy5II4VB/pOzxYFD+QXJp scwH7FvzeDD1FhzNj6DSj9Yq7NET52dompW7duaIZm4ORHL92Jf8i5ootlOz/PL9HDV9 VoSw== 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 la9si11807324ejb.581.2020.06.17.03.42.22; Wed, 17 Jun 2020 03:42:48 -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 S1726565AbgFQKmL (ORCPT + 99 others); Wed, 17 Jun 2020 06:42:11 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:50022 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQKmL (ORCPT ); Wed, 17 Jun 2020 06:42:11 -0400 Received: from localhost.localdomain (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id AC42ACECD3 for ; Wed, 17 Jun 2020 12:52:01 +0200 (CEST) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH 01/14] Bluetooth: mgmt: Add commands for runtime configuration Date: Wed, 17 Jun 2020 12:41:52 +0200 Message-Id: <33f8fb3c32ce1940f2cb41adfe440ca0f77fc39c.1592390407.git.marcel@holtmann.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds the required read/set commands for runtime configuration. Even while currently no parameters are specified, the commands are made available. Signed-off-by: Marcel Holtmann --- net/bluetooth/mgmt.c | 7 +++++++ net/bluetooth/mgmt_config.c | 18 ++++++++++++++++++ net/bluetooth/mgmt_config.h | 6 ++++++ 3 files changed, 31 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 99fbfd467d04..ecfdfc4df486 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -114,6 +114,8 @@ static const u16 mgmt_commands[] = { MGMT_OP_SET_EXP_FEATURE, MGMT_OP_READ_DEF_SYSTEM_CONFIG, MGMT_OP_SET_DEF_SYSTEM_CONFIG, + MGMT_OP_READ_DEF_RUNTIME_CONFIG, + MGMT_OP_SET_DEF_RUNTIME_CONFIG, }; static const u16 mgmt_events[] = { @@ -166,6 +168,7 @@ static const u16 mgmt_untrusted_commands[] = { MGMT_OP_READ_SECURITY_INFO, MGMT_OP_READ_EXP_FEATURES_INFO, MGMT_OP_READ_DEF_SYSTEM_CONFIG, + MGMT_OP_READ_DEF_RUNTIME_CONFIG, }; static const u16 mgmt_untrusted_events[] = { @@ -7305,6 +7308,10 @@ static const struct hci_mgmt_handler mgmt_handlers[] = { HCI_MGMT_UNTRUSTED }, { set_def_system_config, MGMT_SET_DEF_SYSTEM_CONFIG_SIZE, HCI_MGMT_VAR_LEN }, + { read_def_runtime_config, MGMT_READ_DEF_RUNTIME_CONFIG_SIZE, + HCI_MGMT_UNTRUSTED }, + { set_def_runtime_config, MGMT_SET_DEF_RUNTIME_CONFIG_SIZE, + HCI_MGMT_VAR_LEN }, }; void mgmt_index_added(struct hci_dev *hdev) diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c index f6dfbe93542c..8e7ad2a51dbb 100644 --- a/net/bluetooth/mgmt_config.c +++ b/net/bluetooth/mgmt_config.c @@ -251,3 +251,21 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data, MGMT_OP_SET_DEF_SYSTEM_CONFIG, MGMT_STATUS_SUCCESS); } + +int read_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, + u16 data_len) +{ + bt_dev_dbg(hdev, "sock %p", sk); + + return mgmt_cmd_complete(sk, hdev->id, + MGMT_OP_READ_DEF_RUNTIME_CONFIG, 0, NULL, 0); +} + +int set_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, + u16 data_len) +{ + bt_dev_dbg(hdev, "sock %p", sk); + + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEF_SYSTEM_CONFIG, + MGMT_STATUS_INVALID_PARAMS); +} diff --git a/net/bluetooth/mgmt_config.h b/net/bluetooth/mgmt_config.h index 51da6e63b1a0..a4965f107891 100644 --- a/net/bluetooth/mgmt_config.h +++ b/net/bluetooth/mgmt_config.h @@ -9,3 +9,9 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data, int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data, u16 data_len); + +int read_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, + u16 data_len); + +int set_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, + u16 data_len); -- 2.26.2