mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-23 00:38:33 +03:00
card_emu: Avoid PTS related race-condition
We should not set the new Fi/Di values before we actually transmitted the PTSS PCK at the old baud rate first.
This commit is contained in:
@@ -440,8 +440,6 @@ static int tx_byte_pts(struct card_handle *ch)
|
|||||||
break;
|
break;
|
||||||
case PTS_S_WAIT_RESP_PCK:
|
case PTS_S_WAIT_RESP_PCK:
|
||||||
byte = ch->pts.resp[_PCK];
|
byte = ch->pts.resp[_PCK];
|
||||||
/* update baud rate generator with Fi/Di */
|
|
||||||
emu_update_fidi(ch);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TRACE_ERROR("get_byte_pts() in invalid state %u\r\n",
|
TRACE_ERROR("get_byte_pts() in invalid state %u\r\n",
|
||||||
@@ -456,6 +454,8 @@ static int tx_byte_pts(struct card_handle *ch)
|
|||||||
|
|
||||||
switch (ch->pts.state) {
|
switch (ch->pts.state) {
|
||||||
case PTS_S_WAIT_RESP_PCK:
|
case PTS_S_WAIT_RESP_PCK:
|
||||||
|
/* update baud rate generator with Fi/Di */
|
||||||
|
emu_update_fidi(ch);
|
||||||
/* Wait for the next TPDU */
|
/* Wait for the next TPDU */
|
||||||
card_set_state(ch, ISO_S_WAIT_TPDU);
|
card_set_state(ch, ISO_S_WAIT_TPDU);
|
||||||
set_pts_state(ch, PTS_S_WAIT_REQ_PTSS);
|
set_pts_state(ch, PTS_S_WAIT_REQ_PTSS);
|
||||||
|
|||||||
Reference in New Issue
Block a user