From 7ca68359f32929150295c2daa992d51a73afcbde Mon Sep 17 00:00:00 2001 From: Eric Wild Date: Sun, 8 Aug 2021 04:14:38 +0200 Subject: [PATCH] cardem: fix spurious NULL bytes during transfers The "wait time extension timer" was apparently not being reset during normal tx operations, which led to occasional NULL (0x60) bytes getting injected into transfers, which in turn led to more tx bytes than what the reader side expects... The odd thing is that this was only noticeable with high baud rates, probably due to the very long default WT of 9600 ETU, and even then only because it led to weird ngff modem resets after benign transfers. Change-Id: I15b0b83b7d93b8e5589f3640bd6eb2fc82f93394 Related: SYS#5553 --- firmware/libcommon/source/card_emu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 4b840397..debc6585 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -922,6 +922,7 @@ static int tx_byte_tpdu(struct card_handle *ch) byte = msgb_pull_u8(msg); card_emu_uart_tx(ch->uart_chan, byte); + card_emu_uart_reset_wt(ch->uart_chan); /* this must happen _after_ the byte has been transmitted */ switch (ch->tpdu.state) {