lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in osmo-remsim[master]: remsim_client: add support to set sim presence pin polarity
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/36983?usp=email ) Change subject: remsim_client: add support to set sim presence pin polarity ...................................................................... remsim_client: add support to set sim presence pin polarity The sim presence pin allows the simtrace2 to inform the modem about the presence of the simcard. On a generic simcard slot a button is pressed by the simcard which generate a high or low voltage level. Even there are specifications of minipcie or ngff defining this signal, certain modems don't follow the specification and require a different signal level. Change-Id: Iaa61967d2e8cd5c2269b73f4e65b42072e0ec513 --- M TODO-RELEASE M configure.ac M src/client/Makefile.am M src/client/client.h M src/client/remsim_client_main.c M src/client/user_simtrace2.c 6 files changed, 44 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/83/36983/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 4a35f50..7aeffd4 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmocore > 1.9.0 working (compiling) gsmtap_inst_fd2() +libosmo-simtrace2 >= 0.9.0 required to compile (sim presence polarity) diff --git a/configure.ac b/configure.ac index 0529ff2..570b042 100644 --- a/configure.ac +++ b/configure.ac @@ -65,7 +65,7 @@ if test "$osmo_ac_build_client_st2" = "yes"; then AC_DEFINE(BUILD_CLIENT_ST2, 1, [Define if we want to build osmo-remsim-client-st2]) PKG_CHECK_MODULES(OSMOUSB, libosmousb >= 1.4.0) - PKG_CHECK_MODULES(OSMOSIMTRACE2, libosmo-simtrace2 >= 0.8.0) + PKG_CHECK_MODULES(OSMOSIMTRACE2, libosmo-simtrace2 >= 0.9.0) PKG_CHECK_MODULES(USB, libusb-1.0) fi AM_CONDITIONAL(BUILD_CLIENT_ST2, test "x$osmo_ac_build_client_st2" = "xyes") diff --git a/src/client/Makefile.am b/src/client/Makefile.am index b4d5bd5..f158424 100644 --- a/src/client/Makefile.am +++ b/src/client/Makefile.am @@ -32,7 +32,7 @@ bin_PROGRAMS += osmo-remsim-client-st2 osmo_remsim_client_st2_SOURCES = user_simtrace2.c remsim_client_main.c \ remsim_client.c main_fsm.c ../rspro_client_fsm.c ../debug.c -osmo_remsim_client_st2_CPPFLAGS = -DUSB_SUPPORT +osmo_remsim_client_st2_CPPFLAGS = -DUSB_SUPPORT -DSIMTRACE_SUPPORT osmo_remsim_client_st2_CFLAGS = $(AM_CFLAGS) osmo_remsim_client_st2_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ $(OSMOUSB_LIBS) $(OSMOSIMTRACE2_LIBS) \ diff --git a/src/client/client.h b/src/client/client.h index 8fcbcb3..df95312 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -86,6 +86,13 @@ int addr; char *path; } usb; + + /* only valid for simtrace2 devices */ + struct { + /* allow to define sim presence pin behaviour */ + bool presence_valid; + bool presence_pol; + } simtrace; }; struct bankd_client { diff --git a/src/client/remsim_client_main.c b/src/client/remsim_client_main.c index 372cc92..2f9b8e0 100644 --- a/src/client/remsim_client_main.c +++ b/src/client/remsim_client_main.c @@ -36,6 +36,9 @@ " -r --atr-ignore-rspro Ignore any ATR from bankd; use only ATR given by -a)\n" " -e --event-script <path> event script to be called by client\n" " -L --disable-color Disable colors for logging to stderr\n" +#ifdef SIMTRACE_SUPPORT + " -Z --set-sim-presence <0-1> Define the presence pin behaviour (only supported on some boards)\n" +#endif #ifdef USB_SUPPORT " -V --usb-vendor VENDOR_ID\n" " -P --usb-product PRODUCT_ID\n" @@ -79,6 +82,9 @@ }; c = getopt_long(argc, argv, "hvd:i:p:c:n:a:re:L" +#ifdef SIMTRACE_SUPPORT + "Z:" +#endif #ifdef USB_SUPPORT "V:P:C:I:S:A:H:" #endif @@ -128,6 +134,12 @@ case 'L': log_set_use_color(osmo_stderr_target, 0); break; +#ifdef SIMTRACE_SUPPORT + case 'Z': + cfg->simtrace.presence_valid = true; + cfg->simtrace.presence_pol = atoi(optarg); + break; +#endif #ifdef USB_SUPPORT case 'V': cfg->usb.vendor_id = strtol(optarg, NULL, 16); diff --git a/src/client/user_simtrace2.c b/src/client/user_simtrace2.c index 8dd3423..3bc32e2 100644 --- a/src/client/user_simtrace2.c +++ b/src/client/user_simtrace2.c @@ -396,6 +396,7 @@ struct osmo_st2_transport *transp; struct osmo_st2_cardem_inst *ci; struct client_config *cfg = bc->cfg; + struct cardemu_usb_msg_config cardem_config = { .features = CEMU_FEAT_F_STATUS_IRQ }; int rc, i; rc = osmo_libusb_init(NULL); @@ -456,8 +457,12 @@ for (i = 0; i < 4; i++) allocate_and_submit_in(ci); - /* request firmware to generate STATUS on IRQ endpoint */ - osmo_st2_cardem_request_config(ci, CEMU_FEAT_F_STATUS_IRQ); + /* request firmware to generate STATUS on IRQ endpoint, set presence polarity */ + if (cfg->simtrace.presence_valid) { + cardem_config.pres_pol = cfg->simtrace.presence_pol ? CEMU_CONFIG_PRES_POL_PRES_H : 0; + cardem_config.pres_pol |= CEMU_CONFIG_PRES_POL_VALID; + } + osmo_st2_cardem_request_config2(ci, &cardem_config); while (1) { osmo_select_main(0); -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/36983?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: Iaa61967d2e8cd5c2269b73f4e65b42072e0ec513 Gerrit-Change-Number: 36983 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-epdg[master]: README.md: fix copy-pasted 'osmo-bsc' and a broken link
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36968?usp=email ) Change subject: README.md: fix copy-pasted 'osmo-bsc' and a broken link ...................................................................... README.md: fix copy-pasted 'osmo-bsc' and a broken link Change-Id: I760db277ee682298d8c7a4d11cf68c86d94fe368 --- M README.md 1 file changed, 12 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified lynxis lazus: Looks good to me, approved diff --git a/README.md b/README.md index bcd616b..4fa1c15 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ GIT Repository -------------- -You can clone from the official osmo-bsc.git repository using +You can clone from the official osmo-epdg.git repository using git clone https://gitea.osmocom.org/erlang/osmo-epdg @@ -52,8 +52,8 @@ <https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for more details -The current patch queue for osmo-bsc can be seen at -<https://gerrit.osmocom.org/#/q/project:osmo-epdg+status:open> +The current patch queue for osmo-epdg can be seen at +<https://gerrit.osmocom.org/#/q/project:erlang/osmo-epdg+status:open> Building -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36968?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I760db277ee682298d8c7a4d11cf68c86d94fe368 Gerrit-Change-Number: 36968 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
[S] Change in simtrace2[master]: dissector: add support for sim polarity
by lynxis lazus 03 Jun '24

03 Jun '24
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email to look at the new patch set (#3). Change subject: dissector: add support for sim polarity ...................................................................... dissector: add support for sim polarity Needs testing. Related: SYS#6946 Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af --- M contrib/simtrace.lua 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/36980/3 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af Gerrit-Change-Number: 36980 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in simtrace2[master]: firmware: allow to change the sim presence pin polarity
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/simtrace2/+/36981?usp=email ) Change subject: firmware: allow to change the sim presence pin polarity ...................................................................... firmware: allow to change the sim presence pin polarity The sim presence pin allows the simtrace2 to inform the modem about the presence of the simcard. On a generic simcard slot a button is pressed by the simcard which generate a high or low voltage level. Even there are specifications of minipcie or ngff defining this signal, certain modems behave different. Certain modems require different signals from the specification. Extend the usb protocol to set the behaviour at runtime. Related: SYS#6946 Change-Id: I77118114ba873fdf0778137402888b40f2442456 --- M TODO-RELEASE M firmware/libcommon/include/simtrace.h M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c 5 files changed, 75 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/36981/2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36981?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I77118114ba873fdf0778137402888b40f2442456 Gerrit-Change-Number: 36981 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in simtrace2[master]: dissector: add support for sim polarity
by lynxis lazus 03 Jun '24

03 Jun '24
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email to look at the new patch set (#2). Change subject: dissector: add support for sim polarity ...................................................................... dissector: add support for sim polarity Needs testing: Related: SYS#6946 Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af --- M contrib/simtrace.lua 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/36980/2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af Gerrit-Change-Number: 36980 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in simtrace2[master]: simtrace2-cardem-pcsc: allow to set sim presence polarity
by lynxis lazus 03 Jun '24

03 Jun '24
Attention is currently required from: lynxis lazus. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/simtrace2/+/36982?usp=email to look at the new patch set (#2). Change subject: simtrace2-cardem-pcsc: allow to set sim presence polarity ...................................................................... simtrace2-cardem-pcsc: allow to set sim presence polarity Add api call osmo_st2_cardem_request_config2(struct cardemu_usb_msg_config *) which contains a full cardemu_usb_msg_config. Related: SYS#6946 Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59 --- M TODO-RELEASE M host/include/osmocom/simtrace2/simtrace2_api.h M host/lib/simtrace2_api.c M host/src/simtrace2-cardem-pcsc.c 4 files changed, 41 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/36982/2 -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36982?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59 Gerrit-Change-Number: 36982 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in simtrace2[master]: simtrace2-cardem-pcsc: allow to set sim presence polarity
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/36982?usp=email ) Change subject: simtrace2-cardem-pcsc: allow to set sim presence polarity ...................................................................... simtrace2-cardem-pcsc: allow to set sim presence polarity Add api call osmo_st2_cardem_request_config2(struct cardemu_usb_msg_config *) which contains a full cardemu_usb_msg_config. Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59 --- M TODO-RELEASE M host/include/osmocom/simtrace2/simtrace2_api.h M host/lib/simtrace2_api.c M host/src/simtrace2-cardem-pcsc.c 4 files changed, 40 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/36982/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index fb35723..3b33942 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line simtrace2 API/ABI change osmo_st2_transport new member simtrace2 API/ABI change cardemu_usb_msg_config new member +simtrace2 API/ABI change add function osmo_st2_cardem_request_config2() diff --git a/host/include/osmocom/simtrace2/simtrace2_api.h b/host/include/osmocom/simtrace2/simtrace2_api.h index d658d16..a29389c 100644 --- a/host/include/osmocom/simtrace2/simtrace2_api.h +++ b/host/include/osmocom/simtrace2/simtrace2_api.h @@ -41,6 +41,8 @@ void *priv; }; +struct cardemu_usb_msg_config; + int osmo_st2_slot_tx_msg(struct osmo_st2_slot *slot, struct msgb *msg, uint8_t msg_class, uint8_t msg_type); @@ -53,7 +55,7 @@ int osmo_st2_cardem_request_set_atr(struct osmo_st2_cardem_inst *ci, const uint8_t *atr, unsigned int atr_len); int osmo_st2_cardem_request_config(struct osmo_st2_cardem_inst *ci, uint32_t features); - +int osmo_st2_cardem_request_config2(struct osmo_st2_cardem_inst *ci, const struct cardemu_usb_msg_config *config); int osmo_st2_modem_reset_pulse(struct osmo_st2_slot *slot, uint16_t duration_ms); int osmo_st2_modem_reset_active(struct osmo_st2_slot *slot); diff --git a/host/lib/simtrace2_api.c b/host/lib/simtrace2_api.c index 4ad7eb7..37be08a 100644 --- a/host/lib/simtrace2_api.c +++ b/host/lib/simtrace2_api.c @@ -272,6 +272,21 @@ return osmo_st2_slot_tx_msg(ci->slot, msg, SIMTRACE_MSGC_CARDEM, SIMTRACE_MSGT_BD_CEMU_CONFIG); } +/* user_cfg is in host byte order. */ +int osmo_st2_cardem_request_config2(struct osmo_st2_cardem_inst *ci, const struct cardemu_usb_msg_config *user_cfg) +{ + struct msgb *msg = st_msgb_alloc(); + struct cardemu_usb_msg_config *tx_cfg; + + tx_cfg = (struct cardemu_usb_msg_config *) msgb_put(msg, sizeof(*tx_cfg)); + + LOGSLOT(ci->slot, LOGL_NOTICE, "<= %s(features=%08x)\n", __func__, tx_cfg->features); + memcpy(tx_cfg, user_cfg, sizeof(*tx_cfg)); + osmo_store32le(user_cfg->features, &tx_cfg->features); + + return osmo_st2_slot_tx_msg(ci->slot, msg, SIMTRACE_MSGC_CARDEM, SIMTRACE_MSGT_BD_CEMU_CONFIG); +} + /*********************************************************************** * Modem Control protocol ***********************************************************************/ diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c index 4acf268..f26698e 100644 --- a/host/src/simtrace2-cardem-pcsc.c +++ b/host/src/simtrace2-cardem-pcsc.c @@ -413,6 +413,7 @@ "\t-S\t--usb-altsetting ALTSETTING_ID\n" "\t-A\t--usb-address\tADDRESS\n" "\t-H\t--usb-path\tPATH\n" + "\t-Z\t--set-sim-presence\t<0/1>\n" "\n" ); } @@ -431,6 +432,7 @@ { "usb-altsetting", 1, 0, 'S' }, { "usb-address", 1, 0, 'A' }, { "usb-path", 1, 0, 'H' }, + { "set-sim-presence", 1, 0, 'Z' }, { NULL, 0, 0, 0 } }; @@ -487,6 +489,7 @@ char *path = NULL; struct osim_reader_hdl *reader; struct osim_card_hdl *card; + struct cardemu_usb_msg_config cardem_config = { .features = CEMU_FEAT_F_STATUS_IRQ }; print_welcome(); @@ -509,7 +512,7 @@ while (1) { int option_index = 0; - c = getopt_long(argc, argv, "hi:V:P:C:I:S:A:H:akn:t:", opts, &option_index); + c = getopt_long(argc, argv, "hi:V:P:C:I:S:A:H:akn:t:Z:", opts, &option_index); if (c == -1) break; switch (c) { @@ -553,6 +556,10 @@ case 'H': path = optarg; break; + case 'Z': + cardem_config.pres_pol = atoi(optarg) ? CEMU_CONFIG_PRES_POL_PRES_H : 0; + cardem_config.pres_pol |= CEMU_CONFIG_PRES_POL_VALID; + break; } } @@ -636,7 +643,7 @@ allocate_and_submit_in(ci); /* request firmware to generate STATUS on IRQ endpoint */ - osmo_st2_cardem_request_config(ci, CEMU_FEAT_F_STATUS_IRQ); + osmo_st2_cardem_request_config2(ci, &cardem_config); /* simulate card-insert to modem (owhw, not qmod) */ osmo_st2_cardem_request_card_insert(ci, true); -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36982?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59 Gerrit-Change-Number: 36982 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in simtrace2[master]: dissector: add support for sim polarity
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email ) Change subject: dissector: add support for sim polarity ...................................................................... dissector: add support for sim polarity Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af --- M contrib/simtrace.lua 1 file changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/36980/1 diff --git a/contrib/simtrace.lua b/contrib/simtrace.lua index 9015085..2a4a7bc 100644 --- a/contrib/simtrace.lua +++ b/contrib/simtrace.lua @@ -58,6 +58,7 @@ local hf_cemu_cfg_features = ProtoField.uint32("usb_simtrace.cemu_cfg.features.status_irq", "CardEm Features", base.HEX) local hf_cemu_cfg_slot_mux_nr = ProtoField.uint32("usb_simtrace.cemu_cfg.features.slot_mux_nr", "CardEm Slot Mux Nr", base.DEC) +local hf_cemu_cfg_presence_polarity = ProtoField.uint8("usb_simtrace.cemu_cfg.features.presence_polarity", "Sim presence polarity", base.DEC) local card_insert_types = { [0x00] = "not inserted", @@ -71,6 +72,9 @@ local CEMU_STATUS_F_CARD_INSERT = ProtoField.uint32("usb_simtrace.CEMU_STATUS.F_CARD_INSERT", "CARD_INSERT", base.HEX_DEC, NULL, 0x00000008) local CEMU_STATUS_F_RESET_ACTIVE = ProtoField.uint32("usb_simtrace.CEMU_STATUS.F_RESET_ACTIVE", "RESET_ACTIVE", base.HEX_DEC, NULL, 0x00000010) +local CEMU_CONFIG_PRES_POL_PRES_H = ProtoField.uint32("usb_simtrace.CEMU_CONFIG.PRES_POL_PRES_H", "PRESENCE_HIGH", base.HEX_DEC, NULL, 0x00000001) +local CEMU_CONFIG_PRES_POL_VALID = ProtoField.uint32("usb_simtrace.CEMU_CONFIG.PRES_POL_VALID", "PRESENCE_VALID", base.HEX_DEC, NULL, 0x00000002) + local modem_reset_types = { [0x00] = "de-assert", [0x01] = "assert", @@ -89,9 +93,10 @@ msgtype, seqnr, slotnr, reserved, payloadlen, payload, pb_and_rx, pb_and_tx, final, tpdu_hdr, rxtxdatalen, rxtxdata, CEMU_STATUS_F_VCC_PRESENT, CEMU_STATUS_F_CLK_ACTIVE, CEMU_STATUS_F_RCEMU_ACTIVE, CEMU_STATUS_F_CARD_INSERT, CEMU_STATUS_F_RESET_ACTIVE, + CEMU_CONFIG_PRES_POL_PRES_H, CEMU_CONFIG_PRES_POL_VALID, modem_reset_status, modem_reset_len, hf_pts_len, hf_pts_req, hf_pts_resp, - hf_cemu_cfg_features, hf_cemu_cfg_slot_mux_nr, + hf_cemu_cfg_features, hf_cemu_cfg_slot_mux_nr, hf_cemu_cfg_presence_polarity, hf_cemu_cardinsert, hf_modem_sim_select, } @@ -214,7 +219,15 @@ local subtree = tree:add(usb_simtrace_protocol, payload_data, "Card Emu Config") subtree:add(hf_cemu_cfg_features, payload_data(0,4)); - subtree:add(hf_cemu_cfg_slot_mux_nr, payload_data(4,1)); + if payload_data:len() >= 4 then + subtree:add(hf_cemu_cfg_slot_mux_nr, payload_data(4,1)); + end + if payload_data:len() >= 5 then + local pres = payload_data(5,1):le_uint(); + subtree:add(hf_cemu_cfg_presence_polarity, payload_data(5,1)); + headerSubtree:add(CEMU_CONFIG_PRES_POL_PRES_H, pres) + headerSubtree:add(CEMU_CONFIG_PRES_POL_VALID, pres) + end end function dissect_modem_sim_sel(payload_data, pinfo, tree) -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36980?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af Gerrit-Change-Number: 36980 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in simtrace2[master]: firmware: allow to change the sim presence pin polarity
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/36981?usp=email ) Change subject: firmware: allow to change the sim presence pin polarity ...................................................................... firmware: allow to change the sim presence pin polarity The sim presence pin allows the simtrace2 to inform the modem about the presence of the simcard. On a generic simcard slot a button is pressed by the simcard which generate a high or low voltage level. Even there are specifications of minipcie or ngff defining this signal, certain modems behave different. Certain modems require different signals from the specification. Extend the usb protocol to set the behaviour at runtime. Change-Id: I77118114ba873fdf0778137402888b40f2442456 --- M TODO-RELEASE M firmware/libcommon/include/simtrace.h M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c 5 files changed, 74 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/36981/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 5da461b..fb35723 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line simtrace2 API/ABI change osmo_st2_transport new member +simtrace2 API/ABI change cardemu_usb_msg_config new member diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index a37ec4f..aeb56ed 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -124,4 +124,8 @@ void Timer_Init( void ); void TC0_Counter_Reset( void ); +/* Sim presence pins */ +bool mode_cardemu_get_prensence_pol(uint8_t instance); +void mode_cardemu_set_prensence_pol(uint8_t instance, bool high); + #endif /* SIMTRACE_H */ diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index d1eb89b..d95eb00 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -261,12 +261,21 @@ /* enable/disable the generation of DO_STATUS on IRQ endpoint */ #define CEMU_FEAT_F_STATUS_IRQ 0x00000001 +#define CEMU_CONFIG_PRES_POL_PRES_L 0x00 +#define CEMU_CONFIG_PRES_POL_PRES_H 0x01 +#define CEMU_CONFIG_PRES_POL_VALID 0x02 + /* SIMTRACE_MSGT_BD_CEMU_CONFIG */ struct cardemu_usb_msg_config { /* bit-mask of CEMU_FEAT_F flags */ uint32_t features; /* the selected slot number (if an external mux is present) */ uint8_t slot_mux_nr; + /* Sim presence pin polarity. Bit 1 is valid bit. Bit 0 gpio value when sim present. + * When sim is present, set sim_present gpio to high -> 0x03 + * When sim is present, set sim_present gpio to low -> 0x02 + */ + uint8_t pres_pol; } __attribute__ ((packed)); /*********************************************************************** diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index e6907e6..e040eea 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -24,6 +24,7 @@ #include "trace.h" #include "iso7816_fidi.h" #include "card_emu.h" +#include "simtrace.h" #include "simtrace_prot.h" #include "usb_buf.h" #include <osmocom/core/linuxlist.h> @@ -1096,7 +1097,7 @@ #else cfg->slot_mux_nr = 0; #endif - + cfg->pres_pol = mode_cardemu_get_prensence_pol(ch->num) | CEMU_CONFIG_PRES_POL_VALID; usb_buf_upd_len_and_submit(msg); } @@ -1270,6 +1271,11 @@ } #endif + if (scfg_len >= sizeof(uint32_t)+sizeof(uint8_t)+sizeof(uint8_t)) { + if (scfg->pres_pol & CEMU_CONFIG_PRES_POL_VALID) + mode_cardemu_set_prensence_pol(ch->num, scfg->pres_pol & CEMU_CONFIG_PRES_POL_PRES_H); + } + /* send back a report of our current configuration */ card_emu_report_config(ch); diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index a05840e..60c14ea 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -79,7 +79,10 @@ uint8_t ep_out; uint8_t ep_in; uint8_t ep_int; + /*! Pin to set when SIM is present/inserted (SIM presence pin). */ const Pin pin_insert; + /*! Invert the Pin polarity. When not inverted, the SIM pin_insert will be High, when a SIM is present. */ + bool pin_insert_inverted; #ifdef DETECT_VCC_BY_ADC uint32_t vcc_uv; #endif @@ -113,7 +116,10 @@ .ep_int = SIMTRACE_CARDEM_USB_EP_USIM1_INT, #ifdef PIN_SET_USIM1_PRES .pin_insert = PIN_SET_USIM1_PRES, -#endif +#endif /* PIN_SET_USIM1_PRES */ +#ifdef PIN_SET_USIM1_PRES_INVERTED + .pin_insert_inverted = true, +#endif /* PIN_SET_USIM1_PRES_INVERTED */ }, #ifdef CARDEMU_SECOND_UART { @@ -128,7 +134,10 @@ .ep_int = SIMTRACE_CARDEM_USB_EP_USIM2_INT, #ifdef PIN_SET_USIM2_PRES .pin_insert = PIN_SET_USIM2_PRES, -#endif +#endif /* PIN_SET_USIM2_PRES */ +#ifdef PIN_SET_USIM2_PRES_INVERTED + .pin_insert_inverted = true, +#endif /* PIN_SET_USIM2_PRES_INVERTED */ }, #endif }; @@ -700,7 +709,7 @@ TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? "INSERTED" : "REMOVED"); #ifdef HAVE_BOARD_CARDINSERT - board_set_card_insert(ci, card_insert); + board_set_card_insert(ci, card_insert ^ ci->pin_insert_inverted); #else if (!ci->pin_insert.pio) { TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n", @@ -708,7 +717,7 @@ return; } - if (card_insert) + if (card_insert ^ ci->pin_insert_inverted) PIO_Set(&ci->pin_insert); else PIO_Clear(&ci->pin_insert); @@ -962,3 +971,25 @@ process_any_usb_commands(queue, ci); } } + +void mode_cardemu_set_prensence_pol(uint8_t instance, bool high) +{ + struct cardem_inst *ci; + + if (instance >= ARRAY_SIZE(cardem_inst)) + return; + + ci = &cardem_inst[instance]; + ci->pin_insert_inverted = !high; +} + +bool mode_cardemu_get_prensence_pol(uint8_t instance) +{ + struct cardem_inst *ci; + + if (instance >= ARRAY_SIZE(cardem_inst)) + return false; + + ci = &cardem_inst[instance]; + return !ci->pin_insert_inverted; +} -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36981?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: I77118114ba873fdf0778137402888b40f2442456 Gerrit-Change-Number: 36981 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in simtrace2[master]: ngff_cardem: cosmetic: fix superflous space
by lynxis lazus 03 Jun '24

03 Jun '24
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/36979?usp=email ) Change subject: ngff_cardem: cosmetic: fix superflous space ...................................................................... ngff_cardem: cosmetic: fix superflous space Change-Id: Ib155d5778a0df7865958ab65fe2ce48b44f4326d --- M firmware/libboard/ngff_cardem/source/board_ngff_cardem.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/36979/1 diff --git a/firmware/libboard/ngff_cardem/source/board_ngff_cardem.c b/firmware/libboard/ngff_cardem/source/board_ngff_cardem.c index fea64d3..07ae1af 100644 --- a/firmware/libboard/ngff_cardem/source/board_ngff_cardem.c +++ b/firmware/libboard/ngff_cardem/source/board_ngff_cardem.c @@ -146,8 +146,8 @@ return 0; } - static const Pin deton = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}; - static const Pin detoff = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}; +static const Pin deton = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}; +static const Pin detoff = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}; void board_set_card_insert(struct cardem_inst *ci, bool card_insert) { -- To view, visit https://gerrit.osmocom.org/c/simtrace2/+/36979?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-Change-Id: Ib155d5778a0df7865958ab65fe2ce48b44f4326d Gerrit-Change-Number: 36979 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.