aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/l1sap.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-10-02 23:00:54 +0700
committerlaforge <laforge@osmocom.org>2019-10-04 15:53:53 +0000
commitdf5b813c0f4aeb9ac9a45c22722b27366a77faf7 (patch)
tree585d2dc597e0c284ac95f973bcf596b3dbc9888b /src/common/l1sap.c
parent76837bddb783caabd34294706da2ae0a7f12ad55 (diff)
scheduler: fix handling of PTCCH/U and PTCCH/D logical channels
According to 3GPP TS 45.010, section 5.6.2, for packet-switched channels the BTS shall monitor the delay of the Access Bursts sent by the MS on PTCCH and respond with timing advance values for all MS performing the procedure on that PDCH. According to 3GPP TS 45.002, section 3.3.4.2, PTCCH (Packet Timing advance control channel) is a packet dedicated channel, that is used for continuous Timing Advance control (mentioned above). There are two sub-types of that logical channel: - PTCCH/U (Uplink): used to transmit random Access Bursts to allow estimation of the Timing Advance for one MS in packet transfer mode. - PTCCH/D (Downlink): used by the network to transmit Timing Advance updates for several MS. As per 3GPP TS 45.003, section 5.2, the coding scheme used for PTCCH/U is the same as for PRACH as specified in subclause 5.3, while the coding scheme used for PTCCH/D is the same as for CS-1 as specified in subclause 5.1.1. The way we used to handle both PTCCH/U and PTCCH/D is absolutely wrong - they have nothing to do with xCCH coding. Instead, we need to use tx_pdtch_fn() for Downlink and rx_rach_fn() for Uplink. In l1sap_ph_rach_ind() we need to check if an Access Burst was received on PTCCH/U and forward it to OsmoPCU with proper SAPI value (PCU_IF_SAPI_PTCCH). To be able to specify a SAPI, a new parameter is introduced to pcu_tx_rach_ind(). Change-Id: I232e5f514fbad2c51daaa59ff516004aba97c8a3 Related: OS#4102
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r--src/common/l1sap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index a77b53ab..2874c812 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1313,6 +1313,20 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind\n");
+ /* PTCCH/UL (Packet Timing Advance Control Channel) */
+ if (L1SAP_IS_CHAN_PDCH(rach_ind->chan_nr) && L1SAP_IS_PTCCH(rach_ind->fn)) {
+ LOGPFN(DL1P, LOGL_DEBUG, rach_ind->fn,
+ /* TODO: calculate and print Timing Advance Index */
+ "Access Burst for continuous Timing Advance control (toa256=%d)\n",
+ rach_ind->acc_delay_256bits);
+
+ /* QTA: Timing Advance in units of 1/4 of a symbol */
+ pcu_tx_rach_ind(bts, rach_ind->acc_delay_256bits >> 6,
+ rach_ind->ra, rach_ind->fn, rach_ind->is_11bit,
+ rach_ind->burst_type, PCU_IF_SAPI_PTCCH);
+ return 0;
+ }
+
/* check for handover access burst on dedicated channels */
if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) {
rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_HO);
@@ -1349,8 +1363,8 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
rach_ind->acc_delay, rach_ind->ra);
pcu_tx_rach_ind(bts, rach_ind->acc_delay << 2,
- rach_ind->ra, rach_ind->fn,
- rach_ind->is_11bit, rach_ind->burst_type);
+ rach_ind->ra, rach_ind->fn, rach_ind->is_11bit,
+ rach_ind->burst_type, PCU_IF_SAPI_RACH);
return 0;
}