dyn TS: fix error recovery: switch to PDCH after lchan error state

Tested by hacking a CHAN ACT ACK delay of a couple of seconds into osmo-bts'
rsl.c for the first TCH_H lchan:

[[[
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 3c97af9..4bfd27a 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -559,6 +559,22 @@ static int rsl_tx_chan_act_ack(struct gsm_lchan *lchan)
 	return abis_bts_rsl_sendmsg(msg);
 }

+struct osmo_timer_list xxx_timer;
+
+static void xxx_timer_cb(void *data)
+{
+	rsl_tx_chan_act_ack(data);
+}
+
+static int rsl_tx_chan_act_ack_later(struct gsm_lchan *lchan)
+{
+	xxx_timer.cb = xxx_timer_cb;
+	xxx_timer.data = lchan;
+	osmo_timer_schedule(&xxx_timer, 10, 0);
+	return 0;
+}
+
+
 /* 8.4.7 sending HANDOver DETection */
 int rsl_tx_hando_det(struct gsm_lchan *lchan, uint8_t *ho_delay)
 {
@@ -614,6 +630,18 @@ int rsl_tx_chan_act_acknack(struct gsm_lchan *lchan, uint8_t cause)

 	if (cause)
 		return rsl_tx_chan_act_nack(lchan, cause);
+
+	static int xxx = 0;
+
+	DEBUGP(DRSL, "%s XXXXXXXXXXXXXXXXXXXXX %d %s\n",
+	      gsm_lchan_name(lchan), xxx, gsm_lchant_name(lchan->type));
+
+	if (lchan->type == GSM_LCHAN_TCH_H) {
+		if (!xxx) {
+			xxx ++;
+			return rsl_tx_chan_act_ack_later(lchan);
+		}
+	}
 	return rsl_tx_chan_act_ack(lchan);
 }

]]]

Change-Id: Ie82dec9c9fefc476fdf5b5afdad2246b9d6fe304
This commit is contained in:
Neels Hofmeyr 2016-08-24 14:45:44 +02:00 committed by Harald Welte
parent 2ae305de46
commit cd150a8f74
1 changed files with 3 additions and 0 deletions

View File

@ -772,6 +772,9 @@ static void error_timeout_cb(void *data)
if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH
&& lchan->ts->trx->bts->gprs.mode != BTS_GPRS_NONE)
rsl_ipacc_pdch_activate(lchan->ts, 1);
if (dyn_ts_should_switch_to_pdch(lchan->ts))
dyn_ts_switchover_start(lchan, GSM_PCHAN_PDCH);
}
static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan);