2014-03-21 03:05:44

by Bing Zhao

[permalink] [raw]
Subject: [PATCH] Bluetooth: btmrvl: don't consume all vendor specific events

From: Amitkumar Karwar <[email protected]>

If vendor specific HCI commands are received from application,
we should send corresponding events to stack.
These events should be consumed in driver, only if they are for
the internal HCI commands generated by driver.

This patch fixes the vendor command 0x3f stuck problem with
above mentioned change. For example,

hcitool cmd 3f 22 fe 06 22 21 20 43 50 00

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Bing Zhao <[email protected]>
---
drivers/bluetooth/btmrvl_main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 1e0320a..2c4997c 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -59,12 +59,13 @@ bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb)
priv->btmrvl_dev.sendcmdflag = false;
priv->adapter->cmd_complete = true;
wake_up_interruptible(&priv->adapter->cmd_wait_q);
- }

- if (hci_opcode_ogf(opcode) == 0x3F) {
- BT_DBG("vendor event skipped: opcode=%#4.4x", opcode);
- kfree_skb(skb);
- return false;
+ if (hci_opcode_ogf(opcode) == 0x3F) {
+ BT_DBG("vendor event skipped: opcode=%#4.4x",
+ opcode);
+ kfree_skb(skb);
+ return false;
+ }
}
}

--
1.8.2.3


2014-03-21 03:30:05

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: btmrvl: don't consume all vendor specific events

Hi Bing,

> If vendor specific HCI commands are received from application,
> we should send corresponding events to stack.
> These events should be consumed in driver, only if they are for
> the internal HCI commands generated by driver.
>
> This patch fixes the vendor command 0x3f stuck problem with
> above mentioned change. For example,
>
> hcitool cmd 3f 22 fe 06 22 21 20 43 50 00
>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> Signed-off-by: Bing Zhao <[email protected]>
> ---
> drivers/bluetooth/btmrvl_main.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel