summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-08 20:28:09 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commitcc4282f5bedd1390934552c682302691b72e23e2 (patch)
treee6c7de8f61b4e7b3b009264e99adbb21a6d4420f
parent99f8aea905de115a15460b23d69d352ccb563dc5 (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 ab731949..255177ec 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 05a2c543..124074b5 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 43d187a3..b310ee43 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 1ff6e144..f82a982d 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 7c18fdd0..4d535165 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;
}