summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-12-18 05:45:27 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-18 06:04:29 +0700
commit44838f79a2408feca664980d4b42a5c86b17db07 (patch)
tree219f57e904716929aa52f9282351f7fca343a9e2
parent255f25ef25c5ce1deefcfbe63844bc47d524c377 (diff)
trxcon/scheduler: preprocess UL bursts before sending
Having a possibility to preprocess UL burst before sending to transceiver is required for the further ciphering support integration and probably some other tasks. Change-Id: Ia6eead5d4f51d7c0bf277b9d5ebb0a74676df567
-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];