aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-27 11:16:20 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:12 +0100
commit750ca67ce9c08e775caa70788686de82819b7bfb (patch)
treec912f407168ef5fe7f7c72d72684d3902ae929ef /src
parent842808848cb5523d8e4726f43ded933b651a9f84 (diff)
bts: Move the MT_PACKET_MEASUREMENT_REPORT handling to a new method
Diffstat (limited to 'src')
-rw-r--r--src/bts.cpp32
-rw-r--r--src/bts.h1
2 files changed, 19 insertions, 14 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index b84e807f..b9dbaf8e 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1097,13 +1097,27 @@ void gprs_rlcmac_pdch::rcv_resource_request(RlcMacUplink_t *ul_control_block, ui
LOGP(DRLCMAC, LOGL_ERROR, "RX: [PCU <- BTS] %s TFI: %u TLLI: 0x%08x FIXME: Packet resource request\n", (tbf->direction == GPRS_RLCMAC_UL_TBF) ? "UL" : "DL", tbf->tfi, tbf->tlli);
}
+void gprs_rlcmac_pdch::rcv_measurement_report(RlcMacUplink_t *ul_control_block, uint32_t fn)
+{
+ struct gprs_rlcmac_sba *sba;
+
+ sba = bts()->sba()->find(this, fn);
+ if (!sba) {
+ LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement "
+ "in packet resource request of single "
+ "block, but there is no resource request "
+ "scheduled!\n");
+ } else {
+ bts()->timing_advance()->remember(ul_control_block->u.Packet_Measurement_Report.TLLI, sba->ta);
+ bts()->sba()->free_sba(sba);
+ }
+ gprs_rlcmac_meas_rep(&ul_control_block->u.Packet_Measurement_Report);
+}
+
/* Received Uplink RLC control block. */
int gprs_rlcmac_pdch::rcv_control_block(
bitvec *rlc_block, uint32_t fn)
{
- struct gprs_rlcmac_sba *sba;
- int rc;
-
RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t);
LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n");
decode_gsm_rlcmac_uplink(rlc_block, ul_control_block);
@@ -1120,17 +1134,7 @@ int gprs_rlcmac_pdch::rcv_control_block(
rcv_resource_request(ul_control_block, fn);
break;
case MT_PACKET_MEASUREMENT_REPORT:
- sba = bts()->sba()->find(this, fn);
- if (!sba) {
- LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement "
- "in packet resource request of single "
- "block, but there is no resource request "
- "scheduled!\n");
- } else {
- bts()->timing_advance()->remember(ul_control_block->u.Packet_Measurement_Report.TLLI, sba->ta);
- bts()->sba()->free_sba(sba);
- }
- gprs_rlcmac_meas_rep(&ul_control_block->u.Packet_Measurement_Report);
+ rcv_measurement_report(ul_control_block, fn);
break;
case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK:
/* ignoring it. change the SI to not force sending these? */
diff --git a/src/bts.h b/src/bts.h
index fcc30eee..f15e7117 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -84,6 +84,7 @@ private:
void rcv_control_ack(RlcMacUplink_t *, uint32_t fn);
void rcv_control_dl_ack_nack(RlcMacUplink_t *, uint32_t fn);
void rcv_resource_request(RlcMacUplink_t *t, uint32_t fn);
+ void rcv_measurement_report(RlcMacUplink_t *t, uint32_t fn);
#endif
};