Move first_common_ts from gprs_rlcmac_tbf to GprsMs
The field contains a common value between the 2 active TBFs of the MS,
so it makes no sense to have them duplicated on each TBF. It can be
sanely stored in the MS object.
Change-Id: I8df01a99ccbfaf7a442ade5000ee282bd638fbba
diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index 933953e..c9eaf97 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -120,6 +120,7 @@
ms->current_cs_ul = UNKNOWN;
ms->current_cs_dl = UNKNOWN;
ms->is_idle = true;
+ ms->first_common_ts = TBF_TS_UNSET;
INIT_LLIST_HEAD(&ms->list);
INIT_LLIST_HEAD(&ms->old_tbfs);
@@ -383,6 +384,7 @@
if (!ms->dl_tbf && !ms->ul_tbf) {
ms_set_reserved_slots(ms, NULL, 0, 0);
+ ms->first_common_ts = TBF_TS_UNSET;
if (ms_tlli(ms) != 0)
ms_release_timer_start(ms);
@@ -918,15 +920,15 @@
return cs;
}
-int ms_first_common_ts(const struct GprsMs *ms)
+int8_t ms_first_common_ts(const struct GprsMs *ms)
{
- if (ms->dl_tbf)
- return tbf_first_common_ts(dl_tbf_as_tbf(ms->dl_tbf));
+ return ms->first_common_ts;
+}
- if (ms->ul_tbf)
- return tbf_first_common_ts(ul_tbf_as_tbf(ms->ul_tbf));
-
- return -1;
+void ms_set_first_common_ts(struct GprsMs *ms, uint8_t first_common_ts)
+{
+ OSMO_ASSERT(first_common_ts < 8);
+ ms->first_common_ts = first_common_ts;
}
uint8_t ms_dl_slots(const struct GprsMs *ms)