bts: add send_gsmtap_rach(), also send PTCCH/U over GSMTAP

Change-Id: I5cc4c3d2522215a31924121f83fcc2ac9ac6fe9c
This commit is contained in:
Vadim Yanitskiy 2020-06-11 00:26:15 +07:00
parent b90d34b3d1
commit 07b6487c5a
3 changed files with 18 additions and 3 deletions

View File

@ -430,6 +430,16 @@ int BTS::add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len)
return 0;
}
void BTS::send_gsmtap_rach(enum pcu_gsmtap_category categ, uint8_t channel,
const struct rach_ind_params *rip)
{
struct pcu_l1_meas meas;
send_gsmtap_meas(categ, true, rip->trx_nr, rip->ts_nr, channel,
rfn_to_fn(rip->rfn), (uint8_t *) &rip->ra,
/* TODO: properly pack 11 bit RA */
rip->is_11bit ? 2 : 1, &meas);
}
void BTS::send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no,
uint8_t ts_no, uint8_t channel, uint32_t fn,
const uint8_t *data, unsigned int len)
@ -801,9 +811,7 @@ int BTS::rcv_rach(const struct rach_ind_params *rip)
uint32_t Fn = rfn_to_fn(rip->rfn);
uint8_t ta = qta2ta(rip->qta);
send_gsmtap(PCU_GSMTAP_C_UL_RACH, true, rip->trx_nr, rip->ts_nr,
GSMTAP_CHANNEL_RACH, Fn, (uint8_t *) &rip->ra,
rip->is_11bit ? 2 : 1);
send_gsmtap_rach(PCU_GSMTAP_C_UL_RACH, GSMTAP_CHANNEL_RACH, rip);
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests Uplink resource on CCCH/RACH: "
"ra=0x%02x (%d bit) Fn=%u qta=%d\n", rip->ra,
@ -908,6 +916,8 @@ int BTS::rcv_ptcch_rach(const struct rach_ind_params *rip)
struct gprs_rlcmac_pdch *pdch;
uint8_t ss;
send_gsmtap_rach(PCU_GSMTAP_C_UL_PTCCH, GSMTAP_CHANNEL_PTCCH, rip);
/* Prevent buffer overflow */
if (rip->trx_nr >= ARRAY_SIZE(bts->trx) || rip->ts_nr >= 8) {
LOGP(DRLCMAC, LOGL_ERROR, "(TRX=%u TS=%u RFN=%u) Rx malformed "

View File

@ -67,6 +67,7 @@ enum pcu_gsmtap_category {
PCU_GSMTAP_C_UL_DATA_GPRS = 18, /* uplink GPRS data blocks */
PCU_GSMTAP_C_UL_DATA_EGPRS = 19, /* uplink EGPRS data blocks */
PCU_GSMTAP_C_UL_RACH = 20, /* uplink RACH bursts */
PCU_GSMTAP_C_UL_PTCCH = 21, /* uplink PTCCH bursts */
};
struct BTS;
@ -336,6 +337,8 @@ public:
void send_gsmtap_meas(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no,
uint8_t ts_no, uint8_t channel, uint32_t fn,
const uint8_t *data, unsigned int len, struct pcu_l1_meas *meas);
void send_gsmtap_rach(enum pcu_gsmtap_category categ, uint8_t channel,
const struct rach_ind_params *rip);
/*
* Below for C interface for the VTY

View File

@ -38,6 +38,7 @@ static const struct value_string pcu_gsmtap_categ_names[] = {
{ PCU_GSMTAP_C_UL_DATA_GPRS, "ul-data-gprs" },
{ PCU_GSMTAP_C_UL_DATA_EGPRS, "ul-data-egprs" },
{ PCU_GSMTAP_C_UL_RACH, "ul-rach" },
{ PCU_GSMTAP_C_UL_PTCCH, "ul-ptcch" },
{ 0, NULL }
};
@ -58,6 +59,7 @@ static const struct value_string pcu_gsmtap_categ_help[] = {
{ PCU_GSMTAP_C_UL_DATA_GPRS, "Uplink Data Blocks (GPRS)" },
{ PCU_GSMTAP_C_UL_DATA_EGPRS, "Uplink Data Blocks (EGPRS)" },
{ PCU_GSMTAP_C_UL_RACH, "Uplink RACH Bursts" },
{ PCU_GSMTAP_C_UL_PTCCH, "Uplink PTCCH Bursts" },
{ 0, NULL }
};