summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-08 20:28:09 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit30620e720c46cc83d737466aa8bd78a1a45f4116 (patch)
treef8537d67d9d79f0a7a3bf064ebfa703d4e3cd758
parentfce2e66fbb0098997812bbd76d89737ccbb257eb (diff)
host/trxcon/l1ctl.c: implement L1CTL_FBSB_CONF
-rw-r--r--src/host/trxcon/l1ctl.c28
-rw-r--r--src/host/trxcon/l1ctl.h1
-rw-r--r--src/host/trxcon/l1ctl_link.h3
-rw-r--r--src/host/trxcon/sched_lchan_desc.c2
-rw-r--r--src/host/trxcon/sched_lchan_handlers.c4
5 files changed, 37 insertions, 1 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index ab73194..255177e 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -126,6 +126,31 @@ int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type)
return l1ctl_link_send(l1l, msg);
}
+int l1ctl_tx_fbsb_conf(struct l1ctl_link *l1l, uint8_t result, uint8_t bsic)
+{
+ struct l1ctl_fbsb_conf *conf;
+ struct msgb *msg;
+
+ msg = l1ctl_alloc_msg(L1CTL_FBSB_CONF);
+ if (msg == NULL)
+ return -ENOMEM;
+
+ LOGP(DL1C, LOGL_DEBUG, "Send FBSB Conf (result=%u, bsic=%u)\n",
+ result, bsic);
+
+ conf = (struct l1ctl_fbsb_conf *) msgb_put(msg, sizeof(*conf));
+ conf->result = result;
+ conf->bsic = bsic;
+
+ /* FIXME: set proper value */
+ conf->initial_freq_err = 0;
+
+ /* Ask SCH handler not to send L1CTL_FBSB_CONF anymore */
+ l1l->fbsb_conf_sent = 1;
+
+ return l1ctl_link_send(l1l, msg);
+}
+
int l1ctl_tx_data_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data)
{
struct l1ctl_info_dl *dl;
@@ -176,6 +201,9 @@ static int l1ctl_rx_fbsb_req(struct l1ctl_link *l1l, struct msgb *msg)
else
sched_trx_configure_ts(l1l->trx, 0, GSM_PCHAN_CCCH);
+ /* Ask SCH handler to send L1CTL_FBSB_CONF */
+ l1l->fbsb_conf_sent = 0;
+
/* Store current ARFCN */
l1l->trx->band_arfcn = band_arfcn;
diff --git a/src/host/trxcon/l1ctl.h b/src/host/trxcon/l1ctl.h
index 05a2c54..124074b 100644
--- a/src/host/trxcon/l1ctl.h
+++ b/src/host/trxcon/l1ctl.h
@@ -6,6 +6,7 @@
#include "l1ctl_link.h"
#include "l1ctl_proto.h"
+int l1ctl_tx_fbsb_conf(struct l1ctl_link *l1l, uint8_t result, uint8_t bsic);
int l1ctl_tx_pm_conf(struct l1ctl_link *l1l, uint16_t band_arfcn,
int dbm, int last);
int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type);
diff --git a/src/host/trxcon/l1ctl_link.h b/src/host/trxcon/l1ctl_link.h
index 43d187a..b310ee4 100644
--- a/src/host/trxcon/l1ctl_link.h
+++ b/src/host/trxcon/l1ctl_link.h
@@ -23,6 +23,9 @@ struct l1ctl_link {
/* Bind TRX instance */
struct trx_instance *trx;
+
+ /* L1CTL handlers specific */
+ uint8_t fbsb_conf_sent;
};
int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path);
diff --git a/src/host/trxcon/sched_lchan_desc.c b/src/host/trxcon/sched_lchan_desc.c
index 1ff6e14..f82a982 100644
--- a/src/host/trxcon/sched_lchan_desc.c
+++ b/src/host/trxcon/sched_lchan_desc.c
@@ -71,7 +71,7 @@ const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = {
{
TRXC_SCH, "SCH",
0x00, LID_DEDIC,
- 0x00, 0x00,
+ 0x00, TRX_CH_FLAG_AUTO,
/**
* We already have clock indications from TRX,
diff --git a/src/host/trxcon/sched_lchan_handlers.c b/src/host/trxcon/sched_lchan_handlers.c
index 7c18fdd..4d53516 100644
--- a/src/host/trxcon/sched_lchan_handlers.c
+++ b/src/host/trxcon/sched_lchan_handlers.c
@@ -223,5 +223,9 @@ int rx_sch_fn(struct trx_instance *trx, struct trx_ts *ts,
return -EINVAL;
}
+ /* Send L1CTL_FBSB_CONF to higher layers */
+ if (!trx->l1l->fbsb_conf_sent)
+ l1ctl_tx_fbsb_conf(trx->l1l, 0, bsic);
+
return 0;
}