aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-02-22Use ALPHA value received in SI13 from PCUIFPau Espin Pedrol7-11/+37
The old VTY command is marked as deprecated and still overrides the use in case it's used. Related: SYS#5358 Depends: libosmocore.git Change-Id I74fb0a3afc1ac4aadbfc609b882d929401f790eb Depends: osmo-bsc.git Change-Id I8b97ea11bad5fe05f2f634945b5703ee9abde81d Change-Id: I46f2a955b157a409055fca7fb917dc4f75482426
2021-02-19find_multi_slots: Avoid multiple calls to mslot_class_get_type()Pau Espin Pedrol1-3/+4
Change-Id: I9cda52befe32a7727ab479bc151d10106fb94688
2021-02-19find_multi_slots: Mark mslot_class properties constPau Espin Pedrol1-4/+4
This way it's clear for reader that those variables are never touched during the function. Change-Id: Ief038c75bc02d0e987135f29599014eab88447dd
2021-02-19find_multi_slots: Avoid multiple calls to mslot_class_get_rx()Pau Espin Pedrol1-3/+4
Change-Id: I06c97d81636e251f81c26f3aa042c70717be083a
2021-02-19find_multi_slots: Avoid calling mslot_class_get_tx() on each iterationPau Espin Pedrol1-1/+1
Change-Id: I397495c158bce1c2715991371368b0d84cf69261
2021-02-19Use NULL as default value for pointer typePau Espin Pedrol1-1/+1
Using zero there is confusing since it's a pointer to an integer. Change-Id: Ief2368954c71005c529e3eea3fee5df2630e44c1
2021-02-19gprs_bssgp: use gprs_ns2_sns_add_bind() to allow the NSE to use the binds ↵Alexander Couzens1-0/+8
for IP-SNS configuration The gprs_ns2 now requires to specify every bind which should be used by the NSE for IP-SNS Related: SYS#5354 Depends: I9ab8092bf286e7d90e92f5702a5404425e959c84 (libosmocore) Change-Id: I35c987224ce098f7ee9f189ce0fce9e68ad3feac
2021-02-18sched: Avoid selecting TBF to tx NACC Dl msg if no TFI is assignedPau Espin Pedrol1-4/+4
The DL NACC related message (PKT Cell Neighbor Data/Change Continue) are filled with the TFI of the target TBF. Hence, only select the tbf for NACC transmission if the related TBF already has a TFI assigned. Otherwise, "OSMO_ASSERT(tbf_is_tfi_assigned(tbf));" in nacc_fsm.c when generating messages may be hit. Related: SYS#4909 Change-Id: I72b2dff28aacdb04909c098c94834ff79f55b31d
2021-02-18cosmetic: fix line indentationPau Espin Pedrol1-1/+1
Change-Id: Ia8335ce5c005885e4db1864faf775c4bff509c53
2021-02-17vty: Write 'neighbor resolution' config to filePau Espin Pedrol1-0/+5
Fixes: c0a250d17d79e08763f77cdf58e970dc2e65e7d3 Related: SYS#4909 Change-Id: I44eef3826939e05ba88e0c5a67e1fef535582ba7
2021-02-16gprs_bssgp: rename gprs_ns_config -> gprs_ns_update_configAlexander Couzens3-6/+7
Improve the naming of the function to match it's purpose. Related: SYS#5354 Change-Id: Ib8e4ae734503fd6f6695d9d6767d809e1bf79d22
2021-02-16gprs_bssgp: rework and rename ns_create_nsvc -> ns_configure_nseAlexander Couzens1-26/+40
Add support for multiple SNS endpoints. Move the NSE allocation to the top in preparation of IP-SNS binds. The future gprs_ns2 library will require to manual add every bind to the NSE for IP-SNS. Rename the function to match more it's purpose. Related: SYS#5354 Change-Id: I69cf48ab168a6dca4f649157bf6556d7cd27d4fb
2021-02-15nacc_fsm: Improve log when sending RIM RAN-INFO to gather SI from remote cellPau Espin Pedrol1-1/+4
Change-Id: I6972f46f0f3223ce00672178e5610bd3a012fb19
2021-02-11nacc_fsm: Support receiving Pkt Cell Chg Notif while in some advanced statesPau Espin Pedrol1-3/+31
Related: SYS#4909 Change-Id: Iee9cb67bf2c0c6f36b788498f4ef2672e33204b7
2021-02-11nacc_fsm: nacc_fsm: Support receiving Pkt Cell Change Notify in state ↵Pau Espin Pedrol1-16/+32
WAIT_REQUEST_SI Similar to what's done in the previous commit, but this time when we are further forward in the resolution process. This can be triggered for instance because we are taking too much time to resolve and MS has timer to retransmit the Pkt cell Change Notify in case no response was received in time. This commit fixes osmo-pcu exiting due to ASSERT(0) since the event was already accepted but not being handled in the state function. Related: SYS#4909 Change-Id: I0c29e5979fec6eebe9dfb151907a4cd2f5e4a737
2021-02-11nacc_fsm: Support receiving Pkt Cell Change Notify in state WAIT_RESOLVE_RAC_CIPau Espin Pedrol3-21/+62
If the message is a duplicate (same tgt cell), simply ignore it. If the message contains a different tgt cell, restart the resolution: * Avoid re-creating the socket in that case * Avoid potentially picking a CTRL response for an older request Related: SYS#4909 Change-Id: Ia2ed2580bbbdd6d3464833257b0dcb8ec6f8d699
2021-02-11nacc_fsm: Remove NACC_EV_RX_SI from in_event_mask of some statesPau Espin Pedrol1-2/+0
We don't care about those messages anymore if we already transitioned further than NACC_ST_WAIT_REQUEST_SI. Furthermore, RIM code dispatching the event to the FSM is only doing it in the mentioned state above. Related: SYS#4909 Change-Id: If420b49e437ff02073669522408763e5e84fe477
2021-02-11nacc_fsm: Move code filling struct to helper functionPau Espin Pedrol1-10/+19
Same filler will be needed in different places since that message can arrive at different points of time (different states). It also helps supporting newer key types in the future. Change-Id: Idfd4db8408f767b1847b04c88047a1c4996e543e
2021-02-08cosmetic: fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: I5a384985ef54234e915bf6334125f8d087988d1d
2021-02-05vty: register libosmocore's FSM introspection commandsVadim Yanitskiy1-0/+1
Change-Id: Id268e44de6eb873138f38720a61cabe589a5d2c8
2021-02-04rlc.h: Fix struct bit fields on big endian systemsPau Espin Pedrol1-4/+24
Related: OS#5003 Change-Id: I534539cdf197ce5c038752a177aff7efeefc9883
2021-02-03nacc: Avoid RIM procedures targeting cells under same PCUPau Espin Pedrol1-0/+41
Now that we have the required System Information in osmo-pcu to craft the Packet Neigbour Cell Change packet for cells it controls, let's avoid starting a RIM procedure to gather the SI info, since the SGSN would end up routing the RIM request back at us and we'd answer back to ourselves. This same optimization cannot be done on the first step (CTRL Neighbor Resolution against BSC), because the PCU cannot know if the target ARFCN+BSIC requested by the MS is actually managed by a cell under the PCU or it's another cell managed by another external PCU, because ARFCN+BSIC keys can be resued among non-neighbor cells. Hence, it shall always ask the BSC since only it holds the information about neighboring cells. Related: OS#4909 Change-Id: I928875b6b66dff55fc12f51b6b1ad919fef7d03b
2021-02-03nacc: Implement Pkt Cell Change Continue retransmissionPau Espin Pedrol10-17/+105
Use the fact that the MS must answer the RRBP of the Pkt Cell Change Continue with a CTRL ACK to find out whether the message was received successfuly or a retransmission is potentially required. 3GPP TS 44.060: """ When the mobile station receives the PACKET CELL CHANGE ORDER or the PACKET CELL CHANGE CONTINUE message the mobile station shall transmit a PACKET CONTROL ACKNOWLEDGMENT message in the specified uplink radio block if a valid RRBP field is received as part of the message; the mobile station may then switch to a new cell. """ Related: SYS#4909 Change-Id: I7cc28922e71699598da0ef6eb90136a47d3c002f
2021-02-02gprs_bssgp_rim: add serving BSS NACC applicationPhilipp Maier3-13/+131
Answer an incoming RAN INFORMATION REQUEST RIM PDU with RAN INFORMATION PDU that contains system information type 1, 3 and 13 Depends: osmo-bts I5138ab183793e7eee4dc494318d984e9f1f56932 Change-Id: Id72118120c14984d2fb1b918b41fac4868150d41 Related: SYS#5103
2021-02-01nacc: Fix typo in function namePau Espin Pedrol1-3/+3
Change-Id: I74857eacf4664508dce70eb0c6dd2acd7bfb72e4
2021-02-01tbf: Constify some methodsPau Espin Pedrol2-4/+4
Change-Id: I2681a98583f4fb26a274c75d0279084239f76a68
2021-02-01tbf: Reuse stored result in variable in check_polling()Pau Espin Pedrol1-1/+1
Change-Id: Ie6fbe3699bcb4f63f7b617243c769e60881d8aac
2021-02-01encoding: Fix comment description of S/P fieldPau Espin Pedrol1-2/+2
Those fields were ment to be 0 (non-valid), just the comments were copied over from somewhere else, and they are misleading. Change-Id: Ic95853e115f60c65f7f11187d49d6e870d08c7bb
2021-02-01Move src/tbf.txt to doc/Pau Espin Pedrol1-161/+0
At least there it will pass less unnoticed, I just discovered this file by chance. Change-Id: I65a443ae498ae4c5e837e5a069fd87863f259152
2021-02-01Drop comment about an already implemented TODOPau Espin Pedrol1-1/+0
The comment target is already implemented just above it. Change-Id: I05534bbbad24ad8ba602244b834cdbadcabcc7ec
2021-02-01Update TS 04.60 references to new TS 44.060Pau Espin Pedrol2-4/+4
Change-Id: Ib7c3a74b502b2251da2f7b9d6d711f3e32133bc3
2021-01-29nacc: Improve log line failing to establish CTRL neigh connPau Espin Pedrol1-2/+3
Change-Id: Ic92158f9fe986ff427ee2ed2cfbf95549e348746
2021-01-29NACC: Send only Pkt Cell Chg Continue if SI retrieve failsPau Espin Pedrol1-5/+5
If fore some reason we fail to fetch SI of target cell, we move directly to NACC_ST_TX_CELL_CHG_CONTINUE in order to submit a Cell Change Continue against the MS without providing any Packet Neighbor Cell Data beforehand, as per spec that's probably the best we can do in this scenario (TS 44.060): """ 1) The network responds with a PACKET CELL CHANGE CONTINUE message. If a mobile station as response to a PACKET CELL CHANGE NOTIFICATION message receives a PACKET CELL CHANGE CONTINUE message without receiving any neighbour cell system information, the mobile station shall stop timer T3208, stop timer T3210 if still running, leave CCN mode and continue cell reselection in NC0/NC1 mode. """ This commit also fixes a use-after-free triggered by TTCN3 test TC_nacc_outbound_rac_ci-resolve_fail_parse_response, where the "cmd" pointer passed to nacc_fsm_ctrl_reply_cb() was freed during FSM termination (its talloc ctx was under ctx->neigh_ctrl_conn) and the libosmocore code calling that callback was later on accessing cmd->defer. Since due to this change the FSM is no longer syncrhonously freed, the issue is gone. Related: SYS#4909 Change-Id: Ie3f12a08ad611b1086d3f4ab7c3d34af43c07961
2021-01-29NACC: Configure neighbor and SI resolution timeout valuesPau Espin Pedrol3-3/+37
Upon timeout, we move directly to NACC_ST_TX_CELL_CHG_CONTINUE in order to submit a Cell Change Continue against the MS without providing any Packet Neighbor Cell Data beforehand, as per spec that's probably the best we can do in this scenario (TS 44.060): """ 1) The network responds with a PACKET CELL CHANGE CONTINUE message. If a mobile station as response to a PACKET CELL CHANGE NOTIFICATION message receives a PACKET CELL CHANGE CONTINUE message without receiving any neighbour cell system information, the mobile station shall stop timer T3208, stop timer T3210 if still running, leave CCN mode and continue cell reselection in NC0/NC1 mode. """ Related: SYS#4909 Change-Id: Ia9932ab082ec095294e85dc4d532046970e17986
2021-01-29NACC: allow setting keep time for entries in neigh and si cachePau Espin Pedrol5-15/+45
Related: SYS#4909 Change-Id: Ifa336aa27dd88ff5b78dbc5a2799740f542bb369
2021-01-29NACC: delay CTRL conn socket init until it's neededPau Espin Pedrol1-14/+11
This way, we don't open a socket and do the IPA handshake in the event the request is already cached. Related: SYS#4909 Change-Id: Ib1ea85e1196c8b9dc40c8837ab5d4a54f2a1f2d4
2021-01-29NACC: Fix crash freeing struct if CTRL conn was refused during allocPau Espin Pedrol1-0/+3
Older versions of osmo_ctrl_conn_alloc() may not properly initialize write_queue.bfd.fd to -1, which means if osmo_sock_init2_ofd() failed during nacc_fsm_alloc(), the destructor would wrongly enter the conditon where the whole structure is set and unregister the unregistered fd. Related: libosmocore Change-Id I98f744d2880fbb883719cdf1d3eb31f2b22a13b6 Related: SYS#4909 Change-Id: I253bd9087b1f7ab039aa1127e9dc586f5106905a
2021-01-29Introduce NACC supportPau Espin Pedrol22-4/+1393
A new nacc_fsm is introduced per MS object, with its partner priv structure struct nacc_fsm_ctx, which exists and is available in the MS object only during the duration of the NACC procedure. The NACC context is created on an MS whenever a Pkt Cell Change Notification is received on Uplink RLCMAC, which asks for neighbor information of a given ARFCN+BSIC. First, the target ARFCN+BSIC needs to be translated into a CGI-PS (RAC+CI) address. That's done by asking the BSC through the Neighbour Resolution Service available in osmo-bsc using the CTRL interface. Once the CGI-PS of the target cell is known, PCU starts a RIM RAN-INFO request against the SGSN (which will route the request as needed), and wait for a response containing the SI bits from the target cell. After the SI are received, the scheduler is instructed to eventually poll a TBF for the MS originating the CCN, so that we can send the SI encapsulated into multiple Packet Neighbor Cell Data messages on the downlink. One all the SI bits are sent, the scheduler is instructed to send a Packet Cell Change Continue message. Once the message above has been sent, the FSM autodestroys itself. Caches are also introduced in this patch which allows for re-using recently known translations ARFCN+BSIC -> CGI-PS and CGI-PS -> SI_INFO respectively. Change-Id: Id35f40d05f3e081f32fddbf1fa34cb338db452ca
2021-01-29tbf: Make tbf_ms() param constPau Espin Pedrol2-2/+2
Change-Id: I041c564b15d17d05ce97ea0085fcd9192a346578
2021-01-28gprs_ns2: migrate to the new vty syntaxAlexander Couzens1-3/+1
This also changes the vty configuration. If only timeout has been configured for ns the new configuration is compatible. For further information see: https://osmocom.org/projects/libosmocore/wiki/Network_service_(NS) Depends-on: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb (libosmocore) Change-Id: I14af821a8d1fda670643c3d5f81299a3abf3c583
2021-01-28follow gprs_ns2 API enum changesAlexander Couzens3-14/+14
All gprs_ns2 enums have now GPRS_NS2 as prefix. Depends-on: I548ff12f7277cbb7e1a630a3dc02b738ce89be72 (libosmocore) Change-Id: Ifdc7956318c07d680feab33c22bc2c6f20927bf9
2021-01-26sched: Avoid picking TBF with nacked dl blocks when GMSK is requiredPau Espin Pedrol1-3/+28
Sine we don't yet implement properly all resegmentation of blocks from same MCS family type, when requiring a GMSK DL block (due to GPRS+EGPRS multiplexing limitations) we need to skip retransmitions, otherwise we'd be incorrectly picking a DL block which was already built with a potentially higher MCS value. The "DL_PRIO_NEW_DATA" prio serves two purposes: * There's new data to send * There's some nacked data to be retransmitted The 2nd purpose has, later on, more priority over the 1st one when the tbf is selected (see gprs_rlcmac_dl_tbf::take_next_bsn()). Until now we were handling correctly the case where the tbf was skipped in case the prio was to resend unacked data (DL_PRIO_SENT_DATA), but was incorrectly selected when it'd send nacked data. Let's fix it by specifically checking w->resend_needed() < 0. Change-Id: I253de8e1a190a9adb56160f38892c9e43e2c0272
2021-01-25Fix Dl EGPRS data blocks being generated occasionally on GPRS TBFsPau Espin Pedrol5-33/+59
Under some circumstances, it could happen that a DL TBF is created as a GPRS TBF due to not yet having enough information of the MS, and only after the TBF is created the PCU gains that information and upgrades the MS mode to "EGPRS". Hence, there's the possibility to run into a situation where a GPRS TBF is attached to a EGPRS MS. It may also happen sometimes that despite the TBF and the MS be EGPRS, there's need to further limit the DL MCS to use, eg. MCS1-4 (GMSK). As a result, when asking for the current DL (M)CS to use, we must tell the MS which kind of limitations we want to apply. The later reasoning was already implemented when GPRS+EGPRS multiplexing was added, but the former was not being checked. Hence, by further spreading through the call stack the "req_kind_mode" we match both cases. Related: OS#4973 Change-Id: Ic0276ce045660713129f0c72f1158a3321c5977f
2021-01-25ms: Properly handle EGPRS_GMSK mode in ms_max_cs_dl/ul()Pau Espin Pedrol1-18/+10
Change-Id: Ied3e02a12145112fafa12282ed7aefa5b0fa6eb6
2021-01-25ms: Set proper initial MCS values setting mode EGPRS_GMSKPau Espin Pedrol1-0/+13
Before this patch, shared logic with EGPRS case would allow keeping MCS>4. Change-Id: I94cbf0c120fd37deb2dfd077d35b3811c7da0675
2021-01-25encoding: fix typos in commentPau Espin Pedrol1-2/+2
Change-Id: I0867935ad08d6e49c62e061742d3d76eeac35844
2021-01-25tbf: Drop always-true condition checking for MSPau Espin Pedrol1-3/+3
The TBF can sometimes be detached from an MS, for eg. when switching from one MS object to another due to them being merged after we found duplicate objects upon receiving new information from it, but that change is instantaneous so it shouldn't be a problem. The only other way where an MS can be detached from an MS is during the end of its (or the MS) life, where it is not sending data anymore. Hence, it is safe to drop those checks for MS not being null. Those being trigger, it should be considered a bug. Change-Id: If292a53a09a64664031e756bff4735b9c6ee8651
2021-01-25sched: Check if egprs is enabled in TBF rather than MS being egprs capablePau Espin Pedrol1-1/+1
It could happen as of current implementation that a TBF was created as GPRS due to the MS being non-egprs, and later on the MS was upgraded to EGPRS due to newly received information from the MS. Hence, in order to infer if the data block is EGPRS or GPRS, let's better check for the TBF info, which is the one really mandating the kind of dl block to generate. Change-Id: I49720fb3a69ca972cd1973de937ac8ee77615431
2021-01-25ms: Drop always-false checkPau Espin Pedrol1-3/+0
MS is always assigned to a BTS, since it's set during MS constructor. Hence, the check removed in this patch would never hold true (and if it did, it'd be a bug). Change-Id: I86a71c64623f7bec031226938a54306148370ffb
2021-01-22gprs_pcu: Use libosmocore osmo_cgi_ps_cmp APIPau Espin Pedrol1-1/+1
it was noticed that gprs_pcu_get_bts_by_cgi_ps() sometimes failed to return the BTS even if the CGI-PS fields matched, probably due to memcmp checking too padding bytes which may not be zero-initialized in one of the two memory regions being checked. Let's be on the safe side and use libosmocore APIs to check them. Depends: libosmocore.git Change-Id I00e329bc5be8674b30267dec238e7656ddfc21db Change-Id: I7c8ee2c447634e45b367bb8f84adf0140ae48591