Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-29 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 5:

(1 comment)

https://gerrit.osmocom.org/#/c/10170/5/src/common/pcu_sock.c
File src/common/pcu_sock.c:

https://gerrit.osmocom.org/#/c/10170/5/src/common/pcu_sock.c@602
PS5, Line 602: regenerate_si3_restoctets
> I think this should be rather done in pcu_sock_accept(). […]
well, we "abuse" the PCU_VERSION "TXT" indication as some kind of logical 
"hello" message.  I think it's better to wait for that rather than some random 
process having opened a unix domain socket without ever even having written a 
single valid message (or anything) to it.



--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 30 May 2019 00:43:13 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-29 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Wed, 29 May 2019 08:40:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-29 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..

clear GPRS indicator in SI3 while PCU is disconnected

osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MSs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Depends: I690cf308311f910005a325d50f5d5d825678d2b2 (libosmocore.git)
Depends: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0 (libosmocore.git)
Depends: I8b1ee2405f6338507e9dfb5f1f437c4c2db2e330 (libosmocore.git)
Related: OS#3075
---
M include/osmo-bts/bts.h
M include/osmo-bts/gsm_data_shared.h
M src/common/pcu_sock.c
M src/common/rsl.c
M src/common/sysinfo.c
5 files changed, 63 insertions(+), 9 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/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index d7c4bbf..970fb1b 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -48,6 +48,7 @@
  int is_ag_res);

 uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time);
+void regenerate_si3_restoctets(struct gsm_bts *bts);
 uint8_t *lchan_sacch_get(struct gsm_lchan *lchan);
 int lchan_init_lapdm(struct gsm_lchan *lchan);

diff --git a/include/osmo-bts/gsm_data_shared.h 
b/include/osmo-bts/gsm_data_shared.h
index 415e6bc..90772e2 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -620,6 +621,10 @@
/* offsets used while generating SI2quater */
size_t e_offset;
size_t u_offset;
+   /* decoded SI3 rest octets - *unmodified* as received from BSC */
+   struct osmo_gsm48_si_ro_info si3_ro_decoded;
+   /* is SI3 GPRS Indicator currently disabled due to lack of PCU 
connection? */
+   bool si3_gprs_ind_disabled;

/* ip.accesss Unit ID's have Site/BTS/TRX layout */
union {
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index e4f2d66..39b4568 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -1,6 +1,6 @@
 /* pcu_sock.c: Connect from PCU via unix domain socket */

-/* (C) 2008-2010 by Harald Welte 
+/* (C) 2008-2019 by Harald Welte 
  * (C) 2009-2012 by Andreas Eversberg 
  * (C) 2012 by Holger Hans Peter Freyther
  * All Rights Reserved
@@ -598,6 +598,9 @@
oml_tx_failure_event_rep(>gprs.cell.mo, NM_SEVER_CEASED, 
OSMO_EVT_PCU_VERS, txt->text);
osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH);

+   /* patch SI3 to advertise GPRS, *if* the SI3 sent by BSC said 
so */
+   regenerate_si3_restoctets(bts);
+
if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13))
return pcu_tx_si13(bts, true);

@@ -741,6 +744,9 @@
bfd->fd = -1;
osmo_fd_unregister(bfd);

+   /* patch SI3 to remove GPRS indicator */
+   regenerate_si3_restoctets(bts);
+
/* re-enable the generation of ACCEPT for new connections */
state->listen_bfd.when |= BSC_FD_READ;

diff --git a/src/common/rsl.c b/src/common/rsl.c
index f76a006..b96182f 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1,7 +1,7 @@
 /* GSM TS 08.58 RSL, BTS Side */

 /* (C) 2011 by Andreas Eversberg 
- * (C) 2011-2017 by Harald Welte 
+ * (C) 2011-2019 by Harald Welte 
  *
  * All Rights Reserved
  *
@@ -360,12 +360,18 @@

bts->si_valid |= (1 << osmo_si);

-   if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 &&
-   num_agch(trx, "RSL") != 1) {
-   
lchan_deactivate(>bts->c0->ts[0].lchan[CCCH_LCHAN]);
-   /* will be reactivated by sapi_deactivate_cb() */
-   trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
-   LCHAN_REL_ACT_REACT;
+   if (SYSINFO_TYPE_3 == osmo_si) {
+   if (trx->nr == 0 && num_agch(trx, "RSL") != 1) {
+   
lchan_deactivate(>bts->c0->ts[0].lchan[CCCH_LCHAN]);
+   /* will be reactivated by sapi_deactivate_cb() 
*/
+   
trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
+   LCHAN_REL_ACT_REACT;
+   }
+   /* decode original SI3 Rest Octets as sent by BSC */
+   osmo_gsm48_rest_octets_si3_decode(>si3_ro_decoded, 
GSM_BTS_SI(bts, osmo_si));
+   /* patch out GPRS indicator from binary if PCU is not 
connected; will be enabled
+ 

Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 5: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/10170/5/src/common/pcu_sock.c
File src/common/pcu_sock.c:

https://gerrit.osmocom.org/#/c/10170/5/src/common/pcu_sock.c@602
PS5, Line 602: regenerate_si3_restoctets
I think this should be rather done in pcu_sock_accept(). This function should 
do what the name says - process TXT indications.



--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Max 
Gerrit-Comment-Date: Tue, 28 May 2019 23:31:41 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has removed a vote on this change.

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Removed Verified+1 by Harald Welte 
--
To view, visit https://gerrit.osmocom.org/10170
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 5: Verified+1 Code-Review+1


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 
Gerrit-Comment-Date: Tue, 28 May 2019 18:01:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has uploaded a new patch set (#5) to the change originally created 
by Stefan Sperling. ( https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..

clear GPRS indicator in SI3 while PCU is disconnected

osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MSs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Depends: I690cf308311f910005a325d50f5d5d825678d2b2 (libosmocore.git)
Depends: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0 (libosmocore.git)
Depends: I8b1ee2405f6338507e9dfb5f1f437c4c2db2e330 (libosmocore.git)
Related: OS#3075
---
M include/osmo-bts/bts.h
M include/osmo-bts/gsm_data_shared.h
M src/common/pcu_sock.c
M src/common/rsl.c
M src/common/sysinfo.c
5 files changed, 63 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/10170/5
--
To view, visit https://gerrit.osmocom.org/10170
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 4: Code-Review+1

this new patch has been verified using 
https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/14215/


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 4
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 
Gerrit-Comment-Date: Tue, 28 May 2019 17:57:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has removed a vote on this change.

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Removed Code-Review-2 by Harald Welte 
--
To view, visit https://gerrit.osmocom.org/10170
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 4
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-28 Thread Harald Welte
Harald Welte has uploaded a new patch set (#4) to the change originally created 
by Stefan Sperling. ( https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..

clear GPRS indicator in SI3 while PCU is disconnected

osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MSs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Depends: I690cf308311f910005a325d50f5d5d825678d2b2 (libosmocore.git)
Depends: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0 (libosmocore.git)
Depends: I8b1ee2405f6338507e9dfb5f1f437c4c2db2e330 (libosmocore.git)
Related: OS#3075
---
M include/osmo-bts/bts.h
M include/osmo-bts/gsm_data_shared.h
M src/common/pcu_sock.c
M src/common/rsl.c
M src/common/sysinfo.c
5 files changed, 65 insertions(+), 9 deletions(-)


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 4
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-27 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 3: Code-Review-2

actually, this code gets it wrong.  The SI3 manipulation must be done at every 
PCU connect/disconnect, not at the time the BSC sends the BCCH INFO.  That step 
might only happen once on BTS boot/connect time, while PCU might come and go 
all day long (hopefully not)


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Max 
Gerrit-Comment-Date: Mon, 27 May 2019 20:40:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 10 May 2019 08:03:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-12-12 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1:

Shouldn't this be marked as WIP while we're waiting on license clarification 
and related gerrit patch?


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-CC: Max 
Gerrit-Comment-Date: Wed, 12 Dec 2018 15:00:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-10-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1:

ah, it says so in the issue.


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 11 Oct 2018 12:30:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-10-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1:

any news here?


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 11 Oct 2018 12:29:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-07-27 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1:

> Patch Set 1:
>
> I'm also in favor to move encoding to libosmocore so we can share it from 
> osmo-bts and osmo-bsc

OK, I'll port the code from osmo-bsc to libosmocore.
This will take several steps. Here is step one: 
https://gerrit.osmocom.org/c/libosmocore/+/10185


-- 
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 27 Jul 2018 10:47:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-07-27 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1:

I'm also in favor to move encoding to libosmocore so we can share it from 
osmo-bts and osmo-bsc


--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 27 Jul 2018 07:30:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-07-26 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Patch Set 1: Code-Review+1

(4 comments)

Can we share code with osmo-bsc rest_octets.[ch]? (by moving to libosmocore)

If not, the si3 decoding and encoding should probably have a C test.

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

https://gerrit.osmocom.org/#/c/10170/1//COMMIT_MSG@10
PS1, Line 10: The BSC has no knowledge of the PCU connection state. Prevent MMs
MSs?


https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c
File src/common/rsl.c:

https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c@289
PS1, Line 289: struct gsm48_si3_rest {
would it make sense to move gsm48_si_ro_info from osmo-bsc to libosmocore?


https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c@290
PS1, Line 290:  uint8_t sp;
why tabs?


https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c@516
PS1, Line 516:  if (!pcu_connected()) {
(the levels of nesting suggest a separate function)



--
To view, visit https://gerrit.osmocom.org/10170
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: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 26 Jul 2018 20:46:43 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2018-07-26 Thread Stefan Sperling
Stefan Sperling has uploaded this change for review. ( 
https://gerrit.osmocom.org/10170


Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..

clear GPRS indicator in SI3 while PCU is disconnected

osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MMs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Related: OS#3075
---
M src/common/rsl.c
1 file changed, 171 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/10170/1

diff --git a/src/common/rsl.c b/src/common/rsl.c
index a24c444..556ecb0 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -285,6 +285,151 @@
  * common channel releated messages
  */

+/* Parsed representation of si3 rest octets. */
+struct gsm48_si3_rest {
+   uint8_t sp;
+   uint8_t sp_cbq;
+   uint8_t sp_cro;
+   uint8_t sp_to;
+   uint8_t sp_pt;
+   uint8_t po;
+   uint8_t po_value;
+   uint8_t si2ter_ind;
+   uint8_t ecsm;
+   uint8_t sched;
+   uint8_t sched_where;
+   uint8_t gprs;
+   uint8_t gprs_ra_colour;
+   uint8_t gprs_si13_pos;
+   uint8_t ecmr_3g;
+   uint8_t si2qter_ind;
+};
+
+/* decode "SI 3 Rest Octets" (10.5.2.34); XXX move to libosmocore? */
+static void gsm48_decode_si3_rest(struct gsm48_si3_rest *s, uint8_t *si,
+   uint8_t len)
+{
+   struct bitvec bv;
+
+   memset(, 0, sizeof(bv));
+   bv.data_len = len;
+   bv.data = si;
+
+   /* Optional Selection Parameters */
+   if (bitvec_get_bit_high() == H) {
+   s->sp = 1;
+   s->sp_cbq = bitvec_get_uint(, 1);
+   s->sp_cro = bitvec_get_uint(, 6);
+   s->sp_to = bitvec_get_uint(, 3);
+   s->sp_pt = bitvec_get_uint(, 5);
+   } else
+   s->sp = 0;
+   /* Optional Power Offset */
+   if (bitvec_get_bit_high() == H) {
+   s->po = 1;
+   s->po_value = bitvec_get_uint(, 2);
+   } else
+   s->po = 0;
+   /* System Information 2ter Indicator */
+   if (bitvec_get_bit_high() == H)
+   s->si2ter_ind = 1;
+   else
+   s->si2ter_ind = 0;
+   /* Early Classmark Sending Control */
+   if (bitvec_get_bit_high() == H)
+   s->ecsm = 1;
+   else
+   s->ecsm = 0;
+   /* Scheduling if and where */
+   if (bitvec_get_bit_high() == H) {
+   s->sched = 1;
+   s->sched_where = bitvec_get_uint(, 3);
+   } else
+   s->sched = 0;
+   /* GPRS Indicator */
+   if (bitvec_get_bit_high() == H) {
+   s->gprs = 1;
+   s->gprs_ra_colour = bitvec_get_uint(, 3);
+   s->gprs_si13_pos = bitvec_get_uint(, 1);
+   } else
+   s->gprs = 0;
+   /* 3G Early Classmark Sending Restriction. If H, then controlled by
+* early_cm_ctrl above */
+   if (bitvec_get_bit_high() == H)
+   s->ecmr_3g = 1;
+   else
+   s->ecmr_3g = 0;
+
+   if (bitvec_get_bit_high() == H)
+   s->si2qter_ind = 1;
+   else
+   s->si2qter_ind = 0;
+}
+
+/* encode "SI 3 Rest Octets" (10.5.2.34); XXX move to libosmocore? */
+static void gsm48_encode_si3_rest(struct gsm48_si3_rest *s, uint8_t *si,
+   uint8_t len)
+{
+   struct bitvec bv;
+
+   memset(, 0, sizeof(bv));
+   bv.data = si;
+   bv.data_len = len;
+
+   /* Optional Selection Parameters */
+   if (s->sp) {
+   bitvec_set_bit(, H);
+   bitvec_set_bit(, s->sp_cbq);
+   bitvec_set_uint(, s->sp_cro, 6);
+   bitvec_set_uint(, s->sp_to, 3);
+   bitvec_set_uint(, s->sp_pt, 5);
+   } else
+   bitvec_set_bit(, L);
+   /* Optional Power Offset */
+   if (s->po) {
+   bitvec_set_bit(, H);
+   bitvec_set_uint(, s->po_value, 2);
+   } else
+   bitvec_set_bit(, L);
+   /* System Information 2ter Indicator */
+   if (s->si2ter_ind)
+   bitvec_set_bit(, H);
+   else
+   bitvec_set_bit(, L);
+   /* Early Classmark Sending Control */
+   if (s->ecsm)
+   bitvec_set_bit(, H);
+   else
+   bitvec_set_bit(, L);
+   /* Scheduling if and where */
+   if (s->sched) {
+