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

March 2026

  • 1 participants
  • 1933 discussions
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by laforge 24 Mar '26

24 Mar '26
Attention is currently required from: Hoernchen. laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email ) Change subject: firmware: replace libosmocore fsm timers ...................................................................... Patch Set 3: (1 comment) File ccid_common/cuart.c: https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481/comment/1a5b9c0d_c5… : PS3, Line 87: if (deadline && jiffies >= deadline) { what's the jiffies frequency? do we have to worry about it wrapping ever and hence jiffies could be < deadline after such a wrap? -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Tue, 24 Mar 2026 15:58:20 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[S] Change in pysim[master]: pySim/EF.SMSP: add an additional de_encode test for EF_SMSP
by laforge 24 Mar '26

24 Mar '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42468?usp=email ) Change subject: pySim/EF.SMSP: add an additional de_encode test for EF_SMSP ...................................................................... pySim/EF.SMSP: add an additional de_encode test for EF_SMSP Let's add another testvector where we test what happens when we populate none of the fields except for the tp_sc_addr. Related: SYS#7765 Change-Id: I12b600ab17d1acfdddaffe6006095acf1a4228c9 --- M pySim/ts_51_011.py 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 57cfc0c..86d0192 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -261,6 +261,16 @@ "numbering_plan_id": "reserved_for_extension" }, "call_number": "" }, "tp_pid": b"\x00", "tp_dcs": b"\x00", "tp_vp_minutes": 1440 } ), + ( 'fffffffffffffffffffffffffffffffffffffffffffffffffdffffffffffffffffffffffff07919403214365f7ffffffffffffff', + { "alpha_id": "", "parameter_indicators": { "tp_dest_addr": False, "tp_sc_addr": True, + "tp_pid": False, "tp_dcs": False, "tp_vp": False }, + "tp_dest_addr": { "length": 255, "ton_npi": { "ext": True, "type_of_number": "reserved_for_extension", + "numbering_plan_id": "reserved_for_extension" }, + "call_number": "" }, + "tp_sc_addr": { "length": 7, "ton_npi": { "ext": True, "type_of_number": "international", + "numbering_plan_id": "isdn_e164" }, + "call_number": "49301234567" }, + "tp_pid": b"\xff", "tp_dcs": b"\xff", "tp_vp_minutes": 635040 } ), ] _test_no_pad = True class ValidityPeriodAdapter(Adapter): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42468?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I12b600ab17d1acfdddaffe6006095acf1a4228c9 Gerrit-Change-Number: 42468 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-netif[master]: ip_checksum: Add SPDX license identifier
by laforge 24 Mar '26

24 Mar '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/42477?usp=email ) Change subject: ip_checksum: Add SPDX license identifier ...................................................................... ip_checksum: Add SPDX license identifier Let's make sure the newly-created/imported file has a machine-readable SPDX identifier. Change-Id: Ic40d01771e8d01461ed81d1a60d9e91a48fdc8d0 --- M src/ip_checksum.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve diff --git a/src/ip_checksum.c b/src/ip_checksum.c index 1fa6f42..ec715e2 100644 --- a/src/ip_checksum.c +++ b/src/ip_checksum.c @@ -27,6 +27,8 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0+ */ /* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/42477?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic40d01771e8d01461ed81d1a60d9e91a48fdc8d0 Gerrit-Change-Number: 42477 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-netif[master]: icmpv6: Re-license code under GPL-v2-or-later
by laforge 24 Mar '26

24 Mar '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/42476?usp=email ) Change subject: icmpv6: Re-license code under GPL-v2-or-later ...................................................................... icmpv6: Re-license code under GPL-v2-or-later The original statement in my code from osmo-ggsn commit d46bcd236e93432c894a939f4e5810dc5e9b4974 in 2017 was worded GPLv2-only, which was due to the fact that the original OpenGGSN code is v2-only. All subsequent modifications to this code were done by either me or Pau Espin, who was doing the work under contract with sysmocom, of which I'm the managing director. Therefore, I have legal authority to re-license this file to v2-or-later. Change-Id: I5a4fa18ef64c2f228e21fa2c067e55eaa4080508 --- M src/icmpv6.c 1 file changed, 16 insertions(+), 5 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/icmpv6.c b/src/icmpv6.c index b0f29a8..c0d5710 100644 --- a/src/icmpv6.c +++ b/src/icmpv6.c @@ -2,13 +2,24 @@ * relevant 3GPP specs for a GGSN with IPv6 PDP contexts */ /* (C) 2017 by Harald Welte <laforge(a)gnumonks.org> + * All Rights Reserved. * - * The contents of this file may be used under the terms of the GNU - * General Public License Version 2, provided that the above copyright - * notice and this permission notice is included in all copies or - * substantial portions of the software. + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * */ - #include <stdint.h> #include <stdbool.h> #include <string.h> -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/42476?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5a4fa18ef64c2f228e21fa2c067e55eaa4080508 Gerrit-Change-Number: 42476 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by Hoernchen 24 Mar '26

24 Mar '26
Attention is currently required from: Hoernchen. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: firmware: replace libosmocore fsm timers ...................................................................... firmware: replace libosmocore fsm timers Concurrent access from main loop and the different uart irqs was not going well and caused crashes. The libosmocore fsm does still allocate one internal timer, but it is not used by the firmware, so libosmocore will not touch the rbtree. This clashes with the host build which does not have jiffies, and is pretty much a burden because it requires special casing code due to the completely different targets even though it was last used many years ago and might not even work, so disable it. Additionally ignore checkpatch jiffies complaints because we're trying to do firmware here. Closes: SYS#7877 Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd --- M .checkpatch.conf M ccid_common/ccid_slot_fsm.c M ccid_common/cuart.c M ccid_common/cuart.h M ccid_common/iso7816_fsm.c M contrib/jenkins.sh M sysmoOCTSIM/main.c 7 files changed, 61 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/42481/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by Jenkins Builder 24 Mar '26

24 Mar '26
Attention is currently required from: Hoernchen. Jenkins Builder has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email ) Change subject: firmware: replace libosmocore fsm timers ...................................................................... Patch Set 2: (1 comment) File ccid_common/cuart.c: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481/comment/ef1a257e_8a… : PS2, Line 87: if (deadline && jiffies >= deadline) { Comparing jiffies is almost always wrong; prefer time_after, time_before and friends -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Tue, 24 Mar 2026 15:43:53 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by Hoernchen 24 Mar '26

24 Mar '26
Attention is currently required from: Hoernchen. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: firmware: replace libosmocore fsm timers ...................................................................... firmware: replace libosmocore fsm timers Concurrent access from main loop and the different uart irqs was not going well and caused crashes. The libosmocore fsm does still allocate one internal timer, but it is not used by the firmware, so libosmocore will not touch the rbtree. This clashes with the host build which does not have jiffies, and is pretty much a burden because it requires special casing code due to the completely different targets even though it was last used many years ago and might not even work, so disable it. Closes: SYS#7877 Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd --- M ccid_common/ccid_slot_fsm.c M ccid_common/cuart.c M ccid_common/cuart.h M ccid_common/iso7816_fsm.c M contrib/jenkins.sh M sysmoOCTSIM/main.c 6 files changed, 60 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/42481/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by Jenkins Builder 24 Mar '26

24 Mar '26
Jenkins Builder has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email ) Change subject: firmware: replace libosmocore fsm timers ...................................................................... Patch Set 1: (1 comment) File ccid_common/cuart.c: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481/comment/1657d7d2_2b… : PS1, Line 87: if (deadline && jiffies >= deadline) { Comparing jiffies is almost always wrong; prefer time_after, time_before and friends -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Mar 2026 15:12:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmo-ccid-firmware[master]: firmware: replace libosmocore fsm timers
by Hoernchen 24 Mar '26

24 Mar '26
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email ) Change subject: firmware: replace libosmocore fsm timers ...................................................................... firmware: replace libosmocore fsm timers Concurrent access from main loop and the different uart irqs was not going well and caused crashes. The libosmocore fsm does still allocate one internal timer, but it is not used by the firmware, so libosmocore will not touch the rbtree. Closes: SYS#7877 Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd --- M ccid_common/ccid_slot_fsm.c M ccid_common/cuart.c M ccid_common/cuart.h M ccid_common/iso7816_fsm.c M sysmoOCTSIM/main.c 5 files changed, 57 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/42481/1 diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c index 05024c9..22d3f70 100644 --- a/ccid_common/ccid_slot_fsm.c +++ b/ccid_common/ccid_slot_fsm.c @@ -207,7 +207,7 @@ volatile void * volatile data = cs->event_data; if (!event) - return 0; + goto out; // if(event && !data) // return 0; @@ -340,6 +340,8 @@ break; } +out: + card_uart_wtime_poll(ss->cuart); return 0; } diff --git a/ccid_common/cuart.c b/ccid_common/cuart.c index d228c13..593265e 100644 --- a/ccid_common/cuart.c +++ b/ccid_common/cuart.c @@ -21,10 +21,11 @@ #include <string.h> #include <osmocom/core/linuxlist.h> #include <osmocom/core/utils.h> -#include <osmocom/core/timer.h> #include "cuart.h" +extern volatile uint64_t jiffies; + static LLIST_HEAD(g_cuart_drivers); const struct value_string card_uart_event_vals[] = { @@ -56,36 +57,37 @@ return 1e6 / cuart->driver->ops->ctrl(cuart, CUART_CTL_GET_BAUDRATE, 0); } -/* software waiting-time timer has expired */ -static void card_uart_wtime_cb(void *data) -{ - struct card_uart *cuart = (struct card_uart *) data; - card_uart_notification(cuart, CUART_E_RX_TIMEOUT, NULL); - /* should we automatically disable the receiver? */ -} - void card_uart_wtime_restart(struct card_uart *cuart) { - int secs, usecs; - if (!cuart->current_wtime_byte) return; int etu_in_us = get_etu_in_us(cuart) + 1; cuart->wtime_etu = cuart->wtime_etu ? cuart->wtime_etu : 1; - /* timemout is wtime * ETU * expected number of bytes */ - usecs = etu_in_us * cuart->wtime_etu * cuart->current_wtime_byte; + /* timeout is wtime * ETU * expected number of bytes */ + uint32_t usecs = etu_in_us * cuart->wtime_etu * cuart->current_wtime_byte; /* limit lower wait time to reasonable value */ - usecs = usecs < 300000 ? 300000 : usecs; + if (usecs < 300000) + usecs = 300000; - if (usecs > 1000000) { - secs = usecs / 1000000; - usecs = usecs % 1000000; - } else - secs = 0; - osmo_timer_schedule(&cuart->wtime_tmr, secs, usecs); + uint32_t ms = (usecs + 999) / 1000; + cuart->wtime_deadline = jiffies + ms; +} + +static inline void card_uart_wtime_stop(struct card_uart *cuart) +{ + cuart->wtime_deadline = 0; +} + +void card_uart_wtime_poll(struct card_uart *cuart) +{ + uint64_t deadline = cuart->wtime_deadline; + if (deadline && jiffies >= deadline) { + cuart->wtime_deadline = 0; + card_uart_notification(cuart, CUART_E_RX_TIMEOUT, NULL); + } } int card_uart_open(struct card_uart *cuart, const char *driver_name, const char *device_name) @@ -99,7 +101,7 @@ cuart->wtime_etu = 9600; /* ISO 7816-3 Section 8.1 */ cuart->rx_enabled = true; cuart->rx_threshold = 1; - osmo_timer_setup(&cuart->wtime_tmr, card_uart_wtime_cb, cuart); + cuart->wtime_deadline = 0; rc = drv->ops->open(cuart, device_name); if (rc < 0) @@ -137,16 +139,14 @@ case CUART_CTL_RX: cuart->rx_enabled = arg ? true : false; if (!cuart->rx_enabled) - osmo_timer_del(&cuart->wtime_tmr); -// else -// card_uart_wtime_restart(cuart); + card_uart_wtime_stop(cuart); break; case CUART_CTL_RX_TIMER_HINT: cuart->current_wtime_byte = arg; if(arg) card_uart_wtime_restart(cuart); else - osmo_timer_del(&cuart->wtime_tmr); + card_uart_wtime_stop(cuart); break; case CUART_CTL_POWER_5V0: case CUART_CTL_POWER_3V0: @@ -154,7 +154,7 @@ /* we have to reset this somewhere, and powering down loses all state * this is not hw specific so it belongs here, after handling the hw specific part */ if (!arg) { - osmo_timer_del(&cuart->wtime_tmr); + card_uart_wtime_stop(cuart); cuart->tx_busy = false; cuart->rx_threshold = 1; cuart->wtime_etu = 9600; /* ISO 7816-3 Section 8.1 */ diff --git a/ccid_common/cuart.h b/ccid_common/cuart.h index c8573c5..bb1c18b 100644 --- a/ccid_common/cuart.h +++ b/ccid_common/cuart.h @@ -21,8 +21,6 @@ #include <stdint.h> #include <stdbool.h> #include <osmocom/core/linuxlist.h> -#include <osmocom/core/timer.h> - #include <osmocom/core/select.h> #include "utils_ringbuffer.h" @@ -101,7 +99,9 @@ uint32_t rx_threshold; uint32_t wtime_etu; - struct osmo_timer_list wtime_tmr; + /* deadline in jiffies (ms) for card response timeout, 0 = inactive. + * Set from IRQ context, checked from main loop */ + volatile uint64_t wtime_deadline; /* expected number of bytes, for timeout */ uint32_t current_wtime_byte; @@ -153,6 +153,11 @@ /* (re)start the software WTIME timer */ void card_uart_wtime_restart(struct card_uart *cuart); +/* poll wtime deadline from main loop, fires CUART_E_RX_TIMEOUT if expired */ +void card_uart_wtime_poll(struct card_uart *cuart); + void card_uart_notification(struct card_uart *cuart, enum card_uart_event evt, void *data); int card_uart_driver_register(struct card_uart_driver *drv); + +struct card_uart *cuart4slot_nr(uint8_t slot_nr); diff --git a/ccid_common/iso7816_fsm.c b/ccid_common/iso7816_fsm.c index a035148..778528a 100644 --- a/ccid_common/iso7816_fsm.c +++ b/ccid_common/iso7816_fsm.c @@ -33,6 +33,8 @@ #include "cuart.h" #include "iso7816_fsm.h" +extern volatile uint64_t jiffies; + /* unionize to ensure at least properly aligned msgb struct */ #define DECLARE_STATIC_MSGB(name, size) \ struct msgb* name; \ @@ -137,12 +139,6 @@ TPDU_S_DONE, }; -/* FSM timer enumeration */ -enum iso7816_3_timer { - T_WAIT_ATR = 1, - T_GUARD, -}; - /* forward declarations */ static struct osmo_fsm iso7816_3_fsm; static struct osmo_fsm atr_fsm; @@ -264,6 +260,17 @@ return (struct iso7816_3_priv *) fi->priv; } +/* libosmocore fsm timers can't be used to to concurrency issues. + * Expiry fires CUART_E_RX_TIMEOUT from main loop -> ISO7816_E_WTIME_EXP + */ +static void atr_state_chg_guard(struct osmo_fsm_inst *atr_fi, uint32_t new_state, uint32_t timeout_ms) +{ + struct osmo_fsm_inst *parent_fi = atr_fi->proc.parent; + struct iso7816_3_priv *ip = get_iso7816_3_priv(parent_fi); + osmo_fsm_inst_state_chg(atr_fi, new_state, 0, 0); + ip->uart->wtime_deadline = timeout_ms ? (jiffies + timeout_ms) + 1 : 0; +} + /* convert from clock cycles of the CLK line to milli-seconds */ uint32_t fi_cycles2ms(struct osmo_fsm_inst *fi, uint32_t cyclces) { @@ -741,7 +748,7 @@ /* fall-through */ case 0x3f: /* inverse convention used and correctly decoded */ atr_append_byte(fi, byte); - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_T0, atr_fi_gt_ms(fi), T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_T0, atr_fi_gt_ms(fi)); break; default: LOGPFSML(fi, LOGL_ERROR, "Invalid TS received: 0x%02X\n", byte); @@ -783,28 +790,28 @@ atp->y = (byte & 0xf0); /* remember incoming interface bytes */ atp->i++; if (atp->y & 0x10) { - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_TA, guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_TA, guard_time_ms); break; } /* fall-through */ case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ if (atp->y & 0x20) { - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_TB, guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_TB, guard_time_ms); break; } /* fall-through */ case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ if (atp->y & 0x40) { - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_TC, guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_TC, guard_time_ms); break; } /* fall-through */ case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ if (atp->y & 0x80) { - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_TD, guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_TD, guard_time_ms); break; } else if (atp->hist_len) { - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_HIST, guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_HIST, guard_time_ms); break; } /* fall-through */ @@ -814,8 +821,7 @@ if (atp->hist_len == 0) { if (atp->protocol_support > 1) { /* wait for check byte */ - osmo_fsm_inst_state_chg_ms(fi, ATR_S_WAIT_TCK, - guard_time_ms, T_GUARD); + atr_state_chg_guard(fi, ATR_S_WAIT_TCK, guard_time_ms); break; } else { /* no TCK present, ATR complete; notify parent */ diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index e1e83c7..7873c86 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -22,7 +22,6 @@ #include <errno.h> #include <osmocom/core/utils.h> -#include <osmocom/core/timer.h> #include <hal_cache.h> #include <hri_port_e54.h> @@ -714,7 +713,6 @@ g_ci.slot_ops->handle_fsm_events(&g_ci.slot[i], true); } feed_ccid(); - osmo_timers_update(); int qs = llist_count_at(&g_ccid_s.free_q); if (qs > NUM_OUT_BUF) for (int i = 0; i < qs - NUM_OUT_BUF; i++) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42481?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-Change-Id: Id2bd67b3946bb451008965f0b68b4a919f4d10bd Gerrit-Change-Number: 42481 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_te...
by pespin 24 Mar '26

24 Mar '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42472?usp=email ) Change subject: GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_term_ind ...................................................................... GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_term_ind Otherwise it will evnetually run out of entries if enough commands are called sequentially. Change-Id: I7be2639761726c09e4ea6f75c57d8414c5dbf128 --- M library/GTPv1U_Emulation.ttcnpp 1 file changed, 31 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/library/GTPv1U_Emulation.ttcnpp b/library/GTPv1U_Emulation.ttcnpp index 6146147..7b1db12 100644 --- a/library/GTPv1U_Emulation.ttcnpp +++ b/library/GTPv1U_Emulation.ttcnpp @@ -82,9 +82,9 @@ /* pid <-> ConnHdlr mapping (for UECUPS process termination indication) */ type record PidTableRec { /* process ID of the running process */ - integer pid, + integer pid optional, /* component that started it */ - GTP1U_ConnHdlr vc_conn + GTP1U_ConnHdlr vc_conn optional }; #endif @@ -113,8 +113,7 @@ private function f_comp_by_pid(integer pid) runs on GTPv1U_Emulation_CT return GTP1U_ConnHdlr { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { - if (isbound(PidTable[i].pid) and PidTable[i].pid == pid) { - /* fixme: remove */ + if (ispresent(PidTable[i].pid) and PidTable[i].pid == pid) { return PidTable[i].vc_conn; } } @@ -136,10 +135,24 @@ } #ifdef GTP1U_EMULATION_HAVE_UECUPS +private function f_pid_clear(integer idx) runs on GTPv1U_Emulation_CT { + PidTable[idx].pid := omit; + PidTable[idx].vc_conn := omit; +} + +private function f_pid_tbl_init() runs on GTPv1U_Emulation_CT { + var integer i; + + /* Initialize the ConnectionTable */ + for (i := 0; i < sizeof(PidTable); i := i+1) { + f_pid_clear(i); + } +} + private function f_pid_tbl_add(integer pid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { - if (not isbound(PidTable[i].pid)) { + if (not ispresent(PidTable[i].pid)) { PidTable[i].pid := pid; PidTable[i].vc_conn := vc_conn; return; @@ -147,6 +160,17 @@ } testcase.stop("No Space in PID Table for ", pid); } + +private function f_pid_tbl_del(integer pid) runs on GTPv1U_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(PidTable); i := i+1) { + if (ispresent(PidTable[i].pid) and PidTable[i].pid == pid) { + f_pid_clear(i); + return; + } + } + testcase.stop("Cannot find PID ", pid, " in PidTable for deletion"); +} #endif @@ -211,6 +235,7 @@ if (g_gtp1u_cfg.use_gtpu_daemon) { #ifdef GTP1U_EMULATION_HAVE_UECUPS + f_pid_tbl_init(); map(self:UECUPS, system:UECUPS); res := UECUPS_CodecPort_CtrlFunct.f_IPL4_connect(UECUPS, mp_uecups_host, mp_uecups_port, "", -1, -1, { sctp := valueof(ts_SctpTuple) }); @@ -241,8 +266,8 @@ /* handle incoming program_term_ind; dispatch to whatever component started the process */ [] UECUPS.receive(tr_UECUPS_RecvFrom_R({program_term_ind:=?})) -> value rx { vc_conn := f_comp_by_pid(rx.msg.program_term_ind.pid); + f_pid_tbl_del(rx.msg.program_term_ind.pid); CLIENT.send(rx.msg.program_term_ind) to vc_conn; - /* FIXME: remove from table */ repeat; } /* handle incoming ipv6_slaac_ind; dispatch to whatever component started the process */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42472?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7be2639761726c09e4ea6f75c57d8414c5dbf128 Gerrit-Change-Number: 42472 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.