Commit Graph

99 Commits

Author SHA1 Message Date
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 42de18f347 debug_dl_ass_idle: Remove the feature as it is obviously broken
strncpy takes three arguments but only two are given. This feature
would also only work if there is one tbf at a time.
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 7292373f92 tbf: kill the indirection and invoke the right method 2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 70ddde6929 tbf/bts: Move the tfi_find_free into the bts 2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther 86300bbeea tbf: Move the timer routine into the class
The timer is used for various timeouts and there is still external
client code that is calling it. In a perfect world the client code
would indicate that an event has happened and the internal timer
will be stopped. The best compromise is the "stop_t3191" method. It
allows to add semantic verification that the timer has been running.
2013-10-30 21:24:11 +01:00
Holger Hans Peter Freyther aa9c326d7e tbf: Move the updating of the data into the tbf class 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 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 1702f102af tbf: First round of removing llc handling from the rlcmac_data
The code in gprs_rlcmac_data should ask the TBF for help in packing
the frames but it really shouldn't poke in the internals of the
tbf structure. This is very bad capsuling and has plenty of copy
and paste.

At the same thime this will be the most dangerous refactoring of
the code base.
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 9f0c1d216a tbf: Keep a pointer from the tbf to the BTS
This is preparing the next commits and will ease working with
the debug_diagram when the global lists are killed. It will
simplify the APIin the long run.
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 67ed34eedb bts: Move struct gprs_rlcmac_bts and other structs into a bts.h
Begin to make the BTS a real C++ object with real responsibilities.
The biggest issue will be the pcu_vty.c that might not like C++
at all.
2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 1b33361bab bts: Remove the global state from the tbf 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther ee7a535608 bts: Remove global state from write_immediate_assignment 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 485860cc31 bts: Remove global state from write_packet_uplink_assignment 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther d507ce6b85 bts: Remove global state from gprs_rlcmac_send_packet_uplink_assignment
This was the last method of gprs_rlcmac_data.cpp to access the
gprs_rlcmac_bts variable.
2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 8d7a632eef bts: Remove global state frm gprs_rlcmac_rcv_control_block 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 4ffc260869 bts: Remove global state from gprs_rlcmac_send_data_block_acknowledged 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 9f521cd4af bts: Remove global state from gprs_rlcmac_send_packet_downlink_assignment 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther b0250ebeac bts: Remove global state from gprs_rlcmac_rcv_rach 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 698b612188 bts: Remove global state from gprs_rlcmac_rcv_data_block_acknowledged 2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther ae947fcf67 bts: Remove the global state from write_packet_uplink_ack
Similiar to the previous patches
2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther 344ff48756 bts: Remove the global state gprs_rlcmac_trigger_downlink_assignment
Remove the global state from gprs_rlcmac_trigger_downlink_assignment
and walk up to the pcu_l1_if.cpp where I find the timeout handling
that should be part of the SBA and TBF functionality. In terms of
hierachies things start to be more clear.

There should be the BTS object. That holds the SBA and TBF Controllers
that can allocate TBFs and SBAs and will handle the timeout polling
for a BTS.
2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther 173a240a7e bts: Remove global state and the usage of the gprs_rlcmac_bts
Global state makes mocking/writing tests more difficult. Continue
by removing direct usage of the bts and adding it as pointer to
the function calls (showing the true dependencies of the functions)
2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther 96efa70a9e alloc: Call it trx_no and not trx as it is not trx object 2013-10-30 14:45:57 +01:00
Holger Hans Peter Freyther 1c344e2668 tbf: Prepare to make thing things private in the tbf, start with the state
There really shouldn't be too many callers of state. Instead the
tbf should dispatch depending on the internal state. For now
introduce state_is and state_is_not accessor functions so we can
start to see who is using the internal state.
2013-10-28 12:54:09 +04:00
Holger Hans Peter Freyther 7380babdba tbf: Move the tbf_timer_cb into the tbf class
Introduce the first instance method for printing out diagonistic
about itself and create a jump function for it.
2013-10-28 12:53:49 +04:00
Holger Hans Peter Freyther 8692128365 tbf: Move the alloc_ul_tbf into tbf.c and change signature
Add the bts parameter to the method list. This would be a static
method of the class (in case the TBF would be a class)
2013-10-18 15:17:43 +04:00
Holger Hans Peter Freyther bcafdf8d90 tbf: Warn about copy and paste between different tbf alloc routines
These need to be re-factored to use a common allocation routine.
2013-10-18 15:17:13 +04:00
Holger Hans Peter Freyther 52c911b3b4 tbf: constify the IMSI argument for the downlink assignment 2013-10-02 18:09:10 +04:00
Holger Hans Peter Freyther d6bd91e4e5 tfi: The tfi_alloc doesn't allocate anything, rename the function
Call things by what they do and this function doesn't allocate
anything but it is searching for the first unallocated tbf index.
2013-10-02 18:08:31 +04:00
Holger Hans Peter Freyther b67a8a348a rlcmac: Reduce the depedency on the global gprs_rlcmac_bts variable
For mocking/unit-testing/emulation (and a dual trx-systems) having
global state is quite bad. Cut back on the usage of the global
struct gprs_rlcmac_bts. It also makes the complexity of certain
routines more clear.
2013-09-04 21:28:53 +04:00
Holger Hans Peter Freyther 90692f93cf misc: Move the struct bssgp_bvc_ctx into the struct osmo_pcu 2013-07-30 12:19:40 +04:00
Andreas Eversberg a004e6a823 Added timing advance support for up and downlink TBFs
The timing advance of any TBF is stored when it ends. Whenever a new TBF
with the same TLLI is created (downlink TBF), the stored TA is recalled.

This algorithm assumes that the mobile does not move too fast during
transfer. Also the mobile must start a connection in order to get correct
initial timing advance.

This algorithm does not implement the timing advance procedure as defined
in TS 04.60. To implement the standard timing advance procedure, the BTS
must decode RACH on certain bursts, the mobile is expected to send them.
This requires much more complexity to a transceiver like USRP/UmTRX or
Calypso BTS.

The algorithm was tested at TA >= 8 and works quite well.
2013-05-13 16:45:21 +02:00
Andreas Eversberg 050ace2fb4 Introduce new file for various measurements
The measurements include:
- DL bandwidth usage
- DL packet loss rate
- DL measurements by mobile
- UL measurements by BTS

In order to receive DL measurements from mobile, it must be enabled via
system information message at BSC.
2013-03-17 17:16:44 +01:00
Andreas Eversberg 570b44b29b Add RSSI of data blocks to PCU interface
This bumps the PCU API version to 5 and requires osmo-bts >= 0.2.0.
2013-03-17 17:16:18 +01:00
Andreas Eversberg 02d7cd2ac2 Get rid of allocating first timeslot at tfi_alloc
This simpliefies the allocation process.

tfi_alloc is responsible to allocate a TFI, not a time slot.

The first time slot available depends on multislot class and on other
ongoing TBF (concurrent TBFs), so it is part of the allocation
algorithm to select it.
2013-01-15 08:59:34 +01:00