Change in libosmo-sccp[master]: SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD

2022-08-30 Thread Max
Attention is currently required from: neels, laforge, pespin, fixeria.
Hello Jenkins Builder, neels, laforge, fixeria,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/libosmo-sccp/+/29084

to look at the new patch set (#16).

Change subject: SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD
..

SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD

The length limit of optional Data parameter is 130 bytes according to ITU-T Rec 
Q.713 §4.2..§4.5. If we receive CR, CC or
RLSD message with bigger data - cache it if necessary and send via separate DT1 
message after connection becomes active.

While at it, clarify the order of comments in the encoding routine to match the 
spec.

Fixes: OS#5579
Change-Id: I0033faf9da393418930252233ce74d62cd1cef8a
---
M src/sccp_scoc.c
1 file changed, 133 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/29084/16
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/29084
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I0033faf9da393418930252233ce74d62cd1cef8a
Gerrit-Change-Number: 29084
Gerrit-PatchSet: 16
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Attention: neels 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in libosmo-sccp[master]: SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD

2022-08-30 Thread Max
Attention is currently required from: neels, laforge, pespin, fixeria.
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/29084 )

Change subject: SIGTRAN: cache Optional Data for SCCP CR/CC/RLSD
..


Patch Set 15:

(8 comments)

File src/sccp_scoc.c:

https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/4363d4d6_ffda9ece
PS15, Line 642: /* optional: importance */
> why is this line removed here? this is non related.
The RLC does not have optional importance field.


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/b870683f_95186f62
PS15, Line 600: if (
> Ack
We shouldn't. Shall I replace it with assert or just drop?


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/6fa8a826_fd35be4a
PS15, Line 606: } else
> remove curly braces in the if.
Actually it's better to add them to else according to 
https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/51617eeb_e7923d15
PS15, Line 630: if (xua_drop_data_check(prim, SCCP_MAX_DATA, "cache 
overrun"))
> ... […]
Done


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/f4acfafc_5ad77dad
PS15, Line 635: LOGP(DLSCCP, LOGL_ERROR, "replacing 
unsent %u bytes of optional data cache with %s optional data\n",
> NOTICE
I think it's error - this situation should not arise normally.


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/da5d2afe_a69997e6
PS15, Line 639: msgb_alloc(SCCP_MAX_DATA, "SCCP optional data cache for 
CR/CC/RLSD");
> Ack
Done


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/5d2bd69d_a2630137
PS15, Line 639: msgb_alloc(SCCP_MAX_DATA, "SCCP optional data cache for 
CR/CC/RLSD");
> Ack
Done


https://gerrit.osmocom.org/c/libosmo-sccp/+/29084/comment/699f9d67_3b1a53c1
PS15, Line 784: xua_msg_add_sccp_addr(xua, 
SUA_IEI_DEST_ADDR, &conn->calling_addr);
> why is this line removed here? this is non related.
Similar to the above: the comments are placed to match the fields order in the 
spec.



--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/29084
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I0033faf9da393418930252233ce74d62cd1cef8a
Gerrit-Change-Number: 29084
Gerrit-PatchSet: 15
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Attention: neels 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 30 Aug 2022 16:07:09 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-msc[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/29242 )

Change subject: Set working directory in systemd service file
..

Set working directory in systemd service file

By default systemd will execute service with root directory (or home directory 
for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir 
of state directory (/var/lib for system instance) instead.

Fixes: OS#5661
Change-Id: I0f942545d9e920ba8a2d8645512ec3414ab27418
---
M contrib/systemd/osmo-msc.service
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  neels: Looks good to me, but someone else must approve
  Max: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service
index 343639c..36849f7 100644
--- a/contrib/systemd/osmo-msc.service
+++ b/contrib/systemd/osmo-msc.service
@@ -8,6 +8,8 @@
 [Service]
 Type=simple
 Restart=always
+StateDirectory=osmocom
+WorkingDirectory=%S/osmocom
 ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg
 RestartSec=2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/29242
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I0f942545d9e920ba8a2d8645512ec3414ab27418
Gerrit-Change-Number: 29242
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Reviewer: roh 
Gerrit-MessageType: merged


Change in osmo-msc[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Attention is currently required from: roh.
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/29242 )

Change subject: Set working directory in systemd service file
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/29242
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I0f942545d9e920ba8a2d8645512ec3414ab27418
Gerrit-Change-Number: 29242
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Reviewer: roh 
Gerrit-Attention: roh 
Gerrit-Comment-Date: Tue, 30 Aug 2022 15:38:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/29252 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/29252
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I5117ab8d7b8542a161f69a9784a9667bda599473
Gerrit-Change-Number: 29252
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 13:09:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-cbc[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-cbc/+/29251 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/29251
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I033029a6b1f2bfa259cec74b139a33b0897fcd98
Gerrit-Change-Number: 29251
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 13:04:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-upf[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-upf/+/29250 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/29250
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I786e4a655c35617bbea523275a709e865fc86689
Gerrit-Change-Number: 29250
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 12:58:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-hnodeb[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/29249 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/29249
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I67564759f43193f4739b0b194d5f5da92e3bc6ae
Gerrit-Change-Number: 29249
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 12:56:07 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-hnbgw[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29246 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29246
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I3133dc7a687550901841755461db6020ee96d6b1
Gerrit-Change-Number: 29246
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 12:55:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/29244 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29244
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I950d84853c6737276d02b3275127b499ae567c38
Gerrit-Change-Number: 29244
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 12:50:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-mgw[master]: Set working directory in systemd service file

2022-08-30 Thread Max
Max has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/29245 )

Change subject: Set working directory in systemd service file
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29245
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I7696cd92953787591e7b4777ee79c2671326b972
Gerrit-Change-Number: 29245
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 30 Aug 2022 12:49:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration)

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13609 )

Change subject: ggsn: More logging from PCO handling (e.g. in case of 
malconfiguration)
..


Patch Set 4:

Some comment/reference to what PCO is would be helpful.
P. S> Seems like I'm unable to +1 this due to some permissions problem.


--
To view, visit https://gerrit.osmocom.org/13609
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e
Gerrit-Change-Number: 13609
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:26:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13608 )

Change subject: ggsn: Add minimalistic PAP support
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c
File ggsn/ggsn.c:

https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c@511
PS4, Line 511: static const char *pap_welcome = "Welcome to OsmoGGSN";
Maybe add version to make it even more informative?



--
To view, visit https://gerrit.osmocom.org/13608
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731
Gerrit-Change-Number: 13608
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:23:54 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/db.c: fix storing SMS with empty TP-User-Data

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13630 )

Change subject: libmsc/db.c: fix storing SMS with empty TP-User-Data
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13630/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13630/1//COMMIT_MSG@7
PS1, Line 7: libmsc/db.c: fix storing SMS with empty TP-User-Data
Is this even legitimate case? Are there such SMS messages or we should error 
out instead of adding the safeguard?



--
To view, visit https://gerrit.osmocom.org/13630
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661
Gerrit-Change-Number: 13630
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:21:23 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13629 )

Change subject: Introduce initial unit test for db_sms_* API
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13629/1/src/libmsc/db.c
File src/libmsc/db.c:

https://gerrit.osmocom.org/#/c/13629/1/src/libmsc/db.c@773
PS1, Line 773:  if (net != NULL) /* db_sms_test passes NULL, so we need to be 
tolerant */
This can be split-off into separate patch.



--
To view, visit https://gerrit.osmocom.org/13629
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3
Gerrit-Change-Number: 13629
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:10:02 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13655 )

Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/13655/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13655/1//COMMIT_MSG@25
PS1, Line 25: Preventing this would require adding an additional check.
Is there a ticket for that? If so please reference it in here otherwise create 
it and than reference :)


https://gerrit.osmocom.org/#/c/13655/1/src/libmsc/gsm_04_11.c
File src/libmsc/gsm_04_11.c:

https://gerrit.osmocom.org/#/c/13655/1/src/libmsc/gsm_04_11.c@574
PS1, Line 574:"TP-User-Data-Length %u 
(septets) "
What's the point of splitting the strings this way? We're well within the 
length limit.



--
To view, visit https://gerrit.osmocom.org/13655
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Gerrit-Change-Number: 13655
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:06:01 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: make all library-internal static buffers thread-local

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13436 )

Change subject: make all library-internal static buffers thread-local
..


Patch Set 6:

(1 comment)

https://gerrit.osmocom.org/#/c/13436/6//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13436/6//COMMIT_MSG@15
PS6, Line 15: execute the same functiosn once.  They're of course still not
typo: functions



--
To view, visit https://gerrit.osmocom.org/13436
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07
Gerrit-Change-Number: 13436
Gerrit-PatchSet: 6
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 11:00:50 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13723 )

Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. 
sequence
..


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG@24
PS4, Line 24: According to 3GPP TS 05.02, section 5.2.7, there are two 
alternative
It's better to refer to latest version of the spec.


https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG@29
PS4, Line 29: According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability
Here as well.



--
To view, visit https://gerrit.osmocom.org/13723
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284
Gerrit-Change-Number: 13723
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 10:52:56 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: lms: flush_recv: alloc buf on stack instead of heap

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13782 )

Change subject: lms: flush_recv: alloc buf on stack instead of heap
..


Patch Set 1:

> Using the stack is quicker.

What makes you think that? Do you have benchmark? I wouldn't be surprised if 
modern compiler optimize such a trivial case.


--
To view, visit https://gerrit.osmocom.org/13782
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33
Gerrit-Change-Number: 13782
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 10:49:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: lms: Remove references to ALERT loglevel

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13787 )

Change subject: lms: Remove references to ALERT loglevel
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13787
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4
Gerrit-Change-Number: 13787
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 10:47:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Remove unused var m_last_tx_overruns

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13788 )

Change subject: lms: Remove unused var m_last_tx_overruns
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13788
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311
Gerrit-Change-Number: 13788
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 10:46:39 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: cosmetic: Threads.h: Remove trailing whitespace

2019-04-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13784 )

Change subject: cosmetic: Threads.h: Remove trailing whitespace
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13784
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015
Gerrit-Change-Number: 13784
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Fri, 26 Apr 2019 10:45:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: Update MCS selection for retransmission

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13402 )

Change subject: Update MCS selection for retransmission
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/#/c/13402/1/src/coding_scheme.c
File src/coding_scheme.c:

https://gerrit.osmocom.org/#/c/13402/1/src/coding_scheme.c@131
PS1, Line 131: /* FIXME: take into account padding and special cases of 
commanded MCS (MCS-6-9 and MCS-5-7) */
> commanded MCS? do you mean demanded_mcs?
Done



--
To view, visit https://gerrit.osmocom.org/13402
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
Gerrit-Change-Number: 13402
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 27 Mar 2019 13:03:32 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Update MCS selection for retransmission

2019-03-27 Thread Max
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/13402

to look at the new patch set (#4).

Change subject: Update MCS selection for retransmission
..

Update MCS selection for retransmission

In 3GPP TS 44.060 the selection of MCS for retransmissions is defined as
separate tables (8.1.1.1 and 8.1.1.2) depending on the value of
resegmentation bit (which is opposite to the way EGPRS_ARQ are defined
in the source code). Let's follow the same idea and explicitly check for
resegmentation bit value and use separate tables. This also makes it
easier to add proper support for special cases (MCS-6-9 and MCS-5-7) and
padding in future independently for different ARQ types. The code is
also moved to c to avoid unnecessary conversions to and from cpp class.

Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/tbf_dl.cpp
5 files changed, 40 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/02/13402/4
--
To view, visit https://gerrit.osmocom.org/13402
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
Gerrit-Change-Number: 13402
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-pcu[master]: Update MCS selection for retransmission

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13402 )

Change subject: Update MCS selection for retransmission
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/13402/1/src/coding_scheme.c
File src/coding_scheme.c:

https://gerrit.osmocom.org/#/c/13402/1/src/coding_scheme.c@136
PS1, Line 136:  OSMO_ASSERT(NUM_SCHEMES - MCS1 == 9);
> May be worth adding an OSMO_STATIC_ASSERT() macro in libosmocore

Excellent idea! Please update this code once the macro is available in 
libosmocore.



--
To view, visit https://gerrit.osmocom.org/13402
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
Gerrit-Change-Number: 13402
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 27 Mar 2019 12:48:42 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Use boolean for DL resegmentation parameter

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13057 )

Change subject: Use boolean for DL resegmentation parameter
..


Patch Set 9:

(1 comment)

https://gerrit.osmocom.org/#/c/13057/8/src/pcu_main.cpp
File src/pcu_main.cpp:

https://gerrit.osmocom.org/#/c/13057/8/src/pcu_main.cpp@264
PS8, Line 264:   * can also be configured through VTY (egprs dl arq-type ...)
> consider mentioning the VTY option here, since it isn't obvious from the 
> variable name anymore.
Done



--
To view, visit https://gerrit.osmocom.org/13057
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
Gerrit-Change-Number: 13057
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Wed, 27 Mar 2019 12:46:11 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Add ARQ type helpers

2019-03-27 Thread Max
Hello Daniel Willmann, Harald Welte, osmith, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/13406

to look at the new patch set (#4).

Change subject: Add ARQ type helpers
..

Add ARQ type helpers

Add functions to check/log EGPRS ARQ type (as described in 3GPP TS
44.060 §8.1.1). Note - this requires updating previously incorrect TBF
test output.

Depends on: I85b7dc8e8786671a054af2f1e7d836b863a25e60 and
Ib39e4424f73c677b34f921917440f211e400e14f in OsmoPCU.

Change-Id: I844aca7dcd9d7f41e5975c1edd1905951f271998
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.h
M src/pcu_vty.c
M src/tbf_dl.cpp
M tests/tbf/TbfTest.err
6 files changed, 51 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/13406/4
--
To view, visit https://gerrit.osmocom.org/13406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I844aca7dcd9d7f41e5975c1edd1905951f271998
Gerrit-Change-Number: 13406
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 


Change in osmo-pcu[master]: Use boolean for DL resegmentation parameter

2019-03-27 Thread Max
Hello Pau Espin Pedrol, Daniel Willmann, Harald Welte, osmith, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/13057

to look at the new patch set (#9).

Change subject: Use boolean for DL resegmentation parameter
..

Use boolean for DL resegmentation parameter

In some places #define was used for DL resegmentation parameter, in
other int, in some other bool. Let's clarify this and always use boolean
value of resegment bit directly as it's described in 3GPP TS
44.060 - appropriate clarification added as comment to bts.h.

Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
---
M src/bts.h
M src/coding_scheme.c
M src/coding_scheme.h
M src/pcu_main.cpp
M src/pcu_vty.c
M src/tbf_dl.cpp
M tests/tbf/TbfTest.cpp
7 files changed, 17 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/57/13057/9
--
To view, visit https://gerrit.osmocom.org/13057
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
Gerrit-Change-Number: 13057
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in osmo-pcu[master]: Add ARQ type helpers

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13406 )

Change subject: Add ARQ type helpers
..


Patch Set 3:

(2 comments)

https://gerrit.osmocom.org/#/c/13406/3/src/coding_scheme.c
File src/coding_scheme.c:

https://gerrit.osmocom.org/#/c/13406/3/src/coding_scheme.c@177
PS3, Line 177: char *egprs_arq_type_name(const struct gprs_rlcmac_bts *bts)
> "const char *"?
Ack


https://gerrit.osmocom.org/#/c/13406/3/src/pcu_vty.c
File src/pcu_vty.c:

https://gerrit.osmocom.org/#/c/13406/3/src/pcu_vty.c@222
PS3, Line 222:  if (egprs_arq_type_2(bts))
> Just being curious: what's the advantage of using a function here? The 
> previous statement is shorter […]
It makes it easier to modify - see follow-up patch.



--
To view, visit https://gerrit.osmocom.org/13406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I844aca7dcd9d7f41e5975c1edd1905951f271998
Gerrit-Change-Number: 13406
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Wed, 27 Mar 2019 12:43:01 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Rewrite Packet Uplink IA Rest Octets for MBA

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12961 )

Change subject: Rewrite Packet Uplink IA Rest Octets for MBA
..

Rewrite Packet Uplink IA Rest Octets for MBA

Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.

That's partially based on reverted commit 
93d947f5e8a30acc9250c124bf9d5bb6a8863526.

Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Related: OS#3014
---
M src/encoding.cpp
1 file changed, 21 insertions(+), 20 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/encoding.cpp b/src/encoding.cpp
index b0d0467..769e049 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -257,30 +257,30 @@
 }

 static int write_ia_rest_uplink_mba(const gprs_rlcmac_ul_tbf *tbf, bitvec 
*dest, uint8_t usf,
-   uint8_t alpha, uint8_t gamma, unsigned& wp)
+   uint8_t alpha, uint8_t gamma)
 {
int rc = 0;

-   bitvec_write_field(dest, &wp, 1, 1);// Block Allocation: Not Single 
Block Allocation
-   bitvec_write_field(dest, &wp, tbf->tfi(), 5);  // TFI_ASSIGNMENT 
Temporary Flow Identity
-   bitvec_write_field(dest, &wp, 0, 1);// POLLING
-   bitvec_write_field(dest, &wp, 0, 1);// ALLOCATION_TYPE: dynamic
-   bitvec_write_field(dest, &wp, usf, 3);// USF
-   bitvec_write_field(dest, &wp, 0, 1);// USF_GRANULARITY
-   bitvec_write_field(dest, &wp, 0, 1);   // "0" power control: Not Present
-   bitvec_write_field(dest, &wp, mcs_chan_code(tbf->current_cs()), 2);
// CHANNEL_CODING_COMMAND
-   bitvec_write_field(dest, &wp, 1, 1);// TLLI_BLOCK_CHANNEL_CODING
-   if (alpha) {
-   bitvec_write_field(dest, &wp, 0x1, 1);   // ALPHA = present
-   bitvec_write_field(dest, &wp, alpha, 4);   // ALPHA
-   } else
-   bitvec_write_field(dest, &wp, 0x0, 1);   // ALPHA = not present
+   SET_1(dest); /* Multi Block Allocation */

-   bitvec_write_field(dest, &wp, gamma, 5);   // GAMMA power control 
parameter
+   rc = write_tfi_usf(dest, tbf, usf);
+   CHECK(rc);

-   /* note: there is no choise for TAI and no starting time */
-   bitvec_write_field(dest, &wp, 0, 1);   // switch TIMING_ADVANCE_INDEX = 
off
-   bitvec_write_field(dest, &wp, 0, 1);// TBF_STARTING_TIME_FLAG
+   /* 3GPP TS 44.060 Table 11.2.28.2 Channel Coding Indicator */
+   rc = bitvec_set_u64(dest, mcs_chan_code(tbf->current_cs()), 2, false); 
/* CHANNEL_CODING_COMMAND */
+   CHECK(rc);
+
+   /* TLLI_BLOCK_CHANNEL_CODING */
+   SET_1(dest); /* use coding scheme as specified by the corresponding 
CHANNEL CODING COMMAND */
+
+   rc = write_alpha_gamma(dest, alpha, gamma);
+   CHECK(rc);
+
+   /* No TIMING_ADVANCE_INDEX */
+   SET_0(dest);
+
+   /* No TBF_STARTING_TIME */
+   SET_0(dest);

return rc;
 }
@@ -520,7 +520,8 @@
bitvec_write_field(dest, &wp, 0, 2);// "0" Packet Uplink 
Assignment

if (as_ul_tbf(tbf) != NULL) {
-   rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma, wp);
+   dest->cur_bit = wp;
+   rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma);
} else {
rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma, 
ta_idx, wp);
}

--
To view, visit https://gerrit.osmocom.org/12961
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Gerrit-Change-Number: 12961
Gerrit-PatchSet: 11
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 


Change in osmo-pcu[master]: TBF-DL: cosmetic update for helper routines

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13244 )

Change subject: TBF-DL: cosmetic update for helper routines
..

TBF-DL: cosmetic update for helper routines

* use enum values where appropriate
* reformat to proper code style to improve readability

Change-Id: If1d2bc69b0d43fc520e579457007704b7975117e
---
M src/tbf_dl.cpp
1 file changed, 32 insertions(+), 38 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 04c6499..08df05a 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -688,7 +688,7 @@
 * the current limit.
 */
cs = m_rlc.block(index)->cs_current_trans;
-   GprsCodingScheme &cs_init = m_rlc.block(index)->cs_init;
+   enum CodingScheme cs_init = m_rlc.block(index)->cs_init;
bsns[0] = index;
num_bsns = 1;

@@ -702,11 +702,10 @@
 * if the intial mcs is 8 and retransmission mcs is either 6 or 3
 * we have to include the padding of 6 octets in first segment
 */
-   if ((CodingScheme(cs_init) == MCS8) &&
-   (CodingScheme(cs) == MCS6 ||
-   CodingScheme(cs) == MCS3)) {
+   if ((cs_init == MCS8) &&
+   (cs == MCS6 || cs == MCS3)) {
if (spb_status == EGPRS_RESEG_DL_DEFAULT ||
-   spb_status == EGPRS_RESEG_SECOND_SEG_SENT)
+   spb_status == EGPRS_RESEG_SECOND_SEG_SENT)
need_padding  = true;
} else if (num_bsns == 1) {
/* TODO: remove the conditional when MCS-6 padding isn't
@@ -1248,8 +1247,12 @@
egprs_rlc_dl_reseg_bsn_state *block_status_dl =
&rlc_data->spb_status.block_status_dl;

-   GprsCodingScheme &cs_current_trans = m_rlc.block(bsn)->cs_current_trans;
-   GprsCodingScheme &cs_init = m_rlc.block(bsn)->cs_init;
+   enum CodingScheme cs_init = CodingScheme(rlc_data->cs_init);
+   enum CodingScheme cs_current_trans = 
CodingScheme(rlc_data->cs_current_trans);
+
+   enum HeaderType ht_cs_init = rlc_data->cs_init.headerTypeData();
+   enum HeaderType ht_cs_current_trans = 
rlc_data->cs_current_trans.headerTypeData();
+
*block_data = &rlc_data->block[0];

/*
@@ -1259,10 +1262,9 @@
 * MCS8: second segment starts at 31
 * MCS4: second segment starts at 44/2 = 22
 */
-   if (cs_current_trans.headerTypeData() ==
-   HEADER_EGPRS_DATA_TYPE_3) {
+   if (ht_cs_current_trans == HEADER_EGPRS_DATA_TYPE_3) {
if (*block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) {
-   switch (CodingScheme(cs_init)) {
+   switch (cs_init) {
case MCS6 :
case MCS9 :
*block_data = &rlc_data->block[37];
@@ -1281,21 +1283,17 @@
LOGPTBFDL(this, LOGL_ERROR,
  "FIXME: Software error: hit invalid 
condition. "
  "headerType(%d) blockstatus(%d) 
cs(%s) PLEASE FIX!\n",
- cs_current_trans.headerTypeData(),
+ ht_cs_current_trans,
  *block_status_dl, mcs_name(cs_init));
break;

}
return EGPRS_RESEG_SECOND_SEG_SENT;
-   } else if ((cs_init.headerTypeData() ==
-   HEADER_EGPRS_DATA_TYPE_1) ||
-   (cs_init.headerTypeData() ==
-   HEADER_EGPRS_DATA_TYPE_2)) {
+   } else if ((ht_cs_init == HEADER_EGPRS_DATA_TYPE_1) ||
+  (ht_cs_init == HEADER_EGPRS_DATA_TYPE_2)) {
return EGPRS_RESEG_FIRST_SEG_SENT;
-   } else if ((CodingScheme(cs_init) ==
-   MCS4) &&
-   (CodingScheme(cs_current_trans) ==
-   MCS1)) {
+   } else if ((cs_init == MCS4) &&
+  (cs_current_trans == MCS1)) {
return EGPRS_RESEG_FIRST_SEG_SENT;
}
}
@@ -1320,34 +1318,30 @@
 enum egprs_rlcmac_dl_spb gprs_rlcmac_dl_tbf::get_egprs_dl_spb(const int bsn)
 {
struct gprs_rlc_data *rlc_data = m_rlc.block(bsn);
-   egprs_rlc_dl_reseg_bsn_state block_status_dl =
-   rlc_data->spb_status.block_status_dl;
+   egprs_rlc_dl_reseg_bsn_state block_status_dl = 
rlc_data->spb_status.block_status_dl;

-   GprsCodingScheme &cs_

Change in osmo-pcu[master]: Fix Channel Coding Command for MCS

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13216 )

Change subject: Fix Channel Coding Command for MCS
..

Fix Channel Coding Command for MCS

Previously result of ".to_num() - 1" was used without any checks which
means that in case of to_num() returning zero we would effectively try
to encode (uint8_t)(-1).

Let's fix this by using proper mcs_chan_code() function which returns
Channel Coding Command for MCS without the need to further correct it
and adjust expected tests output accordingly.

Change-Id: I868062a81fffe6714a811c032215f25a79259905
---
M src/encoding.cpp
M tests/tbf/TbfTest.cpp
M tests/types/TypesTest.cpp
M tests/types/TypesTest.ok
4 files changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/encoding.cpp b/src/encoding.cpp
index 9920b46..b0d0467 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -268,7 +268,7 @@
bitvec_write_field(dest, &wp, usf, 3);// USF
bitvec_write_field(dest, &wp, 0, 1);// USF_GRANULARITY
bitvec_write_field(dest, &wp, 0, 1);   // "0" power control: Not Present
-   bitvec_write_field(dest, &wp, tbf->current_cs().to_num() - 1, 2);// 
CHANNEL_CODING_COMMAND
+   bitvec_write_field(dest, &wp, mcs_chan_code(tbf->current_cs()), 2);
// CHANNEL_CODING_COMMAND
bitvec_write_field(dest, &wp, 1, 1);// TLLI_BLOCK_CHANNEL_CODING
if (alpha) {
bitvec_write_field(dest, &wp, 0x1, 1);   // ALPHA = present
@@ -315,7 +315,7 @@
CHECK(rc);

/* 3GPP TS 44.060 §12.10d EGPRS Modulation and coding Scheme 
description: */
-   rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 4, false); /* 
EGPRS CHANNEL_CODING_COMMAND */
+   rc = bitvec_set_u64(dest, mcs_chan_code(tbf->current_cs()), 4, false); 
/* EGPRS CHANNEL_CODING_COMMAND */
CHECK(rc);

/* TLLI_BLOCK_CHANNEL_CODING */
@@ -571,7 +571,7 @@

if (!use_egprs) {
bitvec_write_field(dest, &wp,0x0,1); // Message escape
-   bitvec_write_field(dest, &wp,tbf->current_cs().to_num()-1, 2); 
// CHANNEL_CODING_COMMAND
+   bitvec_write_field(dest, &wp, mcs_chan_code(tbf->current_cs()), 
2); // CHANNEL_CODING_COMMAND
bitvec_write_field(dest, &wp,0x1,1); // 
TLLI_BLOCK_CHANNEL_CODING
write_ta_ie(dest, wp,tbf->ta(), ta_idx, ta_ts);
} else { /* EPGRS */
@@ -579,7 +579,7 @@
bitvec_write_field(dest, &wp,0x0,2); // EGPRS message contents
bitvec_write_field(dest, &wp,0x0,1); // No 
CONTENTION_RESOLUTION_TLLI
bitvec_write_field(dest, &wp,0x0,1); // No COMPACT reduced MA
-   bitvec_write_field(dest, &wp,tbf->current_cs().to_num()-1, 4); 
// EGPRS Modulation and Coding IE
+   bitvec_write_field(dest, &wp, mcs_chan_code(tbf->current_cs()), 
4); // EGPRS Modulation and Coding IE
/* 0: no RESEGMENT, 1: Segmentation*/
bitvec_write_field(dest, &wp, 0x1, 1);
write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size
@@ -809,7 +809,7 @@
struct gprs_rlcmac_ul_tbf *tbf, bool is_final)
 {

-   bitvec_write_field(dest, &wp, tbf->current_cs().to_num() - 1, 2); // 
CHANNEL_CODING_COMMAND
+   bitvec_write_field(dest, &wp, mcs_chan_code(tbf->current_cs()), 2); // 
CHANNEL_CODING_COMMAND
write_packet_ack_nack_desc_gprs(bts, dest, wp, tbf->window(), is_final);

bitvec_write_field(dest, &wp, 1, 1); // 1: have 
CONTENTION_RESOLUTION_TLLI
@@ -991,7 +991,7 @@
bitvec_write_field(dest, &wp, 0, 2); // fixed 00
/* CHANNEL_CODING_COMMAND */
bitvec_write_field(dest, &wp,
-   tbf->current_cs().to_num() - 1, 4);
+   mcs_chan_code(tbf->current_cs()), 4);
/* 0: no RESEGMENT, 1: Segmentation*/
bitvec_write_field(dest, &wp, 1, 1);
bitvec_write_field(dest, &wp, 1, 1); // PRE_EMPTIVE_TRANSMISSION, TODO: 
This resembles GPRS, change it?
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 6dc802c..151e7fa 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -739,7 +739,7 @@

struct msgb *msg1 = ul_tbf->create_ul_ack(*fn, ts_no);

-   static uint8_t exp1[] = { 0x40, 0x24, 0x01, 0x3f, 0x3e, 0x24, 0x46, 
0x68, 0x90, 0x87, 0xb0, 0x06,
+   static uint8_t exp1[] = { 0x40, 0x24, 0x01, 0x03, 0x3e, 0x24, 0x46, 
0x68, 0x90, 0x87, 0xb0, 0x06,
  0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b
};

@@ -766,7 +766,7 @@

msg1 = ul_tbf->create_ul_ack(*

Change in osmo-pcu[master]: Update IA Rest Octets encoding

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13245 )

Change subject: Update IA Rest Octets encoding
..

Update IA Rest Octets encoding

Write initial bits of 3GPP TS 44.018 §10.5.2.16 IA Rest Octets the same
way as  write_ia_rest_*() routines do.

This should also fix the issue addressed in
I75dd5bebc74eea85edf9582607c774d0bba0d2a6 initially by properly encoding
L/H bits.

Change-Id: I7ed5270bf95c3f6e9e026ff447eef8539f6f0314
---
M src/encoding.cpp
1 file changed, 13 insertions(+), 17 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/encoding.cpp b/src/encoding.cpp
index b460d41..1b325b4 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -497,41 +497,37 @@
plen = wp / 8;

/* 3GPP TS 44.018 §10.5.2.16 IA Rest Octets */
+   dest->cur_bit = wp;
if (downlink) {
if (!as_dl_tbf(tbf)) {
LOGP(DRLCMACDL, LOGL_ERROR, "Cannot encode DL IMMEDIATE 
ASSIGNMENT without TBF\n");
return -EINVAL;
}

-   dest->cur_bit = wp;
rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, polling, 
gsm48_ta_is_valid(ta), fn, alpha, gamma,
ta_idx);
} else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || (burst_type 
== GSM_L1_BURST_TYPE_ACCESS_2))) {
-   bitvec_write_field(dest, &wp, 1, 2);/* LH */
-   bitvec_write_field(dest, &wp, 0, 2);/* 0 EGPRS Uplink 
Assignment */
-   bitvec_write_field(dest, &wp, ra & 0x1F, 5);/* Extended RA 
*/
-   bitvec_write_field(dest, &wp, 0, 1);/* Access technology 
Request */
+   SET_L(dest); SET_H(dest); // "LH"
+   SET_0(dest); SET_0(dest); // "00" < EGPRS Packet Uplink 
Assignment >
+   rc = bitvec_set_u64(dest, ra & 0x1F, 5, false); // < Extended 
RA >
+   CHECK(rc);

-   if (as_ul_tbf(tbf) != NULL) {
-   dest->cur_bit = wp;
+   SET_0(dest); // No < Access Technologies Request struct >
+
+   if (as_ul_tbf(tbf) != NULL)
rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), 
dest, usf, alpha, gamma, ta_idx);
-   } else {
-   dest->cur_bit = wp;
+   else
rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, 
gamma);
-   }
} else {
OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled());

-   bitvec_write_field(dest, &wp, 3, 2);// "HH"
-   bitvec_write_field(dest, &wp, 0, 2);// "0" Packet Uplink 
Assignment
+   SET_H(dest); SET_H(dest); // "HH"
+   SET_0(dest); SET_0(dest); // "00" < Packet Uplink Assignment >

-   if (as_ul_tbf(tbf) != NULL) {
-   dest->cur_bit = wp;
+   if (as_ul_tbf(tbf) != NULL)
rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma, ta_idx);
-   } else {
-   dest->cur_bit = wp;
+   else
rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma);
-   }
}

if (rc < 0) {

--
To view, visit https://gerrit.osmocom.org/13245
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7ed5270bf95c3f6e9e026ff447eef8539f6f0314
Gerrit-Change-Number: 13245
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 


Change in osmo-pcu[master]: TBF: update MCS counters

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13243 )

Change subject: TBF: update MCS counters
..

TBF: update MCS counters

* use enum CodingScheme directly instead of converting it to class and
  back
* drop useless mode check
* log errorneous update attempt

Change-Id: I763136c2f356d63aa3d28d09c57fd5faf5336258
---
M src/tbf.h
M src/tbf_dl.cpp
M src/tbf_ul.cpp
3 files changed, 116 insertions(+), 126 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/tbf.h b/src/tbf.h
index dc0b050..0a58862 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -648,7 +648,7 @@
int abort();
uint16_t window_size() const;
void set_window_size();
-   void update_coding_scheme_counter_dl(const GprsCodingScheme cs);
+   void update_coding_scheme_counter_dl(enum CodingScheme cs);

/* TODO: add the gettimeofday as parameter */
struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx);
@@ -751,7 +751,7 @@

uint16_t window_size() const;
void set_window_size();
-   void update_coding_scheme_counter_ul(const GprsCodingScheme cs);
+   void update_coding_scheme_counter_ul(enum CodingScheme cs);

/* Please note that all variables here will be reset when changing
 * from WAIT RELEASE back to FLOW state (re-use of TBF).
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 13ef143..04c6499 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1364,68 +1364,63 @@
m_window.set_ws(ws);
 }

-void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const 
GprsCodingScheme cs)
+void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(enum CodingScheme cs)
 {
-   uint8_t coding_scheme = 0;
-
-   coding_scheme = CodingScheme(cs);
-   if (mcs_is_gprs(cs)) {
-   switch (coding_scheme) {
-   case CS1 :
-   bts->gprs_dl_cs1();
-   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]);
-   break;
-   case CS2 :
-   bts->gprs_dl_cs2();
-   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]);
-   break;
-   case CS3 :
-   bts->gprs_dl_cs3();
-   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]);
-   break;
-   case CS4 :
-   bts->gprs_dl_cs4();
-   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]);
-   break;
-   }
-   } else {
-   switch (coding_scheme) {
-   case MCS1 :
-   bts->egprs_dl_mcs1();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]);
-   break;
-   case MCS2 :
-   bts->egprs_dl_mcs2();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]);
-   break;
-   case MCS3 :
-   bts->egprs_dl_mcs3();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]);
-   break;
-   case MCS4 :
-   bts->egprs_dl_mcs4();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]);
-   break;
-   case MCS5 :
-   bts->egprs_dl_mcs5();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]);
-   break;
-   case MCS6 :
-   bts->egprs_dl_mcs6();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]);
-   break;
-   case MCS7 :
-   bts->egprs_dl_mcs7();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]);
-   break;
-   case MCS8 :
-   bts->egprs_dl_mcs8();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]);
-   break;
-   case MCS9 :
-   bts->egprs_dl_mcs9();
-   
rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]);
-   break;
-   }
+   switch (cs) {
+   case CS1:
+   bts->gprs_dl_cs1();
+   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]);
+   break;
+   case CS2:
+   bts->gprs_dl_cs2();
+   rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2

Change in osmo-pcu[master]: Rewrite Packet Uplink IA Rest Octets for SBA

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12955 )

Change subject: Rewrite Packet Uplink IA Rest Octets for SBA
..

Rewrite Packet Uplink IA Rest Octets for SBA

Use bitvec_set_*() directly without external write pointer tracking to
simplify the code. This is part of IA Rest Octets (3GPP TS 44.018
§10.5.2.16) which is the last part of the message so it should not
interfere with the rest of encoding functions.

The difference in the expected test output is due to proper handling of
TAI which should not be transmitted for SBA according to the Note in
Table 10.5.2.16.1 in 3GPP TS 44.018.

The change was manually tested against real mobile phone using options
'gprs mode gprs' in osmo-bsc.cfg and 'two-phase-access' in osmo-pcu.cfg
to make sure appropriate code path is actually triggered.

That's partially based on reverted commit 
93d947f5e8a30acc9250c124bf9d5bb6a8863526.

Change-Id: I97d53c27c1ca9e032d431b3aa7f915027d63ddc0
Related: OS#3014
---
M src/encoding.cpp
M tests/types/TypesTest.cpp
M tests/types/TypesTest.ok
3 files changed, 24 insertions(+), 17 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/encoding.cpp b/src/encoding.cpp
index 769e049..55838fb 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -233,25 +233,31 @@
return rc;
 }

-static int write_ia_rest_uplink_sba(bitvec *dest, uint32_t fn, uint8_t alpha, 
uint8_t gamma, int8_t ta_idx,
-   unsigned& wp)
+/* 3GPP TS 44.018 Table 10.5.2.16.1 < Packet Uplink Assignment > -- Single 
Block Allocation */
+static int write_ia_rest_uplink_sba(bitvec *dest, uint32_t fn, uint8_t alpha, 
uint8_t gamma)
 {
int rc = 0;

-   bitvec_write_field(dest, &wp, 0, 1); // Block Allocation: Single Block 
Allocation
+   SET_0(dest); /* Single Block Allocation */
+   rc = write_alpha_gamma(dest, alpha, gamma);
+   CHECK(rc);

-   if (alpha) {
-   bitvec_write_field(dest, &wp, 0x1, 1);   // ALPHA = present
-   bitvec_write_field(dest, &wp, alpha, 4);
-   } else
-   bitvec_write_field(dest, &wp, 0x0, 1);   // ALPHA = not present
+   /* A 'Timing Advance index' shall not be allocated at a Single Block 
allocation.
+  A 'TBF Starting Time' shall be allocated at a Single Block 
allocation. */
+   SET_0(dest);
+   SET_1(dest);

-   bitvec_write_field(dest, &wp, gamma, 5);   // GAMMA power control 
parameter
-   write_tai(dest, wp, ta_idx);
-   bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG
-   bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5); // T1'
-   bitvec_write_field(dest, &wp, fn % 51, 6);   // T3
-   bitvec_write_field(dest, &wp, fn % 26, 5);   // T2
+   rc = write_tbf_start_time(dest, fn);
+   CHECK(rc);
+
+/* No P0 nor PR_MODE */
+   SET_L(dest);
+
+   /* No Additions for R99 */
+   SET_L(dest);
+
+/* No Additions for Rel-6 */
+   SET_L(dest);

return rc;
 }
@@ -523,7 +529,8 @@
dest->cur_bit = wp;
rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma);
} else {
-   rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma, 
ta_idx, wp);
+   dest->cur_bit = wp;
+   rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma);
}
}

diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 4879424..822bd51 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -514,7 +514,7 @@
 0x23, /* TA */
 0x00, /* 0-length §10.5.2.21 Mobile Allocation 
*/
 /* ETSI TS 44.018 §10.5.2.16 IA Rest Octets */
-0xc5, 0xd1, 0x08, 0x0b, 0x5b, 0x2b, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };
+0xc5, 0xd0, 0x80, 0xb5, 0xab, 0x2b, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };

check_imm_ass(NULL, false, GSM_L1_BURST_TYPE_ACCESS_0, res, 
sizeof(res), "ia_rest_uplink(SBA)");
 }
diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok
index dd7dc4c..c6974d5 100644
--- a/tests/types/TypesTest.ok
+++ b/tests/types/TypesTest.ok
@@ -11,7 +11,7 @@
 [11] UL Immediate Assignment :
06 3f 10 0d 23 6d 0d 03 18 23 00 c8 02 1b a0 2b 2b 2b 2b 2b 2b 2b 2b
 [11] UL Immediate Assignment :
-   06 3f 10 0d 23 6d 0d 03 18 23 00 c5 d1 08 0b 5b 2b 2b 2b 2b 2b 2b 2b
+   06 3f 10 0d 23 6d 0d 03 18 23 00 c5 d0 80 b5 ab 2b 2b 2b 2b 2b 2b 2b
 [11] UL Immediate Assignment :
06 3f 10 0d 23 6d 7f 03 18 23 00 46 97 40 0b

Change in osmo-pcu[master]: Use Timing Advance Index in UL assignments

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12956 )

Change subject: Use Timing Advance Index in UL assignments
..

Use Timing Advance Index in UL assignments

Write TAI (if available) when generating Rest Octets for UL
Assignment. This should not affect actual PCU behavior because TAI is
not yet supported by upper layers but we have to adjust corresponding
tests anyway.

That's updated version of reverted commit.

Change-Id: I69407793bdb863be5fc42adadf75842d22f27335
Related: OS#3014
---
M src/encoding.cpp
M tests/types/TypesTest.cpp
M tests/types/TypesTest.ok
3 files changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/encoding.cpp b/src/encoding.cpp
index 55838fb..b460d41 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -263,7 +263,7 @@
 }

 static int write_ia_rest_uplink_mba(const gprs_rlcmac_ul_tbf *tbf, bitvec 
*dest, uint8_t usf,
-   uint8_t alpha, uint8_t gamma)
+   uint8_t alpha, uint8_t gamma, int8_t ta_idx)
 {
int rc = 0;

@@ -282,8 +282,8 @@
rc = write_alpha_gamma(dest, alpha, gamma);
CHECK(rc);

-   /* No TIMING_ADVANCE_INDEX */
-   SET_0(dest);
+   rc = write_ta_index(dest, ta_idx);
+   CHECK(rc);

/* No TBF_STARTING_TIME */
SET_0(dest);
@@ -311,7 +311,7 @@
 }

 static int write_ia_rest_egprs_uplink_sba(const gprs_rlcmac_ul_tbf *tbf, 
bitvec * dest, uint8_t usf,
- uint8_t alpha, uint8_t gamma)
+ uint8_t alpha, uint8_t gamma, int8_t 
ta_idx)
 {
int rc = 0;

@@ -339,8 +339,8 @@
rc = write_alpha_gamma(dest, alpha, gamma);
CHECK(rc);

-   /* No TIMING_ADVANCE_INDEX */
-   SET_0(dest);
+   rc = write_ta_index(dest, ta_idx);
+   CHECK(rc);

/* No TBF_STARTING_TIME */
SET_0(dest);
@@ -514,7 +514,7 @@

if (as_ul_tbf(tbf) != NULL) {
dest->cur_bit = wp;
-   rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), 
dest, usf, alpha, gamma);
+   rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), 
dest, usf, alpha, gamma, ta_idx);
} else {
dest->cur_bit = wp;
rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, 
gamma);
@@ -527,7 +527,7 @@

if (as_ul_tbf(tbf) != NULL) {
dest->cur_bit = wp;
-   rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma);
+   rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, 
usf, alpha, gamma, ta_idx);
} else {
dest->cur_bit = wp;
rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma);
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 822bd51..589f156 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -497,7 +497,7 @@
 0x23, /* TA */
 0x00, /* 0-length §10.5.2.21 Mobile Allocation 
*/
 /* ETSI TS 44.018 §10.5.2.16 IA Rest Octets */
-0xc8, 0x02, 0x1b, 0xa0, 0x2b, 0x2b, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };
+0xc8, 0x02, 0x1b, 0xa2, 0x0b, 0x2b, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };

check_imm_ass(tbf, false, GSM_L1_BURST_TYPE_ACCESS_0, res, sizeof(res), 
"ia_rest_uplink(MBA)");
 }
@@ -537,7 +537,7 @@
 0x23, /* TA */
 0x00, /* 0-length §10.5.2.21 Mobile Allocation 
*/
 /* ETSI TS 44.018 §10.5.2.16 IA Rest Octets */
-0x46, 0xa0, 0x08, 0x00, 0x17, 0x40, 0x2b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };
+0x46, 0xa0, 0x08, 0x00, 0x17, 0x44, 0x0b, 
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, };

check_imm_ass(tbf, false, GSM_L1_BURST_TYPE_ACCESS_1, res, sizeof(res), 
"ia_rest_egprs_uplink(SBA)");
 }
diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok
index c6974d5..a5c58b8 100644
--- a/tests/types/TypesTest.ok
+++ b/tests/types/TypesTest.ok
@@ -9,13 +9,13 @@
 [11] DL Immediate Assignment :
06 3f 30 0d 23 6d 7f 03 18 23 00 d0 00 00 00 08 17 47 08 0b 5b 2b 2b
 [11] UL Immediate Assignment :
-   06 3f 10 0d 23 6d 0d 03 18 23 00 c8 02 1b a0 2b 2b 2b 2b 2b 2b 2b 2b
+   06 3f 10 0d 23 6d 0d 03 18 23 00 c8 02 1b a2 0b 2b 2b 2b 2b 2b 2b 2b
 [11] UL Immediate Assignment :
06 3f 10 0d 23 6d 0d 03 18 23 00 c5 d0 80 b5 ab 2b 2b 2b 2b 2b 2b 2b
 [11] UL Immediate Assignment :
06 3f 10 0d 23 6d 7f 03 18 23 00 46 97 4

Change in osmo-pcu[master]: MCS: add Channel Coding Command encoder

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13215 )

Change subject: MCS: add Channel Coding Command encoder
..


Patch Set 6:

(1 comment)

Let's do it in a separate patch though to avoid going through weel-long review 
cycle again over essentially cosmetic change.

https://gerrit.osmocom.org/#/c/13215/6/tests/tbf/TbfTest.cpp
File tests/tbf/TbfTest.cpp:

https://gerrit.osmocom.org/#/c/13215/6/tests/tbf/TbfTest.cpp@2740
PS6, Line 2740: 
OSMO_ASSERT(mcs_chan_code(tbf->m_rlc.block(bsn)->cs_current_trans) == cs - 1); \
> This new check looks really cryptic, at least it deserves come comment.
I don't think it looks any more cryptic than before but adding comment won't 
hurt.



--
To view, visit https://gerrit.osmocom.org/13215
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I127fb29f5aaf77a7f6c4c565dfeb3b711af9845d
Gerrit-Change-Number: 13215
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 27 Mar 2019 12:32:00 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: MCS: add Channel Coding Command encoder

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13215 )

Change subject: MCS: add Channel Coding Command encoder
..

MCS: add Channel Coding Command encoder

Add function to encode MCS value as proper EDGE or GPRS Channel Coding
value according to 3GPP TS 44.060 and corresponding helpers.

Use it for everything except IA Rest Octet encoding which is done in a
follow-up patches to make sure that we distinguish between
encoding-related changes to test output and unrelated changes.

Change-Id: I127fb29f5aaf77a7f6c4c565dfeb3b711af9845d
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/gprs_ms.cpp
M tests/ms/MsTest.cpp
M tests/tbf/TbfTest.cpp
7 files changed, 31 insertions(+), 20 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index 4a5d0d4..a4ae882 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -64,6 +64,19 @@
return false;
 }

+/* Return 3GPP TS 44.060 §12.10d (EDGE) or Table 11.2.28.2 (GPRS) Channel 
Coding Command value */
+uint8_t mcs_chan_code(enum CodingScheme cs)
+{
+   if (mcs_is_gprs(cs))
+   return cs - CS1;
+
+   if (mcs_is_edge(cs))
+   return cs - MCS1;
+
+   /* Defaults to (M)CS1 */
+   return 0;
+}
+
 static struct {
struct {
uint8_t data_header_bits;
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index 3a9ef25..aac4bba 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -37,6 +37,8 @@
 bool mcs_is_edge(enum CodingScheme cs);
 bool mcs_is_edge_gmsk(enum CodingScheme cs);

+uint8_t mcs_chan_code(enum CodingScheme cs);
+
 enum HeaderType {
HEADER_INVALID,
HEADER_GPRS_CONTROL,
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index 8e6593b..a149f81 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -67,10 +67,7 @@
const GprsCodingScheme 
demanded_mcs,
const unsigned arq_type)
 {
-   OSMO_ASSERT(mcs.to_num() > 0);
-   OSMO_ASSERT(demanded_mcs.to_num() > 0);
-
-   return egprs_mcs_retx_tbl[arq_type][mcs.to_num() - 
1][demanded_mcs.to_num() - 1];
+   return 
egprs_mcs_retx_tbl[arq_type][mcs_chan_code(mcs)][mcs_chan_code(demanded_mcs)];
 }

 static struct {
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 728ffd6..d5604fb 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -82,6 +82,7 @@
enum CodingScheme m_scheme;
 };

+// FIXME: remove once < comparison operator below is no longer necessary
 inline uint8_t GprsCodingScheme::to_num() const
 {
if (mcs_is_gprs(m_scheme))
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index f8f6227..19f2ecb 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -523,7 +523,7 @@
m_nack_rate_dl = error_rate;

if (error_rate > bts_data->cs_adj_upper_limit) {
-   if (m_current_cs_dl.to_num() > 1) {
+   if (mcs_chan_code(m_current_cs_dl) > 0) {
m_current_cs_dl.dec(mode());
LOGP(DRLCMACDL, LOGL_INFO,
"MS (IMSI %s): High error rate %d%%, "
@@ -621,7 +621,7 @@
int low;
int high;
GprsCodingScheme new_cs_ul = m_current_cs_ul;
-   uint8_t current_cs_num = m_current_cs_ul.to_num();
+   uint8_t current_cs = mcs_chan_code(m_current_cs_ul);

bts_data = m_bts->bts_data();

@@ -632,8 +632,6 @@
return;
}

-   OSMO_ASSERT(current_cs_num > 0);
-
if (!m_current_cs_ul) {
LOGP(DRLCMACMEAS, LOGL_ERROR,
 "Unable to update UL (M)CS because it's not set: %s\n",
@@ -651,15 +649,15 @@
old_link_qual = meas->link_qual;

if (mcs_is_gprs(m_current_cs_ul)) {
-   if (current_cs_num > MAX_GPRS_CS)
-   current_cs_num = MAX_GPRS_CS;
-   low  = bts_data->cs_lqual_ranges[current_cs_num-1].low;
-   high = bts_data->cs_lqual_ranges[current_cs_num-1].high;
+   if (current_cs >= MAX_GPRS_CS)
+   current_cs = MAX_GPRS_CS - 1;
+   low  = bts_data->cs_lqual_ranges[current_cs].low;
+   high = bts_data->cs_lqual_ranges[current_cs].high;
} else if (mcs_is_edge(m_current_cs_ul)) {
-   if (current_cs_num > MAX_EDGE_MCS)
-   current_cs_num = MAX_EDGE_MCS;
-   low  = bts_data->mcs_lqual_ranges[current_cs_num-1].low;
-   high = bts_data->mcs_lqual_ranges[current_cs_num-1].high;
+   if (current_cs >= MAX

Change in osmo-bsc[master]: nanobts: use libosmocore's osmo_store*() for OML attr. patching

2019-03-27 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13418 )

Change subject: nanobts: use libosmocore's osmo_store*() for OML attr. patching
..

nanobts: use libosmocore's osmo_store*() for OML attr. patching

This slightly simplifies things by making endianness more obvious and
removing abstraction.

Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 3 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c 
b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index d674c18..be40410 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -25,15 +25,6 @@
 #include 
 #include 

-static void patch_16(uint8_t *data, const uint16_t val)
-{
-   memcpy(data, &val, sizeof(val));
-}
-
-static void patch_32(uint8_t *data, const uint32_t val)
-{
-   memcpy(data, &val, sizeof(val));
-}

 struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
 {
@@ -213,11 +204,11 @@
msgb_tl16v_put(msgb, NM_ATT_IPACC_NSVCI, 2, buf);

/* remote udp port */
-   patch_16(&buf[0], htons(bts->gprs.nsvc[0].remote_port));
+   osmo_store16be(bts->gprs.nsvc[0].remote_port, &buf[0]);
/* remote ip address */
-   patch_32(&buf[2], htonl(bts->gprs.nsvc[0].remote_ip));
+   osmo_store32be(bts->gprs.nsvc[0].remote_ip, &buf[2]);
/* local udp port */
-   patch_16(&buf[6], htons(bts->gprs.nsvc[0].local_port));
+   osmo_store16be(bts->gprs.nsvc[0].local_port, &buf[6]);
msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_LINK_CFG, 8, buf);

return msgb;

--
To view, visit https://gerrit.osmocom.org/13418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Gerrit-Change-Number: 13418
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: dexter 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-bsc[master]: nanobts: use libosmocore's osmo_store*() for OML attr. patching

2019-03-27 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13418 )

Change subject: nanobts: use libosmocore's osmo_store*() for OML attr. patching
..


Patch Set 1:

(1 comment)

Not sure this will have a chance to significantly improve until we have some 
actual users running Osmocom stack on Power processors (or alike).

https://gerrit.osmocom.org/#/c/13418/1/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
File src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c:

https://gerrit.osmocom.org/#/c/13418/1/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c@202
PS1, Line 202:  buf[0] = bts->gprs.nsvc[0].nsvci >> 8;
> your assessment appears correct.  This should be fixed in an independent 
> patch/fix.
I agree. Ideally we should also try to build and use it on some BE CPU (Power 
9?) - I'm pretty sure this will reveal more issues where code compiles fine but 
does not do what's expected. For example in OsmoBTS pcu_sock.c (and it's copy 
in OsmoBSC) there're warnings about *l_tbf_ext endianness which seems to be due 
to the way PCU in nanobts expects that data.



--
To view, visit https://gerrit.osmocom.org/13418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Gerrit-Change-Number: 13418
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: dexter 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 27 Mar 2019 12:26:28 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 7: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 14:56:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Add vty option to globally enable LCLS

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13421 )

Change subject: Add vty option to globally enable LCLS
..


Patch Set 5:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibb587e6ae47cff71f5bf2e2d22c1da86cd7e1762
Gerrit-Change-Number: 13421
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 14:48:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 6:

(1 comment)

Btw, is there stable URL which could use instead of 
https://jenkins.osmocom.org/jenkins/job/Osmocom-build-tags-against-master/10/console
 to check the results of latest test?

https://gerrit.osmocom.org/#/c/13415/6/scripts/osmocom-build-old-tags-against-master.sh
File scripts/osmocom-build-old-tags-against-master.sh:

https://gerrit.osmocom.org/#/c/13415/6/scripts/osmocom-build-old-tags-against-master.sh@5
PS6, Line 5:
Btw, is there stable URL which could use instead of 
https://jenkins.osmocom.org/jenkins/job/Osmocom-build-tags-against-master/10/console
 to check the results of latest test?

If so than it's better to put it in here.



--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 6
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 14:36:04 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 6: Code-Review+1

Neat. Now it's rather obvious that we should make OsmoSGSN release so we have 
at least one version which is working with current libosmocore master :)


--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 6
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 14:33:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Autofill LCLS parameters for A-interface transactions

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13422


Change subject: Autofill LCLS parameters for A-interface transactions
..

Autofill LCLS parameters for A-interface transactions

That's experimental patch to facilitate testing of BSC implementation of
LCLS.

Change-Id: I35ae6b6ca04925c8d300bc1a0269af00eac727f3
---
M include/osmocom/msc/debug.h
M include/osmocom/msc/transaction.h
M src/libmsc/a_iface.c
M src/libmsc/transaction.c
4 files changed, 62 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/13422/1

diff --git a/include/osmocom/msc/debug.h b/include/osmocom/msc/debug.h
index 28ba482..3d3f5e6 100644
--- a/include/osmocom/msc/debug.h
+++ b/include/osmocom/msc/debug.h
@@ -8,6 +8,7 @@
DCC,
DMM,
DRR,
+   DLCLS,
DMNCC,
DPAG,
DMSC,
diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index 830328b..eb5a0d0 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -108,6 +108,8 @@
 const struct vlr_subscr *vsub,
 uint8_t sm_rp_mr);

+struct osmo_lcls *trans_fill_lcls(const struct gsm_trans *trans, bool use_lac);
+
 struct gsm_trans *trans_alloc(struct gsm_network *net,
  struct vlr_subscr *vsub,
  uint8_t protocol, uint8_t trans_id,
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index 91a2b6a..b707b59 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -425,7 +425,11 @@
memset(&rtp_addr, 0, sizeof(rtp_addr));
memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in));

-   msg = gsm0808_create_ass(&ct, NULL, &rtp_addr, &scl, NULL);
+   LOGPCONN(conn, LOGL_NOTICE, "Preparing LCLS...\n");
+   bool use_lac = true;
+   msg = gsm0808_create_ass2(&ct, NULL, &rtp_addr, &scl, NULL, NULL, 
trans_fill_lcls(trans, use_lac));
+   LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", msgb_hexdump_l2(msg));
+
return a_iface_tx_bssap(conn, msg);
 }

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 66126e6..8aa81c6 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -93,6 +93,60 @@
return NULL;
 }

+struct osmo_lcls *trans_fill_lcls(const struct gsm_trans *trans, bool use_lac)
+{
+   struct osmo_ss7_instance *ss7 = 
osmo_sccp_get_ss7(trans->net->a.sccp);//FIXME: ensure that a interface is in 
use for this transaction
+   struct osmo_lcls *lcls;
+   uint8_t w = osmo_ss7_pc_width(&ss7->cfg.pc_fmt);
+
+   if(!trans->vsub->vlr->cfg.lcls_enabled) {
+   LOGP(DCC, LOGL_NOTICE, "LCLS disabled globally\n");
+   return NULL;
+   }
+
+   if(!trans) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for 
unallocated transaction\n");
+   return NULL;
+   }
+
+   if(!trans->conn) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: unable to fill parameters for 
transaction without connection\n");
+   return NULL;
+   }
+
+   if (trans->conn->via_ran != OSMO_RAT_GERAN_A) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: only A interface is supported at 
the moment\n");
+   return NULL;
+   }
+
+   lcls = talloc_zero(trans, struct osmo_lcls);
+   if (!lcls) {
+   LOGP(DCC, LOGL_ERROR, "LCLS: failed to allocate osmo_lcls\n");
+   return NULL;
+   }
+
+   LOGP(DCC, LOGL_INFO, "LCLS: using %u bits (%u bytes) for node ID\n", w, 
w / 8);
+
+   lcls->gcr.net_len = 3;
+   lcls->gcr.node = ss7->cfg.primary_pc;
+
+   osmo_plmn_to_bcd(lcls->gcr.net, &trans->net->plmn); /* net id from 
Q.1902.3 3-5 bytes, this function gives 3 bytes exactly */
+
+   osmo_store32be(trans->callref, lcls->gcr.cr);
+   osmo_store16be(use_lac ? trans->conn->lac : trans->conn->ci, 
lcls->gcr.cr + 3);
+
+   LOGP(DCC, LOGL_INFO, "LCLS: allocated %s-based CR-ID %s\n", use_lac ? 
"LAC" : "CI", osmo_hexdump(lcls->gcr.cr, 5));
+
+   lcls->config = GSM0808_LCLS_CFG_BOTH_WAY;
+   lcls->control = GSM0808_LCLS_CSC_CONNECT;
+   lcls->corr_needed = true;
+   lcls->gcr_available = true;
+
+   LOGP(DCC, LOGL_INFO, "Filled %s, %s\n", osmo_lcls_dump(lcls), 
osmo_gcr_dump(lcls));
+
+   return lcls;
+}
+
 /*! Allocate a new transaction and add it to network list
  *  \param[in] net Netwokr in which we allocate transaction
  *  \param[in] subscr Subscriber for which we allocate transaction

--
To view, visit https://gerrit.osmocom.org/13422
To unsub

Change in osmo-msc[master]: Add vty option to globally enable LCLS

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13421 )

Change subject: Add vty option to globally enable LCLS
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibb587e6ae47cff71f5bf2e2d22c1da86cd7e1762
Gerrit-Change-Number: 13421
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 14:00:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: Use osmo_lcls instead of anonymous struct

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13419 )

Change subject: Use osmo_lcls instead of anonymous struct
..


Patch Set 1:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13419
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0f2c2a065755d9051fc7d7ce52c19ab0b7d9288a
Gerrit-Change-Number: 13419
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Tue, 26 Mar 2019 13:55:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: Log protocol for which transaction is allocated

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13420 )

Change subject: Log protocol for which transaction is allocated
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4a5f3ecaec568b3f8d5a57d864184d7af2b95cc
Gerrit-Change-Number: 13420
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 13:55:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: Add vty option to globally enable LCLS

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13421


Change subject: Add vty option to globally enable LCLS
..

Add vty option to globally enable LCLS

It's disabled by default and will be used in follow-up patches.

Change-Id: Ibb587e6ae47cff71f5bf2e2d22c1da86cd7e1762
---
M include/osmocom/msc/vlr.h
M src/libmsc/msc_vty.c
2 files changed, 21 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/13421/1

diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index d2d59c7..308a110 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -274,6 +274,7 @@
bool retrieve_imeisv_early;
bool retrieve_imeisv_ciphered;
bool assign_tmsi;
+   bool lcls_enabled;
bool check_imei_rqd;
int auth_tuple_max_reuse_count;
bool auth_reuse_old_sets_on_error;
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index a79f451..3d812e7 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -404,6 +404,22 @@
return CMD_SUCCESS;
 }

+DEFUN(cfg_msc_lcls_enable, cfg_msc_lcls_enable_cmd,
+  "lcls-enable",
+  "Enable LCLS for all calls.\n")
+{
+   gsmnet->vlr->cfg.lcls_enabled = true;
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_msc_no_lcls_enable, cfg_msc_no_lcls_enable_cmd,
+  "no lcls-enable",
+  "Disable LCLS for all calls.\n")
+{
+   gsmnet->vlr->cfg.lcls_enabled = false;
+   return CMD_SUCCESS;
+}
+
 DEFUN(cfg_msc_cs7_instance_a,
   cfg_msc_cs7_instance_a_cmd,
   "cs7-instance-a <0-15>",
@@ -513,6 +529,8 @@
gsmnet->ncss_guard_timeout, VTY_NEWLINE);
vty_out(vty, " %sassign-tmsi%s",
gsmnet->vlr->cfg.assign_tmsi? "" : "no ", VTY_NEWLINE);
+   vty_out(vty, " %slcls-enable%s",
+   gsmnet->vlr->cfg.lcls_enabled ? "" : "no ", VTY_NEWLINE);

vty_out(vty, " cs7-instance-a %u%s", gsmnet->a.cs7_instance,
VTY_NEWLINE);
@@ -1673,12 +1691,14 @@
install_element(CONFIG_NODE, &cfg_msc_cmd);
install_node(&msc_node, config_write_msc);
install_element(MSC_NODE, &cfg_msc_assign_tmsi_cmd);
+   install_element(MSC_NODE, &cfg_msc_lcls_enable_cmd);
install_element(MSC_NODE, &cfg_msc_mncc_internal_cmd);
install_element(MSC_NODE, &cfg_msc_mncc_external_cmd);
install_element(MSC_NODE, &cfg_msc_mncc_guard_timeout_cmd);
install_element(MSC_NODE, &cfg_msc_deprecated_mncc_guard_timeout_cmd);
install_element(MSC_NODE, &cfg_msc_ncss_guard_timeout_cmd);
install_element(MSC_NODE, &cfg_msc_no_assign_tmsi_cmd);
+   install_element(MSC_NODE, &cfg_msc_no_lcls_enable_cmd);
install_element(MSC_NODE, &cfg_msc_auth_tuple_max_reuse_count_cmd);
install_element(MSC_NODE, &cfg_msc_auth_tuple_reuse_on_error_cmd);
install_element(MSC_NODE, &cfg_msc_check_imei_rqd_cmd);

--
To view, visit https://gerrit.osmocom.org/13421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb587e6ae47cff71f5bf2e2d22c1da86cd7e1762
Gerrit-Change-Number: 13421
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-msc[master]: Log protocol for which transaction is allocated

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13420


Change subject: Log protocol for which transaction is allocated
..

Log protocol for which transaction is allocated

Change-Id: If4a5f3ecaec568b3f8d5a57d864184d7af2b95cc
---
M src/libmsc/transaction.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/13420/1

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 66126e6..6cce62a 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -114,8 +114,8 @@
return NULL;
}

-   DEBUGP(DCC, "(ti %02x sub %s callref %x) New transaction\n",
-  trans_id, vlr_subscr_name(vsub), callref);
+   DEBUGP(DCC, "(%s ti %02x sub %s callref %x) New transaction\n",
+  gsm48_pdisc_name(protocol), trans_id, vlr_subscr_name(vsub), 
callref);

trans = talloc_zero(tall_trans_ctx, struct gsm_trans);
if (!trans)

--
To view, visit https://gerrit.osmocom.org/13420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4a5f3ecaec568b3f8d5a57d864184d7af2b95cc
Gerrit-Change-Number: 13420
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-pcu[master]: cosmetic: use const pointer for bts_data

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12246 )

Change subject: cosmetic: use const pointer for bts_data
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12246
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b
Gerrit-Change-Number: 12246
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 13:37:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: Use osmo_lcls instead of anonymous struct

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13419


Change subject: Use osmo_lcls instead of anonymous struct
..

Use osmo_lcls instead of anonymous struct

This allows us to (re)use code from libosmocore for parameter checks,
printing etc.

Change-Id: I0f2c2a065755d9051fc7d7ce52c19ab0b7d9288a
Related: OS#2487
---
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/osmo_bsc_lcls.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_lcls.c
6 files changed, 71 insertions(+), 106 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/13419/1

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 47ca5e8..3ee7694 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -292,10 +292,7 @@

/* LCLS (local call, local switch) related state */
struct {
-   uint8_t global_call_ref[15];
-   uint8_t global_call_ref_len; /* length of global_call_ref */
-   enum gsm0808_lcls_config config;/* TS 48.008 3.2.2.116 
*/
-   enum gsm0808_lcls_control control;  /* TS 48.008 3.2.2.117 
*/
+   struct osmo_lcls *par; /* LCLS parameters */
/* LCLS FSM */
struct osmo_fsm_inst *fi;
/* pointer to "other" connection, if Call Leg Relocation was 
successful */
diff --git a/include/osmocom/bsc/osmo_bsc_lcls.h 
b/include/osmocom/bsc/osmo_bsc_lcls.h
index 8bbd552..b7836ce 100644
--- a/include/osmocom/bsc/osmo_bsc_lcls.h
+++ b/include/osmocom/bsc/osmo_bsc_lcls.h
@@ -47,9 +47,6 @@

 enum gsm0808_lcls_status lcls_get_status(const struct 
gsm_subscriber_connection *conn);

-void lcls_update_config(struct gsm_subscriber_connection *conn,
-   const uint8_t *config, const uint8_t *control);
-
 void lcls_apply_config(struct gsm_subscriber_connection *conn);

 extern struct osmo_fsm lcls_fsm;
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 1cc0c78..3f43801 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -889,16 +889,28 @@
return NULL;
}

+   conn->lcls.par = talloc_zero(conn, struct osmo_lcls);
+
/* indicate "IE not [yet] received" */
-   conn->lcls.config = GSM0808_LCLS_CFG_NA;
-   conn->lcls.control = GSM0808_LCLS_CSC_NA;
+   conn->lcls.par->config = GSM0808_LCLS_CFG_NA;
+   conn->lcls.par->control = GSM0808_LCLS_CSC_NA;
+
conn->lcls.fi = osmo_fsm_inst_alloc_child(&lcls_fsm, conn->fi, 
GSCON_EV_LCLS_FAIL);
+
if (!conn->lcls.fi) {
osmo_fsm_inst_term(conn->fi, OSMO_FSM_TERM_ERROR, NULL);
return NULL;
}
conn->lcls.fi->priv = conn;

+   if (conn->lchan) {
+   LOG_LCHAN(conn->lchan, LOGL_NOTICE, "New %s\n", 
osmo_lcls_dump(conn->lcls.par));
+   LOG_LCHAN(conn->lchan, LOGL_NOTICE, "New %s\n", 
osmo_gcr_dump(conn->lcls.par));
+   } else {
+   LOGPFSM(conn->fi, "New %s\n", osmo_lcls_dump(conn->lcls.par));
+   LOGPFSM(conn->fi, "New %s\n", osmo_gcr_dump(conn->lcls.par));
+   }
+
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;
 }
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 9413d36..769ddeb 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1586,16 +1586,9 @@
vty_out(vty, "conn ID=%u, MSC=%u, hodec2_fail=%d, mgw_ep=%s%s",
conn->sccp.conn_id, conn->sccp.msc->nr, conn->hodec2.failures,
mgw_endpoint_name(conn->user_plane.mgw_endpoint), VTY_NEWLINE);
-   if (conn->lcls.global_call_ref_len) {
-   vty_out(vty, " LCLS GCR: %s%s",
-   osmo_hexdump_nospc(conn->lcls.global_call_ref, 
conn->lcls.global_call_ref_len),
-   VTY_NEWLINE);
-   vty_out(vty, " LCLS Config: %s, LCLS Control: %s, LCLS BSS 
Status: %s%s",
-   gsm0808_lcls_config_name(conn->lcls.config),
-   gsm0808_lcls_control_name(conn->lcls.control),
-   osmo_fsm_inst_state_name(conn->lcls.fi),
-   VTY_NEWLINE);
-   }
+   vty_out(vty, " %s%s", osmo_lcls_dump(conn->lcls.par), VTY_NEWLINE);
+   vty_out(vty, "  %s%s", osmo_gcr_dump(conn->lcls.par), VTY_NEWLINE);
+
if (conn->lchan)
lchan_dump_full_vty(vty, conn->lchan);
if (conn->assignment.new_lchan)
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-

Change in osmo-pcu[master]: vty: add commands to show TBF of a certain kind

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/6239 )

Change subject: vty: add commands to show TBF of a certain kind
..


Patch Set 6:

(1 comment)

Doh! Somehow lost it during patch rebase before submission. Thanks!

https://gerrit.osmocom.org/#/c/6239/4/src/pcu_vty_functions.cpp
File src/pcu_vty_functions.cpp:

https://gerrit.osmocom.org/#/c/6239/4/src/pcu_vty_functions.cpp@46
PS4, Line 46:
> looks like these parameters added in this commit are not used in this 
> function.
Done



--
To view, visit https://gerrit.osmocom.org/6239
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-Change-Number: 6239
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 13:15:00 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: TS alloc: expand tests log

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/3895 )

Change subject: TS alloc: expand tests log
..


Patch Set 28:

(1 comment)

Should have replied year ago but thanks to underwhelming pace of OsmoPCU 
development this patch is still relevant :)

https://gerrit.osmocom.org/#/c/3895/27/tests/alloc/AllocTest.err
File tests/alloc/AllocTest.err:

https://gerrit.osmocom.org/#/c/3895/27/tests/alloc/AllocTest.err@196
PS27, Line 196: [DL] algo A  (suggested TRX: -1): failed to find a 
usable TRX (TFI exhausted)
> why does the old log line statte "multi" and the new one "single"? This looks 
> suspicious. […]
Erm, old log doesn't state "multi" - at least I don't see where. In fact the 
old log does not give any info about single/multi allocation being used and 
that's exactly what this patch is trying to address.



--
To view, visit https://gerrit.osmocom.org/3895
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5
Gerrit-Change-Number: 3895
Gerrit-PatchSet: 28
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:59:24 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Add test for MS mode and (M)CS settings

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13164 )

Change subject: Add test for MS mode and (M)CS settings
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13164
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf917f4b49d927a21cbd467775806fa6ea06a6a6
Gerrit-Change-Number: 13164
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:56:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 5:

(1 comment)

Looking at other FOSS projects, it seems likely that eventually we'll just use 
2-3 explicit tags: "latest stable", "latest unstable" and perhaps "LTS 
release". Not sure if it would make sense to change the release process to 
introduce those as explicit tags in git and just move them from one commit to 
another as new releases made/promoted to stable/LTS status. Not smth of 
immediate concern, just a thing to consider while looking at the code.

https://gerrit.osmocom.org/#/c/13415/5/scripts/osmocom-build-old-tags-against-master.sh
File scripts/osmocom-build-old-tags-against-master.sh:

https://gerrit.osmocom.org/#/c/13415/5/scripts/osmocom-build-old-tags-against-master.sh@53
PS5, Line 53:   echo "1.3.0"
Would be nice to document output format: is it space-separated list of tags?



--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 5
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:41:24 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 5:

(1 comment)

I think the entire test should not stop/fail if one particular tag is failing 
to build. Instead it should be recorded which tag failed (and why) and the test 
should proceed to check other tags.

https://gerrit.osmocom.org/#/c/13415/5//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13415/5//COMMIT_MSG@19
PS5, Line 19: and commented out, so this test runs through and we can detect 
further
Would it be possible to enable them and still run through with the rest of the 
test?



--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 5
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:33:10 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ci[master]: Add osmocom-build-old-tags-against-master.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13415 )

Change subject: Add osmocom-build-old-tags-against-master.sh
..


Patch Set 5:

> osmo-sgsn  (no tags configured)

So it was manually disabled due to some problems?


--
To view, visit https://gerrit.osmocom.org/13415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7cb45cc40c9930840a3d4e6a86f39e1400478ed3
Gerrit-Change-Number: 13415
Gerrit-PatchSet: 5
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:29:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Use boolean for DL resegmentation parameter

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13057 )

Change subject: Use boolean for DL resegmentation parameter
..


Patch Set 8:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13057
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4d4fe5fe12068a4532cb3b61d4eeb229a77c1476
Gerrit-Change-Number: 13057
Gerrit-PatchSet: 8
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:25:07 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: oc2g: Change log type (Litecell15->Oc2g)

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13362 )

Change subject: oc2g: Change log type (Litecell15->Oc2g)
..


Patch Set 2:

> I want to keep the commit from others unchanged as much as a can - even if 
> this is really trivial.

Than it probably make sense to keep commit meta-info as well: author, date, 
original repo/branch etc. It's kinda confusing that for some commits in this 
series it's preserved and for other it isn't.


--
To view, visit https://gerrit.osmocom.org/13362
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I95ced5da1c89dae5a16963b10b005747277f320b
Gerrit-Change-Number: 13362
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Willmann 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Max 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:24:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Add ARQ type helpers

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13406 )

Change subject: Add ARQ type helpers
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I844aca7dcd9d7f41e5975c1edd1905951f271998
Gerrit-Change-Number: 13406
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:24:56 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: a_iface_bssap: add context information to log output

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13319 )

Change subject: a_iface_bssap: add context information to log output
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13319
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I704954edc8677688fc7cccd2b23d2aff958ebf32
Gerrit-Change-Number: 13319
Gerrit-PatchSet: 5
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Tue, 26 Mar 2019 12:18:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: BSSGP: use variable for NSEI

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13204 )

Change subject: BSSGP: use variable for NSEI
..


Patch Set 3:

(1 comment)

This change is ready for review.

https://gerrit.osmocom.org/#/c/13204/1/src/gb/gprs_bssgp.c
File src/gb/gprs_bssgp.c:

https://gerrit.osmocom.org/#/c/13204/1/src/gb/gprs_bssgp.c@1039
PS1, Line 1039:
> 1) we don't assign values to multiple variables in one line […]
Done



--
To view, visit https://gerrit.osmocom.org/13204
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I919a717ca22646849d6ec7f62c677c536db0ed31
Gerrit-Change-Number: 13204
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Tue, 26 Mar 2019 11:21:38 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in python/osmo-python-tests[master]: deb: fix wrong changelog date

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12487 )

Change subject: deb: fix wrong changelog date
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12487
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie73b1f29bd13e68e9b5e05896f1f048bc8108d17
Gerrit-Change-Number: 12487
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 11:00:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: jobs: add osmocom-build-tags-against-master.yml

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13416 )

Change subject: jobs: add osmocom-build-tags-against-master.yml
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13416
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9868a6008f61fb3962279f72d34f67f900425be5
Gerrit-Change-Number: 13416
Gerrit-PatchSet: 4
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 10:40:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: nanobts: use libosmocore's osmo_store*() for OML attr. patching

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13418


Change subject: nanobts: use libosmocore's osmo_store*() for OML attr. patching
..

nanobts: use libosmocore's osmo_store*() for OML attr. patching

This slightly simplifies things by making endianness more obvious and
removing abstraction.

Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 3 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/13418/1

diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c 
b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index d674c18..be40410 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -25,15 +25,6 @@
 #include 
 #include 

-static void patch_16(uint8_t *data, const uint16_t val)
-{
-   memcpy(data, &val, sizeof(val));
-}
-
-static void patch_32(uint8_t *data, const uint32_t val)
-{
-   memcpy(data, &val, sizeof(val));
-}

 struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
 {
@@ -213,11 +204,11 @@
msgb_tl16v_put(msgb, NM_ATT_IPACC_NSVCI, 2, buf);

/* remote udp port */
-   patch_16(&buf[0], htons(bts->gprs.nsvc[0].remote_port));
+   osmo_store16be(bts->gprs.nsvc[0].remote_port, &buf[0]);
/* remote ip address */
-   patch_32(&buf[2], htonl(bts->gprs.nsvc[0].remote_ip));
+   osmo_store32be(bts->gprs.nsvc[0].remote_ip, &buf[2]);
/* local udp port */
-   patch_16(&buf[6], htons(bts->gprs.nsvc[0].local_port));
+   osmo_store16be(bts->gprs.nsvc[0].local_port, &buf[6]);
msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_LINK_CFG, 8, buf);

return msgb;

--
To view, visit https://gerrit.osmocom.org/13418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Gerrit-Change-Number: 13418
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-ci[master]: jobs: add osmocom-build-tags-against-master.yml

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13416 )

Change subject: jobs: add osmocom-build-tags-against-master.yml
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13416/2/jobs/osmocom-build-tags-against-master.yml
File jobs/osmocom-build-tags-against-master.yml:

https://gerrit.osmocom.org/#/c/13416/2/jobs/osmocom-build-tags-against-master.yml@12
PS2, Line 12:
whitespace



--
To view, visit https://gerrit.osmocom.org/13416
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9868a6008f61fb3962279f72d34f67f900425be5
Gerrit-Change-Number: 13416
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 10:14:16 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ci[master]: osmo-build-dep.sh: cd into subdir before building

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13413 )

Change subject: osmo-build-dep.sh: cd into subdir before building
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13413
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I852e103e80bf295f692cf13c4cb38e80fbc19eca
Gerrit-Change-Number: 13413
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 10:12:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: osmo-build-dep.sh: run 'make check' when CHECK=1

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13414 )

Change subject: osmo-build-dep.sh: run 'make check' when CHECK=1
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13414
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I248b53d7a6fe1b64f2a994c568c0466dc93858de
Gerrit-Change-Number: 13414
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 10:12:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: osmocom-list-commits.sh: move functions to common.sh

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13412 )

Change subject: osmocom-list-commits.sh: move functions to common.sh
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13412
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I61be4cffb9275cabc1b253f0b298503ad0d3aea4
Gerrit-Change-Number: 13412
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 26 Mar 2019 10:10:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in openbsc[master]: Drop Iu*S support and related dependencies

2019-03-26 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13417


Change subject: Drop Iu*S support and related dependencies
..

Drop Iu*S support and related dependencies

There's optional libiu for Iu*S support but it's just a leftover from
pre repo-split times:
* it's not used by any code
* it's not checked by gerrit verification in osmo-ci
* it's disabled by default
* it's not supported in .deb packages

Instead of dragging old code in unknown stage of bit-rotting, let's just
drop it completely.

Change-Id: Id5678a74504b4456aba0438ccc34731770801128
---
M contrib/jenkins.sh
M openbsc/configure.ac
M openbsc/include/openbsc/Makefile.am
D openbsc/include/openbsc/iu.h
M openbsc/src/Makefile.am
D openbsc/src/libiu/Makefile.am
D openbsc/src/libiu/iu.c
D openbsc/src/libiu/iu_vty.c
8 files changed, 1 insertion(+), 935 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/13417/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index f8ae49c..277fece 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -2,7 +2,6 @@
 # jenkins build helper script for openbsc.  This is how we build on 
jenkins.osmocom.org
 #
 # environment variables:
-# * IU: configure 3G support (values: "--enable-iu", "--disable-iu")
 # * MGCP: configure transcoding for MGCP (values: "--enable-mgcp-transcoding", 
"--disable-mgcp-transcoding")
 # * SMPP: configure the SMPP interface (values: "--enable-smpp", 
"--disable-smpp")
 # * WITH_MANUALS: build manual PDFs if set to "1"
@@ -19,11 +18,6 @@
x="${x}_$($1 libosmo-sccp "$sccp_branch")"
x="${x}_$($1 libsmpp34)"

-   if [ "x$IU" = "x--enable-iu" ]; then
-   x="${x}_$($1 libasn1c)"
-   x="${x}_$($1 osmo-iuh "$osmo_iuh_branch")"
-   fi
-
echo "${x}.tar.gz"
 }

@@ -35,11 +29,6 @@
osmo-build-dep.sh libosmo-netif
osmo-build-dep.sh libosmo-sccp "$sccp_branch"
PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34
-
-   if [ "x$IU" = "x--enable-iu" ]; then
-   osmo-build-dep.sh libasn1c
-   osmo-build-dep.sh osmo-iuh "$osmo_iuh_branch"
-   fi
 }

 build_project() {
@@ -48,7 +37,7 @@

autoreconf --install --force

-   ./configure "$SMPP" "$MGCP" "$IU" \
+   ./configure "$SMPP" "$MGCP" \
--enable-osmo-bsc \
--enable-nat  \
--enable-vty-tests \
@@ -59,11 +48,6 @@
"$MAKE" distcheck || cat-testlogs.sh
 }

-if [ "x$IU" = "x--enable-iu" ]; then
-sccp_branch="old_sua"
-osmo_iuh_branch="old_sua"
-fi
-
 . osmo-build.sh

 # Build and publish manuals
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 4b432b1..704c7d7 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -98,18 +98,6 @@
 AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = 
"xyes")
 AC_SUBST(osmo_ac_mgcp_transcoding)

-# Enable/disable 3G aka IuPS + IuCS support?
-AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS 
and IuCS interfaces])],
-[osmo_ac_iu="$enableval"],[osmo_ac_iu="no"])
-if test "x$osmo_ac_iu" = "xyes" ; then
-PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.31)
-PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.3.0)
-PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.9.0)
-AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS 
interfaces support])
-fi
-AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes")
-AC_SUBST(osmo_ac_iu)
-

 dnl checks for header files
 AC_HEADER_STDC
@@ -252,7 +240,6 @@
 src/libmgcp/Makefile
 src/libcommon/Makefile
 src/libfilter/Makefile
-src/libiu/Makefile
 src/libcommon-cs/Makefile
 src/osmo-nitb/Makefile
 src/osmo-bsc/Makefile
diff --git a/openbsc/include/openbsc/Makefile.am 
b/openbsc/include/openbsc/Makefile.am
index 1fa30d5..59b2231 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -32,7 +32,6 @@
handover.h \
handover_decision.h \
ipaccess.h \
-   iu.h \
meas_feed.h \
meas_rep.h \
mgcp.h \
diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h
deleted file mode 100644
index f973ac1..000
--- a/openbsc/include/openbsc/iu.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#pragma once
-
-#include 
-
-struct sgsn_pdp_ctx;
-struct msgb;
-struct gprs_ra_id;
-
-struct RANAP_RAB_SetupOrModifiedItemIEs_s;
-struct RANAP_GlobalRNC_ID;
-
-struct ue_conn_ctx {
-

Change in openbsc[master]: Drop openggsn from build dependencies

2019-03-26 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13345 )

Change subject: Drop openggsn from build dependencies
..

Drop openggsn from build dependencies

We don't have SGSN-related code here anymore so we don't need libgtp
from openggsn any longer.

Change-Id: I6725d39449a3d498adcd83fb8c3fe892367df0e8
---
M contrib/jenkins.sh
1 file changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Max: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 7083976..f8ae49c 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -18,7 +18,6 @@
x="${x}_$($1 libosmo-netif)"
x="${x}_$($1 libosmo-sccp "$sccp_branch")"
x="${x}_$($1 libsmpp34)"
-   x="${x}_$($1 openggsn)"

if [ "x$IU" = "x--enable-iu" ]; then
x="${x}_$($1 libasn1c)"
@@ -36,7 +35,6 @@
osmo-build-dep.sh libosmo-netif
osmo-build-dep.sh libosmo-sccp "$sccp_branch"
PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34
-   osmo-build-dep.sh openggsn

if [ "x$IU" = "x--enable-iu" ]; then
osmo-build-dep.sh libasn1c

--
To view, visit https://gerrit.osmocom.org/13345
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6725d39449a3d498adcd83fb8c3fe892367df0e8
Gerrit-Change-Number: 13345
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in openbsc[master]: Drop openggsn from build dependencies

2019-03-26 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13345 )

Change subject: Drop openggsn from build dependencies
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13345
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6725d39449a3d498adcd83fb8c3fe892367df0e8
Gerrit-Change-Number: 13345
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Tue, 26 Mar 2019 09:44:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: bts.h: always include C-headers

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13403 )

Change subject: bts.h: always include C-headers
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13403/1/src/bts.h
File src/bts.h:

https://gerrit.osmocom.org/#/c/13403/1/src/bts.h@44
PS1, Line 44: #endif
> I'm pointing out how usually C headers are guarded on C++ code

That doesn't seem relevant: the headers below #ifdef __cplusplus in a current 
patch version are C++ headers which should not be included directly into .c 
file which use bts.h. Especially if they were not included before this patch. 
And even more so if the only reason to include them is "that's how it usually 
looks like".



--
To view, visit https://gerrit.osmocom.org/13403
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I85b7dc8e8786671a054af2f1e7d836b863a25e60
Gerrit-Change-Number: 13403
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:24:55 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: TBF: update MCS counters

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13243 )

Change subject: TBF: update MCS counters
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13243
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I763136c2f356d63aa3d28d09c57fd5faf5336258
Gerrit-Change-Number: 13243
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:16:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Rewrite Packet Uplink IA Rest Octets for SBA

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12955 )

Change subject: Rewrite Packet Uplink IA Rest Octets for SBA
..


Patch Set 15:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12955
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I97d53c27c1ca9e032d431b3aa7f915027d63ddc0
Gerrit-Change-Number: 12955
Gerrit-PatchSet: 15
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:15:52 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: TBF-DL: cosmetic update for helper routines

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13244 )

Change subject: TBF-DL: cosmetic update for helper routines
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13244
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If1d2bc69b0d43fc520e579457007704b7975117e
Gerrit-Change-Number: 13244
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:16:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Update IA Rest Octets encoding

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13245 )

Change subject: Update IA Rest Octets encoding
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13245
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7ed5270bf95c3f6e9e026ff447eef8539f6f0314
Gerrit-Change-Number: 13245
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:16:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Use Timing Advance Index in UL assignments

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12956 )

Change subject: Use Timing Advance Index in UL assignments
..


Patch Set 12:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I69407793bdb863be5fc42adadf75842d22f27335
Gerrit-Change-Number: 12956
Gerrit-PatchSet: 12
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:15:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Fix Channel Coding Command for MCS

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13216 )

Change subject: Fix Channel Coding Command for MCS
..


Patch Set 6:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13216
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I868062a81fffe6714a811c032215f25a79259905
Gerrit-Change-Number: 13216
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:15:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Rewrite Packet Uplink IA Rest Octets for MBA

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12961 )

Change subject: Rewrite Packet Uplink IA Rest Octets for MBA
..


Patch Set 9:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12961
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibe294b26ac374b9264a734db9663cacc105a4474
Gerrit-Change-Number: 12961
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:15:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: MCS: add Channel Coding Command encoder

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13215 )

Change subject: MCS: add Channel Coding Command encoder
..


Patch Set 5:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13215
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I127fb29f5aaf77a7f6c4c565dfeb3b711af9845d
Gerrit-Change-Number: 13215
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:14:49 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: MCS: add mcs_is_*() helpers

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13214 )

Change subject: MCS: add mcs_is_*() helpers
..


Patch Set 5:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13214
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6699cbc8d7ae766fa4d2b3d37e5f9ff1cf158b7e
Gerrit-Change-Number: 13214
Gerrit-PatchSet: 5
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 25 Mar 2019 21:14:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Add ARQ type helpers

2019-03-25 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13406


Change subject: Add ARQ type helpers
..

Add ARQ type helpers

Add functions to check/log EGPRS ARQ type (as described in 3GPP TS
44.060 §8.1.1). Note - this requires updating previously incorrect TBF
test output.

Depends on: I85b7dc8e8786671a054af2f1e7d836b863a25e60 and
Ib39e4424f73c677b34f921917440f211e400e14f in OsmoPCU.

Change-Id: I844aca7dcd9d7f41e5975c1edd1905951f271998
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.h
M src/pcu_vty.c
M src/tbf_dl.cpp
M tests/tbf/TbfTest.err
6 files changed, 51 insertions(+), 30 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/13406/1

diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index 48a74cd..6ed787e 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -22,6 +22,7 @@

 #include 

+#include "bts.h"
 #include "coding_scheme.h"

 const struct value_string mcs_names[] = {
@@ -163,3 +164,20 @@
return 
egprs_no_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(demanded_mcs)];
}
 }
+
+/* Check whether 3GPP TS 44.060 EGPRS ARQ Type II is configured for BTS */
+bool egprs_arq_type_2(const struct gprs_rlcmac_bts *bts)
+{
+   if (bts->dl_arq_type != EGPRS_ARQ2)
+   return false;
+
+   return true;
+}
+
+char *egprs_arq_type_name(const struct gprs_rlcmac_bts *bts)
+{
+   if (egprs_arq_type_2(bts))
+   return "Type II";
+
+   return "Type I";
+}
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index f93a4a2..5e58528 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -21,6 +21,9 @@

 #include 

+#define EGPRS_ARQ10x0
+#define EGPRS_ARQ20x1
+
 enum CodingScheme {
UNKNOWN,
/* GPRS Coding Schemes: */
@@ -64,3 +67,6 @@
 };

 const char *mode_name(enum mcs_kind val);
+
+bool egprs_arq_type_2(const struct gprs_rlcmac_bts *bts);
+char *egprs_arq_type_name(const struct gprs_rlcmac_bts *bts);
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index c31f58f..03b92ec 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -30,10 +30,6 @@

 class GprsCodingScheme {
 public:
-
-#define EGPRS_ARQ10x0
-#define EGPRS_ARQ20x1
-
GprsCodingScheme(CodingScheme s = UNKNOWN);

operator bool() const {return m_scheme != UNKNOWN;}
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 960c90d..cfc7e85 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -15,6 +15,7 @@
 #include 
 #include "bts.h"
 #include "tbf.h"
+#include "coding_scheme.h"
 #include "pcu_vty_functions.h"

 extern void *tall_pcu_ctx;
@@ -218,7 +219,7 @@
vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch,
VTY_NEWLINE);

-   if (bts->dl_arq_type)
+   if (egprs_arq_type_2(bts))
vty_out(vty, " egprs dl arq-type arq2%s",
VTY_NEWLINE);

diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index c97436a..813a550 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -383,12 +383,12 @@
  
!bts->bts_data()->dl_arq_type);

LOGPTBFDL(this, LOGL_DEBUG,
- "initial_cs_dl(%s) last_mcs(%s) 
demanded_mcs(%s) cs_trans(%s) arq_type(%d) bsn(%d)\n",
+ "initial_cs_dl(%s) last_mcs(%s) 
demanded_mcs(%s) cs_trans(%s) ARQ(%s) bsn(%d)\n",
  mcs_name(m_rlc.block(bsn)->cs_init),
  mcs_name(m_rlc.block(bsn)->cs_last),
  mcs_name(ms()->current_cs_dl()),
  mcs_name(m_rlc.block(bsn)->cs_current_trans),
- bts->bts_data()->dl_arq_type, bsn);
+ egprs_arq_type_name(bts->bts_data()), bsn);

/* TODO: Need to remove this check when MCS-8 -> MCS-6
 * transistion is handled.
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index b58b61d..b007f13 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -4754,7 +4754,7 @@
 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for 
polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)
 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. 
V(S)==1)
-TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) initial_cs_dl(MCS-7) 
last_mcs(MCS-5) demanded_mcs(MCS-7) cs_trans(MCS-7) arq_type(1) bsn(0)
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) initial_cs_dl(MCS-7) 
last_mcs

Change in osmo-pcu[master]: bts.h: always include C-headers

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13403 )

Change subject: bts.h: always include C-headers
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13403/1/src/bts.h
File src/bts.h:

https://gerrit.osmocom.org/#/c/13403/1/src/bts.h@44
PS1, Line 44: #endif
> This endif should go in line 35.
What makes you think that? Even if it won't break the compilation (which I 
doubt) including cpp headers into c files doesn't seem like a good idea.



--
To view, visit https://gerrit.osmocom.org/13403
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I85b7dc8e8786671a054af2f1e7d836b863a25e60
Gerrit-Change-Number: 13403
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 25 Mar 2019 16:44:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: src/logging.c: fix syntax errors in Doxygen documentation

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13401 )

Change subject: src/logging.c: fix syntax errors in Doxygen documentation
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13401
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I85f6c70216b7574b49b90bb1469869a47f721713
Gerrit-Change-Number: 13401
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 25 Mar 2019 16:30:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: bts.h: always include C-headers

2019-03-25 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13403


Change subject: bts.h: always include C-headers
..

bts.h: always include C-headers

Previously C-headers were only included if bts.h was used by C++ code
which might lead to compilation errors if it's used from C. Fix this by
including C-headers regardless of the compilation mode.

Change-Id: I85b7dc8e8786671a054af2f1e7d836b863a25e60
---
M src/bts.h
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/03/13403/1

diff --git a/src/bts.h b/src/bts.h
index ee5a692..e5bf094 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -23,12 +23,14 @@

 #ifdef __cplusplus
 extern "C" {
+#endif
 #include 
 #include 
 #include 
 #include 
 #include 
#include 
+#ifdef __cplusplus
 }

 #include 

--
To view, visit https://gerrit.osmocom.org/13403
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85b7dc8e8786671a054af2f1e7d836b863a25e60
Gerrit-Change-Number: 13403
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-pcu[master]: Include pdch.h in bts.h even if we're not compiling C++

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13361 )

Change subject: Include pdch.h in bts.h even if we're not compiling C++
..


Patch Set 2: Code-Review+1

That's generic fix unrelated to oc2g in any way. Can we rebase this on top of 
master and go ahead with merge?


--
To view, visit https://gerrit.osmocom.org/13361
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib39e4424f73c677b34f921917440f211e400e14f
Gerrit-Change-Number: 13361
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Willmann 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 25 Mar 2019 16:16:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: Update MCS selection for retransmission

2019-03-25 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13402


Change subject: Update MCS selection for retransmission
..

Update MCS selection for retransmission

In 3GPP TS 44.060 the selection of MCS for retransmissions is defined as
separate tables (8.1.1.1 and 8.1.1.2) depending on the value of
resegmentation bit (which is opposite to the way EGPRS_ARQ are defined
in the source code). Let's follow the same idea and explicitly check for
resegmentation bit value and use separate tables. This also makes it
easier to add proper support for special cases (MCS-6-9 and MCS-5-7) and
padding in future independently for different ARQ types. The code is
also moved to c to avoid unnecessary conversions to and from cpp class.

Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/tbf_dl.cpp
5 files changed, 40 insertions(+), 50 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/02/13402/1

diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index a4ae882..48a74cd 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -127,3 +127,39 @@
 const char *mode_name(enum mcs_kind val) {
return get_value_string(mode_names, val);
 }
+
+/* FIXME: take into account padding and special cases of commanded MCS 
(MCS-6-9 and MCS-5-7) */
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum 
CodingScheme demanded_mcs, bool resegment_bit)
+{
+   OSMO_ASSERT(mcs_is_edge(initial_mcs));
+   OSMO_ASSERT(mcs_is_edge(demanded_mcs));
+   OSMO_ASSERT(NUM_SCHEMES - MCS1 == 9);
+
+   if (resegment_bit) { /* 3GPP TS 44.060 Table 8.1.1.1, reflected over 
antidiagonal */
+   enum CodingScheme egprs_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - 
MCS1] = {
+   { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 
},
+   { MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 
},
+   };
+   return 
egprs_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(demanded_mcs)];
+   } else { /* 3GPP TS 44.060 Table 8.1.1.2, reflected over antidiagonal */
+   enum CodingScheme egprs_no_reseg[NUM_SCHEMES - 
MCS1][NUM_SCHEMES - MCS1] = {
+   { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 
},
+   { MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 
},
+   { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 
},
+   { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 
},
+   };
+   return 
egprs_no_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(demanded_mcs)];
+   }
+}
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index aac4bba..f93a4a2 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -32,6 +32,7 @@

 extern const struct value_string mcs_names[];
 const char *mcs_name(enum CodingScheme val);
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum 
CodingScheme demanded_mcs, bool resegment_bit);

 bool mcs_is_gprs(enum CodingScheme cs);
 bool mcs_is_edge(enum CodingScheme cs);
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index a149f81..0c22670 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -21,41 +21,6 @@

 #include "gprs_coding_scheme.h"

-#define MAX_NUM_ARQ       2 /* max. number of ARQ */
-#define MAX_NUM_MCS       9 /* max. number of MCS */
-
-/*
- * 44.060 Table 8.1.1.1 and Table 8.1.1.2
- * It has 3 level indexing. 0th level is ARQ type
- * 1st level is Original MCS( index 0 corresponds to MCS1 and so on)
- * 2nd level is MS MCS (index 0 corresponds to MCS1 and so on)
- */
-static enum CodingScheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
-   [MAX_NUM_M

Change in osmo-pcu[master]: MCS: move Mode enum outside of class definition

2019-03-25 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13163 )

Change subject: MCS: move Mode enum outside of class definition
..

MCS: move Mode enum outside of class definition

Move Mode (EDGE/GPRS) definition and related functions outside of
GprsCodingScheme class. This allows us to use standard libosmocore
value_string functions.

Change-Id: I3baaac7f1ca3f5b88917a23c1679d63847455f47
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/gprs_ms.cpp
M src/gprs_ms.h
M src/pcu_vty_functions.cpp
M src/tbf.cpp
M tests/edge/EdgeTest.cpp
9 files changed, 50 insertions(+), 51 deletions(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index 93278e7..135ddd2 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -85,3 +85,14 @@
OSMO_ASSERT(ht < NUM_HEADER_TYPES);
return hdr_type_info[ht].data_block_header_bits;
 }
+
+const struct value_string mode_names[] = {
+   { GPRS, "GPRS" },
+   { EGPRS_GMSK, "EGPRS_GMSK-only"},
+   { EGPRS, "EGPRS"},
+   { 0, NULL }
+};
+
+const char *mode_name(enum mcs_kind val) {
+   return get_value_string(mode_names, val);
+}
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index 1e8ca78..f69a76e 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -49,3 +49,11 @@
 uint8_t num_data_header_bits_UL(enum HeaderType ht);
 uint8_t num_data_header_bits_DL(enum HeaderType ht);
 uint8_t num_data_block_header_bits(enum HeaderType ht);
+
+enum mcs_kind {
+   GPRS,
+   EGPRS_GMSK,
+   EGPRS,
+};
+
+const char *mode_name(enum mcs_kind val);
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index 53b3b07..1a89b77 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -198,7 +198,7 @@
return mcs_info[m_scheme].data_hdr;
 }

-void GprsCodingScheme::inc(Mode mode)
+void GprsCodingScheme::inc(enum mcs_kind mode)
 {
if (!isCompatible(mode))
/* This should not happen. TODO: Use assert? */
@@ -212,7 +212,7 @@
m_scheme = new_cs;
 }

-void GprsCodingScheme::dec(Mode mode)
+void GprsCodingScheme::dec(enum mcs_kind mode)
 {
if (!isCompatible(mode))
/* This should not happen. TODO: Use assert? */
@@ -254,16 +254,6 @@
m_scheme = CodingScheme(m_scheme - 1);
 }

-const char *GprsCodingScheme::modeName(Mode mode)
-{
-   switch (mode) {
-   case GPRS:   return "GPRS";
-   case EGPRS_GMSK: return "EGPRS_GMSK-only";
-   case EGPRS:  return "EGPRS";
-   default: return "???";
-   }
-}
-
 bool GprsCodingScheme::isFamilyCompatible(GprsCodingScheme o) const
 {
if (*this == o)
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 055c166..6f965d6 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -34,12 +34,6 @@
 #define EGPRS_ARQ10x0
 #define EGPRS_ARQ20x1

-   enum Mode {
-   GPRS,
-   EGPRS_GMSK,
-   EGPRS,
-   };
-
GprsCodingScheme(CodingScheme s = UNKNOWN);

operator bool() const {return m_scheme != UNKNOWN;}
@@ -54,12 +48,12 @@
bool isGprs()   const {return CS1 <= m_scheme && m_scheme <= CS4;}
bool isEgprs()  const {return m_scheme >= MCS1;}
bool isEgprsGmsk()  const {return isEgprs() && m_scheme <= MCS4;}
-   bool isCompatible(Mode mode) const;
+   bool isCompatible(enum mcs_kind mode) const;
bool isCompatible(GprsCodingScheme o) const;
bool isFamilyCompatible(GprsCodingScheme o) const;

-   void inc(Mode mode);
-   void dec(Mode mode);
+   void inc(enum mcs_kind mode);
+   void dec(enum mcs_kind mode);
void inc();
void dec();
void decToSingleBlock(bool *needStuffing);
@@ -81,7 +75,6 @@
static GprsCodingScheme getGprsByNum(unsigned num);
static GprsCodingScheme getEgprsByNum(unsigned num);

-   static const char *modeName(Mode mode);
static CodingScheme get_retx_mcs(const GprsCodingScheme mcs,
const GprsCodingScheme retx_mcs,
const unsigned arq_type);
@@ -102,7 +95,7 @@
return 0;
 }

-inline bool GprsCodingScheme::isCompatible(Mode mode) const
+inline bool GprsCodingScheme::isCompatible(enum mcs_kind mode) const
 {
switch (mode) {
case GPRS: return isGprs();
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 3c28319..e64bee4 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -110,7 +110,7 @@
m_reserved_ul_slots(0),
m_current_trx(NULL),
m_cod

Change in libosmocore[master]: add osmo_str_startswith()

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13394 )

Change subject: add osmo_str_startswith()
..


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG@31
PS1, Line 31: Arguably, strstr(a, b) == a does the same thing, but it searches 
the entire
Why is that a problem exactly? Why do we need in our API smth which duplicates 
 function?



--
To view, visit https://gerrit.osmocom.org/13394
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513
Gerrit-Change-Number: 13394
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 12:31:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: gsm_utils.h: remove unused include of gsm_08_08.h

2019-03-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13390 )

Change subject: gsm_utils.h: remove unused include of gsm_08_08.h
..


Patch Set 2:

Does this really depends on all the preceding patches or it can be rebased on 
top of latest master?


--
To view, visit https://gerrit.osmocom.org/13390
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ied4cb2bd06147785540a53ef118e9268406da702
Gerrit-Change-Number: 13390
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Max 
Gerrit-Comment-Date: Mon, 25 Mar 2019 12:24:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-pcu[master]: MCS: move Mode enum outside of class definition

2019-03-24 Thread Max
Hello Pau Espin Pedrol, Daniel Willmann, Harald Welte, osmith, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/13163

to look at the new patch set (#7).

Change subject: MCS: move Mode enum outside of class definition
..

MCS: move Mode enum outside of class definition

Move Mode (EDGE/GPRS) definition and related functions outside of
GprsCodingScheme class. This allows us to use standard libosmocore
value_string functions.

Change-Id: I3baaac7f1ca3f5b88917a23c1679d63847455f47
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/gprs_ms.cpp
M src/gprs_ms.h
M src/pcu_vty_functions.cpp
M src/tbf.cpp
M tests/edge/EdgeTest.cpp
9 files changed, 50 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/63/13163/7
--
To view, visit https://gerrit.osmocom.org/13163
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3baaac7f1ca3f5b88917a23c1679d63847455f47
Gerrit-Change-Number: 13163
Gerrit-PatchSet: 7
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in openbsc[master]: talloc_ctx_init: Use public API osmo_signal_talloc_ctx_init

2019-03-24 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13387 )

Change subject: talloc_ctx_init: Use public API osmo_signal_talloc_ctx_init
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13387
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8dab0ef810adba17fdd242e3a127908dd09b2b42
Gerrit-Change-Number: 13387
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 24 Mar 2019 17:51:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: Also build oc2g support for osmo-pcu

2019-03-24 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13368 )

Change subject: Also build oc2g support for osmo-pcu
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13368
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iebddf8d41538fe1e69435cda7f77bd49c4c14477
Gerrit-Change-Number: 13368
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Willmann 
Gerrit-Reviewer: Max 
Gerrit-CC: André Boddenberg 
Gerrit-Comment-Date: Sun, 24 Mar 2019 17:48:46 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: Use libosmocore for IMSI parsing

2019-03-24 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/13395


Change subject: Use libosmocore for IMSI parsing
..

Use libosmocore for IMSI parsing

Change-Id: Iec5c65776fc54b2f9e5dd55c711ace2471662db1
---
M src/gprs_bssgp_pcu.cpp
1 file changed, 4 insertions(+), 32 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/13395/1

diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index f63fac3..828997a 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -49,35 +49,6 @@
 static void bvc_timeout(void *_priv);
 static int gprs_ns_reconnect(struct gprs_nsvc *nsvc);

-static int parse_imsi(struct tlv_parsed *tp, char *imsi)
-{
-   uint8_t imsi_len;
-   uint8_t *bcd_imsi;
-   int i, j;
-
-   if (!TLVP_PRESENT(tp, BSSGP_IE_IMSI))
-   return -EINVAL;
-
-   imsi_len = TLVP_LEN(tp, BSSGP_IE_IMSI);
-   bcd_imsi = (uint8_t *) TLVP_VAL(tp, BSSGP_IE_IMSI);
-
-   if ((bcd_imsi[0] & 0x08))
-   imsi_len = imsi_len * 2 - 1;
-   else
-   imsi_len = (imsi_len - 1) * 2;
-   for (i = 0, j = 0; j < imsi_len && j < 15; j++)
-   {
-   if (!(j & 1)) {
-   imsi[j] = (bcd_imsi[i] >> 4) + '0';
-   i++;
-   } else
-   imsi[j] = (bcd_imsi[i] & 0xf) + '0';
-   }
-   imsi[j] = '\0';
-
-   return 0;
-}
-
 #if 0
 static int parse_ra_cap(struct tlv_parsed *tp, MS_Radio_Access_capability_t 
*rac)
 {
@@ -142,7 +113,7 @@
/* read IMSI. if no IMSI exists, use first paging block (any paging),
 * because during attachment the IMSI might not be known, so the MS
 * will listen to all paging blocks. */
-   parse_imsi(tp, imsi);
+   gsm48_mi_to_string(imsi, 17, TLVP_VAL(tp, BSSGP_IE_IMSI), TLVP_LEN(tp, 
BSSGP_IE_IMSI));

 #if 0 /* Do not rely on this IE. TODO: make this configurable */
/* parse ms radio access capability */
@@ -200,12 +171,13 @@
}
LOGPC(DBSSGP, LOGL_NOTICE, "\n");

-   if (parse_imsi(tp, imsi))
-   {
+   if (!TLVP_PRESENT(tp, BSSGP_IE_IMSI)) {
LOGP(DBSSGP, LOGL_ERROR, "No IMSI\n");
return -EINVAL;
}

+   gsm48_mi_to_string(imsi, 17, TLVP_VAL(tp, BSSGP_IE_IMSI), TLVP_LEN(tp, 
BSSGP_IE_IMSI));
+
return gprs_rlcmac_paging_request(ptmsi, ptmsi_len, imsi);
 }


--
To view, visit https://gerrit.osmocom.org/13395
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec5c65776fc54b2f9e5dd55c711ace2471662db1
Gerrit-Change-Number: 13395
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-pcu[master]: gprs_debug: Use named initializers and explicit array indicies

2019-03-24 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13384 )

Change subject: gprs_debug: Use named initializers and explicit array indicies
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/13384
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2be88586ca44b0b8361f96cf3c034c8459244c2c
Gerrit-Change-Number: 13384
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sun, 24 Mar 2019 17:41:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon: use static helper to prepare FBSB

2019-03-22 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13355 )

Change subject: trxcon: use static helper to prepare FBSB
..

trxcon: use static helper to prepare FBSB

Use static helper to prepare l1ctl_fbsb_conf - this simplifies
fbsb-related functions and make difference between timer callback and
regular response more obvious.

Change-Id: I43832d6a912a32ea5795ed0110981e0b714a7a61
---
M src/host/trxcon/l1ctl.c
1 file changed, 15 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 8145936..97c2496 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -151,6 +151,19 @@
return dl;
 }

+/* Fill in FBSB payload: BSIC and sync result */
+static struct l1ctl_fbsb_conf *fbsb_conf_make(struct msgb *msg, uint8_t 
result, uint8_t bsic)
+{
+   struct l1ctl_fbsb_conf *conf = (struct l1ctl_fbsb_conf *) msgb_put(msg, 
sizeof(*conf));
+
+   LOGP(DL1C, LOGL_DEBUG, "Send FBSB Conf (result=%u, bsic=%u)\n", result, 
bsic);
+
+   conf->result = result;
+   conf->bsic = bsic;
+
+   return conf;
+}
+
 int l1ctl_tx_fbsb_conf(struct l1ctl_link *l1l, uint8_t result,
struct l1ctl_info_dl *dl_info, uint8_t bsic)
 {
@@ -161,16 +174,10 @@
if (msg == NULL)
return -ENOMEM;

-   LOGP(DL1C, LOGL_DEBUG, "Send FBSB Conf (result=%u, bsic=%u)\n",
-   result, bsic);
-
put_dl_info_hdr(msg, dl_info);
talloc_free(dl_info);

-   /* Fill in FBSB payload: BSIC and sync result */
-   conf = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*conf));
-   conf->result = result;
-   conf->bsic = bsic;
+   conf = fbsb_conf_make(msg, result, bsic);

/* FIXME: set proper value */
conf->initial_freq_err = 0;
@@ -287,7 +294,6 @@
 static void fbsb_timer_cb(void *data)
 {
struct l1ctl_link *l1l = (struct l1ctl_link *) data;
-   struct l1ctl_fbsb_conf *conf;
struct l1ctl_info_dl *dl;
struct msgb *msg;

@@ -302,10 +308,7 @@
/* Fill in current ARFCN */
dl->band_arfcn = htons(l1l->trx->band_arfcn);

-   /* Fill in FBSB payload: BSIC and sync result */
-   conf = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*conf));
-   conf->result = 255;
-   conf->bsic = 0;
+   fbsb_conf_make(msg, 255, 0);

/* Ask SCH handler not to send L1CTL_FBSB_CONF anymore */
l1l->fbsb_conf_sent = true;

--
To view, visit https://gerrit.osmocom.org/13355
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I43832d6a912a32ea5795ed0110981e0b714a7a61
Gerrit-Change-Number: 13355
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: osmith 


Change in osmocom-bb[master]: trxcon: log FBSB timer events

2019-03-22 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13364 )

Change subject: trxcon: log FBSB timer events
..

trxcon: log FBSB timer events

Change-Id: I0168d43951494f4010df891f391ddad4b57493d7
---
M src/host/trxcon/l1ctl.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index b37082e..8145936 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -295,7 +295,7 @@
if (msg == NULL)
return;

-   LOGP(DL1C, LOGL_DEBUG, "Send FBSB Conf (result=255, bsic=0)\n");
+   LOGP(DL1C, LOGL_NOTICE, "FBSB timer fired for ARFCN %u\n", 
l1l->trx->band_arfcn &~ ARFCN_FLAG_MASK);

dl = put_dl_info_hdr(msg, NULL);

@@ -361,6 +361,7 @@
/* Start FBSB expire timer */
l1l->fbsb_timer.data = l1l;
l1l->fbsb_timer.cb = fbsb_timer_cb;
+   LOGP(DL1C, LOGL_INFO, "Starting FBSB timer %u ms\n", timeout * 
FRAME_DURATION_uS / 1000);
osmo_timer_schedule(&l1l->fbsb_timer, 0,
timeout * FRAME_DURATION_uS);


--
To view, visit https://gerrit.osmocom.org/13364
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0168d43951494f4010df891f391ddad4b57493d7
Gerrit-Change-Number: 13364
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-pcu[master]: MCS: move Mode enum outside of class definition

2019-03-21 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/13163 )

Change subject: MCS: move Mode enum outside of class definition
..


Patch Set 6:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/13163
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3baaac7f1ca3f5b88917a23c1679d63847455f47
Gerrit-Change-Number: 13163
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 21 Mar 2019 16:28:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


  1   2   3   4   5   6   7   8   9   10   >