Bluetooth: Decode btmrvl MODULE_BRINGUP_REG response correctly
authorBing Zhao <bzhao@marvell.com>
Wed, 3 Mar 2010 22:37:35 +0000 (14:37 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 May 2010 07:34:03 +0000 (09:34 +0200)
The MODULE_BRINGUP_REQ command response returns success with
either 0x00 or 0x0c.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmrvl_drv.h
drivers/bluetooth/btmrvl_main.c

index 204727586ee913896b1511e87ceffe3fcf8d6d88..da68c62a22cca897dd269b5eb87a264c240c3732 100644 (file)
@@ -88,8 +88,11 @@ struct btmrvl_private {
 #define BT_CMD_HOST_SLEEP_ENABLE       0x5A
 #define BT_CMD_MODULE_CFG_REQ          0x5B
 
-/* Sub-commands: Module Bringup/Shutdown Request */
+/* Sub-commands: Module Bringup/Shutdown Request/Response */
 #define MODULE_BRINGUP_REQ             0xF1
+#define MODULE_BROUGHT_UP              0x00
+#define MODULE_ALREADY_UP              0x0C
+
 #define MODULE_SHUTDOWN_REQ            0xF2
 
 #define BT_EVENT_POWER_STATE           0x20
index 49ec89cd354c524bc6a8d4fd1a0c91261b1c48d3..87d0d3d5ae548f2f49c7060268a206a546173e77 100644 (file)
@@ -112,8 +112,10 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
        case BT_CMD_MODULE_CFG_REQ:
                if (priv->btmrvl_dev.sendcmdflag &&
                                event->data[1] == MODULE_BRINGUP_REQ) {
-                       BT_DBG("EVENT:%s", (event->data[2]) ?
-                               "Bring-up failed" : "Bring-up succeed");
+                       BT_DBG("EVENT:%s",
+                               ((event->data[2] == MODULE_BROUGHT_UP) ||
+                               (event->data[2] == MODULE_ALREADY_UP)) ?
+                               "Bring-up succeed" : "Bring-up failed");
                } else if (priv->btmrvl_dev.sendcmdflag &&
                                event->data[1] == MODULE_SHUTDOWN_REQ) {
                        BT_DBG("EVENT:%s", (event->data[2]) ?