Commit Graph

2440 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 782f6ddf99 tbf: Add todo item tht could help improving debugging 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 af8094d799 tbf: Move the handle tineout into the tbf class 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 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 9ae367f639 pdch: Instead of passing bts, trx, ts use the pdch
All dispatching will go through the PDCH. This will clean a lot
of the look-ups inside the gprs_rlcmac_data.c and continue with
adding structure to the pcu code.
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 545876550f sched: Add another warning about trx->arfcn and arfcn.. 2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 6796ed23ab alloc: Remove the ts parameter from the internal interface 2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 09ef27ae04 pdch: Simplify the reset code, rename variables to XYZ_no
Simplify the reset code now that the PDCH can know where it is
located. Rename the variables in the sba to trx_no and ts_no as
it stores the number and not the actual thing.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther 4ed1dae533 bts: Add backpointers to the PDCH and TRX structures
This will allow to kill various parameters from all the functions
as we can walk back.
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 d6ef5345e5 ta: Move timing advance related code into the ta.cpp file 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 9446485e3d pdch: Only say we have paged when this has actually been done 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
Holger Hans Peter Freyther 17b0d83a1f pdch: Move enable/disable into the PDCH code
When a PDCH is disabled all resources should be freed. This is
currently not possible as the PDCH does not know where it belongs
to. On top of that the list (and other resources) should be
properly initialized on construction so that disable() is idempotent
and does not check if it was disabled. During the re-factoring I
noticed that during a sysmobts re-start some resources are not
freed. I left a warning in the code to resolve this issue later.
2013-10-30 21:24:09 +01:00
Holger Hans Peter Freyther ba5543fbf3 Add a TODO file with high-level tasks 2013-10-30 21:23:18 +01:00
Holger Hans Peter Freyther b78adcdd11 bts: Introduce a PollController that has the responsibility to poll
For each frame indication received by the BTS the poll controller
is asked to expire timedout entries.
2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 9b30c7f46e bts: Move the frame_number into the BTS sructure
The current_frame is an attribute of the BTS. Move it from the
pcu_l1_if.cpp into the BTS. As the next step we can trigger
actions depending on the change of the frame.
2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther b6acfdaa24 bts: Introduce a singleton for the BTS and use it in the code
Compared to the previous code there will be a branch to get the
global pointer so the code will be slightly slower than the previous
version but it allows us to start creating objects but still use
the code from C. It is best approach I have found so far.

One downside of C++ is that by default talloc will not be used
(unless we override the new operator to use talloc. Right now
we need to memset the C data structure by hand. The benefit of
enforcing a better structure should is more important though.
2013-10-30 21:20:45 +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 b19d7268c3 bts: Remove global state from gprs_rlcmac_rcv_rts_block 2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 1af73f6c81 bts: Remove global state from gprs_rlcmac_add_paging 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 45396a99d9 sched: Make sched_poll static and add a warning about fairness 2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther bfdd5f285b alloc: Add very basic test case for the alloc_a algorithm 2013-10-30 21:20:44 +01:00
Holger Hans Peter Freyther 948a3d62b1 alloc: Move usf into the scope it is actually used 2013-10-30 14:45:57 +01:00
Holger Hans Peter Freyther b0a0075845 alloc: Factor out the routine to find an enabled PDCH 2013-10-30 14:45:57 +01:00