Bluetooth: Fix errors and warnings in L2CAP reported by checkpatch.pl
[safe/jmp/linux-2.6] / net / bluetooth / hci_event.c
index bf3fbf9..184ba0a 100644 (file)
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#ifndef CONFIG_BT_HCI_CORE_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 /* Handle HCI Event packets */
 
 static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
@@ -391,6 +386,35 @@ static void hci_cc_host_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
        hci_req_complete(hdev, status);
 }
 
+static void hci_cc_read_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_rp_read_ssp_mode *rp = (void *) skb->data;
+
+       BT_DBG("%s status 0x%x", hdev->name, rp->status);
+
+       if (rp->status)
+               return;
+
+       hdev->ssp_mode = rp->mode;
+}
+
+static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       __u8 status = *((__u8 *) skb->data);
+       void *sent;
+
+       BT_DBG("%s status 0x%x", hdev->name, status);
+
+       if (status)
+               return;
+
+       sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_MODE);
+       if (!sent)
+               return;
+
+       hdev->ssp_mode = *((__u8 *) sent);
+}
+
 static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_rp_read_local_version *rp = (void *) skb->data;
@@ -460,6 +484,15 @@ static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb
        if (hdev->features[4] & LMP_EV5)
                hdev->esco_type |= (ESCO_EV5);
 
+       if (hdev->features[5] & LMP_EDR_ESCO_2M)
+               hdev->esco_type |= (ESCO_2EV3);
+
+       if (hdev->features[5] & LMP_EDR_ESCO_3M)
+               hdev->esco_type |= (ESCO_3EV3);
+
+       if (hdev->features[5] & LMP_EDR_3S_ESCO)
+               hdev->esco_type |= (ESCO_2EV5 | ESCO_3EV5);
+
        BT_DBG("%s features 0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x", hdev->name,
                                        hdev->features[0], hdev->features[1],
                                        hdev->features[2], hdev->features[3],
@@ -590,11 +623,119 @@ static void hci_cs_add_sco(struct hci_dev *hdev, __u8 status)
        hci_dev_unlock(hdev);
 }
 
+static void hci_cs_auth_requested(struct hci_dev *hdev, __u8 status)
+{
+       struct hci_cp_auth_requested *cp;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status 0x%x", hdev->name, status);
+
+       if (!status)
+               return;
+
+       cp = hci_sent_cmd_data(hdev, HCI_OP_AUTH_REQUESTED);
+       if (!cp)
+               return;
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+       if (conn) {
+               if (conn->state == BT_CONFIG) {
+                       hci_proto_connect_cfm(conn, status);
+                       hci_conn_put(conn);
+               }
+       }
+
+       hci_dev_unlock(hdev);
+}
+
+static void hci_cs_set_conn_encrypt(struct hci_dev *hdev, __u8 status)
+{
+       struct hci_cp_set_conn_encrypt *cp;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status 0x%x", hdev->name, status);
+
+       if (!status)
+               return;
+
+       cp = hci_sent_cmd_data(hdev, HCI_OP_SET_CONN_ENCRYPT);
+       if (!cp)
+               return;
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+       if (conn) {
+               if (conn->state == BT_CONFIG) {
+                       hci_proto_connect_cfm(conn, status);
+                       hci_conn_put(conn);
+               }
+       }
+
+       hci_dev_unlock(hdev);
+}
+
 static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status)
 {
        BT_DBG("%s status 0x%x", hdev->name, status);
 }
 
+static void hci_cs_read_remote_features(struct hci_dev *hdev, __u8 status)
+{
+       struct hci_cp_read_remote_features *cp;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status 0x%x", hdev->name, status);
+
+       if (!status)
+               return;
+
+       cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_FEATURES);
+       if (!cp)
+               return;
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+       if (conn) {
+               if (conn->state == BT_CONFIG) {
+                       hci_proto_connect_cfm(conn, status);
+                       hci_conn_put(conn);
+               }
+       }
+
+       hci_dev_unlock(hdev);
+}
+
+static void hci_cs_read_remote_ext_features(struct hci_dev *hdev, __u8 status)
+{
+       struct hci_cp_read_remote_ext_features *cp;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status 0x%x", hdev->name, status);
+
+       if (!status)
+               return;
+
+       cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES);
+       if (!cp)
+               return;
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
+       if (conn) {
+               if (conn->state == BT_CONFIG) {
+                       hci_proto_connect_cfm(conn, status);
+                       hci_conn_put(conn);
+               }
+       }
+
+       hci_dev_unlock(hdev);
+}
+
 static void hci_cs_setup_sync_conn(struct hci_dev *hdev, __u8 status)
 {
        struct hci_cp_setup_sync_conn *cp;
@@ -707,6 +848,7 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
                memcpy(data.dev_class, info->dev_class, 3);
                data.clock_offset       = info->clock_offset;
                data.rssi               = 0x00;
+               data.ssp_mode           = 0x00;
                info++;
                hci_inquiry_cache_update(hdev, &data);
        }
@@ -724,12 +866,28 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
        hci_dev_lock(hdev);
 
        conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
-       if (!conn)
-               goto unlock;
+       if (!conn) {
+               if (ev->link_type != SCO_LINK)
+                       goto unlock;
+
+               conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr);
+               if (!conn)
+                       goto unlock;
+
+               conn->type = SCO_LINK;
+       }
 
        if (!ev->status) {
                conn->handle = __le16_to_cpu(ev->handle);
-               conn->state  = BT_CONNECTED;
+
+               if (conn->type == ACL_LINK) {
+                       conn->state = BT_CONFIG;
+                       hci_conn_hold(conn);
+                       conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+               } else
+                       conn->state = BT_CONNECTED;
+
+               hci_conn_add_sysfs(conn);
 
                if (test_bit(HCI_AUTH, &hdev->flags))
                        conn->link_mode |= HCI_LM_AUTH;
@@ -741,7 +899,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                if (conn->type == ACL_LINK) {
                        struct hci_cp_read_remote_features cp;
                        cp.handle = ev->handle;
-                       hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES, sizeof(cp), &cp);
+                       hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES,
+                                                       sizeof(cp), &cp);
                }
 
                /* Set packet type for incoming connection */
@@ -751,10 +910,6 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                        cp.pkt_type = cpu_to_le16(conn->pkt_type);
                        hci_send_cmd(hdev, HCI_OP_CHANGE_CONN_PTYPE,
                                                        sizeof(cp), &cp);
-               } else {
-                       /* Update disconnect timer */
-                       hci_conn_hold(conn);
-                       hci_conn_put(conn);
                }
        } else
                conn->state = BT_CLOSED;
@@ -774,9 +929,11 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                }
        }
 
-       hci_proto_connect_cfm(conn, ev->status);
-       if (ev->status)
+       if (ev->status) {
+               hci_proto_connect_cfm(conn, ev->status);
                hci_conn_del(conn);
+       } else if (ev->link_type != ACL_LINK)
+               hci_proto_connect_cfm(conn, ev->status);
 
 unlock:
        hci_dev_unlock(hdev);
@@ -796,10 +953,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
 
        if (mask & HCI_LM_ACCEPT) {
                /* Connection accepted */
+               struct inquiry_entry *ie;
                struct hci_conn *conn;
 
                hci_dev_lock(hdev);
 
+               if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr)))
+                       memcpy(ie->data.dev_class, ev->dev_class, 3);
+
                conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
                if (!conn) {
                        if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) {
@@ -866,7 +1027,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
        conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
        if (conn) {
                conn->state = BT_CLOSED;
-               hci_proto_disconn_ind(conn, ev->reason);
+
+               hci_proto_disconn_cfm(conn, ev->reason);
                hci_conn_del(conn);
        }
 
@@ -889,15 +1051,34 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 
                clear_bit(HCI_CONN_AUTH_PEND, &conn->pend);
 
-               hci_auth_cfm(conn, ev->status);
+               if (conn->state == BT_CONFIG) {
+                       if (!ev->status && hdev->ssp_mode > 0 &&
+                                                       conn->ssp_mode > 0) {
+                               struct hci_cp_set_conn_encrypt cp;
+                               cp.handle  = ev->handle;
+                               cp.encrypt = 0x01;
+                               hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT,
+                                                       sizeof(cp), &cp);
+                       } else {
+                               conn->state = BT_CONNECTED;
+                               hci_proto_connect_cfm(conn, ev->status);
+                               hci_conn_put(conn);
+                       }
+               } else {
+                       hci_auth_cfm(conn, ev->status);
+
+                       hci_conn_hold(conn);
+                       conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+                       hci_conn_put(conn);
+               }
 
                if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
                        if (!ev->status) {
                                struct hci_cp_set_conn_encrypt cp;
-                               cp.handle  = cpu_to_le16(conn->handle);
-                               cp.encrypt = 1;
-                               hci_send_cmd(conn->hdev,
-                                       HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), &cp);
+                               cp.handle  = ev->handle;
+                               cp.encrypt = 0x01;
+                               hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT,
+                                                       sizeof(cp), &cp);
                        } else {
                                clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
                                hci_encrypt_cfm(conn, ev->status, 0x00);
@@ -937,7 +1118,14 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
 
                clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
 
-               hci_encrypt_cfm(conn, ev->status, ev->encrypt);
+               if (conn->state == BT_CONFIG) {
+                       if (!ev->status)
+                               conn->state = BT_CONNECTED;
+
+                       hci_proto_connect_cfm(conn, ev->status);
+                       hci_conn_put(conn);
+               } else
+                       hci_encrypt_cfm(conn, ev->status, ev->encrypt);
        }
 
        hci_dev_unlock(hdev);
@@ -972,14 +1160,29 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff
 
        BT_DBG("%s status %d", hdev->name, ev->status);
 
-       if (ev->status)
-               return;
-
        hci_dev_lock(hdev);
 
        conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
-       if (conn)
-               memcpy(conn->features, ev->features, 8);
+       if (conn) {
+               if (!ev->status)
+                       memcpy(conn->features, ev->features, 8);
+
+               if (conn->state == BT_CONFIG) {
+                       if (!ev->status && lmp_ssp_capable(hdev) &&
+                                               lmp_ssp_capable(conn)) {
+                               struct hci_cp_read_remote_ext_features cp;
+                               cp.handle = ev->handle;
+                               cp.page = 0x01;
+                               hci_send_cmd(hdev,
+                                       HCI_OP_READ_REMOTE_EXT_FEATURES,
+                                                       sizeof(cp), &cp);
+                       } else {
+                               conn->state = BT_CONNECTED;
+                               hci_proto_connect_cfm(conn, ev->status);
+                               hci_conn_put(conn);
+                       }
+               }
+       }
 
        hci_dev_unlock(hdev);
 }
@@ -1080,6 +1283,14 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
                hci_cc_host_buffer_size(hdev, skb);
                break;
 
+       case HCI_OP_READ_SSP_MODE:
+               hci_cc_read_ssp_mode(hdev, skb);
+               break;
+
+       case HCI_OP_WRITE_SSP_MODE:
+               hci_cc_write_ssp_mode(hdev, skb);
+               break;
+
        case HCI_OP_READ_LOCAL_VERSION:
                hci_cc_read_local_version(hdev, skb);
                break;
@@ -1134,10 +1345,26 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
                hci_cs_add_sco(hdev, ev->status);
                break;
 
+       case HCI_OP_AUTH_REQUESTED:
+               hci_cs_auth_requested(hdev, ev->status);
+               break;
+
+       case HCI_OP_SET_CONN_ENCRYPT:
+               hci_cs_set_conn_encrypt(hdev, ev->status);
+               break;
+
        case HCI_OP_REMOTE_NAME_REQ:
                hci_cs_remote_name_req(hdev, ev->status);
                break;
 
+       case HCI_OP_READ_REMOTE_FEATURES:
+               hci_cs_read_remote_features(hdev, ev->status);
+               break;
+
+       case HCI_OP_READ_REMOTE_EXT_FEATURES:
+               hci_cs_read_remote_ext_features(hdev, ev->status);
+               break;
+
        case HCI_OP_SETUP_SYNC_CONN:
                hci_cs_setup_sync_conn(hdev, ev->status);
                break;
@@ -1258,7 +1485,21 @@ static inline void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb
 
 static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
+       struct hci_ev_pin_code_req *ev = (void *) skb->data;
+       struct hci_conn *conn;
+
        BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
+       if (conn && conn->state == BT_CONNECTED) {
+               hci_conn_hold(conn);
+               conn->disc_timeout = HCI_PAIRING_TIMEOUT;
+               hci_conn_put(conn);
+       }
+
+       hci_dev_unlock(hdev);
 }
 
 static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
@@ -1268,7 +1509,21 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff
 
 static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
+       struct hci_ev_link_key_notify *ev = (void *) skb->data;
+       struct hci_conn *conn;
+
        BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
+       if (conn) {
+               hci_conn_hold(conn);
+               conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+               hci_conn_put(conn);
+       }
+
+       hci_dev_unlock(hdev);
 }
 
 static inline void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *skb)
@@ -1349,6 +1604,7 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
                        memcpy(data.dev_class, info->dev_class, 3);
                        data.clock_offset       = info->clock_offset;
                        data.rssi               = info->rssi;
+                       data.ssp_mode           = 0x00;
                        info++;
                        hci_inquiry_cache_update(hdev, &data);
                }
@@ -1363,6 +1619,7 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
                        memcpy(data.dev_class, info->dev_class, 3);
                        data.clock_offset       = info->clock_offset;
                        data.rssi               = info->rssi;
+                       data.ssp_mode           = 0x00;
                        info++;
                        hci_inquiry_cache_update(hdev, &data);
                }
@@ -1373,7 +1630,41 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
 
 static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
+       struct hci_ev_remote_ext_features *ev = (void *) skb->data;
+       struct hci_conn *conn;
+
        BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
+       if (conn) {
+               if (!ev->status && ev->page == 0x01) {
+                       struct inquiry_entry *ie;
+
+                       if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst)))
+                               ie->data.ssp_mode = (ev->features[0] & 0x01);
+
+                       conn->ssp_mode = (ev->features[0] & 0x01);
+               }
+
+               if (conn->state == BT_CONFIG) {
+                       if (!ev->status && hdev->ssp_mode > 0 &&
+                                       conn->ssp_mode > 0 && conn->out &&
+                                       conn->sec_level != BT_SECURITY_SDP) {
+                               struct hci_cp_auth_requested cp;
+                               cp.handle = ev->handle;
+                               hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED,
+                                                       sizeof(cp), &cp);
+                       } else {
+                               conn->state = BT_CONNECTED;
+                               hci_proto_connect_cfm(conn, ev->status);
+                               hci_conn_put(conn);
+                       }
+               }
+       }
+
+       hci_dev_unlock(hdev);
 }
 
 static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
@@ -1397,11 +1688,28 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
                conn->type = SCO_LINK;
        }
 
-       if (!ev->status) {
+       switch (ev->status) {
+       case 0x00:
                conn->handle = __le16_to_cpu(ev->handle);
                conn->state  = BT_CONNECTED;
-       } else
+
+               hci_conn_add_sysfs(conn);
+               break;
+
+       case 0x1c:      /* SCO interval rejected */
+       case 0x1f:      /* Unspecified error */
+               if (conn->out && conn->attempt < 2) {
+                       conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
+                                       (hdev->esco_type & EDR_ESCO_MASK);
+                       hci_setup_sync(conn, conn->link->handle);
+                       goto unlock;
+               }
+               /* fall through */
+
+       default:
                conn->state = BT_CLOSED;
+               break;
+       }
 
        hci_proto_connect_cfm(conn, ev->status);
        if (ev->status)
@@ -1453,6 +1761,7 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
                memcpy(data.dev_class, info->dev_class, 3);
                data.clock_offset       = info->clock_offset;
                data.rssi               = info->rssi;
+               data.ssp_mode           = 0x01;
                info++;
                hci_inquiry_cache_update(hdev, &data);
        }
@@ -1460,6 +1769,53 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
        hci_dev_unlock(hdev);
 }
 
+static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_io_capa_request *ev = (void *) skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
+       if (conn)
+               hci_conn_hold(conn);
+
+       hci_dev_unlock(hdev);
+}
+
+static inline void hci_simple_pair_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_simple_pair_complete *ev = (void *) skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
+       if (conn)
+               hci_conn_put(conn);
+
+       hci_dev_unlock(hdev);
+}
+
+static inline void hci_remote_host_features_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+       struct hci_ev_remote_host_features *ev = (void *) skb->data;
+       struct inquiry_entry *ie;
+
+       BT_DBG("%s", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr)))
+               ie->data.ssp_mode = (ev->features[0] & 0x01);
+
+       hci_dev_unlock(hdev);
+}
+
 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
 {
        struct hci_event_hdr *hdr = (void *) skb->data;
@@ -1584,6 +1940,18 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
                hci_extended_inquiry_result_evt(hdev, skb);
                break;
 
+       case HCI_EV_IO_CAPA_REQUEST:
+               hci_io_capa_request_evt(hdev, skb);
+               break;
+
+       case HCI_EV_SIMPLE_PAIR_COMPLETE:
+               hci_simple_pair_complete_evt(hdev, skb);
+               break;
+
+       case HCI_EV_REMOTE_HOST_FEATURES:
+               hci_remote_host_features_evt(hdev, skb);
+               break;
+
        default:
                BT_DBG("%s event 0x%x", hdev->name, event);
                break;