Commit Graph

6910 Commits

Author SHA1 Message Date
Harald Welte 117fa9d92d Bump version: 1.3.0.293-605c → 1.4.0
Change-Id: Iaedf16a3a03868c5ca6b1afe9fbac7b042905d51
2019-01-20 21:21:25 +01:00
Philipp Maier 605c7f074a 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
2019-01-17 15:52:25 +01:00
Max 17cbe5cd2d 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
2019-01-16 20:04:07 +01:00
Max 413846e655 Print BTS number on GPRS options error
Change-Id: Ia413bd1b375d874cd79a2bf06eb82477417ead1a
2019-01-14 13:44:20 +00:00
Philipp Maier f3ba4d7bd2 paging: fix nullpointer deref
In theroy the function T_def_get_entry() may return a nullpointer. In
this case we would run straight into a nullpointer dereference problem.
However, the requested timer is statically defined and should always be
there. However Coverity still reports this as a problem. Lets put an
OSMO_ASSERT to make clear that there is no problem here.

Fixes: CID#190403
Change-Id: If5238132d9d5a1507b9955a0b2dc4b1bced220e8
2019-01-14 09:06:52 +01:00
Neels Hofmeyr cf4a49b7b0 use mgcp-client configured endpoint domain name
Rationale: reading pcaps becomes so much easier when each of osmo-bsc and
osmo-msc address their MGW with differing domain names. Otherwise, both will
have a '0@mgw' endpoint and it gets really confusing.

After this, with according configuration, there can be a '0@bsc' and a '0@msc'
endpoint.

osmo-mgw-for-bsc.cfg:
 mgcp
  domain bsc

osmo-bsc.cfg:
 msc 0
  mgw endpoint-domain bsc

Depends: Ia662016f29dd8727d9c4626d726729641e21e1f8 (osmo-mgw)
Change-Id: I492023e9dca0233ec0a077032455d9f2e3880f78
2019-01-05 04:38:24 +01:00
Max f3bd838afc LCLS: use enum values instead of magic numbers
Change-Id: I3f49f74edb5400df1b13bb75da3d524f234c8d03
Related: OS#3659
2019-01-04 09:38:40 +00:00
Max 45867378f1 IPA: log OML/RSL link drop reason
There could multiple reason for OML or RSL link towards BTS to be
dropped: ctrl command, vty, new link etc. Introduce "reason" parameter
to corresponding functions and log it on link drop to simplify
troubleshooting issues with more complex setups.

Change-Id: I8c8d8132ba67c31e40dbecdfe2e09be08c744899
2019-01-03 19:10:58 +00:00
Neels Hofmeyr 38134eac8b comments: describe some lchan details
(requested by pespin)

Change-Id: I04ec4ce1fd2b7b110bb496186aae39ecfbbc3628
2018-12-21 03:02:27 +01:00
Neels Hofmeyr 700e518a6b make sure early lchan act failure resets the lchan
Fix crash after AMR configuration fails.

The crash is due to an assertion that finds a non-NULL conn in the lchan, when
re-using an lchan that has failed in AMR configuration earlier on. That is
because the AMR config still happens in state UNUSED.

  DCHAN ERROR lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: (type=TCH_F) lchan allocation failed in state UNUSED: Can not generate multirate configuration IE
  ...
  DCHAN DEBUG lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: (type=TCH_F) After failure handling, already in state UNUSED
  ...
  ...
  DCHAN DEBUG lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: Received Event LCHAN_EV_ACTIVATE (lchan_fsm.c:324)
  Assert failed !lchan->conn ../../../../src/osmo-bsc/src/osmo-bsc/lchan_fsm.c:491

The FSM design idea is that when returning to the UNUSED state, all lchan state
is cleared. However, when calling lchan_activate(), a failure may happen still
in state UNUSED, so that we don't transition *back* to UNUSED properly.

So, first transition out of UNUSED before failures can happen. (Other ways to
solve this would be to invoke lchan clearing even if already in UNUSED, but
semantically, transitioning first makes more sense.)

Upon LCHAN_EV_ACTIVATE, just remember the lchan_activate_info and transition to
WAIT_TS_READY, so that on lchan_fail(), we can normally transition back to
UNUSED and clear the lchan.

Move the initial lchan activation code to lchan_fsm_wait_ts_ready_onenter().

Also, there is a bit of duplication of members of the lchan->activate (lchan
state) and the lchan_activate_info (passed to lchan_activate()) structs. The
fix for this also removes the dup:

Add struct lchan_activate_info as child struct at lchan->activate.info, drop
the other lchan->activate members that would dup .info.*. Move struct
lchan_activate_info declaration to gsm_data.h.

Apply the new '.info' member struct throughout the code.

Related: OS#3737
Change-Id: Ide665b10fa3f4583059c55346db8da833959e3cc
2018-12-21 03:02:27 +01:00
Max 43c403af56 LCLS: log config/control update
Change-Id: Iac493014144ca0e5e1a83081e6e01ea7910deac2
2018-12-19 16:53:05 +01:00
Max fe65ece24c LCLS: update parameter representation
* use osmo_lcls struct from libosmocore
* use enum values instead of magic numbers

Change-Id: I5e962d4fbb24bf1fb2398dc13e142a4a3304d858
Related: OS#3659
2018-12-18 17:48:46 +00:00
Pau Espin 1cf21de48f Add VTY option to avoid sending empty Full BCCH Info for disabled SI
According to 3GPP TS 08.58 §8.5.1 BCCH INFORMATION:
"If the Full BCCH information element is not included this indicates that
transmission of the indicated SYSTEM INFORMATION message shall be stopped."

However, some ipaccess nanoBTS firmware versions are known to not support
some SI elements and also to dislike receiving BCCH Information for those SI,
even if received with empty BCCH Information meaning they should not be used.

Upon receival of this kind of message, nanoBTS sends a Failure Report
with following text:
Type=processing failure, Severity=critical failure, Probable cause=Manufacturer specific values: Fatal software error, Additional Text=l2_bch.c:1149
****
** l2_bch.c#1149:BCHbcchSItypeValid( prim_p->infoType )
** IPA_SW_FATAL_ERROR
** In task "TRX Proc:L2_BCH" @ (325).
****

This kind of issue only appears with some fw versions, since it's known
to work fine in other ones, so let's not disable this kind of mesage by
default on all BTs of type "nanobts".

Instead, add a VTY command that allows disabling this kind of message in
order to be able to operate those nanoBTS units.

Fixes: OS#3707
Change-Id: Idec1daabc21de4eea5c55edd1dbb0e0775720fc7
2018-12-14 20:06:37 +00:00
Pau Espin 1aea16f54f bsc: bssap: Set subscr log context during paging
Change-Id: I3998a35ff6ea29440882514bbb30cafed66f03fa
2018-12-12 00:58:40 +01:00
Pau Espin d5c7582f72 bsc: dtap: Set subscr log context
Change-Id: I362a7d10f5ca9a95b594f7caafd7ed5b10fd059a
2018-12-11 17:25:22 +01:00
Pau Espin 4e13309104 bsc: rsl: Set subscr log context during meas report
Change-Id: Idc6af592e870d15491797ae6fcaffaac2b411766
2018-12-11 17:02:15 +01:00
Pau Espin 26da3291d4 bsc: Set subscr log context during complete_layer3
Change-Id: I162a474f711248a3f64a0438967fa6f8a9a3e686
2018-12-11 17:02:15 +01:00
Pau Espin 8a8052e117 bsc_main: filter_fn: Compare imsi values instead of subscr pointers
Since we actually want to match by IMSI as specified by filter in VTY.
It will allow to match based on other information later.

Change-Id: Ia73fd2f38e42396db8f6d2cc6b2c163aa8f67f3f
2018-12-11 16:13:21 +01:00
Pau Espin a3acb30077 paging: Properly enclose logging imsi filter scope
Otherwise all logging is kept enabled after passing through those code
paths.

Change-Id: I06a977d97e6ffea02ec7402d48410c0e7cc6c155
2018-12-11 16:13:21 +01:00
Daniel Willmann 95739cf8cb VTY: Allow logging filter imsi statements for IMSIs we haven't seen yet
Limiting the logging filter only to IMSIs that we have as local
subscriber doesn't make sense for osmo-bsc since all subscribers are
initially unknown.

Create a bsc subscriber and enable logging there. This struct will then
be used and liked to the gsm_subscr_conn when receiving the Location
update.

Related: OS#3641
Change-Id: Ia20bdc15565417020205d7b2b06b04a01c03106c
2018-12-11 16:12:46 +01:00
Pau Espin b84fc49b1f paging: fix whitespace
Change-Id: I81c4a9f0dbd708df27a485ef764c9524a36d548a
2018-12-11 14:32:27 +01:00
Neels Hofmeyr 8f6eeb4a66 set gscon FSM instances' log level to DEBUG
Currently, we see all subscribers' FSM transitions on NOTICE level even though
the code uses LOGPFSML(LOGL_DEBUG), because LOGPFSML() uses the max loglevel of
the passed level and the FSM instance's level. Too noisy!

By default, start out all gscon FSM instances on DEBUG level, so it is possible
to silence the osmo-bsc log. Individual instances can still be lifted (I
presume using the CTRL interface?).

Change-Id: Ie021483e93ab174abac51357bcca8895756566c4
2018-12-09 17:12:32 +01:00
Philipp Maier 0a4d2e52af handover_fsm: send HANDOVER PERFORMED msg on internal ho
When an internal handover is done the specification demands to inform
the MSC about the event.

- Add sending of BSSMAP HANDOVER PERFORMED msg.

Change-Id: If26e5807280e0f75a423b3b04f8e3c698c82a351
Depends: libosmocore I825106858bd89afc9837811b8fed2e8accc82441
Related: OS#3645
2018-12-07 15:10:19 +01:00
Daniel Willmann 162626637f gsm_04_08: Free GSM subscr conn if paging response can't be matched
The current idea of calling gscon_release_lchans is not enough because
the conn is still present.
Insetad pretend we got a disconnect indication from the MSC which will
call gscon_release_lchans as well as terminate the conn state machine
which will clean up conn state as well.

Related: OS#3680
Change-Id: Iccf5f6864ffe238189907c4bb3ea333948621b4c
2018-12-06 19:51:21 +00:00
Oliver Smith 98483760e8 contrib: fix makedistcheck with disabled systemd
EXTRA_DIST files need to be distributed, no matter if the systemd option
is configured or not.

Change-Id: Ide5de9383a2a3b957d182dca1187f73dbf1ce982
2018-12-06 16:31:24 +00:00
Pau Espin 1b96334b26 paging: Add VTY options to calculate T3113 timeout dynamically
The idea is to have a base static value which is set like before "timer
t3113 [seconds]", but now have a part of this timeout calculated
dynamically based on BTS channel configuration and channel load.

This patch only implements initial support to calculate based on channel
configuration, but doesn't include code to calculate based on channel
load. To implement the later part, we probably need to keep track of BTS
paging queues per paging group, which we don't do nowadays.

Dynamic calculation is enabled by default, and default static base value
is decreased accordingly. This way, in a typical setup were the default
10 seconds were used, now the calculated final value is 11 seconds.
That's intended because it was observed experimentally in osmo-gsm-tester with
a similar channel setup that sometimes paging response can arrive slightly
later than 10 seconds.

Related: OS#3680
Change-Id: I4fb2969b690151415038631fb6ad059aa6835c7f
2018-12-05 19:40:23 +00:00
Pau Espin 4af2d18814 bsc: lchan_fsm: Fix invalid duplicated transition
When we enter WAIT_RLL_RTP_RELEASED
(lchan_fsm_wait_rll_rtp_released_onenter), we call lchan_do_release()
which in turn dispatches LCHAN_RTP_EV_RELEASE to lchan_rtp_fsm.c, which
will dispatch back an LCHAN_EV_RTP_RELEASED event, which will be handled
by lchan_fsm_wait_rll_rtp_released(), which will change state to
WAIT_BEFORE_RF_RELEASE. When going back the stack (return), we are still
in lchan_fsm_wait_rll_rtp_released_onenter() which again triggers a
change state to WAIT_BEFORE_RF_RELEASE because it checks same conditions
than first one.

20181128203727051 DCHAN osmo-bsc/lchan_fsm.c:1388 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{ESTABLISHED}: lchan detaches from conn SUBSCR_CONN(conn3)[0x612000002da0]
20181128203727051 DMSC osmo-bsc/lchan_fsm.c:1391 SUBSCR_CONN(conn3)[0x612000002da0]{CLEARING}: lchan lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0] detaches from conn
20181128203727051 DCHAN osmo-bsc/lchan_fsm.c:1359 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{ESTABLISHED}: state_chg to WAIT_RLL_RTP_RELEASED
20181128203727052 DCHAN osmo-bsc/lchan_fsm.c:959 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: (type=TCH_F) SAPI[0] = 1
20181128203727052 DRR osmo-bsc/gsm_04_08_rr.c:254 Sending Channel Release: Chan: Number: 0 Type: 2
20181128203727052 DCHAN osmo-bsc/lchan_fsm.c:945 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Received Event LCHAN_RTP_EV_RELEASE
20181128203727052 DCHAN osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
20181128203727052 DCHAN osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Removing from parent lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]
20181128203727052 DCHAN osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Freeing instance
20181128203727052 DCHAN fsm.c:381 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Deallocated
20181128203727052 DCHAN osmo-bsc/lchan_rtp_fsm.c:572 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: Received Event LCHAN_EV_RTP_RELEASED
20181128203727052 DCHAN osmo-bsc/lchan_fsm.c:856 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: (type=TCH_F) Still active SAPIs: 0
20181128203727052 DCHAN osmo-bsc/lchan_fsm.c:1011 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: state_chg to WAIT_BEFORE_RF_RELEASE
20181128203727052 DRSL osmo-bsc/abis_rsl.c:633 (bts=0,trx=0,ts=6,ss=0) DEACTivate SACCH CMD
20181128203727052 DCHAN osmo-bsc/lchan_fsm.c:986 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_BEFORE_RF_RELEASE}: transition to state WAIT_BEFORE_RF_RELEASE not permitted!

Change-Id: I5d95bbd8244cc8e9c1cfb6fe0f76148332386a3d
2018-12-05 16:06:47 +00:00
Pau Espin bbbc12148a bsc: timeslot_fsm: Handle and ignore tear down of lchan during PDCH DEACT
lchan sends TS_EV_LCHAN_UNUSED to its parent (ts) during release time. It
was experimentally found that it can happen that an lchan can be terminated
while waiting for a PDCH DEACT (N)ACK response.

The fsm definition actually states that this event can be received in
state TS_ST_WAIT_PDCH_DEACT, but it was not handled before and as a result the
process aborted due to the default switch case.

Change-Id: If61493e7d5449bf2c2de9fd34cdf2410625e92ac
2018-12-05 16:06:47 +00:00
Pau Espin 35b979cc0c bsc: lchan_fsm: Add missing transition WAIT_TS_READY->WAIT_RLL_RTP_RELEASED
20181128193707326 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Freeing instance
20181128193707327 DCHAN fsm.c:381 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Deallocated
20181128193707327 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_TS_READY}: Received Event LCHAN_EV_RTP_RELEASED
20181128193707330 DCHAN osmo-bsc/lchan_fsm.c:1347 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_TS_READY}: transition to state WAIT_RLL_RTP_RELEASED not permitted!

Change-Id: I43aab5ed8ac369869b191b3b7c938ce4985ab849
2018-12-05 16:06:47 +00:00
Pau Espin 96058f69fb bsc: lchan_rtp_fsm: Avoid duplicate LCHAN_EV_RTP_RELEASED event
When lchan_rtp_fsm instance is allcoated with
osmo_fsm_inst_alloc_child(..., LCHAN_EV_RTP_RELEASED) we already let fsm
code to take care of sending that event ito the parent when the fsm is
terminated (but only if freeing cause is not OSMO_FSM_TERM_PARENT).
The lchan_rtp_fsm cleanup() callback, which is called immediatelly before
sending to the parent the event defined during osmo_gsm_install_alloc_child(),
currently also sends that same event, which ends up in a duplicated
event being sent as shown in log files below.
Let's only send the event in cleanup() if we are in the
cause=OSMO_FSM_TERM_PARENT scenario, to make sure parent always receives the
event, but only once.

20181128193707326 DAS osmo-bsc/assignment_fsm.c:127 assignment(conn4_0-0-6-TCH_F_PDCHasPDCH-0)[0x6120000024a0]{WAIT_LCHAN_ACTIVE}: (bts=0,trx=0,ts=6,ss=0) Assignment failed
20181128193707326 DAS osmo-bsc/assignment_fsm.c:128 assignment(conn4_0-0-6-TCH_F_PDCHasPDCH-0)[0x6120000024a0]{WAIT_LCHAN_ACTIVE}: Terminating (cause = OSMO_FSM_TERM_ERROR)
20181128193707326 DAS osmo-bsc/assignment_fsm.c:128 assignment(conn4_0-0-6-TCH_F_PDCHasPDCH-0)[0x6120000024a0]{WAIT_LCHAN_ACTIVE}: Removing from parent SUBSCR_CONN(conn4)[0x612000002920]
20181128193707326 DCHAN osmo-bsc/lchan_fsm.c:1333 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Received Event LCHAN_RTP_EV_ROLLBACK
20181128193707326 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
20181128193707326 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Removing from parent lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]
20181128193707326 DRSL osmo-bsc/mgw_endpoint_fsm.c:441 mgw-endpoint(conn4)[0x6120000021a0]{WAIT_MGW_RESPONSE}: (rtpbridge/*@mgw) CI[0] to-BTS: DLCX :0: notify=NULL
20181128193707326 DRSL osmo-bsc/mgw_endpoint_fsm.c:482 mgw-endpoint(conn4)[0x6120000021a0]{WAIT_MGW_RESPONSE}: (rtpbridge/*@mgw) CI[0] to-BTS: DLCX :0: Scheduling
20181128193707326 DCHAN osmo-bsc/lchan_rtp_fsm.c:742 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_TS_READY}: Received Event LCHAN_EV_RTP_RELEASED
20181128193707326 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Freeing instance
20181128193707327 DCHAN fsm.c:381 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x612000002320]{WAIT_MGW_ENDPOINT_AVAILABLE}: Deallocated
20181128193707327 DCHAN osmo-bsc/lchan_rtp_fsm.c:193 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_TS_READY}: Received Event LCHAN_EV_RTP_RELEASED
20181128193707330 DCHAN osmo-bsc/lchan_fsm.c:1347 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_TS_READY}: transition to state WAIT_RLL_RTP_RELEASED not permitted!
20181128193707330 DAS osmo-bsc/assignment_fsm.c:128 assignment(conn4_0-0-6-TCH_F_PDCHasPDCH-0)[0x6120000024a0]{WAIT_LCHAN_ACTIVE}: Freeing instance
20181128193707330 DAS fsm.c:381 assignment(conn4_0-0-6-TCH_F_PDCHasPDCH-0)[0x6120000024a0]{WAIT_LCHAN_ACTIVE}: Deallocated

Change-Id: I3e95a21e5a5ec6c35b1ab20b7a642fd7eb81e556
2018-12-05 16:06:47 +00:00
Pau Espin ba4f66a31d bsc: timeslot_fsm: Fix count in ts_lchans_waiting
Before this patch, TCH lchans waiting for dynamic TS to
switch PDCH->TCH wouldn't be counted.

See osmo-bsc I9cedb77d6578597f1febab36c54b2ee427c7a4a2 for similar
extensive explanation.

Change-Id: I32008859cc23cd2afddd79daae21497d0945fed0
2018-12-05 16:06:47 +00:00
Pau Espin 4b856a5030 bsc: timeslot_fsm: Fix possible skip of some lchans in ts_terminate_lchan_fsms
If TS is in state changing from PDCH->TCH, the TCH lchan provoking the
switch would be skipped and not terminated before this patch.

See osmo-bsc I9cedb77d6578597f1febab36c54b2ee427c7a4a2 for similar
extensive explanation.

Change-Id: I9dc2a6e5b15376d049bd2ac5ddfa24340771b5c8
2018-12-05 16:06:47 +00:00
Pau Espin 674bcd53d0 bsc: ts_is_pchan_switching: Return correct IPA dyn TS target_pchan
Change-Id: Ie438b4efaa9832c44009a92c3df698875f1fa9ae
2018-12-05 16:06:47 +00:00
Pau Espin 3df6356555 bsc: timeslot_fsm: Fix ts_is_lchan_waiting_for_pchan
If ts_is_lchan_waiting_for_pchan() wasn't accounting for TCH lchans
waiting for TS to deactive PDCH in order to setup the TS as TCH.

Since now TCH lchan is catched by ts_is_lchan_waiting_for_pchan() when
TS state is TS_ST_WAIT_PDCH_DEACT, there's no need to check for that
case in caller ts_is_pchan_switching(), since it will never hit because
the callee returns true in that case now.

See osmo-bsc I9cedb77d6578597f1febab36c54b2ee427c7a4a2 for similar
extensive explanation.

Change-Id: Ib03e5a91438a5b74a04e69f81fab565842b02b66
2018-12-05 16:06:47 +00:00
Pau Espin 0502a0ee1b bsc: timelost_fsm: Remove unneeded set of out variable on failure
Documentation of the function explicitly states that the out
target_pchan param returns the "PCHAN waited for". If we return false,
then no PCHAN is being waited for. The 2 callers of this function only
use this out param if function returns true, so let's simplify the code.

Change-Id: Ib8f9b7e1f584dee885d6823dc043682577572bd8
2018-12-05 16:06:47 +00:00
Pau Espin 746dbc9fdd bsc: Fix lchan iteration for dyn TS during PDCH Deact
In general PDCH channels are not handled as lchans in BSC (lchan_fsm.c),
and so when a TS is in ts->pchan_is=GSM_PCHAN_PDCH, no lchan slot is
being used.

However, during Dynamic TS PDCH Deactivation being in progress (state
WAIT_PDCH_DEACT in timeslot_fsm.c), ts->pchan_is =GSM_PCHAN_PDCH, but
an lchan slot of that TS is actually already being used by a TCH lchan:
it's the one who initiated the deactivate in order to be able to use the TS.

While being in WAIT_PDCH_DEACT state and receiving a PDCH DEACT NACK,
ts_fsm_error() was called in order to kill the TS and it was expected
that it would kill any lchan using it (or willing to start using it). In
order to do that, it calls ts_lchans_dispatch() which in turns iterates
over all lchans attached to the TS using ts_for_each_lchan().

However, when the NACK arrived we still had ts->pchan_is=GSM_PCHAN_PDCH,
ts_for_each_lchan ends up calling
ts_as_pchan_for_each_lchan(GSM_PCHAN_PDCH), which in turns calls
pchan_subslots(GSM_PCHAN_PDCH) which returns 0, because we don't manage
lchans in that mode as explained in first paragraph. This means in this
case ts_for_each_lchan() is actually an empty loop while still any of
the TCH channels may be in use, and won't be advertised about the TS
entering in a broken state.

As a result, the lchan won't be released for a while, only after T23001
expires.

Related: OS#3708
Change-Id: I9cedb77d6578597f1febab36c54b2ee427c7a4a2
2018-12-05 16:06:47 +00:00
Pau Espin 0ba20df9ee bsc: Add define for ts_as_pchan_for_each_lchan with ts->pchan_on_init
It will be used further in follow-up patches. It also provides a place
to document its (intricate) logic around it and its possible uses.

Change-Id: Ia1d4bdbfca6b9719f54ee609b6bfadf7f3a4bb43
2018-12-05 16:06:47 +00:00
Oliver Smith ab9a259cd2 contrib/jenkins.sh: build and publish manuals
Add new environment variables WITH_MANUALS and PUBLISH to control if
the manuals should be built and uploaded. Describe all environment vars
on top of the file.

When WITH_MANUALS is set, install osmo-gsm-manuals like any other
dependency and add --enable-manuals to the configure flags (for "make"
and "make distcheck"). Add the bin subdir of the installed files to
PATH, so osmo-gsm-manuals-check-depends can be used by ./configure.

Related: OS#3385
Change-Id: Ief6ce94013612a968183e82abef421f116ed37c3
2018-12-05 13:09:11 +01:00
Oliver Smith b871da977b Fix DISTCHECK_CONFIGURE_FLAGS override
Set AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am instead of
DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from the
automake manual, as otherwise the flag can't be changed by the user
anymore.

Related: OS#3718
Change-Id: I38bd2bffa24c5b970aa4a42dcfc8d8766bb96046
2018-12-04 15:35:32 +01:00
Vadim Yanitskiy 0620b37189 osmo_bsc_bssap.c: fix incorrect link_id assignment
Every DTAP message coming from the MSC has a header (see struct
dtap_header) that contains message type, length, and link ID.
The link ID indicates SAPI and channel type of a given message.

In dtap_rcvmsg() we allocate a new message buffer and copy the
received message into it. The old message buffer is freed by
the caller then.

The link ID value parsed from DTAP header is usually being stored
in the control buffer of a message buffer (i.e. msgb->cb). Due to
a mistake, it was stored in the old (to be freed) message, while
the new (to be forwarded) message always had link_id = 0x00!

This change resolves the problem with sending SMS during a voice
call, when MT signalling goes through FACCH, while MO signalling
goes through SACCH.

Change-Id: I7675e1ce4436fad836778261ac9d446fa8f81483
Related: OS#3716
2018-12-01 22:06:40 +07:00
Neels Hofmeyr 24482ad4e2 follow-up: logging tweak for Immediate Assignment
follow-up to I9ad094d272254d7aee9b0a676201d4ed8cd727ca because it was merged
before fixeria's code review could be incorporated.

Change-Id: I474cf1a58d1f00ec5b0ae52bd095a60aad763975
2018-11-30 19:33:27 +01:00
Pau Espin 7ae0f9c271 bsc: ts_for_each_lchan: Improve documentation
Change-Id: Id7c050087c14aae3f01c6d41d21cf861ff53621c
2018-11-29 15:39:02 +00:00
Pau Espin d3e8e0cf4c bsc: ts_as_pchan_for_each_lchan: reorder and improve documentation
It is moved prior to its user in the header file.

Change-Id: I59f52401ba37b351ba3848e8e9ffb3b24c259496
2018-11-29 15:39:02 +00:00
Pau Espin d69b580b24 bsc: lchan_select: Avoid returning a TCH/H lchan when TCH/F is requested
If BTS is configured to have only TCH/F_PDCH and TCH/H and a call is
resolved to require TCH/F, don't return the TCH/H which have no use, but
instead let it allocate the TCH/F_PDCH.

20181128185013783 DRLL <0000> lchan_select.c:159 (bts=0) lchan_select_by_type(TCH_F)
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4,state=IN_USE) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=1,pchan=SDCCH8,state=UNUSED) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=2,pchan=TCH/H,state=UNUSED) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=3,pchan=TCH/H,state=UNUSED) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=4,pchan=TCH/H,state=UNUSED) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=5,pchan=TCH/H,state=UNUSED) is != TCH/F
20181128185013783 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=6,pchan_on_init=TCH/F_PDCH,pchan=PDCH,state=PDCH) is != TCH/F
20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/F: (bts=0,trx=0,ts=7,pchan_on_init=TCH/F_PDCH,pchan=PDCH,state=PDCH) is != TCH/F
20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/H: (bts=0,trx=0,ts=0,pchan=CCCH+SDCCH4,state=IN_USE) is != TCH/H
20181128185013784 DRLL <0000> lchan_select.c:71 looking for lchan TCH/H: (bts=0,trx=0,ts=1,pchan=SDCCH8,state=UNUSED) is != TCH/H
20181128185013784 DRLL <0000> lchan_select.c:86 looking for lchan TCH/H: (bts=0,trx=0,ts=2,pchan=TCH/H,state=UNUSED) ss=0 is available
20181128185013784 DCHAN <0010> lchan_select.c:253 lchan(0-0-2-TCH_H-0)[0x6120000066a0]{UNUSED}: (type=TCH_H) Selected

Change-Id: I9a73beb0432fab16d5430e5b40d470694e09b189
2018-11-28 19:12:55 +01:00
Pau Espin 4933048d3f cosmetic: bsc: timeslot_fsm: Clean uneeded scope brackets
Change-Id: I5140f98e23b8c8d16ce0cca0be66297aaf0b5653
2018-11-28 11:51:07 +00:00
Oliver Smith 686deafa48 build manuals included from osmo-gsm-manuals.git
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in local the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.

Related: OS#3385
Change-Id: I92c0f771d4ffc2b0401d26e25cb0b3817e6f95ea
2018-11-27 17:33:29 +01:00
Neels Hofmeyr 5c55d4933d Merge history from osmo-gsm-manuals.git
Change-Id: I9ff481784ba8c6334b1e57b1f64dfc9262e6d0e2
2018-11-27 17:32:17 +01:00
Oliver Smith 27683cbe13 copy NITB's osmobsc-usermanual.adoc to OsmoBSC
Includes from other projects don't work anymore when moving project
specific manuals into other repositories.

Related: OS#3385
Change-Id: I96933dd4dd6cac159847647f1c642215051a9aad
2018-11-27 17:12:40 +01:00
Neels Hofmeyr 39e1215cbc OsmoBSC: update VTY reference
Re-generate bsc_vty_reference.xml from osmo-bsc, including updates to:
- handover and neighbor config
- SCCP timers
- logging

Change-Id: Ia9ba8d5eba531b1156de57573ab42517e0c1ca15
2018-11-27 17:12:40 +01:00
Daniel Willmann 5397326b40 OsmoBSC/HLR/MSC: Fix default config file name
Mention that the default is not openbsc.cfg, but osmo-*.cfg

Change-Id: I139e6004e28d6f918f31792e634214a6153edd0e
2018-11-27 17:12:40 +01:00