The allocation in the TBF/BTS code is quite complex. In parts this
is due the assignment and requests occuring under differen circumstances.
Attempt to re-create the commono scenarios.
Remove the bogus msclass check in gprs_rlcmac_tbf::update as the
allocation code will check the ms class anyway.
Fixes a bug introduced in commit 402cdc. That commit sets direction to
zero so setting it to 1 should be done after the call to
csnStreamInit().
This issue was discovered by the rlcmac test.
1. ar.direction variable was not initialized
2. overrunning array "data->RLC_DATA" of 20 bytes at byte offset 22 using index "i" (which evaluates to 22)
The first byte in data_ind->msgUnitParam.u8Buffer is not part of the GSM
frame, but something else, it is also skipped in the call to
pcu_rx_data_ind_pdtch().
This patch fixes GSM RLC/MAC UL packet decoding in wireshark, especially
ACK/NACK packets are now displayed correctly (amongst others).
It is possible that certain UL ACK messages are not sent when there
are many many uplink and downlink assignments. Try to be more fair
and schedule them round-robin. This way no starvation should occur.
Use a formula like it is used with TCP. This can help to make
decisions about if frames should be dropped or not at the time
we enqueue them.
This code will store two timeval structs in fron the of the
actual data and compute the average at the time of the dequeue.
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.
Coverity complains about this code as it doesn't know that the
OSMO_ASSERT is always on. But it is good practice to now have the
side-effect in here.
Fixes: Coverity CID 1080724
Coverity warns about the below lines of code. strerror is supposed
to return a char* and %s should work on char. Let's see if including
string.h will make coverity more happy. The pre-processes file looked
sane as well.
LOGP(DL1IF, LOGL_ERROR, "error writing to L1 msg_queue: %s\n",
strerror(errno));
Coverity: CID 1040951, CID 1040950, CID 1040952
Daniel and me worked on the window handling. We now test that what
we encode is compatible to what we decode. The char array now includes
SSN-1 to the right of the array (reflecting a time axis that grows
towards the right..)
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
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.
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.