aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-02-08pcu: Add bitvec_write_field_lhJacob Erlbeck2-0/+19
While the bitvec functions from libosmocore support LH encoding, the C++ wrapper does not. Add a bitvec_write_field_lh function that is similar to bitvec_write_field, but writes L and H instead of ZERO and ONE. Sponsored-by: On-Waves ehf
2016-02-08tbf: Don't change type from CCCH to PACCH without ackJacob Erlbeck2-2/+11
Currently the CCCH flag is cleared and the PACCH flag is set when a multislot upgrade is scheduled for a downlink TBF, even if the MS has never confirmed in any way that the PACCH really exists. This can happen if the MS did not receive the DL IMM.ASS. Since the CCCH flags gets cleared in that case, the IMM.ASSS is never retried and all subsequent PACKET DOWNLINK ASSIGNMENTS will fail. This commit delays the update of these flags until the MS has responded with a corresponding CONTROL ACK. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use TLLI as ID if TFI not yet assignedJacob Erlbeck5-9/+44
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-08tbf: Add check_polling/set_pollingJacob Erlbeck8-77/+135
Currently the checks for and the actual polling is done in several places by copy & paste of several lines of code. This hinders changes of they polling is handled internally and also is likely source of programming mistakes. Separate this into a check_polling function, that checks whether polling is possible and returns the FN and the RRBP to be used in that case. Otherwise the cause is logged (LOGL_DEBUG) and a negative error value is returned. There are no other side effect beside the logging. If the call is successful, the set_polling method can be used to actually register the polling. Extend the encoder functions' parameters lists by an rrbp parameter. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add and use tbf->poll_tsJacob Erlbeck7-25/+32
Currently tbf->control_ts is used to look up an incoming poll response. Since that may eventually change, poll timeouts could theoretically happen in that case. Store the real poll TS in tbf->poll_ts at all places where tbf->poll_fn is set. Do not use tbf->control_ts to look up outstanding polls. Sponsored-by: On-Waves ehf
2016-02-08tbf: Mark control slots in VTY TBF outJacob Erlbeck1-1/+2
Put an '!' after the PDCH number in the output of the 'show tbf' command, if is_control_ts() yields true. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use is_control_ts() instead of comparing TS values directlyJacob Erlbeck4-8/+11
Currently there are some places where tbf->control_ts != ts is evaluated to check, whether ts is a control slot. Replace these expressions by tbf->is_control_ts(ts) which does the same whitout exposing internal fields. Sponsored-by: On-Waves ehf
2016-02-08sched: Pass the current TS to the control create functionsJacob Erlbeck4-15/+15
Currently the checks in that function are based on the different internal TS values of a TBF. It is assumed that they match the TS that the current RTS refers to. This commit adds a TS parameter to create_ul_ass, create_dl_ass, and create_ul_ack to make this more explicit. Sponsored-by: On-Waves ehf
2016-02-08tbf: Do not reuse old TBF after RACH requestsJacob Erlbeck4-28/+33
Currently existing TBF can be reused after an MS has sent a RACH request. Since the MS can be or most probably is in packet idle mode in that case, the TBF are no longer usable even if they share the PDCHs and the control TS with the new one. There are occasional freezes where the MS does no longer react to messages sent on the PACCH. This change aborts all pending TBFs if a new TBF is or has been established via RACH. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add abort method for downlink TBFJacob Erlbeck4-52/+88
Currently the is a release() function which takes care of statistics and shutdown of properly finished TBFs, but which cannot be used for aborted TBFs. This commit add an abort() method which handles unacked RLC blocks as lost and doesn't start a release timer. This method will be invoked by tbf_free() for downlink TBF. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add counters for aborted TBF in state FLOWJacob Erlbeck3-5/+19
Increment CTR_TBF_DL_ABORTED/CTR_TBF_UL_ABORTED if a TBF gets freed that is still in state GPRS_RLCMAC_FLOW. Sponsored-by: On-Waves ehf
2016-02-08Revert "tbf: Use the control TS for Immediate Assignments"Jacob Erlbeck1-2/+2
According to spec, the lowest numbered PDCH of the TBF shall be used for the PACCH, only when concurrent TBF are active, the lowest common PDCH shall be used. An immediate assigment is in general only sent, if no TBF is active, so the latter case never applies. This reverts commit fdd8a1ba2312be3f33576ee994c0b5da6272e815.
2016-02-08tbf: Use the control TS for Immediate AssignmentsJacob Erlbeck1-2/+2
Currently the first TS is used, which can be different from the control TS on downlink TBFs. Use the control TS instead. Sponsored-by: On-Waves ehf
2016-02-08tbf: Refactor calls to write_immediate_assignmentJacob Erlbeck2-14/+75
Make use of variables, log them to LOGL_DEBUG, and reduce code duplication. This should help to narrow down the cause why snd_dl_ass are not answered by the MS sometimes. Sponsored-by: On-Waves ehf
2016-02-08bssgp: Ignore downlink BSSGP RA Cap IEJacob Erlbeck1-0/+4
That IE may contain inaccurate or completely bogus data. This commit disables the parsing. Note that this should be replaced by a config option. Sponsored-by: On-Waves ehf
2016-02-08tbf: Low prio for BSSPG values for GPRS/EGPRS MS classJacob Erlbeck2-15/+18
Currently the values in the BSSGP RA Cap IE are eventually use overwrite the 'good' values obtained from the MS earlier. Use the 'good' values when the are present, which is assumed if at least one of ms->ms_class() or ms->egprs_ms_class() is set. Sponsored-by: On-Waves ehf
2016-02-08edge: Get EGPRS MS class from downlink BSSGPJacob Erlbeck1-27/+22
In case there is no MS object present that matches a DL UNITDATA, the EGPRS class is currently assumed to be 0, since the Radio Access Capabilities IE is not fully decoded if present. This commit uses the CSN.1 decoder to parse the IE and uses the same functions like the uplink related code does to get the GPRS and EGPRS multislot classes. Remove the old parse_ra_cap_ms_class function. Sponsored-by: On-Waves ehf
2016-02-08rlc: Add decode_gsm_ra_cap to decode Radio Access CapsJacob Erlbeck2-0/+9
This uses the CSN.1 decoder to fully parse the radio access capabilities as defined by TS 24.008, 10.5.5.12a. Sponsored-by: On-Waves ehf
2016-02-08Revert "bssgp: Add hand-coded extended RA Cap parser"Jacob Erlbeck1-66/+0
Just keep this for later reference, since a CSN.1 decoder based implementation will be used. This reverts commit b37ab36bb14d2d2c1363fbe521cd19984d0c3d4c.
2016-02-08bssgp: Add hand-coded extended RA Cap parserJacob Erlbeck1-0/+66
Add an extended parse_ra_cap function based on the existing parse_ra_cap_ms_class which also parses up to the EGPRS related fields. Sponsored-by: On-Waves ehf
2016-02-08tbf: Show window parameters in VTYJacob Erlbeck1-3/+18
Add V(Q), V(R), V(A), V(S) to the output of the "show tbf" command. Sponsored-by: On-Waves ehf
2016-02-08edge: Make window size configurableJacob Erlbeck9-6/+189
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-08tbf/vty: Fix the CS output and show the EGPRS MS classJacob Erlbeck1-3/+3
Currently only the GPRS MS class and the DL CS (even for UL TBFs) are shown. Add the EGPRS MS class and use the TBF's real CS. Sponsored-by: On-Waves ehf
2016-02-08utils: Add pcu_bitcount and pcu_lsbJacob Erlbeck2-21/+24
These functions are currently defined in src/gprs_rlcmac_ts_alloc.cpp but will be needed elsewhere. Turn them into template functions to support different types and move them to pcu_utils.h. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add gprs_rlcmac_tbf::window() methodJacob Erlbeck1-0/+12
This method returns a gprs_rlc_window independently of the TBF's direction. Sponsored-by: On-Waves ehf
2016-02-08rlc: Add unified gprs_rlc_window parent classJacob Erlbeck3-68/+32
Currently gprs_rlc_ul_window and gprs_rlc_dl_window are completely separate classes, containing several identical members and methods. This commit add a shared parent class containing WS and SNS handling. Sponsored-by: On-Waves ehf
2016-02-08edge: Work-around to use EGPRS if there was no DL RA CapJacob Erlbeck1-4/+7
If the downlink BSSGP didn't contain a RA Capabilities IE, both MS class values are 0. The phone will send valid RA Caps later on. Currently in that case, the downlink TBF is not established if EGPRS is enabled. Just force egprs_ms_class to 1 if EGPRS (only) is enabled. Sponsored-by: On-Waves ehf
2016-02-08edge: Disable GPRS/EGPRS mixed modeJacob Erlbeck7-5/+59
Currently the plain 'egprs' command enables EGPRS but doesn't prevent phones from being served in GPRS mode if they do not support EGPRS. This involves complex frame allocation implementations in dynamic mode, especially if 8PSK is being used. This is due to the inability of non-EGPRS phone to decode 8PSK USF and ES/P altogether. Since polling has a higher priority than USF, collisions will have to be prevented by the PCU by never using an GPRS USF if it refers to a FN that is already being used for polling. This commit just disables mixed usage by ignoring GPRS-only request if EGPRS is enabled. The following VTY command (config-pcu node) is changed: egprs -> egprs only Sponsored-by: On-Waves ehf
2016-02-08edge: Fix MCS range in VTYJacob Erlbeck1-1/+1
Change the range from MCS 1-4 to MCS 1-9. Sponsored-by: On-Waves ehf
2016-02-08edge: Fix initial coding scheme selectionJacob Erlbeck1-12/+17
Currently the coding scheme gets reset when GprsMs::set_mode() is called even if the mode did not change. Make sure, that the CS is only reset, if it is not compliant to the new mode. Sponsored-by: On-Waves ehf
2016-02-08edge: Call update_window even if FINAL_ACK_INDICATION is setJacob Erlbeck2-10/+43
The bitvec RBB is always valid, even when FINAL_ACK_INDICATION is set. This is done by the ack/nack decoder function which fake a bitmap starting with V(A) up to V(S)-1 in that case (see Decoding::handle_final_ack). Call gprs_rlcmac_dl_tbf::update_window unconditionally and only use is_final for logging and TBF state changes in gprs_rlcmac_dl_tbf::rcvd_dl_ack. Sponsored-by: On-Waves ehf
2016-02-08edge: Use bitvec based window methods for EGPRSJacob Erlbeck1-23/+12
Currently a faked 'old' RBB with 64 ACKs is being used. Use the new bitvec based methods instead. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use bitvec based window methods for GPRSJacob Erlbeck4-5/+78
Currently the old fixed 64 bit RBB based implementation is used for GPRS. Use the new bitvec based methods instead. Sponsored-by: On-Waves ehf
2016-02-08edge: Use num_blocks in gprs_rlcmac_dl_tbf::analyse_errorsJacob Erlbeck1-5/+9
Currently a window size of 64 is being hard coded. Use the length of the show_rbb string instead. Sponsored-by: On-Waves ehf
2016-02-08edge: Add bitvec based DL window updating methodsJacob Erlbeck4-0/+118
The current methods are based on the GRPS specific RBB and SSN values and formats which are not compatible with EGPRS. Add a second set of similar methods with the same semantics but which are based on a bitvec and the first BSN instead. The following methods are affected: - gprs_rlc_dl_window::update - gprs_rlcmac_dl_tbf::rcvd_dl_ack - gprs_rlcmac_dl_tbf::update_window Sponsored-by: On-Waves ehf
2016-02-08edge: Add a bitvec based Decoding::extract_rbb functionJacob Erlbeck2-0/+13
This shall replace the old one after the transition to bitvec based RBBs. Sponsored-by: On-Waves ehf
2016-02-08decode: Add bitvec based GPRS DL ACK/NACK decoderJacob Erlbeck2-0/+51
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-08edge: Enable CRBB decodingJacob Erlbeck1-13/+1
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-08edge: Add experimental support for uplink CRBBJacob Erlbeck1-27/+67
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-08edge: Handle EGPRS PACKET DOWNLINK ACK NACKJacob Erlbeck5-0/+219
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-05edge: Workaround to fix decoding of EGPRS_AckNack_w_len_tJacob Erlbeck1-1/+1
The presence of the LENGTH field adds an additional offset which breaks the related M_SERIALIZE in gsm_rlcmac.cpp. In that case, the Desc in EGPRS_AckNack_t is being cast to EGPRS_AckNack_w_len_t and then ((EGPRS_AckNack_w_len_t *)Desc)->Desc is filled with the parsed data, which is a platform dependant number of bytes apart the real Desc struct. Remove LENGTH field from EGPRS_AckNack_w_len_t so that the Desc field is the first field. Note that this is not a real fix. The rlcmac wireshark dissector still has the same declaration but doesn't seem to suffer from this problem. Sponsored-by: On-Waves ehf
2016-02-05edge: Provide and use CS -> CPS conversionJacob Erlbeck3-0/+17
The MS' RLC receiver needs a valid CPS field to decode the block. Add the function gprs_rlc_mcs_cps to generate the CPS value based on coding scheme, puncturing, and padding. Sponsored-by: On-Waves ehf
2016-02-05edge: Support MCS data block encodingJacob Erlbeck2-0/+389
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-05edge: Select implementation by mode in rlc_data_to_dl_appendJacob Erlbeck4-22/+39
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-05edge: Use rlc_data_to_dl_append in create_new_bsnJacob Erlbeck2-125/+34
Currently TBF related tasks (status changes, counter updates, LLC dummy command insertion) as well as RLC data block generation are done within create_new_bsn. The data block creation part has already been copied to the stateless Encoding::rlc_data_to_dl_append function. This commit changes create_new_bsn to use the encoder function and just care about the TBF related stuff. Since the rlc_data_to_dl_append function has been validated against the test cases being described in annex B of TS 44.060, this commit fixes an encoder bug which leads to broken LLC frames in a special case (see example B.2, the main header's E bit was erroneously set to 1 in that case). When this happens, the LLC frame will get discarded after reassembly, so that TCP will have to retransmit the lost packet. Sponsored-by: On-Waves ehf
2016-02-05edge: Add Encoding::rlc_data_to_dl_appendJacob Erlbeck4-0/+388
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-05edge: Use RLC data block encoding functionsJacob Erlbeck2-110/+204
This commit removes the use of struct rlc_dl_header from gprs_rlcmac_dl_tbf::create_dl_acked_block and gprs_rlcmac_dl_tbf::create_new_bsn. Instead of patching the data area directly, the RLC block encoding functions are used. Note that the data unit encoding is still hard-coded to GPRS in create_new_bsn, so using MCS 1-4 (albeit being supported by the encoder) will not work yet. Sponsored-by: On-Waves ehf
2016-02-05tbf/test: Add missing function name printfsJacob Erlbeck2-0/+14
Some test function don't have the "=== start/end ===" printfs. Sponsored-by: On-Waves ehf
2016-02-05tbf: Remove obsolete TLLI functionsJacob Erlbeck4-71/+0
This commit removes gprs_rlcmac_tbf::extract_tlli and Decoding::tlli_from_ul_data. Sponsored-by: On-Waves ehf
2016-02-05edge: Add encoder for downlink RLC data blocksJacob Erlbeck4-0/+213
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