aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy/l1_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-octphy/l1_if.c')
-rw-r--r--src/osmo-bts-octphy/l1_if.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 294a65ec..074a1a7f 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -479,7 +479,7 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
abort();
}
- len = msgb_l2len(msg);
+ len = (msg->l2h) ? msgb_l2len(msg) : 0;
chan_nr = l1sap->u.data.chan_nr;
link_id = l1sap->u.data.link_id;
@@ -589,11 +589,10 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
if (msg) {
nmsg = l1p_msgb_alloc();
if (!nmsg) {
- LOGPFN(DL1C, LOGL_FATAL, u32Fn, "L1SAP PH-TCH.req msg alloc failed\n");
+ LOGPLCFN(lchan, u32Fn, DL1C, LOGL_FATAL, "L1SAP PH-TCH.req msg alloc failed\n");
return -ENOMEM;
}
- msgb_pull(msg, sizeof(*l1sap));
tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req =
(tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *)
msgb_put(nmsg, sizeof(*data_req));
@@ -615,7 +614,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg,
&data_req->Data.ulPayloadType,
data_req->Data.abyDataContent,
&data_req->Data.ulDataLength,
- msg->data, msg->len);
+ msgb_l2(msg), msgb_l2len(msg));
mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req);
} else {
@@ -769,15 +768,17 @@ int bts_model_init(struct gsm_bts *bts)
bts->variant = BTS_OSMO_OCTPHY;
bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
+ bts->gprs.cell.support.gprs_codings = NM_IPAC_MASK_GPRS_CODING_CS;
/* FIXME: what is the nominal transmit power of the PHY/board? */
bts->c0->nominal_power = 15;
- osmo_bts_set_feature(bts->features, BTS_FEAT_GPRS);
- osmo_bts_set_feature(bts->features, BTS_FEAT_OML_ALERTS);
+ /* order alphabetically */
#if defined(cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_FCCH_SCH_BCCH_CCCH_SDCCH4_CBCH_SACCHC4) && defined(cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_SDCCH8_CBCH_SACCHC8)
osmo_bts_set_feature(bts->features, BTS_FEAT_CBCH);
#endif
+ osmo_bts_set_feature(bts->features, BTS_FEAT_GPRS);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_OML_ALERTS);
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_V1);
osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_V1);
@@ -786,6 +787,29 @@ int bts_model_init(struct gsm_bts *bts)
int bts_model_trx_init(struct gsm_bts_trx *trx)
{
+ /* Frequency bands indicated to the BSC */
+ trx->support.freq_bands = NM_IPAC_F_FREQ_BAND_PGSM
+ | NM_IPAC_F_FREQ_BAND_EGSM
+ | NM_IPAC_F_FREQ_BAND_RGSM
+ | NM_IPAC_F_FREQ_BAND_DCS
+ | NM_IPAC_F_FREQ_BAND_PCS
+ | NM_IPAC_F_FREQ_BAND_850
+ | NM_IPAC_F_FREQ_BAND_480
+ | NM_IPAC_F_FREQ_BAND_450;
+
+ /* Channel types and modes indicated to the BSC */
+ trx->support.chan_types = NM_IPAC_MASK_CHANT_COMMON
+#if defined(cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_FCCH_SCH_BCCH_CCCH_SDCCH4_CBCH_SACCHC4)
+ | NM_IPAC_F_CHANT_BCCH_SDCCH4_CBCH
+#endif
+#if defined(cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_SDCCH8_CBCH_SACCHC8)
+ | NM_IPAC_F_CHANT_SDCCH8_CBCH
+#endif
+ | NM_IPAC_F_CHANT_PDCHF
+ | NM_IPAC_F_CHANT_TCHF_PDCHF;
+ trx->support.chan_modes = NM_IPAC_F_CHANM_SPEECH_FS
+ | NM_IPAC_F_CHANM_SPEECH_HS;
+
return 0;
}
@@ -1302,7 +1326,11 @@ static int retransmit_wlc_upto(struct octphy_hdl *fl1h, uint32_t trans_id)
wlc->num_retrans++;
msg = msgb_copy(wlc->cmd_msg, "PHY CMD Retrans");
msg_set_retrans_flag(msg);
- osmo_wqueue_enqueue(&fl1h->phy_wq, msg);
+ if (osmo_wqueue_enqueue(&fl1h->phy_wq, msg) < 0) {
+ LOGP(DL1C, LOGL_ERROR, "Queue full on wlc retransmit\n");
+ msgb_free(msg);
+ return 0;
+ }
osmo_timer_schedule(&wlc->timer, CMD_TIMEOUT, 0);
count++;
LOGP(DL1C, LOGL_INFO, "Re-transmitting %s "