Commit Graph

77 Commits

Author SHA1 Message Date
Daniel Willmann 7e994e392d tbf, ...: Make the fields in the dl/ul struct member variables
There is no need for the union/struct anymore. Make the variable members
of the UL/DL class.

As a result gprs_rlc_dl_window gets a reset() method because
memset(&dir.dl, 0, sizeof(dir.dl)) doesn't work anymore in reuse_tbf().

Ticket: SYS#389
Sponsored by: On-Waves ehf
2014-08-07 16:12:05 +02:00
Holger Hans Peter Freyther 35cc1c0ff3 misc: Do not mix struct/class in the forward declaration 2014-07-02 14:48:44 +02:00
Daniel Willmann 3ce011f44f rlc: Rename state() to show_state() to better reflect its function
show_state() is only used for debugging output to make the v(b) array
human readable.
2014-01-15 15:23:35 +01:00
Daniel Willmann d54d9f5c75 rlc: Use an enum for the state array instead of chars
gprs_rlc_bsn_state is now used to hold the ACK state of sent/received
rlc packets.
2014-01-15 15:23:35 +01:00
Daniel Willmann 146514e180 rlc/tbf: Move v_b into DL window
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-15 15:23:21 +01:00
Daniel Willmann 55844795be rlc/tbf: Add function receive_bsn that updates v_r, v_q, v_n
We don't need to expose the mecanics of updating the variables to the
outside.
2014-01-15 15:23:21 +01:00
Daniel Willmann 7c3751b10b rlc/tbf: Move v_n into gprs_rlc_ul_window and adapt the tests
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15 15:23:21 +01:00
Daniel Willmann f4a1ec6ce7 rlc: Rename the simple raise_v_r method to avoid naming conflicts 2014-01-15 15:23:21 +01:00
Daniel Willmann 8a31f9e016 rlc: Manage the received block bitmap in the ul_window
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-12 10:59:56 +01:00
Holger Hans Peter Freyther 3cbf9e040c rlc: Make the RLC types only operate on the BSN
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-12-04 21:01:02 +01:00
Holger Hans Peter Freyther 7f3e662b34 tbf/rlc: Move raising of V(Q) into the ul window code 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther cbb00ebd04 rlc/tbf: Move the code to raise V(R) into the ul_window handling 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther 423dd2286b tbf/rlc: Move the putting of a block into the rlc code 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther 6ab5b24be4 tbf/rlc: Move the check if something is in the window out. 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther 7decedcbf8 rlc: The bsn has never been used. Remove it from the Xl_window 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther e9b1ebba9d rlc: Test the basic of the gprs_rlc_v_n code for remembering the state 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther 270f7fce1d tbf/rlc: Move the v_n handling into a dedicated object 2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther f1593b7c49 tbf/rlc: Big change and move the window handling out to the rlc
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-26 21:00:51 +01:00
Holger Hans Peter Freyther 9c5539d46d tbf/rlc: Move the counting of unacked frames into the RLC V_B class
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-26 20:57:24 +01:00
Holger Hans Peter Freyther bc15570651 tbf/rlc: Change the code and generate the entire state in the V_B 2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther e358ff8fa4 tbf/rlc: Move the moving of V(A) into the V_B code
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-26 20:57:24 +01:00
Holger Hans Peter Freyther df6b4f52e0 tbf/rlc: Move the parsing of RBB to Decoding, move window marking out
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-26 20:57:24 +01:00
Holger Hans Peter Freyther 8b16ae30fe tbf/rlc: Move the marking of frames for resend into the v_b 2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther 1577779526 rlc/tbf: Move the loop into the gprs_rlc_v_b class 2013-11-26 20:57:19 +01:00
Holger Hans Peter Freyther 9525567d77 rlc: Create a basic test that mark/is is talking about the same 2013-11-23 16:19:17 +01:00
Holger Hans Peter Freyther 6b5660c19f rlc: Move the rlc headers into a separate header file 2013-11-23 16:19:17 +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