aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-11-17 01:30:33 +0700
committerlaforge <laforge@osmocom.org>2019-11-22 17:38:07 +0000
commita070e863e21443aabbc8a39f87538d4ac7cdaad7 (patch)
treedbcde451d3fdc5d91ca619e72fbbc7cecff19fa1
parent1d9f6efccb2dfed52069910901ec8c8cc0d8de46 (diff)
pcuif_proto.h: extend RACH.ind with TRX and timeslot number fields
Since there can be multiple PDCH channels configured on different timeslots, different TRXes, and BTSes, the PTCCH/U handling code in OsmoPCU needs to know the exact origin of a given RACH.ind. Otherwise, it is not known which subscriber originated a given PTCCH/U indication, and hence it is impossible to send PTCCH/D Timing Advance notification properly. Fortunately, we can extend the RACH.ind message without even bumping the protocol version, because every single PDU has a fixed size defined by the largest message - INFO.ind. In case if the actual message payload is smaller, the rest is filled with a constant padding byte (0x00). Older versions of OsmoPCU will consider the new fields as padding, while the messages from older OsmoBTS versions will always have both fields set to 0x00. Since C0/TS0 cannot be configured to PDCH, this can be easily detected on the other end. Change-Id: Iff38934a108b6b1cd298669834263a7d5296c3f6 Related: OS#4102, OS#1545
-rw-r--r--include/osmo-bts/pcu_if.h5
-rw-r--r--include/osmo-bts/pcuif_proto.h2
-rw-r--r--src/common/l1sap.c6
-rw-r--r--src/common/pcu_sock.c9
4 files changed, 15 insertions, 7 deletions
diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index f34e0cdc..1475a944 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -11,8 +11,9 @@ int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual);
-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 sapi);
+int pcu_tx_rach_ind(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+ int16_t qta, uint16_t ra, uint32_t fn, uint8_t is_11bit,
+ enum ph_burst_type burst_type, uint8_t sapi);
int pcu_tx_time_ind(uint32_t fn);
int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed);
int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len);
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 2d24c434..e9779149 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -108,6 +108,8 @@ struct gsm_pcu_if_rach_ind {
uint16_t arfcn;
uint8_t is_11bit;
uint8_t burst_type;
+ uint8_t trx_nr;
+ uint8_t ts_nr;
} __attribute__ ((packed));
struct gsm_pcu_if_info_trx {
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 7bf0b09a..e640ce9e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1403,7 +1403,8 @@ static int l1sap_pdch_rach(struct gsm_bts_trx *trx, struct ph_rach_ind_param *ra
rach_ind->acc_delay_256bits);
/* QTA: Timing Advance in units of 1/4 of a symbol */
- pcu_tx_rach_ind(trx->bts, rach_ind->acc_delay_256bits >> 6,
+ pcu_tx_rach_ind(trx->bts->nr, trx->nr, rach_ind->chan_nr & 0x07,
+ 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;
@@ -1466,7 +1467,8 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
rach_ind->acc_delay, rach_ind->ra);
/* QTA: Timing Advance in units of 1/4 of a symbol */
- pcu_tx_rach_ind(bts, rach_ind->acc_delay_256bits >> 6,
+ pcu_tx_rach_ind(bts->nr, trx->nr, rach_ind->chan_nr & 0x07,
+ rach_ind->acc_delay_256bits >> 6,
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 9fc1d4d9..579f8cc4 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -379,8 +379,9 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn,
return pcu_sock_send(&bts_gsmnet, msg);
}
-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 sapi)
+int pcu_tx_rach_ind(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+ int16_t qta, uint16_t ra, uint32_t fn, uint8_t is_11bit,
+ enum ph_burst_type burst_type, uint8_t sapi)
{
struct msgb *msg;
struct gsm_pcu_if *pcu_prim;
@@ -389,7 +390,7 @@ int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn,
LOGP(DPCU, LOGL_INFO, "Sending RACH indication: qta=%d, ra=%d, "
"fn=%d\n", qta, ra, fn);
- msg = pcu_msgb_alloc(PCU_IF_MSG_RACH_IND, bts->nr);
+ msg = pcu_msgb_alloc(PCU_IF_MSG_RACH_IND, bts_nr);
if (!msg)
return -ENOMEM;
pcu_prim = (struct gsm_pcu_if *) msg->data;
@@ -401,6 +402,8 @@ int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn,
rach_ind->fn = fn;
rach_ind->is_11bit = is_11bit;
rach_ind->burst_type = burst_type;
+ rach_ind->trx_nr = trx_nr;
+ rach_ind->ts_nr = ts_nr;
return pcu_sock_send(&bts_gsmnet, msg);
}