2020-06-10 20:20:46

by Alain Michaud

[permalink] [raw]
Subject: [PATCH v2 1/3] mgmt: read/set system parameter definitions

This patch submits the corresponding kernel definitions to mgmt.h.
This is submitted before the implementation to avoid any conflicts in
values allocations.

Reviewed-by: Abhishek Pandit-Subedi <[email protected]>
Reviewed-by: Yu Liu <[email protected]>

Signed-off-by: Alain Michaud <[email protected]>
---

Changes in v2:
- Renamed the mgmt.h per Marcel's comments.
- Addressed Marcel's comments in the implementation.

include/net/bluetooth/mgmt.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 16e0d87bd8fa..09452d2ea6d3 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -702,6 +702,36 @@ struct mgmt_rp_set_exp_feature {
__le32 flags;
} __packed;

+#define MGMT_OP_READ_DEF_SYSTEM_CONFIG 0x004b
+
+struct mgmt_tlv {
+ __u16 type;
+ __u8 length;
+ __u8 value[];
+} __packed;
+
+struct mgmt_rp_read_default_system_config {
+ __u8 parameters[0]; /* mgmt_tlv */
+} __packed;
+
+#define MGMT_OP_SET_DEF_SYSTEM_CONFIG 0x004c
+
+struct mgmt_cp_set_default_system_config {
+ __u8 parameters[0]; /* mgmt_tlv */
+} __packed;
+
+#define MGMT_OP_READ_DEF_RUNTIME_CONFIG 0x004d
+
+struct mgmt_rp_read_default_runtime_config {
+ __u8 parameters[0]; /* mgmt_tlv */
+} __packed;
+
+#define MGMT_OP_SET_DEF_RUNTIME_CONFIG 0x004e
+
+struct mgmt_cp_set_default_runtime_config {
+ __u8 parameters[0]; /* mgmt_tlv */
+} __packed;
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
--
2.27.0.290.gba653c62da-goog


2020-06-12 06:41:13

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] mgmt: read/set system parameter definitions

Hi Alain,

> This patch submits the corresponding kernel definitions to mgmt.h.
> This is submitted before the implementation to avoid any conflicts in
> values allocations.
>
> Reviewed-by: Abhishek Pandit-Subedi <[email protected]>
> Reviewed-by: Yu Liu <[email protected]>
>
> Signed-off-by: Alain Michaud <[email protected]>

one think that I forgot to mention, you start with the authors signed-off-by and after that you include other signed-off-by, reviewed-by, tested-by, acked-by etc. You should be able to read this top to bottom as the history of the patch.

> ---
>
> Changes in v2:
> - Renamed the mgmt.h per Marcel's comments.
> - Addressed Marcel's comments in the implementation.
>
> include/net/bluetooth/mgmt.h | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
> index 16e0d87bd8fa..09452d2ea6d3 100644
> --- a/include/net/bluetooth/mgmt.h
> +++ b/include/net/bluetooth/mgmt.h
> @@ -702,6 +702,36 @@ struct mgmt_rp_set_exp_feature {
> __le32 flags;
> } __packed;
>
> +#define MGMT_OP_READ_DEF_SYSTEM_CONFIG 0x004b
> +
> +struct mgmt_tlv {
> + __u16 type;
> + __u8 length;
> + __u8 value[];
> +} __packed;
> +
> +struct mgmt_rp_read_default_system_config {
> + __u8 parameters[0]; /* mgmt_tlv */

There are ongoing attempts to use var[] instead of var[0] to standardize on more restrict C standards and its interpretations.

In addition, I would shortcut parameters to params[] here. I can fix this up for you since I just saw you send a v4 as well.

Regards

Marcel