diff mbox

[31/33] NFC: Use communicate thru only for PaSoRi when trying to read Felica tags

Message ID 1341605393-32056-32-git-send-email-sameo@linux.intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Samuel Ortiz July 6, 2012, 8:09 p.m. UTC
Otherwise DATA_EXCHANGE seems to be just fine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/nfc/pn533.c |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 37786ff..84d8175 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1806,7 +1806,17 @@  static int pn533_build_tx_frame(struct pn533 *dev, struct sk_buff *skb,
 
 	if (target == true) {
 		switch (dev->device_type) {
-		case PN533_DEVICE_STD:
+		case PN533_DEVICE_PASORI:
+			if (dev->tgt_active_prot == NFC_PROTO_FELICA) {
+				skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN - 1);
+				out_frame = (struct pn533_frame *) skb->data;
+				pn533_tx_frame_init(out_frame,
+						    PN533_CMD_IN_COMM_THRU);
+
+				break;
+			}
+
+		default:
 			skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN);
 			out_frame = (struct pn533_frame *) skb->data;
 			pn533_tx_frame_init(out_frame,
@@ -1815,19 +1825,8 @@  static int pn533_build_tx_frame(struct pn533 *dev, struct sk_buff *skb,
 			memcpy(PN533_FRAME_CMD_PARAMS_PTR(out_frame),
 			       &tg, sizeof(u8));
 			out_frame->datalen += sizeof(u8);
-			break;
-
-		case PN533_DEVICE_PASORI:
-			skb_push(skb, PN533_CMD_DATAEXCH_HEAD_LEN - 1);
-			out_frame = (struct pn533_frame *) skb->data;
-			pn533_tx_frame_init(out_frame, PN533_CMD_IN_COMM_THRU);
 
 			break;
-
-		default:
-			nfc_dev_err(&dev->interface->dev,
-				    "Unknown device type %d", dev->device_type);
-			return -EINVAL;
 		}
 
 	} else {