aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-02 01:59:23 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-02 02:10:01 -0400
commitee39269369eaada5daae7fabb69bc03429e23bc7 (patch)
tree935d764d6fc82851823752c7b0f8fa8b80c07953
parent848566b381e72b07e41beffde677955ae1498153 (diff)
Bluetooth: Send new settings event when changing high speed option
When enabling or disabling high speed setting it is required to send a new settings event to inform other management interface users about the changed settings. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/mgmt.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index dd15491f2374..ad3862949a2c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1337,6 +1337,8 @@ failed:
1337static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) 1337static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1338{ 1338{
1339 struct mgmt_mode *cp = data; 1339 struct mgmt_mode *cp = data;
1340 bool changed;
1341 int err;
1340 1342
1341 BT_DBG("request for %s", hdev->name); 1343 BT_DBG("request for %s", hdev->name);
1342 1344
@@ -1348,12 +1350,23 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1348 return cmd_status(sk, hdev->id, MGMT_OP_SET_HS, 1350 return cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
1349 MGMT_STATUS_INVALID_PARAMS); 1351 MGMT_STATUS_INVALID_PARAMS);
1350 1352
1353 hci_dev_lock(hdev);
1354
1351 if (cp->val) 1355 if (cp->val)
1352 set_bit(HCI_HS_ENABLED, &hdev->dev_flags); 1356 changed = !test_and_set_bit(HCI_HS_ENABLED, &hdev->dev_flags);
1353 else 1357 else
1354 clear_bit(HCI_HS_ENABLED, &hdev->dev_flags); 1358 changed = test_and_clear_bit(HCI_HS_ENABLED, &hdev->dev_flags);
1359
1360 err = send_settings_rsp(sk, MGMT_OP_SET_HS, hdev);
1361 if (err < 0)
1362 goto unlock;
1355 1363
1356 return send_settings_rsp(sk, MGMT_OP_SET_HS, hdev); 1364 if (changed)
1365 err = new_settings(hdev, sk);
1366
1367unlock:
1368 hci_dev_unlock(hdev);
1369 return err;
1357} 1370}
1358 1371
1359static void le_enable_complete(struct hci_dev *hdev, u8 status) 1372static void le_enable_complete(struct hci_dev *hdev, u8 status)