diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-06-13 06:35:44 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-06-18 23:19:11 -0400 |
commit | ea1e76a3f92f8565d395c549b9ca836c7eaa44b9 (patch) | |
tree | da2abc4751944cc6fa5d6c584308dacaed8b6bf3 /drivers/bluetooth/btmrvl_main.c | |
parent | f960727e6c98a36018029c0512aa03f1c5faa914 (diff) |
Bluetooth: btmrvl: Do not send vendor events to bluetooth stack
Vendor-specific events shall be processed in driver and not sent
to bluetooth stack where they screw up HCI command countings.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'drivers/bluetooth/btmrvl_main.c')
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 681ca9d18e12..dc304def8400 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c | |||
@@ -44,23 +44,33 @@ void btmrvl_interrupt(struct btmrvl_private *priv) | |||
44 | } | 44 | } |
45 | EXPORT_SYMBOL_GPL(btmrvl_interrupt); | 45 | EXPORT_SYMBOL_GPL(btmrvl_interrupt); |
46 | 46 | ||
47 | void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) | 47 | bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) |
48 | { | 48 | { |
49 | struct hci_event_hdr *hdr = (void *) skb->data; | 49 | struct hci_event_hdr *hdr = (void *) skb->data; |
50 | struct hci_ev_cmd_complete *ec; | 50 | struct hci_ev_cmd_complete *ec; |
51 | u16 opcode, ocf; | 51 | u16 opcode, ocf, ogf; |
52 | 52 | ||
53 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { | 53 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { |
54 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); | 54 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); |
55 | opcode = __le16_to_cpu(ec->opcode); | 55 | opcode = __le16_to_cpu(ec->opcode); |
56 | ocf = hci_opcode_ocf(opcode); | 56 | ocf = hci_opcode_ocf(opcode); |
57 | ogf = hci_opcode_ogf(opcode); | ||
58 | |||
57 | if (ocf == BT_CMD_MODULE_CFG_REQ && | 59 | if (ocf == BT_CMD_MODULE_CFG_REQ && |
58 | priv->btmrvl_dev.sendcmdflag) { | 60 | priv->btmrvl_dev.sendcmdflag) { |
59 | priv->btmrvl_dev.sendcmdflag = false; | 61 | priv->btmrvl_dev.sendcmdflag = false; |
60 | priv->adapter->cmd_complete = true; | 62 | priv->adapter->cmd_complete = true; |
61 | wake_up_interruptible(&priv->adapter->cmd_wait_q); | 63 | wake_up_interruptible(&priv->adapter->cmd_wait_q); |
62 | } | 64 | } |
65 | |||
66 | if (ogf == OGF) { | ||
67 | BT_DBG("vendor event skipped: ogf 0x%4.4x", ogf); | ||
68 | kfree_skb(skb); | ||
69 | return false; | ||
70 | } | ||
63 | } | 71 | } |
72 | |||
73 | return true; | ||
64 | } | 74 | } |
65 | EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); | 75 | EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); |
66 | 76 | ||