diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/l1sap.c | 13 | ||||
-rw-r--r-- | src/common/paging.c | 6 | ||||
-rw-r--r-- | src/common/rsl.c | 8 | ||||
-rw-r--r-- | src/common/sysinfo.c | 14 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/l1_if.c | 16 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/oml.c | 9 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 16 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 9 |
8 files changed, 42 insertions, 49 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 553011f0..82aa1ac9 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -205,7 +205,8 @@ const struct value_string gsmtap_sapi_names[] = { /* send primitive as gsmtap */ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *ss, uint32_t fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len, + uint8_t num_agch) { struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr, link_id; @@ -229,10 +230,9 @@ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, } else if (L1SAP_IS_CHAN_BCCH(chan_nr)) { *chan_type = GSMTAP_CHANNEL_BCCH; } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { -#warning Set BS_AG_BLKS_RES /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ - if (L1SAP_FN2CCCHBLOCK(fn) >= 1) + if (L1SAP_FN2CCCHBLOCK(fn) >= num_agch) *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; @@ -312,7 +312,7 @@ static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) &len); else rc = gsmtap_ph_data(l1sap, &chan_type, &ss, fn, &data, - &len); + &len, num_agch(trx, "GSMTAP")); break; case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION): rc = gsmtap_ph_rach(l1sap, &chan_type, &tn, &ss, &fn, &data, @@ -615,10 +615,9 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx, } } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); -#warning "TODO: Yet another assumption that BS_AG_BLKS_RES=1" - /* if CCCH block is 0, it is AGCH */ rc = bts_ccch_copy_msg(trx->bts, p, &g_time, - (L1SAP_FN2CCCHBLOCK(fn) < 1)); + (L1SAP_FN2CCCHBLOCK(fn) < + num_agch(trx, "PH-RTS-IND"))); if (rc <= 0) memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } diff --git a/src/common/paging.c b/src/common/paging.c index f75f12dc..957d609b 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -538,12 +538,6 @@ static int paging_signal_cbfn(unsigned int subsys, unsigned int signal, void *hd struct paging_state *ps = btsb->paging_state; struct gsm48_system_information_type_3 *si3 = (void *) bts->si_buf[SYSINFO_TYPE_3]; -#warning "TODO: Remove this when setting u8NbrOfAgch is implemented properly" - if (si3->control_channel_desc.bs_ag_blks_res != 1) - LOGP(DPAG, LOGL_ERROR, - "Paging: BS_AG_BLKS_RES = %d != 1 not fully supported\n", - si3->control_channel_desc.bs_ag_blks_res); - paging_si_update(ps, &si3->control_channel_desc); } return 0; diff --git a/src/common/rsl.c b/src/common/rsl.c index 880136cd..8d1175db 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -295,6 +295,14 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); + if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && + num_agch(trx, "RSL") != 1) { + lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); + /* will be reactivated by sapi_deactivate_cb() */ + trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_REACT; + } + if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) bts->si_buf[SYSINFO_TYPE_2quater]; diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index ee42da25..d0a476d3 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -22,6 +22,7 @@ #include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/sysinfo.h> +#include <osmo-bts/logging.h> #include <osmo-bts/gsm_data.h> #define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum)) @@ -132,6 +133,19 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time) return NULL; } +uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg) +{ + struct gsm_bts *b = trx->bts; + struct gsm48_system_information_type_3 *si3; + if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) { + si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3); + return si3->control_channel_desc.bs_ag_blks_res; + } + LOGP(DL1P, LOGL_ERROR, "%s: Unable to determine actual BS_AG_BLKS_RES " + "value as SI3 is not available yet, fallback to 1\n", arg); + return 1; +} + uint8_t *lchan_sacch_get(struct gsm_lchan *lchan) { uint32_t tmp; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 632e769b..d9593382 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1188,22 +1188,6 @@ int l1if_handle_sysprim(struct lc15l1_hdl *fl1h, struct msgb *msg) return l1if_handle_ind(fl1h, msg); } -#if 0 -/* called by RSL if the BCCH SI has been modified */ -int sysinfo_has_changed(struct gsm_bts *bts, int si) -{ - /* FIXME: Determine BS_AG_BLKS_RES and - * * set cfgParams.u.agch.u8NbrOfAgch - * * determine implications on paging - */ - /* FIXME: Check for Extended BCCH presence */ - /* FIXME: Check for CCCH_CONF */ - /* FIXME: Check for BS_PA_MFRMS: update paging */ - - return 0; -} -#endif - static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) { diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 8afa2a2f..64c868cb 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1025,8 +1025,7 @@ static int mph_send_activate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd) lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic; break; case GsmL1_Sapi_Agch: -#warning Set BS_AG_BLKS_RES - lch_par->agch.u8NbrOfAgch = 1; + lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx, lchan->name); break; case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: @@ -1566,6 +1565,12 @@ static int sapi_deactivate_cb(struct gsm_lchan *lchan, int status) lchan_set_state(lchan, LCHAN_S_NONE); mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0); + + /* Reactivate CCCH due to SI3 update in RSL */ + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + lchan_activate(lchan); + } return 0; } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index ed643fcf..2a3caf95 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1176,22 +1176,6 @@ int l1if_handle_sysprim(struct femtol1_hdl *fl1h, struct msgb *msg) return l1if_handle_ind(fl1h, msg); } -#if 0 -/* called by RSL if the BCCH SI has been modified */ -int sysinfo_has_changed(struct gsm_bts *bts, int si) -{ - /* FIXME: Determine BS_AG_BLKS_RES and - * * set cfgParams.u.agch.u8NbrOfAgch - * * determine implications on paging - */ - /* FIXME: Check for Extended BCCH presence */ - /* FIXME: Check for CCCH_CONF */ - /* FIXME: Check for BS_PA_MFRMS: update paging */ - - return 0; -} -#endif - static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) { diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index b23d9924..01752d18 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1040,8 +1040,7 @@ static int mph_send_activate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd) lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic; break; case GsmL1_Sapi_Agch: -#warning Set BS_AG_BLKS_RES - lch_par->agch.u8NbrOfAgch = 1; + lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx, lchan->name); break; case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: @@ -1586,6 +1585,12 @@ static int sapi_deactivate_cb(struct gsm_lchan *lchan, int status) lchan_set_state(lchan, LCHAN_S_NONE); mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0); + + /* Reactivate CCCH due to SI3 update in RSL */ + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + lchan_activate(lchan); + } return 0; } |