Commit b8f42918 authored by Cedric Roux's avatar Cedric Roux

get rid of mac_rlc_get_buffer_occupancy

use mac_rlc_status_ind instead
(at first I thought I could not use it and wrote
mac_rlc_get_buffer_occupancy instead)
parent 7ec73948
......@@ -859,7 +859,7 @@ printf("MAC to FAPI downlink BUF CCCH %d\n", rlc.rlcTransmissionQueueSize);
/* this code is wrong: we should loop over all configured RaB */
/* DCCH (srb 1, lcid 1) */
rlc_status = mac_rlc_get_buffer_occupancy(module_idP, rlc.rnti, frameP, DCCH);
rlc_status = mac_rlc_status_ind(module_idP, rlc.rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, DCCH, 0);
rlc.logicalChannelIdentity = DCCH;
rlc.rlcTransmissionQueueSize = rlc_status.bytes_in_buffer;
LOG_I(MAC, "calling SchedDlRlcBufferReq on DCCH rnti %x queue_size %d\n", rlc.rnti, rlc_status.bytes_in_buffer);
......@@ -867,7 +867,7 @@ printf("MAC to FAPI downlink BUF CCCH %d\n", rlc.rlcTransmissionQueueSize);
printf("MAC to FAPI downlink BUF DCCH %d\n", rlc_status.bytes_in_buffer);
/* DCCH+1 (srb 2, lcid 2) */
rlc_status = mac_rlc_get_buffer_occupancy(module_idP, rlc.rnti, frameP, DCCH+1);
rlc_status = mac_rlc_status_ind(module_idP, rlc.rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, DCCH+1, 0);
rlc.logicalChannelIdentity = DCCH+1;
rlc.rlcTransmissionQueueSize = rlc_status.bytes_in_buffer;
LOG_I(MAC, "calling SchedDlRlcBufferReq on DCCH+1 rnti %x queue_size %d\n", rlc.rnti, rlc_status.bytes_in_buffer);
......@@ -875,7 +875,7 @@ printf("MAC to FAPI downlink BUF DCCH %d\n", rlc_status.bytes_in_buffer);
printf("MAC to FAPI downlink BUF DCCH+1 %d\n", rlc_status.bytes_in_buffer);
/* DTCH (drb 1, lcid 3) */
rlc_status = mac_rlc_get_buffer_occupancy(module_idP, rlc.rnti, frameP, DTCH);
rlc_status = mac_rlc_status_ind(module_idP, rlc.rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, DTCH, 0);
rlc.logicalChannelIdentity = DTCH;
rlc.rlcTransmissionQueueSize = rlc_status.bytes_in_buffer;
LOG_I(MAC, "calling SchedDlRlcBufferReq on DTCH rnti %x queue_size %d\n", rlc.rnti, rlc_status.bytes_in_buffer);
......
......@@ -659,32 +659,6 @@ rlc_am_mac_status_indication (
return status_resp;
}
#if FAPI
//-----------------------------------------------------------------------------
struct mac_status_resp
rlc_am_mac_get_buffer_occupancy(
const protocol_ctxt_t* const ctxt_pP,
void * const rlc_pP)
{
struct mac_status_resp status_resp;
uint16_t sdu_size = 0;
uint16_t sdu_remaining_size = 0;
int32_t diff_time=0;
rlc_am_entity_t *rlc = (rlc_am_entity_t *) rlc_pP;
status_resp.buffer_occupancy_in_bytes = 0;
status_resp.buffer_occupancy_in_pdus = 0;
status_resp.head_sdu_remaining_size_to_send = 0;
status_resp.head_sdu_creation_time = 0;
status_resp.head_sdu_is_segmented = 0;
status_resp.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, rlc);
return status_resp;
}
#endif /* FAPI */
//-----------------------------------------------------------------------------
struct mac_data_req
rlc_am_mac_data_request (
......
......@@ -280,10 +280,6 @@ protected_rlc_am( void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void *
*/
public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);)
#if FAPI
public_rlc_am( struct mac_status_resp rlc_am_mac_get_buffer_occupancy(const protocol_ctxt_t* const ctxtP, void * const rlc_pP);)
#endif
/*! \fn struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP)
* \brief Gives PDUs to lower layer MAC.
* \param[in] ctxt_pP Running context.
......
......@@ -171,21 +171,6 @@ rlc_tm_mac_status_indication (
return status_resp;
}
#if FAPI
//-----------------------------------------------------------------------------
struct mac_status_resp
rlc_tm_mac_get_buffer_occupancy(
const protocol_ctxt_t* const ctxt_pP,
void * const rlc_pP)
{
struct mac_status_resp status_resp;
status_resp.buffer_occupancy_in_bytes = ((rlc_tm_entity_t *) rlc_pP)->buffer_occupancy;
return status_resp;
}
#endif /* FAPI */
//-----------------------------------------------------------------------------
struct mac_data_req
rlc_tm_mac_data_request (
......
......@@ -124,10 +124,6 @@ public_rlc_tm( struct mac_status_resp rlc_tm_mac_status_indication (
const uint16_t tb_sizeP,
struct mac_status_ind tx_statusP);)
#if FAPI
public_rlc_tm( struct mac_status_resp rlc_tm_mac_get_buffer_occupancy( const protocol_ctxt_t* const ctxt_pP, void * const rlcP);)
#endif
/*! \fn struct mac_data_req rlc_tm_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void * const rlcP)
* \brief Gives PDUs to lower layer MAC.
* \param[in] ctxtP Running context.
......
......@@ -513,32 +513,6 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
return status_resp;
}
#if FAPI
//-----------------------------------------------------------------------------
struct mac_status_resp
rlc_um_mac_get_buffer_occupancy(const protocol_ctxt_t* const ctxt_pP, void *rlc_pP)
{
struct mac_status_resp status_resp;
rlc_um_entity_t *rlc_p = NULL;
status_resp.buffer_occupancy_in_pdus = 0;
status_resp.buffer_occupancy_in_bytes = 0;
status_resp.head_sdu_remaining_size_to_send = 0;
status_resp.head_sdu_creation_time = 0;
status_resp.head_sdu_is_segmented = 0;
if (rlc_pP) {
rlc_p = (rlc_um_entity_t *) rlc_pP;
status_resp.rlc_info.rlc_protocol_state = rlc_p->protocol_state;
status_resp.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (rlc_p);
}
return status_resp;
}
#endif /* FAPI */
//-----------------------------------------------------------------------------
struct mac_data_req
rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP)
......
......@@ -195,10 +195,6 @@ protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_
*/
public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);)
#if FAPI
public_rlc_um( struct mac_status_resp rlc_um_mac_get_buffer_occupancy(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP);)
#endif
/*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
* \brief Gives PDUs to lower layer MAC.
* \param[in] ctxt_pP Running context.
......
......@@ -448,70 +448,3 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_STATUS_IND,VCD_FUNCTION_OUT);
return mac_rlc_status_resp;
}
#if FAPI
//-----------------------------------------------------------------------------
mac_rlc_status_resp_t mac_rlc_get_buffer_occupancy(
const module_id_t module_idP,
const rnti_t rntiP,
const frame_t frameP,
const logical_chan_id_t channel_idP)
{
//-----------------------------------------------------------------------------
mac_rlc_status_resp_t mac_rlc_status_resp;
struct mac_status_resp status_resp;
rb_id_t rb_id = 0;
rlc_mode_t rlc_mode = RLC_MODE_NONE;
rlc_union_t *rlc_union_p = NULL;
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
srb_flag_t srb_flag = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO;
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, 1 /* enb flag */, rntiP, frameP, 0, module_idP /* eNB_index */);
memset (&mac_rlc_status_resp, 0, sizeof(mac_rlc_status_resp_t));
if (channel_idP > 2) {
rb_id = channel_idP - 2;
} else {
rb_id = channel_idP;
}
key = RLC_COLL_KEY_VALUE(module_idP, rntiP, 1, rb_id, srb_flag);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
rlc_mode = rlc_union_p->mode;
} else {
rlc_mode = RLC_MODE_NONE;
}
switch (rlc_mode) {
default:
case RLC_MODE_NONE:
mac_rlc_status_resp.bytes_in_buffer = 0;
break;
case RLC_MODE_AM:
status_resp = rlc_am_mac_get_buffer_occupancy(&ctxt, &rlc_union_p->rlc.am);
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
break;
case RLC_MODE_UM:
status_resp = rlc_um_mac_get_buffer_occupancy(&ctxt, &rlc_union_p->rlc.um);
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
break;
case RLC_MODE_TM:
status_resp = rlc_tm_mac_get_buffer_occupancy(&ctxt, &rlc_union_p->rlc.tm);
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
break;
}
return mac_rlc_status_resp;
}
#endif /* FAPI */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment