提交 22953f93 编写于 作者: O Olivier Guiter 提交者: Samuel Ortiz

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: NOlivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 2bed2785
......@@ -2504,14 +2504,17 @@ static int pn533_fill_fragment_skbs(struct pn533 *dev, struct sk_buff *skb)
break;
}
if (!dev->tgt_mode) {
/* Reserve the TG/MI byte */
skb_reserve(frag, 1);
/* MI + TG */
if (frag_size == PN533_CMD_DATAFRAME_MAXLEN)
*skb_push(frag, sizeof(u8)) = (PN533_CMD_MI_MASK | 1);
*skb_push(frag, sizeof(u8)) =
(PN533_CMD_MI_MASK | 1);
else
*skb_push(frag, sizeof(u8)) = 1; /* TG */
}
memcpy(skb_put(frag, frag_size), skb->data, frag_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册