Move tbf::free_all static methods to proper object files
Move each method to the object on which they operate, be it a trx or a pdch ts. Change-Id: Ida715cbf384431d37b2b192fbd7882957c93a4d1
This commit is contained in:
parent
8a35e640a3
commit
906aafc9e2
|
@ -70,6 +70,12 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bts_trx_free_all_tbf(struct gprs_rlcmac_trx *trx)
|
||||||
|
{
|
||||||
|
for (uint8_t ts = 0; ts < 8; ts++)
|
||||||
|
pdch_free_all_tbf(&trx->pdch[ts]);
|
||||||
|
}
|
||||||
|
|
||||||
static struct osmo_tdef T_defs_bts[] = {
|
static struct osmo_tdef T_defs_bts[] = {
|
||||||
{ .T=3142, .default_val=20, .unit=OSMO_TDEF_S, .desc="timer (s)", .val=0 },
|
{ .T=3142, .default_val=20, .unit=OSMO_TDEF_S, .desc="timer (s)", .val=0 },
|
||||||
{ .T=3169, .default_val=5, .unit=OSMO_TDEF_S, .desc="Reuse of USF and TFI(s) after the MS uplink TBF assignment is invalid (s)", .val=0 },
|
{ .T=3169, .default_val=5, .unit=OSMO_TDEF_S, .desc="Reuse of USF and TFI(s) after the MS uplink TBF assignment is invalid (s)", .val=0 },
|
||||||
|
|
|
@ -65,6 +65,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void bts_trx_reserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots);
|
void bts_trx_reserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots);
|
||||||
void bts_trx_unreserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots);
|
void bts_trx_unreserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots);
|
||||||
|
void bts_trx_free_all_tbf(struct gprs_rlcmac_trx *trx);
|
||||||
|
|
||||||
void bts_update_tbf_ta(const char *p, uint32_t fn, uint8_t trx_no, uint8_t ts, int8_t ta, bool is_rach);
|
void bts_update_tbf_ta(const char *p, uint32_t fn, uint8_t trx_no, uint8_t ts, int8_t ta, bool is_rach);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -118,7 +118,7 @@ static void pcu_sock_close(int lost)
|
||||||
bts->trx[trx].pdch[ts].disable();
|
bts->trx[trx].pdch[ts].disable();
|
||||||
/* FIXME: NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c
|
/* FIXME: NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c
|
||||||
for the reset. */
|
for the reset. */
|
||||||
gprs_rlcmac_tbf::free_all(&bts->trx[trx]);
|
bts_trx_free_all_tbf(&bts->trx[trx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gprs_bssgp_destroy(bts);
|
gprs_bssgp_destroy(bts);
|
||||||
|
|
16
src/pdch.cpp
16
src/pdch.cpp
|
@ -152,7 +152,7 @@ void gprs_rlcmac_pdch::free_resources()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* kick all TBF on slot */
|
/* kick all TBF on slot */
|
||||||
gprs_rlcmac_tbf::free_all(this);
|
pdch_free_all_tbf(this);
|
||||||
|
|
||||||
/* flush all pending paging messages */
|
/* flush all pending paging messages */
|
||||||
while ((pag = dequeue_paging()))
|
while ((pag = dequeue_paging()))
|
||||||
|
@ -1017,3 +1017,17 @@ void gprs_rlcmac_pdch::update_ta(uint8_t tai, uint8_t ta)
|
||||||
OSMO_ASSERT(tai < PTCCH_TAI_NUM);
|
OSMO_ASSERT(tai < PTCCH_TAI_NUM);
|
||||||
ptcch_msg[tai] = ta;
|
ptcch_msg[tai] = ta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pdch_free_all_tbf(struct gprs_rlcmac_pdch *pdch)
|
||||||
|
{
|
||||||
|
for (uint8_t tfi = 0; tfi < 32; tfi++) {
|
||||||
|
struct gprs_rlcmac_tbf *tbf;
|
||||||
|
|
||||||
|
tbf = pdch->ul_tbf_by_tfi(tfi);
|
||||||
|
if (tbf)
|
||||||
|
tbf_free(tbf);
|
||||||
|
tbf = pdch->dl_tbf_by_tfi(tfi);
|
||||||
|
if (tbf)
|
||||||
|
tbf_free(tbf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -183,3 +183,11 @@ inline bool gprs_rlcmac_pdch::is_enabled() const
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
void pdch_free_all_tbf(struct gprs_rlcmac_pdch *pdch);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
20
src/tbf.cpp
20
src/tbf.cpp
|
@ -1045,26 +1045,6 @@ free_ret:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_trx *trx)
|
|
||||||
{
|
|
||||||
for (uint8_t ts = 0; ts < 8; ts++)
|
|
||||||
free_all(&trx->pdch[ts]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_pdch *pdch)
|
|
||||||
{
|
|
||||||
for (uint8_t tfi = 0; tfi < 32; tfi++) {
|
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
|
||||||
|
|
||||||
tbf = pdch->ul_tbf_by_tfi(tfi);
|
|
||||||
if (tbf)
|
|
||||||
tbf_free(tbf);
|
|
||||||
tbf = pdch->dl_tbf_by_tfi(tfi);
|
|
||||||
if (tbf)
|
|
||||||
tbf_free(tbf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int gprs_rlcmac_tbf::establish_dl_tbf_on_pacch()
|
int gprs_rlcmac_tbf::establish_dl_tbf_on_pacch()
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_dl_tbf *new_tbf = NULL;
|
struct gprs_rlcmac_dl_tbf *new_tbf = NULL;
|
||||||
|
|
|
@ -215,9 +215,6 @@ struct gprs_rlcmac_tbf {
|
||||||
gprs_rlcmac_tbf(struct gprs_rlcmac_bts *bts_, GprsMs *ms, gprs_rlcmac_tbf_direction dir);
|
gprs_rlcmac_tbf(struct gprs_rlcmac_bts *bts_, GprsMs *ms, gprs_rlcmac_tbf_direction dir);
|
||||||
virtual ~gprs_rlcmac_tbf() {}
|
virtual ~gprs_rlcmac_tbf() {}
|
||||||
|
|
||||||
static void free_all(struct gprs_rlcmac_trx *trx);
|
|
||||||
static void free_all(struct gprs_rlcmac_pdch *pdch);
|
|
||||||
|
|
||||||
virtual gprs_rlc_window *window() = 0;
|
virtual gprs_rlc_window *window() = 0;
|
||||||
|
|
||||||
int setup(int8_t use_trx, bool single_slot);
|
int setup(int8_t use_trx, bool single_slot);
|
||||||
|
|
Loading…
Reference in New Issue