aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wild <ewild@sysmocom.de>2021-08-08 04:14:38 +0200
committerEric Wild <ewild@sysmocom.de>2021-08-08 04:14:38 +0200
commit7ca68359f32929150295c2daa992d51a73afcbde (patch)
treeb5cd02184034f6bc8380202c7c7b51af20da5a86
parenta951c4ae025df33b8bc585430a20b014fc3fb695 (diff)
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
-rw-r--r--firmware/libcommon/source/card_emu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c
index 4b84039..debc658 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) {