Change in osmo-ccid-firmware[master]: ccid: support warm reset

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Hoernchen gerrit-no-reply at lists.osmocom.org
Thu Jul 30 21:23:36 UTC 2020


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/19471 )


Change subject: ccid: support warm reset
......................................................................

ccid: support warm reset

Change-Id: I4b0a119afcb37edb1d30badc85834165883a12b5
---
M ccid_common/ccid_slot_fsm.c
1 file changed, 26 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/71/19471/1

diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c
index dc90a38..13d1139 100644
--- a/ccid_common/ccid_slot_fsm.c
+++ b/ccid_common/ccid_slot_fsm.c
@@ -91,22 +91,33 @@
 	ss->seq = ipo->hdr.bSeq;
 	LOGPCS(cs, LOGL_DEBUG, "scheduling power-up\n");
 
-	/* FIXME: do this via a FSM? */
-	card_uart_ctrl(ss->cuart, CUART_CTL_RST, true);
-	osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_ACT_IND, NULL);
-	card_uart_ctrl(ss->cuart, CUART_CTL_POWER, true);
-	osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_POWER_UP_IND, NULL);
-	cs->icc_powered = true;
-	card_uart_ctrl(ss->cuart, CUART_CTL_CLOCK, true);
-#ifdef OCTSIMFWBUILD
-	delay_us(10000);
-#else
-	usleep(10000);
-#endif
+	if (! cs->icc_powered) {
+		/* FIXME: do this via a FSM? */
+		card_uart_ctrl(ss->cuart, CUART_CTL_RST, true);
+		osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_ACT_IND, NULL);
+		card_uart_ctrl(ss->cuart, CUART_CTL_POWER, true);
+		osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_POWER_UP_IND, NULL);
+		cs->icc_powered = true;
+		card_uart_ctrl(ss->cuart, CUART_CTL_CLOCK, true);
+	#ifdef OCTSIMFWBUILD
+		delay_us(10000);
+	#else
+		usleep(10000);
+	#endif
 
-	osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_REL_IND, NULL);
-	card_uart_ctrl(ss->cuart, CUART_CTL_RST, false);
-
+		osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_REL_IND, NULL);
+		card_uart_ctrl(ss->cuart, CUART_CTL_RST, false);
+	} else { /* warm reset */
+		card_uart_ctrl(ss->cuart, CUART_CTL_RST, true);
+		osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_ACT_IND, NULL);
+	#ifdef OCTSIMFWBUILD
+		delay_us(10000);
+	#else
+		usleep(10000);
+	#endif
+		osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_RESET_REL_IND, NULL);
+		card_uart_ctrl(ss->cuart, CUART_CTL_RST, false);
+	}
 	msgb_free(msg);
 	/* continues in iso_fsm_clot_user_cb once ATR is received */
 }

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I4b0a119afcb37edb1d30badc85834165883a12b5
Gerrit-Change-Number: 19471
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200730/52169203/attachment.htm>


More information about the gerrit-log mailing list