Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352261
b: refs/heads/master
c: 9b008c0
h: refs/heads/master
i:
  352259: 9e6b259
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jan 23, 2013
1 parent be28c3e commit 2e36233
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf1d081f6597a45e5ff63f55c893494a8ae1cdaf
refs/heads/master: 9b008c0457e583e10e62d1215bed6ab26ee54906
6 changes: 6 additions & 0 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,12 @@ struct hci_rp_le_ltk_neg_reply {
__le16 handle;
} __packed;

#define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c
struct hci_rp_le_read_supported_states {
__u8 status;
__u8 le_states[8];
} __packed;

/* ---- HCI Events ---- */
#define HCI_EV_INQUIRY_COMPLETE 0x01

Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ struct hci_dev {
__u8 host_features[8];
__u8 le_features[8];
__u8 le_white_list_size;
__u8 le_states[8];
__u8 commands[64];
__u8 hci_ver;
__u16 hci_rev;
Expand Down
20 changes: 20 additions & 0 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ static void le_setup(struct hci_dev *hdev)

/* Read LE White List Size */
hci_send_cmd(hdev, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL);

/* Read LE Supported States */
hci_send_cmd(hdev, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
}

static void hci_setup(struct hci_dev *hdev)
Expand Down Expand Up @@ -1346,6 +1349,19 @@ static void hci_cc_le_ltk_neg_reply(struct hci_dev *hdev, struct sk_buff *skb)
hci_req_complete(hdev, HCI_OP_LE_LTK_NEG_REPLY, rp->status);
}

static void hci_cc_le_read_supported_states(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_rp_le_read_supported_states *rp = (void *) skb->data;

BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);

if (!rp->status)
memcpy(hdev->le_states, rp->le_states, 8);

hci_req_complete(hdev, HCI_OP_LE_READ_SUPPORTED_STATES, rp->status);
}

static void hci_cc_write_le_host_supported(struct hci_dev *hdev,
struct sk_buff *skb)
{
Expand Down Expand Up @@ -2712,6 +2728,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
hci_cc_le_ltk_neg_reply(hdev, skb);
break;

case HCI_OP_LE_READ_SUPPORTED_STATES:
hci_cc_le_read_supported_states(hdev, skb);
break;

case HCI_OP_WRITE_LE_HOST_SUPPORTED:
hci_cc_write_le_host_supported(hdev, skb);
break;
Expand Down

0 comments on commit 2e36233

Please sign in to comment.