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

July 2023

  • 1 participants
  • 3051 discussions
[M] Change in pysim[master]: pysim-test: rename pysim-test.sh to pySim-prog_test.sh
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33964 ) Change subject: pysim-test: rename pysim-test.sh to pySim-prog_test.sh ...................................................................... pysim-test: rename pysim-test.sh to pySim-prog_test.sh We now have pySim-shell and pySim-trace. Let's give pysim-test.sh a more distinctive name so that it is clear to which program it refers. Related: OS#6094 Change-Id: I438f63f9580ebd3c7cc78cc5dab13c9937ac6e3a --- M contrib/jenkins.sh D tests/pysim-test.sh 2 files changed, 14 insertions(+), 231 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/64/33964/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 583400b..93dc4bc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -28,7 +28,7 @@ # Run the test with physical cards cd pysim-testdata - ../tests/pysim-test.sh + ../tests/pySim-prog_test.sh ../tests/pySim-trace_test.sh ;; "pylint") diff --git a/tests/pysim-test.sh b/tests/pysim-test.sh deleted file mode 100755 index 4004c18..0000000 --- a/tests/pysim-test.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash - -# Utility to verify the functionality of pysim-prog.py -# -# (C) 2018 by Sysmocom s.f.m.c. GmbH -# All Rights Reserved -# -# Author: Philipp Maier -# -# 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/>. - -PYSIM_PROG=../pySim-prog.py -PYSIM_READ=../pySim-read.py -TEMPFILE=temp.tmp -PYTHON=python3 - -set -e - -echo "pysim-test - a test program to test pysim-prog.py" -echo "=================================================" - -# Generate a list of the cards we expect to see by checking which .ok files -# are present -function gen_card_list { - N_CARDS=0 - - echo "Expecting to see the following cards:" - - for I in *.data ; do - CARD_NAMES[$N_CARDS]=${I%.*} - CARD_SEEN[$N_CARDS]=0 - N_CARDS=$((N_CARDS+1)) - done - - for I in $(seq 0 $((N_CARDS-1))); do - echo ${CARD_NAMES[$I]} - done -} - -# Increment counter in card list for a specified card name (type) -function inc_card_list { - CARD_NAME=$1 - for I in $(seq 0 $((N_CARDS-1))); do - if [ $CARD_NAME = ${CARD_NAMES[$I]} ]; then - CARD_SEEN[$I]=$((${CARD_NAMES[$I]}+1)) - fi - done -} - -# Check the card list, each card must be seen exactly one times -function check_card_list { - for I in $(seq 0 $((N_CARDS-1))); do - if [ ${CARD_SEEN[$I]} -ne 1 ]; then - echo "Error: Card ${CARD_NAMES[$I]} seen ${CARD_SEEN[$I]} times!" - exit 1 - fi - done - - echo "All cards seen -- everything ok!" -} - -# Verify the contents of a card by reading them and then diffing against the -# previously created .ok file -function check_card { - TERMINAL=$1 - CARD_NAME=$2 - echo "Verifying card ..." - stat ./$CARD_NAME.ok > /dev/null - $PYTHON $PYSIM_READ -p $TERMINAL > $TEMPFILE - set +e - CARD_DIFF=$(diff $TEMPFILE ./$CARD_NAME.ok) - set -e - - if [ "$CARD_DIFF" != "" ]; then - echo "Card contents do not match the test data:" - echo "Expected: $CARD_NAME.ok" - echo "------------8<------------" - cat "$CARD_NAME.ok" - echo "------------8<------------" - echo "Got:" - echo "------------8<------------" - cat $TEMPFILE - echo "------------8<------------" - rm *.tmp - exit 1 - fi - - inc_card_list $CARD_NAME - - echo "Card contents match the test data -- success!" - rm $TEMPFILE -} - -# Read out the card using pysim-read and store the result as .ok file. This -# data will be used later in order to verify the results of our write tests. -function gen_ok_file { - TERMINAL=$1 - CARD_NAME=$2 - $PYTHON $PYSIM_READ -p $TERMINAL > "$CARD_NAME.ok" - echo "Generated file: $CARD_NAME.ok" - echo "------------8<------------" - cat "$CARD_NAME.ok" - echo "------------8<------------" -} - -# Find out the type (card name) of the card that is installed in the specified -# reader -function probe_card { - TERMINAL=$1 - RESULT=$(timeout 5 $PYSIM_PROG -p $TERMINAL -T | cut -d ":" -f 2 | tail -n 1 | xargs) - echo $RESULT -} - -# Read out all cards and store the results as .ok files -function gen_ok_files { - echo "== OK FILE GENERATION ==" - for I in $(seq 0 $((N_TERMINALS-1))); do - echo "Probing card in terminal #$I" - CARD_NAME=$(probe_card $I) - if [ -z "$CARD_NAME" ]; then - echo "Error: Unresponsive card!" - exit 1 - fi - echo "Card is of type: $CARD_NAME" - gen_ok_file $I $CARD_NAME - done -} - -# Execute tests. Each card is programmed and the contents are checked -# afterwards. -function run_test { - for I in $(seq 0 $((N_TERMINALS-1))); do - echo "== EXECUTING TEST ==" - echo "Probing card in terminal #$I" - CARD_NAME=$(probe_card $I) - if [ -z "$CARD_NAME" ]; then - echo "Error: Unresponsive card!" - exit 1 - fi - echo "Card is of type: $CARD_NAME" - - # Make sure some default data is set - MCC=001 - MNC=01 - ICCID=1122334455667788990 - KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - IMSI=001010000000001 - MSISDN=6766266 - ADM=00000000 - ADM_HEX="" - ADM_OPT="-a" - - source "$CARD_NAME.data" - if [ -n "$ADM_HEX" ]; then - ADM_OPT="-A" - ADM=$ADM_HEX - fi - $PYTHON $PYSIM_PROG -p $I -t $CARD_NAME -o $OPC -k $KI -x $MCC -y $MNC -i $IMSI -s $ICCID --msisdn $MSISDN $ADM_OPT $ADM - check_card $I $CARD_NAME - echo "" - done -} - -function usage { - echo "Options:" - echo "-n: number of card terminals" - echo "-o: generate .ok files" -} - -# Make sure that the pathes to the python scripts always work, regardless from -# where the script is called. -CURDIR=$PWD -SCRIPTDIR=$(dirname $0) -cd $SCRIPTDIR -PYSIM_PROG=$(realpath $PYSIM_PROG) -PYSIM_READ=$(realpath $PYSIM_READ) -cd $CURDIR - -OPT_N_TERMINALS=0 -OPT_GEN_OK_FILES=0 -while getopts ":hon:" OPT; do - case $OPT in - h) - usage - exit 0 - ;; - o) - OPT_GEN_OK_FILES=1 - ;; - n) - OPT_N_TERMINALS=$OPTARG - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - esac -done - -N_TERMINALS=$OPT_N_TERMINALS - -# Generate a list of available cards, if no explicit reader number is given -# then the number of cards will be used as reader number. -gen_card_list -if [ $N_TERMINALS -eq 0 ]; then - N_TERMINALS=$N_CARDS -fi -echo "Number of card terminals installed: $N_TERMINALS" -echo "" - -if [ $OPT_GEN_OK_FILES -eq 1 ]; then - gen_ok_files - exit 0 -else - run_test - check_card_list - exit 0 -fi -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33964 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I438f63f9580ebd3c7cc78cc5dab13c9937ac6e3a Gerrit-Change-Number: 33964 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim-trace: catch StopIteration exception on trace file end
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33962 ) Change subject: pySim-trace: catch StopIteration exception on trace file end ...................................................................... pySim-trace: catch StopIteration exception on trace file end When the trace file end is reaced, pyShark raises a StopIteration exception. Let's catch this exception and exit gracefully. Related: OS#6094 Change-Id: I6ab5689b909333531d08bf46e5dfea59b161a79e --- M pySim-trace.py 1 file changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/33962/1 diff --git a/pySim-trace.py b/pySim-trace.py index 4561723..5990e32 100755 --- a/pySim-trace.py +++ b/pySim-trace.py @@ -102,7 +102,11 @@ """Main loop of tracer: Iterates over all Apdu received from source.""" while True: # obtain the next APDU from the source (blocking read) - apdu = self.source.read() + try: + apdu = self.source.read() + except StopIteration: + print("no more data, stop iteration.") + return 0 if isinstance(apdu, CardReset): self.rs.reset() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33962 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I6ab5689b909333531d08bf46e5dfea59b161a79e Gerrit-Change-Number: 33962 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: tests: add test script for pySim-trace
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33963 ) Change subject: tests: add test script for pySim-trace ...................................................................... tests: add test script for pySim-trace pySim-trace has no test coverage yet. Let's use a script to run a GSAMTAP pcacp through it and check that no exceptions are raised. Related: OS#6094 Change-Id: Icfabfa7c59968021eef0399991bd05b92467d8d2 --- M contrib/jenkins.sh A tests/pySim-trace_test.sh A tests/pySim-trace_test_gsmtap.pcapng 3 files changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/63/33963/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0309877..583400b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,6 +29,7 @@ # Run the test with physical cards cd pysim-testdata ../tests/pysim-test.sh + ../tests/pySim-trace_test.sh ;; "pylint") # Print pylint version diff --git a/tests/pySim-trace_test.sh b/tests/pySim-trace_test.sh new file mode 100755 index 0000000..0ec5e0f --- /dev/null +++ b/tests/pySim-trace_test.sh @@ -0,0 +1,20 @@ +#/bin/bash + +PYSIM_TRACE=../pySim-trace.py +GSMTAP_TRACE=pySim-trace_test_gsmtap.pcapng + +echo "pySim-trace_test - a test program to test pySim-trace.py" +echo "========================================================" + +$PYSIM_TRACE gsmtap-pyshark-pcap -f $GSMTAP_TRACE +if [ $? -ne 0 ]; then + echo "" + echo "========================================================" + echo "Testrun with $GSMTAP_TRACE failed." + exit 1 +fi + +echo "" +echo "========================================================" +echo "trace parsed without problems -- everything ok!" + diff --git a/tests/pySim-trace_test_gsmtap.pcapng b/tests/pySim-trace_test_gsmtap.pcapng new file mode 100644 index 0000000..35c3003 --- /dev/null +++ b/tests/pySim-trace_test_gsmtap.pcapng Binary files differ -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icfabfa7c59968021eef0399991bd05b92467d8d2 Gerrit-Change-Number: 33963 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim-trace: mark card reset in the trace
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33960 ) Change subject: pySim-trace: mark card reset in the trace ...................................................................... pySim-trace: mark card reset in the trace The trace log currently does not contain any information about card resets. This makes the trace difficult to follow. Let's use the CardReset object to display the ATR in the trace. Related: OS#6094 Change-Id: Ia550a8bd2f45d2ad622cb2ac2a2905397db76bce --- M pySim-trace.py M pySim/apdu/__init__.py M pySim/apdu_source/gsmtap.py M pySim/apdu_source/pyshark_gsmtap.py M pySim/apdu_source/pyshark_rspro.py 5 files changed, 32 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/33960/1 diff --git a/pySim-trace.py b/pySim-trace.py index 453ee43..c93a339 100755 --- a/pySim-trace.py +++ b/pySim-trace.py @@ -93,6 +93,11 @@ print("%02u %-16s %-35s %-8s %s %s" % (inst.lchan_nr, inst._name, inst.path_str, inst.col_id, inst.col_sw, inst.processed)) print("===============================") + def format_reset(self, apdu: CardReset): + """Output a single decoded + processed ApduCommand.""" + print(apdu) + print("===============================") + def main(self): """Main loop of tracer: Iterates over all Apdu received from source.""" while True: @@ -101,6 +106,7 @@ if isinstance(apdu, CardReset): self.rs.reset() + self.format_reset(apdu) continue # ask ApduDecoder to look-up (INS,CLA) + instantiate an ApduCommand derived diff --git a/pySim/apdu/__init__.py b/pySim/apdu/__init__.py index cc0f701..b884e23 100644 --- a/pySim/apdu/__init__.py +++ b/pySim/apdu/__init__.py @@ -448,4 +448,11 @@ class CardReset: - pass + def __init__(self, atr: bytes): + self.atr = atr + + def __str__(self): + if (self.atr): + return '%s(%s)' % (type(self).__name__, b2h(self.atr)) + else: + return '%s' % (type(self).__name__) diff --git a/pySim/apdu_source/gsmtap.py b/pySim/apdu_source/gsmtap.py index fe450e2..aaf97ad 100644 --- a/pySim/apdu_source/gsmtap.py +++ b/pySim/apdu_source/gsmtap.py @@ -49,7 +49,7 @@ return ApduCommands.parse_cmd_bytes(gsmtap_msg['body']) elif sub_type == 'atr': # card has been reset - return CardReset() + return CardReset(gsmtap_msg['body']) elif sub_type in ['pps_req', 'pps_rsp']: # simply ignore for now pass diff --git a/pySim/apdu_source/pyshark_gsmtap.py b/pySim/apdu_source/pyshark_gsmtap.py index 8ea9ae7..aa7b624 100644 --- a/pySim/apdu_source/pyshark_gsmtap.py +++ b/pySim/apdu_source/pyshark_gsmtap.py @@ -69,7 +69,7 @@ return ApduCommands.parse_cmd_bytes(gsmtap_msg['body']) elif sub_type == 'atr': # card has been reset - return CardReset() + return CardReset(gsmtap_msg['body']) elif sub_type in ['pps_req', 'pps_rsp']: # simply ignore for now pass diff --git a/pySim/apdu_source/pyshark_rspro.py b/pySim/apdu_source/pyshark_rspro.py index 499e9ff..8c614ff 100644 --- a/pySim/apdu_source/pyshark_rspro.py +++ b/pySim/apdu_source/pyshark_rspro.py @@ -117,7 +117,8 @@ vccPresent, resetActive, clkActive = self.get_pstatus(slot_pstatus) if vccPresent and clkActive and not resetActive: logger.debug("RESET") - return CardReset() + #TODO: extract ATR from RSPRO message and use it here + return CardReset(None) else: print("Unhandled msg type %s: %s" % (msg_type, rspro_msg)) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33960 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ia550a8bd2f45d2ad622cb2ac2a2905397db76bce Gerrit-Change-Number: 33960 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim-trace: remove stray debug print
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33961 ) Change subject: pySim-trace: remove stray debug print ...................................................................... pySim-trace: remove stray debug print Related: OS#6094 Change-Id: I5f030a8552a84f721bd12ab4751933fc6eeae256 --- M pySim-trace.py 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/33961/1 diff --git a/pySim-trace.py b/pySim-trace.py index c93a339..4561723 100755 --- a/pySim-trace.py +++ b/pySim-trace.py @@ -120,7 +120,7 @@ continue if self.suppress_status and isinstance(inst, UiccStatus): continue - #print(inst) + self.format_capdu(apdu, inst) option_parser = argparse.ArgumentParser(description='Osmocom pySim high-level SIM card trace decoder', -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33961 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I5f030a8552a84f721bd12ab4751933fc6eeae256 Gerrit-Change-Number: 33961 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim-trace: add commandline option --show-raw-apdu
by dexter 27 Jul '23

27 Jul '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33959 ) Change subject: pySim-trace: add commandline option --show-raw-apdu ...................................................................... pySim-trace: add commandline option --show-raw-apdu The trace log currently only shows the parsed APDU. However, depending on the problem to investigate it may be required to see the raw APDU string as well. Let's add an option for this. Related: OS#6094 Change-Id: I1a3bc54c459e45ed3154479759ceecdc26db9d37 --- M pySim-trace.py 1 file changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/59/33959/1 diff --git a/pySim-trace.py b/pySim-trace.py index d457bf4..453ee43 100755 --- a/pySim-trace.py +++ b/pySim-trace.py @@ -83,10 +83,13 @@ # parameters self.suppress_status = kwargs.get('suppress_status', True) self.suppress_select = kwargs.get('suppress_select', True) + self.show_raw_apdu = kwargs.get('show_raw_apdu', False) self.source = kwargs.get('source', None) - def format_capdu(self, inst: ApduCommand): + def format_capdu(self, apdu: Apdu, inst: ApduCommand): """Output a single decoded + processed ApduCommand.""" + if self.show_raw_apdu: + print(apdu) print("%02u %-16s %-35s %-8s %s %s" % (inst.lchan_nr, inst._name, inst.path_str, inst.col_id, inst.col_sw, inst.processed)) print("===============================") @@ -95,7 +98,6 @@ while True: # obtain the next APDU from the source (blocking read) apdu = self.source.read() - #print(apdu) if isinstance(apdu, CardReset): self.rs.reset() @@ -113,7 +115,7 @@ if self.suppress_status and isinstance(inst, UiccStatus): continue #print(inst) - self.format_capdu(inst) + self.format_capdu(apdu, inst) option_parser = argparse.ArgumentParser(description='Osmocom pySim high-level SIM card trace decoder', formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -128,6 +130,9 @@ help=""" Don't suppress displaying STATUS APDUs. We normally suppress them as they don't provide any information that was not already received in resposne to the most recent SEELCT.""") +global_group.add_argument('--show-raw-apdu', action='store_true', dest='show_raw_apdu', + help="""Show the raw APDU in addition to its parsed form.""") + subparsers = option_parser.add_subparsers(help='APDU Source', dest='source', required=True) @@ -172,7 +177,8 @@ elif opts.source == 'gsmtap-pyshark-pcap': s = PysharkGsmtapPcap(opts.pcap_file) - tracer = Tracer(source=s, suppress_status=opts.suppress_status, suppress_select=opts.suppress_select) + tracer = Tracer(source=s, suppress_status=opts.suppress_status, suppress_select=opts.suppress_select, + show_raw_apdu=opts.show_raw_apdu) logger.info('Entering main loop...') tracer.main() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33959 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I1a3bc54c459e45ed3154479759ceecdc26db9d37 Gerrit-Change-Number: 33959 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-gprs[master]: llc: Set proper Radio Priority when submitting GRR-UNITDATA.req
by pespin 27 Jul '23

27 Jul '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33958 ) Change subject: llc: Set proper Radio Priority when submitting GRR-UNITDATA.req ...................................................................... llc: Set proper Radio Priority when submitting GRR-UNITDATA.req Change-Id: I2ace165003469c2a43d7333634171896699d5a5d --- M include/osmocom/gprs/llc/llc_private.h M src/llc/llc.c M src/llc/llc_ll.c M src/llc/llc_llgmm.c 4 files changed, 20 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/58/33958/1 diff --git a/include/osmocom/gprs/llc/llc_private.h b/include/osmocom/gprs/llc/llc_private.h index e5c197e..2d3f02f 100644 --- a/include/osmocom/gprs/llc/llc_private.h +++ b/include/osmocom/gprs/llc/llc_private.h @@ -323,7 +323,7 @@ int gprs_llc_lle_tx_xid(const struct gprs_llc_lle *lle, uint8_t *xid_payload, unsigned int xid_payload_len, bool is_cmd); int gprs_llc_lle_tx_xid_req(struct gprs_llc_lle *lle, uint8_t *l3par, unsigned int l3par_len); int gprs_llc_lle_tx_xid_resp(struct gprs_llc_lle *lle, uint8_t *l3par, unsigned int l3par_len); -int gprs_llc_lle_tx_ui(struct gprs_llc_lle *lle, uint8_t *l3_pdu, size_t l3_pdu_len, bool encryptable); +int gprs_llc_lle_tx_ui(struct gprs_llc_lle *lle, uint8_t *l3_pdu, size_t l3_pdu_len, bool encryptable, uint8_t radio_prio); int gprs_llc_lle_tx_null(const struct gprs_llc_lle *lle); /* llc_prim.c: */ diff --git a/src/llc/llc.c b/src/llc/llc.c index d58b454..cff6c16 100644 --- a/src/llc/llc.c +++ b/src/llc/llc.c @@ -255,6 +255,7 @@ int rc; struct msgb *msg; struct osmo_gprs_llc_prim *llc_prim; + const uint8_t radio_prio = 1; /* Use highest prio for GMM messages, TS 24.008 10.5.7.2 */ struct gprs_llc_pdu_decoded pdu_dec = { .sapi = lle->sapi, .fmt = OSMO_GPRS_LLC_FMT_U, @@ -287,6 +288,7 @@ llc_prim->grr.ll_pdu = msgb_l3(msg); llc_prim->grr.ll_pdu_len = msgb_l3len(msg); llc_prim->grr.unitdata_req.sapi = lle->sapi; + llc_prim->grr.unitdata_req.radio_prio = radio_prio; } /* Send GRR-UNITDATA.req */ @@ -299,6 +301,7 @@ { int rc; struct msgb *msg; + const uint8_t radio_prio = 4; /* Use lowest prio for GMM messages, TS 24.008 10.5.7.2 */ struct gprs_llc_pdu_decoded pdu_dec = { .sapi = lle->sapi, .fmt = OSMO_GPRS_LLC_FMT_U, @@ -329,6 +332,7 @@ llc_prim->grr.ll_pdu = msgb_l3(msg); llc_prim->grr.ll_pdu_len = msgb_l3len(msg); llc_prim->grr.unitdata_req.sapi = lle->sapi; + llc_prim->grr.unitdata_req.radio_prio = radio_prio; } /* Send BSSGP-DL-UNITDATA.req (SGSN) / GRR-UNITDATA.req (MS) */ @@ -340,7 +344,7 @@ 'encryptable' indicates whether particular message can be encrypted according to 3GPP TS 24.008 ยง 4.7.1.2 */ -int gprs_llc_lle_tx_ui(struct gprs_llc_lle *lle, uint8_t *l3_pdu, size_t l3_pdu_len, bool encryptable) +int gprs_llc_lle_tx_ui(struct gprs_llc_lle *lle, uint8_t *l3_pdu, size_t l3_pdu_len, bool encryptable, uint8_t radio_prio) { struct osmo_gprs_llc_prim *llc_prim; struct msgb *msg; @@ -393,6 +397,7 @@ llc_prim->grr.ll_pdu = msgb_l3(msg); llc_prim->grr.ll_pdu_len = msgb_l3len(msg); llc_prim->grr.unitdata_req.sapi = lle->sapi; + llc_prim->grr.unitdata_req.radio_prio = radio_prio; } /* Increment V(U) */ diff --git a/src/llc/llc_ll.c b/src/llc/llc_ll.c index 2df6e33..28420a7 100644 --- a/src/llc/llc_ll.c +++ b/src/llc/llc_ll.c @@ -309,7 +309,8 @@ } rc = gprs_llc_lle_tx_ui(lle, llc_prim->ll.l3_pdu, llc_prim->ll.l3_pdu_len, - llc_prim->ll.unitdata_req.apply_gea); + llc_prim->ll.unitdata_req.apply_gea, + llc_prim->ll.unitdata_req.radio_prio); ret_free: msgb_free(llc_prim->oph.msg); diff --git a/src/llc/llc_llgmm.c b/src/llc/llc_llgmm.c index f33d6de..438de51 100644 --- a/src/llc/llc_llgmm.c +++ b/src/llc/llc_llgmm.c @@ -283,6 +283,7 @@ struct gprs_llc_lle *lle; int rc; struct gprs_llc_llme *llme = gprs_llc_find_llme_by_tlli(llc_prim->llgmm.tlli); + const uint8_t radio_prio = 1; /* Use highest prio for GMM messages, TS 24.008 10.5.7.2 */ if (!llme) { LOGLLC(LOGL_NOTICE, "Rx %s: Unknown TLLI 0x%08x\n", @@ -308,7 +309,7 @@ case OSMO_GPRS_LLC_LLGM_TRIGGER_CELL_UPDATE: case OSMO_GPRS_LLC_LLGM_TRIGGER_PAGE_RESP: default: - rc = gprs_llc_lle_tx_ui(lle, NULL, 0, false); + rc = gprs_llc_lle_tx_ui(lle, NULL, 0, false, radio_prio); break; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I2ace165003469c2a43d7333634171896699d5a5d Gerrit-Change-Number: 33958 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-trx[master]: ms: restructure the va code to add rach support
by pespin 27 Jul '23

27 Jul '23
Attention is currently required from: Hoernchen. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/33944 ) Change subject: ms: restructure the va code to add rach support ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/33944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I4a5cedc8c9a3289c75ce7b914eac286e601ebed0 Gerrit-Change-Number: 33944 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 12:10:52 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-trx[master]: ms/va: add test tool and data
by pespin 27 Jul '23

27 Jul '23
Attention is currently required from: Hoernchen, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/33945 ) Change subject: ms/va: add test tool and data ...................................................................... Patch Set 9: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/33945 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ie38ed4996134e84ad0481872a743299bb442b3db Gerrit-Change-Number: 33945 Gerrit-PatchSet: 9 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Thu, 27 Jul 2023 12:09:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-gprs[master]: sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.req
by pespin 27 Jul '23

27 Jul '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33957 ) Change subject: sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.req ...................................................................... sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.req Change-Id: I632329bb1f34efb4d9263241e2cda5b559f1ff59 --- M include/osmocom/gprs/sndcp/sndcp_private.h M src/sndcp/sndcp.c M src/sndcp/sndcp_prim.c 3 files changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/57/33957/1 diff --git a/include/osmocom/gprs/sndcp/sndcp_private.h b/include/osmocom/gprs/sndcp/sndcp_private.h index 21c6a40..5630c97 100644 --- a/include/osmocom/gprs/sndcp/sndcp_private.h +++ b/include/osmocom/gprs/sndcp/sndcp_private.h @@ -151,6 +151,9 @@ /* The NSAPI we shall use on top of LLC */ uint8_t nsapi; + /* Radio Priority (MS only, used by LLC/RLCMAC), TS 24.008 10.5.7.2 */ + uint8_t radio_prio; + /* NPDU number for the GTP->SNDCP side */ uint16_t tx_npdu_nr; /* SNDCP eeceiver state */ diff --git a/src/sndcp/sndcp.c b/src/sndcp/sndcp.c index d71cac9..7e82b5d 100644 --- a/src/sndcp/sndcp.c +++ b/src/sndcp/sndcp.c @@ -222,6 +222,18 @@ return rc; } +int gprs_sndcp_sne_submit_llc_ll_unitdata_req(struct gprs_sndcp_entity *sne, uint8_t *data, unsigned int len) +{ + struct osmo_gprs_llc_prim *llc_prim_tx; + int rc; + + llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, data, len); + OSMO_ASSERT(llc_prim_tx); + llc_prim_tx->ll.unitdata_req.radio_prio = sne->radio_prio; + rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + return rc; +} + int gprs_sndcp_sne_submit_sn_xid_cnf(struct gprs_sndcp_entity *sne) { struct osmo_gprs_sndcp_prim *sndcp_prim_tx; @@ -530,7 +542,6 @@ unsigned int len; uint8_t *data; int rc, more; - struct osmo_gprs_llc_prim *llc_prim_tx; fmsg = msgb_alloc_headroom(sne->n201_u+256, 128, "SNDCP Frag"); if (!fmsg) { @@ -588,9 +599,7 @@ sch->more = more; /* Send down the stack SNDCP->LLC as LL-UNITDATA.req: */ - llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, fmsg->data, fmsg->len); - OSMO_ASSERT(llc_prim_tx); - rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + rc = gprs_sndcp_sne_submit_llc_ll_unitdata_req(sne, fmsg->data, fmsg->len); msgb_free(fmsg); /* abort in case of error, do not advance frag_nr / next_byte */ if (rc < 0) { @@ -622,7 +631,6 @@ uint8_t dcomp = 0; int rc; struct msgb *msg = msgb_alloc_headroom(npdu_len + 256, 128, "sndcp-tx"); - struct osmo_gprs_llc_prim *llc_prim_tx; memcpy(msgb_put(msg, npdu_len), npdu, npdu_len); @@ -711,9 +719,7 @@ sch->nsapi = sne->nsapi; /* Send down the stack SNDCP->LLC as LL-UNITDATA.req: */ - llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, msg->data, msg->len); - OSMO_ASSERT(llc_prim_tx); - rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + rc = gprs_sndcp_sne_submit_llc_ll_unitdata_req(sne, msg->data, msg->len); free_ret: msgb_free(msg); return rc; diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c index e371416..2e2139c 100644 --- a/src/sndcp/sndcp_prim.c +++ b/src/sndcp/sndcp_prim.c @@ -661,6 +661,8 @@ if (g_sndcp_ctx->location != OSMO_GPRS_SNDCP_LOCATION_MS) return 0; + sne->radio_prio = sndcp_prim->snsm.activate_ind.radio_prio; + /* TODO: when supporting and using LLC ABM mode, flow should go through * LL-ESTABLISH.req, as per TS 24.007 C.6 "No LLC link exists yet, * establish a link and exchange XID" -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33957 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I632329bb1f34efb4d9263241e2cda5b559f1ff59 Gerrit-Change-Number: 33957 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • ...
  • 306
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.