osmo-bsc/src/libbsc
Neels Hofmeyr 8206f20f89 move init from gsm_bts_alloc_register() to gsm_bts_alloc(); fix gsm0408_test
gsm_bts_alloc() ought to do all static initialization, so that e.g. unit tests
can use an initialized bts struct that is fully usable, just not registered at
the gsm_network.

For example, two INIT_LLIST_HEAD() and various system information data pointers
(pointing to proper places within the same bts struct) should definitely never
be omitted.

This fixes the remaining errors of gsm0408_test's SI tests, as revealed by a
sanitizer build using gcc (Debian 7.3.0-12) 7.3.0.

Fixes:

  ../../../../src/osmo-bsc/src/libbsc/system_information.c:613:3: runtime error: null pointer passed as argument 1, which is declared to never be null

Initializing the bts->si_common.rach_control results in different expected
bytes for SI2. The initialized values are

  bts->si_common.rach_control.re = 1; /* no re-establishment */
  bts->si_common.rach_control.tx_integer = 9;  /* 12 slots spread - 217/115 slots delay */
  bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */
  bts->si_common.rach_control.t2 = 4; /* no emergency calls */

Causing a change to e5 04. 04 is t2 = 4, and the remaining values are verified by:

  uint8_t re :1,
           cell_bar :1,
           tx_integer :4,
           max_trans :2;

  >>> hex(1 + (9 << 2) + (3 << 6))
  '0xe5'

Change-Id: I13ef24bbe0f1fbe49465e67a0b67d6fd69fff3b1
2018-03-28 18:59:48 +02:00
..
Makefile.am introduce an osmo_fsm for gsm_subscriber_connection 2018-03-16 18:49:47 +00:00
a_reset.c a_reset: Add FSM event names 2018-03-01 23:08:15 +00:00
abis_nm.c cosmetic: abis_nm: use osmo_cell_global_id, parse 3-digit MNC 2018-03-22 04:13:09 +00:00
abis_nm_ipaccess.c move openbsc/* to repos root 2017-08-27 03:52:43 +02:00
abis_nm_vty.c vty: skip installing cmds now always installed by default 2017-11-01 00:48:52 +01:00
abis_om2000.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
abis_om2000_vty.c compiler warnings: drop some unused variables 2017-11-29 17:37:18 +00:00
abis_rsl.c introduce an osmo_fsm for gsm_subscriber_connection 2018-03-16 18:49:47 +00:00
acc_ramp.c Add support for Access Control Class ramping. 2018-02-27 14:29:39 +00:00
arfcn_range_encode.c range_enc_arfcns: avoid runtime error on zero size 2018-03-28 18:59:04 +02:00
bsc_api.c bssmap: State correct speech codec in ASSIGNMENT COMPLETE 2018-03-22 15:15:12 +00:00
bsc_ctrl_commands.c implement support for 3-digit MNC with leading zeros 2018-03-07 15:34:48 +00:00
bsc_ctrl_lookup.c Support control connection status query for a particular MSC. 2018-01-09 11:18:10 +00:00
bsc_dyn_ts.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
bsc_init.c implement support for 3-digit MNC with leading zeros 2018-03-07 15:34:48 +00:00
bsc_msc.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
bsc_rf_ctrl.c Make TRX rf locking more visible 2017-09-08 08:31:02 +00:00
bsc_rll.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
bsc_subscr_conn_fsm.c gscon: fix illegal state transitions 2018-03-27 11:31:47 +00:00
bsc_subscriber.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
bsc_vty.c bsc_vty: Fix uninitialized var false positive on gcc 7.3.1 2018-03-26 18:20:34 +02:00
bts_ericsson_rbs2000.c gsm_data: use feature list from libosmocore 2018-03-12 10:18:05 +00:00
bts_init.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
bts_ipaccess_nanobts.c gsm_data: use feature list from libosmocore 2018-03-12 10:18:05 +00:00
bts_ipaccess_nanobts_omlattr.c osmo-bts/nanobts: Set RACH_Busy Threshold to -90 dBm 2018-02-27 10:09:43 +01:00
bts_nokia_site.c libbsc: nokia_site: Fix uninitialized return val 2018-03-26 18:10:15 +02:00
bts_siemens_bs11.c gsm_data: use feature list from libosmocore 2018-03-12 10:18:05 +00:00
bts_sysmobts.c gsm_data: use feature list from libosmocore 2018-03-12 10:18:05 +00:00
bts_unknown.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
chan_alloc.c Add support for Access Control Class ramping. 2018-02-27 14:29:39 +00:00
e1_config.c Make RSL connection attempts time out. 2018-02-13 18:08:28 +01:00
gsm_04_08_utils.c RR: Send RR STATUS in case of unsupported/unknown message 2018-03-17 21:46:56 +01:00
gsm_04_80_utils.c move include/openbsc to include/osmocom/bsc 2017-09-06 16:26:13 +02:00
gsm_data.c move init from gsm_bts_alloc_register() to gsm_bts_alloc(); fix gsm0408_test 2018-03-28 18:59:48 +02:00
handover_cfg.c cosmetic: adjust copyrights on handover_cfg.c,_vty.c 2018-02-19 16:31:10 +00:00
handover_decision.c HO: introduce ho decision callbacks 2018-02-19 17:11:47 +01:00
handover_decision_2.c introduce an osmo_fsm for gsm_subscriber_connection 2018-03-16 18:49:47 +00:00
handover_logic.c introduce an osmo_fsm for gsm_subscriber_connection 2018-03-16 18:49:47 +00:00
handover_vty.c HO: vty: clearly mark 'handover foo' as legacy alias for 'handover1 foo' 2018-02-19 19:01:13 +01:00
meas_rep.c Fix: meas_rep.c will only use valid DL measurement reports 2018-01-21 19:06:58 +00:00
net_init.c implement support for 3-digit MNC with leading zeros 2018-03-07 15:34:48 +00:00
paging.c paging: paging_request_bts: Fix wrong return value 2018-03-26 18:33:35 +02:00
pcu_sock.c pcu_sock.c: Avoid breaking strict-aliasing on ptr derreference 2018-03-18 17:31:49 +00:00
penalty_timers.c HO: move penalty timers to own file as proper API 2018-02-16 16:11:16 +01:00
rest_octets.c Generate SI2bis Rest Octets 2017-12-12 18:00:56 +00:00
system_information.c sysinfo: Fix regression causing missing L2 Pseudo-Length in SI5/SI6 2018-03-12 00:28:58 +01:00