diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-24 17:09:51 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-11-01 18:26:59 -0400 |
commit | 5ed8eb2f6b5710c09bd1adb40aa795a424e21143 (patch) | |
tree | 54d08ed0743a58d85a6bf67cc88f52c73214c99d /net/bluetooth/hci_event.c | |
parent | f15504788d7b1613ef2ef0a673cfe250c16a6b0d (diff) |
Bluetooth: Fix setting host feature bits for SSP
When we get a successful command complete for HCI_Write_SSP_Mode we need
to update the host feature bits for the hdev struct accordingly.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index aae80531f8ce..dc60d3161824 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -440,7 +440,7 @@ static void hci_cc_host_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) | |||
440 | static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) | 440 | static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) |
441 | { | 441 | { |
442 | __u8 status = *((__u8 *) skb->data); | 442 | __u8 status = *((__u8 *) skb->data); |
443 | void *sent; | 443 | struct hci_cp_write_ssp_mode *sent; |
444 | 444 | ||
445 | BT_DBG("%s status 0x%2.2x", hdev->name, status); | 445 | BT_DBG("%s status 0x%2.2x", hdev->name, status); |
446 | 446 | ||
@@ -448,10 +448,17 @@ static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) | |||
448 | if (!sent) | 448 | if (!sent) |
449 | return; | 449 | return; |
450 | 450 | ||
451 | if (!status) { | ||
452 | if (sent->mode) | ||
453 | hdev->host_features[0] |= LMP_HOST_SSP; | ||
454 | else | ||
455 | hdev->host_features[0] &= ~LMP_HOST_SSP; | ||
456 | } | ||
457 | |||
451 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) | 458 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
452 | mgmt_ssp_enable_complete(hdev, *((u8 *) sent), status); | 459 | mgmt_ssp_enable_complete(hdev, sent->mode, status); |
453 | else if (!status) { | 460 | else if (!status) { |
454 | if (*((u8 *) sent)) | 461 | if (sent->mode) |
455 | set_bit(HCI_SSP_ENABLED, &hdev->dev_flags); | 462 | set_bit(HCI_SSP_ENABLED, &hdev->dev_flags); |
456 | else | 463 | else |
457 | clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags); | 464 | clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags); |