gsmtap: Set signal level and SNR fields

lqual (containing C/I value) is passed instead of SNR, but let's have
that better than nothing.

Change-Id: Ibe9502d42c8bd1b984069e7fd805dde87ecbab0c
changes/65/18365/4
Pau Espin 2 years ago
parent 2ae8337669
commit 0b0391ff66
  1. 14
      src/bts.cpp
  2. 3
      src/bts.h
  3. 2
      src/pcu_l1_if.cpp
  4. 14
      src/pdch.cpp

@ -433,6 +433,14 @@ int BTS::add_paging(uint8_t chan_needed, const uint8_t *mi, uint8_t mi_len)
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)
{
struct pcu_l1_meas meas;
send_gsmtap_meas(categ, uplink, trx_no, ts_no, channel, fn, data, len, &meas);
}
void BTS::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)
{
uint16_t arfcn;
@ -444,7 +452,11 @@ void BTS::send_gsmtap(enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_n
if (uplink)
arfcn |= GSMTAP_ARFCN_F_UPLINK;
gsmtap_send(m_bts.gsmtap, arfcn, ts_no, channel, 0, fn, 0, 0, data, len);
/* GSMTAP needs the SNR here, but we only have C/I (meas->link_qual).
Those are not the same, but there is no known way to convert them,
let's pass C/I instead of nothing */
gsmtap_send(m_bts.gsmtap, arfcn, ts_no, channel, 0, fn,
meas->rssi, meas->link_qual, data, len);
}
static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts)

@ -316,6 +316,9 @@ public:
void 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);
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);
/*
* Below for C interface for the VTY

@ -347,7 +347,7 @@ static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind)
if (rc < 0 && (bts->gsmtap_categ_mask & (1 <<PCU_GSMTAP_C_UL_UNKNOWN))) {
gsmtap_send(bts->gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr,
GSMTAP_CHANNEL_UNKNOWN, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len);
GSMTAP_CHANNEL_UNKNOWN, 0, data_ind->fn, meas.rssi, meas.link_qual, data_ind->data, data_ind->len);
}
return rc;

@ -704,9 +704,9 @@ int gprs_rlcmac_pdch::rcv_control_block(const uint8_t *data, uint8_t data_len,
rc = decode_gsm_rlcmac_uplink(rlc_block, ul_control_block);
if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK)
bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len);
bts()->send_gsmtap_meas(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len, meas);
else
bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len);
bts()->send_gsmtap_meas(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len, meas);
if(rc < 0) {
LOGP(DRLCMACUL, LOGL_ERROR, "Dropping Uplink Control Block with invalid "
@ -789,8 +789,9 @@ int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t f
* control blocks (see 44.060, section 10.3, 1st par.)
*/
if (mcs_is_edge(cs)) {
bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn,
data, data_len);
bts()->send_gsmtap_meas(PCU_GSMTAP_C_UL_DATA_EGPRS, true,
trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn,
data, data_len, meas);
if (!bts()->bts_data()->egprs_enabled) {
LOGP(DRLCMACUL, LOGL_ERROR,
"Got %s RLC block but EGPRS is not enabled\n",
@ -798,8 +799,9 @@ int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t f
return 0;
}
} else {
bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn,
data, data_len);
bts()->send_gsmtap_meas(PCU_GSMTAP_C_UL_DATA_GPRS, true,
trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn,
data, data_len, meas);
}
LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len));

Loading…
Cancel
Save