Unify BTS into a C usable structure

Previous work on BTS class started to get stuff out of the C++ struct
 into a C struct (BTS -> struct gprs_glcmac_bts) so that some parts of
it were accessible from C code. Doing so, however, ended up being messy
too, since all code needs to be switching from one object to another,
which actually refer to the same logical component.

Let's instead rejoin the structures and make sure the struct is
accessible and usable from both C and C++ code by rewriting all methods
to be C compatible and converting 3 allocated suboject as pointers.
This way BTS can internally still use those C++ objects while providing
a clean APi to both C and C++ code.

Change-Id: I7d12c896c5ded659ca9d3bff4cf3a3fc857db9dd
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 1596d67..92fa845 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -34,6 +34,7 @@
 	#include <osmocom/core/utils.h>
 	#include <osmocom/gsm/gsm48.h>
 	#include "coding_scheme.h"
+	#include "tbf_dl.h"
 }
 
 /* Tuning parameters for BSSGP flow control */
@@ -208,7 +209,7 @@
 	if ((rc = get_paging_mi(&mi, tp)) > 0)
 		return bssgp_tx_status((enum gprs_bssgp_cause) rc, NULL, msg);
 
-	return BTS::main_bts()->add_paging(tlvp_val8(tp, BSSGP_IE_CHAN_NEEDED, 0), &mi);
+	return bts_add_paging(the_pcu->bts, tlvp_val8(tp, BSSGP_IE_CHAN_NEEDED, 0), &mi);
 }
 
 static int gprs_bssgp_pcu_rx_paging_ps(struct msgb *msg, const struct tlv_parsed *tp)
@@ -761,8 +762,8 @@
 			} else {
 				/* We found "num" for free in the loop above */
 			}
-		} else if (bts->bts->max_mcs_dl()) {
-			num = bts->bts->max_mcs_dl();
+		} else if (bts_max_mcs_dl(bts)) {
+			num = bts_max_mcs_dl(bts);
 		} else {
 			num = 9;
 		}
@@ -782,8 +783,8 @@
 				}
 			}
 		}
-	} else if (bts->bts->max_cs_dl()) {
-		num = bts->bts->max_cs_dl();
+	} else if (bts_max_cs_dl(bts)) {
+		num = bts_max_cs_dl(bts);
 	}
 
 	if (!num)