aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-13 16:45:21 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-05-13 16:45:21 +0200
commita004e6a8233695abd417a97d6f81a802b605038a (patch)
tree226ca73caa945b447f2c8fcd7be242a7f9b4f671 /src/gprs_bssgp_pcu.cpp
parent783aa4bcb8aab7fbcd1b91ad225018a06e950f50 (diff)
Added timing advance support for up and downlink TBFs
The timing advance of any TBF is stored when it ends. Whenever a new TBF with the same TLLI is created (downlink TBF), the stored TA is recalled. This algorithm assumes that the mobile does not move too fast during transfer. Also the mobile must start a connection in order to get correct initial timing advance. This algorithm does not implement the timing advance procedure as defined in TS 04.60. To implement the standard timing advance procedure, the BTS must decode RACH on certain bursts, the mobile is expected to send them. This requires much more complexity to a transceiver like USRP/UmTRX or Calypso BTS. The algorithm was tested at TA >= 8 and works quite well.
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r--src/gprs_bssgp_pcu.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 5dbfb2c1..54753b85 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -196,6 +196,7 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
uint8_t trx, ta, ss;
int8_t use_trx;
struct gprs_rlcmac_tbf *old_tbf;
+ int rc;
/* check for uplink data, so we copy our informations */
tbf = tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
@@ -207,7 +208,19 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
old_tbf = tbf;
} else {
use_trx = -1;
- ta = 0; /* FIXME: initial TA */
+ /* we already have an uplink TBF, so we use that TA */
+ if (tbf)
+ ta = tbf->ta;
+ else {
+ /* recall TA */
+ rc = recall_timing_advance(tlli);
+ if (rc < 0) {
+ LOGP(DRLCMAC, LOGL_NOTICE, "TA unknown"
+ ", assuming 0\n");
+ ta = 0;
+ } else
+ ta = rc;
+ }
ss = 1; /* PCH assignment only allows one timeslot */
old_tbf = NULL;
}