Commit d06b50ce authored by Marcel Holtmann's avatar Marcel Holtmann

Bluetooth: Remove connection interval parameters from hci_conn_params_set

The connection interval parameter of hci_conn_params_set are always used
with the controller defaults. So just let hci_conn_params_add set the
controller default and not bother resetting them to controller defaults
every time the hci_conn_params_set is called.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 8c87aae1
...@@ -855,8 +855,7 @@ struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, ...@@ -855,8 +855,7 @@ struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev,
struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
bdaddr_t *addr, u8 addr_type); bdaddr_t *addr, u8 addr_type);
int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
u8 auto_connect, u16 conn_min_interval, u8 auto_connect);
u16 conn_max_interval);
void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
void hci_conn_params_clear(struct hci_dev *hdev); void hci_conn_params_clear(struct hci_dev *hdev);
......
...@@ -3508,8 +3508,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, ...@@ -3508,8 +3508,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
/* This function requires the caller holds hdev->lock */ /* This function requires the caller holds hdev->lock */
int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
u8 auto_connect, u16 conn_min_interval, u8 auto_connect)
u16 conn_max_interval)
{ {
struct hci_conn_params *params; struct hci_conn_params *params;
...@@ -3517,8 +3516,6 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, ...@@ -3517,8 +3516,6 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
if (!params) if (!params)
return -EIO; return -EIO;
params->conn_min_interval = conn_min_interval;
params->conn_max_interval = conn_max_interval;
params->auto_connect = auto_connect; params->auto_connect = auto_connect;
switch (auto_connect) { switch (auto_connect) {
...@@ -3532,9 +3529,8 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, ...@@ -3532,9 +3529,8 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
break; break;
} }
BT_DBG("addr %pMR (type %u) auto_connect %u conn_min_interval 0x%.4x " BT_DBG("addr %pMR (type %u) auto_connect %u", addr, addr_type,
"conn_max_interval 0x%.4x", addr, addr_type, auto_connect, auto_connect);
conn_min_interval, conn_max_interval);
return 0; return 0;
} }
......
...@@ -5028,9 +5028,8 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, ...@@ -5028,9 +5028,8 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,
/* If the connection parameters don't exist for this device, /* If the connection parameters don't exist for this device,
* they will be created and configured with defaults. * they will be created and configured with defaults.
*/ */
if (hci_conn_params_set(hdev, &cp->addr.bdaddr, addr_type, auto_conn, if (hci_conn_params_set(hdev, &cp->addr.bdaddr, addr_type,
hdev->le_conn_min_interval, auto_conn) < 0) {
hdev->le_conn_max_interval) < 0) {
err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE,
MGMT_STATUS_FAILED, MGMT_STATUS_FAILED,
&cp->addr, sizeof(cp->addr)); &cp->addr, sizeof(cp->addr));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment