diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-03-02 12:43:47 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2017-04-13 19:03:56 +0200 |
commit | e4403464ed7de23f8fa3a2a57acee31248993c3d (patch) | |
tree | 81d9c4223a384745b3f215933cabf60a1de389a1 /src | |
parent | 7a21dccec1c672e0c071eb5f264a26c248ac6cac (diff) |
octphy: add conditional compilation to support latest octasic header release
With octasics latest release (octsdr-2g-02.07.01-B1351-beta), some struct
members are moved or renamed. This patch adds ifdef-logic and configure
checks to restore compatibilty.
Change-Id: I73287983e8bed8bf64b2ab87e6b810c2c59ea6fd
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bts-octphy/octphy_hw_api.c | 27 | ||||
-rw-r--r-- | src/osmo-bts-octphy/octphy_vty.c | 12 |
2 files changed, 37 insertions, 2 deletions
diff --git a/src/osmo-bts-octphy/octphy_hw_api.c b/src/osmo-bts-octphy/octphy_hw_api.c index 0d6fabdd..7b988fe1 100644 --- a/src/osmo-bts-octphy/octphy_hw_api.c +++ b/src/osmo-bts-octphy/octphy_hw_api.c @@ -125,11 +125,19 @@ static int rf_port_stats_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, psr->RxStats.ulRxByteCnt, psr->RxStats.ulRxOverflowCnt, psr->RxStats.ulRxAverageBytePerSecond, psr->RxStats.ulRxAveragePeriodUs, +#if OCTPHY_USE_FREQUENCY == 1 + psr->RxStats.Frequency.ulValue, +#else psr->RxStats.ulFrequencyKhz, +#endif psr->TxStats.ulTxByteCnt, psr->TxStats.ulTxUnderflowCnt, psr->TxStats.ulTxAverageBytePerSecond, psr->TxStats.ulTxAveragePeriodUs, +#if OCTPHY_USE_FREQUENCY == 1 + psr->TxStats.Frequency.ulValue); +#else psr->TxStats.ulFrequencyKhz); +#endif get_cb_data = (struct octphy_hw_get_cb_data*) data; get_cb_data->cb(resp,get_cb_data->data); @@ -177,10 +185,15 @@ static int rf_ant_rx_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, LOGP(DL1C, LOGL_INFO, "ANT-RX-CONFIG.resp(Port=%u, Ant=%u): %s, " "Gain %d dB, GainCtrlMode=%s\n", arc->ulPortIndex, arc->ulAntennaIndex, +#ifdef OCTPHY_USE_RX_CONFIG + arc->RxConfig.ulEnableFlag ? "Enabled" : "Disabled", + arc->RxConfig.lRxGaindB/512, + get_value_string(rx_gain_mode_vals, arc->RxConfig.ulRxGainMode)); +#else arc->ulEnableFlag ? "Enabled" : "Disabled", arc->lRxGaindB/512, get_value_string(rx_gain_mode_vals, arc->ulRxGainMode)); - +#endif msgb_free(resp); return 0; } @@ -219,9 +232,14 @@ static int rf_ant_tx_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, LOGP(DL1C, LOGL_INFO, "ANT-TX-CONFIG.resp(Port=%u, Ant=%u): %s, " "Gain %d dB\n", atc->ulPortIndex, atc->ulAntennaIndex, +#ifdef OCTPHY_USE_TX_CONFIG + atc->TxConfig.ulEnableFlag? "Enabled" : "Disabled", + atc->TxConfig.lTxGaindB/512); +#else atc->ulEnableFlag ? "Enabled" : "Disabled", atc->lTxGaindB/512); +#endif msgb_free(resp); return 0; } @@ -326,7 +344,12 @@ static int get_clock_sync_stats_cb(struct octphy_hdl *fl1, struct msgb *resp, get_value_string(clocksync_state_vals, csr->ulState), csr->lClockError, csr->lDroppedCycles, csr->ulPllFreqHz, csr->ulPllFractionalFreqHz, csr->ulSlipCnt, - csr->ulSyncLosseCnt, csr->ulSourceState, csr->ulDacValue); +#if OCTPHY_USE_SYNC_LOSS_CNT == 1 + csr->ulSyncLossCnt, +#else + csr->ulSyncLosseCnt, +#endif + csr->ulSourceState, csr->ulDacValue); get_cb_data = (struct octphy_hw_get_cb_data*) data; get_cb_data->cb(resp,get_cb_data->data); diff --git a/src/osmo-bts-octphy/octphy_vty.c b/src/osmo-bts-octphy/octphy_vty.c index bc4acd65..370aff6d 100644 --- a/src/osmo-bts-octphy/octphy_vty.c +++ b/src/osmo-bts-octphy/octphy_vty.c @@ -187,7 +187,11 @@ void show_rf_port_stats_cb(struct msgb *resp, void *data) VTY_NEWLINE); vty_out(vty, "Rx Period=%u%s", psr->RxStats.ulRxAveragePeriodUs, VTY_NEWLINE); +#if OCTPHY_USE_FREQUENCY == 1 + vty_out(vty, "Rx Freq=%u%s", psr->RxStats.Frequency.ulValue, VTY_NEWLINE); +#else vty_out(vty, "Rx Freq=%u%s", psr->RxStats.ulFrequencyKhz, VTY_NEWLINE); +#endif vty_out(vty, "Tx Bytes=%u%s", psr->TxStats.ulTxByteCnt, VTY_NEWLINE); vty_out(vty, "Tx Underflow=%u%s", psr->TxStats.ulTxUnderflowCnt, VTY_NEWLINE); @@ -195,7 +199,11 @@ void show_rf_port_stats_cb(struct msgb *resp, void *data) VTY_NEWLINE); vty_out(vty, "Tx Period=%u%s", psr->TxStats.ulTxAveragePeriodUs, VTY_NEWLINE); +#if OCTPHY_USE_FREQUENCY == 1 + vty_out(vty, "Tx Freq=%u%s", psr->TxStats.Frequency.ulValue, VTY_NEWLINE); +#else vty_out(vty, "Tx Freq=%u%s", psr->TxStats.ulFrequencyKhz, VTY_NEWLINE); +#endif } DEFUN(show_rf_port_stats, show_rf_port_stats_cmd, @@ -243,7 +251,11 @@ void show_clk_sync_stats_cb(struct msgb *resp, void *data) vty_out(vty, "PllFreqHz=%u%s", csr->ulPllFreqHz, VTY_NEWLINE); vty_out(vty, "PllFract=%u%s", csr->ulPllFractionalFreqHz, VTY_NEWLINE); vty_out(vty, "SlipCnt=%u%s", csr->ulSlipCnt, VTY_NEWLINE); +#if OCTPHY_USE_SYNC_LOSS_CNT == 1 + vty_out(vty, "SyncLosses=%u%s", csr->ulSyncLossCnt, VTY_NEWLINE); +#else vty_out(vty, "SyncLosses=%u%s", csr->ulSyncLosseCnt, VTY_NEWLINE); +#endif vty_out(vty, "SourceState=%u%s", csr->ulSourceState, VTY_NEWLINE); vty_out(vty, "DacValue=%u%s", csr->ulDacValue, VTY_NEWLINE); } |