diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 99c92b77..07561361 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -828,6 +828,14 @@ DEFUN(show_bts_stats, return CMD_SUCCESS; } +DEFUN(show_bts_pdch, + show_bts_pdch_cmd, + "show bts pdch", + SHOW_STR "BTS related functionality\nPDCH timeslots\n") +{ + return pcu_vty_show_bts_pdch(vty, bts_main_data()); +} + #define IDLE_TIME_STR "keep an idle DL TBF alive for the time given\n" DEFUN_DEPRECATED(cfg_pcu_dl_tbf_idle_time, cfg_pcu_dl_tbf_idle_time_cmd, @@ -1273,6 +1281,7 @@ int pcu_vty_init(void) install_element(PCU_NODE, &cfg_pcu_timer_cmd); install_element_ve(&show_bts_stats_cmd); + install_element_ve(&show_bts_pdch_cmd); install_element_ve(&show_tbf_cmd); install_element_ve(&show_ms_all_cmd); install_element_ve(&show_ms_tlli_cmd); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 3e9973ca..33a4637e 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -239,3 +239,31 @@ int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts_data, return show_ms(vty, ms); } + +int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts_data) +{ + unsigned int trx_nr, ts_nr; + + vty_out(vty, "BTS (%s)%s", bts_data->active ? "active" : "disabled", VTY_NEWLINE); + for (trx_nr = 0; trx_nr < ARRAY_SIZE(bts_data->trx); trx_nr++) { + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_nr]; + + for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) { + if (trx->pdch[ts_nr].is_enabled()) + break; + } + if (ts_nr == ARRAY_SIZE(trx->pdch)) + continue; /* no pdch active, skip */ + + vty_out(vty, " TRX%u%s", trx->trx_no, VTY_NEWLINE); + for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) { + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts_nr]; + + vty_out(vty, " TS%u: PDCH %s, %u UL TBFs, %u DL TBFs%s", pdch->ts_no, + pdch->is_enabled() ? "enabled" : "disabled", + pdch->num_tbfs(GPRS_RLCMAC_DL_TBF), + pdch->num_tbfs(GPRS_RLCMAC_UL_TBF), VTY_NEWLINE); + } + } + return CMD_SUCCESS; +} diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h index 6fbc366e..4528fb23 100644 --- a/src/pcu_vty_functions.h +++ b/src/pcu_vty_functions.h @@ -33,7 +33,7 @@ int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data, uint32_t tlli); int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts_data, const char *imsi); - +int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts_data); #ifdef __cplusplus } #endif