From: Johan Hedberg <johan.hedberg@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 1/6] Bluetooth: Fix setting host feature bits for SSP
Date: Thu, 25 Oct 2012 00:09:51 +0300 [thread overview]
Message-ID: <1351112996-9597-2-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1351112996-9597-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@intel.com>
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>
---
net/bluetooth/hci_event.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index aae8053..dc60d31 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)
static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
{
__u8 status = *((__u8 *) skb->data);
- void *sent;
+ struct hci_cp_write_ssp_mode *sent;
BT_DBG("%s status 0x%2.2x", hdev->name, status);
@@ -448,10 +448,17 @@ static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
if (!sent)
return;
+ if (!status) {
+ if (sent->mode)
+ hdev->host_features[0] |= LMP_HOST_SSP;
+ else
+ hdev->host_features[0] &= ~LMP_HOST_SSP;
+ }
+
if (test_bit(HCI_MGMT, &hdev->dev_flags))
- mgmt_ssp_enable_complete(hdev, *((u8 *) sent), status);
+ mgmt_ssp_enable_complete(hdev, sent->mode, status);
else if (!status) {
- if (*((u8 *) sent))
+ if (sent->mode)
set_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
else
clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
--
1.7.10.4
next prev parent reply other threads:[~2012-10-24 21:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 21:09 [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support Johan Hedberg
2012-10-24 21:09 ` Johan Hedberg [this message]
2012-10-24 21:45 ` [PATCH 1/6] Bluetooth: Fix setting host feature bits for SSP Marcel Holtmann
2012-10-24 21:09 ` [PATCH 2/6] Bluetooth: Fix sending unnecessary HCI_Write_SSP_Mode command Johan Hedberg
2012-10-24 21:48 ` Marcel Holtmann
2012-10-24 21:09 ` [PATCH 3/6] Bluetooth: Fix sending unnecessary HCI_LE_Host_Enable Johan Hedberg
2012-10-24 21:48 ` Marcel Holtmann
2012-10-25 15:05 ` Gustavo Padovan
2012-10-25 15:07 ` Marcel Holtmann
2012-10-25 15:14 ` Johan Hedberg
2012-10-25 15:20 ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 4/6] Bluetooth: Fix unnecessary EIR update during powering on Johan Hedberg
2012-10-24 21:49 ` Marcel Holtmann
2012-10-25 15:08 ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 5/6] Bluetooth: mgmt: Add support for switching to LE peripheral mode Johan Hedberg
2012-10-24 22:13 ` Vinicius Costa Gomes
2012-10-24 22:36 ` Johan Hedberg
2012-10-25 0:58 ` Vinicius Costa Gomes
2012-10-25 1:54 ` Marcel Holtmann
2012-10-25 4:56 ` Vinicius Costa Gomes
2012-10-25 7:50 ` Johan Hedberg
2012-10-25 10:41 ` Anderson Lizardo
2012-10-25 11:48 ` Johan Hedberg
2012-10-25 12:04 ` Johan Hedberg
2012-10-25 14:31 ` Vinicius Costa Gomes
2012-10-25 15:07 ` Johan Hedberg
2012-10-25 18:48 ` Vinicius Costa Gomes
2012-10-24 21:09 ` [PATCH 6/6] Bluetooth: Add support for setting LE advertising data Johan Hedberg
2012-10-24 21:53 ` [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351112996-9597-2-git-send-email-johan.hedberg@gmail.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).