aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-29 16:39:21 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:38 +0100
commit6b356a58d1269fe4ad449bc868cbc734c6d2a28e (patch)
tree8736689113716ab1eebb56ef7055e4840700cf7b /src/tbf.h
parentf2694b74c9af6e308d3886cd3c75864d101de8d4 (diff)
tbf: Use TLLI as ID if TFI not yet assigned
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
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tbf.h b/src/tbf.h
index edb8280e..d1b286cb 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -132,6 +132,7 @@ struct gprs_rlcmac_tbf {
void update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction);
uint8_t tfi() const;
+ bool is_tfi_assigned() const;
const char *imsi() const;
void assign_imsi(const char *imsi);
@@ -310,6 +311,16 @@ inline bool gprs_rlcmac_tbf::is_tlli_valid() const
return tlli() != 0;
}
+inline bool gprs_rlcmac_tbf::is_tfi_assigned() const
+{
+ /* The TBF is established or has been assigned by a IMM.ASS for
+ * download */
+ return state > GPRS_RLCMAC_ASSIGN ||
+ (direction == GPRS_RLCMAC_DL_TBF &&
+ state == GPRS_RLCMAC_ASSIGN &&
+ (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)));
+}
+
inline uint8_t gprs_rlcmac_tbf::tfi() const
{
return m_tfi;