mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-pcu.git
synced 2025-11-21 22:48:14 +00:00
sba: Move freeing a sba into a central place
This commit is contained in:
10
src/bts.cpp
10
src/bts.cpp
@@ -1052,10 +1052,7 @@ int gprs_rlcmac_pdch::rcv_control_block(
|
|||||||
} else {
|
} else {
|
||||||
ta = sba->ta;
|
ta = sba->ta;
|
||||||
bts()->timing_advance()->remember(tlli, ta);
|
bts()->timing_advance()->remember(tlli, ta);
|
||||||
#warning "SBA deleted inline.. enforce capsulation"
|
bts()->sba()->free_sba(sba);
|
||||||
bts()->sba_freed();
|
|
||||||
llist_del(&sba->list);
|
|
||||||
talloc_free(sba);
|
|
||||||
}
|
}
|
||||||
if (ul_control_block->u.Packet_Resource_Request.Exist_MS_Radio_Access_capability)
|
if (ul_control_block->u.Packet_Resource_Request.Exist_MS_Radio_Access_capability)
|
||||||
ms_class = Decoding::get_ms_class_by_capability(&ul_control_block->u.Packet_Resource_Request.MS_Radio_Access_capability);
|
ms_class = Decoding::get_ms_class_by_capability(&ul_control_block->u.Packet_Resource_Request.MS_Radio_Access_capability);
|
||||||
@@ -1101,11 +1098,8 @@ int gprs_rlcmac_pdch::rcv_control_block(
|
|||||||
"block, but there is no resource request "
|
"block, but there is no resource request "
|
||||||
"scheduled!\n");
|
"scheduled!\n");
|
||||||
} else {
|
} else {
|
||||||
#warning "SBA deleted inline.. enforce capsulation"
|
|
||||||
bts()->timing_advance()->remember(ul_control_block->u.Packet_Measurement_Report.TLLI, sba->ta);
|
bts()->timing_advance()->remember(ul_control_block->u.Packet_Measurement_Report.TLLI, sba->ta);
|
||||||
bts()->sba_freed();
|
bts()->sba()->free_sba(sba);
|
||||||
llist_del(&sba->list);
|
|
||||||
talloc_free(sba);
|
|
||||||
}
|
}
|
||||||
gprs_rlcmac_meas_rep(&ul_control_block->u.Packet_Measurement_Report);
|
gprs_rlcmac_meas_rep(&ul_control_block->u.Packet_Measurement_Report);
|
||||||
break;
|
break;
|
||||||
|
|||||||
19
src/sba.cpp
19
src/sba.cpp
@@ -124,14 +124,18 @@ uint32_t SBAController::sched(uint8_t trx, uint8_t ts, uint32_t fn, uint8_t bloc
|
|||||||
int SBAController::timeout(struct gprs_rlcmac_sba *sba)
|
int SBAController::timeout(struct gprs_rlcmac_sba *sba)
|
||||||
{
|
{
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA\n");
|
LOGP(DRLCMAC, LOGL_NOTICE, "Poll timeout for SBA\n");
|
||||||
llist_del(&sba->list);
|
|
||||||
m_bts.sba_timedout();
|
m_bts.sba_timedout();
|
||||||
m_bts.sba_freed();
|
free_sba(sba);
|
||||||
talloc_free(sba);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SBAController::free_sba(gprs_rlcmac_sba *sba)
|
||||||
|
{
|
||||||
|
m_bts.sba_freed();
|
||||||
|
llist_del(&sba->list);
|
||||||
|
talloc_free(sba);
|
||||||
|
}
|
||||||
|
|
||||||
void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch)
|
void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch)
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_sba *sba, *sba2;
|
struct gprs_rlcmac_sba *sba, *sba2;
|
||||||
@@ -139,10 +143,7 @@ void SBAController::free_resources(struct gprs_rlcmac_pdch *pdch)
|
|||||||
const uint8_t ts_no = pdch->ts_no;
|
const uint8_t ts_no = pdch->ts_no;
|
||||||
|
|
||||||
llist_for_each_entry_safe(sba, sba2, &m_sbas, list) {
|
llist_for_each_entry_safe(sba, sba2, &m_sbas, list) {
|
||||||
if (sba->trx_no == trx_no && sba->ts_no == ts_no) {
|
if (sba->trx_no == trx_no && sba->ts_no == ts_no)
|
||||||
llist_del(&sba->list);
|
free_sba(sba);
|
||||||
m_bts.sba_freed();
|
|
||||||
talloc_free(sba);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
int timeout(struct gprs_rlcmac_sba *sba);
|
int timeout(struct gprs_rlcmac_sba *sba);
|
||||||
void free_resources(struct gprs_rlcmac_pdch *pdch);
|
void free_resources(struct gprs_rlcmac_pdch *pdch);
|
||||||
|
|
||||||
|
void free_sba(gprs_rlcmac_sba *sba);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BTS &m_bts;
|
BTS &m_bts;
|
||||||
llist_head m_sbas;
|
llist_head m_sbas;
|
||||||
|
|||||||
Reference in New Issue
Block a user