From d35fc4408c82193253e197aace9207fbe6d73b92 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 24 Aug 2016 17:02:37 +0200 Subject: dyn TS: fix OS#1798: on late RF CHAN REL ACK, activate PDCH Tested by hacking a REL ACK delay of a couple of seconds into osmo-bts' rsl.c for the first TCH_H lchan: [[[ diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 093e9cb..b35c3bb 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -22,6 +22,7 @@ int rsl_tx_est_ind(struct gsm_lchan *lchan, uint8_t link_id, uint8_t *data, int int rsl_tx_chan_act_acknack(struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_conn_fail(struct gsm_lchan *lchan, uint8_t cause); int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan); +int rsl_tx_rf_rel_ack_later(struct gsm_lchan *lchan); int rsl_tx_hando_det(struct gsm_lchan *lchan, uint8_t *ho_delay); /* call-back for LAPDm code, called when it wants to send msgs UP */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 3802e25..1f92b0d 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -491,7 +491,16 @@ static int l1sap_info_rel_cnf(struct gsm_bts_trx *trx, lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr); - rsl_tx_rf_rel_ack(lchan); + static int yyy = 0; + + DEBUGP(DRSL, "%s YYYYYYYYYYYYYYYYYYYYY %d %s\n", + gsm_lchan_name(lchan), yyy, gsm_lchant_name(lchan->type)); + + if (lchan->type == GSM_LCHAN_TCH_H && !yyy) { + yyy ++; + rsl_tx_rf_rel_ack_later(lchan); + } else + rsl_tx_rf_rel_ack(lchan); /* During PDCH DEACT, this marks the deactivation of the PDTCH as * requested by the PCU. Next up, we disconnect the TS completely and diff --git a/src/common/rsl.c b/src/common/rsl.c index 3c97af9..7926f21 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -534,6 +534,22 @@ int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan) return abis_bts_rsl_sendmsg(msg); } +struct osmo_timer_list yyy_timer; + +static void yyy_timer_cb(void *data) +{ + rsl_tx_rf_rel_ack(data); +} + +int rsl_tx_rf_rel_ack_later(struct gsm_lchan *lchan) +{ + yyy_timer.cb = yyy_timer_cb; + yyy_timer.data = lchan; + osmo_timer_schedule(&yyy_timer, 10, 0); + return 0; +} + + /* 8.4.2 sending CHANnel ACTIVation ACKnowledge */ static int rsl_tx_chan_act_ack(struct gsm_lchan *lchan) { ]]] Change-Id: I87e07e1d54882f8f3d667fa300c6e3679f5c920d Fixes: OS#1798 --- openbsc/src/libbsc/abis_rsl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index edc28a704..3cf1b250e 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -887,6 +887,8 @@ static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan) do_free ? "Releasing it" : "Keeping it broken"); if (do_free) do_lchan_free(lchan); + if (dyn_ts_should_switch_to_pdch(lchan->ts)) + dyn_ts_switchover_start(lchan->ts, GSM_PCHAN_PDCH); return 0; } -- cgit v1.2.3