aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_grace.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-28large refactoring: use FSMs for lchans; add inter-BSC HONeels Hofmeyr1-1/+2
Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-01-16Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c.Stefan Sperling1-43/+4
We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. The purpose of this change is to make the layering a bit cleaner. There is one functional change: We no longer abort paging if paging fails for a particular BTS. Instead, we keep trying to page on other BTS. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753
2018-01-15Implement support for paging based on CI (cell identifier).Stefan Sperling1-21/+39
This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run in isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753
2017-12-11paging: Remove obsolete paging call-back supportHarald Welte1-3/+3
The call-back was needed inside the NITB to determine which part (CC, SMS, ...) had triggered a given paging. A pure BSC doesn't need that feature, so let's get rid of it. The 'void *cbfn_data' is replaced with a 'struct bsc_msc_data *', as all callers use it with that type. Change-Id: I8839e8338d3ad1a91b41e687e8412fcdca3fd9ab
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr1-7/+7
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-08-27move openbsc/* to repos rootNeels Hofmeyr1-0/+169
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7