aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/hci
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-09-27 05:32:58 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-26 12:26:46 -0400
commite81076235b46189a776362ec5e4c6626bf1599ff (patch)
treef1623677ef0202907a94ef32ee52b928b9aa36f8 /net/nfc/hci
parentc40d17401f89f575a6ff5774abaa0838398b820c (diff)
NFC: Implement HCI DEP send and receive data
And implement the corresponding hooks for pn544. Signed-off-by: Arron Wang <arron.wang@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/hci')
-rw-r--r--net/nfc/hci/core.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 777deb84aa73..c2339c468d91 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -616,8 +616,8 @@ static int hci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
616 switch (target->hci_reader_gate) { 616 switch (target->hci_reader_gate) {
617 case NFC_HCI_RF_READER_A_GATE: 617 case NFC_HCI_RF_READER_A_GATE:
618 case NFC_HCI_RF_READER_B_GATE: 618 case NFC_HCI_RF_READER_B_GATE:
619 if (hdev->ops->data_exchange) { 619 if (hdev->ops->im_transceive) {
620 r = hdev->ops->data_exchange(hdev, target, skb, cb, 620 r = hdev->ops->im_transceive(hdev, target, skb, cb,
621 cb_context); 621 cb_context);
622 if (r <= 0) /* handled */ 622 if (r <= 0) /* handled */
623 break; 623 break;
@@ -634,8 +634,8 @@ static int hci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
634 skb->len, hci_transceive_cb, hdev); 634 skb->len, hci_transceive_cb, hdev);
635 break; 635 break;
636 default: 636 default:
637 if (hdev->ops->data_exchange) { 637 if (hdev->ops->im_transceive) {
638 r = hdev->ops->data_exchange(hdev, target, skb, cb, 638 r = hdev->ops->im_transceive(hdev, target, skb, cb,
639 cb_context); 639 cb_context);
640 if (r == 1) 640 if (r == 1)
641 r = -ENOTSUPP; 641 r = -ENOTSUPP;
@@ -650,6 +650,16 @@ static int hci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
650 return r; 650 return r;
651} 651}
652 652
653int hci_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
654{
655 struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
656
657 if (hdev->ops->tm_send)
658 return hdev->ops->tm_send(hdev, skb);
659 else
660 return -ENOTSUPP;
661}
662
653static int hci_check_presence(struct nfc_dev *nfc_dev, 663static int hci_check_presence(struct nfc_dev *nfc_dev,
654 struct nfc_target *target) 664 struct nfc_target *target)
655{ 665{
@@ -758,6 +768,7 @@ static struct nfc_ops hci_nfc_ops = {
758 .activate_target = hci_activate_target, 768 .activate_target = hci_activate_target,
759 .deactivate_target = hci_deactivate_target, 769 .deactivate_target = hci_deactivate_target,
760 .im_transceive = hci_transceive, 770 .im_transceive = hci_transceive,
771 .tm_send = hci_tm_send,
761 .check_presence = hci_check_presence, 772 .check_presence = hci_check_presence,
762}; 773};
763 774