summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/trxcon/sched_lchan_rach.c6
-rw-r--r--src/host/trxcon/sched_lchan_tchf.c6
-rw-r--r--src/host/trxcon/sched_lchan_xcch.c6
-rw-r--r--src/host/trxcon/sched_trx.c18
-rw-r--r--src/host/trxcon/sched_trx.h3
5 files changed, 27 insertions, 12 deletions
diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c
index b26e2790..2a09a37d 100644
--- a/src/host/trxcon/sched_lchan_rach.c
+++ b/src/host/trxcon/sched_lchan_rach.c
@@ -86,11 +86,9 @@ int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts,
LOGP(DSCHD, LOGL_DEBUG, "Transmitting RACH fn=%u\n", fn);
- /* Send burst to transceiver */
- rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, burst);
+ /* Forward burst to scheduler */
+ rc = sched_trx_handle_tx_burst(trx, ts, lchan, fn, burst);
if (rc) {
- LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
-
/* Forget this primitive */
sched_prim_drop(lchan);
diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c
index e562a49b..45fa1c20 100644
--- a/src/host/trxcon/sched_lchan_tchf.c
+++ b/src/host/trxcon/sched_lchan_tchf.c
@@ -258,11 +258,9 @@ send_burst:
LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s fn=%u ts=%u burst=%u\n",
lchan_desc->name, fn, ts->index, bid);
- /* Send burst to transceiver */
- rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, burst);
+ /* Forward burst to scheduler */
+ rc = sched_trx_handle_tx_burst(trx, ts, lchan, fn, burst);
if (rc) {
- LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
-
/* Forget this primitive */
sched_prim_drop(lchan);
diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c
index d395b1da..c71b10fd 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -170,11 +170,9 @@ send_burst:
LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s fn=%u ts=%u burst=%u\n",
lchan_desc->name, fn, ts->index, bid);
- /* Send burst to transceiver */
- rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, burst);
+ /* Forward burst to scheduler */
+ rc = sched_trx_handle_tx_burst(trx, ts, lchan, fn, burst);
if (rc) {
- LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
-
/* Forget this primitive */
sched_prim_drop(lchan);
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index ee62e708..fba9ee44 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -531,3 +531,21 @@ next_frame:
return 0;
}
+
+int sched_trx_handle_tx_burst(struct trx_instance *trx,
+ struct trx_ts *ts, struct trx_lchan_state *lchan,
+ uint32_t fn, ubit_t *bits)
+{
+ int rc;
+
+ /* TODO: perform A5/X burst encryption if required */
+
+ /* Forward burst to transceiver */
+ rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, bits);
+ if (rc) {
+ LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
+ return rc;
+ }
+
+ return 0;
+}
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index c857601f..54dbc855 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -279,6 +279,9 @@ void sched_prim_flush_queue(struct llist_head *list);
int sched_trx_handle_rx_burst(struct trx_instance *trx, uint8_t tn,
uint32_t burst_fn, sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);
+int sched_trx_handle_tx_burst(struct trx_instance *trx,
+ struct trx_ts *ts, struct trx_lchan_state *lchan,
+ uint32_t fn, ubit_t *bits);
/* Shared declarations for lchan handlers */
extern const uint8_t sched_nb_training_bits[8][26];