aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/common/l1sap.c18
-rw-r--r--src/common/pcu_sock.c4
-rw-r--r--src/common/scheduler.c10
3 files changed, 25 insertions, 7 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;
}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index ba9e1721..51f72d89 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -380,7 +380,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn,
}
int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn,
- uint8_t is_11bit, enum ph_burst_type burst_type)
+ uint8_t is_11bit, enum ph_burst_type burst_type, uint8_t sapi)
{
struct msgb *msg;
struct gsm_pcu_if *pcu_prim;
@@ -395,7 +395,7 @@ int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn,
pcu_prim = (struct gsm_pcu_if *) msg->data;
rach_ind = &pcu_prim->u.rach_ind;
- rach_ind->sapi = PCU_IF_SAPI_RACH;
+ rach_ind->sapi = sapi;
rach_ind->ra = ra;
rach_ind->qta = qta;
rach_ind->fn = fn;
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 40e0a542..19fec324 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -539,11 +539,15 @@ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = {
.desc = "Packet Timing advance control channel",
.chan_nr = RSL_CHAN_OSMO_PDCH,
- /* Same as for TRXC_BCCH (xCCH), see above. */
+ /* On the Uplink, mobile stations transmit random Access Bursts
+ * to allow estimation of the timing advance for one MS in packet
+ * transfer mode. On Downlink, the network sends timing advance
+ * updates for several mobile stations. The coding scheme used
+ * for PTCCH/D messages is the same as for PDTCH CS-1. */
.flags = TRX_CHAN_FLAG_PDCH,
.rts_fn = rts_data_fn,
- .dl_fn = tx_data_fn,
- .ul_fn = rx_data_fn,
+ .dl_fn = tx_pdtch_fn,
+ .ul_fn = rx_rach_fn,
},
[TRXC_CBCH] = {
/* TODO: distinguish CBCH on SDCCH/4 and SDCCH/8 */