Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: mgmt: Add commands for runtime configuration

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 <marcel@holtmann.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>

authored by

Marcel Holtmann and committed by
Johan Hedberg
aececa64 17896406

+31
+7
net/bluetooth/mgmt.c
··· 114 114 MGMT_OP_SET_EXP_FEATURE, 115 115 MGMT_OP_READ_DEF_SYSTEM_CONFIG, 116 116 MGMT_OP_SET_DEF_SYSTEM_CONFIG, 117 + MGMT_OP_READ_DEF_RUNTIME_CONFIG, 118 + MGMT_OP_SET_DEF_RUNTIME_CONFIG, 117 119 }; 118 120 119 121 static const u16 mgmt_events[] = { ··· 168 166 MGMT_OP_READ_SECURITY_INFO, 169 167 MGMT_OP_READ_EXP_FEATURES_INFO, 170 168 MGMT_OP_READ_DEF_SYSTEM_CONFIG, 169 + MGMT_OP_READ_DEF_RUNTIME_CONFIG, 171 170 }; 172 171 173 172 static const u16 mgmt_untrusted_events[] = { ··· 7307 7304 { read_def_system_config, MGMT_READ_DEF_SYSTEM_CONFIG_SIZE, 7308 7305 HCI_MGMT_UNTRUSTED }, 7309 7306 { set_def_system_config, MGMT_SET_DEF_SYSTEM_CONFIG_SIZE, 7307 + HCI_MGMT_VAR_LEN }, 7308 + { read_def_runtime_config, MGMT_READ_DEF_RUNTIME_CONFIG_SIZE, 7309 + HCI_MGMT_UNTRUSTED }, 7310 + { set_def_runtime_config, MGMT_SET_DEF_RUNTIME_CONFIG_SIZE, 7310 7311 HCI_MGMT_VAR_LEN }, 7311 7312 }; 7312 7313
+18
net/bluetooth/mgmt_config.c
··· 251 251 MGMT_OP_SET_DEF_SYSTEM_CONFIG, 252 252 MGMT_STATUS_SUCCESS); 253 253 } 254 + 255 + int read_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, 256 + u16 data_len) 257 + { 258 + bt_dev_dbg(hdev, "sock %p", sk); 259 + 260 + return mgmt_cmd_complete(sk, hdev->id, 261 + MGMT_OP_READ_DEF_RUNTIME_CONFIG, 0, NULL, 0); 262 + } 263 + 264 + int set_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, 265 + u16 data_len) 266 + { 267 + bt_dev_dbg(hdev, "sock %p", sk); 268 + 269 + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEF_SYSTEM_CONFIG, 270 + MGMT_STATUS_INVALID_PARAMS); 271 + }
+6
net/bluetooth/mgmt_config.h
··· 9 9 10 10 int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data, 11 11 u16 data_len); 12 + 13 + int read_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, 14 + u16 data_len); 15 + 16 + int set_def_runtime_config(struct sock *sk, struct hci_dev *hdev, void *data, 17 + u16 data_len);