aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
AgeCommit message (Collapse)AuthorFilesLines
2020-10-07LCS: SCCP next conn id: prepare Lb-interfaceNeels Hofmeyr3-24/+59
When adding the Lb interface, it is necessary to determine an unused conn id across *all* SCCP users. Prepare adding Lb by moving conn id creation out of the gscon code and generalizing. Change-Id: I12fcb18f6e4380f72929cfe7681bac05330a8c9a
2020-10-07LCS: implement re-use of existing A-interface connNeels Hofmeyr2-23/+68
Location Services brings a new scenario to OsmoBSC: the MSC may create an A-interface conn for a subscriber without an lchan being established (N-CONNECT from MSC to BSC, so far only for an incoming inter-BSC handover). If an MS becomes active while an A-interface conn is already established, associate with an existing conn. Change-Id: I42290f519a419ed7e8dd02a5ed0a5261b30a51e6
2020-10-07cosmetic: fix naming of GSCON_EV_A_CONN_REQ -> GSCON_EV_MO_COMPL_L3Neels Hofmeyr2-4/+4
The N-CONNECT.req on the A interface is a possible *consequence* of the event being handled, namely the incoming RSL ESTablish INDication containing the Complete Layer 3 message: dispatched by bsc_compl_l3(). If an (LCS related) connection is already present on the A-interface when the lchan is established, there will be no N-CONNECT but an N-DATA sending the Complete Layer 3. See BSC_Tests.TC_cm_service_during_lcs_loc_req(). Change-Id: Ic43aabeb0d3c58ac62249ad9d3718363d32508f9
2020-10-07bsc_subscr_name: print both IMSI and TMSINeels Hofmeyr1-17/+23
Always use a format containing only osmo_identifier_valid() characters. Change-Id: I6cdbaad2f0d0552f697440bf9a75bef36d59a597
2020-10-07introduce osmo_use_count for bsc_subscrNeels Hofmeyr6-56/+93
During LCS development, I'm getting use count bugs and would like to see use token strings to figure it out. Change-Id: I29bf60059d4cf7bb99a00753e6cdc149baf95f94
2020-10-07LCS: add paging reason, return in paging_request_stop()Neels Hofmeyr3-26/+48
To distinguish between the CN requiring a Complete Layer 3 response, or just the BSC requiring a TA, allow recording a separate for-LCS paging reason. Change-Id: Ib28d1599ae4e483727398859d07de4490fbc31f0
2020-10-07refactor paging: add bsc_subscr to bsc_paging_paramsNeels Hofmeyr2-24/+19
Get a bsub once at start of paging. Change-Id: I13621cd51d934846ff6556e1f2f8839da73a5dbb
2020-10-07refactor paging: introduce bsc_paging_start()Neels Hofmeyr1-3/+6
Allow starting a paging from elsewhere than a BSSMAP Paging Request. For upcoming Location Services (LCS), a BSSLAP TA Request from the SMLC may require triggering a Paging. Change-Id: Iaff91584699d163bd1963927280ff3a8ddd43073
2020-10-07refactor paging: introduce bsc_paging_paramsNeels Hofmeyr2-107/+91
For LCS, I would like to add an enum indicating the paging reason. Instead of modifying extremely many function signatures to pass the reason across all levels of paging, introduce a struct combining these. Change-Id: I27ca78fc6ff8ef1101554c0a8429e34945ca6f3c
2020-10-07compl l3: move all message parsing out of bsc_find_msc()Neels Hofmeyr1-23/+10
I lost count of how many times the gsm48_hdr got parsed from the msg in the same compl l3 code path. Here is one less. Change-Id: I9f15b3e5e7352ef90b4598dadf2ebc0d2665f069
2020-10-07compl l3: move Paging Response handling out of bsc_find_msc()Neels Hofmeyr2-110/+61
Instead of iterating the llist of gsm_paging_requests first to find an MSC, and then again right away to mark the paging as served, do both in the same step. Change-Id: I447e61afc9934f3a5a82f6076e41c155d3328041
2020-10-07compl l3: populate conn's bsc subscr from MINeels Hofmeyr2-5/+7
Set conn->bsub as indicated by the Mobile Identity. Now the 'log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);' becomes useful. Upcoming patch to support Perform Location Request will use the subscriber to retrieve an already established conn via the bsub. Drop fixme in gscon_fsm_init(), MI now extracted and id updated. Change-Id: I00d4c7e8284b745368a432a7ec176aa99f79db47
2020-10-07compl l3: allocate conn in gsm_08_08.c, not gsm_04_08_rr.cNeels Hofmeyr2-16/+18
Move conn allocation to bsc_compl_l3(), from gsm0408_rcvmsg(). Drop dispatch of GSCON_EV_A_DISC_IND, because a) we did not receive such DISC.IND, and b) the lchan release will discard the conn in the regular fashion. In upcoming LCS patch, bsc_compl_l3() will decide whether to allocate a new conn or whether a conn from a Perform Location Request already exists for the subscriber. In this patch, it becomes clear that the conn->bsub is always NULL in bsc_compl_l3(), and that the 'log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);' never has the intended effect. An upcoming patch will change that. Change-Id: I92af0f0d54c4282d782f2b29d524a64006c3b674
2020-10-07compl l3: cosmetics around Create Layer 3Neels Hofmeyr1-24/+26
Move getting the CGI closer to where it is used. Use a use_scl pointer to remove a bit of code dup. Drop logging for tx Compl L3, there is plenty logging later in osmo_bsc_sigtran_open_conn(). This cosmetically prepares future changes for LCS handling. Change-Id: If7a7d0fe857797d569968e694bf20818d7472bcd
2020-10-07compl l3: parse Mobile Identity onceNeels Hofmeyr1-28/+27
Move two calls of osmo_mobile_identity_decode_from_l3() from bsc_find_msc() and handle_page_resp() out into a single call in bsc_compl_l3(). Prepares cosmetically for upcoming LCS patch. Change-Id: I26950b63621417da0ed3125d0dc0b06cf015cb4a
2020-10-07compl l3: separate paging handling from bsc_scan_bts_msg()Neels Hofmeyr1-77/+53
bsc_scan_bts_msg() essentially updates the MS power class for LU and CM Service, and also stops the paging and counts the response for a Paging Response. Separate that. Reduce code dup by one common parse_power_cap() function for both LU and CM Service. Call handle_page_resp() separately. (Upcoming patches will add more reasons to read the gsm48_hdr's pdisc and mtype in bsc_compl_l3().) Change-Id: If14284494c74a396fabebd79da8079342e65dcc2
2020-10-07gscon_bssmap_clear(): guard against NULL mscNeels Hofmeyr1-0/+6
Change-Id: I95b16cebb6ff78649f72a09b5d6c7c7e403233fa
2020-10-07bsc_vty: parse the return code to make coverity happyAlexander Couzens1-2/+2
The missing return code isn't a problem atm because remote.af is checked and remote.af is only set when osmo_Sockaddr_str_from_sockaddr() returns success. However check the return code to be safe also in the future. Found-by: Coverity Fixes: CID#214863 Change-Id: I621360cab1e12c22248e33d62a9929995053ce04
2020-10-07bsc_vty: cfg_bts_gprs_nsvc_rip: add missing breaksAlexander Couzens1-0/+2
Found-by: Coverity Fixes: CID#214862 Change-Id: I0966bfd3948fef4dd2a4465aae0927bff6437e43
2020-10-05pcuif_proto: version 10: add support for IPv6 NSVCsAlexander Couzens1-9/+17
Introduce a address_type in the NSVC configuration pass the given protocol. The remote_ip is network byte order, the default encoding for in_addr and in6_addr. Related: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973 Related: SYS#4915 Change-Id: I740be0a401612bb5ed4e8ccd7f4be8176b936449
2020-10-05pcuif_proto: version 10: add frequency hopping parametersAlexander Couzens1-10/+29
Related: SYS#4868, OS#4546, OS#4547 Change-Id: I5540fae66a116cbb25ec75b35145c36137146ffd
2020-10-05oml: encode IPv6 NSVC using the new OML attribute NM_ATT_OSMO_NS_LINK_CFGAlexander Couzens5-21/+86
The old IE NM_ATT_IPACC_NS_LINK_CFG didn't support IPv6 NSVC. Depends: Ic261bc43a07fa741b97a9c6ec5a9ed6f5ecae588 (libosmocore) Depends: I9e279bb20940c66eea5196f281184cb4f8a5cc5f (libosmocore) Change-Id: I6529876a3c1116a79dd624312243d8ae48a41fe2
2020-10-05ipa oml: tx OPSTART after unlocking, not beforePau Espin Pedrol1-4/+4
According to TS 12.21, when adminsitratively Locking an object, in general it should go into operative state Disabled. We don't really implement it this way right now, but keep it this way consistent in all objects. Furthermore, TS 12.21. Figure 2 describes vaguely that unlock procedure is done around same time where object attributes are set, which is before OPSTART. Change-Id: Icd4b3bb467f23c9ddfa56f6b6f8a55da1e574ab8
2020-10-03pcu_sock: use tn as variable name to improve readabilityAlexander Couzens1-6/+6
Same as used in osmo-bts Change-Id: I5c8cf0e2d29fa4999983293401294ee0a94bfa30
2020-10-03log MSC nr for opening new A connNeels Hofmeyr1-2/+2
Change-Id: Ie2df767197947b2d5ffeb882dc0827914975df88
2020-10-02abis_nm: Remove duplicated log linePau Espin Pedrol1-1/+0
Change-Id: I52ff3c7457ca9985bb4936a6ec48abe0aee07e71
2020-10-02abis_nm: Log no state change detectedPau Espin Pedrol1-1/+3
Change-Id: I15695b18ad7b31c2f9579813b76ecee36cce4ede
2020-09-30abis_nm: Log Rx Change Administrative State ACKPau Espin Pedrol1-0/+3
Change-Id: I165138634b1fdb982197afdac6d2d00a4d1e4074
2020-09-28vty: fix unreacheable code / wrong check in lchan_act_all_trx()Vadim Yanitskiy1-1/+1
Change-Id: If7d8a108a147980d26b71836343d20b1b0b95579 Fixes: CID#214277
2020-09-23bssap: Use new DTAP DLCI helper fields from libosmocorePau Espin Pedrol1-1/+1
This is the only place where the entire dtap header is passed, where the split between SAPI and CHAN is done. Other places in osmo-bsc pass around a link_id integer containing everything, so leaving that out of the scope for this patch. The gsm0406_dlci_sapi_name() API was introduced in libosmocore 1.3.0, and osmo-bsc currently requires libosmocore 1.4.0, so it means we are not further restricting libosmocore dependency here by using it. Change-Id: Ib72e2bda46e39d1075e4270ac5fa51df2f418164
2020-09-21abis_nm: abis_nm_perform_test: fix a potential null derefAlexander Couzens1-1/+4
gcc 10.2.0 warns msgb can be a deref because nm_msgb_alloc() can fail with null. Change-Id: I4b0e4cd15046272e026cd74c14cbf2972ef6a070
2020-09-20oml: Fix premature Opstart to Radio CarrierPau Espin Pedrol2-9/+29
During the A-bis/OML bootstrapping, osmo-bsc sends Opstart to the Radio Carrier MO twice. The first Opstart is triggered by the State Changed Event Report, originated by the Radio Carrier itself. The second is triggered by Software Activated Report. According to 3GPP TS 12.21, figure 2, we shall send it only once, after the "Attribute setting" step. Therefore, the first Opstart is premature, and we shall not send it. Related: SYS#5063, OS#4755 Change-Id: If69393551117266ecb726d8961153560b2b3cc59
2020-09-18bsc_vty: fix wrong else-if statementPhilipp Maier1-1/+2
Related: CID#214331 Change-Id: I1b0f324a66757278f7c95d25a5192d4234432a6b
2020-09-18lchan_fsm, lchan_rtp_fsm: make all timers configurableOliver Smith3-6/+12
Choose saner timer numbers before exposing to the user config. Related: SYS#4897 Change-Id: I637fcdde93c11158de46157d494c060bb36bdcfb
2020-09-18clean up timer definitions: introduce groups, move some T to XNeels Hofmeyr4-22/+54
Backwards compatibly, introduce timer groups in OsmoBSC, and move some non-specified T timers to new X timers: T993111 -> X3111 T993210 -> X3210 T999 -> X4 Why X4? because there already is an X3 used elsewhere in Osmocom, and I find it less confusing if X-numbers don't repeat across programs. See https://osmocom.org/projects/cellular-infrastructure/wiki/List_of_Timer_numbers Drop unused timers from g_mgw_tdefs. Only X2427 has an actual effect. (libosmo-mgcp-client recently moved T2427001 to X2427.) Put libosmo-mgcp-client related timers to the 'mgw' group, like in osmo-msc. This makes the MGCP timeout configurable for the first time. Keep previous timer commands as DEFUN_HIDDEN, and also translate the moved T timers to X timers on-the-fly. All previous VTY commands still work, and new 'timer [(net|mgw)] ...' commands are added. timer.vty shows this. Remove the "_OPTIONAL" from the legacy "timer" and "show timer" commands, so that they don't ambiguously overload the new "timer [(net|mgw)] ..." commands. Related: OS#4539 Related: If097f52701fd81f29bcca1d252f4fb4fca8a04f7 (osmo-mgw) Change-Id: I4beec47502afa193dee343869c4be55dc6a4b536
2020-09-17bsc_vty: fix manual channel activationPhilipp Maier2-92/+97
The manual channel activation work in a very hackish way by sending the CHANNAL ACTIVATION message manually using rsl_tx_chan_activ(). This means the channel activation is not under FSM control. Also switchover of dynamic channels does not work. The lchan_fsm supports an activ_for in its activation info struct. The header files define a "FOR_VTY" enum value there. However, the lchan_fsm is not yet prepared to handle this. Lets update the lchan_fsm so that FOR_VTY is supported and change bsc_vty to use lchan_activate() instead of calling rsl_tx_chan_activ() directly. This will give us real channel activation under FSM control. Change-Id: Iffc57b7a5b7bdde06d392267791fd908e80bbb5d Related: SYS#4910
2020-09-17osmo-bsc: fix a crash when receiving a RACH LOAD IND with 0Alexander Couzens1-2/+8
Change-Id: Ia395d4ec70107688856ef0cd5daa6124a7da834b
2020-09-17generate_ma_for_ts(): simplify MA bit-mask computationVadim Yanitskiy1-10/+7
Instead of maintaining two variables and re-calculating the bit position on each iteration, let's use the existing field of the bit-vector: set it to the first LSB and decrement in the loop. Change-Id: I1b226a2d5867434c33ae04a0b971dbfd16c4688f Related: SYS#4868, OS#4545
2020-09-17abis_nm: improve logging message in abis_nm_get_attr()Vadim Yanitskiy1-4/+5
Change-Id: I10ef08e7d01ed27e05ef30c0bb876c0197a30500
2020-09-17abis_nm: use LOGPFOH()/DEBUGPFOH() in parse_attr_resp_info_unreported()Vadim Yanitskiy1-7/+10
Change-Id: Ib0c95c6c52122de06fa164f7a5fcb09ec7ad384a
2020-09-16drop unused Tdef for 992427Neels Hofmeyr1-1/+0
Change-Id: I22a18662392545ba69f48e7fd8474c7c06d529cb
2020-09-16drop bsc_subscr.lacNeels Hofmeyr2-4/+3
It does not make sense to set the bsc_subscr's LAC from a Paging Request, especially since the paging code has loops that possibly kick off several pagings. At this point, there remains no code setting bsub->lac anywhere. We could set it during rx of Complete Layer 3, but since there is no use for it besides a vty dump, let's just drop the bsub->lac completely, and the vty dump of it. Change-Id: Id017bd494d329b6fc254d7135b4074ac2b224d66
2020-09-16dissolve bsc_grace_paging_request()Neels Hofmeyr2-40/+6
RF-locking: simply ask bsc_grace_allow_new_connection() at the start of page_subscriber(). Before this patch, we would log an INFO of "Paging request failed" when RF-locked, for each BTS. Instead log "RF-locked". (An upcoming patch will introduce a LOG_PAGING() macro that will trivially add more log context there, so not bothering now.) Drop LAC condition: since Stefan introduced page_subscriber() starting 2018 Ic3c62ff0fccea586794ea4b3c275a0685cc9326e, matching a requested LAC to a specific BTS is done *before* calling page_subscriber(). BTW: the msc->core_lac (config 'core-location-area-code') has not had an effect on Paging maybe ever. I opened OS#4751. Change-Id: Ic8696414a1db8f4b1be502d6434599f684746ed6
2020-09-15abis_nm: use DEBUGPFOH() in abis_nm_rx_sw_act_req()Vadim Yanitskiy1-1/+1
Change-Id: Ib148a451edee88350f09895a85a9d1bc03f3ac00
2020-09-15abis_nm: use btstype2str() in abis_nm_rcvmsg_manuf()Vadim Yanitskiy1-1/+1
Change-Id: I6858480fb8343a4862601ef48ff1778c4e4b0275
2020-09-15abis_nm: abis_nm_get_ts(): use LOGPFOH() instead of generic LOGP()Vadim Yanitskiy1-4/+2
Change-Id: I510506a5b2c9493d3473dd2b0fcb16a90aeb8c21
2020-09-15abis_nm: LOGPFOH()/DEBUGPFOH(): remove redundant context infoVadim Yanitskiy1-22/+17
Change-Id: I3531a0da3c64aea8bf4df5ffa1d8768f7e70c87b
2020-09-15abis_nm: fix msgb memleak in _abis_nm_sendmsg()Vadim Yanitskiy1-0/+1
Change-Id: I8e9c5d32e9bc43c760cb71efb8cab4982a305f0e
2020-09-15abis_nm: fix erroneous use of LOGPC() instead of LOGP()Vadim Yanitskiy1-3/+3
Change-Id: I8b6f791e423d1f7fcdabcaaaab48fc9586c1dc7b
2020-09-15gsm 04.08: correct calculate the Cell Selection Indicator after release of ↵Alexander Couzens1-4/+4
all TCH and SDCCH When the measurement bandwidth was added the calculation of the maximum length wasn't increased. Fixes: 27a887f666ad ("gsm 04.08: encode the LTE neighbors measurement bandwindth in Channel Release") Change-Id: Ic8132fd988140c34b8e0fd8349f4518fcbaecc31