aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_ms.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-09 09:44:36 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-22 10:39:06 +0200
commit94cde130ca78d6ca1b5f815180ccdd363b234407 (patch)
treee7443307dd30847d4d6c7bffad99c8a2023b8b7a /src/gprs_ms.cpp
parente4bcb62dbf89bf882805e3824251a3013f3eecd7 (diff)
ms: Add UL CS selection based on L1 link quality
Currently the UL CS values are set to the corresponding DL CS value, eventually limited by a maximum value. This approach does not reflect the general situation of the RF link between ME and BTS, which is rather asymmetric e.g. due to a lower degree of TX efficiency of the built-in antenna. This means, that UL and DL CS control should be decoupled for better results. This commit adds automatic UL CS selection based on the link quality measurement parameter. Each coding scheme is mapped to a link quality range. If the link quality value leaves that range, the current UL CS value is increased/decreased accordingly. This value will be copied when the next PACKET_UPLINK_ACK_NACK or PACKET_UPLINK_ASSIGMENT is sent to the MS. The following VTY command will be added to the config-pcu node: - cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35> which sets the ranges for the four coding schemes. For instance the example below reflects the current default values: cs link-quality-ranges cs1 6 cs2 5 8 cs3 7 13 cs4 12 set the following ranges, where the overlapping is used to configure a hysteresis: CS1: -inf .. 6 CS2: 5 .. 8 CS3: 7 .. 13 CS4: 12 .. inf Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_ms.cpp')
-rw-r--r--src/gprs_ms.cpp48
1 files changed, 40 insertions, 8 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 189e4bd2..cc211713 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -367,7 +367,7 @@ void GprsMs::update_error_rate(gprs_rlcmac_tbf *tbf, int error_rate)
{
struct gprs_rlcmac_bts *bts_data;
int64_t now;
- uint8_t max_cs_ul = 4, max_cs_dl = 4;
+ uint8_t max_cs_dl = 4;
OSMO_ASSERT(m_bts != NULL);
bts_data = m_bts->bts_data();
@@ -377,18 +377,15 @@ void GprsMs::update_error_rate(gprs_rlcmac_tbf *tbf, int error_rate)
now = now_msec();
- if (bts_data->max_cs_ul)
- max_cs_ul = bts_data->max_cs_ul;
-
if (bts_data->max_cs_dl)
max_cs_dl = bts_data->max_cs_dl;
+ /* TODO: Check for TBF direction */
/* TODO: Support different CS values for UL and DL */
if (error_rate > bts_data->cs_adj_upper_limit) {
if (m_current_cs_dl > 1) {
m_current_cs_dl -= 1;
- m_current_cs_ul = m_current_cs_dl;
LOGP(DRLCMACDL, LOGL_INFO,
"MS (IMSI %s): High error rate %d%%, "
"reducing CS level to %d\n",
@@ -399,12 +396,10 @@ void GprsMs::update_error_rate(gprs_rlcmac_tbf *tbf, int error_rate)
if (m_current_cs_dl < max_cs_dl) {
if (now - m_last_cs_not_low > 1000) {
m_current_cs_dl += 1;
- if (m_current_cs_dl <= max_cs_ul)
- m_current_cs_ul = m_current_cs_dl;
LOGP(DRLCMACDL, LOGL_INFO,
"MS (IMSI %s): Low error rate %d%%, "
- "increasing CS level to %d\n",
+ "increasing DL CS level to %d\n",
imsi(), error_rate, m_current_cs_dl);
m_last_cs_not_low = now;
} else {
@@ -424,6 +419,43 @@ void GprsMs::update_error_rate(gprs_rlcmac_tbf *tbf, int error_rate)
void GprsMs::update_l1_meas(const pcu_l1_meas *meas)
{
+ struct gprs_rlcmac_bts *bts_data;
+ uint8_t max_cs_ul = 4;
+
+ OSMO_ASSERT(m_bts != NULL);
+ bts_data = m_bts->bts_data();
+
+ if (bts_data->max_cs_ul)
+ max_cs_ul = bts_data->max_cs_ul;
+
+ if (meas->have_link_qual) {
+ int old_link_qual = meas->link_qual;
+ int low = bts_data->cs_lqual_ranges[current_cs_ul()-1].low;
+ int high = bts_data->cs_lqual_ranges[current_cs_ul()-1].high;
+ uint8_t new_cs_ul = m_current_cs_ul;
+
+ if (m_l1_meas.have_link_qual)
+ old_link_qual = m_l1_meas.link_qual;
+
+ if (meas->link_qual < low && old_link_qual < low)
+ new_cs_ul = m_current_cs_ul - 1;
+ else if (meas->link_qual > high && old_link_qual > high &&
+ m_current_cs_ul < max_cs_ul)
+ new_cs_ul = m_current_cs_ul + 1;
+
+ if (m_current_cs_ul != new_cs_ul) {
+ LOGP(DRLCMACDL, LOGL_INFO,
+ "MS (IMSI %s): "
+ "Link quality %ddB (%ddB) left window [%d, %d], "
+ "modifying uplink CS level: %d -> %d\n",
+ imsi(), meas->link_qual, old_link_qual,
+ low, high,
+ m_current_cs_ul, new_cs_ul);
+
+ m_current_cs_ul = new_cs_ul;
+ }
+ }
+
if (meas->have_rssi)
m_l1_meas.set_rssi(meas->rssi);
if (meas->have_bto)