NFC: st21nfca: Add error messages for unexpected HCI events
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:47 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 27 Oct 2015 02:55:13 +0000 (03:55 +0100)
Potentially an unexpected HCI event may occur because of a
firmware bug. It could be transparent for the user but we should
at least log it.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfca/core.c
drivers/nfc/st21nfca/dep.c
drivers/nfc/st21nfca/se.c

index 6fc60bba4e917bb3dd97fae81a01e9d10b071fed..496ee7cc1f41f5156cba93e93c9877ceb865502b 100644 (file)
@@ -893,6 +893,8 @@ static int st21nfca_admin_event_received(struct nfc_hci_dev *hdev, u8 event,
                        }
                }
        break;
+       default:
+               nfc_err(&hdev->ndev->dev, "Unexpected event on admin gate\n");
        }
        kfree_skb(skb);
        return 0;
index c011712a4c5f28c5dcacef8b8686cf87ad04e753..798a32bbac5ddca479592857c74753bf84a5faf6 100644 (file)
@@ -435,6 +435,7 @@ int st21nfca_dep_event_received(struct nfc_hci_dev *hdev,
                        return r;
                return 0;
        default:
+               nfc_err(&hdev->ndev->dev, "Unexpected event on card f gate\n");
                return 1;
        }
        kfree_skb(skb);
index d3347c7e8c37ecc55adf726d9be16c5d02e7fed4..dd3e15c173530d52d0caa63d760b30a3c81bab26 100644 (file)
@@ -342,6 +342,7 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
                r = nfc_se_transaction(hdev->ndev, host, transaction);
                break;
        default:
+               nfc_err(&hdev->ndev->dev, "Unexpected event on connectivity gate\n");
                return 1;
        }
        kfree_skb(skb);
@@ -373,6 +374,9 @@ int st21nfca_apdu_reader_event_received(struct nfc_hci_dev *hdev,
                mod_timer(&info->se_info.bwi_timer, jiffies +
                                msecs_to_jiffies(info->se_info.wt_timeout));
                break;
+       default:
+               nfc_err(&hdev->ndev->dev, "Unexpected event on apdu reader gate\n");
+               return 1;
        }
 
 exit: