aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-30 17:14:26 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-11-04 21:39:42 +0100
commitd87722d03c162971f5164ce9341053a82674e234 (patch)
treec4d2851c83cd1e0cb21cc1553cc3e9f58b3b924c /src/gprs_bssgp_pcu.cpp
parent46fd7a0316632bfce429ae42d0f446699f2592dd (diff)
pcuif: Improve BTS-supported CS/MCS handling
Take into account the MCS values supported by the BTS. In osmo-bts, in general all MCS are enabled if "mode egprs" is selected in BSC, and none otherwise. Change-Id: Ie8f0215ba17da1e545e98bec9325c02f1e8efaea
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r--src/gprs_bssgp_pcu.cpp41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 671629bd..4b5582d3 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -738,40 +738,49 @@ static int get_and_reset_measured_leak_rate(int *usage_by_1000, unsigned num_pdc
static enum CodingScheme max_coding_scheme_dl(struct gprs_rlcmac_bts *bts)
{
- int num;
+ int num = 0;
+ int i;
if (bts->egprs_enabled) {
if (!bts->cs_adj_enabled) {
- if (bts->initial_mcs_dl)
+ if (bts->initial_mcs_dl) {
num = bts->initial_mcs_dl;
- else
- num = 1;
+ } else {
+ for (i = 8; i >= 0; i--) {
+ if (bts->mcs_mask & (1 << i)) {
+ num = i + 1;
+ break;
+ }
+ }
+ }
} else if (bts->max_mcs_dl) {
num = bts->max_mcs_dl;
} else {
num = 9;
}
- return mcs_get_egprs_by_num(num);
+ if (num)
+ return mcs_get_egprs_by_num(num);
}
if (!bts->cs_adj_enabled) {
- if (bts->initial_cs_dl)
+ if (bts->initial_cs_dl) {
num = bts->initial_cs_dl;
- else if (bts->cs4)
- num = 4;
- else if (bts->cs3)
- num = 3;
- else if (bts->cs2)
- num = 2;
- else
- num = 1;
+ } else {
+ for (i = 3; i >= 0; i--) {
+ if (bts->cs_mask & (1 << i)) {
+ num = i + 1;
+ break;
+ }
+ }
+ }
} else if (bts->max_cs_dl) {
num = bts->max_cs_dl;
- } else {
- num = 4;
}
+ if (!num)
+ num = 4;
+
return mcs_get_gprs_by_num(num);
}