aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoding.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-02-02rlc: Support encoding of EGPRS header type 1 + 2Jacob Erlbeck1-4/+59
Currently only header type 3 (MCS-1 to MCS-4) is supported. Add header structs to rlc.h and extend Encoding::rlc_write_dl_data_header accordingly. Sponsored-by: On-Waves ehf
2016-02-02edge: Support EGPRS in IMM ASSIGNMENTJacob Erlbeck1-0/+25
Tell the MS to use EGPRS if EGPRS is enabled on the TBF. Note that only downlink TBF will be supported so far. Sponsored-by: On-Waves ehf
2016-02-02encoding: Redesign Encoding::write_immediate_assignment APIJacob Erlbeck1-19/+37
The EGPRS support will need more information to encode the IMMEDIATE ASSIGMENT. Instead of adding more parameters pass a pointer to the TBF unless an SBA shall be done (indicated by tbf == NULL). All values that can be derived from the TBF and are not needed for an SBA are removed from the parameter list. Return a negative value on error. Sponsored-by: On-Waves ehf
2016-02-02encoding: Refactor write_immediate_assignmentJacob Erlbeck1-79/+98
Move the IA rest encoding into separate functions fpr uplink and downlink. Sponsored-by: On-Waves ehf
2016-02-02encoding: Use explicit LH encoding in write_immediate_assignmentJacob Erlbeck1-2/+2
Currently bitvec_write_field is used which just sets the bits as given, while the spec 44.018 assumes LH encoding. Use the bitvec_write_field_lh function instead. Sponsored-by: On-Waves ehf
2016-02-02tbf: Use TLLI as ID if TFI not yet assignedJacob Erlbeck1-5/+11
Currently the old TFI is always used as ID when a PACKET DOWNLINK ASSIGNMENT is generated. This fails if the old TBF has not been fully assigned yet. The MS will then ignore the PDA. This commit changes write_packet_downlink_assignment to accept an additional parameter old_tfi_is_valid and uses the new TBF's TLLI instead of the olf TFI if that parameter is set to false. Sponsored-by: On-Waves ehf
2016-02-02tbf: Add check_polling/set_polling (TODO)Jacob Erlbeck1-6/+7
Ticket: OW#???? Sponsored-by: On-Waves ehf
2016-02-02edge: Make window size configurableJacob Erlbeck1-2/+7
Currently the window size is fixed to 64 even for EGPRS. Support dynamic window sizes depending on the number of PDCH. The WS can be set to b + f * N_PDCH. If the result is not valid according to TS 44.060, Table 9.1.9.2.1, the value will be corrected to use the next lower valid value (or 64). The following VTY commands are added (config-pcu node): window-size <0-1024> set base (b) value and leave f unchanged window-size <0-1024> <0-256> set base (b) and factor (f) Sponsored-by: On-Waves ehf
2016-02-02edge: Fix rlc_data_to_dl_append_egprsJacob Erlbeck1-26/+45
Ticket: OW#???? Sponsored-by: On-Waves ehf
2016-02-02edge: Support MCS data block encodingJacob Erlbeck1-0/+127
Currently only GPRS data block encoding is supported. This commit adds rlc_data_to_dl_append_egprs which does the EGPRS specific extension and chunk handling. It extends Encoding::rlc_data_to_dl_append to use that function for MCS coding schemes. Sponsored-by: On-Waves ehf
2016-02-02edge: Select implementation by mode in rlc_data_to_dl_appendJacob Erlbeck1-7/+23
Currently the GPRS data block encoding is applied to every coding scheme, even if an MCS is selected. This commit renames the actual encoding function to rlc_data_to_dl_append_gprs (not exported) and puts selection code into Encoding::rlc_data_to_dl_append. This requires an additional cs argument. Sponsored-by: On-Waves ehf
2016-02-02edge: Add Encoding::rlc_data_to_dl_appendJacob Erlbeck1-0/+121
This function appends a single chunk to an RLC downlink data block. The implementation is basically taken from the gprs_rlcmac_dl_tbf::create_new_bsn method without the TBF related functionality and any side effects. Note that it still only supports GRPS. Sponsored-by: On-Waves ehf
2016-02-02edge: Add encoder for downlink RLC data blocksJacob Erlbeck1-0/+120
Currently the (GPRS) RLC block encoding is done by setting the header fields directly in gprs_rlcmac_dl_tbf::create_new_bsn. This is much more complex with EGPRS, since the data fields are not byte aligned, the header formats depend on the header type, and the mapping of bits to bytes is LSB first. This commit adds Encoding::rlc_write_dl_data_header which writes the header according to the given gprs_rlc_data_header structure. Encoding::rlc_copy_from_aligned_buffer is also added to copy byte sequences into the message. Note that the actual encoding of data units is not yet present. Sponsored-by: On-Waves ehf
2016-02-01edge: Support EGPRS in write_packet_downlink_assignmentJacob Erlbeck1-4/+18
Add an use_egprs parameter to write_packet_downlink_assignment and add the EGPRS related fields if it is set to true. The window size is fixed at 64 blocks, link quality measurement reports have been disabled, and the other optional fields are not present. Sponsored-by: On-Waves ehf
2016-02-01edge: Replace integer cs by GprsCodingSchemeJacob Erlbeck1-3/+3
Currently the TBF and MS object use a plain integer value (current_cs) to manage the coding scheme. This makes it difficult to support the MCS schemes. GprsCodingScheme supports a partial ordering of these values (CS and MCS) and provides safe increment and decrement methods. Use the GprsCodingScheme type instead of integer for cs fields and variables. Add a 'mode' to GprsMs which can be set to either GPRS, EGPRS, or EGPRS_GMSK which also set the initial values of current_cs_ul/dl. Select the mode based on max_mcs_ul and max_mcs_dl. Sponsored-by: On-Waves ehf
2016-02-01encoding: Remove RlcMacDownlink_t based write_packet_uplink_ackJacob Erlbeck1-117/+0
This is the CSN1-encoder based variant, which has been replaced and is no longer being used. Sponsored-by: On-Waves ehf
2016-02-01encoding: Add bitvec based write_packet_uplink_ackJacob Erlbeck1-0/+176
The current write_packet_uplink_ack implementation is based on the CSN.1 encoder which makes it difficult to do the bitmap encoding for EGPRS. Add a new implementation based on bitvec functions to create the PACKET UPLINK ACK/NACK messages. Sponsored-by: On-Waves ehf
2016-02-01rlc: Add and use mod_sns(bsn) methodJacob Erlbeck1-1/+1
Currently there is only a mod_sns() method which is being used in expression like bsn_expr & win.mod_sns(). This only works, because it is known that mod_sns() is (sns() - 1) where sns() in turn is always 2^n. This is error prone, hard to read, and relies on window specifics that should be kept inside the respective module. This commit adds a mod_sns(uint bsn) method to gprs_rlc_ul_window and gprs_rlc_dl_window, that encapsulates and hides this optimized computation. Sponsored-by: On-Waves ehf
2016-02-01edge: Support EGPRS uplink Ack/Nack messagesJacob Erlbeck1-4/+61
This commit adds EGPRS UL Ack/Nack encoding based on the CSN1 code. Note that the bitmap encoding is still broken and not easy to fix with the CSN1 framework, especially w.r.t. the length field. Therefore this implementation will be abandoned and replaced by a bitvec based one. Sponsored-by: On-Waves ehf
2016-02-01rlc: Use a pointer instead of repeated selector chainsJacob Erlbeck1-6/+9
Currently the same selector chain is used several times in the same function. This commit adds a pointer to Packet_Uplink_Ack_Nack and uses that instead. Sponsored-by: On-Waves ehf
2016-02-01edge: Move the GPRS UL Ack/Nack encoding into a separate functionJacob Erlbeck1-24/+35
Currently the Encoding::write_packet_uplink_ack function only supports GPRS. Split this function into a generic and a GPRS specific part. Sponsored-by: On-Waves ehf
2015-11-30edge: Support EGPRS in packet uplink assignment messageJacob Erlbeck1-11/+37
Currently the Encoding::write_packet_uplink_assignment method only supports the GPRS variant of the message. This commit adds the missing EGPRS variant to the encoder. Sponsored-by: On-Waves ehf
2015-11-27encoder: Whitespace fixesJacob Erlbeck1-4/+4
Sponsored-by: On-Waves ehf
2015-06-08tbf: Move the current CS field to GprsMsJacob Erlbeck1-2/+2
Currently the current CS value is stored in the cs field of gprs_rlcmac_tbf and initialised when it is used the first time. This commit adds separate fields for UL and DL CS values to the GprsMs class and provides corresponding getter methods for GprsMs and gprs_rlcmac_tbf. Ticket: #1739 Sponsored-by: On-Waves ehf
2015-05-28tbf: Store the timing advance (TA) value in the GprsMs objectJacob Erlbeck1-2/+2
The TA value rather relates to an MS and not to a single TBF. So all TBFs share the same TA value. Currently the TA value is stored per TBF and eventually copied from an old TBF to a new one. It is in general only passed with an RACH request when the TLLI and thus the MS is not yet known. This commit adds a TA member to the GprsMs class and uses that one when the TBF is associated to an MS object. Since the TBF is not always associated with an MS object (after RACH or when it has been replaced by another TBF), the TA value is still stored in each TBF and that value is used as long as no MS object is being associated. Sponsored-by: On-Waves ehf
2014-08-07tbf, ...: Make the fields in the dl/ul struct member variablesDaniel Willmann1-3/+3
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-07encoding: Change function signature to use UL TBFs where it makes senseDaniel Willmann1-2/+2
encode_rbb() and write_packet_uplink_assignment are only called with UL TBFs so change the function signature to reflect that. Ticket: SYS#389 Sponsored by: On-Waves ehf
2014-05-30tbf/bts, encoding: Keep track of WAIT_RELEASE state for DL assignmentDaniel Willmann1-1/+1
The current code does not properly distinguish between DL assignments to reuse a tbf (after it was put in state WAIT_RELEASE) and DL assignments for an active tbf to change the allocation of the PDCH timeslots. This patch introduces a new variable was_releasing which remembers if trigger_dl_ass() was called with a tbf in state WAIT_RELEASE. In that case we have to set the CONTROL_ACK field in the download assignment. This should allow us to send DL assignments to change PDCH TS allocation of a tbf before we enter FLOW state.
2014-01-15rlc/tbf: Move v_n into gprs_rlc_ul_window and adapt the testsDaniel Willmann1-1/+1
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15tbf: Kill the tsc member as it duplicates dataHolger Hans Peter Freyther1-2/+2
We can just use first_ts and the trx/pdch to extract this information. Avoid duplication of data.
2013-12-12encoding: Factor out encode_rbb to help testingDaniel Willmann1-13/+22
2013-12-12encoding: Use ul_window ssn()/update_rbb() methods when encoding ul ACKDaniel Willmann1-20/+18
Use the ssn() and update_rbb() methods of gprs_rlc_ul_window when encoding the ACK/NACK packet in write_packet_uplink_ack()
2013-12-12encoding: Change wording to match that of 3GPP TS 04.60Daniel Willmann1-1/+1
The spec (in ch. 9.1.8.1) speaks of RECEIVED or INVALID in the RLC receiver, so change the wording in the log message to match.
2013-12-04rlc: Make the RLC types only operate on the BSNHolger Hans Peter Freyther1-3/+3
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-26rlc: Test the basic of the gprs_rlc_v_n code for remembering the stateHolger Hans Peter Freyther1-2/+0
2013-11-26tbf/rlc: Move the v_n handling into a dedicated objectHolger Hans Peter Freyther1-1/+1
2013-11-26tbf/rlc: Big change and move the window handling out to the rlcHolger Hans Peter Freyther1-2/+2
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-23tbf: Make the ws and sns number "private" (they should also be const)Holger Hans Peter Freyther1-1/+1
2013-10-30tbf: Make tfi private and update the codeHolger Hans Peter Freyther1-5/+5
All logging code that used tbf->tfi is now using tbf_name to print the the TBF. External code is now using tfi() which is inlined and should result in the same code being generated as before (+debug code that can be stripped).
2013-10-30tbf: Make the tlli "private" and update the updating codeHolger Hans Peter Freyther1-1/+1
Now all updates to the tlli/tlli_valid are in one place. If we implement the policy to update the matching/linked TBF we can now to do it in a single place. Add a todo item for that as I am waiting for feedback from the mailinglist.
2013-10-30tbf: Go through the trx to get the ARFCNHolger Hans Peter Freyther1-2/+2
2013-10-30misc: Change the logging for the tbf and what to logHolger Hans Peter Freyther1-1/+1
TLLIs got printed as TBF. Fix that but also rename things to TFI. The TFI is not required to be unique per BTS but it is the indicator we use right now.
2013-10-30bts/tbf: Move the lists into the BTS and do the look-up from the BTSHolger Hans Peter Freyther1-0/+1
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-30encoding: Move the functions into the encoding classHolger Hans Peter Freyther1-7/+8
Add some TODO to this class. E.g. they could all work on the bitvec and the parameter handling could better.
2013-10-30encoding: Move encoding routines into a separate fileHolger Hans Peter Freyther1-0/+456