aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-13 13:33:12 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-20 11:36:12 +0200
commite43460b50fc152026ab96b5095b94fbac6939ab2 (patch)
treebe82e5062fa68f19a4bd660394a77104728e5560 /src/bts.cpp
parent536708617505a017b6b263a32f592471913ec464 (diff)
ms: Integrate the MS storage
Use the MS storage to find a MS object for a given TLLI instead of searching the TBF lists. The TBFs are then taken from the MS object, if one has been found. If all TBF might be temporarily detached from the MS object, a GprsMs::Guard is added to prevent the deletion of the object, in case another TBF gets attached later on in the scope. Ticket: #1674 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/bts.cpp')
-rw-r--r--src/bts.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index d027993a..8d4f4942 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -884,13 +884,21 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
int rc;
if (request->ID.UnionType) {
- struct gprs_rlcmac_ul_tbf *ul_tbf;
- struct gprs_rlcmac_dl_tbf *dl_tbf;
+ struct gprs_rlcmac_ul_tbf *ul_tbf = NULL;
+ struct gprs_rlcmac_dl_tbf *dl_tbf = NULL;
uint32_t tlli = request->ID.u.TLLI;
uint8_t ms_class = 0;
uint8_t ta;
- ul_tbf = bts()->ul_tbf_by_tlli(tlli);
+ GprsMs *ms = bts()->ms_by_tlli(tlli);
+ /* Keep the ms, even if it gets idle temporarily */
+ GprsMs::Guard guard(ms);
+
+ if (ms) {
+ ul_tbf = ms->ul_tbf();
+ dl_tbf = ms->dl_tbf();
+ }
+
if (ul_tbf) {
LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
"TLLI=0x%08x while %s still "
@@ -900,7 +908,7 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
ul_tbf = NULL;
}
- if ((dl_tbf = bts()->dl_tbf_by_tlli(tlli))) {
+ if (dl_tbf) {
LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
"TLLI=0x%08x while %s still exists. "
"Killing pending DL TBF\n", tlli,