Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp465166ybt; Wed, 17 Jun 2020 05:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWisTBO6VEmEpoDo7aRl07QIiM1LSKglgdhDTQvvzMpYTV59qWcqHqXqCvPQjYS2zeXyID X-Received: by 2002:a17:906:3013:: with SMTP id 19mr7252717ejz.303.1592398447435; Wed, 17 Jun 2020 05:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592398447; cv=none; d=google.com; s=arc-20160816; b=0/qEM2joEaW5QGtuD36KpCj+/VOfbFT9R9LsH3/DP4Y1ILPay1hTO4vFUk+wsAR6Fd 1E9KnkJex1iVe98pOrpslnFVdyTnyxOg7hGNvLCaKPJcgQUx0+QHyhRSqd06nlYzXVlL yia6j+7WMdO6f+Rg8JZWeJhQ5ALyDRc/sntH+pJuXQrPjQvodIS5GYy7UFoDkP3J64VP 7wiveBSWSedCwYc7AwG11Dgs5NQbFuR5ZOtQu3w7yUg79G1BfrwuJ1y0j9vKpChRFiw+ HfVVSH4CcviR8zLJLP6QTKbd0aq7uQHx8cMhDpAxCM0zy2H6skcV9R0nmDFaPrrUAZSG SQjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Ydc4Anp7yqvrtJe1VckMIJmtVzaa7m1psqY7l5LknoE=; b=Wc68LsYeo1aklMp8AH+mynxmSv7iPH7LubjrhgBiqB6PviU2lKlceBJBdrAaYncqKb 8P2Dvy3pcHh/isvvgqzl2B1I4FXvhPCeTDWoDrj3L1PyPMZ6oPdccaDdKyKQc4Tx9REa loP0jVwfLFn/J1QC5AWLUm+AzRDow6b8FmogpA/Nxbb7d+goL0wPJ/wt6LlJzIQOH+yG VuR0FKAexB7FmOnWNIGDMv0jDdE1vl5agcKMcMzFbdmafizRAZrT64grW1XTF5fMF9F2 7RgJSkWspGK2Dt0gUKaHTpVwthQfuvf8xBht9PO1vxITEIf4WXEGveLuqcms7NEl55jD pJog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZjCgzjoI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt1si16624525ejc.29.2020.06.17.05.53.42; Wed, 17 Jun 2020 05:54:07 -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=@google.com header.s=20161025 header.b=ZjCgzjoI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgFQMwC (ORCPT + 99 others); Wed, 17 Jun 2020 08:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgFQMwC (ORCPT ); Wed, 17 Jun 2020 08:52:02 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48965C06174E for ; Wed, 17 Jun 2020 05:52:02 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id s1so2744827ljo.0 for ; Wed, 17 Jun 2020 05:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ydc4Anp7yqvrtJe1VckMIJmtVzaa7m1psqY7l5LknoE=; b=ZjCgzjoI0hBRmEg86l18ac2TqJaeKjuYMSO9RVxaxqvOPwYrV0XCeJIS/pEoMKED9p 8cQBdZ5Nwvzep4ZkXoGsenwU6gbdl7unGcpOD7qeiZHOqeaId377utONIZpquD7sJAjj nqeU/V1/STz5I7IXx84oPv+fXmm/QdpSlTzvtJ1zHZ6rGqxt9Qtngmpj9r5uAbZklkxh dzPsRigkywp/QNY/M/MBXxc0jmNTRlD1CP5YapSBIN/V7NOXwYkxTQwHLWLowuKnlvi7 mTYywCHRjbRHvSudJbWTxssZQNYzXuov+Z53cbRIRUfcvvUw0dX+8LLMpN3QR9wYyLz5 EhQg== 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=Ydc4Anp7yqvrtJe1VckMIJmtVzaa7m1psqY7l5LknoE=; b=hRa2H2H718pduW7j5uBElpeWbM+NI1Z5gHJvN0+C4T+gPLjn7Hw1L4A8ZglAe97hBM F9ZoR4j87oRo6PouW+b7OEMjagrmCcYLN7Aov5I/xZGWSCdaMXaV+l1ZXv8mZlpGGf98 KFkA2M5fZ07mcBVR9IjTY/n2VdQjT7raCHeNd5aFou1E5goBzj9RzaUoIqus8gWZP9D8 iSbcyH0/zTCWhzdXxbpyxyv+docqUjtklCDoi2Oh0YyXkWL8DpiyU/DSexgUGfALkoZV RddZ12rx5Y3WM4hJvB2vy1kioK8XGxF83O/9V0wb6E+dQAqDHZMaYQsaGCBu53ikA9Qd wn4w== X-Gm-Message-State: AOAM532hEzk1wWwx74Y9b2qqxVE3PZxXKqn1GW34lgQOcBSu0DdCrc5A oivbVzhpf4m2PgQyuHGQh47OKHAnx+fhBUN+0c/2OtxjW+g= X-Received: by 2002:a2e:890d:: with SMTP id d13mr4049371lji.75.1592398320495; Wed, 17 Jun 2020 05:52:00 -0700 (PDT) MIME-Version: 1.0 References: <33f8fb3c32ce1940f2cb41adfe440ca0f77fc39c.1592390407.git.marcel@holtmann.org> In-Reply-To: <33f8fb3c32ce1940f2cb41adfe440ca0f77fc39c.1592390407.git.marcel@holtmann.org> From: Alain Michaud Date: Wed, 17 Jun 2020 08:51:48 -0400 Message-ID: Subject: Re: [PATCH 01/14] Bluetooth: mgmt: Add commands for runtime configuration To: Marcel Holtmann Cc: BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, On Wed, Jun 17, 2020 at 6:42 AM Marcel Holtmann wrote: > > This adds the required read/set commands for runtime configuration. Even > while currently no parameters are specified, the commands are made > available. > Reviewed-by: Alain Michaud > 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 >