NFC: st-nci: Add error messages when an unexpected HCI event occurs
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:37 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 27 Oct 2015 02:55:10 +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 need to
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/st-nci/se.c

index 7ec4dba98a806cafe1a5f35e657bada696fd9e63..2812884847942a1590a9ff9848068348cdfcefb1 100644 (file)
@@ -280,6 +280,8 @@ static void st_nci_hci_admin_event_received(struct nci_dev *ndev,
                        }
                }
        break;
+       default:
+               nfc_err(&ndev->nfc_dev->dev, "Unexpected event on admin gate\n");
        }
 }
 
@@ -303,6 +305,9 @@ static int st_nci_hci_apdu_reader_event_received(struct nci_dev *ndev,
                mod_timer(&info->se_info.bwi_timer, jiffies +
                          msecs_to_jiffies(info->se_info.wt_timeout));
        break;
+       default:
+               nfc_err(&ndev->nfc_dev->dev, "Unexpected event on apdu reader gate\n");
+               return 1;
        }
 
        kfree_skb(skb);
@@ -357,6 +362,7 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,
                r = nfc_se_transaction(ndev->nfc_dev, host, transaction);
                break;
        default:
+               nfc_err(&ndev->nfc_dev->dev, "Unexpected event on connectivity gate\n");
                return 1;
        }
        kfree_skb(skb);