tbf: Move the code to close all timeslots into the tbf class
Move the code out of the sysmocom_socket (as this is only required to talk to our hardware) and into the TBF class that actually knows what a TBF is.
This commit is contained in:
parent
9e21d84f1e
commit
964ddb6aa0
|
@ -82,8 +82,7 @@ static void pcu_sock_close(struct pcu_sock_state *state, int lost)
|
||||||
{
|
{
|
||||||
struct osmo_fd *bfd = &state->conn_bfd;
|
struct osmo_fd *bfd = &state->conn_bfd;
|
||||||
struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
|
struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
uint8_t trx, ts;
|
||||||
uint8_t trx, ts, tfi;
|
|
||||||
|
|
||||||
LOGP(DL1IF, LOGL_NOTICE, "PCU socket has %s connection\n",
|
LOGP(DL1IF, LOGL_NOTICE, "PCU socket has %s connection\n",
|
||||||
(lost) ? "LOST" : "closed");
|
(lost) ? "LOST" : "closed");
|
||||||
|
@ -108,14 +107,7 @@ static void pcu_sock_close(struct pcu_sock_state *state, int lost)
|
||||||
#endif
|
#endif
|
||||||
for (ts = 0; ts < 8; ts++)
|
for (ts = 0; ts < 8; ts++)
|
||||||
bts->trx[trx].pdch[ts].enable = 0;
|
bts->trx[trx].pdch[ts].enable = 0;
|
||||||
for (tfi = 0; tfi < 32; tfi++) {
|
gprs_rlcmac_tbf::free_all(&bts->trx[trx]);
|
||||||
tbf = bts->trx[trx].ul_tbf[tfi];
|
|
||||||
if (tbf)
|
|
||||||
tbf_free(tbf);
|
|
||||||
tbf = bts->trx[trx].dl_tbf[tfi];
|
|
||||||
if (tbf)
|
|
||||||
tbf_free(tbf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gprs_bssgp_destroy_or_exit();
|
gprs_bssgp_destroy_or_exit();
|
||||||
|
|
14
src/tbf.cpp
14
src/tbf.cpp
|
@ -237,3 +237,17 @@ struct gprs_rlcmac_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
||||||
|
|
||||||
return tbf;
|
return tbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_trx *trx)
|
||||||
|
{
|
||||||
|
for (uint8_t tfi = 0; tfi < 32; tfi++) {
|
||||||
|
struct gprs_rlcmac_tbf *tbf;
|
||||||
|
|
||||||
|
tbf = trx->ul_tbf[tfi];
|
||||||
|
if (tbf)
|
||||||
|
tbf_free(tbf);
|
||||||
|
tbf = trx->dl_tbf[tfi];
|
||||||
|
if (tbf)
|
||||||
|
tbf_free(tbf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -87,6 +87,10 @@ extern struct llist_head gprs_rlcmac_sbas; /* list of single block allocs */
|
||||||
|
|
||||||
|
|
||||||
struct gprs_rlcmac_tbf {
|
struct gprs_rlcmac_tbf {
|
||||||
|
|
||||||
|
static void free_all(struct gprs_rlcmac_trx *trx);
|
||||||
|
|
||||||
|
|
||||||
struct llist_head list;
|
struct llist_head list;
|
||||||
enum gprs_rlcmac_tbf_state state;
|
enum gprs_rlcmac_tbf_state state;
|
||||||
uint32_t state_flags;
|
uint32_t state_flags;
|
||||||
|
|
Loading…
Reference in New Issue