diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-06-30 12:34:39 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 17:42:51 +0200 |
commit | bf5b3c8be07905c242bb7f751dcb890b94c22d93 (patch) | |
tree | d51b8f325a1b0b0043ea309cd748bd9f546f2377 /net/bluetooth/mgmt.c | |
parent | f1649577a6c20410335dbb4765e74e51fd5df585 (diff) | |
download | lwn-bf5b3c8be07905c242bb7f751dcb890b94c22d93.tar.gz lwn-bf5b3c8be07905c242bb7f751dcb890b94c22d93.zip |
Bluetooth: Provide function to create and set connection parameters
In some cases it is useful to not overwrite connection parametes and
instead just create default ones if they don't exist. This function
does exactly that. hci_conn_params_add will allow to create new
default connection parameters. hci_conn_params_set will set the
values and also create new parameters if they don't exist.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d83197f9e727..e30d0ebb5018 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -5014,7 +5014,10 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, else auto_conn = HCI_AUTO_CONN_DISABLED; - if (hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type, auto_conn, + /* If the connection parameters don't exist for this device, + * they will be created and configured with defaults. + */ + if (hci_conn_params_set(hdev, &cp->addr.bdaddr, addr_type, auto_conn, hdev->le_conn_min_interval, hdev->le_conn_max_interval) < 0) { err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, |