aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@intel.com>2012-06-11 07:36:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:06 -0400
commit72b06f75fea45fa861f2e137bc94e56aab306c4b (patch)
tree472f0c25fd48b7b11aeaa4880e22af0f045e30d6 /net/nfc
parent1c215d79a18a22fc6c2a9ef8658d426bac492b58 (diff)
NFC: Implement HCP reaggregation allocation error case
We can now report an ENOMEM error up to the HCI layer. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/hci/core.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 1a009d554fd7..7d4fdbc06a98 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -717,12 +717,18 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev)
717} 717}
718EXPORT_SYMBOL(nfc_hci_get_clientdata); 718EXPORT_SYMBOL(nfc_hci_get_clientdata);
719 719
720void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err) 720static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err)
721{ 721{
722 /* TODO: lower layer has permanent failure. 722 /*
723 * TODO: lower layer has permanent failure.
723 * complete potential HCI command or send an empty tag discovered event 724 * complete potential HCI command or send an empty tag discovered event
724 */ 725 */
725} 726}
727
728void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err)
729{
730 nfc_hci_failure(hdev, err);
731}
726EXPORT_SYMBOL(nfc_hci_driver_failure); 732EXPORT_SYMBOL(nfc_hci_driver_failure);
727 733
728void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb) 734void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb)
@@ -755,9 +761,8 @@ void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb)
755 hcp_skb = nfc_alloc_recv_skb(NFC_HCI_HCP_PACKET_HEADER_LEN + 761 hcp_skb = nfc_alloc_recv_skb(NFC_HCI_HCP_PACKET_HEADER_LEN +
756 msg_len, GFP_KERNEL); 762 msg_len, GFP_KERNEL);
757 if (hcp_skb == NULL) { 763 if (hcp_skb == NULL) {
758 /* TODO ELa: cannot deliver HCP message. How to 764 nfc_hci_failure(hdev, -ENOMEM);
759 * propagate error up? 765 return;
760 */
761 } 766 }
762 767
763 *skb_put(hcp_skb, NFC_HCI_HCP_PACKET_HEADER_LEN) = pipe; 768 *skb_put(hcp_skb, NFC_HCI_HCP_PACKET_HEADER_LEN) = pipe;