laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42781?usp=email )

Change subject: 7816fsm: state_chg before card_uart_tx in 
tpdu_s_procedure_action
......................................................................

7816fsm: state_chg before card_uart_tx in tpdu_s_procedure_action

State change must precede the TX to ensure we don't lose
TX_COMPLETE notifications that arrive at a bad time.

Change-Id: Id66f836452674209e25dc3ee4c37d616de30001b
---
M ccid_common/iso7816_fsm.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/ccid_common/iso7816_fsm.c b/ccid_common/iso7816_fsm.c
index c0ff1f0..4e4c2b1 100644
--- a/ccid_common/iso7816_fsm.c
+++ b/ccid_common/iso7816_fsm.c
@@ -1371,8 +1371,8 @@
                                delay_us(1);
                                gpio_set_pin_level(PIN_PB12, false);
 #endif
-                               card_uart_tx(ip->uart, msgb_l2(tfp->tpdu), 
msgb_l2len(tfp->tpdu), true);
                                osmo_fsm_inst_state_chg(fi, 
TPDU_S_TX_REMAINING, 0, 0);
+                               card_uart_tx(ip->uart, msgb_l2(tfp->tpdu), 
msgb_l2len(tfp->tpdu), true);
                        } else {
                                /* 7816-3 10.3.2 special case outgoing transfer 
0 means 256 */
                                int len_expected = tpduh->p3 == 0 ? 256 : 
tpduh->p3;
@@ -1391,8 +1391,8 @@
                        if (tfp->is_command) {
                                /* transmit *next*, not first byte */
                                OSMO_ASSERT(msgb_l3len(tfp->tpdu) >= 0);
-                               card_uart_tx(ip->uart, msgb_l3(tfp->tpdu), 1, 
false);
                                osmo_fsm_inst_state_chg(fi, TPDU_S_TX_SINGLE, 
0, 0);
+                               card_uart_tx(ip->uart, msgb_l3(tfp->tpdu), 1, 
false);
                        } else {
                                card_uart_set_rx_threshold(ip->uart, 1);
                                card_uart_ctrl(ip->uart, 
CUART_CTL_RX_TIMER_HINT, 1);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42781?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: Id66f836452674209e25dc3ee4c37d616de30001b
Gerrit-Change-Number: 42781
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>

Reply via email to