aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Godin <yves.godin@nutaq.com>2016-09-19 10:35:57 -0400
committerYves Godin <yves.godin@nutaq.com>2016-09-19 10:35:57 -0400
commit13fdfd932be0e57ee0d229936094f4d32b03a886 (patch)
tree5730268b346fd560d9004392b41809557cd73420
parent800638acb6393aea0bb5baa7d92c774e4e816ae1 (diff)
parent26649dd46e5d955b55821c8da55df3600d73dcda (diff)
Merge branch 'nrw/litecell15-merge-master-19092016' into 'nrw/litecell15-next'
Nrw/litecell15 merge master 19092016 This MR should have: * See merge request !53
-rwxr-xr-xcontrib/jenkins_oct.sh4
-rw-r--r--include/osmo-bts/phy_link.h3
-rw-r--r--src/common/rsl.c63
-rw-r--r--src/osmo-bts-litecell15/oml.c9
-rw-r--r--src/osmo-bts-octphy/l1_oml.c12
-rw-r--r--src/osmo-bts-octphy/l1_utils.c2
-rw-r--r--src/osmo-bts-octphy/octphy_hw_api.c2
-rw-r--r--src/osmo-bts-sysmo/l1_if.c42
-rw-r--r--src/osmo-bts-sysmo/oml.c9
9 files changed, 99 insertions, 47 deletions
diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh
index 88b8c084..32b14073 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -47,7 +47,7 @@ fi
# Build osmo-bts
cd ../../
autoreconf --install --force
-PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig ./configure --with-openbsc=$PWD/deps/openbsc/openbsc/include --with-octsdr-2g=$PWD/deps/layer1-api/
+PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig ./configure --with-openbsc=$PWD/deps/openbsc/openbsc/include --with-octsdr-2g=$PWD/deps/layer1-api/ --enable-octphy
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig $MAKE $PARALLEL_MAKE
PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE check
-DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$PWD/deps/layer1-api/ --with-openbsc=$PWD/deps/openbsc/openbsc/include" PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck
+DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$PWD/deps/layer1-api/ --with-openbsc=$PWD/deps/openbsc/openbsc/include --enable-octphy" PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index f40d487d..753dfd4b 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -63,8 +63,7 @@ struct phy_link {
uint32_t rf_port_index;
uint32_t rx_gain_db;
uint32_t tx_atten_db;
- /* arfcn used by TRX with id 0 */
- uint16_t center_arfcn;
+
struct octphy_hdl *hdl;
} octphy;
} u;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index a0f58d24..12579cb6 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -145,19 +145,21 @@ static int report_error(struct gsm_bts_trx *trx)
return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
}
-static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr)
+static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
+ const char *log_name)
{
int rc;
struct gsm_lchan *lchan = rsl_lchan_lookup(trx, chan_nr, &rc);
if (!lchan) {
- LOGP(DRSL, LOGL_ERROR, "unknown chan_nr=0x%02x\n", chan_nr);
+ LOGP(DRSL, LOGL_ERROR, "%sunknown chan_nr=0x%02x\n", log_name,
+ chan_nr);
return NULL;
}
if (rc < 0)
- LOGP(DRSL, LOGL_ERROR, "%s mismatching chan_nr=0x%02x\n",
- gsm_ts_and_pchan_name(lchan->ts), chan_nr);
+ LOGP(DRSL, LOGL_ERROR, "%s %smismatching chan_nr=0x%02x\n",
+ gsm_ts_and_pchan_name(lchan->ts), log_name, chan_nr);
return lchan;
}
@@ -620,14 +622,7 @@ static int rsl_tx_chan_act_nack(struct gsm_lchan *lchan, uint8_t cause)
/* Send an RSL Channel Activation Ack if cause is zero, a Nack otherwise. */
int rsl_tx_chan_act_acknack(struct gsm_lchan *lchan, uint8_t cause)
{
- /*
- * Normally, PDCH activation via PCU does not ack back to the BSC.
- * But for GSM_PCHAN_TCH_F_TCH_H_PDCH, send a non-standard act ack for
- * LCHAN_REL_ACT_PCU, since the act req came from RSL initially.
- */
- if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL
- && !(lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
- && lchan->rel_act_kind == LCHAN_REL_ACT_PCU)) {
+ if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL) {
LOGP(DRSL, LOGL_NOTICE, "%s not sending CHAN ACT %s\n",
gsm_lchan_name(lchan), cause ? "NACK" : "ACK");
return 0;
@@ -945,6 +940,29 @@ static int rsl_rx_chan_activ(struct msgb *msg)
if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
&& ts->dyn.pchan_want == GSM_PCHAN_PDCH) {
/*
+ * We ack the activation to the BSC right away, regardless of
+ * the PCU succeeding or not; if a dynamic timeslot fails to go
+ * to PDCH mode for any reason, the BSC should still be able to
+ * switch it back to TCH modes and should not put the time slot
+ * in an error state. So for operating dynamic TS, the BSC
+ * would not take any action if the PDCH mode failed, e.g.
+ * because the PCU is not yet running. Even if alerting the
+ * core network of broken GPRS service is desired, this only
+ * makes sense when the PCU has not shown up for some time.
+ * It's easiest to not forward activation delays to the BSC: if
+ * the BSC tells us to do PDCH, we do our best, and keep the
+ * details on the BTS and PCU level. This is kind of analogous
+ * to how plain PDCH TS operate. Directly call
+ * rsl_tx_chan_act_ack() instead of rsl_tx_chan_act_acknack()
+ * because we don't want/need to decide whether to drop due to
+ * lchan->rel_act_kind.
+ */
+ rc = rsl_tx_chan_act_ack(lchan);
+ if (rc < 0)
+ LOGP(DRSL, LOGL_ERROR, "%s Cannot send act ack: %d\n",
+ gsm_ts_and_pchan_name(ts), rc);
+
+ /*
* pcu_tx_info_ind() will pick up the ts->dyn.pchan_want. If
* the PCU is not connected yet, ignore for now; the PCU will
* catch up (and send the RSL ack) once it connects.
@@ -995,7 +1013,7 @@ static int dyn_ts_pdch_release(struct gsm_lchan *lchan)
/* PCU not connected yet. Just record the new type and done,
* the PCU will pick it up once connected. */
ts->dyn.pchan_is = GSM_PCHAN_NONE;
- return 0;
+ return 1;
}
return pcu_tx_info_ind();
@@ -1004,6 +1022,8 @@ static int dyn_ts_pdch_release(struct gsm_lchan *lchan)
/* 8.4.14 RF CHANnel RELease is received */
static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan, uint8_t chan_nr)
{
+ int rc;
+
if (lchan->abis_ip.rtp_socket) {
rsl_tx_ipac_dlcx_ind(lchan, RSL_ERR_NORMAL_UNSPEC);
osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
@@ -1018,8 +1038,13 @@ static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan, uint8_t chan_nr)
/* Dynamic channel in PDCH mode is released via PCU */
if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
- && lchan->ts->dyn.pchan_is == GSM_PCHAN_PDCH)
- return dyn_ts_pdch_release(lchan);
+ && lchan->ts->dyn.pchan_is == GSM_PCHAN_PDCH) {
+ rc = dyn_ts_pdch_release(lchan);
+ if (rc != 1)
+ return rc;
+ /* If the PCU is not connected, continue right away. */
+ return rsl_tx_rf_rel_ack(lchan);
+ }
l1sap_chan_rel(lchan->ts->trx, chan_nr);
@@ -2112,7 +2137,7 @@ static int rsl_rx_rll(struct gsm_bts_trx *trx, struct msgb *msg)
}
msg->l3h = (unsigned char *)rh + sizeof(*rh);
- lchan = lchan_lookup(trx, rh->chan_nr);
+ lchan = lchan_lookup(trx, rh->chan_nr, "RSL rx RLL: ");
if (!lchan) {
LOGP(DRLL, LOGL_NOTICE, "Rx RLL %s for unknown lchan\n",
rsl_msg_name(rh->c.msg_type));
@@ -2256,7 +2281,7 @@ static int rsl_rx_cchan(struct gsm_bts_trx *trx, struct msgb *msg)
}
msg->l3h = (unsigned char *)cch + sizeof(*cch);
- msg->lchan = lchan_lookup(trx, cch->chan_nr);
+ msg->lchan = lchan_lookup(trx, cch->chan_nr, "RSL rx CCHAN: ");
if (!msg->lchan) {
LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknown lchan\n",
rsl_msg_name(cch->c.msg_type));
@@ -2310,7 +2335,7 @@ static int rsl_rx_dchan(struct gsm_bts_trx *trx, struct msgb *msg)
}
msg->l3h = (unsigned char *)dch + sizeof(*dch);
- msg->lchan = lchan_lookup(trx, dch->chan_nr);
+ msg->lchan = lchan_lookup(trx, dch->chan_nr, "RSL rx DCHAN: ");
if (!msg->lchan) {
LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknown lchan\n",
rsl_or_ipac_msg_name(dch->c.msg_type));
@@ -2409,7 +2434,7 @@ static int rsl_rx_ipaccess(struct gsm_bts_trx *trx, struct msgb *msg)
}
msg->l3h = (unsigned char *)dch + sizeof(*dch);
- msg->lchan = lchan_lookup(trx, dch->chan_nr);
+ msg->lchan = lchan_lookup(trx, dch->chan_nr, "RSL rx IPACC: ");
if (!msg->lchan) {
LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n",
rsl_msg_name(dch->c.msg_type));
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index a175af4b..634c2368 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -755,9 +755,12 @@ static void sapi_queue_dispatch(struct gsm_lchan *lchan, int status)
talloc_free(cmd);
if (end || llist_empty(&lchan->sapi_cmds)) {
- LOGP(DL1C, LOGL_NOTICE,
- "%s End of queue encountered. Now empty? %d\n",
- gsm_lchan_name(lchan), llist_empty(&lchan->sapi_cmds));
+ LOGP(DL1C, LOGL_DEBUG,
+ "%s End of SAPI cmd queue encountered.%s\n",
+ gsm_lchan_name(lchan),
+ llist_empty(&lchan->sapi_cmds)
+ ? " Queue is now empty."
+ : " More pending.");
return;
}
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index c893b044..ed365b64 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1345,14 +1345,6 @@ int l1if_trx_open(struct gsm_bts_trx *trx)
oc->TrxId.byTrxId = pinst->u.octphy.trx_id;
oc->Config.ulBand = osmocom_to_octphy_band(trx->bts->band, trx->arfcn);
oc->Config.usArfcn = trx->arfcn;
-
- if (pinst->u.octphy.trx_id)
- oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn;
- else {
- oc->Config.usCentreArfcn = trx->arfcn;
- plink->u.octphy.center_arfcn = trx->arfcn;
- }
-
oc->Config.usTsc = trx->bts->bsic & 0x7;
oc->Config.usBcchArfcn = trx->bts->c0->arfcn;
oc->RfConfig.ulRxGainDb = plink->u.octphy.rx_gain_db;
@@ -1360,9 +1352,9 @@ int l1if_trx_open(struct gsm_bts_trx *trx)
oc->RfConfig.ulTxAttndB = plink->u.octphy.tx_atten_db;
LOGP(DL1C, LOGL_INFO, "Tx TRX-OPEN.req(trx=%u, rf_port=%u, arfcn=%u, "
- "center=%u, tsc=%u, rx_gain=%u, tx_atten=%u)\n",
+ "tsc=%u, rx_gain=%u, tx_atten=%u)\n",
oc->TrxId.byTrxId, oc->ulRfPortIndex, oc->Config.usArfcn,
- oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb,
+ oc->Config.usTsc, oc->RfConfig.ulRxGainDb,
oc->RfConfig.ulTxAttndB);
mOCTVC1_GSM_MSG_TRX_OPEN_CMD_SWAP(oc);
diff --git a/src/osmo-bts-octphy/l1_utils.c b/src/osmo-bts-octphy/l1_utils.c
index fd399a65..682865bb 100644
--- a/src/osmo-bts-octphy/l1_utils.c
+++ b/src/osmo-bts-octphy/l1_utils.c
@@ -62,7 +62,7 @@ const struct value_string octphy_dir_names[5] =
const struct value_string octphy_clkmgr_state_vals[8] = {
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNINITIALIZE, "UNINITIALIZED" },
- { cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE, "IDLE" },
+ { cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED, "UNUSED" },
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_NO_EXT_CLOCK, "NO_EXT_CLOCK" },
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_LOCKED, "LOCKED" },
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNLOCKED, "UNLOCKED" },
diff --git a/src/osmo-bts-octphy/octphy_hw_api.c b/src/osmo-bts-octphy/octphy_hw_api.c
index ec7c4be3..d0d5ec74 100644
--- a/src/osmo-bts-octphy/octphy_hw_api.c
+++ b/src/osmo-bts-octphy/octphy_hw_api.c
@@ -279,7 +279,7 @@ static const struct value_string clocksync_source_state_vals[] = {
static const struct value_string clocksync_state_vals[] = {
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNINITIALIZE,
"Uninitialized" },
- { cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE, "Idle" },
+ { cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED, "Unused" },
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_NO_EXT_CLOCK,
"No External Clock" },
{ cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_LOCKED, "Locked" },
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 0880ee97..40ac12d6 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -929,7 +929,8 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
struct gsm_lchan *lchan;
struct osmo_phsap_prim *l1sap;
uint32_t fn;
- uint8_t ra, acc_delay = 0;
+ uint8_t acc_delay = 0;
+ uint16_t ra = 0, is_11bit = 0, burst_type = 0, temp = 0;
int rc;
/* increment number of busy RACH slots, if required */
@@ -951,16 +952,28 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
btsb->load.rach.access++;
dump_meas_res(LOGL_DEBUG, &ra_ind->measParam);
+ burst_type = ra_ind->burstType;
- if (ra_ind->msgUnitParam.u8Size != 1) {
+ if ((ra_ind->msgUnitParam.u8Size != 1) &&
+ (ra_ind->msgUnitParam.u8Size != 2)) {
LOGP(DL1C, LOGL_ERROR, "PH-RACH-INDICATION has %d bits\n",
ra_ind->sapi);
msgb_free(l1p_msg);
return 0;
}
+ if (ra_ind->msgUnitParam.u8Size == 2) {
+ is_11bit = 1;
+ ra = ra_ind->msgUnitParam.u8Buffer[0];
+ ra = ra << 3;
+ temp = (ra_ind->msgUnitParam.u8Buffer[1] & 0x7);
+ ra = ra | temp;
+ } else {
+ is_11bit = 0;
+ ra = ra_ind->msgUnitParam.u8Buffer[0];
+ }
+
fn = ra_ind->u32Fn;
- ra = ra_ind->msgUnitParam.u8Buffer[0];
rc = msgb_trim(l1p_msg, sizeof(*l1sap));
if (rc < 0)
MSGB_ABORT(l1p_msg, "No room for primitive data\n");
@@ -970,11 +983,28 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind,
l1sap->u.rach_ind.ra = ra;
l1sap->u.rach_ind.acc_delay = acc_delay;
l1sap->u.rach_ind.fn = fn;
+ l1sap->u.rach_ind.is_11bit = is_11bit; /* no of bits in 11 bit RACH */
- /* Initialising the parameters needs to be handled when 11 bit RACH */
+ /*mapping of the burst type, the values are specific to osmo-bts-sysmo*/
- l1sap->u.rach_ind.is_11bit = 0;
- l1sap->u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0;
+ switch (burst_type) {
+ case GsmL1_BurstType_Access_0:
+ l1sap->u.rach_ind.burst_type =
+ GSM_L1_BURST_TYPE_ACCESS_0;
+ break;
+ case GsmL1_BurstType_Access_1:
+ l1sap->u.rach_ind.burst_type =
+ GSM_L1_BURST_TYPE_ACCESS_1;
+ break;
+ case GsmL1_BurstType_Access_2:
+ l1sap->u.rach_ind.burst_type =
+ GSM_L1_BURST_TYPE_ACCESS_2;
+ break;
+ default:
+ l1sap->u.rach_ind.burst_type =
+ GSM_L1_BURST_TYPE_NONE;
+ break;
+ }
if (!lchan || lchan->ts->pchan == GSM_PCHAN_CCCH ||
lchan->ts->pchan == GSM_PCHAN_CCCH_SDCCH4)
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index dea1c5e2..c1f1e0b2 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -764,9 +764,12 @@ static void sapi_queue_dispatch(struct gsm_lchan *lchan, int status)
talloc_free(cmd);
if (end || llist_empty(&lchan->sapi_cmds)) {
- LOGP(DL1C, LOGL_NOTICE,
- "%s End of queue encountered. Now empty? %d\n",
- gsm_lchan_name(lchan), llist_empty(&lchan->sapi_cmds));
+ LOGP(DL1C, LOGL_DEBUG,
+ "%s End of SAPI cmd queue encountered.%s\n",
+ gsm_lchan_name(lchan),
+ llist_empty(&lchan->sapi_cmds)
+ ? " Queue is now empty."
+ : " More pending.");
return;
}