aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-06-13 06:35:44 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-06-18 23:19:11 -0400
commitea1e76a3f92f8565d395c549b9ca836c7eaa44b9 (patch)
treeda2abc4751944cc6fa5d6c584308dacaed8b6bf3 /drivers/bluetooth
parentf960727e6c98a36018029c0512aa03f1c5faa914 (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')
-rw-r--r--drivers/bluetooth/btmrvl_drv.h2
-rw-r--r--drivers/bluetooth/btmrvl_main.c14
-rw-r--r--drivers/bluetooth/btmrvl_sdio.c8
3 files changed, 18 insertions, 6 deletions
diff --git a/drivers/bluetooth/btmrvl_drv.h b/drivers/bluetooth/btmrvl_drv.h
index 94f2d65131c4..27068d149380 100644
--- a/drivers/bluetooth/btmrvl_drv.h
+++ b/drivers/bluetooth/btmrvl_drv.h
@@ -136,7 +136,7 @@ int btmrvl_remove_card(struct btmrvl_private *priv);
136 136
137void btmrvl_interrupt(struct btmrvl_private *priv); 137void btmrvl_interrupt(struct btmrvl_private *priv);
138 138
139void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); 139bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb);
140int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); 140int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb);
141 141
142int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); 142int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd);
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}
45EXPORT_SYMBOL_GPL(btmrvl_interrupt); 45EXPORT_SYMBOL_GPL(btmrvl_interrupt);
46 46
47void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) 47bool 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}
65EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); 75EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt);
66 76
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index a853244e7fd7..0cd61d9f07cd 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -562,10 +562,12 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
562 skb_put(skb, buf_len); 562 skb_put(skb, buf_len);
563 skb_pull(skb, SDIO_HEADER_LEN); 563 skb_pull(skb, SDIO_HEADER_LEN);
564 564
565 if (type == HCI_EVENT_PKT) 565 if (type == HCI_EVENT_PKT) {
566 btmrvl_check_evtpkt(priv, skb); 566 if (btmrvl_check_evtpkt(priv, skb))
567 hci_recv_frame(skb);
568 } else
569 hci_recv_frame(skb);
567 570
568 hci_recv_frame(skb);
569 hdev->stat.byte_rx += buf_len; 571 hdev->stat.byte_rx += buf_len;
570 break; 572 break;
571 573