[PATCH 3/4] sysmobts: Add L1 support for the new RF mute request

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Mon Nov 4 13:56:11 UTC 2013


This adds a new function

  l1if_mute_rf(femtol1_hdl, ch_mute[8])

to set the mute state for each radio channel. On completion and iff
l1if_mute_rf() returned 0 the callback

  oml_mo_rf_lock_chg(mo, ch_mute_state[8], success)

is invoked when the response from the superfemto DSP is received.

Ticket: OW#976
Sponsored-by: On-Waves ehf
---
 include/osmo-bts/oml.h     |    4 ++++
 src/osmo-bts-sysmo/l1_if.c |   48 ++++++++++++++++++++++++++++++++++++++++++++
 src/osmo-bts-sysmo/l1_if.h |    3 +++
 src/osmo-bts-sysmo/oml.c   |    6 ++++++
 4 files changed, 61 insertions(+)

diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h
index 5e9c880..92695ca 100644
--- a/include/osmo-bts/oml.h
+++ b/include/osmo-bts/oml.h
@@ -17,6 +17,10 @@ int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state);
 /* First initialization of MO, does _not_ generate state changes */
 void oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state);
 
+/* Update admin state and send ACK/NACK */
+int oml_mo_rf_lock_chg(struct gsm_abis_mo *mo, uint8_t mute_state[8],
+		       int success);
+
 /* Transmit STATE CHG REP even if there was no state change */
 int oml_tx_state_changed(struct gsm_abis_mo *mo);
 
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 3dbcd53..36df462 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1103,6 +1103,54 @@ int l1if_activate_rf(struct femtol1_hdl *hdl, int on)
 	return l1if_req_compl(hdl, msg, activate_rf_compl_cb);
 }
 
+static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp)
+{
+	struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx);
+	SuperFemto_Prim_t *sysp = msgb_sysprim(resp);
+	GsmL1_Status_t status;
+
+	status = sysp->u.muteRfCnf.status;
+
+	if (status != GsmL1_Status_Success) {
+		LOGP(DL1C, LOGL_ERROR, "Rx RF-MUTE.conf with status %s\n",
+		     get_value_string(femtobts_l1status_names, status));
+		oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0);
+	} else {
+		LOGP(DL1C, LOGL_INFO, "Rx RF-MUTE.conf with status=%s\n",
+		     get_value_string(femtobts_l1status_names, status));
+		sysmobts_led_set(LED_RF_ACTIVE, !fl1h->last_rf_mute[0]);
+		oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 1);
+	}
+
+	msgb_free(resp);
+
+	return 0;
+}
+
+/* mute/unmute RF time slots */
+int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8])
+{
+	struct msgb *msg = sysp_msgb_alloc();
+	SuperFemto_Prim_t *sysp = msgb_sysprim(msg);
+
+	LOGP(DL1C, LOGL_INFO, "Tx RF-MUTE.req (%d, %d, %d, %d, %d, %d, %d, %d)\n",
+	     mute[0], mute[1], mute[2], mute[3],
+	     mute[4], mute[5], mute[6], mute[7]
+	    );
+
+#if SUPERFEMTO_API_VERSION < SUPERFEMTO_API(3,6,0)
+	LOGP(DL1C, LOGL_ERROR, "RF-MUTE.req not supported by SuperFemto\n");
+	return -ENOTSUP;
+#endif /* < 3.6.0 */
+
+	sysp->id = SuperFemto_PrimId_MuteRfReq;
+	memcpy(sysp->u.muteRfReq.u8Mute, mute, sizeof(sysp->u.muteRfReq.u8Mute));
+	/* save for later use */
+	memcpy(hdl->last_rf_mute, mute, sizeof(hdl->last_rf_mute));
+
+	return l1if_req_compl(hdl, msg, mute_rf_compl_cb);
+}
+
 /* call-back on arrival of DSP+FPGA version + band capability */
 static int info_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp)
 {
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 8d63569..d659841 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -76,6 +76,8 @@ struct femtol1_hdl {
 	int fixup_needed;
 
 	struct calib_send_state st;
+
+	uint8_t last_rf_mute[8];
 };
 
 #define msgb_l1prim(msg)	((GsmL1_Prim_t *)(msg)->l1h)
@@ -95,6 +97,7 @@ int l1if_reset(struct femtol1_hdl *hdl);
 int l1if_activate_rf(struct femtol1_hdl *hdl, int on);
 int l1if_set_trace_flags(struct femtol1_hdl *hdl, uint32_t flags);
 int l1if_set_txpower(struct femtol1_hdl *fl1h, float tx_power);
+int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8]);
 
 struct msgb *l1p_msgb_alloc(void);
 struct msgb *sysp_msgb_alloc(void);
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index c09b3f3..822453f 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -326,6 +326,12 @@ int bts_model_trx_close(struct gsm_bts_trx *trx)
 	return l1if_gsm_req_compl(fl1h, msg, trx_close_compl_cb);
 }
 
+int oml_mo_rf_lock_chg(struct gsm_abis_mo *mo, uint8_t mute_state[8],
+		       int success)
+{
+	return 0;
+}
+
 static int ts_connect(struct gsm_bts_trx_ts *ts)
 {
 	struct msgb *msg = l1p_msgb_alloc();
-- 
1.7.9.5





More information about the OpenBSC mailing list