Commit Graph

17 Commits

Author SHA1 Message Date
Jacob Erlbeck 0f5c6956dd rlc: Use the rlc structure to access the data unit in the RLC message
Currently most offsets are hard-coded which makes it difficult to
access the data units and their headers when padding has to be taken
into account. These offset are already provided by the
gprs_rlc_data_info_init_ul/dl functions.

Change the encoder/decoder to use these values.

Note that some assumptions (bit alignment) are still present in the
code and checked by assertions.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:40 +01:00
Jacob Erlbeck f2f24b0959 edge: Add a bitvec based Decoding::extract_rbb function
This shall replace the old one after the transition to bitvec based
RBBs.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:34 +01:00
Jacob Erlbeck 192bf33ffb decode: Add bitvec based GPRS DL ACK/NACK decoder
Currently the RBB is used and passed directly to the window handling
methods. For EGPRS a more abstract bitvec is derived from the messages
and will passed around instead.

Add a similar function for GPRS so that the same window handling can
be used for GPRS and EGPRS.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:34 +01:00
Jacob Erlbeck 2bef4dbd43 edge: Enable CRBB decoding
Currently CRBB bitmaps are ignored if they are present.

This commit enables the decoding.

Note that this requires osmo_t4_decode in libosmocore.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:34 +01:00
Jacob Erlbeck 3fdcb2b84e edge: Add experimental support for uplink CRBB
Currently only uncompressed bitmaps (URBB) are supported in
PACKET UPLINK ACK/NACK messages.

Extend decode_egprs_acknack_bits to decode compressed bitmaps (CRBB),
too.

Note that this code is only active, if the macro WITH_CRBB_DECODING
is defined.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:34 +01:00
Jacob Erlbeck ae9c575d2c edge: Handle EGPRS PACKET DOWNLINK ACK NACK
Currently this message is ignored.

Support decoding and handling of this message. Use a bitvec for the
decoder that just represents a BSN sequence without any encoding
details (first bit -> first BSN). Return the corresponding BSN range
(snsmod(bsn_begin + bits_in_bitvec) = bsn_end), so snsmod(bsn_end-1)
is the last BSN if there is at least 1. If bsn_begin == bsn_end, no
BSNs has been added.

Note that this bitvec is not yet used for RBB handling. It just calls
the old rcvd_dl_ack with a faked (all bits are 1) RBB map.

Sponsored-by: On-Waves ehf
2016-02-08 00:45:34 +01:00
Jacob Erlbeck 314ec4db40 tbf: Remove obsolete TLLI functions
This commit removes gprs_rlcmac_tbf::extract_tlli and
Decoding::tlli_from_ul_data.

Sponsored-by: On-Waves ehf
2016-02-05 13:26:34 +01:00
Jacob Erlbeck f2ba4cbf51 edge: Rename gprs_rlc_ul_header_egprs and gprs_rlc_ul_data_block_info
These struct names are more specific than necessary. They are used
for GPRS (uplink) already. In downlink direction, only a few fields
will be added to the header struct. Add addition,
gprs_rlc_ul_header_egprs does not map directly to an encoded
header, like many other 'header' structs do.

Change the names to fit both modes and both directions:

  gprs_rlc_ul_header_egprs    -> gprs_rlc_data_info
  gprs_rlc_ul_data_block_info -> gprs_rlc_data_block_info

Sponsored-by: On-Waves ehf
2016-02-05 13:26:33 +01:00
Jacob Erlbeck 27dc941475 edge: Remove leftover comments from encoding.c
Sponsored-by: On-Waves ehf
2016-01-08 11:14:15 +01:00
Jacob Erlbeck ead5e4724c edge: Fix data block decoder (Coverity)
Use a signed integer instead of an unsigned one for num_chunks
which can set to a negative value on error.

Ensure that chunks is not dereferenced if it is NULL. In fact
that will not happen currently, since num_chunks is now always
<= 0 if chunks == NULL.

Fixes: Coverity CID 1347433, 1347434, 1347435

Sponsored-by: On-Waves ehf
2016-01-08 10:14:50 +01:00
Jacob Erlbeck 4abc686d76 edge: Add unified decoder methods for GPRS/EGPRS
This commit adds new RLC block decoder functions that support both
GPRS and EGPRS. The code path is selected based on the value of the
GprsCodingScheme cs object.

- rlc_parse_ul_data_header
        parses the header of an RLC data block including the E and FBI/TI
        flags (currently supported CS-1 - CS-4, MCS-1 - MCS-4).

- rlc_copy_to_aligned_buffer
        copies an RLC data unit to a byte aligned buffer and returns
        the unit's length.

- rlc_get_data_aligned
        is a convenience wrapper around rlc_copy_to_aligned_buffer
        that avoids copying if the data unit is already byte aligned.

Sponsored-by: On-Waves ehf
2015-12-16 19:36:09 +01:00
Jacob Erlbeck c3c58046c7 edge: Get EGPRS multislot class
The EGPRS MS class ist contained in the MS_RA_capability information.
Its presence indicates, that the MS is able (and willing) to use
EGPRS.

This commit implements basic support for retrieving, storing, and
showing it in the VTY. The information is stored in the MS object.

Sponsored-by: On-Waves ehf
2015-11-30 12:20:36 +01:00
Daniel Willmann 5e94cd4fde decoding: Cosmetic - change rbb decoding 2013-12-12 11:09:17 +01:00
Daniel Willmann 6f7cb2cb4f decoding: Use 'I' and 'R' in rbb array for DL
We want to match up rbb decoding and encoding so it helps to use the
same chars.
2013-12-12 11:03:50 +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 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