Harald Welte has submitted this change and it was merged.

Change subject: sysmobts: Compatibility with older firmware versions
......................................................................


sysmobts: Compatibility with older firmware versions

When using a firmware version < 3.6, the call to l1if_mute_rf()
returned an error, which caused an OML CHG ADM STATE NACK.

Let's check if the l1if_mute_rf() call is an un-mute for all
timeslots (which apparently we do always at start-up).  If it is, then
acknowledge it even if muting is not supported by earlier firmwares.

I suppose the change causing this problem was introduced in:
        commit b26b8fc77692e851469f3e27b9aeaeff233ffd2e
        Author: Holger Hans Peter Freyther <ze...@selfish.org>
        Date:   Tue Mar 4 15:03:59 2014 +0100
        sysmobts: Do a RF mute at initialization when the RC is locked

With the current change applied, we can run the BTS with earlier
firmware versions than 3.6.0 again.  Tested with 3.1 and 2.4

Change-Id: I1a29c1031d96e65a0111bc812a90f2dbaf2a5aa3
---
M src/osmo-bts-sysmo/l1_if.c
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 60eacab..9aa5477 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1322,7 +1322,6 @@
        return l1if_req_compl(hdl, msg, activate_rf_compl_cb, NULL);
 }
 
-#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3,6,0)
 static void mute_handle_ts(struct gsm_bts_trx_ts *ts, int is_muted)
 {
        int i;
@@ -1350,6 +1349,7 @@
        }
 }
 
+#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3,6,0)
 static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
                            void *data)
 {
@@ -1388,8 +1388,11 @@
 /* mute/unmute RF time slots */
 int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
 {
+       const uint8_t unmuted[8] = { 0,0,0,0,0,0,0,0 };
        struct msgb *msg = sysp_msgb_alloc();
        SuperFemto_Prim_t *sysp = msgb_sysprim(msg);
+       struct gsm_bts_trx *trx = hdl->phy_inst->trx;
+       int i;
 
        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],
@@ -1399,6 +1402,14 @@
 #if SUPERFEMTO_API_VERSION < SUPERFEMTO_API(3,6,0)
        LOGP(DL1C, LOGL_ERROR, "RF-MUTE.req not supported by SuperFemto\n");
        msgb_free(msg);
+       /* always acknowledge an un-MUTE (which is a no-op if MUTE is not 
supported */
+       if (!memcmp(mute, unmuted, ARRAY_SIZE(mute))) {
+               bts_update_status(BTS_STATUS_RF_MUTE, mute[0]);
+               oml_mo_rf_lock_chg(&trx->mo, mute, 1);
+               for (i = 0; i < ARRAY_SIZE(mute); ++i)
+                       mute_handle_ts(&trx->ts[i], mute[i]);
+               return 0;
+       }
        return -ENOTSUP;
 #else
        sysp->id = SuperFemto_PrimId_MuteRfReq;

-- 
To view, visit https://gerrit.osmocom.org/7197
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a29c1031d96e65a0111bc812a90f2dbaf2a5aa3
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to