paging: Provide the number of pending requests

Address the FIXME and take code from the on-waves/bsc-master
branch. This will count the number of requests.
This commit is contained in:
Holger Hans Peter Freyther 2011-04-26 15:52:34 +02:00
parent 5a081bbb1d
commit 66e14cdda6
3 changed files with 18 additions and 1 deletions

View File

@ -65,4 +65,7 @@ void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
/* update paging load */
void paging_update_buffer_space(struct gsm_bts *bts, uint16_t);
/* pending paging requests */
unsigned int paging_pending_requests_nr(struct gsm_bts *bts);
#endif

View File

@ -258,7 +258,8 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
net_dump_nmstate(vty, &bts->nm_state);
vty_out(vty, " Site Mgr NM State: ");
net_dump_nmstate(vty, &bts->site_mgr.nm_state);
vty_out(vty, " Paging: FIXME pending requests, %u free slots%s",
vty_out(vty, " Paging: %u pending requests, %u free slots%s",
paging_pending_requests_nr(bts),
bts->paging.available_slots, VTY_NEWLINE);
if (is_ipaccess_bts(bts)) {
vty_out(vty, " OML Link state: %s.%s",

View File

@ -403,3 +403,16 @@ void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots)
bts->paging.available_slots = free_slots;
paging_schedule_if_needed(&bts->paging);
}
unsigned int paging_pending_requests_nr(struct gsm_bts *bts)
{
unsigned int requests = 0;
struct gsm_paging_request *req;
paging_init_if_needed(bts);
llist_for_each_entry(req, &bts->paging.pending_requests, entry)
++requests;
return requests;
}