pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/41790?usp=email )


Change subject: ta_control: Fix skip_block_num not reset when switching TS to 
PDCH
......................................................................

ta_control: Fix skip_block_num not reset when switching TS to PDCH

Change-Id: Id3e81ebec04042dd7d8e4805762e3e518790706d
---
M include/osmo-bts/ta_control.h
M src/common/rsl.c
M src/common/ta_control.c
3 files changed, 14 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/90/41790/1

diff --git a/include/osmo-bts/ta_control.h b/include/osmo-bts/ta_control.h
index bf99331..e003245 100644
--- a/include/osmo-bts/ta_control.h
+++ b/include/osmo-bts/ta_control.h
@@ -2,4 +2,6 @@

 #include <osmo-bts/gsm_data.h>

+void lchan_ms_ta_ctrl_reset(struct gsm_lchan *lchan);
+
 void lchan_ms_ta_ctrl(struct gsm_lchan *lchan, uint8_t ms_tx_ta, int16_t 
toa256);
diff --git a/src/common/rsl.c b/src/common/rsl.c
index f16fe7c..ba403bc 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -58,6 +58,7 @@
 #include <osmo-bts/pcuif_proto.h>
 #include <osmo-bts/notification.h>
 #include <osmo-bts/asci.h>
+#include <osmo-bts/ta_control.h>

 //#define FAKE_CIPH_MODE_COMPL

@@ -1765,7 +1766,7 @@
        memset(&lchan->ho, 0, sizeof(lchan->ho));
        memset(&lchan->ms_power_ctrl, 0, sizeof(lchan->ms_power_ctrl));
        memset(&lchan->bs_power_ctrl, 0, sizeof(lchan->bs_power_ctrl));
-       lchan->ta_ctrl.current = 0;
+       lchan_ms_ta_ctrl_reset(lchan);
        copy_sacch_si_to_lchan(lchan);
        memset(&lchan->tch, 0, sizeof(lchan->tch));
 }
diff --git a/src/common/ta_control.c b/src/common/ta_control.c
index 64c44be..0fae5a4 100644
--- a/src/common/ta_control.c
+++ b/src/common/ta_control.c
@@ -42,6 +42,16 @@
 #define TA_MAX_INC_STEP 2
 #define TA_MAX_DEC_STEP 2

+void lchan_ms_ta_ctrl_reset(struct gsm_lchan *lchan)
+{
+       /* Reset the number of SACCH blocks to be skipped:
+        *   ctrl_interval=0 => 0 blocks to skip,
+        *   ctrl_interval=1 => 1 blocks to skip,
+        *   ctrl_interval=2 => 3 blocks to skip,
+        *     so basically ctrl_interval * 2 - 1. */
+       lchan->ta_ctrl.skip_block_num = lchan->ts->trx->ta_ctrl_interval * 2 - 
1;
+       lchan->ta_ctrl.current = 0;
+}

 /* Shall we skip current block based on configured interval? */
 static bool ctrl_interval_skip_block(struct gsm_lchan *lchan)

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41790?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id3e81ebec04042dd7d8e4805762e3e518790706d
Gerrit-Change-Number: 41790
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to