Change in osmo-ccid-firmware[master]: slot fsm: fake ccid setparameter response

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
Sat Nov 27 12:15:34 UTC 2021


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


Change subject: slot fsm: fake ccid setparameter response
......................................................................

slot fsm: fake ccid setparameter response

This secretly disables the PPS exchange to set a different baud rate and
ensures proper multislot operation at the default rate @ 2.5Mhz.

Change-Id: I72bd2bbabe55c00e771626d2e473f6f8e88793d2
---
M ccid_common/ccid_slot_fsm.c
1 file changed, 16 insertions(+), 0 deletions(-)



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

diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c
index f77081b..5401bf3 100644
--- a/ccid_common/ccid_slot_fsm.c
+++ b/ccid_common/ccid_slot_fsm.c
@@ -32,6 +32,8 @@
 #include "iso7816_fsm.h"
 #include "iso7816_3.h"
 
+#define FAKE_CCID_SETPARAMETERS
+
 struct iso_fsm_slot {
 	/* CCID slot above us */
 	struct ccid_slot *cs;
@@ -280,11 +282,20 @@
 		 * - after ATR while card is idle
 		 * - after PPS while card is idle
 		 */
+#ifndef FAKE_CCID_SETPARAMETERS
 		card_uart_ctrl(ss->cuart, CUART_CTL_SET_CLOCK_FREQ, fmax);
 		card_uart_ctrl(ss->cuart, CUART_CTL_SET_FD, F/D);
 		card_uart_ctrl(ss->cuart, CUART_CTL_WTIME, cs->proposed_pars.t0.waiting_integer * 960 * D_or_one);
 
 		cs->pars = cs->proposed_pars;
+#else
+		//card_uart_ctrl(ss->cuart, CUART_CTL_SET_CLOCK_FREQ, fmax);
+		card_uart_ctrl(ss->cuart, CUART_CTL_SET_FD, F/D);
+		//card_uart_ctrl(ss->cuart, CUART_CTL_WTIME, cs->proposed_pars.t0.waiting_integer);
+
+		cs->pars.fi = cs->proposed_pars.fi;
+		cs->pars.di = cs->proposed_pars.di;
+#endif
 		resp = ccid_gen_parameters_t0(cs, ss->seq, CCID_CMD_STATUS_OK, 0);
 
 		ccid_slot_send_unbusy(cs, resp);
@@ -408,8 +419,13 @@
 
 	LOGPCS(cs, LOGL_DEBUG, "scheduling PPS transfer, PPS1: %2x\n", PPS1);
 
+#if FAKE_CCID_SETPARAMETERS
+	ccid_slot_send_unbusy(cs, ccid_gen_parameters_t0(cs, ss->seq, CCID_CMD_STATUS_OK, 0));
+#else
 	/* pass PPS1 instead of msgb */
 	osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_XCEIVE_PPS_CMD, (void*)PPS1);
+#endif
+
 	/* continues in iso_fsm_clot_user_cb once response/error/timeout is received */
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/26400
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: I72bd2bbabe55c00e771626d2e473f6f8e88793d2
Gerrit-Change-Number: 26400
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/20211127/43a40dda/attachment.htm>


More information about the gerrit-log mailing list