pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30148 )
Change subject: osmux: Rework log formatting when replaying detected RTP gaps
......................................................................
Patch Set 1:
(1 comment)
File src/osmux_input.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/30148/comment/6326fda2_317947ac
PS1, Line 366: d
> Ack
@laforge this calculation seems to be correct due to how unsigned subtraction and conversion to signed works. This is also how the before() and after() functions are implemented in the linux kernel.
Checked with a unit test in gdb:
448 diff = cur_seq - last_seq;
(gdb) print last_seq
$4 = 65535
(gdb) print cur_seq
$5 = 1
(gdb) n
453 if (diff <= 1)
(gdb) print diff
$6 = 2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30148
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I5fd64acf7bc1e53efae0674d0c906d1255a9bbf6
Gerrit-Change-Number: 30148
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 16 Nov 2022 11:04:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30182 )
Change subject: firmware/sniffer: Make all global variables 'static'
......................................................................
firmware/sniffer: Make all global variables 'static'
None of those variables are used outside sniffer.c, so they can all be
static.
Change-Id: I8946acb6189d5ade57214295f0ba87f0608bad92
---
M firmware/libcommon/source/sniffer.c
1 file changed, 14 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/30182/1
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index da5d743..8deda9c 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -141,47 +141,47 @@
static struct ringbuf sniff_buffer;
/* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */
-volatile uint32_t change_flags = 0;
+static volatile uint32_t change_flags = 0;
/* ISO 7816 variables */
/*! ISO 7816-3 state */
-enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET;
+static enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET;
/*! ATR state */
-enum atr_sniff_state atr_state;
+static enum atr_sniff_state atr_state;
/*! ATR data
* @remark can be used to check later protocol changes
*/
-uint8_t atr[MAX_ATR_SIZE];
+static uint8_t atr[MAX_ATR_SIZE];
/*! Current index in the ATR data */
-uint8_t atr_i = 0;
+static uint8_t atr_i = 0;
/*! If convention conversion is needed */
-bool convention_convert = false;
+static bool convention_convert = false;
/*! The supported T protocols */
-uint16_t t_protocol_support = 0;
+static uint16_t t_protocol_support = 0;
/*! PPS state
* @remark it is shared between request and response since they aren't simultaneous but follow the same procedure
*/
-enum pps_sniff_state pps_state;
+static enum pps_sniff_state pps_state;
/*! PPS request data
* @remark can be used to check PPS response
*/
-uint8_t pps_req[MAX_PPS_SIZE];
+static uint8_t pps_req[MAX_PPS_SIZE];
/*! PPS response data */
-uint8_t pps_rsp[MAX_PPS_SIZE];
+static uint8_t pps_rsp[MAX_PPS_SIZE];
/*! TPDU state */
-enum tpdu_sniff_state tpdu_state;
+static enum tpdu_sniff_state tpdu_state;
/*! Final TPDU packet
* @note this is the complete command+response TPDU, including header, data, and status words
* @remark this does not include the procedure bytes
*/
-uint8_t tpdu_packet[5+256+2];
+static uint8_t tpdu_packet[5+256+2];
/*! Current index in TPDU packet */
-uint16_t tpdu_packet_i = 0;
+static uint16_t tpdu_packet_i = 0;
/*! Waiting Time (WT)
* @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2
*/
-uint32_t wt = 9600;
+static uint32_t wt = 9600;
/*------------------------------------------------------------------------------
* Internal functions
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30182
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I8946acb6189d5ade57214295f0ba87f0608bad92
Gerrit-Change-Number: 30182
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30181 )
Change subject: firmware/sniffer: Fix programming error in PPS
......................................................................
firmware/sniffer: Fix programming error in PPS
process_byte_pps() would never enter the error path in which the
first byte would be != 0xff. However, the caller already verified
this before calling process_byte_pps() so the error path should
never be hit anyway.
Change-Id: Ia74b6338219a6965e6bd35a6efcf369890e02d81
---
M firmware/libcommon/source/sniffer.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/30181/1
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index cbfa7c9..da5d743 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -595,7 +595,7 @@
switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */
case PPS_S_WAIT_PPSS: /*!< initial byte */
flags = 0;
- if (0xff) {
+ if (byte == 0xff) {
pps_cur[0] = byte;
pps_state = PPS_S_WAIT_PPS0; /* go to next state */
} else {
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30181
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ia74b6338219a6965e6bd35a6efcf369890e02d81
Gerrit-Change-Number: 30181
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30179 )
Change subject: firmware/sniffer: Log old and new state in ISO7816-3 state changes
......................................................................
firmware/sniffer: Log old and new state in ISO7816-3 state changes
Change-Id: Iddb460cc2ad02c11a74de10dab127bb14cee9605
---
M firmware/libcommon/source/sniffer.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/30179/1
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index 1647e17..e3b7fbb 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -302,9 +302,10 @@
break;
}
+ TRACE_INFO("ISO 7816-3 state %u->%u\n\r", iso_state, iso_state_new);
+
/* save new state */
iso_state = iso_state_new;
- TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state);
}
const struct value_string data_flags[] = {
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30179
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Iddb460cc2ad02c11a74de10dab127bb14cee9605
Gerrit-Change-Number: 30179
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/30180 )
Change subject: firmware/sniffer: Avoid extra call for rbuf_is_full
......................................................................
firmware/sniffer: Avoid extra call for rbuf_is_full
rbuf_write() will tell us in the return value if the buffer was full
(error) or not (success). Let's use that return value rather than a
theoretically race-y call to rbuf_is_full() before.
It's theoretical as the write happens from IRQ context and the read from
normal process context, so the fill-level cannot really change while
we're in the USART interrupt. So it doesn't fix a bug, just improves
coding style and also avoids an extra function call + irq-disable/re-enable.
Change-Id: Icf570d0aa48d67a19e63c6e2b6caa14438fe88e3
---
M firmware/libcommon/source/sniffer.c
1 file changed, 1 insertion(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/30180/1
diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c
index e3b7fbb..cbfa7c9 100644
--- a/firmware/libcommon/source/sniffer.c
+++ b/firmware/libcommon/source/sniffer.c
@@ -826,11 +826,8 @@
/* Reset WT timer */
wt_remaining = wt;
/* Store sniffed data into buffer (also clear interrupt */
- if (rbuf_is_full(&sniff_buffer)) {
+ if (rbuf_write(&sniff_buffer, byte) != 0)
TRACE_ERROR("USART buffer full\n\r");
- } else {
- rbuf_write(&sniff_buffer, byte);
- }
}
/* Verify it WT timeout occurred, to detect unresponsive card */
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30180
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Icf570d0aa48d67a19e63c6e2b6caa14438fe88e3
Gerrit-Change-Number: 30180
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/30153 )
Change subject: conrtrib/upload : upload elf files
......................................................................
conrtrib/upload : upload elf files
Due to popular demand people want elf files that can be loaded to get
debug symbols, so publish the elf file, but not the stub-less bin file.
This elf file can ONLY be used to look up symbols, it should NOT be
"load"ed into flash, because the preceding crc stub has to match. Mixing
older crc stubs that are still in flash and newer elf files means the
device will end up in DFU mode upon reset.
Change-Id: Ifceb16d385388356ac1bf8b13f5df62c643bebf8
---
M contrib/prepare_upload.sh
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/contrib/prepare_upload.sh b/contrib/prepare_upload.sh
index f134d2a..cdd144f 100755
--- a/contrib/prepare_upload.sh
+++ b/contrib/prepare_upload.sh
@@ -9,7 +9,7 @@
cd firmware/bin
for ext in bin elf; do
for file in *."$ext"; do
- if ! [[ "$file" =~ ^(.*padded.*|.*nocrcstub.*)$ ]];then
+ if ! [[ "$file" =~ ^(.*padded.*|.*nocrcstub.*bin)$ ]];then
without_ext="${file%.*}"
cp -v "$file" "$without_ext-latest.$ext"
cp -v "$file" "$without_ext-$GIT_VERSION.$ext"
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/30153
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ifceb16d385388356ac1bf8b13f5df62c643bebf8
Gerrit-Change-Number: 30153
Gerrit-PatchSet: 4
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/30177 )
Change subject: asn1tostruct: don't use f-strings
......................................................................
asn1tostruct: don't use f-strings
Make the script work with python < 3.6 again by not using f-strings.
Fix for:
SyntaxError: invalid syntax
File "../../git/asn1/utils/asn1tostruct.py", line 94
f" IE {ie}. Found another entry in ies {ie_other}" \
^
Fixes: 1d19c8e2 ("asn1tostruct: fix defines getting redefined")
Change-Id: I3a19b8a1147532b41d3ed7b802de595302ff8f44
---
M asn1/utils/asn1tostruct.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
daniel: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py
index d71d87d..9b1c1a1 100755
--- a/asn1/utils/asn1tostruct.py
+++ b/asn1/utils/asn1tostruct.py
@@ -91,8 +91,8 @@
if ie_other[2] == ie[2]:
unique = False
assert ie[0] != ie_other[0], "failed to find a unique name for" \
- f" IE {ie}. Found another entry in ies {ie_other}" \
- " that has the same ie[0] value."
+ " IE {}. Found another entry in ies {}" \
+ " that has the same ie[0] value.".format(ie, ie_other)
if unique:
ret = ie[2]
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/30177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I3a19b8a1147532b41d3ed7b802de595302ff8f44
Gerrit-Change-Number: 30177
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: osmith.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/30177 )
Change subject: asn1tostruct: don't use f-strings
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/30177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I3a19b8a1147532b41d3ed7b802de595302ff8f44
Gerrit-Change-Number: 30177
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 16 Nov 2022 10:29:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment