From patchwork Fri Jul 6 20:09:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Ortiz X-Patchwork-Id: 1167501 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6A85C40135 for ; Fri, 6 Jul 2012 20:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757514Ab2GFUAf (ORCPT ); Fri, 6 Jul 2012 16:00:35 -0400 Received: from mga09.intel.com ([134.134.136.24]:23801 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108Ab2GFUAd (ORCPT ); Fri, 6 Jul 2012 16:00:33 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 06 Jul 2012 13:00:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="scan'208";a="162265957" Received: from unknown (HELO sortiz-mobl) ([10.252.120.212]) by orsmga001.jf.intel.com with ESMTP; 06 Jul 2012 13:00:30 -0700 From: Samuel Ortiz To: "John W. Linville" Cc: Lauro Ramos Venancio , Aloisio Almeida Jr , Ilan Elias , linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, Samuel Ortiz Subject: [PATCH 31/33] NFC: Use communicate thru only for PaSoRi when trying to read Felica tags Date: Fri, 6 Jul 2012 22:09:51 +0200 Message-Id: <1341605393-32056-32-git-send-email-sameo@linux.intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1341605393-32056-1-git-send-email-sameo@linux.intel.com> References: <1341605393-32056-1-git-send-email-sameo@linux.intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Otherwise DATA_EXCHANGE seems to be just fine. Signed-off-by: Samuel Ortiz --- drivers/nfc/pn533.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) 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 {