bts: extend bts_chan_load to allow counting tch only
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
This commit is contained in:
parent
7c359eb4b4
commit
308cb0719d
|
@ -46,7 +46,7 @@ struct pchan_load {
|
||||||
struct load_counter pchan[_GSM_PCHAN_MAX];
|
struct load_counter pchan[_GSM_PCHAN_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts);
|
void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts, int only_count_tch);
|
||||||
void network_chan_load(struct pchan_load *pl, struct gsm_network *net);
|
void network_chan_load(struct pchan_load *pl, struct gsm_network *net);
|
||||||
|
|
||||||
int trx_is_usable(struct gsm_bts_trx *trx);
|
int trx_is_usable(struct gsm_bts_trx *trx);
|
||||||
|
|
|
@ -239,7 +239,7 @@ static int get_bts_chan_load(struct ctrl_cmd *cmd, void *data)
|
||||||
|
|
||||||
bts = cmd->node;
|
bts = cmd->node;
|
||||||
memset(&pl, 0, sizeof(pl));
|
memset(&pl, 0, sizeof(pl));
|
||||||
bts_chan_load(&pl, bts);
|
bts_chan_load(&pl, bts, 0);
|
||||||
|
|
||||||
cmd->reply = talloc_strdup(cmd, "");
|
cmd->reply = talloc_strdup(cmd, "");
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
||||||
|
|
||||||
/* FIXME: chan_desc */
|
/* FIXME: chan_desc */
|
||||||
memset(&pl, 0, sizeof(pl));
|
memset(&pl, 0, sizeof(pl));
|
||||||
bts_chan_load(&pl, bts);
|
bts_chan_load(&pl, bts, 0);
|
||||||
vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE);
|
vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE);
|
||||||
dump_pchan_load_vty(vty, " ", &pl);
|
dump_pchan_load_vty(vty, " ", &pl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -514,7 +514,28 @@ struct gsm_subscriber_connection *connection_for_subscr(struct gsm_subscriber *s
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts)
|
static int chan_is_tch(struct gsm_bts_trx_ts *ts)
|
||||||
|
{
|
||||||
|
switch (ts->pchan) {
|
||||||
|
case GSM_PCHAN_TCH_F:
|
||||||
|
case GSM_PCHAN_TCH_H:
|
||||||
|
return 1;
|
||||||
|
case GSM_PCHAN_TCH_F_PDCH:
|
||||||
|
case GSM_PCHAN_TCH_F_TCH_H_PDCH:
|
||||||
|
if (ts->dyn.pchan_is == GSM_PCHAN_TCH_F ||
|
||||||
|
ts->dyn.pchan_is == GSM_PCHAN_TCH_H)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts,
|
||||||
|
int only_count_tch)
|
||||||
{
|
{
|
||||||
struct gsm_bts_trx *trx;
|
struct gsm_bts_trx *trx;
|
||||||
|
|
||||||
|
@ -536,6 +557,9 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts)
|
||||||
if (!nm_is_running(&ts->mo.nm_state))
|
if (!nm_is_running(&ts->mo.nm_state))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (only_count_tch && !chan_is_tch(ts))
|
||||||
|
continue;
|
||||||
|
|
||||||
subslots = ts_subslots(ts);
|
subslots = ts_subslots(ts);
|
||||||
for (j = 0; j < subslots; j++) {
|
for (j = 0; j < subslots; j++) {
|
||||||
struct gsm_lchan *lchan = &ts->lchan[j];
|
struct gsm_lchan *lchan = &ts->lchan[j];
|
||||||
|
@ -561,6 +585,5 @@ void network_chan_load(struct pchan_load *pl, struct gsm_network *net)
|
||||||
memset(pl, 0, sizeof(*pl));
|
memset(pl, 0, sizeof(*pl));
|
||||||
|
|
||||||
llist_for_each_entry(bts, &net->bts_list, list)
|
llist_for_each_entry(bts, &net->bts_list, list)
|
||||||
bts_chan_load(pl, bts);
|
bts_chan_load(pl, bts, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ static int can_send_pag_req(struct gsm_bts *bts, int rsl_type)
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
memset(&pl, 0, sizeof(pl));
|
memset(&pl, 0, sizeof(pl));
|
||||||
bts_chan_load(&pl, bts);
|
bts_chan_load(&pl, bts, 0);
|
||||||
|
|
||||||
switch (rsl_type) {
|
switch (rsl_type) {
|
||||||
case RSL_CHANNEED_TCH_F:
|
case RSL_CHANNEED_TCH_F:
|
||||||
|
|
Loading…
Reference in New Issue