Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256396
b: refs/heads/master
c: 971e3a4
h: refs/heads/master
v: v3
  • Loading branch information
Andre Guedes authored and Gustavo F. Padovan committed Jul 6, 2011
1 parent b6c9918 commit 28eb409
Show file tree
Hide file tree
Showing 4 changed files with 33 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: 02f1b641060486df8eecd66b060ae6551f398593
refs/heads/master: 971e3a4bbcbf7378315b85150853d86be59cffe0
4 changes: 4 additions & 0 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ enum {

#define LMP_LSTO 0x01
#define LMP_INQ_TX_PWR 0x02
#define LMP_EXTFEATURES 0x80

/* Connection modes */
#define HCI_CM_ACTIVE 0x0000
Expand Down Expand Up @@ -676,6 +677,9 @@ struct hci_rp_read_local_features {
} __packed;

#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
struct hci_cp_read_local_ext_features {
__u8 page;
} __packed;
struct hci_rp_read_local_ext_features {
__u8 status;
__u8 page;
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 @@ -113,6 +113,7 @@ struct hci_dev {
__u8 major_class;
__u8 minor_class;
__u8 features[8];
__u8 extfeatures[8];
__u8 commands[64];
__u8 ssp_mode;
__u8 hci_ver;
Expand Down
27 changes: 27 additions & 0 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,14 @@ static void hci_setup(struct hci_dev *hdev)

if (hdev->features[7] & LMP_INQ_TX_PWR)
hci_send_cmd(hdev, HCI_OP_READ_INQ_RSP_TX_POWER, 0, NULL);

if (hdev->features[7] & LMP_EXTFEATURES) {
struct hci_cp_read_local_ext_features cp;

cp.page = 0x01;
hci_send_cmd(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES,
sizeof(cp), &cp);
}
}

static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb)
Expand Down Expand Up @@ -658,6 +666,21 @@ static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb
hdev->features[6], hdev->features[7]);
}

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

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

if (rp->status)
return;

memcpy(hdev->extfeatures, rp->features, 8);

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

static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_rp_read_buffer_size *rp = (void *) skb->data;
Expand Down Expand Up @@ -1826,6 +1849,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
hci_cc_read_local_features(hdev, skb);
break;

case HCI_OP_READ_LOCAL_EXT_FEATURES:
hci_cc_read_local_ext_features(hdev, skb);
break;

case HCI_OP_READ_BUFFER_SIZE:
hci_cc_read_buffer_size(hdev, skb);
break;
Expand Down

0 comments on commit 28eb409

Please sign in to comment.