On Sat, Feb 22, 2014 at 12:36:06AM +0100, Jacob Erlbeck wrote:
This patch extends paging_gen_msg() by adding an
output parameter
is_empty that is true, if only a paging message with dummy entries
has been placed into buffer. This feature is then used by
bts_ccch_copy_msg() to insert an AGCH message if is_empty is true
and there are more entries in the AGCH queue than fit into the
reserved blocks.
+ struct gsm48_system_information_type_3 *si3 =
+ GSM_BTS_SI(bts, SYSINFO_TYPE_3);
+ int bs_ag_blks_res = si3->control_channel_desc.bs_ag_blks_res;
it is the third place we access bs_ag_blks_res and it will not be the
last one (src/osmo-bts-sysmo/oml.c). Here we don't check if the SI3 is
valid or not. What do you think of creating an accessor method in common
instead that will return a default value? This way even the paging code
could initialize the bs_ag_blks_res to the default?
+ int agch_res_full = btsb->agch_queue_length >
bs_ag_blks_res;
- if (!is_ag_res)
- return paging_gen_msg(btsb->paging_state, out_buf, gt);
+ if (!is_ag_res) {
+ rc = paging_gen_msg(btsb->paging_state, out_buf, gt, &is_empty);
+
+ if (!is_empty || !agch_res_full)
+ return rc;
+ }
If I understand that correctly. In case we generated an empty paging
message and we have fewer AGCH messages in the queue than reserved blocks,
we do send an empty paging message. What is the reason for that? It
seems to complicate the code, is it a spec requirement?