aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc/pn533.c
diff options
context:
space:
mode:
authorOlivier Guiter <olivier.guiter@linux.intel.com>2013-09-23 06:24:37 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-09-25 10:01:03 -0400
commit22953f9329ebf5cc81cefe250a079600145388b3 (patch)
tree9a39d88beb3eb8d8ea802c96272ba08113bfaeb4 /drivers/nfc/pn533.c
parent2bed27851767d93b5d2823eee110857f350a9fbe (diff)
NFC: pn533: Add MI/TG bits only when in Initiator mode
The fragmentation routine (used to split big frames) could be used in target or initiator mode (TgSetMetaData vs InDataExchange), but the MI/TG bytes are not needed in target mode (TgSetMetaData), so we add a check on the mode Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/pn533.c')
-rw-r--r--drivers/nfc/pn533.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 75bffd8bb3eb..0b7e928ceb3d 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -2504,14 +2504,17 @@ static int pn533_fill_fragment_skbs(struct pn533 *dev, struct sk_buff *skb)
2504 break; 2504 break;
2505 } 2505 }
2506 2506
2507 /* Reserve the TG/MI byte */ 2507 if (!dev->tgt_mode) {
2508 skb_reserve(frag, 1); 2508 /* Reserve the TG/MI byte */
2509 2509 skb_reserve(frag, 1);
2510 /* MI + TG */ 2510
2511 if (frag_size == PN533_CMD_DATAFRAME_MAXLEN) 2511 /* MI + TG */
2512 *skb_push(frag, sizeof(u8)) = (PN533_CMD_MI_MASK | 1); 2512 if (frag_size == PN533_CMD_DATAFRAME_MAXLEN)
2513 else 2513 *skb_push(frag, sizeof(u8)) =
2514 *skb_push(frag, sizeof(u8)) = 1; /* TG */ 2514 (PN533_CMD_MI_MASK | 1);
2515 else
2516 *skb_push(frag, sizeof(u8)) = 1; /* TG */
2517 }
2515 2518
2516 memcpy(skb_put(frag, frag_size), skb->data, frag_size); 2519 memcpy(skb_put(frag, frag_size), skb->data, frag_size);
2517 2520