summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/st-nci
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-10-25 22:54:37 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-10-27 03:55:10 +0100
commit2b5dbe089f619f995faf2fe6beb7efb705eed302 (patch)
tree5c81bd052da209fe154e3b13ee97bc7aaedd680b /drivers/nfc/st-nci
parentNFC: st-nci: Add support for proprietary commands (diff)
downloadlinux-2b5dbe089f619f995faf2fe6beb7efb705eed302.tar.xz
linux-2b5dbe089f619f995faf2fe6beb7efb705eed302.zip
NFC: st-nci: Add error messages when an unexpected HCI event occurs
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>
Diffstat (limited to 'drivers/nfc/st-nci')
-rw-r--r--drivers/nfc/st-nci/se.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nfc/st-nci/se.c b/drivers/nfc/st-nci/se.c
index 7ec4dba98a80..281288484794 100644
--- a/drivers/nfc/st-nci/se.c
+++ b/drivers/nfc/st-nci/se.c
@@ -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);