Build failed in Jenkins: master-simtrace2 » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #256

2019-01-17 Thread jenkins
See 


--
[...truncated 99.70 KB...]
[COMPILING ./atmel_softpack_libraries/usb/device/core/USBD.c]
[COMPILING ./atmel_softpack_libraries/usb/device/core/USBDCallbacks.c]
[COMPILING ./atmel_softpack_libraries/usb/device/core/USBDDriver.c]
[COMPILING ./atmel_softpack_libraries/usb/device/core/USBDDriverCallbacks.c]
[COMPILING libcommon/source/string.c]
[COMPILING libcommon/source/stdio.c]
[COMPILING libcommon/source/fputs.c]
[COMPILING libcommon/source/usb_buf.c]
[COMPILING libcommon/source/ringbuffer.c]
[COMPILING libcommon/source/pseudo_talloc.c]
[COMPILING libcommon/source/host_communication.c]
[COMPILING libboard/common/source/sim_switch.c]
[COMPILING libboard/common/source/board_cstartup_gnu.c]
[COMPILING libboard/common/source/board_lowlevel.c]
[COMPILING libboard/common/source/uart_console.c]
[COMPILING libboard/common/source/led.c]
[COMPILING libboard/common/source/boardver_adc.c]
[COMPILING libboard/common/source/manifest.c]
[COMPILING libboard/simtrace/source/board_simtrace.c]
[COMPILING apps/trace/main.c]
[COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu.c]
[COMPILING ./atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c]
[COMPILING libcommon/source/card_emu.c]
[COMPILING libcommon/source/cciddriver.c]
[COMPILING libcommon/source/iso7816_4.c]
[COMPILING libcommon/source/iso7816_fidi.c]
[COMPILING libcommon/source/mitm.c]
[COMPILING libcommon/source/mode_cardemu.c]
[COMPILING libcommon/source/mode_ccid.c]
[COMPILING libcommon/source/simtrace_iso7816.c]
[COMPILING libcommon/source/sniffer.c]
[COMPILING libcommon/source/tc_etu.c]
[COMPILING libcommon/source/usb.c]
   textdata bss dec hex filename
144   0   4 148  94 obj/simtrace/flash_panic.o
 54   0   0  54  36 obj/simtrace/flash_backtrace.o
   1012   0   01012 3f4 obj/simtrace/flash_rbtree.o
   1166   0410452701496 obj/simtrace/flash_msgb.o
820   0   0 820 334 obj/simtrace/flash_bits.o
400   0  12 412 19c obj/simtrace/flash_timer.o
   1807   0435961661816 obj/simtrace/flash_utils.o
   4143   0 2244367110f obj/simtrace/flash_USBD_HAL.o
 84   0   0  84  54 obj/simtrace/flash_unique_id.o
375   0   0 375 177 obj/simtrace/flash_tc.o
729   0  60 789 315 obj/simtrace/flash_pio_it.o
406   0   0 406 196 obj/simtrace/flash_pio.o
   1707   0   01707 6ab obj/simtrace/flash_exceptions.o
278   0   0 278 116 obj/simtrace/flash_spi.o
778   0   0 778 30a obj/simtrace/flash_efc.o
403   0   0 403 193 obj/simtrace/flash_pmc.o
   1477   0 2601737 6c9 obj/simtrace/flash_flashd.o
543   0   0 543 21f obj/simtrace/flash_usart.o
 56   0   0  56  38 obj/simtrace/flash_wdt.o
148   0   0 148  94 obj/simtrace/flash_core_cm3.o
182   0   0 182  b6 obj/simtrace/flash_USBDescriptors.o
 86   0   0  86  56 obj/simtrace/flash_USBRequests.o
584   0   2 586 24a obj/simtrace/flash_USBD.o
 26   0   0  26  1a obj/simtrace/flash_USBDCallbacks.o
   1587   0  161603 643 obj/simtrace/flash_USBDDriver.o
 65   0   0  65  41 obj/simtrace/flash_USBDDriverCallbacks.o
282   0   0 282 11a obj/simtrace/flash_string.o
970   0   0 970 3ca obj/simtrace/flash_stdio.o
 64   0   0  64  40 obj/simtrace/flash_fputs.o
201   0  96 297 129 obj/simtrace/flash_usb_buf.o
198   0   0 198  c6 obj/simtrace/flash_ringbuffer.o
393   034923885 f2d obj/simtrace/flash_pseudo_talloc.o
658   0   0 658 292 obj/simtrace/flash_host_communication.o
203   0   4 207  cf obj/simtrace/flash_sim_switch.o
1209424   095442548 obj/simtrace/flash_board_cstartup_gnu.o
304   0   0 304 130 obj/simtrace/flash_board_lowlevel.o
   1216   0 5211737 6c9 obj/simtrace/flash_uart_console.o
731 184   0 915 393 obj/simtrace/flash_led.o
  8   0   0   8   8 obj/simtrace/flash_boardver_adc.o
 35  16   0  51  33 obj/simtrace/flash_manifest.o
231   0   0 231  e7 obj/simtrace/flash_board_simtrace.o
   1121   1   01122 462 obj/simtrace/flash_main.o
244   0   0 244  f4 obj/simtrace/flash_dfu.o
645   4   6 655 28f obj/simtrace/flash_dfu_runtime.o
   3490   0 2083698 e72 obj/simtrace/flash_card_emu.o
   

Change in osmo-bsc[master]: assignment_fsm: fix channel allocator preferences

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12625 )

Change subject: assignment_fsm: fix channel allocator preferences
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/12625/1/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/#/c/12625/1/src/osmo-bsc/abis_rsl.c@1378
PS1, Line 1378: to
Spelling: 'to' is not needed here I think.


https://gerrit.osmocom.org/#/c/12625/1/src/osmo-bsc/assignment_fsm.c
File src/osmo-bsc/assignment_fsm.c:

https://gerrit.osmocom.org/#/c/12625/1/src/osmo-bsc/assignment_fsm.c@258
PS1, Line 258: int
Let's use bool.



--
To view, visit https://gerrit.osmocom.org/12625
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: I5239e05c1cfbcb8af28f43373a58fa6c2d216c51
Gerrit-Change-Number: 12625
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 18 Jan 2019 05:43:20 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: bsc_vty: add features to shun specific lchans

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12624 )

Change subject: bsc_vty: add features to shun specific lchans
..


Patch Set 1:

(1 comment)

Also, why not to call this flag 'ignored' or 'disabled'?

https://gerrit.osmocom.org/#/c/12624/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/#/c/12624/1/include/osmocom/bsc/gsm_data.h@619
PS1, Line 619: shun
As this flag is related to debug feature, it makes sense to prefix it somehow, 
e.g. '_shun'...



--
To view, visit https://gerrit.osmocom.org/12624
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: I397e68e26d6a1727890353fa34f4897b54795866
Gerrit-Change-Number: 12624
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 18 Jan 2019 05:31:48 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: lchan_select: Do not unsolicitedly select a TCH/F

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12623 )

Change subject: lchan_select: Do not unsolicitedly select a TCH/F
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/12623
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: I057e70bc81b3dac470f6d1d2a37533ec3a7a79d0
Gerrit-Change-Number: 12623
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 18 Jan 2019 05:25:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: lchan_select: dont allow half rate EFR to be selected

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12622 )

Change subject: lchan_select: dont allow half rate EFR to be selected
..


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/12622/1/src/osmo-bsc/lchan_select.c
File src/osmo-bsc/lchan_select.c:

https://gerrit.osmocom.org/#/c/12622/1/src/osmo-bsc/lchan_select.c@140
PS1, Line 140: There is no full-rate EFR specified!
This comment looks confusing. Let's rather say:

  /* EFR works over FR channels only */


https://gerrit.osmocom.org/#/c/12622/1/src/osmo-bsc/lchan_select.c@143
PS1, Line 143:  case GSM48_CMODE_SPEECH_V1:
Please add some "fall-through" comment here to suppress Coverity / compiler 
warnings.



--
To view, visit https://gerrit.osmocom.org/12622
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: I961d9aaba81424053ab1dc04ce7799e716af4cd8
Gerrit-Change-Number: 12622
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 18 Jan 2019 05:23:29 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: chan_alloc: remove references to lchan_alloc()

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12621 )

Change subject: chan_alloc: remove references to lchan_alloc()
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/12621/1/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/#/c/12621/1/src/osmo-bsc/abis_rsl.c@a1381
PS1, Line 1381:
Does it make sense for lchan_select_by_type()?



--
To view, visit https://gerrit.osmocom.org/12621
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: I36227ea306d28587ac70acbe596c7756b23d88c7
Gerrit-Change-Number: 12621
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 18 Jan 2019 05:14:32 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: vty: make 'sh connect/transact' readable again

2019-01-17 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/12626


Change subject: vty: make 'sh connect/transact' readable again
..

vty: make 'sh connect/transact' readable again

After recent changes to vlr_subscr_name() result became variable-length
which messes up old vty code. Fix this by moving it to the very end and
adjusting headers as necessary. While at it, make sure we don't print
headers if we have nothing else to show.

Change-Id: Id06b4277ff790d95457d0cc2f94ef6bf5366bb21
---
M src/libmsc/msc_vty.c
1 file changed, 24 insertions(+), 9 deletions(-)



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

diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 1fdf560..93d093f 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -550,15 +550,21 @@

 static void vty_conn_hdr(struct vty *vty)
 {
-   vty_out(vty, "--ConnId Subscriber RAN --LAC Use --Tokens C 
A5 State%s",
-   VTY_NEWLINE);
+   unsigned lnum = 0;
+   struct ran_conn *conn;
+
+   llist_for_each_entry(conn, >ran_conns, entry)
+   lnum++;
+
+   if (lnum)
+   vty_out(vty, "--ConnId RAN --LAC Use --Tokens C A5State 
    Subscriber%s",
+   VTY_NEWLINE);
 }

 static void vty_dump_one_conn(struct vty *vty, const struct ran_conn *conn)
 {
-   vty_out(vty, "%08x %22s %3s %5u %3u %08x %c /%1u %27s %s",
+   vty_out(vty, "%08x %3s %5u %3u %08x %c /%1u %27s %22s%s",
conn->a.conn_id,
-   conn->vsub ? vlr_subscr_name(conn->vsub) : "-",
conn->via_ran == OSMO_RAT_UTRAN_IU ? "Iu" : "A",
conn->lac,
conn->use_count,
@@ -566,6 +572,7 @@
conn->received_cm_service_request ? 'C' : '-',
conn->geran_encr.alg_id,
conn->fi ? osmo_fsm_inst_state_name(conn->fi) : "-",
+   conn->vsub ? vlr_subscr_name(conn->vsub) : "-",
VTY_NEWLINE);
 }

@@ -583,8 +590,15 @@

 static void vty_trans_hdr(struct vty *vty)
 {
-   vty_out(vty, "Subscriber --ConnId -P TI -CallRef Proto%s",
-   VTY_NEWLINE);
+   unsigned lnum = 0;
+   struct gsm_trans *trans;
+
+   llist_for_each_entry(trans, >trans_list, entry)
+   lnum++;
+
+   if (lnum)
+   vty_out(vty, "--ConnId -P TI -CallRef [---  Proto   ---] 
 Subscriber%s",
+   VTY_NEWLINE);
 }

 static const char *get_trans_proto_str(const struct gsm_trans *trans)
@@ -613,13 +627,14 @@

 static void vty_dump_one_trans(struct vty *vty, const struct gsm_trans *trans)
 {
-   vty_out(vty, "%22s %08x %s %02u %08x %s%s",
-   trans->vsub ? vlr_subscr_name(trans->vsub) : "-",
+   vty_out(vty, "%08x %s %02u %08x [%s] %22s%s",
trans->conn ? trans->conn->a.conn_id : 0,
gsm48_pdisc_name(trans->protocol),
trans->transaction_id,
trans->callref,
-   get_trans_proto_str(trans), VTY_NEWLINE);
+   get_trans_proto_str(trans),
+   trans->vsub ? vlr_subscr_name(trans->vsub) : "-",
+   VTY_NEWLINE);
 }

 DEFUN(show_msc_transaction, show_msc_transaction_cmd,

--
To view, visit https://gerrit.osmocom.org/12626
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: Id06b4277ff790d95457d0cc2f94ef6bf5366bb21
Gerrit-Change-Number: 12626
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-bsc[master]: bsc_vty: add features to shun specific lchans

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12624


Change subject: bsc_vty: add features to shun specific lchans
..

bsc_vty: add features to shun specific lchans

In some test and debug situations it is useful to have the ability to
lock certain lchans in a way that the BSC can not allocate them. One
application might be to simulate an exhaustion of all TCH/H channels in
order to force the BSC to take one of the available TCH/F.

Lets add a command to the vty which alloes us to mark certain lchans as
shunned and check that condition while doing the channel allocation

Change-Id: I397e68e26d6a1727890353fa34f4897b54795866
Related: OS#3503
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/lchan_fsm.c
M src/osmo-bsc/lchan_select.c
4 files changed, 72 insertions(+), 19 deletions(-)



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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 9f7ce8d..22d80df 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -613,6 +613,10 @@
struct gsm48_req_ref *rqd_ref;

struct gsm_subscriber_connection *conn;
+
+   /* Debug feature: When set to true via VTY, the channel allocator will
+* not use this lchan. */
+   bool shun;
 };

 /* One Timeslot in a TRX */
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 791aebe..ed93dcb 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1372,10 +1372,11 @@
lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr,
lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE);
vty_out_dyn_ts_details(vty, lchan->ts);
-   vty_out(vty, "  Connection: %u, State: %s%s%s%s",
+   vty_out(vty, "  Connection: %u, State: %s%s%s%s%s",
lchan->conn ? 1: 0, lchan_state_name(lchan),
lchan->fi && lchan->fi->state == LCHAN_ST_BORKEN ? " Error 
reason: " : "",
lchan->fi && lchan->fi->state == LCHAN_ST_BORKEN ? 
lchan->last_error : "",
+   lchan->shun ? " (shunned)" : "",
VTY_NEWLINE);
vty_out(vty, "  BS Power: %u dBm, MS Power: %u dBm%s",
lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red
@@ -1430,22 +1431,24 @@
gsm_pchan_name(lchan->ts->pchan_on_init));
vty_out_dyn_ts_status(vty, lchan->ts);
vty_out(vty, ", Lchan %u, Type %s, State %s - "
-   "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d 
dBm%s",
+   "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d 
dBm%s%s",
lchan->nr,
gsm_lchant_name(lchan->type), lchan_state_name(lchan),
mr->ms_l1.pwr,
rxlev2dbm(mr->dl.full.rx_lev),
rxlev2dbm(mr->ul.full.rx_lev),
+   lchan->shun ? " (shunned)" : "",
VTY_NEWLINE);
 }


 static int dump_lchan_trx_ts(struct gsm_bts_trx_ts *ts, struct vty *vty,
-void (*dump_cb)(struct vty *, struct gsm_lchan *))
+void (*dump_cb)(struct vty *, struct gsm_lchan *),
+bool all)
 {
struct gsm_lchan *lchan;
ts_for_each_lchan(lchan, ts) {
-   if (lchan_state_is(lchan, LCHAN_ST_UNUSED))
+   if (lchan_state_is(lchan, LCHAN_ST_UNUSED) && all == false)
continue;
dump_cb(vty, lchan);
}
@@ -1454,33 +1457,36 @@
 }

 static int dump_lchan_trx(struct gsm_bts_trx *trx, struct vty *vty,
- void (*dump_cb)(struct vty *, struct gsm_lchan *))
+ void (*dump_cb)(struct vty *, struct gsm_lchan *),
+ bool all)
 {
int ts_nr;

for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) {
struct gsm_bts_trx_ts *ts = >ts[ts_nr];
-   dump_lchan_trx_ts(ts, vty, dump_cb);
+   dump_lchan_trx_ts(ts, vty, dump_cb, all);
}

return CMD_SUCCESS;
 }

 static int dump_lchan_bts(struct gsm_bts *bts, struct vty *vty,
- void (*dump_cb)(struct vty *, struct gsm_lchan *))
+ void (*dump_cb)(struct vty *, struct gsm_lchan *),
+ bool all)
 {
int trx_nr;

for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) {
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, trx_nr);
-   dump_lchan_trx(trx, vty, dump_cb);
+   dump_lchan_trx(trx, vty, dump_cb, all);
}

return CMD_SUCCESS;
 }

 static int lchan_summary(struct vty *vty, int argc, const char **argv,
-void (*dump_cb)(struct vty *, struct gsm_lchan *))
+void (*dump_cb)(struct vty *, struct gsm_lchan *),
+ 

Change in osmo-bsc[master]: chan_alloc: remove references to lchan_alloc()

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12621


Change subject: chan_alloc: remove references to lchan_alloc()
..

chan_alloc: remove references to lchan_alloc()

The function lchan_alloc() does not exist anymore, however there is
still a prototype definition in chan_alloc.h and a comment in
abis_rsl.c. Lets remove those.

Change-Id: I36227ea306d28587ac70acbe596c7756b23d88c7
---
M include/osmocom/bsc/chan_alloc.h
M src/osmo-bsc/abis_rsl.c
2 files changed, 0 insertions(+), 5 deletions(-)



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

diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h
index 97f6cb2..b509e3e 100644
--- a/include/osmocom/bsc/chan_alloc.h
+++ b/include/osmocom/bsc/chan_alloc.h
@@ -24,9 +24,6 @@

 struct gsm_subscriber_connection;

-/* Allocate a logical channel (SDCCH, TCH, ...) */
-struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int 
allow_bigger);
-
 /* Free a logical channel (SDCCH, TCH, ...) */
 void lchan_free(struct gsm_lchan *lchan);

diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 8ffb07e..d67573f 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1378,8 +1378,6 @@
 * - If SDCCH is not available, try whatever MS requested, if not SDCCH.
 * - If there is still no channel available, reject channel request.
 *
-* lchan_alloc() possibly tries to allocate larger lchans.
-*
 * Note: If the MS requests not TCH/H, we don't know if the phone
 *   supports TCH/H, so we must assign TCH/F or SDCCH.
 */

--
To view, visit https://gerrit.osmocom.org/12621
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: I36227ea306d28587ac70acbe596c7756b23d88c7
Gerrit-Change-Number: 12621
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 


Change in osmo-bsc[master]: lchan_select: Do not unsolicitedly select a TCH/F

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12623


Change subject: lchan_select: Do not unsolicitedly select a TCH/F
..

lchan_select: Do not unsolicitedly select a TCH/F

The function lchan_select_by_type() will unsolicitedly select a TCH/F
when it is asked for a TCH/H but a TCH/H is not available. This behavior
is presumably a leftover from before the split. Now every fallback to
another rate must be agreed with the MSC in advance, it is a spec
violation to silently fallback to TCH/F when asked for a TCH/H.

Change-Id: I057e70bc81b3dac470f6d1d2a37533ec3a7a79d0
Related: OS#3503
---
M src/osmo-bsc/lchan_select.c
1 file changed, 0 insertions(+), 17 deletions(-)



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

diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index 0e22448..eac0adf 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -206,12 +206,6 @@
break;
case GSM_LCHAN_TCH_H:
lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H);
-   /* If we don't have TCH/H available, fall-back to TCH/F */
-   if (!lchan) {
-   lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F);
-   if (lchan)
-   type = GSM_LCHAN_TCH_F;
-   }
/* No dedicated TCH/x available -- try fully dynamic
 * TCH/F_TCH/H_PDCH */
if (!lchan) {
@@ -221,17 +215,6 @@
if (lchan)
type = GSM_LCHAN_TCH_H;
}
-   /*
-* No need to check TCH/F_TCH/H_PDCH channels for TCH/F:
-* if no TCH/H was available, neither will be TCH/F.
-*/
-   /* If we don't have TCH/F either, try dynamic TCH/F_PDCH */
-   if (!lchan) {
-   lchan = _lc_dyn_find_bts(bts, GSM_PCHAN_TCH_F_PDCH,
-GSM_PCHAN_TCH_F);
-   if (lchan)
-   type = GSM_LCHAN_TCH_F;
-   }
break;
default:
LOGP(DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type);

--
To view, visit https://gerrit.osmocom.org/12623
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: I057e70bc81b3dac470f6d1d2a37533ec3a7a79d0
Gerrit-Change-Number: 12623
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 


Change in osmo-bsc[master]: lchan_select: dont allow half rate EFR to be selected

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12622


Change subject: lchan_select: dont allow half rate EFR to be selected
..

lchan_select: dont allow half rate EFR to be selected

The function lchan_select_by_chan_mode() is prone to select an half rate
lchan when EFR is used, even though EFR is not defined for half-rate.
Lets protect against that.

Change-Id: I961d9aaba81424053ab1dc04ce7799e716af4cd8
Related: OS#3503
---
M src/osmo-bsc/lchan_select.c
1 file changed, 4 insertions(+), 1 deletion(-)



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

diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index f70ad4a..0e22448 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -136,8 +136,11 @@
case GSM48_CMODE_SIGN:
type = GSM_LCHAN_SDCCH;
break;
-   case GSM48_CMODE_SPEECH_V1:
case GSM48_CMODE_SPEECH_EFR:
+   /* There is no full-rate EFR specified! */
+   if (!full_rate)
+   return NULL;
+   case GSM48_CMODE_SPEECH_V1:
case GSM48_CMODE_SPEECH_AMR:
type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
break;

--
To view, visit https://gerrit.osmocom.org/12622
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: I961d9aaba81424053ab1dc04ce7799e716af4cd8
Gerrit-Change-Number: 12622
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 


Change in osmo-bsc[master]: assignment_fsm: fix channel allocator preferences

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12625


Change subject: assignment_fsm: fix channel allocator preferences
..

assignment_fsm: fix channel allocator preferences

When the MSC allocates a channel through the ASSIGNMENT REQUEST, it may
ask for a TCH/H and a TCH/F at the same time and tell which of the two
types it prefers.

The process of channel allocation currently selects, based on the BTS,
MSC and MS capabilites exactly one apropriate codec/rate (e.g. TCH/H)
and then trys to allocate it. If that allocation fails, there is no way
to try the second choice and the assignment fails.

For example: The MSC asks for TCH/F and TCH/H, prefering TCH/F, then the
channel allocator will try TCH/F and if it fails (all TCH/F are
currently in use), then TCH/H is never tried.

Since the BSC currently only trys the first best codec/rate that is
supported it also ignores the preference.

Lets fix those problems by including the preference information and both
possible codec/rate settings into the channel allocation decision.

Change-Id: I5239e05c1cfbcb8af28f43373a58fa6c2d216c51
Related: OS#3503
---
M include/osmocom/bsc/codec_pref.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/codec_pref.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
M tests/codec_pref/codec_pref_test.c
8 files changed, 366 insertions(+), 136 deletions(-)



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

diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h
index 51340c1..adefe04 100644
--- a/include/osmocom/bsc/codec_pref.h
+++ b/include/osmocom/bsc/codec_pref.h
@@ -9,14 +9,19 @@
 struct bts_codec_conf;
 struct bsc_msc_data;
 struct gsm_bts;
+struct channel_mode_and_rate;

-int match_codec_pref(enum gsm48_chan_mode *chan_mode,
-bool *full_rate,
-uint16_t *s15_s0,
+enum rate_pref {
+   RATE_PREF_NONE,
+   RATE_PREF_HR,
+   RATE_PREF_FR,
+};
+
+int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate,
 const struct gsm0808_channel_type *ct,
 const struct gsm0808_speech_codec_list *scl,
 const struct bsc_msc_data *msc,
-const struct gsm_bts *bts);
+const struct gsm_bts *bts, enum rate_pref rate_pref);

 void gen_bss_supported_codec_list(struct gsm0808_speech_codec_list *scl,
  const struct bsc_msc_data *msc,
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 22d80df..a161051 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -99,6 +99,12 @@
SUBSCR_SCCP_ST_CONNECTED
 };

+struct channel_mode_and_rate {
+   enum gsm48_chan_mode chan_mode;
+   bool full_rate;
+   uint16_t s15_s0;
+};
+
 struct assignment_request {
bool aoip;

@@ -107,9 +113,12 @@
char msc_rtp_addr[INET_ADDRSTRLEN];
uint16_t msc_rtp_port;

-   enum gsm48_chan_mode chan_mode;
-   bool full_rate;
-   uint16_t s15_s0;
+   /* Prefered rate/codec setting (mandatory) */
+   struct channel_mode_and_rate ch_mode_rate_pref;
+
+   /* Alternate rate/codec setting (optional) */
+   bool ch_mode_rate_alt_present;
+   struct channel_mode_and_rate ch_mode_rate_alt;
 };

 struct assignment_fsm_data {
@@ -282,6 +291,13 @@
/* pointer to "other" connection, if Call Leg Relocation was 
successful */
struct gsm_subscriber_connection *other;
} lcls;
+
+   /* Depending on the preferences that where submitted together with
+* the assignment and the current channel load, the BSC has to select
+* one of the offered codec/rates. The final selection by the BSC is
+* stored here and is used when sending the assignment complete or
+* when performing a handover procedure. */
+   struct channel_mode_and_rate ch_mode_rate;
 };

 
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index d67573f..c1e6bf0 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1375,22 +1375,12 @@
/* check availability / allocate channel
 *
 * - First try to allocate SDCCH.
-* - If SDCCH is not available, try whatever MS requested, if not SDCCH.
-* - If there is still no channel available, reject channel request.
+* - If SDCCH is not available, try to a TCH/H (less bandwith).
+* - If there is still no channel available, try a TCH/F.
 *
-* Note: If the MS requests not TCH/H, we don't know if the phone
-*   supports TCH/H, so we must assign TCH/F or SDCCH.
 */
lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH);
-   if (!lchan && lctype != GSM_LCHAN_SDCCH) {
-   

Change in osmo-ttcn3-hacks[master]: WIP: BSC_Tests: Add tests to check channel allocator

2019-01-17 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/12620


Change subject: WIP: BSC_Tests: Add tests to check channel allocator
..

WIP: BSC_Tests: Add tests to check channel allocator

When a channel is assigned via the assignment request throught the A
interface, the MSC may offer either FR, HR or both. When FR and HR are
permitted, a preference is set on one of the two.

At the moment we do not check how the bsc is reacting to those
preferences and its also not checked how the behavior is when the
preferred rate is not available because all lchan of that type are
already in use. Lets add a set of tests to verify this.

Change-Id: I109d986dd7ece1a56422a669ca64353ed46f7ed6
Related: OS#3503
---
M bsc/BSC_Tests.ttcn
M bsc/expected-results.xml
2 files changed, 304 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/20/12620/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 77da306..1467063 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2053,6 +2053,289 @@
vc_conn.done;
 }

+private function f_shun_all_tch_f() runs on test_CT {
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 1 sub-slot 0 shun");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 2 sub-slot 0 shun");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 3 sub-slot 0 shun");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 4 sub-slot 0 shun");
+}
+
+private function f_shun_all_tch_h() runs on test_CT {
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 0 shun");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 1 shun");
+}
+
+private function f_allow_all_tch() runs on test_CT {
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 1 sub-slot 0 allow");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 2 sub-slot 0 allow");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 3 sub-slot 0 allow");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 4 sub-slot 0 allow");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 0 allow");
+   f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 1 allow");
+}
+
+/* Allow HR only */
+private function f_TC_assignment_codec_xr_exhausted_req_hr(charstring id) runs 
on MSC_ConnHdlr {
+   g_pars := f_gen_test_hdlr_pars();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := 
'09'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator 
:= '05'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR}));
+   f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR only */
+private function f_TC_assignment_codec_xr_exhausted_req_fr(charstring id) runs 
on MSC_ConnHdlr {
+   g_pars := f_gen_test_hdlr_pars();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := 
'08'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator 
:= '01'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+   f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow HR only (expect assignment failure) */
+private function f_TC_assignment_codec_xr_exhausted_req_hr_fail(charstring id) 
runs on MSC_ConnHdlr {
+   g_pars := f_gen_test_hdlr_pars();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := 
'09'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator 
:= '05'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR}));
+   f_establish_fully(ass_cmd, exp_fail);
+}
+
+/* Allow FR only (expect assignment failure) */
+private function f_TC_assignment_codec_xr_exhausted_req_fr_fail(charstring id) 
runs on MSC_ConnHdlr {
+   g_pars := f_gen_test_hdlr_pars();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := 
'08'O;
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator 

Change in osmo-ci[master]: nightly packages: Build libosmo-dsp

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12619 )

Change subject: nightly packages: Build libosmo-dsp
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12619
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: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
Gerrit-Change-Number: 12619
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 17:17:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: nightly packages: Build libosmo-dsp

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12619 )

Change subject: nightly packages: Build libosmo-dsp
..

nightly packages: Build libosmo-dsp

Change-Id: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
---
M scripts/osmocom-nightly-packages.sh
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/scripts/osmocom-nightly-packages.sh 
b/scripts/osmocom-nightly-packages.sh
index 1c98029..55c744c 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -183,6 +183,7 @@
   checkout rtl-sdr
   checkout osmo-fl2k
   checkout simtrace2
+  checkout libosmo-dsp

   create_osmo_trx_debian8_jessie

@@ -213,6 +214,7 @@
   build rtl-sdr
   build osmo-fl2k
   build simtrace2
+  build libosmo-dsp

   download_bumpversion


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
Gerrit-Change-Number: 12619
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


Change in osmo-ci[master]: nightly packages: Build libosmo-dsp

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12619 )

Change subject: nightly packages: Build libosmo-dsp
..


Patch Set 1: Verified+1


--
To view, visit https://gerrit.osmocom.org/12619
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: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
Gerrit-Change-Number: 12619
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 17:17:32 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Add function to combine nibbles into byte

2019-01-17 Thread Max
Max has abandoned this change. ( https://gerrit.osmocom.org/12573 )

Change subject: Add function to combine nibbles into byte
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I380687c31a787c0a109819f7c3b2946eae52675e
Gerrit-Change-Number: 12573
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: socket: add define for socket name length

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12554 )

Change subject: socket: add define for socket name length
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12554
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: If8be8c2c0d4935da17ab13b2c2127b719ceefbcc
Gerrit-Change-Number: 12554
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Thu, 17 Jan 2019 17:07:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: nightly packages: Build libosmo-dsp

2019-01-17 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/12619


Change subject: nightly packages: Build libosmo-dsp
..

nightly packages: Build libosmo-dsp

Change-Id: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
---
M scripts/osmocom-nightly-packages.sh
1 file changed, 2 insertions(+), 0 deletions(-)



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

diff --git a/scripts/osmocom-nightly-packages.sh 
b/scripts/osmocom-nightly-packages.sh
index 1c98029..55c744c 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -183,6 +183,7 @@
   checkout rtl-sdr
   checkout osmo-fl2k
   checkout simtrace2
+  checkout libosmo-dsp

   create_osmo_trx_debian8_jessie

@@ -213,6 +214,7 @@
   build rtl-sdr
   build osmo-fl2k
   build simtrace2
+  build libosmo-dsp

   download_bumpversion


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I989c7961336b4dacbc83e97d1c098f93f56ef6ab
Gerrit-Change-Number: 12619
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: socket: add define for socket name length

2019-01-17 Thread dexter
dexter has posted comments on this change. ( https://gerrit.osmocom.org/12554 )

Change subject: socket: add define for socket name length
..


Patch Set 2:

(1 comment)

> Build Started https://jenkins.osmocom.org/jenkins/job/gerrit-libosmocore/1454/

https://gerrit.osmocom.org/#/c/12554/2/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/12554/2/src/socket.c@786
PS2, Line 786:  /* "r=1.2.3.4:123<->l=5.6.7.8:987" */
> It might make sense to move the comment as well: the format is explained in 
> doxygen already. […]
Done



--
To view, visit https://gerrit.osmocom.org/12554
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: If8be8c2c0d4935da17ab13b2c2127b719ceefbcc
Gerrit-Change-Number: 12554
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Thu, 17 Jan 2019 16:47:05 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: socket: add define for socket name length

2019-01-17 Thread dexter
Hello Max, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/12554

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

Change subject: socket: add define for socket name length
..

socket: add define for socket name length

The function osmo_sock_get_name_buf() can be used to write a string
representation to a user provided memory. Unfortunately the proper
length for the user provided memory is not obvious. To make using
osmo_sock_get_name_buf() more practical, add a define constant that
defines the length of the required memory. Also use this define in
socket.c.

Change-Id: If8be8c2c0d4935da17ab13b2c2127b719ceefbcc
---
M include/osmocom/core/socket.h
M src/socket.c
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/12554/3
--
To view, visit https://gerrit.osmocom.org/12554
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If8be8c2c0d4935da17ab13b2c2127b719ceefbcc
Gerrit-Change-Number: 12554
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 


Change in osmo-msc[master]: Add SGs Interface

2019-01-17 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/11642 )

Change subject: Add SGs Interface
..


Patch Set 30:

> Also I think we don't have any TTCN3 test that verifies the periodic LU for 
> 2G. If we do not have that yet we should implement it.

The difficulty there is that we would, in TTCN3, actually have to *wait* for 
the entire periodic LU timeout (15 minutes?) -- unless we reconfigure that to 
something like 10 seconds if possible. IIRC the msc_vlr_tests in osmo-msc wait 
for this period using fake time, no real time wait required.


--
To view, visit https://gerrit.osmocom.org/11642
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: I73359925fc1ca72b33a1466e6ac41307f2f0b11d
Gerrit-Change-Number: 11642
Gerrit-PatchSet: 30
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: dexter 
Gerrit-CC: Stefan Sperling 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 16:37:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: Rename oc2g config file to match new naming scheme

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12617 )

Change subject: Rename oc2g config file to match new naming scheme
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/12617
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: Ie49d5695ea78da2995252c56c75ce42e6cec0e9c
Gerrit-Change-Number: 12617
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 16:33:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: LCLS: constify helper parameters

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12485 )

Change subject: LCLS: constify helper parameters
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12485/1/src/osmo-bsc/osmo_bsc_lcls.c
File src/osmo-bsc/osmo_bsc_lcls.c:

https://gerrit.osmocom.org/#/c/12485/1/src/osmo-bsc/osmo_bsc_lcls.c@278
PS1, Line 278: static void lcls_break_local_switching(struct 
gsm_subscriber_connection *conn)
> the function changes the switching of the conn, right? Isn't it confusing to 
> say const then?
Done



--
To view, visit https://gerrit.osmocom.org/12485
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: I341f4ea172432b94e8e96919926a5fb6870c2a30
Gerrit-Change-Number: 12485
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 17 Jan 2019 16:29:20 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: LCLS: constify helper parameters

2019-01-17 Thread daniel
daniel has posted comments on this change. ( https://gerrit.osmocom.org/12485 )

Change subject: LCLS: constify helper parameters
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/12485
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: I341f4ea172432b94e8e96919926a5fb6870c2a30
Gerrit-Change-Number: 12485
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: daniel 
Gerrit-Comment-Date: Thu, 17 Jan 2019 16:14:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: dump_docs: Use new config file naming scheme

2019-01-17 Thread daniel
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/12618


Change subject: dump_docs: Use new config file naming scheme
..

dump_docs: Use new config file naming scheme

Change-Id: I05723ef50deb918ed1131c1d30f8e613351b3be5
---
M contrib/dump_docs.py
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/contrib/dump_docs.py b/contrib/dump_docs.py
index 59f2a61..bdf27c4 100755
--- a/contrib/dump_docs.py
+++ b/contrib/dump_docs.py
@@ -10,7 +10,7 @@
 env['L1FWD_BTS_HOST'] = '127.0.0.1'

 bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
-   "-c", "./doc/examples/sysmo/osmo-bts.cfg"], env = env,
+   "-c", "./doc/examples/sysmo/osmo-bts-sysmo.cfg"], env = env,
stdin=None, stdout=None)
 time.sleep(1)


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I05723ef50deb918ed1131c1d30f8e613351b3be5
Gerrit-Change-Number: 12618
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 


Change in osmo-bts[master]: Rename oc2g config file to match new naming scheme

2019-01-17 Thread daniel
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/12617


Change subject: Rename oc2g config file to match new naming scheme
..

Rename oc2g config file to match new naming scheme

examples/oc2g/osmo-bts.cfg->examples/oc2g/osmo-bts-oc2g.cfg

Change-Id: Ie49d5695ea78da2995252c56c75ce42e6cec0e9c
Related: SYS#
---
M contrib/systemd/osmo-bts-oc2g.service
R doc/examples/oc2g/osmo-bts-oc2g.cfg
2 files changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/contrib/systemd/osmo-bts-oc2g.service 
b/contrib/systemd/osmo-bts-oc2g.service
index 2f2d837..7b0168a 100644
--- a/contrib/systemd/osmo-bts-oc2g.service
+++ b/contrib/systemd/osmo-bts-oc2g.service
@@ -5,7 +5,7 @@
 Type=simple
 ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
 ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
-ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts.cfg -M
+ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts-oc2g.cfg -M
 ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
 ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
 Restart=always
diff --git a/doc/examples/oc2g/osmo-bts.cfg 
b/doc/examples/oc2g/osmo-bts-oc2g.cfg
similarity index 100%
rename from doc/examples/oc2g/osmo-bts.cfg
rename to doc/examples/oc2g/osmo-bts-oc2g.cfg

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie49d5695ea78da2995252c56c75ce42e6cec0e9c
Gerrit-Change-Number: 12617
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 


Change in libosmocore[master]: LCLS: add status parameter to Assignment Completed message

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12483 )

Change subject: LCLS: add status parameter to Assignment Completed message
..


Patch Set 4:

(2 comments)

This change is ready for review.

https://gerrit.osmocom.org/#/c/12483/2/src/gsm/gsm0808.c
File src/gsm/gsm0808.c:

https://gerrit.osmocom.org/#/c/12483/2/src/gsm/gsm0808.c@522
PS2, Line 522: /*! Create BSSMAP Assignment Completed message as per 3GPP TS 
48.008 §3.2.1.2
> (end with dot)
Done


https://gerrit.osmocom.org/#/c/12483/2/src/gsm/gsm0808.c@537
PS2, Line 537: enum gsm0808_lcls_status 
lcls_bss_status)
> looks like wrong indent on gerrit
Looks fine in Emacs.



--
To view, visit https://gerrit.osmocom.org/12483
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: I547c6b8707123aa8c1ef636db88908df112d90a4
Gerrit-Change-Number: 12483
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 17 Jan 2019 15:58:22 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bsc[master]: LCLS: constify helper parameters

2019-01-17 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/12485

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

Change subject: LCLS: constify helper parameters
..

LCLS: constify helper parameters

Related: OS#2487
Change-Id: I341f4ea172432b94e8e96919926a5fb6870c2a30
---
M include/osmocom/bsc/osmo_bsc_lcls.h
M src/osmo-bsc/osmo_bsc_lcls.c
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/12485/2
--
To view, visit https://gerrit.osmocom.org/12485
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I341f4ea172432b94e8e96919926a5fb6870c2a30
Gerrit-Change-Number: 12485
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 


Change in meta-telephony[201705]: Update libosmocore to work with newer oc2g osmo-bts

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12616 )

Change subject: Update libosmocore to work with newer oc2g osmo-bts
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: meta-telephony
Gerrit-Branch: 201705
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib205bee48779754a809895a7e5024eba5948194d
Gerrit-Change-Number: 12616
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Thu, 17 Jan 2019 15:32:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-iuh[master]: ranap_msg_factory.h: fix enum def within function signature

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12591 )

Change subject: ranap_msg_factory.h: fix enum def within function signature
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifefaab32afa962dacdaa738a5419cce0a65a4b22
Gerrit-Change-Number: 12591
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Thu, 17 Jan 2019 15:30:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: fix lchan modifications: switch off re-using lchan during assignment

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12401 )

Change subject: fix lchan modifications: switch off re-using lchan during 
assignment
..


Patch Set 3: Code-Review-1

(2 comments)

It seems like this doesn't really fix an issue - it rather works around it by 
disabling some code.

https://gerrit.osmocom.org/#/c/12401/3/src/osmo-bsc/assignment_fsm.c
File src/osmo-bsc/assignment_fsm.c:

https://gerrit.osmocom.org/#/c/12401/3/src/osmo-bsc/assignment_fsm.c@345
PS3, Line 345:  ---
This looks like something which should belong to issue tracker. Put it into 
https://osmocom.org/issues/3735 instead?


https://gerrit.osmocom.org/#/c/12401/3/src/osmo-bsc/assignment_fsm.c@369
PS3, Line 369:  Test scenario:
This looks like it belong to TTCN3 instead. I think we should first make TTCN3 
test covering call-in-call scenario and than make any significant changes to 
this.



--
To view, visit https://gerrit.osmocom.org/12401
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: I0c00ec2c120e5008281755adcd4944a3ce4d8355
Gerrit-Change-Number: 12401
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 15:30:08 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in openbsc[master]: Cosmetic: Fix spelling in smpp vty

2019-01-17 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12603 )

Change subject: Cosmetic: Fix spelling in smpp vty
..

Cosmetic: Fix spelling in smpp vty

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

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



diff --git a/openbsc/src/libmsc/smpp_vty.c b/openbsc/src/libmsc/smpp_vty.c
index ff0314e..f1df652 100644
--- a/openbsc/src/libmsc/smpp_vty.c
+++ b/openbsc/src/libmsc/smpp_vty.c
@@ -164,7 +164,7 @@
 DEFUN(cfg_smpp_policy, cfg_smpp_policy_cmd,
"policy (accept-all|closed)",
"Set the authentication policy of this SMSC\n"
-   "Accept all SMPP connections independeint of system ID / passwd\n"
+   "Accept all SMPP connections independent of system ID / password\n"
"Accept only SMPP connections from ESMEs explicitly configured")
 {
struct smsc *smsc = smsc_from_vty(vty);
@@ -541,7 +541,7 @@

 DEFUN(show_esme, show_esme_cmd,
"show smpp esme",
-   SHOW_STR "SMPP Interface\n" "SMPP Extrenal SMS Entity\n")
+   SHOW_STR "SMPP Interface\n" "SMPP External SMS Entity\n")
 {
struct smsc *smsc = smsc_from_vty(vty);
struct osmo_esme *esme;

--
To view, visit https://gerrit.osmocom.org/12603
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: If2180828e2acd28d96754c593c317c2868644c4b
Gerrit-Change-Number: 12603
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-msc[master]: Handle LCLS-NOTIFICATION message from BSS

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12608 )

Change subject: Handle LCLS-NOTIFICATION message from BSS
..


Patch Set 4:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12608
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: Ibf5f9cad1f70aee56d5bca8fe09a24ca417e7a63
Gerrit-Change-Number: 12608
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 15:17:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in openbsc[master]: Make alert notifications vty configurable per ESME

2019-01-17 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12601 )

Change subject: Make alert notifications vty configurable per ESME
..

Make alert notifications vty configurable per ESME

OSMO-MSC backport

Adds (no) alert-notifications as a per-esme vty command,
in order to allow some ESMEs to be excluded from alerts.
The default is still to send alert notifications to all esme,
so no changes are required to the config file to maintain
identical operation after this patch.

Change-Id: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
---
M openbsc/src/libmsc/smpp_openbsc.c
M openbsc/src/libmsc/smpp_smsc.c
M openbsc/src/libmsc/smpp_smsc.h
M openbsc/src/libmsc/smpp_vty.c
4 files changed, 34 insertions(+), 2 deletions(-)

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



diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 3fe2dfd..f463e1c 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -278,8 +278,12 @@
llist_for_each_entry(esme, >esme_list, list) {
/* we currently send an alert notification to each ESME that is
 * connected, and do not require a (non-existant) delivery
-* pending flag to be set before,  FIXME: make this VTY
-* configurable */
+* pending flag to be set before. */
+   if (!esme->acl->alert_notifications) {
+   LOGP(DSMPP, LOGL_DEBUG,
+   "[%s] is not set to receive Alert Notifications\n", 
esme->system_id);
+   continue;
+   }
if (esme->acl && esme->acl->deliver_src_imsi) {
smpp_tx_alert(esme, TON_Subscriber_Number,
  NPI_Land_Mobile_E212,
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c
index e4acd3a..35097b4 100644
--- a/openbsc/src/libmsc/smpp_smsc.c
+++ b/openbsc/src/libmsc/smpp_smsc.c
@@ -148,6 +148,7 @@

acl->smsc = smsc;
strcpy(acl->system_id, sys_id);
+   acl->alert_notifications = 1;
INIT_LLIST_HEAD(>route_list);

llist_add_tail(>list, >acl_list);
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
index 257383f..2398201 100644
--- a/openbsc/src/libmsc/smpp_smsc.h
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -68,6 +68,7 @@
int deliver_src_imsi;
int osmocom_ext;
int dcs_transparent;
+   int alert_notifications;
struct llist_head route_list;
 };

diff --git a/openbsc/src/libmsc/smpp_vty.c b/openbsc/src/libmsc/smpp_vty.c
index 0a84358..ff0314e 100644
--- a/openbsc/src/libmsc/smpp_vty.c
+++ b/openbsc/src/libmsc/smpp_vty.c
@@ -499,6 +499,28 @@
return CMD_SUCCESS;
 }

+DEFUN(cfg_esme_alert_notif, cfg_esme_alert_notif_cmd,
+   "alert-notifications",
+   "Disable sending of SMPP Alert Notifications for this ESME")
+{
+   struct osmo_smpp_acl *acl = vty->index;
+
+   acl->alert_notifications = 1;
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_esme_no_alert_notif, cfg_esme_no_alert_notif_cmd,
+   "no alert-notifications", NO_STR
+   "Disable sending of SMPP Alert Notifications for this ESME")
+{
+   struct osmo_smpp_acl *acl = vty->index;
+
+   acl->alert_notifications = 0;
+
+   return CMD_SUCCESS;
+}
+

 static void dump_one_esme(struct vty *vty, struct osmo_esme *esme)
 {
@@ -560,6 +582,8 @@
vty_out(vty, "  osmocom-extensions%s", VTY_NEWLINE);
if (acl->dcs_transparent)
vty_out(vty, "  dcs-transparent%s", VTY_NEWLINE);
+   if (acl->alert_notifications)
+   vty_out(vty, "  alert-notifications%s", VTY_NEWLINE);

llist_for_each_entry(r, >route_list, list)
write_esme_route_single(vty, r);
@@ -603,6 +627,8 @@
install_element(SMPP_ESME_NODE, _esme_no_osmo_ext_cmd);
install_element(SMPP_ESME_NODE, _esme_dcs_transp_cmd);
install_element(SMPP_ESME_NODE, _esme_no_dcs_transp_cmd);
+   install_element(SMPP_ESME_NODE, _esme_alert_notif_cmd);
+   install_element(SMPP_ESME_NODE, _esme_no_alert_notif_cmd);

install_element_ve(_esme_cmd);


--
To view, visit https://gerrit.osmocom.org/12601
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: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
Gerrit-Change-Number: 12601
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 


Change in osmo-msc[master]: Cosmetic: Fix spelling in smpp vty

2019-01-17 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12600 )

Change subject: Cosmetic: Fix spelling in smpp vty
..

Cosmetic: Fix spelling in smpp vty

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

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



diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c
index 5896707..4c179d4 100644
--- a/src/libmsc/smpp_vty.c
+++ b/src/libmsc/smpp_vty.c
@@ -164,7 +164,7 @@
 DEFUN(cfg_smpp_policy, cfg_smpp_policy_cmd,
"policy (accept-all|closed)",
"Set the authentication policy of this SMSC\n"
-   "Accept all SMPP connections independeint of system ID / passwd\n"
+   "Accept all SMPP connections independent of system ID / password\n"
"Accept only SMPP connections from ESMEs explicitly configured")
 {
struct smsc *smsc = smsc_from_vty(vty);
@@ -541,7 +541,7 @@

 DEFUN(show_esme, show_esme_cmd,
"show smpp esme",
-   SHOW_STR "SMPP Interface\n" "SMPP Extrenal SMS Entity\n")
+   SHOW_STR "SMPP Interface\n" "SMPP External SMS Entity\n")
 {
struct smsc *smsc = smsc_from_vty(vty);
struct osmo_esme *esme;

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id3fa3f26c333bf445590fd75ad7a08be68fed3e2
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 3
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 


Change in osmo-msc[master]: VLR: use msgb_eq_data_print() for comparison

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12571 )

Change subject: VLR: use msgb_eq_data_print() for comparison
..


Patch Set 2:

(2 comments)

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

https://gerrit.osmocom.org/#/c/12571/1//COMMIT_MSG@9
PS1, Line 9: This simplifies tests refactoring by showing exact byte where 
mismatch
> that's technically not allowed

Ok, a little clarification: it is technically allowed. We probably shouldn't do 
multiline logging in regular programs/libraries for aesthetic reasons but it's 
perfectly fine in unit-tests - there're no technical reasons to avoid it. 
Especially in this case where log output will be seen only if test fails.


https://gerrit.osmocom.org/#/c/12571/1//COMMIT_MSG@10
PS1, Line 10: happened. It also makes code more readable.
> That's a personal preference at best.

Yes? You can see the person's name in "Author" header of the commit log. Having 
said that, do you really find multi-line if() clause more readable?



--
To view, visit https://gerrit.osmocom.org/12571
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: If9771c973f2bc55580f4c146bdbeeb1609d56786
Gerrit-Change-Number: 12571
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 17 Jan 2019 14:48:04 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: VLR: use msgb_eq_data_print() for comparison

2019-01-17 Thread Max
Hello Stefan Sperling, Neels Hofmeyr, osmith, Jenkins Builder,

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

https://gerrit.osmocom.org/12571

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

Change subject: VLR: use msgb_eq_data_print() for comparison
..

VLR: use msgb_eq_data_print() for comparison

This simplifies tests refactoring by showing exact byte where mismatch
happened. It also makes code more readable.

Change-Id: If9771c973f2bc55580f4c146bdbeeb1609d56786
---
M tests/msc_vlr/msc_vlr_tests.c
1 file changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/71/12571/2
--
To view, visit https://gerrit.osmocom.org/12571
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If9771c973f2bc55580f4c146bdbeeb1609d56786
Gerrit-Change-Number: 12571
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: osmith 


Change in osmo-msc[master]: Log transaction allocation errors as such

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12615 )

Change subject: Log transaction allocation errors as such
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/12615/1/src/libmsc/transaction.c
File src/libmsc/transaction.c:

https://gerrit.osmocom.org/#/c/12615/1/src/libmsc/transaction.c@112
PS1, Line 112: DVLR
> Why changing this?

Because absence of VLR subscriber is error.

> And why DVLR?

Because absence of VLR subscriber is error related to VLR, not Call Control.

> Rather do this in a separate change

I'd rather not: it's completely pointless to split every single line into 
separate commit. Especially when the changes are directly related as is in this 
case.



--
To view, visit https://gerrit.osmocom.org/12615
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: I617be8793b9416ccd49022c72f7d93df7f4fb4d9
Gerrit-Change-Number: 12615
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 17 Jan 2019 14:36:40 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Jenkins build is back to normal : master-osmo-trx » --with-sse,1,a3=default,a4=default,osmocom-master-debian9 #818

2019-01-17 Thread jenkins
See 




Change in osmo-msc[master]: Make alert notifications vty configurable per ESME

2019-01-17 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12597 )

Change subject: Make alert notifications vty configurable per ESME
..

Make alert notifications vty configurable per ESME

Adds (no) alert-notifications as a per-esme vty command,
in order to allow some ESMEs to be excluded from alerts.

The default is still to send alert notifications to all esme,
so no changes are required to the config file to maintain
identical operation after this patch.

Change-Id: I57f4d268ca6fe6a233f2caaffce62e4aade01274
---
M src/libmsc/smpp_openbsc.c
M src/libmsc/smpp_smsc.c
M src/libmsc/smpp_smsc.h
M src/libmsc/smpp_vty.c
4 files changed, 35 insertions(+), 2 deletions(-)

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



diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c
index 10f3cfa..fb9b0f8 100644
--- a/src/libmsc/smpp_openbsc.c
+++ b/src/libmsc/smpp_openbsc.c
@@ -283,8 +283,13 @@
llist_for_each_entry(esme, >esme_list, list) {
/* we currently send an alert notification to each ESME that is
 * connected, and do not require a (non-existant) delivery
-* pending flag to be set before,  FIXME: make this VTY
-* configurable */
+* pending flag to be set before. */
+   if (!esme->acl->alert_notifications) {
+   LOGP(DSMPP, LOGL_DEBUG,
+   "[%s] is not set to receive Alert 
Notifications\n",
+   esme->system_id);
+   continue;
+   }
if (esme->acl && esme->acl->deliver_src_imsi) {
smpp_tx_alert(esme, TON_Subscriber_Number,
  NPI_Land_Mobile_E212,
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index ea5303c..2350d84 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -148,6 +148,7 @@

acl->smsc = smsc;
strcpy(acl->system_id, sys_id);
+   acl->alert_notifications = 1;
INIT_LLIST_HEAD(>route_list);

llist_add_tail(>list, >acl_list);
diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h
index 27a2646..dc7b7c1 100644
--- a/src/libmsc/smpp_smsc.h
+++ b/src/libmsc/smpp_smsc.h
@@ -68,6 +68,7 @@
int deliver_src_imsi;
int osmocom_ext;
int dcs_transparent;
+   int alert_notifications;
struct llist_head route_list;
 };

diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c
index be55c4d..5896707 100644
--- a/src/libmsc/smpp_vty.c
+++ b/src/libmsc/smpp_vty.c
@@ -499,6 +499,28 @@
return CMD_SUCCESS;
 }

+DEFUN(cfg_esme_alert_notif, cfg_esme_alert_notif_cmd,
+   "alert-notifications",
+   "Disable sending of SMPP Alert Notifications for this ESME")
+{
+   struct osmo_smpp_acl *acl = vty->index;
+
+   acl->alert_notifications = 1;
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_esme_no_alert_notif, cfg_esme_no_alert_notif_cmd,
+   "no alert-notifications", NO_STR
+   "Disable sending of SMPP Alert Notifications for this ESME")
+{
+   struct osmo_smpp_acl *acl = vty->index;
+
+   acl->alert_notifications = 0;
+
+   return CMD_SUCCESS;
+}
+

 static void dump_one_esme(struct vty *vty, struct osmo_esme *esme)
 {
@@ -560,6 +582,8 @@
vty_out(vty, "  osmocom-extensions%s", VTY_NEWLINE);
if (acl->dcs_transparent)
vty_out(vty, "  dcs-transparent%s", VTY_NEWLINE);
+   if (acl->alert_notifications)
+   vty_out(vty, "  alert-notifications%s", VTY_NEWLINE);

llist_for_each_entry(r, >route_list, list)
write_esme_route_single(vty, r);
@@ -603,6 +627,8 @@
install_element(SMPP_ESME_NODE, _esme_no_osmo_ext_cmd);
install_element(SMPP_ESME_NODE, _esme_dcs_transp_cmd);
install_element(SMPP_ESME_NODE, _esme_no_dcs_transp_cmd);
+   install_element(SMPP_ESME_NODE, _esme_alert_notif_cmd);
+   install_element(SMPP_ESME_NODE, _esme_no_alert_notif_cmd);

install_element_ve(_esme_cmd);


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I57f4d268ca6fe6a233f2caaffce62e4aade01274
Gerrit-Change-Number: 12597
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 


Change in osmo-msc[master]: Don't send Alert Notifications to ESME not bound for RX

2019-01-17 Thread Keith Whyte
Keith Whyte has posted comments on this change. ( 
https://gerrit.osmocom.org/12599 )

Change subject: Don't send Alert Notifications to ESME not bound for RX
..


Patch Set 2:

> Why is that?

In short, I guess I was thinking to work around what looks like a big failure 
in the python-smpplib; in that it is expecting the response to the _last_ 
message _it_ sent in the _next_ received PDU, whereas, with many LURs/sec going 
on, it often gets an alert_notification. :(

This can even happen on the bind_transmitter command

So I figured, bind it as a transmitter and we won't get "unsolicited" PDUs

But you are right, I misinterpreted the spec:

"An ESME indicates its desire not to receive (mobile) originated messages from 
other SME’s
(e.g. mobile stations) by binding as a Transmitter."

it says MO messages, says nothing about alert notifications.

Hmm.. I know we really don't want to work around other software's bugs, but 
given the lack of SMPP libraries out there, I wonder if this could become an 
obscure smpp config option useful to anybody.

"no tx-to-transmitter" or some such.

I'm guessing we /really/ don't want to go down that road. :)

So.. the other patch that allows to exclude an ESME will help in binding an 
ESME in tranceiver mode for SMS but I guess python-smpplib HAS to be fixed, 
otherwise you cannot ever get away from this transaction possibility:

ESME -> bind_transmitter - > SMSC
SMSC -> alert_notification - > ESME
ESME "huh I was expecting bind_transmitter_resp?"


--
To view, visit https://gerrit.osmocom.org/12599
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: Iec92d4c145ca050c2e212139572eeaae581b99df
Gerrit-Change-Number: 12599
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 13:59:05 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: Handle LCLS-NOTIFICATION message from BSS

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12608 )

Change subject: Handle LCLS-NOTIFICATION message from BSS
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12608/2/src/libmsc/a_iface_bssap.c
File src/libmsc/a_iface_bssap.c:

https://gerrit.osmocom.org/#/c/12608/2/src/libmsc/a_iface_bssap.c@593
PS2, Line 593: Ignoring
Ignoring, but not doing return? Is it intended?



--
To view, visit https://gerrit.osmocom.org/12608
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: Ibf5f9cad1f70aee56d5bca8fe09a24ca417e7a63
Gerrit-Change-Number: 12608
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 13:03:46 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: Handle LCLS-NOTIFICATION message from BSS

2019-01-17 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12608 )

Change subject: Handle LCLS-NOTIFICATION message from BSS
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/12608
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: Ibf5f9cad1f70aee56d5bca8fe09a24ca417e7a63
Gerrit-Change-Number: 12608
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Thu, 17 Jan 2019 13:01:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: trxcon/l1ctl.c: fix memleak triggered by unsupported messages

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12604 )

Change subject: trxcon/l1ctl.c: fix memleak triggered by unsupported messages
..

trxcon/l1ctl.c: fix memleak triggered by unsupported messages

Change-Id: I6e636afec8e45d7dc786f5f159cd5d7784d9a83b
---
M src/host/trxcon/l1ctl.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 0b6d75a..2f1d720 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -871,6 +871,7 @@
case L1CTL_SIM_REQ:
LOGP(DL1C, LOGL_NOTICE, "Ignoring unsupported message "
"(type=%u)\n", l1h->msg_type);
+   msgb_free(msg);
return -ENOTSUP;
default:
LOGP(DL1C, LOGL_ERROR, "Unknown MSG type %u: %s\n", 
l1h->msg_type,

--
To view, visit https://gerrit.osmocom.org/12604
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: I6e636afec8e45d7dc786f5f159cd5d7784d9a83b
Gerrit-Change-Number: 12604
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in meta-telephony[201705]: Update libosmocore to work with newer oc2g osmo-bts

2019-01-17 Thread daniel
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/12616


Change subject: Update libosmocore to work with newer oc2g osmo-bts
..

Update libosmocore to work with newer oc2g osmo-bts

The version of osmo-bts that has oc2g support needs a newer libosmocore,
otherwise it fails trying to use OSMO_SOCK_F_UDP_REUSEADDR.

Change-Id: Ib205bee48779754a809895a7e5024eba5948194d
Related: SYS#
---
M recipes-osmocom/libosmocore/libosmocore_git.bb
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/16/12616/1

diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb 
b/recipes-osmocom/libosmocore/libosmocore_git.bb
index 09ac239..6d00c0d 100644
--- a/recipes-osmocom/libosmocore/libosmocore_git.bb
+++ b/recipes-osmocom/libosmocore/libosmocore_git.bb
@@ -1,7 +1,7 @@
 require ${PN}.inc

 S = "${WORKDIR}/git"
-SRCREV = "f36e0abb9796530a80937057eed2985f652d37f2"
+SRCREV = "b8a91625dd974f596214646da345d9d649f4dae3"
 SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1"
 PV = "0.12.1+gitr${SRCPV}"
 PR = "r0"

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

Gerrit-Project: meta-telephony
Gerrit-Branch: 201705
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib205bee48779754a809895a7e5024eba5948194d
Gerrit-Change-Number: 12616
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 


Change in osmocom-bb[master]: trxcon/l1ctl_link.c: refactor l1ctl_link_init()

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12583 )

Change subject: trxcon/l1ctl_link.c: refactor l1ctl_link_init()
..

trxcon/l1ctl_link.c: refactor l1ctl_link_init()

The main changes are:

  - return pointer to the allocated l1ctl_link or NULL,
  - accept the talloc context as 'tall_ctx' argument.

Change-Id: I7fe1bc306494ac692c182dcfd2a2d9412929194b
---
M src/host/trxcon/l1ctl_link.c
M src/host/trxcon/l1ctl_link.h
M src/host/trxcon/trxcon.c
3 files changed, 20 insertions(+), 22 deletions(-)

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



diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 1350c3c..b7ea262 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -229,59 +229,57 @@
return 0;
 }

-int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path)
+struct l1ctl_link *l1ctl_link_init(void *tall_ctx, const char *sock_path)
 {
-   struct l1ctl_link *l1l_new;
+   struct l1ctl_link *l1l;
struct osmo_fd *bfd;
int rc;

LOGP(DL1C, LOGL_NOTICE, "Init L1CTL link (%s)\n", sock_path);

-   l1l_new = talloc_zero(tall_trx_ctx, struct l1ctl_link);
-   if (!l1l_new) {
+   l1l = talloc_zero(tall_ctx, struct l1ctl_link);
+   if (!l1l) {
LOGP(DL1C, LOGL_ERROR, "Failed to allocate memory\n");
-   return -ENOMEM;
+   return NULL;
}

/* Allocate a new dedicated state machine */
-   l1l_new->fsm = osmo_fsm_inst_alloc(_fsm, l1l_new,
+   l1l->fsm = osmo_fsm_inst_alloc(_fsm, l1l,
NULL, LOGL_DEBUG, "l1ctl_link");
-   if (l1l_new->fsm == NULL) {
+   if (l1l->fsm == NULL) {
LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
"of FSM '%s'\n", l1ctl_fsm.name);
-   talloc_free(l1l_new);
-   return -ENOMEM;
+   talloc_free(l1l);
+   return NULL;
}

/* Create a socket and bind handlers */
-   bfd = _new->listen_bfd;
+   bfd = >listen_bfd;
rc = osmo_sock_unix_init_ofd(bfd, SOCK_STREAM, 0, sock_path,
OSMO_SOCK_F_BIND);
if (rc < 0) {
LOGP(DL1C, LOGL_ERROR, "Could not create UNIX socket: %s\n",
strerror(errno));
-   osmo_fsm_inst_free(l1l_new->fsm);
-   talloc_free(l1l_new);
-   return rc;
+   osmo_fsm_inst_free(l1l->fsm);
+   talloc_free(l1l);
+   return NULL;
}

/* Bind shutdown handler */
-   l1l_new->shutdown_cb = l1ctl_shutdown_cb;
+   l1l->shutdown_cb = l1ctl_shutdown_cb;

/* Bind connection handler */
bfd->cb = l1ctl_link_accept;
bfd->when = BSC_FD_READ;
-   bfd->data = l1l_new;
+   bfd->data = l1l;

/**
 * To be able to accept first connection and
 * drop others, it should be set to -1
 */
-   l1l_new->wq.bfd.fd = -1;
+   l1l->wq.bfd.fd = -1;

-   *l1l = l1l_new;
-
-   return 0;
+   return l1l;
 }

 void l1ctl_link_shutdown(struct l1ctl_link *l1l)
diff --git a/src/host/trxcon/l1ctl_link.h b/src/host/trxcon/l1ctl_link.h
index 01103dc..da64419 100644
--- a/src/host/trxcon/l1ctl_link.h
+++ b/src/host/trxcon/l1ctl_link.h
@@ -41,7 +41,7 @@
void (*shutdown_cb)(struct l1ctl_link *l1l);
 };

-int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path);
+struct l1ctl_link *l1ctl_link_init(void *tall_ctx, const char *sock_path);
 void l1ctl_link_shutdown(struct l1ctl_link *l1l);

 int l1ctl_link_send(struct l1ctl_link *l1l, struct msgb *msg);
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 501d0c7..777138f 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -279,8 +279,8 @@
NULL, LOGL_DEBUG, "main");

/* Init L1CTL server */
-   rc = l1ctl_link_init(_data.l1l, app_data.bind_socket);
-   if (rc)
+   app_data.l1l = l1ctl_link_init(tall_trx_ctx, app_data.bind_socket);
+   if (app_data.l1l == NULL)
goto exit;

/* Init transceiver interface */

--
To view, visit https://gerrit.osmocom.org/12583
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: I7fe1bc306494ac692c182dcfd2a2d9412929194b
Gerrit-Change-Number: 12583
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/trx_if: refactor trx_if_open()

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12582 )

Change subject: trxcon/trx_if: refactor trx_if_open()
..

trxcon/trx_if: refactor trx_if_open()

The main changes are:

  - return pointer to the allocated trx_instance or NULL,
  - extend debug message with TRX address and base port,
  - accept the talloc context as 'tall_ctx' argument,
  - rename goto label 'error' to 'udp_error',
  - rename argument 'port' to 'base_port'.

Change-Id: I39b24afee2f09d6a6c500cfc26ac45f206589c5c
---
M src/host/trxcon/trx_if.c
M src/host/trxcon/trx_if.h
M src/host/trxcon/trxcon.c
3 files changed, 32 insertions(+), 34 deletions(-)

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



diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index bff73cc..4c10da6 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -626,58 +626,55 @@
return 0;
 }

-/*
- * Open/close OsmoTRX connection
- */
-
-int trx_if_open(struct trx_instance **trx, const char *local_host,
-   const char *remote_host, uint16_t port)
+/* Init TRX interface (TRXC, TRXD sockets and FSM) */
+struct trx_instance *trx_if_open(void *tall_ctx,
+   const char *local_host, const char *remote_host,
+   uint16_t base_port)
 {
-   struct trx_instance *trx_new;
+   struct trx_instance *trx;
int rc;

-   LOGP(DTRX, LOGL_NOTICE, "Init transceiver interface\n");
+   LOGP(DTRX, LOGL_NOTICE, "Init transceiver interface "
+   "(%s:%u)\n", remote_host, base_port);

/* Try to allocate memory */
-   trx_new = talloc_zero(tall_trx_ctx, struct trx_instance);
-   if (!trx_new) {
+   trx = talloc_zero(tall_ctx, struct trx_instance);
+   if (!trx) {
LOGP(DTRX, LOGL_ERROR, "Failed to allocate memory\n");
-   return -ENOMEM;
+   return NULL;
}

/* Allocate a new dedicated state machine */
-   trx_new->fsm = osmo_fsm_inst_alloc(_fsm, trx_new,
+   trx->fsm = osmo_fsm_inst_alloc(_fsm, trx,
NULL, LOGL_DEBUG, "trx_interface");
-   if (trx_new->fsm == NULL) {
+   if (trx->fsm == NULL) {
LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
"of FSM '%s'\n", trx_fsm.name);
-   talloc_free(trx_new);
-   return -ENOMEM;
+   talloc_free(trx);
+   return NULL;
}

/* Initialize CTRL queue */
-   INIT_LLIST_HEAD(_new->trx_ctrl_list);
+   INIT_LLIST_HEAD(>trx_ctrl_list);

/* Open sockets */
-   rc = trx_udp_open(trx_new, _new->trx_ofd_ctrl, local_host,
-   port + 101, remote_host, port + 1, trx_ctrl_read_cb);
+   rc = trx_udp_open(trx, >trx_ofd_ctrl, local_host,
+   base_port + 101, remote_host, base_port + 1, trx_ctrl_read_cb);
if (rc < 0)
-   goto error;
+   goto udp_error;

-   rc = trx_udp_open(trx_new, _new->trx_ofd_data, local_host,
-   port + 102, remote_host, port + 2, trx_data_rx_cb);
+   rc = trx_udp_open(trx, >trx_ofd_data, local_host,
+   base_port + 102, remote_host, base_port + 2, trx_data_rx_cb);
if (rc < 0)
-   goto error;
+   goto udp_error;

-   *trx = trx_new;
+   return trx;

-   return 0;
-
-error:
+udp_error:
LOGP(DTRX, LOGL_ERROR, "Couldn't establish UDP connection\n");
-   osmo_fsm_inst_free(trx_new->fsm);
-   talloc_free(trx_new);
-   return rc;
+   osmo_fsm_inst_free(trx->fsm);
+   talloc_free(trx);
+   return NULL;
 }

 /* Flush pending control messages */
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index d551252..0b3f36f 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -52,8 +52,8 @@
int cmd_len;
 };

-int trx_if_open(struct trx_instance **trx, const char *local_host,
-   const char *remote_host, uint16_t port);
+struct trx_instance *trx_if_open(void *tall_ctx,
+   const char *local_host, const char *remote_host, uint16_t port);
 void trx_if_flush_ctrl(struct trx_instance *trx);
 void trx_if_close(struct trx_instance *trx);

diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 874f893..501d0c7 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -284,9 +284,10 @@
goto exit;

/* Init transceiver interface */
-   rc = trx_if_open(_data.trx,
-   app_data.trx_bind_ip, app_data.trx_remote_ip, 
app_data.trx_base_port);
-   if (rc)
+   app_data.trx = trx_if_open(tall_trx_ctx,
+   app_data.trx_bind_ip, app_data.trx_remote_ip,
+   app_data.trx_base_port);
+   if (!app_data.trx)
goto exit;

/* Bind L1CTL with TRX and vice versa */

--
To view, 

Change in osmocom-bb[master]: trxcon: register both l1ctl_fsm and trx_fsm on DSO load

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12586 )

Change subject: trxcon: register both l1ctl_fsm and trx_fsm on DSO load
..

trxcon: register both l1ctl_fsm and trx_fsm on DSO load

Change-Id: I7111e368afa47c88ff3c610bae9044f2d5baf037
---
M src/host/trxcon/l1ctl_link.c
M src/host/trxcon/trx_if.c
2 files changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 20cb70c..23019fd 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -269,7 +269,6 @@
l1l_new->wq.bfd.fd = -1;

/* Allocate a new dedicated state machine */
-   osmo_fsm_register(_fsm);
l1l_new->fsm = osmo_fsm_inst_alloc(_fsm, l1l_new,
NULL, LOGL_DEBUG, "l1ctl_link");

@@ -308,3 +307,8 @@
osmo_fsm_inst_free(l1l->fsm);
talloc_free(l1l);
 }
+
+static __attribute__((constructor)) void on_dso_load(void)
+{
+   OSMO_ASSERT(osmo_fsm_register(_fsm) == 0);
+}
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 982fb40..91b87a2 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -660,7 +660,6 @@
goto error;

/* Allocate a new dedicated state machine */
-   osmo_fsm_register(_fsm);
trx_new->fsm = osmo_fsm_inst_alloc(_fsm, trx_new,
NULL, LOGL_DEBUG, "trx_interface");

@@ -710,3 +709,8 @@
osmo_fsm_inst_free(trx->fsm);
talloc_free(trx);
 }
+
+static __attribute__((constructor)) void on_dso_load(void)
+{
+   OSMO_ASSERT(osmo_fsm_register(_fsm) == 0);
+}

--
To view, visit https://gerrit.osmocom.org/12586
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: I7111e368afa47c88ff3c610bae9044f2d5baf037
Gerrit-Change-Number: 12586
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon: do not include trxcon.h everywhere

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12581 )

Change subject: trxcon: do not include trxcon.h everywhere
..

trxcon: do not include trxcon.h everywhere

Change-Id: Ia78bd6dac7ab12970838e0b1a2929a106b898d9d
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/sched_clck.c
M src/host/trxcon/sched_lchan_common.c
M src/host/trxcon/sched_lchan_pdtch.c
M src/host/trxcon/sched_lchan_rach.c
M src/host/trxcon/sched_lchan_sch.c
M src/host/trxcon/sched_lchan_tchf.c
M src/host/trxcon/sched_lchan_tchh.c
M src/host/trxcon/sched_lchan_xcch.c
9 files changed, 0 insertions(+), 9 deletions(-)

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



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index a2ced46..0b6d75a 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -38,7 +38,6 @@
 #include 
 #include 

-#include "trxcon.h"
 #include "logging.h"
 #include "l1ctl_link.h"
 #include "l1ctl_proto.h"
diff --git a/src/host/trxcon/sched_clck.c b/src/host/trxcon/sched_clck.c
index d4054c9..66477b2 100644
--- a/src/host/trxcon/sched_clck.c
+++ b/src/host/trxcon/sched_clck.c
@@ -41,7 +41,6 @@
 #include "scheduler.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"

 #define MAX_FN_SKEW50
 #define TRX_LOSS_FRAMES400
diff --git a/src/host/trxcon/sched_lchan_common.c 
b/src/host/trxcon/sched_lchan_common.c
index 540a57f..921c466 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -42,7 +42,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"
 
 /* GSM 05.02 Chapter 5.2.3 Normal Burst (NB) */
diff --git a/src/host/trxcon/sched_lchan_pdtch.c 
b/src/host/trxcon/sched_lchan_pdtch.c
index 1a8987b..aa9cb6a 100644
--- a/src/host/trxcon/sched_lchan_pdtch.c
+++ b/src/host/trxcon/sched_lchan_pdtch.c
@@ -38,7 +38,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 int rx_pdtch_fn(struct trx_instance *trx, struct trx_ts *ts,
diff --git a/src/host/trxcon/sched_lchan_rach.c 
b/src/host/trxcon/sched_lchan_rach.c
index a255efb..ecf5df8 100644
--- a/src/host/trxcon/sched_lchan_rach.c
+++ b/src/host/trxcon/sched_lchan_rach.c
@@ -38,7 +38,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 /**
diff --git a/src/host/trxcon/sched_lchan_sch.c 
b/src/host/trxcon/sched_lchan_sch.c
index 1b241a0..e1977e1 100644
--- a/src/host/trxcon/sched_lchan_sch.c
+++ b/src/host/trxcon/sched_lchan_sch.c
@@ -40,7 +40,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 static void decode_sb(struct gsm_time *time, uint8_t *bsic, uint8_t *sb_info)
diff --git a/src/host/trxcon/sched_lchan_tchf.c 
b/src/host/trxcon/sched_lchan_tchf.c
index 09d504f..5bebe49 100644
--- a/src/host/trxcon/sched_lchan_tchf.c
+++ b/src/host/trxcon/sched_lchan_tchf.c
@@ -40,7 +40,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts,
diff --git a/src/host/trxcon/sched_lchan_tchh.c 
b/src/host/trxcon/sched_lchan_tchh.c
index 7fb2809..5b7daa3 100644
--- a/src/host/trxcon/sched_lchan_tchh.c
+++ b/src/host/trxcon/sched_lchan_tchh.c
@@ -43,7 +43,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 static const uint8_t tch_h0_traffic_block_map[3][4] = {
diff --git a/src/host/trxcon/sched_lchan_xcch.c 
b/src/host/trxcon/sched_lchan_xcch.c
index b31f727..825fc58 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -38,7 +38,6 @@
 #include "sched_trx.h"
 #include "logging.h"
 #include "trx_if.h"
-#include "trxcon.h"
 #include "l1ctl.h"

 int rx_data_fn(struct trx_instance *trx, struct trx_ts *ts,

--
To view, visit https://gerrit.osmocom.org/12581
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: Ia78bd6dac7ab12970838e0b1a2929a106b898d9d
Gerrit-Change-Number: 12581
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/trxcon.c: do not expose tall_trx_ctx

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12584 )

Change subject: trxcon/trxcon.c: do not expose tall_trx_ctx
..

trxcon/trxcon.c: do not expose tall_trx_ctx

Both l1ctl_link_init() and trx_if_open() do accept 'tall_ctx' now,
so there is no need to expose the root context anymore. For
logging initialization, we can just pass a pointer.

Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
---
M src/host/trxcon/logging.c
M src/host/trxcon/logging.h
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
4 files changed, 14 insertions(+), 15 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, approved



diff --git a/src/host/trxcon/logging.c b/src/host/trxcon/logging.c
index 6a3043b..78915f2 100644
--- a/src/host/trxcon/logging.c
+++ b/src/host/trxcon/logging.c
@@ -26,7 +26,6 @@
 #include 

 #include "logging.h"
-#include "trxcon.h"

 static struct log_info_cat trx_log_info_cat[] = {
[DAPP] = {
@@ -78,9 +77,9 @@
.num_cat = ARRAY_SIZE(trx_log_info_cat),
 };

-int trx_log_init(const char *category_mask)
+int trx_log_init(void *tall_ctx, const char *category_mask)
 {
-   osmo_init_logging2(tall_trx_ctx, _log_info);
+   osmo_init_logging2(tall_ctx, _log_info);

if (category_mask)
log_parse_category_mask(osmo_stderr_target, category_mask);
diff --git a/src/host/trxcon/logging.h b/src/host/trxcon/logging.h
index 0206362..152c346 100644
--- a/src/host/trxcon/logging.h
+++ b/src/host/trxcon/logging.h
@@ -14,4 +14,4 @@
DSCHD,
 };

-int trx_log_init(const char *category_mask);
+int trx_log_init(void *tall_ctx, const char *category_mask);
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 777138f..8e371df 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -74,7 +74,7 @@
uint32_t trx_fn_advance;
 } app_data;

-void *tall_trx_ctx = NULL;
+static void *tall_trxcon_ctx = NULL;
 struct osmo_fsm_inst *trxcon_fsm;

 static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
@@ -242,7 +242,7 @@
case SIGABRT:
case SIGUSR1:
case SIGUSR2:
-   talloc_report_full(tall_trx_ctx, stderr);
+   talloc_report_full(tall_trxcon_ctx, stderr);
break;
default:
break;
@@ -261,8 +261,8 @@
talloc_enable_null_tracking();

/* Init talloc memory management system */
-   tall_trx_ctx = talloc_init("trxcon context");
-   msgb_talloc_ctx_init(tall_trx_ctx, 0);
+   tall_trxcon_ctx = talloc_init("trxcon context");
+   msgb_talloc_ctx_init(tall_trxcon_ctx, 0);

/* Setup signal handlers */
signal(SIGINT, _handler);
@@ -271,20 +271,21 @@
osmo_init_ignore_signals();

/* Init logging system */
-   trx_log_init(app_data.debug_mask);
+   trx_log_init(tall_trxcon_ctx, app_data.debug_mask);

/* Allocate the application state machine */
osmo_fsm_register(_fsm_def);
-   trxcon_fsm = osmo_fsm_inst_alloc(_fsm_def, tall_trx_ctx,
+   trxcon_fsm = osmo_fsm_inst_alloc(_fsm_def, tall_trxcon_ctx,
NULL, LOGL_DEBUG, "main");

/* Init L1CTL server */
-   app_data.l1l = l1ctl_link_init(tall_trx_ctx, app_data.bind_socket);
+   app_data.l1l = l1ctl_link_init(tall_trxcon_ctx,
+   app_data.bind_socket);
if (app_data.l1l == NULL)
goto exit;

/* Init transceiver interface */
-   app_data.trx = trx_if_open(tall_trx_ctx,
+   app_data.trx = trx_if_open(tall_trxcon_ctx,
app_data.trx_bind_ip, app_data.trx_remote_ip,
app_data.trx_base_port);
if (!app_data.trx)
@@ -331,8 +332,8 @@
 * Print report for the root talloc context in order
 * to be able to find and fix potential memory leaks.
 */
-   talloc_report_full(tall_trx_ctx, stderr);
-   talloc_free(tall_trx_ctx);
+   talloc_report_full(tall_trxcon_ctx, stderr);
+   talloc_free(tall_trxcon_ctx);

/* Make both Valgrind and ASAN happy */
talloc_report_full(NULL, stderr);
diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h
index 65b5e85..f66a628 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -3,7 +3,6 @@
 #define GEN_MASK(state) (0x01 << state)

 extern struct osmo_fsm_inst *trxcon_fsm;
-extern void *tall_trx_ctx;

 enum trxcon_fsm_states {
TRXCON_STATE_IDLE = 0,

--
To view, visit https://gerrit.osmocom.org/12584
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: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim 

Change in osmocom-bb[master]: trxcon/trx_if.c: check if trx_fsm allocation failed

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12588 )

Change subject: trxcon/trx_if.c: check if trx_fsm allocation failed
..

trxcon/trx_if.c: check if trx_fsm allocation failed

Change-Id: I31c9f2a651182b258d0a4d4504365b778529715a
---
M src/host/trxcon/trx_if.c
1 file changed, 11 insertions(+), 4 deletions(-)

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



diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index 91b87a2..bff73cc 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -645,6 +645,16 @@
return -ENOMEM;
}

+   /* Allocate a new dedicated state machine */
+   trx_new->fsm = osmo_fsm_inst_alloc(_fsm, trx_new,
+   NULL, LOGL_DEBUG, "trx_interface");
+   if (trx_new->fsm == NULL) {
+   LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
+   "of FSM '%s'\n", trx_fsm.name);
+   talloc_free(trx_new);
+   return -ENOMEM;
+   }
+
/* Initialize CTRL queue */
INIT_LLIST_HEAD(_new->trx_ctrl_list);

@@ -659,16 +669,13 @@
if (rc < 0)
goto error;

-   /* Allocate a new dedicated state machine */
-   trx_new->fsm = osmo_fsm_inst_alloc(_fsm, trx_new,
-   NULL, LOGL_DEBUG, "trx_interface");
-
*trx = trx_new;

return 0;

 error:
LOGP(DTRX, LOGL_ERROR, "Couldn't establish UDP connection\n");
+   osmo_fsm_inst_free(trx_new->fsm);
talloc_free(trx_new);
return rc;
 }

--
To view, visit https://gerrit.osmocom.org/12588
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: I31c9f2a651182b258d0a4d4504365b778529715a
Gerrit-Change-Number: 12588
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/l1ctl_link.c: check if l1ctl_fsm allocation failed

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12587 )

Change subject: trxcon/l1ctl_link.c: check if l1ctl_fsm allocation failed
..

trxcon/l1ctl_link.c: check if l1ctl_fsm allocation failed

Change-Id: Ibd9404a888f02798224238a7b9ff4ebf09f03850
---
M src/host/trxcon/l1ctl_link.c
1 file changed, 11 insertions(+), 4 deletions(-)

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



diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 23019fd..1350c3c 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -243,6 +243,16 @@
return -ENOMEM;
}

+   /* Allocate a new dedicated state machine */
+   l1l_new->fsm = osmo_fsm_inst_alloc(_fsm, l1l_new,
+   NULL, LOGL_DEBUG, "l1ctl_link");
+   if (l1l_new->fsm == NULL) {
+   LOGP(DTRX, LOGL_ERROR, "Failed to allocate an instance "
+   "of FSM '%s'\n", l1ctl_fsm.name);
+   talloc_free(l1l_new);
+   return -ENOMEM;
+   }
+
/* Create a socket and bind handlers */
bfd = _new->listen_bfd;
rc = osmo_sock_unix_init_ofd(bfd, SOCK_STREAM, 0, sock_path,
@@ -250,6 +260,7 @@
if (rc < 0) {
LOGP(DL1C, LOGL_ERROR, "Could not create UNIX socket: %s\n",
strerror(errno));
+   osmo_fsm_inst_free(l1l_new->fsm);
talloc_free(l1l_new);
return rc;
}
@@ -268,10 +279,6 @@
 */
l1l_new->wq.bfd.fd = -1;

-   /* Allocate a new dedicated state machine */
-   l1l_new->fsm = osmo_fsm_inst_alloc(_fsm, l1l_new,
-   NULL, LOGL_DEBUG, "l1ctl_link");
-
*l1l = l1l_new;

return 0;

--
To view, visit https://gerrit.osmocom.org/12587
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: Ibd9404a888f02798224238a7b9ff4ebf09f03850
Gerrit-Change-Number: 12587
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/trxcon.c: do not expose tall_trx_ctx

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12584 )

Change subject: trxcon/trxcon.c: do not expose tall_trx_ctx
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:48:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Log transaction allocation errors as such

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12615 )

Change subject: Log transaction allocation errors as such
..


Patch Set 1: Code-Review+1

(1 comment)

Fine, excluding changing the logging category. Otherwise I would CR+2.

https://gerrit.osmocom.org/#/c/12615/1/src/libmsc/transaction.c
File src/libmsc/transaction.c:

https://gerrit.osmocom.org/#/c/12615/1/src/libmsc/transaction.c@112
PS1, Line 112: DVLR
Why changing this? And why DVLR?
Rather do this in a separate change please.



--
To view, visit https://gerrit.osmocom.org/12615
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: I617be8793b9416ccd49022c72f7d93df7f4fb4d9
Gerrit-Change-Number: 12615
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-CC: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:46:39 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Log transaction allocation errors as such

2019-01-17 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/12615


Change subject: Log transaction allocation errors as such
..

Log transaction allocation errors as such

While at it, use proper subsystem to log missing VLR subscriber.

Change-Id: I617be8793b9416ccd49022c72f7d93df7f4fb4d9
---
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_09_11.c
M src/libmsc/transaction.c
3 files changed, 5 insertions(+), 5 deletions(-)



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

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 7172184..0119e7b 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1931,7 +1931,7 @@
/* Create transaction */
trans = trans_alloc(net, vsub, GSM48_PDISC_CC, 0xff, 
data->callref);
if (!trans) {
-   DEBUGP(DCC, "No memory for trans.\n");
+   LOGP(DCC, LOGL_ERROR, "No memory for trans.\n");
vlr_subscr_put(vsub);
/* Ressource unavailable */
mncc_release_ind(net, NULL, data->callref,
@@ -2129,7 +2129,7 @@
GSM48_PDISC_CC,
transaction_id, new_callref++);
if (!trans) {
-   DEBUGP(DCC, "No memory for trans.\n");
+   LOGP(DCC, LOGL_ERROR, "No memory for trans.\n");
rc = gsm48_tx_simple(conn,
 GSM48_PDISC_CC | (transaction_id 
<< 4),
 GSM48_MT_CC_RELEASE_COMPL);
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 12bec9d..608d4ff 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -101,7 +101,7 @@
trans = trans_alloc(conn->network, conn->vsub,
GSM48_PDISC_NC_SS, tid, new_callref++);
if (!trans) {
-   DEBUGP(DMM, " -> No memory for trans\n");
+   LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n");
gsm48_tx_simple(conn,
GSM48_PDISC_NC_SS | (tid << 4),
GSM0480_MTYPE_RELEASE_COMPLETE);
@@ -298,7 +298,7 @@
trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS,
0xff, gsup_msg->session_id);
if (!trans) {
-   DEBUGP(DMM, " -> No memory for trans\n");
+   LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n");
return NULL;
}

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index df770ed..17f8e96 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -109,7 +109,7 @@

/* a valid subscriber is indispensable */
if (vsub == NULL) {
-   LOGP(DCC, LOGL_NOTICE,
+   LOGP(DVLR, LOGL_ERROR,
 "unable to alloc transaction, invalid subscriber 
(NULL)\n");
return NULL;
}

--
To view, visit https://gerrit.osmocom.org/12615
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: I617be8793b9416ccd49022c72f7d93df7f4fb4d9
Gerrit-Change-Number: 12615
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmocom-bb[master]: trxcon/trxcon.h: do not expose pointer to trxcon_fsm instance

2019-01-17 Thread Vadim Yanitskiy
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/12590

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

Change subject: trxcon/trxcon.h: do not expose pointer to trxcon_fsm instance
..

trxcon/trxcon.h: do not expose pointer to trxcon_fsm instance

Change-Id: I37812573a33e090e6edb45713d3132cb43bd4ffb
---
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
2 files changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/12590/3
--
To view, visit https://gerrit.osmocom.org/12590
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37812573a33e090e6edb45713d3132cb43bd4ffb
Gerrit-Change-Number: 12590
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmocom-bb[master]: trxcon/trxcon.h: introduce and use struct 'trxcon_inst'

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12610


Change subject: trxcon/trxcon.h: introduce and use struct 'trxcon_inst'
..

trxcon/trxcon.h: introduce and use struct 'trxcon_inst'

Change-Id: Id868dac54693be9a67527dba06a2b80c0ecb7bd4
---
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
2 files changed, 48 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/10/12610/1

diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 6b4c989..ab29412 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -63,11 +63,9 @@
int quit;

/* L1CTL specific */
-   struct l1ctl_link *l1l;
const char *bind_socket;

/* TRX specific */
-   struct trx_instance *trx;
const char *trx_bind_ip;
const char *trx_remote_ip;
uint16_t trx_base_port;
@@ -184,7 +182,7 @@

 int main(int argc, char **argv)
 {
-   struct osmo_fsm_inst *trxcon_fsm;
+   struct trxcon_inst *trxcon = NULL;
int rc = 0;

printf("%s", COPYRIGHT);
@@ -207,31 +205,41 @@
/* Init logging system */
trx_log_init(tall_trxcon_ctx, app_data.debug_mask);

-   /* Allocate a trxcon state machine */
-   trxcon_fsm = osmo_fsm_inst_alloc(_fsm_def,
-   tall_trxcon_ctx, NULL, LOGL_DEBUG, "main");
-   if (trxcon_fsm == NULL)
+   /* Allocate a single trxcon instance */
+   trxcon = talloc_zero(tall_trxcon_ctx, struct trxcon_inst);
+   if (trxcon == NULL) {
+   LOGP(DAPP, LOGL_ERROR, "Failed to allocate a trxcon 
instance\n");
goto exit;
+   }
+
+   /* Allocate an associated trxcon state machine */
+   trxcon->fi = osmo_fsm_inst_alloc(_fsm_def,
+   tall_trxcon_ctx, trxcon, LOGL_DEBUG, "main");
+   if (trxcon->fi == NULL) {
+   LOGP(DAPP, LOGL_ERROR, "Failed to allocate trxcon FSM\n");
+   goto exit;
+   }

/* Init L1CTL server */
-   app_data.l1l = l1ctl_link_init(trxcon_fsm,
+   trxcon->l1l = l1ctl_link_init(trxcon->fi,
app_data.bind_socket);
-   if (app_data.l1l == NULL)
+   if (trxcon->l1l == NULL)
goto exit;

/* Init transceiver interface */
-   app_data.trx = trx_if_open(trxcon_fsm,
+   trxcon->trx = trx_if_open(trxcon->fi,
app_data.trx_bind_ip, app_data.trx_remote_ip,
app_data.trx_base_port);
-   if (!app_data.trx)
+   if (trxcon->trx == NULL)
goto exit;

-   /* Bind L1CTL with TRX and vice versa */
-   app_data.l1l->trx = app_data.trx;
-   app_data.trx->l1l = app_data.l1l;
+   /* Bind L1CTL with TRX and vice versa
+* TODO: get rid of this, they should be abstracted */
+   trxcon->l1l->trx = trxcon->trx;
+   trxcon->trx->l1l = trxcon->l1l;

/* Init scheduler */
-   rc = sched_trx_init(app_data.trx, app_data.trx_fn_advance);
+   rc = sched_trx_init(trxcon->trx, app_data.trx_fn_advance);
if (rc)
goto exit;

@@ -252,14 +260,21 @@
osmo_select_main(0);

 exit:
-   /* Close active connections */
-   l1ctl_link_shutdown(app_data.l1l);
-   sched_trx_shutdown(app_data.trx);
-   trx_if_close(app_data.trx);
+   if (trxcon != NULL) {
+   /* Shutdown scheduler */
+   sched_trx_shutdown(trxcon->trx);

-   /* Shutdown main state machine */
-   if (trxcon_fsm != NULL)
-   osmo_fsm_inst_free(trxcon_fsm);
+   /* Close active connections */
+   l1ctl_link_shutdown(trxcon->l1l);
+   trx_if_close(trxcon->trx);
+
+   /* Shutdown main state machine */
+   if (trxcon->fi != NULL)
+   osmo_fsm_inst_free(trxcon->fi);
+
+   /* Release trxcon instance */
+   talloc_free(trxcon);
+   }

/* Deinitialize logging */
log_fini();
diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h
index 2259931..fa48d0b 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -32,3 +32,14 @@
TRXCON_EV_SCHED_DL_TF_IND,  /*!< DL Traffic Frame INDication */
TRXCON_EV_SCHED_UL_TF_CONF, /*!< UL Traffic Frame CONFirmation */
 };
+
+/* Represents a single L1CTL <-> TRX connection */
+struct trxcon_inst {
+   /* Associated instance of trxcon_fsm */
+   struct osmo_fsm_inst *fi;
+
+   /* Connection with transceiver */
+   struct trx_instance *trx;
+   /* L1CTL server */
+   struct l1ctl_link *l1l;
+};

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: 

Change in osmocom-bb[master]: trxcon/l1ctl_link.h: get rid of pointer to a trx_instance

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12614


Change subject: trxcon/l1ctl_link.h: get rid of pointer to a trx_instance
..

trxcon/l1ctl_link.h: get rid of pointer to a trx_instance

Change-Id: Ie154a9d25dd0e8828fa2c278c98f9d8ba8c037e3
---
M src/host/trxcon/l1ctl_link.h
M src/host/trxcon/trxcon.c
2 files changed, 0 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/12614/1

diff --git a/src/host/trxcon/l1ctl_link.h b/src/host/trxcon/l1ctl_link.h
index ceeaa30..bf482b6 100644
--- a/src/host/trxcon/l1ctl_link.h
+++ b/src/host/trxcon/l1ctl_link.h
@@ -30,9 +30,6 @@
struct osmo_fd listen_bfd;
struct osmo_wqueue wq;

-   /* Bind TRX instance */
-   struct trx_instance *trx;
-
/* L1CTL handlers specific */
struct osmo_timer_list fbsb_timer;
uint8_t fbsb_conf_sent;
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index ab29412..11668a9 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -235,7 +235,6 @@

/* Bind L1CTL with TRX and vice versa
 * TODO: get rid of this, they should be abstracted */
-   trxcon->l1l->trx = trxcon->trx;
trxcon->trx->l1l = trxcon->l1l;

/* Init scheduler */

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie154a9d25dd0e8828fa2c278c98f9d8ba8c037e3
Gerrit-Change-Number: 12614
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/l1ctl.c: accept band_arfcn as a parameter

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12613


Change subject: trxcon/l1ctl.c: accept band_arfcn as a parameter
..

trxcon/l1ctl.c: accept band_arfcn as a parameter

Change-Id: I74a23c73b03bad822272b9cfe76c2501666912b7
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/l1ctl.h
M src/host/trxcon/sched_lchan_rach.c
3 files changed, 6 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/13/12613/1

diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 8f0be48..40c5171 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -222,7 +222,8 @@
return l1ctl_link_send(l1l, msg);
 }

-int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, uint32_t fn)
+int l1ctl_tx_rach_conf(struct l1ctl_link *l1l,
+   uint16_t band_arfcn, uint32_t fn)
 {
struct l1ctl_info_dl *dl;
struct msgb *msg;
@@ -236,7 +237,7 @@
dl = (struct l1ctl_info_dl *) msgb_put(msg, len);

memset(dl, 0x00, len);
-   dl->band_arfcn = htons(l1l->trx->band_arfcn);
+   dl->band_arfcn = htons(band_arfcn);
dl->frame_nr = htonl(fn);

return l1ctl_link_send(l1l, msg);
diff --git a/src/host/trxcon/l1ctl.h b/src/host/trxcon/l1ctl.h
index 76b49e3..ebf9b2d 100644
--- a/src/host/trxcon/l1ctl.h
+++ b/src/host/trxcon/l1ctl.h
@@ -23,4 +23,5 @@
uint8_t *l2, size_t l2_len, bool traffic);
 int l1ctl_tx_dt_conf(struct l1ctl_link *l1l,
struct l1ctl_info_dl *data, bool traffic);
-int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, uint32_t fn);
+int l1ctl_tx_rach_conf(struct l1ctl_link *l1l,
+   uint16_t band_arfcn, uint32_t fn);
diff --git a/src/host/trxcon/sched_lchan_rach.c 
b/src/host/trxcon/sched_lchan_rach.c
index ecf5df8..ee5faa0 100644
--- a/src/host/trxcon/sched_lchan_rach.c
+++ b/src/host/trxcon/sched_lchan_rach.c
@@ -113,7 +113,7 @@
}

/* Confirm RACH request */
-   l1ctl_tx_rach_conf(trx->l1l, fn);
+   l1ctl_tx_rach_conf(trx->l1l, trx->band_arfcn, fn);

/* Forget processed primitive */
sched_prim_drop(lchan);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I74a23c73b03bad822272b9cfe76c2501666912b7
Gerrit-Change-Number: 12613
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/l1ctl.c: pass trxcon_inst pointer to RX handlers

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12612


Change subject: trxcon/l1ctl.c: pass trxcon_inst pointer to RX handlers
..

trxcon/l1ctl.c: pass trxcon_inst pointer to RX handlers

Change-Id: I4e59f547a165b30aa9538ae8f9d6bd822067315b
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/l1ctl.h
M src/host/trxcon/trxcon_fsm.c
3 files changed, 79 insertions(+), 76 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/12/12612/1

diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 0b6d75a..8f0be48 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -42,6 +42,7 @@
 #include "l1ctl_link.h"
 #include "l1ctl_proto.h"

+#include "trxcon.h"
 #include "trx_if.h"
 #include "sched_trx.h"

@@ -288,7 +289,7 @@
 /* FBSB expire timer */
 static void fbsb_timer_cb(void *data)
 {
-   struct l1ctl_link *l1l = (struct l1ctl_link *) data;
+   struct trxcon_inst *trxcon = (struct trxcon_inst *) data;
struct l1ctl_fbsb_conf *conf;
struct l1ctl_info_dl *dl;
struct msgb *msg;
@@ -306,7 +307,7 @@
memset(dl, 0x00, len);

/* Fill in current ARFCN */
-   dl->band_arfcn = htons(l1l->trx->band_arfcn);
+   dl->band_arfcn = htons(trxcon->trx->band_arfcn);

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

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

-   l1ctl_link_send(l1l, msg);
+   l1ctl_link_send(trxcon->l1l, msg);
 }

-static int l1ctl_rx_fbsb_req(struct l1ctl_link *l1l, struct msgb *msg)
+static int l1ctl_rx_fbsb_req(struct trxcon_inst *trxcon, struct msgb *msg)
 {
enum gsm_phys_chan_config ch_config;
struct l1ctl_fbsb_req *fbsb;
@@ -344,38 +345,38 @@
band_arfcn &~ ARFCN_FLAG_MASK);

/* Reset scheduler and clock counter */
-   sched_trx_reset(l1l->trx, true);
+   sched_trx_reset(trxcon->trx, true);

/* Configure a single timeslot */
-   sched_trx_configure_ts(l1l->trx, 0, ch_config);
+   sched_trx_configure_ts(trxcon->trx, 0, ch_config);

/* Ask SCH handler to send L1CTL_FBSB_CONF */
-   l1l->fbsb_conf_sent = 0;
+   trxcon->l1l->fbsb_conf_sent = 0;

/* Only if current ARFCN differs */
-   if (l1l->trx->band_arfcn != band_arfcn) {
+   if (trxcon->trx->band_arfcn != band_arfcn) {
/* Update current ARFCN */
-   l1l->trx->band_arfcn = band_arfcn;
+   trxcon->trx->band_arfcn = band_arfcn;

/* Tune transceiver to required ARFCN */
-   trx_if_cmd_rxtune(l1l->trx, band_arfcn);
-   trx_if_cmd_txtune(l1l->trx, band_arfcn);
+   trx_if_cmd_rxtune(trxcon->trx, band_arfcn);
+   trx_if_cmd_txtune(trxcon->trx, band_arfcn);
}

-   trx_if_cmd_poweron(l1l->trx);
+   trx_if_cmd_poweron(trxcon->trx);

/* Start FBSB expire timer */
-   l1l->fbsb_timer.data = l1l;
-   l1l->fbsb_timer.cb = fbsb_timer_cb;
-   osmo_timer_schedule(>fbsb_timer, 0,
-   timeout * FRAME_DURATION_uS);
+   trxcon->l1l->fbsb_timer.data = trxcon;
+   trxcon->l1l->fbsb_timer.cb = fbsb_timer_cb;
+   osmo_timer_schedule(>l1l->fbsb_timer,
+   0, timeout * FRAME_DURATION_uS);

 exit:
msgb_free(msg);
return rc;
 }

-static int l1ctl_rx_pm_req(struct l1ctl_link *l1l, struct msgb *msg)
+static int l1ctl_rx_pm_req(struct trxcon_inst *trxcon, struct msgb *msg)
 {
uint16_t band_arfcn_start, band_arfcn_stop;
struct l1ctl_pm_req *pmr;
@@ -399,14 +400,15 @@
band_arfcn_stop &~ ARFCN_FLAG_MASK);

/* Send measurement request to transceiver */
-   rc = trx_if_cmd_measure(l1l->trx, band_arfcn_start, band_arfcn_stop);
+   rc = trx_if_cmd_measure(trxcon->trx,
+   band_arfcn_start, band_arfcn_stop);

 exit:
msgb_free(msg);
return rc;
 }

-static int l1ctl_rx_reset_req(struct l1ctl_link *l1l, struct msgb *msg)
+static int l1ctl_rx_reset_req(struct trxcon_inst *trxcon, struct msgb *msg)
 {
struct l1ctl_reset *res;
int rc = 0;
@@ -425,12 +427,12 @@
switch (res->type) {
case L1CTL_RES_T_FULL:
/* TODO: implement trx_if_reset() */
-   trx_if_cmd_poweroff(l1l->trx);
-   trx_if_cmd_echo(l1l->trx);
+   trx_if_cmd_poweroff(trxcon->trx);
+   trx_if_cmd_echo(trxcon->trx);

/* Fall through */
case L1CTL_RES_T_SCHED:
-   sched_trx_reset(l1l->trx, true);
+   sched_trx_reset(trxcon->trx, true);
break;
default:
LOGP(DL1C, LOGL_ERROR, 

Change in osmocom-bb[master]: trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/12611


Change subject: trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event
..

trxcon/l1ctl_link.c: use TRXCON_EV_L1CTL_REQ event

Change-Id: I9ad19c158397f73ab1b6639a34ce20fc7a7431b3
---
M src/host/trxcon/l1ctl_link.c
M src/host/trxcon/trxcon_fsm.c
2 files changed, 14 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/11/12611/1

diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 5a22c7e..aea23bd 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -113,8 +113,13 @@
LOGP(DL1D, LOGL_DEBUG, "RX: '%s'\n",
osmo_hexdump(msg->data, msg->len));

-   /* Call L1CTL handler */
-   l1ctl_rx_cb(l1l, msg);
+   /* Pass a message to the parent FSM */
+   rc = osmo_fsm_inst_dispatch(l1l->fsm->proc.parent,
+   TRXCON_EV_L1CTL_REQ, msg);
+   if (rc) {
+   msgb_free(msg);
+   return rc;
+   }

return 0;
 }
diff --git a/src/host/trxcon/trxcon_fsm.c b/src/host/trxcon/trxcon_fsm.c
index 69a2da1..f90f88b 100644
--- a/src/host/trxcon/trxcon_fsm.c
+++ b/src/host/trxcon/trxcon_fsm.c
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 

 static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
@@ -44,6 +45,8 @@
 static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
uint32_t event, void *data)
 {
+   struct trxcon_inst *trxcon = (struct trxcon_inst *) fi->priv;
+
switch ((enum trxcon_event_type) event) {
case TRXCON_EV_L1CTL_DISCONNECT:
/* TODO: reset TRX interface */
@@ -53,6 +56,10 @@
/* TODO: notify L1CTL interface */
osmo_fsm_inst_state_chg(fi, TRXCON_ST_IDLE, 0, 0);
break;
+   case TRXCON_EV_L1CTL_REQ:
+   OSMO_ASSERT(data != NULL);
+   l1ctl_rx_cb(trxcon->l1l, (struct msgb *) data);
+   break;
default:
LOGPFSML(fi, LOGL_ERROR, "Unhandled event '%s'\n",
osmo_fsm_event_name(_fsm_def, event));

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ad19c158397f73ab1b6639a34ce20fc7a7431b3
Gerrit-Change-Number: 12611
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/trxcon.c: do not expose tall_trx_ctx

2019-01-17 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/12584

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

Change subject: trxcon/trxcon.c: do not expose tall_trx_ctx
..

trxcon/trxcon.c: do not expose tall_trx_ctx

Both l1ctl_link_init() and trx_if_open() do accept 'tall_ctx' now,
so there is no need to expose the root context anymore. For
logging initialization, we can just pass a pointer.

Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
---
M src/host/trxcon/logging.c
M src/host/trxcon/logging.h
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
4 files changed, 14 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/12584/3
-- 
To view, visit https://gerrit.osmocom.org/12584
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Harald Welte 


Change in osmo-asf4-dfu[master]: remove OCTSIM in USB ID

2019-01-17 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/12609


Change subject: remove OCTSIM in USB ID
..

remove OCTSIM in USB ID

this bootloader is initiated and meant for the sysmo-OCTSIM, but
it can be applied for other SAM E5x/D5x boards.
Thus we remove the OCTSIM name an just use the more generic
bootloader name.

Change-Id: Icc46f0d8b4b649fd00b5c6cea5bad91a93891f14
---
M config/usbd_config.h
M usb/class/dfu/device/dfudf_desc.h
2 files changed, 31 insertions(+), 31 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/09/12609/1

diff --git a/config/usbd_config.h b/config/usbd_config.h
index 96b3320..c20dfb2 100644
--- a/config/usbd_config.h
+++ b/config/usbd_config.h
@@ -23,7 +23,7 @@
 #endif
 //  Language IDs
 //  Language IDs in c format, split by comma (E.g., 0x0409 ...)
-//  usb_dufd_langid
+//  usb_dfud_langid
 #ifndef CONF_USB_DFUD_LANGID
 #define CONF_USB_DFUD_LANGID "0x0409"
 #endif
@@ -69,33 +69,33 @@
 // <0x0010=> 16 bytes
 // <0x0020=> 32 bytes
 // <0x0040=> 64 bytes
-//  usb_dufd_bmaxpksz0
+//  usb_dfud_bmaxpksz0
 #ifndef CONF_USB_DFUD_BMAXPKSZ0
 #define CONF_USB_DFUD_BMAXPKSZ0 0x40
 #endif

 //  idVendor <0x-0x>
 // <0x1d50=> OpenMoko
-//  usb_octsim_idvendor
-#ifndef CONF_USB_OCTSIM_IDVENDOR
-#define CONF_USB_OCTSIM_IDVENDOR 0x1d50
+//  usb_dfud_idvendor
+#ifndef CONF_USB_OPENMOKO_IDVENDOR
+#define CONF_USB_OPENMOKO_IDVENDOR 0x1d50
 #endif

 //  idProduct <0x-0x>
-// <0x6140=> sysmoOCTSIM
-//  usb_dufd_idproduct
-#ifndef CONF_USB_OCTSIM_IDPRODUCT
-#define CONF_USB_OCTSIM_IDPRODUCT 0x6140
+// <0x6140=> osmo-ASF4-DFU
+//  usb_dfud_idproduct
+#ifndef CONF_USB_OSMOASF4DFU_IDPRODUCT
+#define CONF_USB_OSMOASF4DFU_IDPRODUCT 0x6140
 #endif

 //  bcdDevice <0x-0x>
-//  usb_dufd_bcddevice
+//  usb_dfud_bcddevice
 #ifndef CONF_USB_DFUD_BCDDEVICE
 #define CONF_USB_DFUD_BCDDEVICE 0x000
 #endif

 //  Enable string descriptor of iManufact
-//  usb_dufd_imanufact_en
+//  usb_dfud_imanufact_en
 #ifndef CONF_USB_DFUD_IMANUFACT_EN
 #define CONF_USB_DFUD_IMANUFACT_EN 1
 #endif
@@ -105,7 +105,7 @@
 #endif

 //  Unicode string of iManufact
-//  usb_dufd_imanufact_str
+//  usb_dfud_imanufact_str
 #ifndef CONF_USB_DFUD_IMANUFACT_STR
 #define CONF_USB_DFUD_IMANUFACT_STR "osmocom"
 #endif
@@ -117,7 +117,7 @@
 // 

 //  Enable string descriptor of iProduct
-//  usb_dufd_iproduct_en
+//  usb_dfud_iproduct_en
 #ifndef CONF_USB_DFUD_IPRODUCT_EN
 #define CONF_USB_DFUD_IPRODUCT_EN 1
 #endif
@@ -128,7 +128,7 @@
 #endif

 //  Unicode string of iProduct
-//  usb_dufd_iproduct_str
+//  usb_dfud_iproduct_str
 #ifndef CONF_USB_DFUD_IPRODUCT_STR
 #define CONF_USB_DFUD_IPRODUCT_STR "osmo-ASF4-DFU"
 #endif
@@ -140,7 +140,7 @@
 // 

 //  Enable string descriptor of iSerialNum
-//  usb_dufd_iserialnum_en
+//  usb_dfud_iserialnum_en
 #ifndef CONF_USB_DFUD_ISERIALNUM_EN
 #define CONF_USB_DFUD_ISERIALNUM_EN 0
 #endif
@@ -152,7 +152,7 @@
 #endif

 //  Unicode string of iSerialNum
-//  usb_dufd_iserialnum_str
+//  usb_dfud_iserialnum_str
 #ifndef CONF_USB_DFUD_ISERIALNUM_STR
 #define CONF_USB_DFUD_ISERIALNUM_STR "123456789ABCDEF"
 #endif
@@ -164,7 +164,7 @@
 // 

 //  bNumConfigurations <0x01-0xFF>
-//  usb_dufd_bnumconfig
+//  usb_dfud_bnumconfig
 #ifndef CONF_USB_DFUD_BNUMCONFIG
 #define CONF_USB_DFUD_BNUMCONFIG 0x1
 #endif
@@ -174,25 +174,25 @@
 //  DFU Configuration Descriptor

 //  wTotalLength <0x01-0xFF>
-//  usb_dufd_wtotallength
+//  usb_dfud_wtotallength
 #ifndef CONF_USB_DFUD_WTOTALLENGTH
 #define CONF_USB_DFUD_WTOTALLENGTH 27
 #endif

 //  bNumInterfaces <0x01-0xFF>
-//  usb_dufd_bnuminterfaces
+//  usb_dfud_bnuminterfaces
 #ifndef CONF_USB_DFUD_BNUMINTERFACES
 #define CONF_USB_DFUD_BNUMINTERFACES 1
 #endif

 //  bConfigurationValue <0x01-0xFF>
-//  usb_dufd_bconfigval
+//  usb_dfud_bconfigval
 #ifndef CONF_USB_DFUD_BCONFIGVAL
 #define CONF_USB_DFUD_BCONFIGVAL 0x1
 #endif

 //  Enable string descriptor of iConfig
-//  usb_dufd_iconfig_en
+//  usb_dfud_iconfig_en
 #ifndef CONF_USB_DFUD_ICONFIG_EN
 #define CONF_USB_DFUD_ICONFIG_EN 0
 #endif
@@ -205,7 +205,7 @@
 #endif

 //  Unicode string of iConfig
-//  usb_dufd_iconfig_str
+//  usb_dfud_iconfig_str
 #ifndef CONF_USB_DFUD_ICONFIG_STR
 #define CONF_USB_DFUD_ICONFIG_STR ""
 #endif
@@ -221,13 +221,13 @@
 // <0xA0=> Bus power supply, support for remote wakeup
 // <0xC0=> Self powered, not support for remote wakeup
 // <0xE0=> Self powered, support for remote wakeup
-//  usb_dufd_bmattri
+//  usb_dfud_bmattri
 #ifndef CONF_USB_DFUD_BMATTRI
 #define CONF_USB_DFUD_BMATTRI 0x80
 #endif

 //  bMaxPower <0x00-0xFF>
-//  usb_dufd_bmaxpower
+//  usb_dfud_bmaxpower
 #ifndef CONF_USB_DFUD_BMAXPOWER
 #define CONF_USB_DFUD_BMAXPOWER 0x32
 #endif
@@ -236,25 +236,25 @@
 //  DFU Interface Descriptor

 //  bInterfaceNumber <0x00-0xFF>
-//  usb_dufd_bifcnum
+//  usb_dfud_bifcnum
 #ifndef CONF_USB_DFUD_BIFCNUM
 #define CONF_USB_DFUD_BIFCNUM 0x0
 

Change in osmo-hlr[master]: docs: running: document --db-upgrade

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12606 )

Change subject: docs: running: document --db-upgrade
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I641fd258091974662d9f63697aea103eaf151d09
Gerrit-Change-Number: 12606
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:32:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: docs: running: same argument order as osmo-hlr -h

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12605 )

Change subject: docs: running: same argument order as osmo-hlr -h
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If866124e9cfb43c6986d458712961713541e03b6
Gerrit-Change-Number: 12605
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:31:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: docs: running: s/OsmoBTS/OsmoHLR

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12607 )

Change subject: docs: running: s/OsmoBTS/OsmoHLR
..

docs: running: s/OsmoBTS/OsmoHLR

Change-Id: Ib4e1c8460dbe0a9b7dca8d2291a5e6c5406180e7
---
M doc/manuals/chapters/running.adoc
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/doc/manuals/chapters/running.adoc 
b/doc/manuals/chapters/running.adoc
index d20c907..ad89974 100644
--- a/doc/manuals/chapters/running.adoc
+++ b/doc/manuals/chapters/running.adoc
@@ -39,7 +39,7 @@
been deprecated by VTY based logging configuration, see
<> for more information.
 *-V, --version*::
-   Print the compile-time version number of the OsmoBTS program
+   Print the compile-time version number of the OsmoHLR program

 === Bootstrap the Database


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4e1c8460dbe0a9b7dca8d2291a5e6c5406180e7
Gerrit-Change-Number: 12607
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-hlr[master]: docs: running: same argument order as osmo-hlr -h

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12605 )

Change subject: docs: running: same argument order as osmo-hlr -h
..

docs: running: same argument order as osmo-hlr -h

Change the Synopsis and Options sections of the Running OsmoHLR chapter
to list the arguments in the same order as osmo-hlr. This makes it
easier to compare, which options are already documented, and which ones
are missing.

A follow-up commit will document the missing -U/--db-upgrade option.

Change-Id: If866124e9cfb43c6986d458712961713541e03b6
---
M doc/manuals/chapters/running.adoc
1 file changed, 12 insertions(+), 10 deletions(-)

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



diff --git a/doc/manuals/chapters/running.adoc 
b/doc/manuals/chapters/running.adoc
index 5f24746..d20c907 100644
--- a/doc/manuals/chapters/running.adoc
+++ b/doc/manuals/chapters/running.adoc
@@ -5,24 +5,27 @@

 === SYNOPSIS

-*osmo-hlr* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 
'LOGLEVEL'] [-l 'DATABASE']
+*osmo-hlr* [-h] [-c 'CONFIGFILE'] [-l 'DATABASE'] [-d 'DBGMASK'] [-D] [-s] 
[-T] [-e 'LOGLEVEL'] [-V]

 === OPTIONS

+// Keep the order the same as in osmo-hlr --help!
+
 *-h, --help*::
Print a short help message about the supported options
-*-V, --version*::
-   Print the compile-time version number of the OsmoBTS program
+*-c, --config-file 'CONFIGFILE'*::
+   Specify the file and path name of the configuration file to be
+   used. If none is specified, use `osmo-hlr.cfg` in the current
+   working directory.
+*-l, --database 'DATABASE'*::
+   Specify the file name of the SQLite3 database to use as HLR/AUC
+   storage
 *-d, --debug 'DBGMASK','DBGLEVELS'*::
Set the log subsystems and levels for logging to stderr. This
has mostly been superseded by VTY-based logging configuration,
see <> for further information.
 *-D, --daemonize*::
Fork the process as a daemon into background.
-*-c, --config-file 'CONFIGFILE'*::
-   Specify the file and path name of the configuration file to be
-   used. If none is specified, use `osmo-hlr.cfg` in the current
-   working directory.
 *-s, --disable-color*::
Disable colors for logging to stderr. This has mostly been
deprecated by VTY based logging configuration, see <>
@@ -35,9 +38,8 @@
Set the global log level for logging to stderr. This has mostly
been deprecated by VTY based logging configuration, see
<> for more information.
-*-l, --database 'DATABASE'*::
-   Specify the file name of the SQLite3 database to use as HLR/AUC
-   storage
+*-V, --version*::
+   Print the compile-time version number of the OsmoBTS program

 === Bootstrap the Database


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If866124e9cfb43c6986d458712961713541e03b6
Gerrit-Change-Number: 12605
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 


Change in osmo-hlr[master]: docs: running: s/OsmoBTS/OsmoHLR

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12607 )

Change subject: docs: running: s/OsmoBTS/OsmoHLR
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4e1c8460dbe0a9b7dca8d2291a5e6c5406180e7
Gerrit-Change-Number: 12607
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:31:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-manuals[master]: common: extend glossary.adoc

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12567 )

Change subject: common: extend glossary.adoc
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12567/2/common/chapters/glossary.adoc
File common/chapters/glossary.adoc:

https://gerrit.osmocom.org/#/c/12567/2/common/chapters/glossary.adoc@298
PS2, Line 298: Supplementary Services; textual dialog between subscriber and 
core
 :   network, e.g. '*#100#' -> 'Your extension is 1234'
actually, your example is USSD, which is only one part of non-call-related SS, 
which again are only a part of SS. Supplementary services are also used for 
3-party calls, hold/retrieve, advice-of-charge, call deflection, ...



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

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I054a8599a78eb5e62ab7af914875e1c8a992af71
Gerrit-Change-Number: 12567
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: osmith 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:31:17 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: Handle LCLS-NOTIFICATION message from BSS

2019-01-17 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/12608


Change subject: Handle LCLS-NOTIFICATION message from BSS
..

Handle LCLS-NOTIFICATION message from BSS

Change-Id: Ibf5f9cad1f70aee56d5bca8fe09a24ca417e7a63
Related: OS#2487
---
M src/libmsc/a_iface_bssap.c
1 file changed, 26 insertions(+), 0 deletions(-)



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

diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 41af93c..12a7af6 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -585,6 +585,30 @@
return 0;
 }

+/* Handle incoming LCLS-NOTIFICATION BSSMAP message: 3GPP TS 48.008 §3.2.1.93 
*/
+static int bssmap_rx_lcls_notif(const struct ran_conn *conn, const struct msgb 
*msg, const struct tlv_parsed *tp)
+{
+   /* Either §3.2.2.119 LCLS-BSS-Status (GSM0808_LCLS_STS*) or §3.2.2.120 
LCLS-Break-Request shall be present */
+   if (TLVP_PRESENT(tp, GSM0808_IE_LCLS_BSS_STATUS) && TLVP_PRESENT(tp, 
GSM0808_IE_LCLS_BREAK_REQ)) {
+   LOGPCONN(conn, LOGL_ERROR, "Ignoring broken LCLS Notification 
message\n");
+   }
+
+   if (TLVP_PRESENT(tp, GSM0808_IE_LCLS_BSS_STATUS)) {
+   uint8_t *status = TLVP_VAL(tp, GSM0808_IE_LCLS_BSS_STATUS);
+   LOGPCONN(conn, LOGL_NOTICE, "Received LCLS Status %s\n", 
gsm0808_lcls_status_name(*status));
+   return 0;
+   }
+
+   if (TLVP_PRESENT(tp, GSM0808_IE_LCLS_BREAK_REQ)) {
+   LOGPCONN(conn, LOGL_NOTICE, "Received LCLS Break Request\n");
+   return 0;
+   }
+
+   LOGPCONN(conn, LOGL_ERROR, "Received empty LCLS Notification\n");
+
+   return 0;
+}
+
 /* Handle incoming connection oriented BSSMAP messages */
 static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info 
*a_conn_info, struct msgb *msg)
 {
@@ -646,6 +670,8 @@
return bssmap_rx_sapi_n_rej(conn, msg, );
case BSS_MAP_MSG_ASSIGMENT_COMPLETE:
return bssmap_rx_ass_compl(conn, msg, );
+   case BSS_MAP_MSG_LCLS_NOTIFICATION:
+   return bssmap_rx_lcls_notif(conn, msg, );
default:
LOGPCONN(conn, LOGL_ERROR, "Unimplemented msg type: %s\n", 
gsm0808_bssmap_name(msg_type));
return -EINVAL;

--
To view, visit https://gerrit.osmocom.org/12608
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: Ibf5f9cad1f70aee56d5bca8fe09a24ca417e7a63
Gerrit-Change-Number: 12608
Gerrit-PatchSet: 1
Gerrit-Owner: Max 


Change in osmo-bsc[master]: Log MDCX ACK for established lchan

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12596 )

Change subject: Log MDCX ACK for established lchan
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12596
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: Ib642df799f3405c4d707eb57b2ebc84386d7f03f
Gerrit-Change-Number: 12596
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:29:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: Log MDCX ACK for established lchan

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12596 )

Change subject: Log MDCX ACK for established lchan
..

Log MDCX ACK for established lchan

Previously LCHAN_RTP_EV_IPACC_MDCX_ACK was not permitted for
LCHAN_RTP_ST_ESTABLISHED state in lchan FSM. However this message is
normal in case of LCLS loop closed via IPA (as opposed to MGCP). Let's
permit this message and log it to make debug output easier to read.

Change-Id: Ib642df799f3405c4d707eb57b2ebc84386d7f03f
Related: OS#2487
---
M src/osmo-bsc/lchan_rtp_fsm.c
1 file changed, 8 insertions(+), 1 deletion(-)

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/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 84cc287..2d15bf2 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -565,13 +565,19 @@

 static void lchan_rtp_fsm_established(struct osmo_fsm_inst *fi, uint32_t 
event, void *data)
 {
+   struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi);
+
switch (event) {

case LCHAN_RTP_EV_RELEASE:
case LCHAN_RTP_EV_ROLLBACK:
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0);
return;
-
+   case LCHAN_RTP_EV_IPACC_MDCX_ACK:
+   LOG_LCHAN_RTP(lchan, LOGL_NOTICE,
+ "Received MDCX ACK on established lchan's RTP 
port: %s\n",
+ mgwep_ci_name(lchan->mgw_endpoint_ci_bts));
+   return;
default:
OSMO_ASSERT(false);
}
@@ -689,6 +695,7 @@
.in_event_mask = 0
| S(LCHAN_RTP_EV_RELEASE)
| S(LCHAN_RTP_EV_ROLLBACK)
+   | S(LCHAN_RTP_EV_IPACC_MDCX_ACK)
,
},
[LCHAN_RTP_ST_ROLLBACK] = {

--
To view, visit https://gerrit.osmocom.org/12596
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: Ib642df799f3405c4d707eb57b2ebc84386d7f03f
Gerrit-Change-Number: 12596
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmocom-bb[master]: trxcon/trxcon.h: do not expose pointer to trxcon_fsm instance

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12590 )

Change subject: trxcon/trxcon.h: do not expose pointer to trxcon_fsm instance
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I37812573a33e090e6edb45713d3132cb43bd4ffb
Gerrit-Change-Number: 12590
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:28:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon: make trxcon_fsm parent for both l1ctl_fsm and trx_fsm

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12589 )

Change subject: trxcon: make trxcon_fsm parent for both l1ctl_fsm and trx_fsm
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6262726f2b6e23abe543d6d67edfd634eece1b71
Gerrit-Change-Number: 12589
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:28:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon/trxcon.h: do not expose tall_trx_ctx

2019-01-17 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12584 )

Change subject: trxcon/trxcon.h: do not expose tall_trx_ctx
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12584/2/src/host/trxcon/trxcon.c
File src/host/trxcon/trxcon.c:

https://gerrit.osmocom.org/#/c/12584/2/src/host/trxcon/trxcon.c@77
PS2, Line 77: void *tall_trxcon_ctx = NULL;
> can you even make it static to this file?
Sure, thanks!



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:28:27 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmocom-bb[master]: trxcon/trxcon.h: do not expose tall_trx_ctx

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12584 )

Change subject: trxcon/trxcon.h: do not expose tall_trx_ctx
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12584/2/src/host/trxcon/trxcon.c
File src/host/trxcon/trxcon.c:

https://gerrit.osmocom.org/#/c/12584/2/src/host/trxcon/trxcon.c@77
PS2, Line 77: void *tall_trxcon_ctx = NULL;
can you even make it static to this file?



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:27:16 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmocom-bb[master]: trxcon/l1ctl_link.c: refactor l1ctl_link_init()

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12583 )

Change subject: trxcon/l1ctl_link.c: refactor l1ctl_link_init()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7fe1bc306494ac692c182dcfd2a2d9412929194b
Gerrit-Change-Number: 12583
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:26:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon/trx_if: refactor trx_if_open()

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12582 )

Change subject: trxcon/trx_if: refactor trx_if_open()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I39b24afee2f09d6a6c500cfc26ac45f206589c5c
Gerrit-Change-Number: 12582
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:26:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon/trx_if.c: check if trx_fsm allocation failed

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12588 )

Change subject: trxcon/trx_if.c: check if trx_fsm allocation failed
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I31c9f2a651182b258d0a4d4504365b778529715a
Gerrit-Change-Number: 12588
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:25:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon: do not include trxcon.h everywhere

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12581 )

Change subject: trxcon: do not include trxcon.h everywhere
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia78bd6dac7ab12970838e0b1a2929a106b898d9d
Gerrit-Change-Number: 12581
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:26:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon: register both l1ctl_fsm and trx_fsm on DSO load

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12586 )

Change subject: trxcon: register both l1ctl_fsm and trx_fsm on DSO load
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7111e368afa47c88ff3c610bae9044f2d5baf037
Gerrit-Change-Number: 12586
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:25:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon/l1ctl_link.c: check if l1ctl_fsm allocation failed

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12587 )

Change subject: trxcon/l1ctl_link.c: check if l1ctl_fsm allocation failed
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd9404a888f02798224238a7b9ff4ebf09f03850
Gerrit-Change-Number: 12587
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:25:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: trxcon/sched_trx.c: use bool in sched_trx_reset()

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12580 )

Change subject: trxcon/sched_trx.c: use bool in sched_trx_reset()
..

trxcon/sched_trx.c: use bool in sched_trx_reset()

Change-Id: I4f6990520836edb5eecce38c04857a4b3bc6f2fc
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/sched_trx.h
M src/host/trxcon/trxcon.c
4 files changed, 8 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, approved



diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 02aa3fa..a2ced46 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -345,7 +345,7 @@
band_arfcn &~ ARFCN_FLAG_MASK);

/* Reset scheduler and clock counter */
-   sched_trx_reset(l1l->trx, 1);
+   sched_trx_reset(l1l->trx, true);

/* Configure a single timeslot */
sched_trx_configure_ts(l1l->trx, 0, ch_config);
@@ -431,7 +431,7 @@

/* Fall through */
case L1CTL_RES_T_SCHED:
-   sched_trx_reset(l1l->trx, 1);
+   sched_trx_reset(l1l->trx, true);
break;
default:
LOGP(DL1C, LOGL_ERROR, "Unknown L1CTL_RESET_REQ type\n");
@@ -674,7 +674,7 @@
"switching back to CCCH\n");

/* Reset scheduler */
-   sched_trx_reset(l1l->trx, 0);
+   sched_trx_reset(l1l->trx, false);

msgb_free(msg);
return 0;
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 19d1fe8..18516d3 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -2,7 +2,7 @@
  * OsmocomBB <-> SDR connection bridge
  * TDMA scheduler: GSM PHY routines
  *
- * (C) 2017 by Vadim Yanitskiy 
+ * (C) 2017-2019 by Vadim Yanitskiy 
  *
  * All Rights Reserved
  *
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -160,7 +161,7 @@
return 0;
 }

-int sched_trx_reset(struct trx_instance *trx, int reset_clock)
+int sched_trx_reset(struct trx_instance *trx, bool reset_clock)
 {
int i;

diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index b7236d5..f914eee 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -263,7 +263,7 @@

 /* Scheduler management functions */
 int sched_trx_init(struct trx_instance *trx, uint32_t fn_advance);
-int sched_trx_reset(struct trx_instance *trx, int reset_clock);
+int sched_trx_reset(struct trx_instance *trx, bool reset_clock);
 int sched_trx_shutdown(struct trx_instance *trx);

 /* Timeslot management functions */
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 251321d..874f893 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -93,7 +93,7 @@

if (app_data.trx->fsm->state != TRX_STATE_OFFLINE) {
/* Reset scheduler and clock counter */
-   sched_trx_reset(app_data.trx, 1);
+   sched_trx_reset(app_data.trx, true);

/* TODO: implement trx_if_reset() */
trx_if_cmd_poweroff(app_data.trx);

--
To view, visit https://gerrit.osmocom.org/12580
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: I4f6990520836edb5eecce38c04857a4b3bc6f2fc
Gerrit-Change-Number: 12580
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-msc[master]: Cosmetic: Fix spelling in smpp vty

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12600 )

Change subject: Cosmetic: Fix spelling in smpp vty
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12600
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: Id3fa3f26c333bf445590fd75ad7a08be68fed3e2
Gerrit-Change-Number: 12600
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:24:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Make alert notifications vty configurable per ESME

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12597 )

Change subject: Make alert notifications vty configurable per ESME
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12597
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: I57f4d268ca6fe6a233f2caaffce62e4aade01274
Gerrit-Change-Number: 12597
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:24:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in openbsc[master]: Don't deliver alert notification to ESME not bound for RX

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12602 )

Change subject: Don't deliver alert notification to ESME not bound for RX
..


Patch Set 1:

(1 comment)

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

https://gerrit.osmocom.org/#/c/12602/1//COMMIT_MSG@7
PS1, Line 7: bound for RX
Why is that? I would argue there are many applications where you may want to 
transmit a SMS from ESME to the MS in response to an activity report.  In that 
case, IIRC, the ESME would only be bound for TX but still want notifications?

Basically, I think to avoid constraining use cases we should send notifications 
to any ESME that is bound to any of RX/TX/TRX.



--
To view, visit https://gerrit.osmocom.org/12602
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: I0e5d55d3fb6ac46d253902df2fe304e1b0fc8bbf
Gerrit-Change-Number: 12602
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:23:12 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in openbsc[master]: Make alert notifications vty configurable per ESME

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12601 )

Change subject: Make alert notifications vty configurable per ESME
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12601
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: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
Gerrit-Change-Number: 12601
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:23:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Don't send Alert Notifications to ESME not bound for RX

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12599 )

Change subject: Don't send Alert Notifications to ESME not bound for RX
..


Patch Set 2:

Why is that? I would argue there are many applications where you may want to 
transmit a SMS from ESME to the MS in response to an activity report.  In that 
case, IIRC, the ESME would only be bound for TX but still want notifications?

Basically, I think to avoid constraining use cases we should send notifications 
to any ESME that is bound to any of RX/TX/TRX.


--
To view, visit https://gerrit.osmocom.org/12599
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: Iec92d4c145ca050c2e212139572eeaae581b99df
Gerrit-Change-Number: 12599
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:23:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in openbsc[master]: Cosmetic: Fix spelling in smpp vty

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12603 )

Change subject: Cosmetic: Fix spelling in smpp vty
..


Patch Set 1: Code-Review+2

forget my earlier comments, I now saw the MSC changes. Thanks!


--
To view, visit https://gerrit.osmocom.org/12603
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: If2180828e2acd28d96754c593c317c2868644c4b
Gerrit-Change-Number: 12603
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:17:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in openbsc[master]: Cosmetic: Fix spelling in smpp vty

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12603 )

Change subject: Cosmetic: Fix spelling in smpp vty
..


Patch Set 1:

good patch, but similarly, we should always work "mainline first" and then 
back-port to openbsc.git. Thanks!


--
To view, visit https://gerrit.osmocom.org/12603
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: If2180828e2acd28d96754c593c317c2868644c4b
Gerrit-Change-Number: 12603
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:17:18 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: SMS: remove code duplication in transaction init

2019-01-17 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12578 )

Change subject: SMS: remove code duplication in transaction init
..

SMS: remove code duplication in transaction init

Move code which allocates transaction for SMS and initializes
corresponding FSM into separate function (shared by MT and MO code
paths) to avoid code duplication and simplify further modifications.

Change-Id: I3563e11bebb58e656592df2ff7db96f41deaf735
---
M src/libmsc/gsm_04_11.c
1 file changed, 28 insertions(+), 25 deletions(-)

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



diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 8ef26a7..4dc07bd 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -1007,6 +1007,27 @@
return rc;
 }

+static struct gsm_trans *gsm411_trans_init(struct gsm_network *net, struct 
vlr_subscr *vsub, struct ran_conn *conn,
+  uint8_t tid)
+{
+   /* Allocate a new transaction */
+   struct gsm_trans *trans = trans_alloc(net, vsub, GSM48_PDISC_SMS, tid, 
new_callref++);
+   if (!trans) {
+   LOGP(DLSMS, LOGL_ERROR, "No memory for transaction\n");
+   return NULL;
+   }
+
+   /* Init both SMC and SMR state machines */
+   gsm411_smc_init(>sms.smc_inst, 0, 1, gsm411_mn_recv, 
gsm411_mm_send);
+   gsm411_smr_init(>sms.smr_inst, 0, 1, gsm411_rl_recv, 
gsm411_mn_send);
+
+   /* Associate transaction with connection */
+   if (conn)
+   trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
+
+   return trans;
+}
+
 static struct gsm_trans *gsm411_alloc_mt_trans(struct gsm_network *net,
   struct vlr_subscr *vsub)
 {
@@ -1023,24 +1044,15 @@
return NULL;
}

-   /* Allocate a new transaction */
-   trans = trans_alloc(net, vsub, GSM48_PDISC_SMS, tid, new_callref++);
-   if (!trans) {
-   LOGP(DLSMS, LOGL_ERROR, "No memory for trans\n");
-   return NULL;
-   }
-
-   /* Init both SMC and SMR state machines */
-   gsm411_smc_init(>sms.smc_inst, 0, 1,
-   gsm411_mn_recv, gsm411_mm_send);
-   gsm411_smr_init(>sms.smr_inst, 0, 1,
-   gsm411_rl_recv, gsm411_mn_send);
-
/* Attempt to find an existing connection */
conn = connection_for_subscr(vsub);
+
+   /* Allocate a new transaction */
+   trans = gsm411_trans_init(net, vsub, conn, tid);
+   if (!trans)
+   return NULL;
+
if (conn) {
-   /* Associate transaction with connection */
-   trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
/* Generate unique RP Message Reference */
trans->sms.sm_rp_mr = conn->next_rp_ref++;
}
@@ -1192,21 +1204,12 @@
}

if (!trans) {
-   DEBUGP(DLSMS, " -> (new transaction)\n");
-   trans = trans_alloc(conn->network, conn->vsub,
-   GSM48_PDISC_SMS,
-   transaction_id, new_callref++);
+   trans = gsm411_trans_init(conn->network, conn->vsub, conn, 
transaction_id);
if (!trans) {
-   DEBUGP(DLSMS, " -> No memory for trans\n");
/* FIXME: send some error message */
return -ENOMEM;
}
-   gsm411_smc_init(>sms.smc_inst, 0, 1,
-   gsm411_mn_recv, gsm411_mm_send);
-   gsm411_smr_init(>sms.smr_inst, 0, 1,
-   gsm411_rl_recv, gsm411_mn_send);

-   trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC 
*/

new_trans = 1;

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3563e11bebb58e656592df2ff7db96f41deaf735
Gerrit-Change-Number: 12578
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 


Change in openbsc[master]: Don't deliver alert notification to ESME not bound for RX

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12602 )

Change subject: Don't deliver alert notification to ESME not bound for RX
..


Patch Set 1:

good patch, but similarly, we should always work "mainline first" and then 
back-port to openbsc.git. Thanks!


--
To view, visit https://gerrit.osmocom.org/12602
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: I0e5d55d3fb6ac46d253902df2fe304e1b0fc8bbf
Gerrit-Change-Number: 12602
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:16:49 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in openbsc[master]: Make alert notifications vty configurable per ESME

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12601 )

Change subject: Make alert notifications vty configurable per ESME
..


Patch Set 1:

I'm happy to merge this, but in general we should first merge such changes to 
the maintained software (e.g. osmo-msc in this case) and then back-port it to 
openbsc to avoid too much feature divergence.


--
To view, visit https://gerrit.osmocom.org/12601
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: I2b52f2778b24eebc82b2e5e2fb3c2250b1f9e5b0
Gerrit-Change-Number: 12601
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:16:21 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-asf4-dfu[master]: avoid mutli-packet USB transfer

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12595 )

Change subject: avoid mutli-packet USB transfer
..


Patch Set 1:

I'm not sure if we really want to mege this.  The USB stack will also be used 
later on, and for sure with CCID we will have APDUs/TPDUs larger than the 
endpoint size, and we will support this.  Or is this behavior only visible on 
the control endpoint?


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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icb4c5f4bc06095f5f962152b8d8247054ef6a520
Gerrit-Change-Number: 12595
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:15:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-asf4-dfu[master]: start application if valid at boot

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12592 )

Change subject: start application if valid at boot
..

start application if valid at boot

if the application is not valid, check and start the bootloader

Change-Id: I323f2b3a1828d3e40a02c7fc755d07009fb43a85
---
M usb_dfu_main.c
M usb_start.c
2 files changed, 85 insertions(+), 42 deletions(-)

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



diff --git a/usb_dfu_main.c b/usb_dfu_main.c
index 2535475..91748a5 100644
--- a/usb_dfu_main.c
+++ b/usb_dfu_main.c
@@ -1,45 +1,95 @@
 /**
  * \file
+ * \brief USB DFU bootloader implementation (DFU mode)
  *
- * \brief Application implement
+ * Copyright (c) 2018-2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

  *
- * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
- * Copyright (c) 2018 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 

+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * \asf_license_start
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * \page License
- *
- * Subject to your compliance with these terms, you may use Microchip
- * software and any derivatives exclusively with Microchip products.
- * It is your responsibility to comply with third party license terms 
applicable
- * to your use of third party software (including open source software) that
- * may accompany Microchip software.
- *
- * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS".  NO WARRANTIES,
- * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
- * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
- * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
- * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
- * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
- * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
- * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.  TO THE FULLEST EXTENT
- * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
- * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
- * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit https://www.microchip.com/support/;>Microchip Support
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
  */

 #include "atmel_start.h"
 #include "atmel_start_pins.h"

+/** Start address of the application in flash
+ *  \remark must be initialized by check_bootloader
+ */
+static uint32_t* application_start_address;
+
+/** Check if the bootloader is valid
+ *  \return true if the bootloader is valid and can be run
+ *  \remark initializes application_start_address
+ */
+static bool check_bootloader(void)
+{
+   if (hri_nvmctrl_read_STATUS_BOOTPROT_bf(FLASH_0.dev.hw) > 15) { // 
ensure BOOTPROT setting is valid
+   return false;
+   }
+   application_start_address = (uint32_t*)((15 - 
hri_nvmctrl_read_STATUS_BOOTPROT_bf(FLASH_0.dev.hw)) * 8192); // calculate 
bootloader size to know start address of the application (e.g. after the 
bootloader)
+   if (0 == application_start_address) { // no space has been reserved for 
the bootloader
+   return false;
+   }
+   return true;
+}
+
+/** Check if starting the bootloader is forced
+ *  \return true of the DFU bootloader should be started
+ */
+static bool check_force_dfu(void)
+{
+}
+
+/** Check if the application is valid
+ *  \return true if the application is valid and can be started
+ *  \warning application_start_address must be initialized
+ */
+static bool check_application(void)
+{
+   /* the application starts with the vector table
+* the first entry in the vector table is the initial stack pointer 
(SP) address
+* the stack will be placed in RAM which begins at 0x2000 , and 
there is up to 256 KB of RAM (0x4).
+* if the SP is not in this range (e.g. flash has been erased) there is 
no valid application
+* the second entry in the vector table is the reset address, 
corresponding to the application start
+*/
+   return (0x2000 == ((*application_start_address) & 0xFFF8));
+}
+
+/** Start the application
+ *  \warning application_start_address 

Change in osmo-asf4-dfu[master]: reduce number of endpoints

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12594 )

Change subject: reduce number of endpoints
..

reduce number of endpoints

only endpoint 0 is used, thus there is no need to define more.
this also saves RAM.

Change-Id: I52a5d2d3c3d09ca7dfa165535ccc295bf190841b
---
M config/hpl_usb_config.h
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/config/hpl_usb_config.h b/config/hpl_usb_config.h
index 02439a3..4445de5 100644
--- a/config/hpl_usb_config.h
+++ b/config/hpl_usb_config.h
@@ -39,7 +39,7 @@
 //  Max possible (by "Max Endpoint Number" config)
 //  usbd_num_ep_sp
 #ifndef CONF_USB_D_NUM_EP_SP
-#define CONF_USB_D_NUM_EP_SP CONF_USB_D_N_EP_MAX
+#define CONF_USB_D_NUM_EP_SP CONF_USB_N_1
 #endif

 // 
@@ -60,7 +60,7 @@
 //  The number of physical endpoints - 1
 //  usbd_arch_max_ep_n
 #ifndef CONF_USB_D_MAX_EP_N
-#define CONF_USB_D_MAX_EP_N CONF_USB_N_2
+#define CONF_USB_D_MAX_EP_N CONF_USB_N_0
 #endif

 //  USB Speed Limit

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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I52a5d2d3c3d09ca7dfa165535ccc295bf190841b
Gerrit-Change-Number: 12594
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-asf4-dfu[master]: add README file

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12516 )

Change subject: add README file
..

add README file

this describes the project, how to compile, and how to flash the
USB DFU bootloader

Change-Id: If884bca373aab10fe74d16f42b79dd6685eeabcf
---
A README.md
1 file changed, 50 insertions(+), 0 deletions(-)

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



diff --git a/README.md b/README.md
new file mode 100644
index 000..031bc27
--- /dev/null
+++ b/README.md
@@ -0,0 +1,50 @@
+This is an implementation of the DFU mode of the [USB DFU Device Class 
Specification](https://usb.org/document-library/device-firmware-upgrade-11-new-version-31-aug-2004)
 for the Microchip SAM D5x/E5x micro-controller.
+It is meant to be used as bootloader to allow flashing the main application 
over USB.
+
+The code has been developed for the Microchip [SAM E54 Xplained 
Pro](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNo/ATSAME54-XPRO)
 development board using a [SAM 
E54](https://www.microchip.com/wwwproducts/en/ATSAME54P20A) micro-controller.
+It should work on any chip of the SAM D5x/E5x device family by replacing the 
corresponding device-specific definitions (usually including the chip name in 
the file name).
+
+The code uses the [Atmel START](https://start.atmel.com/) ASFv4 library.
+
+USB DFU
+===
+
+This implementation support the following USB DFU capabilities:
+
+* can download: allowing to download the code over USB on the device (enabled 
per default)
+* manifestation tolerant: allowing to download after a previous download 
(disabled per default)
+* will detach: forcing the device the reset after a download, else it wit for 
a USB reset (enable per default)
+
+Set the corresponding attributes in the 'DFUD_IFACE_DESCB' macro definition in 
the 'usb/class/dfu/device/dfudf_desc.h' file.
+
+Compiling
+=
+
+Use the 'Makefile' script to compile the source code using the ARM none EABI 
GCC cross-cimpilig toolchain:
+```
+cd gcc
+make
+```
+
+The resulting firmware binary is `AtmelStart.bin`.
+
+Flashing
+
+
+To flash the bootloader you can either use the [edbg 
tool](https://github.com/ataradov/edbg) over the EDBG interface of the SAM E54 
Xplained Pro development board, or OpenICD with any SWJ adapter.
+
+The USB DFU bootloader should be flashed in a protected area of the flash 
memory to prevent for erasing it, as specified in data sheet section 25.6.2 
Memory Organization.
+The bootloader size is configured in the NVM user configuration BOOTPROT 
field, as specified in data sheet section 25.6.9 NVM User Configuration.
+The bit position of the BOOTPROT field is documented in data sheet section 9.4 
NVM User Page Mapping.
+We need to reserve as least 2 pages of 8192 bytes for the bootloader since it 
is a bit larger than 10 KB (e.g. over 8 KB).
+This setting will also tell the bootloader where to flash the application 
firmware to (e.g. after the bootloader reserved space).
+The LED will blink once per second if this size is not set.
+
+EDBG
+
+
+To flash the USB DFU bootloader, perform the following actions:
+* remove reserved bootloader space so we can erase it: `edbg --target 
atmel_cm4v2 --fuse wv,29:26,15`
+* erase the whole flash: `edbg --target atmel_cm4v2 --fuse v,29:26,15 --erase`
+* program the bootloader: `edbg --target atmel_cm4v2 --fuse v,29:26,15 
--program --verify --file AtmelStart.bin`
+* reserve bootloader space: `edbg --target atmel_cm4v2 --fuse wv,29:26,13`

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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If884bca373aab10fe74d16f42b79dd6685eeabcf
Gerrit-Change-Number: 12516
Gerrit-PatchSet: 3
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 


Change in osmo-asf4-dfu[master]: add button to force DFU bootloader

2019-01-17 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12593 )

Change subject: add button to force DFU bootloader
..

add button to force DFU bootloader

Change-Id: I163ab2de0fcbe13532c1992f6b78d49f4cda2d88
---
M atmel_start_pins.h
M driver_init.c
M usb_dfu_main.c
3 files changed, 12 insertions(+), 2 deletions(-)

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



diff --git a/atmel_start_pins.h b/atmel_start_pins.h
index 23b8d33..86e1dfb 100644
--- a/atmel_start_pins.h
+++ b/atmel_start_pins.h
@@ -27,9 +27,12 @@
 #define GPIO_PIN_FUNCTION_M 12
 #define GPIO_PIN_FUNCTION_N 13

-/** LED pin to indicate system state (pull low to switch on */
+/** LED pin to indicate system state (pull low to switch on) */
 #define LED_SYSTEM GPIO(GPIO_PORTC, 18)

+/** User button to force DFu bootloader (connected to ground when pressed) */
+#define BUTTON_FORCE_DFU GPIO(GPIO_PORTB, 31)
+
 /** USB D+/D- pins */
 #define PA24 GPIO(GPIO_PORTA, 24)
 #define PA25 GPIO(GPIO_PORTA, 25)
diff --git a/driver_init.c b/driver_init.c
index 0b07cc1..a91b0eb 100644
--- a/driver_init.c
+++ b/driver_init.c
@@ -148,6 +148,11 @@
gpio_set_pin_direction(LED_SYSTEM, GPIO_DIRECTION_OUT);
gpio_set_pin_function(LED_SYSTEM, GPIO_PIN_FUNCTION_OFF);

+   // configure force DFU user button
+   gpio_set_pin_direction(BUTTON_FORCE_DFU, GPIO_DIRECTION_IN);
+   gpio_set_pin_pull_mode(BUTTON_FORCE_DFU, GPIO_PULL_UP);
+   gpio_set_pin_function(BUTTON_FORCE_DFU, GPIO_PIN_FUNCTION_OFF);
+
USB_DEVICE_INSTANCE_init();
FLASH_0_init();
 }
diff --git a/usb_dfu_main.c b/usb_dfu_main.c
index 91748a5..449b311 100644
--- a/usb_dfu_main.c
+++ b/usb_dfu_main.c
@@ -48,6 +48,8 @@
  */
 static bool check_force_dfu(void)
 {
+   gpio_set_pin_pull_mode(BUTTON_FORCE_DFU, GPIO_PULL_UP); // pull button 
high
+   return (0 == gpio_get_pin_level(BUTTON_FORCE_DFU)); // signal is low 
when button is pressed
 }

 /** Check if the application is valid
@@ -87,7 +89,7 @@
delay_ms(500);
}
}
-   if (check_application()) { // application is valid
+   if (!check_force_dfu() && check_application()) { // application is valid
start_application(); // start application
} else {
usb_dfu(); // start DFU bootloader

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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I163ab2de0fcbe13532c1992f6b78d49f4cda2d88
Gerrit-Change-Number: 12593
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-asf4-dfu[master]: add button to force DFU bootloader

2019-01-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12593 )

Change subject: add button to force DFU bootloader
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I163ab2de0fcbe13532c1992f6b78d49f4cda2d88
Gerrit-Change-Number: 12593
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 17 Jan 2019 12:11:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


  1   2   >