tbf, gprs_rlcmac_meas: Move the DL bandwidth variables to the DL TBF

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
diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp
index 30958fc..5a2e38e 100644
--- a/src/gprs_rlcmac_meas.cpp
+++ b/src/gprs_rlcmac_meas.cpp
@@ -112,10 +112,10 @@
  */
 
 /* Lost frames reported from RLCMAC layer */
-int gprs_rlcmac_received_lost(struct gprs_rlcmac_tbf *tbf, uint16_t received,
+int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received,
 	uint16_t lost)
 {
-	struct timeval now_tv, *loss_tv = &tbf->meas.dl_loss_tv;
+	struct timeval now_tv, *loss_tv = &tbf->m_bw.dl_loss_tv;
 	uint32_t elapsed;
 	uint16_t sum = received + lost;
 
@@ -126,8 +126,8 @@
 	LOGP(DRLCMACMEAS, LOGL_DEBUG, "DL Loss of TLLI 0x%08x: Received: %4d  "
 		"Lost: %4d  Sum: %4d\n", tbf->tlli(), received, lost, sum);
 
-	tbf->meas.dl_loss_received += received;
-	tbf->meas.dl_loss_lost += lost;
+	tbf->m_bw.dl_loss_received += received;
+	tbf->m_bw.dl_loss_lost += lost;
 
 	gettimeofday(&now_tv, NULL);
 	elapsed = ((now_tv.tv_sec - loss_tv->tv_sec) << 7)
@@ -139,16 +139,16 @@
 
 	/* reset lost values and timestamp */
 	memcpy(loss_tv, &now_tv, sizeof(struct timeval));
-	tbf->meas.dl_loss_received = 0;
-	tbf->meas.dl_loss_lost = 0;
+	tbf->m_bw.dl_loss_received = 0;
+	tbf->m_bw.dl_loss_lost = 0;
 
 	return 0;
 }
 
 /* Give Lost report */
-int gprs_rlcmac_lost_rep(struct gprs_rlcmac_tbf *tbf)
+int gprs_rlcmac_lost_rep(struct gprs_rlcmac_dl_tbf *tbf)
 {
-	uint16_t sum = tbf->meas.dl_loss_lost + tbf->meas.dl_loss_received;
+	uint16_t sum = tbf->m_bw.dl_loss_lost + tbf->m_bw.dl_loss_received;
 
 	/* No measurement values */
 	if (!sum)
@@ -156,7 +156,7 @@
 
 	LOGP(DRLCMACMEAS, LOGL_INFO, "DL packet loss of IMSI=%s / TLLI=0x%08x: "
 		"%d%%\n", tbf->imsi(), tbf->tlli(),
-		tbf->meas.dl_loss_lost * 100 / sum);
+		tbf->m_bw.dl_loss_lost * 100 / sum);
 
 	return 0;
 }
@@ -166,12 +166,12 @@
  * downlink bandwidth
  */
 
-int gprs_rlcmac_dl_bw(struct gprs_rlcmac_tbf *tbf, uint16_t octets)
+int gprs_rlcmac_dl_bw(struct gprs_rlcmac_dl_tbf *tbf, uint16_t octets)
 {
-	struct timeval now_tv, *bw_tv = &tbf->meas.dl_bw_tv;
+	struct timeval now_tv, *bw_tv = &tbf->m_bw.dl_bw_tv;
 	uint32_t elapsed;
 
-	tbf->meas.dl_bw_octets += octets;
+	tbf->m_bw.dl_bw_octets += octets;
 
 	gettimeofday(&now_tv, NULL);
 	elapsed = ((now_tv.tv_sec - bw_tv->tv_sec) << 7)
@@ -181,11 +181,11 @@
 
 	LOGP(DRLCMACMEAS, LOGL_INFO, "DL Bandwitdh of IMSI=%s / TLLI=0x%08x: "
 		"%d KBits/s\n", tbf->imsi(), tbf->tlli(),
-		tbf->meas.dl_bw_octets / elapsed);
+		tbf->m_bw.dl_bw_octets / elapsed);
 
 	/* reset bandwidth values timestamp */
 	memcpy(bw_tv, &now_tv, sizeof(struct timeval));
-	tbf->meas.dl_bw_octets = 0;
+	tbf->m_bw.dl_bw_octets = 0;
 
 	return 0;
 }