aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.h
AgeCommit message (Collapse)AuthorFilesLines
2016-01-22Get rid of duplicated timer codeMax1-1/+1
Sponsored-by: On-Waves ehf
2015-12-16edge: Remove unused GPRS functionsJacob Erlbeck1-4/+0
This commit removes the code that is no longer used due to the commit "Use a single PDCH rcv_data_block method for GPRS and EGPRS". Sponsored-by: On-Waves ehf
2015-12-16edge: Add methods for unified GPRS/EGPRS UL data block handlingJacob Erlbeck1-0/+6
The current rcv_data_block_acknowledged_gprs method is tightly coupled to GPRS. This commit adds variants of the involved methods that support EGPRS and GPRS RLC encodings likewise. Sponsored-by: On-Waves ehf
2015-12-16tbf: Refactor parts of extract_tlli into set_tlli_from_ulJacob Erlbeck1-0/+1
Currently gprs_rlcmac_tbf::extract_tlli takes care of decoding and the TBF update. These are really different things and doing the decoding in extract_tlli makes EGPRS support more complex. This commit moves the TBF state related part into a new method gprs_rlcmac_tbf::set_tlli_from_ul. Sponsored-by: On-Waves ehf
2015-12-15edge: Rename rcv_data_block_acknowledgedJacob Erlbeck1-1/+1
This commit renames rcv_data_block_acknowledged to rcv_data_block_acknowledged_gprs to separate it from EGPRS data block decoding. Sponsored-by: On-Waves ehf
2015-12-15edge: Extend gprs_rlcmac_dl_tbf::handle by egprs_ms_classJacob Erlbeck1-1/+2
The multislot (MS) class and the EGPRS MS class can also be passed via BSSGP in an MS Radio Access Capability element which can optionally be contained in a DL-UNITDATA PDU. While this case is fully supported for GPRS, the EGPRS MS class in BSSGP messages is ignored. This commit extends gprs_rlcmac_dl_tbf::handle to pass the EGPRS MS class, too. Note, that the EGPRS class is not yet taken from the CSN.1 RA capability and is always set to 0. Note also, that append_data still uses ms_class only. Sponsored-by: On-Waves ehf
2015-12-15edge: Support EGPRS multislot class handling in tbf_allocJacob Erlbeck1-3/+3
Add an egprs_ms_class argument to the allocation functions and set/pass it where necessary. Sponsored-by: On-Waves ehf
2015-12-15edge: Add m_egprs_enabled and related methods to TBFJacob Erlbeck1-0/+22
Add the following methods to gprs_rlcmac_tbf: - is_egprs_enabled - enable_egprs - disable_egprs Also show the value of the flag in name() by displaying "EGPRS" if it is set. Sponsored-by: On-Waves ehf
2015-09-11bssgp: Use measured leak rate for flow controlJacob Erlbeck1-1/+8
The leak rate sent to the SGSN does not reflect the current CS level, lost frames, and control message overhead. So the SGSN cannot do proper queue control under non-optimal conditions. This commit computes the leak rate for the last flow control interval by computing the maximum theoretical leak rate and basically substracting control blocks, nacked blocks, and reduced block sizes due to CS downgrade. By using this approach, the value will by more stable on low load, where the value will tend to be near the value derived from the configuration. On full load the transmitted value is completely derived from the measurements. Note that the MS default values are no adapted to the adapted BVC leak rate, since a single MS which has a lower link quality would otherwise be reducing the rate of another MS with good radio conditions, which would not make much sense if they did not share any PDCH. Sponsored-by: On-Waves ehf
2015-09-01tbf: Refactor reuse_tbf into releasing and DL TBF establishmentJacob Erlbeck1-0/+2
Currently reuse_tbf (partly) resets the old DL TBF and uses its PACCH to establish a new DL TBF. The method can not be used with UL TBFs. This commit replaces the reuse_tbf method into a gprs_rlcmac_dl_tbf:release method which triggers the TBF's timer based deletion (so that the TFI is still reserved for some time) and a gprs_rlcmac_tbf::establish_dl_tbf_on_pacch which can establish DL TBFs on existing PACCHs of either DL or UL TBFs. Sponsored-by: On-Waves ehf
2015-08-28tbf: Use explicit initialisations in constructor (Coverity)Jacob Erlbeck1-5/+9
Currently when allocating tbf_alloc_ul_tbf or tbf_alloc_dl_tbf objects, the allocated memory area is pre-initialised by talloc_zero before the C++ constructors are called. This is not recognised by Coverity, since there is no talloc model file yet. Thus Coverity complains about missing initialisers. On the other hand, it is still planned to convert the TBF classes into real C++ ones. So instead of silencing Coverity directly, this is an opportunity to do it the C++ way. This commit adds initialisers and initialisation code for all members that relied on talloc_zero. The corresponding calls to talloc_zero are replaced by calls to talloc to give ASAN/valgrind a chance to detect future initialisation errors. Some initialisation code is also moved from setup_tbf to the constructors, notably the initialisation of the bts pointer. Fixes: Coverity CID 1320604, 1320605, 1320606 Sponsored-by: On-Waves ehf
2015-08-24ms: Store references to replaced TBFs in the MS objectJacob Erlbeck1-0/+6
Currently when calling GprsMs::attach_tbf and a TBF of the same direction already exists, the old TBF gets detached from the MS object. Therefore that TBF object loses access to that MS object including for instance TLLI and IMSI. This leads to failing DL TBF reuses, since the downlink assigment cannot be sent on the PACCH later on because that must be sent on the old DL TBF which ms() is NULL and the new DL TBF cannot be retrieved. This commit fixes this bug by changing the GprsMs implementation to keep a list of replaced (old) TBFs. TBFs are only removed when they are being detached explicitely (see tbf_free and set_ms). Addresses: tbf.cpp:741 We have a schedule for downlink assignment at uplink TBF(TFI=1 TLLI=0xf35a680e DIR=UL STATE=RELEASING), but there is no downlink TBF Sponsored-by: On-Waves ehf
2015-08-24tbf: Use C++/talloc magic to support TBF constructors/destructorsJacob Erlbeck1-0/+5
The TBF object are currently created by using talloc_zero/talloc_free directly from plain functions. Therefore C++ constructors and destructors are not called. So the only initialisation that is done is setting every member to 0. Non POD members do not have their constructors called either, which makes it impossible to use the current LListHead class for real members when the LListHead::m_back member has to be set. This commit changes the TBF allocation functions to call the corresponding C++ constructor after the call to talloc_zero and to register the C++ destructor with the talloc context, so that is is called before talloc_free actually frees the memory. With this change, non-POD members and custom constructors/desctructors can be used with gprs_rlcmac_tbf, gprs_rlcmac_dl_tbf, and gprs_rlcmac_ul_tbf. Note that this change is only a single step of the plan to turn the TBF classes into real C++ classes. Sponsored-by: On-Waves ehf
2015-08-17tbf: Clean old MS objects if they have the same TLLIJacob Erlbeck1-0/+1
Currently if an MS retries to access the PCU by using RACH and if there is already an entry for that MS, a duplicated MS object referring to the same TLLI is created. This is caused by blindly setting the TLLI without querying the MS storage to avoid inconsitencies. This leads to several entries in the MS storage that are assigned to the same TLLI. If that happens, 'show ms all' can display multiple entries with the same TLLI (note that an MS object can belong to several TLLIs, so there might be an intersection that is not visible in the list) or 'show tbf all' can show entries with MS_CLASS == 0 in some cases. This commit changes update_ms() to merge and clean up old entries that belong to the given TLLI if they exist. Some data (like the MS class) is copied to the new MS object. Note that TBF belonging to the old MS object are deleted immediately if they have not registered a timer. Sponsored-by: On-Waves ehf
2015-07-16tbf: Move TFI selection into alloc_algorithmJacob Erlbeck1-3/+2
Currently the TFI and the TRX have to be determined before the actual TBF allocation function is called, passing TFI and TRX number as parameters. This does fit to TFI reuse for different slots, since this were tightly coupled with the slot selection. This commit just moves the TFI selection into the alloc_algorithm functions. The tfi parameter is removed from the the TFI alloc functions. The trx parameter is changed into use_trx to optionally limit the trx selection (same semantics like in tfi_find_free). Sponsored-by: On-Waves ehf
2015-07-03Revert "tbf: Add GprsMs* argument to update() and use it in reuse_tbf"Jacob Erlbeck1-1/+1
This reverts commit 2272a83a13b57ea7e99fe96ac76e4ad892e19e90. The modification is no longer needed, since the call to update has been removed from reuse_tbf(). Conflicts: src/tbf_dl.cpp Sponsored-by: On-Waves ehf
2015-07-03ms: Get the set of slots currently activeJacob Erlbeck1-0/+2
This commits adds methods to GprsMs and gprs_rlcmac_tbf to retrieve the slots that are actively used. Sponsored-by: On-Waves ehf
2015-07-03tbf: Add GprsMs* argument to update() and use it in reuse_tbfJacob Erlbeck1-1/+1
Since set_ms() is caled on the new DL TBF, the old DL TBF loses the reference to the MS object. This will lead to a segfault, when update() is called in reuse_tbf(). This commit adds an optional GprsMs* parameter to update() and uses it for the slot allocation. This fixes a TbfTest crash that would otherwise occur after applying the next commit. Sponsored-by: On-Waves ehf
2015-07-03ms: Add tbf() method to get the TBF based on the directionJacob Erlbeck1-0/+5
To avoid the need for a switch or conditional statement when needing a TBF from an MS object in direction independant code, this method contains that case distinction. For additional flexibility, a reverse() function is added to get the opposite direction. Sponsored-by: On-Waves ehf
2015-06-29tbf: Pass the MS object around instead of old_tbfJacob Erlbeck1-4/+3
Currently the old TBF (either uplink or downlink) is passed around at TBF allocation mainly to get information about the MS. To implement more complex allocation algorithms, the MS object itself will be needed anyway. This commit replaces the old_tbf arguments by MS object arguments. Sponsored-by: On-Waves ehf
2015-06-29tbf: Remove update_tlli methodJacob Erlbeck1-1/+0
This method does not do anything anymore, it's functionality has been taken over by update_ms. This commit removes gprs_rlcmac_tbf::update_tlli completely. Sponsored-by: On-Waves ehf
2015-06-22tbf: Fix downlink packet lossJacob Erlbeck1-1/+2
When the MS is pinged with a longer interval, many packets get lost even if the GprsMs object is kept. If the interval is above the time where the DL TBF is in state FLOW (mainly influenced be the dl-tbf-idle-time command), an new TBF must be requested via AGCH for each ICMP PING message. Currently the LLC frame containing the PING is immediately stored in the TBF and gets lost, if TBF establishment fails for some reason. This commit moves all calls to put_frame() to schedule_next_frame(), where the data is moved from the LLC queue to the frame storage within the TBF object. This method is only called from within create_new_bsn() when the TBF is in the FLOW state and the frame is going to be encoded immediately. At all other places, where put_frame() has been called before, the LLC message is just appended to the LLC queue in the GprsMs object. This change effectively simplifies the related code parts, since date/len information and discard notifications is no longer needed there. Ticket: #1759 Sponsored-by: On-Waves ehf
2015-06-22l1: Pass all L1 measurements upwardsJacob Erlbeck1-1/+3
Currently only the RSSI value is passed to the upper layers. Other values like TA and BER which are needed for TA update respectively CS selection are not propagated. This commit introduces and passes a struct that contains a set of measurement values. Sponsored-by: On-Waves ehf
2015-06-08tbf: Add adaptive DL CS adjustmentJacob Erlbeck1-0/+1
To cope with transmission failures due to bad radio conditions, a different coding scheme with more redundance can be used. This commit adds an implemenation that is based on the Ack/Nack ratio per PACKET DOWNLINK ACK/NACK message received from the MS. Basically the CS level is decreased, if the block error rate goes above cs_adj_upper_limit (default 33%), and it is increased, if the rate drops below cs_adj_lower_limit (default 10%). Only blocks that have been encoded with the current CS are taken into account. Note that this approach doesn't measure the MS->BTS conditions and that the measurement values reported by the MS are not taken into account. Ticket: #1739 Sponsored-by: On-Waves ehf
2015-06-08tbf: Move the current CS field to GprsMsJacob Erlbeck1-2/+1
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-06-08tbf: Store MS class in GprsMs objectsJacob Erlbeck1-2/+4
The ms_class value is a property of the MS and thus belongs to the GprsMs class. Nevertheless the MS object is created after the TLLI gets known, so the value still has to be stored in the TBF initially. This commit add the ms_class value to the GprsMs class and introduces TBF accessor functions which either access that object or, if that is not available, the value stored locally. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-06-08tbf: Move the LLC queue to GprsMsJacob Erlbeck1-11/+0
Currently the enqueued DL LLC messages which have not yet passed to RLC/MAC encoding are eventually copied from one TBF to the next one (see gprs_rlcmac_dl_tbf::reuse_tbf). Since the enqueued LLC messages are related to a specific MS, they should be stored at that layer. This commit moves the gprs_llc_queue object to GprsMs and changes the TBF's accessor methods accordingly. The LLC copying code is removed from gprs_rlcmac_dl_tbf::reuse_tbf(). Sponsored-by: On-Waves ehf
2015-06-08tbf: Make the ms() getter method constJacob Erlbeck1-2/+2
Currently this method cannot be used in other const methods. This commit adds the missing const keyword. Sponsored-by: On-Waves ehf
2015-06-08llc: Separate LLC queue handling from gprs_llcJacob Erlbeck1-0/+14
Currently the gprs_llc class handles both LLC queueing and the partition into smaller pieces for RLC/MAC encapsulation. This hinders the separation of TBF and MS related data, since LLC queueing belongs to the MS related code while the RLC/MAC encoding/decoding belongs to the TBF layer. This commits takes the LLC queueing related methods and members and puts them into a new class gprs_llc_queue. It puts the queueing object into gprs_rlcmac_tbf and adds accessor functions. The implementation in tbf.cpp and tbf_dl.cpp is adapted accordingly. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-28tbf: Store the timing advance (TA) value in the GprsMs objectJacob Erlbeck1-1/+5
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
2015-05-28tbf: Remove TBF chaining (m_new_tbf and m_old_tbf)Jacob Erlbeck1-11/+0
Currently a new TBF is chained to an existing older one, either of the other direction (active or releasing) or of the same direction (releasing). This does not work properly work if and uplink and a downlink TBF are being established at the same time while an old TBF is being released. In that case, one of them is thrown away and the pending procedure is cancelled. The chaining is no longer necessary since the GprsMs objects have been introduced which keep track of the active TBFs. This commit removes the TBF members m_new_tbf and m_old_tbf and the related methods and code paths. Note that a new TBF can replace an older TBF entry of the same direction within an MS object when it is associated with an MS (e.g. by TLLI or because it is assigned via another, already associated TBF). In that case, the old TBF is no longer associated with an MS object. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-28tbf: Move IMSI to MS objectJacob Erlbeck1-8/+0
Currently the IMSI is stored in the TBFs. Since it directly refers to an MS, it should rather be stored in an MS object. This patch move the m_imsi field from gprs_rlcmac_tbf to GprsMs, changes gprs_rlcmac_tbf::imsi() to get the IMSI from the associated MS object, and adds getter and setter to GprsMs. Before changing the IMSI of the associated MS object, assign_imsi() checks if there is already another MS object with the same IMSI and eventually resets the IMSI of that one. So using update_ms() and assign_imsi() ensures that there are not two MS object entries is the storage with the same TLLI or the same IMSI. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-27tbf: Remove the TLLI from the TBFsJacob Erlbeck1-4/+1
Currently the TLLI is stored in each TBF. Since each MS is now represented by a GprsMs object which takes care of TLLI updating, and each TBF that has been associated with an TLLI also contains a reference to a GprsMs object, per TBF TLLI handling is no longer needed. Keeping all TBF m_tlli members up to date is complex and doesn't currently work correctly in all circumstances. This commit removes m_tlli and related members from the TBF class and the tbf_by_tlli functions from the BTS class. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-21tbf: Explicitly pass the direction to update_ms()Jacob Erlbeck1-1/+1
The type of the TBF update_ms() is being called on does not always reflect whether the TLLI has been signaled by the MS or the SGSN. This commit adds an additional parameter to tell the method, in which direction the TLLI has been passed. Sponsored-by: On-Waves ehf
2015-05-21tbf: Get the TLLI from the MS objectJacob Erlbeck1-5/+0
Since the synchronisation of the TBF's concerning the TLLIs has been removed in 'Support new and old TLLI's', gprs_rlcmac_tbf::tlli() can return the old TLLI which is probably different to ms()->tlli() in that case. This can lead to a wrong TLLI being used in BSSGP messages. This commit modifies the TBF's tlli() method to get the current TLLI from the MS object. Sponsored-by: On-Waves ehf
2015-05-21ms: Support new and old TLLIsJacob Erlbeck1-1/+2
According to the specification (GSM 04.08/24.008, 4.7.1.5) after a new P-TMSI has been assigned, the old P-TMSI must be kept basically until it has been used by both sides. Since the TLLI will be derived from the P-TMSI, the old TLLI must also be kept until the new TLLI has been used by both MS and SGSN. This commit modifies the TLLI handling of GprsMs accordingly. set_tlli() is only used with TLLIs derived from MS messages, confirm_tlli() is used with TLLIs derived from messages received from the SGSN. tlli() returns the value set by the MS. check_tlli() matches each of the TLLI used by either MS or SGSN as well as the old TLLI until it has been confirmed. Sponsored-by: On-Waves ehf
2015-05-20tbf: Add MS object management to TBF codeJacob Erlbeck1-0/+13
This commit adds MS object creation and cleanup to the TBF related code. MS objects are created when a TBF that has been "anonymous" so far gets associated with a TLLI. When a TBF is replaced by another, the old TBF is detached and the new one is attached to the MS. When all TBFs have been detached, the MS object gets deleted. The TBF related code should not call attach_tbf/detach_tbf directly but use set_ms instead to make sure, that the references are updated properly. GprsMs::detach_tbf also calls set_ms(NULL) on the detached TBF object. The MS object is not really used yet, the focus is still on object creation, TBF association, and cleanup. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-04vty: Fix warnings about undeclared functionsJacob Erlbeck1-2/+1
This commit adds missing includes to pcu_vty.c and fixes the llist_head type (missing struct keyword) used by tbf_print_vty_info. Sponsored-by: On-Waves ehf
2015-04-02tbf: Force ACK after the last DL LCC frame has been receivedJacob Erlbeck1-0/+5
If the protocol layers above LLC (e.g. TCP) need an acknowledgement to continue, it can take up to 400ms (single TS) until the MS is polled for Ack/Nack which it can use to request an uplink TBF quickly. The 400ms result from requesting an DL Ack/Nack every 20 RLC blocks until all pending LLC frames have been sent. Especially TCP's slow start mechanism can lead to a high delay at the start of the connection, since the sender will eventually stop after having sent the first packets (up to 4 (RFC2581) or 10 (RFC6928)). This commit modifies append_data() to (re-)start a timer every time it handles an LLC packet and to request an Ack/Nack every time it expires. So if the server ceases to send IP packets, the MS is polled in the assumption, that the server is waiting for an ACK. The following VTY commands are added (pcu node): - queue idle-ack-delay <1-65535> timeout in centiseconds - no queue idle-ack-delay disable this feature (default) A sensible value is 10 (100ms) that at gave promising results when testing locally. Sponsored-by: On-Waves ehf
2015-03-25tbf: Implement delayed release of a downlink TBFJacob Erlbeck1-0/+3
Currently a DL TBF is immediately closed, when the LLC queue is drained. This will lead to a new DL assignment if data is received afterwards. In addition, it is not possible to keep the PACCH open to poll the MS for UL establishment requests there. GSM 44.060, 9.3.1a suggests to delay the release of an inactive TBF for some time (max 5s). This commit mainly changes create_new_bsn() to send LLC dummy commands as filler if no LLC data is available until keep_open() returns false. The keep_open() functions returns true unless a configurable time has passed after the LLC data store drained. By default, that time is not set which causes keep_open() to always return false, so that delayed release is effectively disabled. The following VTY commands are added: - dl-tbf-idle-time <1-5000> to set the delay in ms - no dl-tbf-idle-time to disable delayed release Ticket: #556 Sponsored-by: On-Waves ehf
2015-03-25tbf: Add frames_since_last_poll methodJacob Erlbeck1-0/+2
This functions calculates the number of frames that have passed since the last DL poll (RRBP flag set) has been sent. It returns a value less than zero (fn_now - fn_sched) if the block has been scheduled but not yet sent. If the function is called before the first data block has been sent it will return -1. If the function is called before the first DL poll is sent, it returns the number of frames since the first data block has been sent. Sponsored-by: On-Waves ehf
2015-03-25tbf: Add helper functions for DL TBFsJacob Erlbeck1-0/+6
Some properties of a DL TBF are explicitly calculated within modules using DL TBFs. This commit introduces the methods need_control_ts(), have_data(), is_control_ts() to hide internals of the DL TBF implementation. Sponsored-by: On-Waves ehf
2015-03-12tbf: Fix scheduling for DL Ack/Nack requestJacob Erlbeck1-1/+3
Currently the DL Ack/Nack is not requested, if the last chunk of the final LLC frame in the TBF fits exactly into the remaining space of the RLC block. It is also not requested, if the RRBP flag cannot be set due to scheduling issues (single block allocation, polling already pending for this TBF, ...). So up to POLL_ACK_AFTER_FRAMES (20) RLC data blocks will have to be resent, before requesting the Ack/Nack will be retried. This commit removes the first_fin_ack parameter of create_dl_acked_block entirely and adds a request_dl_ack() method that should be called, when the TBF's state changes to FINISHED. This request will be reset, when the block has been scheduled successfully. Since the first_fin_ack hasn't been set if chunk == space, calling request_dl_ack() on both places in create_new_bsn() when the state is changed to FINISHED will also fix the first issue described above. Note that DL scheduling might not be fair concerning access to first_ts when multiple TS are used for a TBF. In theory, a TBF might never get access to first_ts in the worst case. Sponsored-by: On-Waves ehf
2015-03-06tbf: Add name() method and put the buf into the tbfJacob Erlbeck1-0/+5
Currently tbf_name() must not be used twice in a printf statement with different TBFs, since the same baffer will be used for each. This commit puts the text buffer into struct gprs_rlcmac_tbf to avoid this problem. Sponsored-by: On-Waves ehf
2015-02-23tbf: Fix dangling m_new_tbf pointerJacob Erlbeck1-0/+1
Currently if a 'new' TBF is freed before the 'old' one (where old_tbf->m_new_tbf == new_tbf), the old_tbf->m_new_tbf is not cleared and can be accessed later on. This can lead to inconsistencies or segmentation faults. This commit adds m_old_tbf which points back from new_tbf to old_pdf. m_new_tbf and m_old_tbf are either both set to NULL or one is the reverse pointer of the other (tbf->m_new_tbf->m_old_tbf == tbf and tbf->m_old_tbf->m_new_tbf == tbf). It extends set_new_tbf and tbf_free to update the pointee accordingly. The TBF test is extended to check this invariant at several places. Sponsored-by: On-Waves ehf
2014-09-10tbf,bts: Keep track of new TBF for dl/ul assignment in m_new_tbfDaniel Willmann1-0/+10
There are a couple of possibilities where one TBF is used to assign a new one: 1. Assign a DL TBF from a UL TBF 2. Assign a UL TBF from a DL TBF 3. Assign a DL TBF from a DL TBF which is in wait-release state (T3193 is running) In these cases the assignment is sent on the existing TBF and triggers the assignement of the new TBF (with different TFI/direction). The current code detects these situations by looking at dl/ul_ass_state and then chosing the TBF with the opposite direction (DL/UL) that has the same TLLI. This does not work in the case 3 above where a new DL TBF is triggered for a DL TBF. The current code reuses the old TBF (and TFI), but this violates the spec. This patch introduces a m_new_tbf member which is set to the new TBF to be assigned. When receiving a control ack the code looks up the n_new_tbf member of the tbf that requested the control ack and completes the ul/dl assignment. If the old TBF was in the wait release state (T3193 is running) it is released. From 3GPP TS 04.60 9.3.2.6: """ If the network has received the PACKET DOWNLINK ACK/NACK message with the Final Ack Indicator bit set to '1' and has new data to transmit for the mobile station, the network may establish a new downlink TBF for the mobile station by sending the PACKET DOWNLINK ASSIGNMENT or PACKET TIMESLOT RECONFIGURE message with the Control Ack bit set to '1' on PACCH. In case the network establishes a new downlink TBF for the mobile station, the network shall stop timer T3193. """ reuse_tbf() is modified to allocate a new TBF with a new TFI and trigger a dl assignment for that TBF on the old TBF. All pending data is moved to the new TBF. Ticket: SYS#382 Sponsored-by: On-Waves ehf
2014-08-15tbf: Include TBF state in tbf_name outputDaniel Willmann1-0/+6
Sponsored-by: On-Waves ehf
2014-08-08tbf, bts: Use tbf set_state method instead of tbf_new_state functionDaniel Willmann1-5/+7
All the function did was add debug output and call the set_state method. Move the debugging into the method and remove the function. Ticket: SYS#389 Sponsored by: On-Waves ehf
2014-08-08tbf, gprs_rlcmac_meas: Move the DL bandwidth variables to the DL TBFDaniel Willmann1-8/+9
The bandwidth calculation as well as loss report is only done for DL TBF so move everything related to that in there. Ticket: SYS#389 Sponsored by: On-Waves ehf
2014-08-08tbf: Make llc_dequeue a method of DL TBFDaniel Willmann1-3/+3
llc_dequeue is only used in DL TBF to send the data from the BSSGP to the MS. Ticket: SYS#389 Sponsored by: On-Waves ehf