From 89b3399e621976fd0fdad92890ed99cb98222148 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 27 Feb 2013 16:32:32 +0100 Subject: Set BTS mode at transceiver application only after successful sync to cell --- src/host/layer23/src/transceiver/l1ctl.c | 13 ++++++++++++- src/host/layer23/src/transceiver/l1ctl_link.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/host/layer23/src/transceiver/l1ctl.c b/src/host/layer23/src/transceiver/l1ctl.c index 52ea80b0..1c764b09 100644 --- a/src/host/layer23/src/transceiver/l1ctl.c +++ b/src/host/layer23/src/transceiver/l1ctl.c @@ -89,6 +89,9 @@ l1ctl_tx_fbsb_req(struct l1ctl_link *l1l, struct msgb *msg; struct l1ctl_fbsb_req *req; + if (l1l->sync) + return -EIO; + LOGP(DL1C, LOGL_INFO, "Sync Req\n"); msg = _l1ctl_alloc(L1CTL_FBSB_REQ); @@ -120,6 +123,9 @@ l1ctl_tx_bts_mode(struct l1ctl_link *l1l, uint8_t enabled, uint8_t *type, struct l1ctl_bts_mode *be; int i; + if (!l1l->sync) + return -EIO; + msg = _l1ctl_alloc(L1CTL_BTS_MODE); if (!msg) return -1; @@ -147,6 +153,9 @@ l1ctl_tx_bts_burst_req(struct l1ctl_link *l1l, struct msgb *msg; struct l1ctl_bts_burst_req *br; + if (!l1l->sync) + return -EIO; + msg = _l1ctl_alloc(L1CTL_BTS_BURST_REQ); if (!msg) return -1; @@ -325,7 +334,9 @@ _l1ctl_rx_fbsb_conf(struct l1ctl_link *l1l, struct msgb *msg) LOGP(DAPP, LOGL_INFO, "Sync failed, retrying ... \n"); rc = l1ctl_tx_fbsb_req(l1l, l1l->as->arfcn_sync, L1CTL_FBSB_F_FB01SB, 100, 0, CCCH_MODE_NONE); } else { - LOGP(DAPP, LOGL_INFO, "Sync acquired, wait for BCCH ...\n"); + LOGP(DAPP, LOGL_INFO, "Sync acquired, setting BTS mode ...\n"); + l1l->sync = 1; + l1ctl_tx_bts_mode(l1l, l1l->trx->power, l1l->trx->type, l1l->trx->bsic, l1l->trx->arfcn, l1l->trx->gain, l1l->tx_mask, l1l->rx_mask); } rc = 0; diff --git a/src/host/layer23/src/transceiver/l1ctl_link.h b/src/host/layer23/src/transceiver/l1ctl_link.h index 15960242..07b169b6 100644 --- a/src/host/layer23/src/transceiver/l1ctl_link.h +++ b/src/host/layer23/src/transceiver/l1ctl_link.h @@ -42,6 +42,8 @@ struct l1ctl_link struct trx *trx; uint8_t tx_mask, rx_mask; + + int sync; }; -- cgit v1.2.3