aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlc.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-01-15rlc: Rename state() to show_state() to better reflect its functionDaniel Willmann1-1/+3
show_state() is only used for debugging output to make the v(b) array human readable.
2014-01-15rlc: Use an enum for the state array instead of charsDaniel Willmann1-4/+16
gprs_rlc_bsn_state is now used to hold the ACK state of sent/received rlc packets.
2014-01-15rlc/tbf: Move v_b into DL windowDaniel Willmann1-26/+25
Move functions resend_needed(), mark_for_resend(), update(), move_window(), state(), count_unacked() out of v_b directly into the UL window and provide a function get_state in v_b to access the v_b elements.
2014-01-15rlc/tbf: Add function receive_bsn that updates v_r, v_q, v_nDaniel Willmann1-0/+8
We don't need to expose the mecanics of updating the variables to the outside.
2014-01-15rlc/tbf: Move v_n into gprs_rlc_ul_window and adapt the testsDaniel Willmann1-6/+6
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15rlc: Rename the simple raise_v_r method to avoid naming conflictsDaniel Willmann1-1/+1
2013-12-18rlc: Use sizeof() for the memset instead of ARRAY_SIZEHolger Hans Peter Freyther1-1/+1
In this case both will give the same result but it is better to use sizeof. But it is better to use the raw number of bytes instead of the number of elements.
2013-12-12rlc: Make the update loop more understandableDaniel Willmann1-7/+11
Add bitnum_to_bsn() as a convenience function to get the BSN, use it in the update handling and ignore rbb for values outside of our tx window.
2013-12-12decoding: Use 'I' and 'R' in rbb array for DLDaniel Willmann1-1/+1
We want to match up rbb decoding and encoding so it helps to use the same chars.
2013-12-12rlc: Manage the received block bitmap in the ul_windowDaniel Willmann1-0/+12
Added two methods to gprs_rlc_ul_window * ssn() returns the starting sequence number * update_rbb() returns an array of chars representing the state of the received block bitmap. Each element is either 'I'nvalid or 'R'eceived. The rbb is generated from v_n rbb[63] relates to BSN ssn-1 ... rbb[0] relates to BSN ssn-64
2013-12-04rlc: Make the RLC types only operate on the BSNHolger Hans Peter Freyther1-17/+12
The code has an internal optimization to only use window_size space. This means that the caller needed to know that only half of the size was used. Change the API to work on the BSN and do the mapping internally. The compiler should have plenty of opportunity to propagate the constant(s) but this has not been verified.
2013-11-26tbf/rlc: Move raising of V(Q) into the ul window codeHolger Hans Peter Freyther1-2/+23
2013-11-26rlc/tbf: Move the code to raise V(R) into the ul_window handlingHolger Hans Peter Freyther1-0/+16
2013-11-26tbf/rlc: Move the putting of a block into the rlc codeHolger Hans Peter Freyther1-0/+6
2013-11-26rlc: Test the basic of the gprs_rlc_v_n code for remembering the stateHolger Hans Peter Freyther1-0/+5
2013-11-26tbf/rlc: Big change and move the window handling out to the rlcHolger Hans Peter Freyther1-30/+22
The send and receive window is now managed by an external object. There are some issues that can only be solved with C++11 but it is progres and removes some of the spaghetti code. For GPRS the sns and ws is hardcoded. Move that into the window code.
2013-11-26rlc: Use uint16_t for the BSN in all cases.Holger Hans Peter Freyther1-2/+2
The sns is only 128 for GPRS (it can be bigger for EDGE) so the uint8_t was enough but it is bad to have inconsistencies for both of them.
2013-11-26tbf/rlc: Move the counting of unacked frames into the RLC V_B classHolger Hans Peter Freyther1-0/+15
Whenwe receive a final ack we assume that all the unacked frames have been acked now. Move the counting to V_B and now the caller can remove the BSN and the "lost" variable which has always been zero.
2013-11-26tbf/rlc: Change the code and generate the entire state in the V_BHolger Hans Peter Freyther1-0/+15
2013-11-26tbf/rlc: Move the moving of V(A) into the V_B codeHolger Hans Peter Freyther1-0/+19
Move the code that moves the V_B to the first not acked frame. Return how many indexes the V_B was moved and update the V_A in the caller.
2013-11-26tbf/rlc: Move the parsing of RBB to Decoding, move window marking outHolger Hans Peter Freyther1-0/+29
Move the parsing of the bitbmap out of the TBF code into Decoding. Move the updating of the V_B into the V_B class. Add some comments about handling the mod_sns, mod_sns_half parameters by using template code.
2013-11-26tbf/rlc: Move the marking of frames for resend into the v_bHolger Hans Peter Freyther1-0/+18
2013-11-26rlc/tbf: Move the loop into the gprs_rlc_v_b classHolger Hans Peter Freyther1-0/+13
2013-11-23rlc: Move the ack state array into a separate class that can be testedHolger Hans Peter Freyther1-0/+6
2013-11-19rlc: Start to move things out of the tbf into the rlcHolger Hans Peter Freyther1-0/+33
Add remarks of possible broken behavior inside the tbf routines. Move the preparation (and init) into the new rlc.cpp file.