ms: Get the set of slots currently active
This commits adds methods to GprsMs and gprs_rlcmac_tbf to retrieve the slots that are actively used. Sponsored-by: On-Waves ehf
This commit is contained in:
parent
23f93a15ca
commit
617c7127f4
|
@ -538,6 +538,32 @@ int GprsMs::first_common_ts() const
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t GprsMs::dl_slots() const
|
||||||
|
{
|
||||||
|
uint8_t slots = 0;
|
||||||
|
|
||||||
|
if (m_dl_tbf)
|
||||||
|
slots |= m_dl_tbf->dl_slots();
|
||||||
|
|
||||||
|
if (m_ul_tbf)
|
||||||
|
slots |= m_ul_tbf->dl_slots();
|
||||||
|
|
||||||
|
return slots;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t GprsMs::ul_slots() const
|
||||||
|
{
|
||||||
|
uint8_t slots = 0;
|
||||||
|
|
||||||
|
if (m_dl_tbf)
|
||||||
|
slots |= m_dl_tbf->ul_slots();
|
||||||
|
|
||||||
|
if (m_ul_tbf)
|
||||||
|
slots |= m_ul_tbf->ul_slots();
|
||||||
|
|
||||||
|
return slots;
|
||||||
|
}
|
||||||
|
|
||||||
void GprsMs::set_reserved_slots(gprs_rlcmac_trx *trx,
|
void GprsMs::set_reserved_slots(gprs_rlcmac_trx *trx,
|
||||||
uint8_t ul_slots, uint8_t dl_slots)
|
uint8_t ul_slots, uint8_t dl_slots)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,6 +80,8 @@ public:
|
||||||
uint8_t current_cs_dl() const;
|
uint8_t current_cs_dl() const;
|
||||||
|
|
||||||
int first_common_ts() const;
|
int first_common_ts() const;
|
||||||
|
uint8_t dl_slots() const;
|
||||||
|
uint8_t ul_slots() const;
|
||||||
uint8_t reserved_dl_slots() const;
|
uint8_t reserved_dl_slots() const;
|
||||||
uint8_t reserved_ul_slots() const;
|
uint8_t reserved_ul_slots() const;
|
||||||
gprs_rlcmac_trx *current_trx() const;
|
gprs_rlcmac_trx *current_trx() const;
|
||||||
|
|
36
src/tbf.cpp
36
src/tbf.cpp
|
@ -935,6 +935,42 @@ uint8_t gprs_rlcmac_tbf::tsc() const
|
||||||
return trx->pdch[first_ts].tsc;
|
return trx->pdch[first_ts].tsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t gprs_rlcmac_tbf::dl_slots() const
|
||||||
|
{
|
||||||
|
uint8_t slots = 0;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if (direction == GPRS_RLCMAC_UL_TBF)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(pdch); i += 1)
|
||||||
|
if (pdch[i])
|
||||||
|
slots |= 1 << i;
|
||||||
|
|
||||||
|
return slots;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t gprs_rlcmac_tbf::ul_slots() const
|
||||||
|
{
|
||||||
|
uint8_t slots = 0;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if (direction == GPRS_RLCMAC_DL_TBF) {
|
||||||
|
if (control_ts < 8)
|
||||||
|
slots |= 1 << control_ts;
|
||||||
|
if (first_common_ts < 8)
|
||||||
|
slots |= 1 << first_common_ts;
|
||||||
|
|
||||||
|
return slots;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(pdch); i += 1)
|
||||||
|
if (pdch[i])
|
||||||
|
slots |= 1 << i;
|
||||||
|
|
||||||
|
return slots;
|
||||||
|
}
|
||||||
|
|
||||||
void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf)
|
void tbf_print_vty_info(struct vty *vty, struct llist_head *ltbf)
|
||||||
{
|
{
|
||||||
gprs_rlcmac_tbf *tbf = llist_pods_entry(ltbf, gprs_rlcmac_tbf);
|
gprs_rlcmac_tbf *tbf = llist_pods_entry(ltbf, gprs_rlcmac_tbf);
|
||||||
|
|
|
@ -158,6 +158,8 @@ struct gprs_rlcmac_tbf {
|
||||||
const gprs_llc_queue *llc_queue() const;
|
const gprs_llc_queue *llc_queue() const;
|
||||||
|
|
||||||
time_t created_ts() const;
|
time_t created_ts() const;
|
||||||
|
uint8_t dl_slots() const;
|
||||||
|
uint8_t ul_slots() const;
|
||||||
|
|
||||||
/* attempt to make things a bit more fair */
|
/* attempt to make things a bit more fair */
|
||||||
void rotate_in_list();
|
void rotate_in_list();
|
||||||
|
|
Loading…
Reference in New Issue