diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-11-04 14:56:11 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-05 15:46:22 +0100 |
commit | 9ef742f5e751c1d5fdfae14aa663e6056e6cac6f (patch) | |
tree | 79d9054775f7834f9425286e81bc8d16c93cb691 /src | |
parent | f3108fafab3705752e21861a18c257c35e194c08 (diff) |
sysmobts: Add L1 support for the new RF mute request
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
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 50 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.h | 3 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 6 |
3 files changed, 59 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 3dbcd537..48d71b0d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1103,6 +1103,56 @@ int l1if_activate_rf(struct femtol1_hdl *hdl, int on) return l1if_req_compl(hdl, msg, activate_rf_compl_cb); } +#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3,6,0) +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; +} +#endif + +/* 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; +#else + 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); +#endif /* < 3.6.0 */ +} + /* 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 8d63569f..d659841c 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 c09b3f31..822453f5 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(); |