Commit Graph

120 Commits

Author SHA1 Message Date
Max cb947e0a0f gprs_rlcmac: convert from C++ to C
Change-Id: I7260ad1a67ebdc09767a679e579fead262f1627a
2023-04-12 16:13:10 +03:00
Philipp Maier 41e38475ed pcu_l1_if: get rid of strange paging group calculation
The PCU uses a 16 bit integer value as paging group which does in fact
not really resamble the paging group. Instead it encodes the last three
digits of the IMSI from which the paging group can be calculated. The
value is then eventually converted back to Ascii-digits and then sent
over the PCU-IF interface. Lets get rid of this weird conversion and
use the IMSI directly.

Change-Id: I40d7fc14c9591b3de091e425faaf325421c70a0e
2023-03-20 10:54:28 +01:00
Pau Espin ff7c581011 Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h file
First commit towards trying to have alloc algorithm as isolated as
possible from others parts of the code trying to avoid state changes on
data structures.
Change name also because the alloc_algo not only allocated TS, but TFIs
and USFs.

Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62
2022-12-16 12:08:07 +01:00
Oliver Smith 8d03c50024 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I4a49dbeeec89b22624c968152118aecf8886dac6
2021-12-14 12:19:13 +01:00
Pau Espin c85e093969 Remove uneeded ms param from alloc_algorithm_func_t func
Since a while ago, the data architecture was changed so that TBF is
guaranteed to always have a MS object associated. Hence, it makes no
sense to pass the MS object as a separate param as we can take it from
tbf object and makes code less confusing.

Change-Id: Idc0c76cf6f007afa4236480cdad0d8e99dabec5f
2021-02-26 11:50:21 +01:00
Pau Espin d1049dc8cc Allow multiple bts objects in PCU
This patch doesn't really tests whether osmo-pcu can work on a multi-bts
environment, but it prepares the data structures to be able to do so at
any later point in time.

Change-Id: I6b10913f46c19d438c4e250a436a7446694b725a
2021-01-20 12:36:21 +01:00
Pau Espin 8a35e640a3 Convert gprs_bssgp_pcu.cpp to C
There's no real use of C++ in that file, and it causes problems when
using llist_head entry macros in future patches adding initial support
for multiple BTS in PCU object, so let's move it to plain C.

Change-Id: Ic771a89fd78b5e66151a5384f0ff6a8895589466
2021-01-19 16:28:13 +01:00
Pau Espin 4a5209d8bc Get rid of unused gsm_timer.{cpp,h}
Those files are not really being used other than for calling
get_current_fn() which is just a placeholder to call
bts_current_frame_number on the global bts object.

Change-Id: I6d50a8c15c1de5e2a308a24b313a7776f94ae54f
2021-01-19 16:28:13 +01:00
Pau Espin b69928cfaf pdch: rcv pkt meas rep: Allocate MS object early in path and use it
Let's create the MS object early if doesn't exist and fill in the
information, so that we can operate on it in an early way (for instance,
logging macros), this way it's easier to trace the lifecycle of
subscribers.

Change-Id: I3ec7eb970310698dd228ae6ad65ec5ca833bab3f
2020-08-24 07:50:49 +00:00
Neels Hofmeyr 59fc0bda6e paging: pass struct osmo_mobile_identity, not encoded IE bytes
In get_paging_mi(), before this, an encoded buffer of Mobile Identity bytes is
returned. Code paths following this repeatedly decode the Mobile Identity
bytes, e.g. for logging. Also, in get_paging_mi(), since the TMSI is read in
from a different encoding than a typical Mobile Identity IE, the TMSI was
manually encoded into a typical Mobile Identity IE. This is essentially a code
dup of osmo_mobile_identity_encode(). Stop this madness.

Instead, in get_paging_mi(), return a decoded struct osmo_mobile_identity. Code
paths after this use the struct osmo_mobile_identity directly without repeated
decoding.

At the point of finally needing an encoded Mobile Identity IE (in
Encoding::write_paging_request()), do a proper osmo_mobile_identity_encode().

Since this may return errors, add an rc check for the caller of
write_paging_request(), gprs_rlcmac_paging_request().

A side effect is stricter validation of the Mobile Identity passing through the
Paging code path. Before, invalid MI might have passed through unnoticed.

Change-Id: Iad845acb0096b75dc453105c9c16b2252879b4ca
2020-08-24 01:12:16 +00:00
Pau Espin b2653fe619 Move gsm_rlcmac.cpp -> .c
Original file from wireshark.git (packet-gsm_csn1.c) is being built and
maintained as a C file. There's no real need for us to maintain it as a
C++, and doing so will make both files derive over time (as already
happened). Let's keep it as a C compiler (which btw seems to be more
strict) to make it easier to port patches back and forth wireshark.git.

Take the chance to move some declarations we added to csn1.h to be able
to build it out of wireshark. Let's keep those in a separate header file
to ease looking for differences.

Change-Id: I818a8ae947f002d35142f9f5473454cfd80e1830
2020-03-30 10:08:02 +00:00
Pau Espin 5530f12f71 Allow Gb PAGING-PS without P-TMSI
P-TMSI is optional IE, but IE is mandatory and hence always available.
Since the encoding is actually a Mobile Identity, the IMSI is used in
case P-TMSI is not available.

Change-Id: I4dbf8db04e81f98352a42ce34a5d91326be9bfd1
2020-01-06 10:26:46 +00:00
Pau Espin d7c3265223 Pass paging group instead of imsi where later is not needed
Change-Id: Id0663a81f439f2d0b893b0d34f85a6db1927ef8e
2020-01-06 10:26:46 +00:00
Pau Espin 585cfb28b8 Fix trailing whitespace
Change-Id: I0515b5c8f6744fa501de88fa7808b7fc91981f0e
2019-12-10 20:02:21 +01:00
Oliver Smith cfb6321b88 Forward ETWS Primary Notification to MS
Receive an Application Information Request from the BTS via PCU
interface. Construct a Packet Application Information message from it
(3GPP TS 44.060 11.2.47) and send it to all MS with active TBF.

The TTCN-3 test infrastructure to test this feature is not quite ready
yet, so I've added C unit tests instead.

Related: OS#4048
Change-Id: Ie35959f833f46bde5f2126314b6f96763f863b36
2019-09-14 15:28:43 +00:00
Max 7426c5f957 Add define for dummy burst string
Change-Id: I464920b3d6d47bb1c797a4ce06230f005a2e06a0
2019-02-19 18:58:04 +01:00
Max 4da385998a Simplify TS alloc: constify max dl slot func
Constify parameters of gprs_alloc_max_dl_slots_per_ms().

Change-Id: Ic90930d98560459eab0054cb9e1625cb99db61c8
Related: OS#2282
2018-02-20 10:20:55 +01:00
Max e9fe0e3d06 Simplify TS alloc: adjust allocator signatures
* drop unused parameters (from both functions and structs)
* document used parameters and return values
* tighten types used for parameters
* use consistent formatting

Tests are adjusted accordingly but test results are left untouched to
avoid regressions.

Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755
Related: OS#2282
2018-01-26 12:55:29 +01:00
Max 46fbfceac6 Add tests for find_multi_slots()
* make function public
* add tests

Change-Id: I4174703808335c19341cd5b5f4422496d958967f
2018-01-25 16:12:56 +00:00
Max ef784e4e9e Remove unused includes and forward declarations
Change-Id: I59da04edd1b8ff965bbfbe00ccae1f7c9b6e5301
2017-12-18 22:05:22 +00:00
Alexander Couzens ccde5c9557 remove pcu own bitvector implementation
The osmocore bitvec is exact the same, but use a pointer instead of
a reference.

Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
2017-05-15 12:46:33 +00:00
Max 878bd1f296 Remove useless ARFCN parameter
ARFCN is already part of TRX struct so there's no need to supply it
explicitly in a separate parameter. I've tested and those are the same
anyway.

Change-Id: I8e975c52cbc819427880093b1e5371fe1f8ce460
2016-07-26 00:20:23 +00:00
Jacob Erlbeck 7f79f0d332 bssgp: Adapt flowcontrol MS default to current alloc algorithm
Currently the values Bmax/R default MS are computed under the
assumption than min(4, N_PDCH) DL slots are allocated for an MS, even
if multislot assignment is not enabled.

This commit changes the computation to assume 1 DL slot if algorithm
A is selected or the dynamic algorithm is used and has disabled
multislot assigment due to high load.

Sponsored-by: On-Waves ehf
2015-07-17 12:06:19 +02:00
Jacob Erlbeck 400ec02e8a alloc: Add 'dynamic' allocation algorithm
The idea behind this meta algorithm is to automatically select one of
the other algorithms based on the system state. Basically algorithm B
will be selected if the PDCH usage is low to improve throughput and
latency. Algorithm A will be selected to support more concurrent MS.

This commit adds a first simple state-less version of this algorithm
that always tries B first and only if that fails A is tried
afterwards.

The following VTY command is added to the 'pcu' node:

 - alloc-algorithm dynamic

Ticket: #1934
Sponsored-by: On-Waves ehf
2015-07-16 19:24:15 +02:00
Jacob Erlbeck 5879c6493f tbf: Move TFI selection into alloc_algorithm
Currently the TFI and the TRX have to be determined before the actual TBF
allocation function is called, passing TFI and TRX number as
parameters. This does fit to TFI reuse for different slots, since
this were tightly coupled with the slot selection.

This commit just moves the TFI selection into the alloc_algorithm
functions. The tfi parameter is removed from the the TFI alloc
functions. The trx parameter is changed into use_trx to optionally
limit the trx selection (same semantics like in tfi_find_free).

Sponsored-by: On-Waves ehf
2015-07-16 10:25:14 +02:00
Jacob Erlbeck e2e004e7a9 tbf: Pass the MS object around instead of old_tbf
Currently the old TBF (either uplink or downlink) is passed around at
TBF allocation mainly to get information about the MS. To implement
more complex allocation algorithms, the MS object itself will be
needed anyway.

This commit replaces the old_tbf arguments by MS object arguments.

Sponsored-by: On-Waves ehf
2015-06-29 10:53:32 +02:00
Daniel Willmann 418a4230e0 tbf, gprs_rlcmac_meas: Move the DL bandwidth variables to the DL TBF
The bandwidth calculation as well as loss report is only done for DL TBF
so move everything related to that in there.

Ticket: SYS#389
Sponsored by: On-Waves ehf
2014-08-08 14:15:24 +02:00
Holger Hans Peter Freyther 12c039cdb2 debug_diagram: Remove the special debug_diagram compilation mode
This approach is somehow flawed. We need/want to debug problems on
systems with real traffic and re-compiling it with debug_diagram
is not an option. All internal logging needs to be expressive enough
so we can understand what is going on (e.g. create a script to
post-process the output).
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther 61a0a04d26 tbf: Move gprs_rlcmac_send_data_block_acknowledged into tbf
We can now remove the gprs_rlcmac_data as the code has been
moved into the tbf, pdch and bts.
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 3dc56a3b34 tbf: Move gprs_rlcmac_send_packet_uplink_assignment into the tbf 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther ae03f22199 tbf: Move gprs_rlcmac_send_packet_uplink_assignment to the tbf
Again the function was called send but didn't do any sending
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 46bcb8d59d tbf: Move gprs_rlcmac_send_uplink_ack into the tbf
The method was called send but didn't send anything. Move
it to the tbf
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 02beed5e98 bts: Move gprs_rlcmac_rcv_rach into the BTS class 2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 2db7e7e7db tbf: Move gprs_rlcmac_send_packet_downlink_assignment into the tbf
This method was called _send_packet_ but actually didn't do any
sending at all. It just formated the right assignment. I replaced
tbf-> with nothing.
2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 24c1a5ba29 bts: Move gprs_rlcmac_trigger_downlink_assignment into BTS 2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther d9262b3b55 tbf: Move gprs_rlcmac_poll_timeout into the tbf
Move the gprs_rlcmac_poll_timeout method into the tbf class and
gprs_rlcmac_downlink_assignment into the BTS.
2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 40cfaa6837 bts: Move rcv_imm_ass_cnf into the bts code 2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther fcbc702112 pdch: Move the giant switch/case of gprs_rlcmac_rcv_control_block
Move the dispatch into the PDCH. This needs to be split up
further into understandable blocks.
2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther d11290b90b pdch/tbf: Move gprs_rlcmac_rcv_data_block_acknowledged into the pdch
Move the method into the PDCH. Extract the finding of TLLI into a
new class called Decoding. Move the assemble and forward LLC frames
into the TBF as it is poking in the internals of the TBF.
2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 6f9f434463 pdch: Move the dispatch of gprs_rlcmac_rcv_block into the pdch 2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther b65e08a7be misc: Remove the bts parameter from calls that take a tbf
Mark some of the tbf manipulation that is burried in the data
sending routine.. that it should be moved around.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 7ce21eb042 data: Move gprs_rlcmac_cs to the place it is used and make static 2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 34bd8bdf30 bts/tbf: Move the lists into the BTS and do the look-up from the BTS
The list belongs to the BTS. This makes cleaning this up more easy
and establishes a hierachy of resources that start from the BTS. The
debug_diagram code is now broken.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther cedf890928 sba: Create a SBAController that will manage the sbas for a BTS
The PollController is a friend of the SBAController and is allowed
to access the internal list. The list is hidden from everyone else.

This is done because the calculation of timeout should belong into
the PollController and not into the SBAController.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 621dc2fd01 sba: Move the sba code to a dedicated file
Move the code around and then turn it into an object...
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 111614a994 ta: Create TimingAdvance class and make it belong to the BTS
This allows us to easily flush the state in case a PCU/BTS
connection is lost.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 63f29d6f73 encoding: Move the functions into the encoding class
Add some TODO to this class. E.g. they could all work on the
bitvec and the parameter handling could better.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 6ca0a9076e encoding: Move encoding routines into a separate file 2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther f0984897a5 bts/pdch: Move the adding of paging to the BTS/PDCH objects
Only the gprs_rlcmac_pdch will manipulate the paging list now. There
can be various more refactorings of the code but they can be done
later. E.g. on memory allocation failure we can continue instead
of leaving the code, we should also set any_tbf only after things
have been paged.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 24e98d039d pdch: Move paging dequeue into the PDCH object
Rely on packet_paging_request returning NULL in case the queue
is empty. We should move the write_packet_paging_request into
a separate file/object as well.
2013-10-30 21:24:10 +01:00