aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/l1sap.c7
-rw-r--r--src/common/pcu_sock.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 71690cd2..b05ed721 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -135,11 +135,12 @@ struct msgb *l1sap_msgb_alloc(unsigned int l2_len)
}
int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg,
- struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn)
+ struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn,
+ uint16_t ber10k, int16_t lqual_cb)
{
struct osmo_phsap_prim *l1sap;
- LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n",
+ LOGP(DL1P, LOGL_DEBUG, "%s Rx -> RTP: %s\n",
gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len));
rmsg->l2h = rmsg->data;
@@ -150,6 +151,8 @@ int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg,
rmsg);
l1sap->u.tch.chan_nr = chan_nr;
l1sap->u.tch.fn = fn;
+ l1sap->u.tch.ber10k = ber10k;
+ l1sap->u.tch.lqual_cb = lqual_cb;
return l1sap_up(trx, l1sap);
}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 27550480..a4ddc052 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -29,6 +29,7 @@
#include <assert.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <inttypes.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
@@ -329,11 +330,18 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
struct gsm_pcu_if *pcu_prim;
struct gsm_pcu_if_data *data_ind;
struct gsm_bts *bts = ts->trx->bts;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d "
"block=%d data=%s\n", is_ptcch, arfcn, block_nr,
osmo_hexdump(data, len));
+ if (lqual / 10 < btsb->min_qual_norm) {
+ LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n",
+ lqual, btsb->min_qual_norm);
+ return 0;
+ }
+
msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_IND, bts->nr);
if (!msg)
return -ENOMEM;