Commit b0798357 authored by Haruki NAOI's avatar Haruki NAOI

Merge branch 'sp3_rlc_assertion' into sp3_master

parents a8ab765f 5d06a1ca
...@@ -42,8 +42,17 @@ void rlc_am_free_in_sdu( ...@@ -42,8 +42,17 @@ void rlc_am_free_in_sdu(
{ {
if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) { if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
/* BugFix: SDU shall have been already freed during initial PDU segmentation or concatenation !! */ /* BugFix: SDU shall have been already freed during initial PDU segmentation or concatenation !! */
//Assertion(eNB)_PRAN_DesignDocument_annex No.761
if(rlcP->input_sdus[index_in_bufferP].mem_block != NULL)
{
LOG_E(RLC, "RLC AM Tx SDU Conf: Data Part is not empty index=%d LcId=%d\n",
index_in_bufferP,rlcP->channel_id);
return;
}
/*
AssertFatal(rlcP->input_sdus[index_in_bufferP].mem_block == NULL, "RLC AM Tx SDU Conf: Data Part is not empty index=%d LcId=%d\n", AssertFatal(rlcP->input_sdus[index_in_bufferP].mem_block == NULL, "RLC AM Tx SDU Conf: Data Part is not empty index=%d LcId=%d\n",
index_in_bufferP,rlcP->channel_id); index_in_bufferP,rlcP->channel_id);
*/
/* /*
if (rlcP->input_sdus[index_in_bufferP].mem_block != NULL) { if (rlcP->input_sdus[index_in_bufferP].mem_block != NULL) {
free_mem_block(rlcP->input_sdus[index_in_bufferP].mem_block, __func__); free_mem_block(rlcP->input_sdus[index_in_bufferP].mem_block, __func__);
...@@ -121,8 +130,13 @@ rlc_am_pdu_sdu_data_cnf( ...@@ -121,8 +130,13 @@ rlc_am_pdu_sdu_data_cnf(
for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].nb_sdus; pdu_sdu_index++) { for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].nb_sdus; pdu_sdu_index++) {
sdu_index = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].sdus_index[pdu_sdu_index]; sdu_index = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].sdus_index[pdu_sdu_index];
assert(sdu_index >= 0); //assert(sdu_index >= 0);
assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE); //assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE);
if(sdu_index < 0 || sdu_index >= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
LOG_E(RLC, "sdu_index error. sdu_index %d, pdu_sdu_index %d\n", sdu_index, pdu_sdu_index);
continue;
}
rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1; rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1;
if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) && if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) &&
......
...@@ -57,7 +57,12 @@ rlc_am_reassembly ( ...@@ -57,7 +57,12 @@ rlc_am_reassembly (
if (rlc_pP->output_sdu_in_construction == NULL) { if (rlc_pP->output_sdu_in_construction == NULL) {
rlc_pP->output_sdu_in_construction = get_free_mem_block (RLC_SDU_MAX_SIZE, __func__); rlc_pP->output_sdu_in_construction = get_free_mem_block (RLC_SDU_MAX_SIZE, __func__);
rlc_pP->output_sdu_size_to_write = 0; rlc_pP->output_sdu_size_to_write = 0;
assert(rlc_pP->output_sdu_in_construction != NULL); //assert(rlc_pP->output_sdu_in_construction != NULL);
if(rlc_pP->output_sdu_in_construction == NULL) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PAYLOAD] output_sdu_in_construction is NULL\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
return;
}
} }
if (rlc_pP->output_sdu_in_construction != NULL) { if (rlc_pP->output_sdu_in_construction != NULL) {
...@@ -198,10 +203,16 @@ rlc_am_send_sdu ( ...@@ -198,10 +203,16 @@ rlc_am_send_sdu (
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
//msg("[RLC_AM][MOD %d] Freeing mem_block ...\n", rlc_pP->module_id); //msg("[RLC_AM][MOD %d] Freeing mem_block ...\n", rlc_pP->module_id);
//free_mem_block (rlc_pP->output_sdu_in_construction, __func__); //free_mem_block (rlc_pP->output_sdu_in_construction, __func__);
//Assertion(eNB)_PRAN_DesignDocument_annex No.764
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" SEND SDU REQUESTED %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->output_sdu_size_to_write);
/*
AssertFatal(3==4, AssertFatal(3==4,
PROTOCOL_RLC_AM_CTXT_FMT" SEND SDU REQUESTED %d bytes", PROTOCOL_RLC_AM_CTXT_FMT" SEND SDU REQUESTED %d bytes",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->output_sdu_size_to_write); rlc_pP->output_sdu_size_to_write);
*/
} }
rlc_pP->output_sdu_size_to_write = 0; rlc_pP->output_sdu_size_to_write = 0;
...@@ -270,7 +281,9 @@ rlc_am_reassemble_pdu( ...@@ -270,7 +281,9 @@ rlc_am_reassemble_pdu(
break; break;
default: default:
assert(0 != 0); //Assertion(eNB)_PRAN_DesignDocument_annex No.1428
LOG_E(RLC, "RLC_E_FIXED_PART_DATA_FIELD_FOLLOW error pdu_info->fi[%d]\n", pdu_info->fi);
// assert(0 != 0);
} }
} else { } else {
switch (pdu_info->fi) { switch (pdu_info->fi) {
...@@ -386,7 +399,9 @@ rlc_am_reassemble_pdu( ...@@ -386,7 +399,9 @@ rlc_am_reassemble_pdu(
break; break;
default: default:
assert(1 != 1); //Assertion(eNB)_PRAN_DesignDocument_annex No.1429
LOG_E(RLC, "not RLC_E_FIXED_PART_DATA_FIELD_FOLLOW error pdu_info->fi[%d]\n", pdu_info->fi);
// assert(1 != 1);
} }
} }
......
...@@ -47,9 +47,15 @@ rlc_am_get_data_pdu_infos( ...@@ -47,9 +47,15 @@ rlc_am_get_data_pdu_infos(
pdu_info_pP->d_c = header_pP->b1 >> 7; pdu_info_pP->d_c = header_pP->b1 >> 7;
pdu_info_pP->num_li = 0; pdu_info_pP->num_li = 0;
//Assertion(eNB)_PRAN_DesignDocument_annex No.766
if(pdu_info_pP->d_c == 0)
{
LOG_E(RLC, "RLC AM Rx PDU Data D/C Header Error LcId=%d\n", rlc_pP->channel_id);
return -2;
}
/*
AssertFatal (pdu_info_pP->d_c != 0, "RLC AM Rx PDU Data D/C Header Error LcId=%d\n", rlc_pP->channel_id); AssertFatal (pdu_info_pP->d_c != 0, "RLC AM Rx PDU Data D/C Header Error LcId=%d\n", rlc_pP->channel_id);
*/
pdu_info_pP->rf = (header_pP->b1 >> 6) & 0x01; pdu_info_pP->rf = (header_pP->b1 >> 6) & 0x01;
pdu_info_pP->p = (header_pP->b1 >> 5) & 0x01; pdu_info_pP->p = (header_pP->b1 >> 5) & 0x01;
pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03; pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03;
...@@ -264,9 +270,17 @@ rlc_am_receive_routing ( ...@@ -264,9 +270,17 @@ rlc_am_receive_routing (
rlc_pP->stat_rx_control_pdu += 1; rlc_pP->stat_rx_control_pdu += 1;
rlc_am_receive_process_control_pdu (ctxt_pP, rlc_pP, tb_p, &first_byte_p, &tb_size_in_bytes); rlc_am_receive_process_control_pdu (ctxt_pP, rlc_pP, tb_p, &first_byte_p, &tb_size_in_bytes);
// Test if remaining bytes not processed (up to know, highest probability is bug in MAC) // Test if remaining bytes not processed (up to know, highest probability is bug in MAC)
//Assertion(eNB)_PRAN_DesignDocument_annex No.767
if(tb_size_in_bytes != 0)
{
LOG_E(RLC, "Remaining %d bytes following a control PDU\n",
tb_size_in_bytes);
}
/*
AssertFatal( tb_size_in_bytes == 0, AssertFatal( tb_size_in_bytes == 0,
"Remaining %d bytes following a control PDU", "Remaining %d bytes following a control PDU",
tb_size_in_bytes); tb_size_in_bytes);
*/
} }
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RX ROUTING] VR(R)=%03d VR(MR)=%03d\n", LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RX ROUTING] VR(R)=%03d VR(MR)=%03d\n",
......
...@@ -60,10 +60,14 @@ boolean_t rlc_am_nack_pdu ( ...@@ -60,10 +60,14 @@ boolean_t rlc_am_nack_pdu (
sdu_size_t pdu_data_to_retx = 0; sdu_size_t pdu_data_to_retx = 0;
if (mb_p != NULL) { if (mb_p != NULL) {
assert(so_startP <= so_endP); //assert(so_startP <= so_endP);
if(so_startP > so_endP) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, so_startP %d, so_endP %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),so_startP, so_endP);
status = FALSE;
}
// Handle full PDU NACK first // Handle full PDU NACK first
if ((so_startP == 0) && (so_endP == 0x7FFF)) { else if ((so_startP == 0) && (so_endP == 0x7FFF)) {
if ((prev_nack_snP != snP) && (tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) { if ((prev_nack_snP != snP) && (tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size; pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size;
/* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */ /* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */
...@@ -82,7 +86,12 @@ boolean_t rlc_am_nack_pdu ( ...@@ -82,7 +86,12 @@ boolean_t rlc_am_nack_pdu (
snP, snP,
so_stopP); so_stopP);
#endif #endif
assert(tx_data_pdu_buffer_p->nack_so_start < tx_data_pdu_buffer_p->payload_size); //assert(tx_data_pdu_buffer_p->nack_so_start < tx_data_pdu_buffer_p->payload_size);
if(tx_data_pdu_buffer_p->nack_so_start >= tx_data_pdu_buffer_p->payload_size){
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU, nack_so_start %d, payload_size %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->payload_size);
status = FALSE;
}
} }
else { else {
status = FALSE; status = FALSE;
...@@ -225,9 +234,18 @@ void rlc_am_ack_pdu ( ...@@ -225,9 +234,18 @@ void rlc_am_ack_pdu (
} }
if (tx_data_pdu_buffer->retx_payload_size) { if (tx_data_pdu_buffer->retx_payload_size) {
//Assertion(eNB)_PRAN_DesignDocument_annex No.768
if(tx_data_pdu_buffer->flags.ack != 0)
{
LOG_E(RLC, "RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n",
snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return;
}
/*
AssertFatal (tx_data_pdu_buffer->flags.ack == 0, AssertFatal (tx_data_pdu_buffer->flags.ack == 0,
"RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n", "RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n",
snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_buffer->retx_payload_size; rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_buffer->retx_payload_size;
tx_data_pdu_buffer->retx_payload_size = 0; tx_data_pdu_buffer->retx_payload_size = 0;
tx_data_pdu_buffer->num_holes = 0; tx_data_pdu_buffer->num_holes = 0;
...@@ -256,10 +274,17 @@ mem_block_t* rlc_am_retransmit_get_copy ( ...@@ -256,10 +274,17 @@ mem_block_t* rlc_am_retransmit_get_copy (
const rlc_sn_t snP) const rlc_sn_t snP)
{ {
mem_block_t* mb_original_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block; mem_block_t* mb_original_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
//Assertion(eNB)_PRAN_DesignDocument_annex No.784
if(mb_original_p == NULL)
{
LOG_E(RLC,"RLC AM PDU Copy Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
snP,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (mb_original_p != NULL, "RLC AM PDU Copy Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (mb_original_p != NULL, "RLC AM PDU Copy Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
snP,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); snP,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
rlc_am_tx_data_pdu_management_t *pdu_mngt = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE]; rlc_am_tx_data_pdu_management_t *pdu_mngt = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
/* We need to allocate a new buffer and copy to it because header content may change for Polling bit */ /* We need to allocate a new buffer and copy to it because header content may change for Polling bit */
...@@ -296,20 +321,43 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -296,20 +321,43 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
uint8_t li_bit_offset = 4; /* toggle between 0 and 4 */ uint8_t li_bit_offset = 4; /* toggle between 0 and 4 */
uint8_t li_jump_offset = 1; /* toggle between 1 and 2 */ uint8_t li_jump_offset = 1; /* toggle between 1 and 2 */
//Assertion(eNB)_PRAN_DesignDocument_annex No.774
if(mb_original_p == NULL)
{
LOG_E(RLC,"RLC AM PDU Segment Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (mb_original_p != NULL, "RLC AM PDU Segment Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (mb_original_p != NULL, "RLC AM PDU Segment Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
//Assertion(eNB)_PRAN_DesignDocument_annex No.775
if(pdu_mngt->payload != mb_original_p->data + sizeof(struct mac_tb_req) + pdu_mngt->header_and_payload_size - pdu_mngt->payload_size)
{
LOG_E(RLC,"RLC AM PDU Segment Error: Inconsistent data pointers p1=%p p2=%p sn = %d total size = %d data size = %d LcId=%d !\n",
pdu_mngt->payload,mb_original_p->data + sizeof(struct mac_tb_req),pdu_mngt->header_and_payload_size,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (pdu_mngt->payload == mb_original_p->data + sizeof(struct mac_tb_req) + pdu_mngt->header_and_payload_size - pdu_mngt->payload_size, AssertFatal (pdu_mngt->payload == mb_original_p->data + sizeof(struct mac_tb_req) + pdu_mngt->header_and_payload_size - pdu_mngt->payload_size,
"RLC AM PDU Segment Error: Inconsistent data pointers p1=%p p2=%p sn = %d total size = %d data size = %d LcId=%d !\n", "RLC AM PDU Segment Error: Inconsistent data pointers p1=%p p2=%p sn = %d total size = %d data size = %d LcId=%d !\n",
pdu_mngt->payload,mb_original_p->data + sizeof(struct mac_tb_req),pdu_mngt->header_and_payload_size,pdu_mngt->payload_size,sn,rlc_pP->channel_id); pdu_mngt->payload,mb_original_p->data + sizeof(struct mac_tb_req),pdu_mngt->header_and_payload_size,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
*/
/* Init ReTx Hole list if not configured, ie the whole PDU has to be retransmitted */ /* Init ReTx Hole list if not configured, ie the whole PDU has to be retransmitted */
if (pdu_mngt->num_holes == 0) if (pdu_mngt->num_holes == 0)
{ {
//Assertion(eNB)_PRAN_DesignDocument_annex No.776
if(pdu_mngt->retx_payload_size != pdu_mngt->payload_size)
{
LOG_E(RLC,"RLC AM PDU ReTx Segment: Expecting full PDU size ReTxSize=%d DataSize=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
pdu_mngt->retx_payload_size,pdu_mngt->payload_size,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (pdu_mngt->retx_payload_size == pdu_mngt->payload_size,"RLC AM PDU ReTx Segment: Expecting full PDU size ReTxSize=%d DataSize=%d sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (pdu_mngt->retx_payload_size == pdu_mngt->payload_size,"RLC AM PDU ReTx Segment: Expecting full PDU size ReTxSize=%d DataSize=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
pdu_mngt->retx_payload_size,pdu_mngt->payload_size,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); pdu_mngt->retx_payload_size,pdu_mngt->payload_size,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
pdu_mngt->retx_hole_index = 0; pdu_mngt->retx_hole_index = 0;
pdu_mngt->hole_so_start[0] = 0; pdu_mngt->hole_so_start[0] = 0;
pdu_mngt->hole_so_stop[0] = pdu_mngt->payload_size - 1; pdu_mngt->hole_so_stop[0] = pdu_mngt->payload_size - 1;
...@@ -319,11 +367,18 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -319,11 +367,18 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
/* Init SO Start and SO Stop */ /* Init SO Start and SO Stop */
retx_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index]; retx_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index];
retx_so_stop = pdu_mngt->hole_so_stop[pdu_mngt->retx_hole_index]; retx_so_stop = pdu_mngt->hole_so_stop[pdu_mngt->retx_hole_index];
//Assertion(eNB)_PRAN_DesignDocument_annex No.777
if((retx_so_start > retx_so_stop) || (retx_so_stop - retx_so_start + 1 > pdu_mngt->payload_size))
{
LOG_E(RLC,"RLC AM Tx PDU Segment Data SO Error: retx_so_start=%d retx_so_stop=%d OriginalPDUDataLength=%d sn=%d LcId=%d!\n",
retx_so_start,retx_so_stop,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal ((retx_so_start <= retx_so_stop) && (retx_so_stop - retx_so_start + 1 <= pdu_mngt->payload_size), AssertFatal ((retx_so_start <= retx_so_stop) && (retx_so_stop - retx_so_start + 1 <= pdu_mngt->payload_size),
"RLC AM Tx PDU Segment Data SO Error: retx_so_start=%d retx_so_stop=%d OriginalPDUDataLength=%d sn=%d LcId=%d!\n", "RLC AM Tx PDU Segment Data SO Error: retx_so_start=%d retx_so_stop=%d OriginalPDUDataLength=%d sn=%d LcId=%d!\n",
retx_so_start,retx_so_stop,pdu_mngt->payload_size,sn,rlc_pP->channel_id); retx_so_start,retx_so_stop,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
*/
/* Init FI to the same value as original PDU */ /* Init FI to the same value as original PDU */
fi_start = (!(RLC_AM_PDU_GET_FI_START(*(pdu_mngt->first_byte)))); fi_start = (!(RLC_AM_PDU_GET_FI_START(*(pdu_mngt->first_byte))));
fi_end = (!(RLC_AM_PDU_GET_FI_END(*(pdu_mngt->first_byte)))); fi_end = (!(RLC_AM_PDU_GET_FI_END(*(pdu_mngt->first_byte))));
...@@ -410,8 +465,17 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -410,8 +465,17 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
/* Set FI Start if retx_so_start = cumulated data size */ /* Set FI Start if retx_so_start = cumulated data size */
fi_start = TRUE; fi_start = TRUE;
/* there must be at least one SDU more */ /* there must be at least one SDU more */
//Assertion(eNB)_PRAN_DesignDocument_annex No.778
if(sdu_index >= pdu_mngt->nb_sdus)
{
LOG_E(RLC,"RLC AM Tx PDU Segment Error: sdu_index=%d nb_sdus=%d sn=%d LcId=%d !\n",
sdu_index,pdu_mngt->nb_sdus,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (sdu_index < pdu_mngt->nb_sdus, "RLC AM Tx PDU Segment Error: sdu_index=%d nb_sdus=%d sn=%d LcId=%d !\n", AssertFatal (sdu_index < pdu_mngt->nb_sdus, "RLC AM Tx PDU Segment Error: sdu_index=%d nb_sdus=%d sn=%d LcId=%d !\n",
sdu_index,pdu_mngt->nb_sdus,sn,rlc_pP->channel_id); sdu_index,pdu_mngt->nb_sdus,sn,rlc_pP->channel_id);
*/
if (sdu_index < pdu_mngt->nb_sdus - 1) if (sdu_index < pdu_mngt->nb_sdus - 1)
{ {
temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1)); temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1));
...@@ -489,17 +553,33 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -489,17 +553,33 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
/* Set number of LIs in the segment */ /* Set number of LIs in the segment */
num_LIs_pdu_segment = sdu_segment_index - 1; num_LIs_pdu_segment = sdu_segment_index - 1;
//Assertion(eNB)_PRAN_DesignDocument_annex No.779
if(num_LIs_pdu_segment > pdu_mngt->nb_sdus - 1)
{
LOG_E(RLC, "RLC AM Tx PDU Segment Data Error: nbLISegment=%d nbLIPDU=%d sn=%d LcId=%d !\n",
num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (num_LIs_pdu_segment <= pdu_mngt->nb_sdus - 1, "RLC AM Tx PDU Segment Data Error: nbLISegment=%d nbLIPDU=%d sn=%d LcId=%d !\n", AssertFatal (num_LIs_pdu_segment <= pdu_mngt->nb_sdus - 1, "RLC AM Tx PDU Segment Data Error: nbLISegment=%d nbLIPDU=%d sn=%d LcId=%d !\n",
num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id); num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
*/
/* Bound to available TBS taking into account min PDU segment header*/ /* Bound to available TBS taking into account min PDU segment header*/
sdu_segment_index = 0; sdu_segment_index = 0;
while ((sdu_segment_index < num_LIs_pdu_segment + 1) && (rlc_pP->nb_bytes_requested_by_mac > *payload_sizeP + RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index))) while ((sdu_segment_index < num_LIs_pdu_segment + 1) && (rlc_pP->nb_bytes_requested_by_mac > *payload_sizeP + RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index)))
{ {
//Assertion(eNB)_PRAN_DesignDocument_annex No.780
if(sdus_segment_size[sdu_segment_index] <= 0)
{
LOG_E(RLC, "RLC AM Tx PDU Segment Data Error: EMpty LI index=%d numLISegment=%d numLIPDU=%d PDULength=%d SOStart=%d SOStop=%d sn=%d LcId=%d !\n",
sdu_segment_index,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,pdu_mngt->payload_size,retx_so_start,retx_so_stop,sn,rlc_pP->channel_id);
sdu_segment_index++;
continue;
}
/*
AssertFatal (sdus_segment_size[sdu_segment_index] > 0, "RLC AM Tx PDU Segment Data Error: EMpty LI index=%d numLISegment=%d numLIPDU=%d PDULength=%d SOStart=%d SOStop=%d sn=%d LcId=%d !\n", AssertFatal (sdus_segment_size[sdu_segment_index] > 0, "RLC AM Tx PDU Segment Data Error: EMpty LI index=%d numLISegment=%d numLIPDU=%d PDULength=%d SOStart=%d SOStop=%d sn=%d LcId=%d !\n",
sdu_segment_index,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,pdu_mngt->payload_size,retx_so_start,retx_so_stop,sn,rlc_pP->channel_id); sdu_segment_index,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,pdu_mngt->payload_size,retx_so_start,retx_so_stop,sn,rlc_pP->channel_id);
*/
/* Add next sdu_segment_index to data part */ /* Add next sdu_segment_index to data part */
if (RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index) + (*payload_sizeP) + sdus_segment_size[sdu_segment_index] <= rlc_pP->nb_bytes_requested_by_mac) if (RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index) + (*payload_sizeP) + sdus_segment_size[sdu_segment_index] <= rlc_pP->nb_bytes_requested_by_mac)
{ {
...@@ -521,11 +601,18 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -521,11 +601,18 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
/* update retx_so_stop */ /* update retx_so_stop */
retx_so_stop = retx_so_start + (*payload_sizeP) - 1; retx_so_stop = retx_so_start + (*payload_sizeP) - 1;
//Assertion(eNB)_PRAN_DesignDocument_annex No.781
if((retx_so_stop > pdu_mngt->payload_size - 1) || (retx_so_stop - retx_so_start + 1 >= pdu_mngt->payload_size))
{
LOG_E(RLC,"RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n",
retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal ((retx_so_stop <= pdu_mngt->payload_size - 1) && (retx_so_stop - retx_so_start + 1 < pdu_mngt->payload_size), AssertFatal ((retx_so_stop <= pdu_mngt->payload_size - 1) && (retx_so_stop - retx_so_start + 1 < pdu_mngt->payload_size),
"RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n", "RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n",
retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id); retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
*/
/* init FI End to FALSE if retx_so_stop is not end of PDU */ /* init FI End to FALSE if retx_so_stop is not end of PDU */
if (retx_so_stop != pdu_mngt->payload_size - 1) if (retx_so_stop != pdu_mngt->payload_size - 1)
{ {
...@@ -543,15 +630,31 @@ mem_block_t* rlc_am_retransmit_get_am_segment( ...@@ -543,15 +630,31 @@ mem_block_t* rlc_am_retransmit_get_am_segment(
fi_end = TRUE; fi_end = TRUE;
} }
} }
//Assertion(eNB)_PRAN_DesignDocument_annex No.782
if(data_size != *payload_sizeP)
{
LOG_E(RLC,"RLC AM Tx PDU Segment Data Error: SduSum=%d Data=%d sn=%d LcId=%d !\n",
data_size,*payload_sizeP,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (data_size == *payload_sizeP, "RLC AM Tx PDU Segment Data Error: SduSum=%d Data=%d sn=%d LcId=%d !\n", AssertFatal (data_size == *payload_sizeP, "RLC AM Tx PDU Segment Data Error: SduSum=%d Data=%d sn=%d LcId=%d !\n",
data_size,*payload_sizeP,sn,rlc_pP->channel_id); data_size,*payload_sizeP,sn,rlc_pP->channel_id);
*/
/* Allocation */ /* Allocation */
//Assertion(eNB)_PRAN_DesignDocument_annex No.783
if(header_segment_length + *payload_sizeP > pdu_mngt->header_and_payload_size + 2)
{
LOG_E(RLC, "RLC AM PDU Segment Error: Hdr=%d Data=%d Original Hdr+Data =%d sn=%d LcId=%d !\n",
header_segment_length,*payload_sizeP,pdu_mngt->header_and_payload_size,sn,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal (header_segment_length + *payload_sizeP <= pdu_mngt->header_and_payload_size + 2, "RLC AM PDU Segment Error: Hdr=%d Data=%d Original Hdr+Data =%d sn=%d LcId=%d !\n", AssertFatal (header_segment_length + *payload_sizeP <= pdu_mngt->header_and_payload_size + 2, "RLC AM PDU Segment Error: Hdr=%d Data=%d Original Hdr+Data =%d sn=%d LcId=%d !\n",
header_segment_length,*payload_sizeP,pdu_mngt->header_and_payload_size,sn,rlc_pP->channel_id); header_segment_length,*payload_sizeP,pdu_mngt->header_and_payload_size,sn,rlc_pP->channel_id);
*/
mem_pdu_segment_p = get_free_mem_block((*payload_sizeP + header_segment_length + sizeof(struct mac_tb_req)), __func__); mem_pdu_segment_p = get_free_mem_block((*payload_sizeP + header_segment_length + sizeof(struct mac_tb_req)), __func__);
if(mem_pdu_segment_p == NULL) return NULL; if(mem_pdu_segment_p == NULL) return NULL;
pdu_segment_header_p = (uint8_t *)&mem_pdu_segment_p->data[sizeof(struct mac_tb_req)]; pdu_segment_header_p = (uint8_t *)&mem_pdu_segment_p->data[sizeof(struct mac_tb_req)];
...@@ -1174,7 +1277,11 @@ void rlc_am_tx_buffer_display ( ...@@ -1174,7 +1277,11 @@ void rlc_am_tx_buffer_display (
LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->nack_so_stop); LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->nack_so_stop);
} else { } else {
for (i=0; i<tx_data_pdu_buffer_p->num_holes; i++) { for (i=0; i<tx_data_pdu_buffer_p->num_holes; i++) {
assert(i < RLC_AM_MAX_HOLES_REPORT_PER_PDU); //assert(i < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
if(i >= RLC_AM_MAX_HOLES_REPORT_PER_PDU) {
LOG_E(RLC, "num_holes error. %d %d %d\n", tx_data_pdu_buffer_p->num_holes, i, RLC_AM_MAX_HOLES_REPORT_PER_PDU);
break;
}
LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->hole_so_start[i], tx_data_pdu_buffer_p->hole_so_stop[i]); LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->hole_so_start[i], tx_data_pdu_buffer_p->hole_so_stop[i]);
} }
} }
...@@ -1197,22 +1304,50 @@ mem_block_t * rlc_am_get_pdu_to_retransmit( ...@@ -1197,22 +1304,50 @@ mem_block_t * rlc_am_get_pdu_to_retransmit(
rlc_sn_t sn_end = rlc_pP->vt_s; rlc_sn_t sn_end = rlc_pP->vt_s;
mem_block_t* pdu_p = NULL; mem_block_t* pdu_p = NULL;
rlc_am_tx_data_pdu_management_t* tx_data_pdu_management; rlc_am_tx_data_pdu_management_t* tx_data_pdu_management;
//Assertion(eNB)_PRAN_DesignDocument_annex No.769
if((rlc_pP->retrans_num_pdus <= 0) || (rlc_pP->vt_a == rlc_pP->vt_s))
{
LOG_E(RLC, "RLC AM ReTx start process Error: NbPDUtoRetx=%d vtA=%d vtS=%d LcId=%d !\n",
rlc_pP->retrans_num_pdus,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
return NULL;
}
/*
AssertFatal ((rlc_pP->retrans_num_pdus > 0) && (rlc_pP->vt_a != rlc_pP->vt_s), "RLC AM ReTx start process Error: NbPDUtoRetx=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal ((rlc_pP->retrans_num_pdus > 0) && (rlc_pP->vt_a != rlc_pP->vt_s), "RLC AM ReTx start process Error: NbPDUtoRetx=%d vtA=%d vtS=%d LcId=%d !\n",
rlc_pP->retrans_num_pdus,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); rlc_pP->retrans_num_pdus,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
do do
{ {
tx_data_pdu_management = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE]; tx_data_pdu_management = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
if ((tx_data_pdu_management->flags.retransmit) && (tx_data_pdu_management->flags.max_retransmit == 0)) if ((tx_data_pdu_management->flags.retransmit) && (tx_data_pdu_management->flags.max_retransmit == 0))
{ {
//Assertion(eNB)_PRAN_DesignDocument_annex No.770
if(tx_data_pdu_management->sn != sn)
{
LOG_E(RLC, "RLC AM ReTx PDU Error: SN Error pdu_sn=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
tx_data_pdu_management->sn,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
}
//Assertion(eNB)_PRAN_DesignDocument_annex No.771
else if(tx_data_pdu_management->flags.transmitted != 1)
{
LOG_E(RLC, "RLC AM ReTx PDU Error: State Error sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
}
//Assertion(eNB)_PRAN_DesignDocument_annex No.772
else if(tx_data_pdu_management->retx_payload_size <= 0)
{
LOG_E(RLC, "RLC AM ReTx PDU Error: No Data to Retx sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
}
else
{
/*
AssertFatal (tx_data_pdu_management->sn == sn, "RLC AM ReTx PDU Error: SN Error pdu_sn=%d sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (tx_data_pdu_management->sn == sn, "RLC AM ReTx PDU Error: SN Error pdu_sn=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
tx_data_pdu_management->sn,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); tx_data_pdu_management->sn,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
AssertFatal (tx_data_pdu_management->flags.transmitted == 1, "RLC AM ReTx PDU Error: State Error sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (tx_data_pdu_management->flags.transmitted == 1, "RLC AM ReTx PDU Error: State Error sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
AssertFatal (tx_data_pdu_management->retx_payload_size > 0, "RLC AM ReTx PDU Error: No Data to Retx sn=%d vtA=%d vtS=%d LcId=%d !\n", AssertFatal (tx_data_pdu_management->retx_payload_size > 0, "RLC AM ReTx PDU Error: No Data to Retx sn=%d vtA=%d vtS=%d LcId=%d !\n",
sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
*/
/* Either the whole RLC PDU is to be transmitted and there is enough MAC TBS or there is minimum TBS size for transmitting 1 AM PDU segment */ /* Either the whole RLC PDU is to be transmitted and there is enough MAC TBS or there is minimum TBS size for transmitting 1 AM PDU segment */
if ((tx_data_pdu_management->retx_payload_size == tx_data_pdu_management->payload_size) && (rlc_pP->nb_bytes_requested_by_mac >= tx_data_pdu_management->header_and_payload_size)) if ((tx_data_pdu_management->retx_payload_size == tx_data_pdu_management->payload_size) && (rlc_pP->nb_bytes_requested_by_mac >= tx_data_pdu_management->header_and_payload_size))
{ {
...@@ -1260,9 +1395,18 @@ mem_block_t * rlc_am_get_pdu_to_retransmit( ...@@ -1260,9 +1395,18 @@ mem_block_t * rlc_am_get_pdu_to_retransmit(
if (pdu_p != NULL) if (pdu_p != NULL)
{ {
//Assertion(eNB)_PRAN_DesignDocument_annex No.773
if((tx_data_pdu_management->retx_payload_size < pdu_data_size)|| (rlc_pP->retrans_num_bytes_to_retransmit < pdu_data_size))
{
LOG_E(RLC, "RLC AM ReTx PDU Segment Error: DataSize=%d PDUReTxsize=%d TotalReTxsize=%d sn=%d LcId=%d !\n",
pdu_data_size,tx_data_pdu_management->retx_payload_size,rlc_pP->retrans_num_bytes_to_retransmit,sn,rlc_pP->channel_id);
}
else
{
/*
AssertFatal ((tx_data_pdu_management->retx_payload_size >= pdu_data_size) && (rlc_pP->retrans_num_bytes_to_retransmit >= pdu_data_size), "RLC AM ReTx PDU Segment Error: DataSize=%d PDUReTxsize=%d TotalReTxsize=%d sn=%d LcId=%d !\n", AssertFatal ((tx_data_pdu_management->retx_payload_size >= pdu_data_size) && (rlc_pP->retrans_num_bytes_to_retransmit >= pdu_data_size), "RLC AM ReTx PDU Segment Error: DataSize=%d PDUReTxsize=%d TotalReTxsize=%d sn=%d LcId=%d !\n",
pdu_data_size,tx_data_pdu_management->retx_payload_size,rlc_pP->retrans_num_bytes_to_retransmit,sn,rlc_pP->channel_id); pdu_data_size,tx_data_pdu_management->retx_payload_size,rlc_pP->retrans_num_bytes_to_retransmit,sn,rlc_pP->channel_id);
*/
tx_data_pdu_management->retx_payload_size -= pdu_data_size; tx_data_pdu_management->retx_payload_size -= pdu_data_size;
rlc_pP->retrans_num_bytes_to_retransmit -= pdu_data_size; rlc_pP->retrans_num_bytes_to_retransmit -= pdu_data_size;
if (tx_data_pdu_management->retx_payload_size == 0) if (tx_data_pdu_management->retx_payload_size == 0)
...@@ -1280,6 +1424,7 @@ mem_block_t * rlc_am_get_pdu_to_retransmit( ...@@ -1280,6 +1424,7 @@ mem_block_t * rlc_am_get_pdu_to_retransmit(
rlc_pP->stat_tx_retransmit_bytes += pdu_data_size; rlc_pP->stat_tx_retransmit_bytes += pdu_data_size;
rlc_pP->stat_tx_retransmit_bytes_by_status += pdu_data_size; rlc_pP->stat_tx_retransmit_bytes_by_status += pdu_data_size;
}//Assertion(eNB)_PRAN_DesignDocument_annex No.773
} }
} }
else else
...@@ -1304,8 +1449,8 @@ mem_block_t * rlc_am_get_pdu_to_retransmit( ...@@ -1304,8 +1449,8 @@ mem_block_t * rlc_am_get_pdu_to_retransmit(
break; break;
} }
}//Assertion(eNB)_PRAN_DesignDocument_annex No.770 No.771 No.772
} }
sn = RLC_AM_NEXT_SN(sn); sn = RLC_AM_NEXT_SN(sn);
} while((sn != sn_end) && (rlc_pP->retrans_num_pdus > 0)); } while((sn != sn_end) && (rlc_pP->retrans_num_pdus > 0));
......
...@@ -53,8 +53,17 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -53,8 +53,17 @@ boolean_t rlc_am_rx_check_vr_reassemble(
if (pdu_info_p->rf) { if (pdu_info_p->rf) {
pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data); pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
next_waited_so = 0; next_waited_so = 0;
//Assertion(eNB)_PRAN_DesignDocument_annex No.785
if(pdu_cursor_mgnt_p->all_segments_received <= 0)
{
LOG_E(RLC, "AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n",
sn_ref,rlc_pP->vr_r,rlc_pP->channel_id);
return FALSE;
}
/*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received > 0,"AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received > 0,"AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n",
sn_ref,rlc_pP->vr_r,rlc_pP->channel_id); sn_ref,rlc_pP->vr_r,rlc_pP->channel_id);
*/
while ((cursor_p != NULL) && (pdu_info_p->sn == sn_ref) && (pdu_info_p->so == next_waited_so)) { while ((cursor_p != NULL) && (pdu_info_p->sn == sn_ref) && (pdu_info_p->so == next_waited_so)) {
if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) { if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING; pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
...@@ -80,8 +89,17 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -80,8 +89,17 @@ boolean_t rlc_am_rx_check_vr_reassemble(
if ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r)) { if ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r)) {
pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data); pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
next_waited_so = 0; next_waited_so = 0;
//Assertion(eNB)_PRAN_DesignDocument_annex No.786
if(pdu_cursor_mgnt_p->all_segments_received != 0)
{
LOG_E(RLC, "AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n",
rlc_pP->vr_r,sn_ref,rlc_pP->channel_id);
return FALSE;
}
/*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n",
rlc_pP->vr_r,sn_ref,rlc_pP->channel_id); rlc_pP->vr_r,sn_ref,rlc_pP->channel_id);
*/
while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) { while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) {
if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) { if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING; pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
...@@ -100,8 +118,17 @@ boolean_t rlc_am_rx_check_vr_reassemble( ...@@ -100,8 +118,17 @@ boolean_t rlc_am_rx_check_vr_reassemble(
pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data); pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
next_waited_so = 0; next_waited_so = 0;
//Assertion(eNB)_PRAN_DesignDocument_annex No.787
if(pdu_cursor_mgnt_p->all_segments_received != 0)
{
LOG_E(RLC, "AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n",
rlc_pP->vr_r,rlc_pP->channel_id);
return FALSE;
}
/*
AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n", AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n",
rlc_pP->vr_r,rlc_pP->channel_id); rlc_pP->vr_r,rlc_pP->channel_id);
*/
while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) { while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) {
if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) { if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING; pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
...@@ -333,8 +360,15 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment( ...@@ -333,8 +360,15 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment(
/*****************************************************/ /*****************************************************/
// 1) Find previous cursor to the PDU to insert // 1) Find previous cursor to the PDU to insert
/*****************************************************/ /*****************************************************/
//Assertion(eNB)_PRAN_DesignDocument_annex No.791
if(cursor_p == NULL)
{
LOG_E(RLC, "AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
return RLC_AM_DATA_PDU_STATUS_HEADER_ERROR;
}
/*
AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id); AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
*/
do { do {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
...@@ -483,11 +517,20 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment( ...@@ -483,11 +517,20 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment(
} }
} }
//Assertion(eNB)_PRAN_DesignDocument_annex No.792
if((so_start_segment > so_end_segment) || (pdu_rx_info_p->so > so_start_segment) ||
(so_end_segment > pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1))
{
LOG_E(RLC, " AM RX PDU Segment Duplicate elimination error FirstSO=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
}
/*
AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) && AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) &&
(so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1), (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
" AM RX PDU Segment Duplicate elimination error FirstSO=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n", " AM RX PDU Segment Duplicate elimination error FirstSO=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn); pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
*/
} // end pdu_info_cursor_p->so == 0 } // end pdu_info_cursor_p->so == 0
else { else {
// Handle most likely case : PDU Segment without duplicate is inserted before first stored PDU segment // Handle most likely case : PDU Segment without duplicate is inserted before first stored PDU segment
...@@ -527,12 +570,20 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment( ...@@ -527,12 +570,20 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment(
so_end_segment = pdu_info_cursor_p->so - 1; so_end_segment = pdu_info_cursor_p->so - 1;
} }
} }
//Assertion(eNB)_PRAN_DesignDocument_annex No.793
if((so_start_segment > so_end_segment) ||
(so_end_segment > pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1))
{
LOG_E(RLC, " AM RX PDU Segment Duplicate elimination at the end error FirstSO!=0 SOStart=%d OldSOEnd=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_end_segment,pdu_rx_info_p->sn);
return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
}
/*
AssertFatal((so_start_segment <= so_end_segment) && AssertFatal((so_start_segment <= so_end_segment) &&
(so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1), (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
" AM RX PDU Segment Duplicate elimination at the end error FirstSO!=0 SOStart=%d OldSOEnd=%d newSOEnd =%d SN=%d\n", " AM RX PDU Segment Duplicate elimination at the end error FirstSO!=0 SOStart=%d OldSOEnd=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_end_segment,pdu_rx_info_p->sn); pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_end_segment,pdu_rx_info_p->sn);
*/
} }
else { else {
// Second Case: Duplicate at the begining and potentially at the end // Second Case: Duplicate at the begining and potentially at the end
...@@ -618,21 +669,38 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment( ...@@ -618,21 +669,38 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment(
so_end_segment = pdu_info_cursor_p->so - 1; so_end_segment = pdu_info_cursor_p->so - 1;
} }
} }
//Assertion(eNB)_PRAN_DesignDocument_annex No.794
if((so_start_segment > so_end_segment) || (pdu_rx_info_p->so > so_start_segment) ||
(so_end_segment > pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1))
{
LOG_E(RLC, " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
}
/*
AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) && AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) &&
(so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1), (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
" AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n", " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn); pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
*/
} }
} // end pdu_info_cursor_p->so != 0 } // end pdu_info_cursor_p->so != 0
/* Last step : duplicate bytes had been removed, build a new PDU segment */ /* Last step : duplicate bytes had been removed, build a new PDU segment */
//Assertion(eNB)_PRAN_DesignDocument_annex No.795
if((pdu_rx_info_p->so == so_start_segment) && (so_end_segment == pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1))
{
LOG_E(RLC, " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
}
/*
AssertFatal((pdu_rx_info_p->so != so_start_segment) || (so_end_segment != pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1), AssertFatal((pdu_rx_info_p->so != so_start_segment) || (so_end_segment != pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
" AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n", " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn); pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
*/
mem_block_t* trunc_segment = create_new_segment_from_pdu(tb_pP,so_start_segment - pdu_rx_info_p->so,so_end_segment - so_start_segment + 1); mem_block_t* trunc_segment = create_new_segment_from_pdu(tb_pP,so_start_segment - pdu_rx_info_p->so,so_end_segment - so_start_segment + 1);
if (trunc_segment != NULL) { if (trunc_segment != NULL) {
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT] CREATE SEGMENT FROM SEGMENT OFFSET=%d DATA LENGTH=%d SN=%d\n", LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT] CREATE SEGMENT FROM SEGMENT OFFSET=%d DATA LENGTH=%d SN=%d\n",
...@@ -672,8 +740,15 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu( ...@@ -672,8 +740,15 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu(
/*****************************************************/ /*****************************************************/
// 1) Find previous cursor to the PDU to insert // 1) Find previous cursor to the PDU to insert
/*****************************************************/ /*****************************************************/
//Assertion(eNB)_PRAN_DesignDocument_annex No.788
if(cursor_p == NULL)
{
LOG_E(RLC, "AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
return RLC_AM_DATA_PDU_STATUS_HEADER_ERROR;
}
/*
AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id); AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
*/
do { do {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
...@@ -749,9 +824,25 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu( ...@@ -749,9 +824,25 @@ rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu(
else { else {
/* First update cursor until discontinuity */ /* First update cursor until discontinuity */
previous_cursor_p = cursor_p; previous_cursor_p = cursor_p;
//Assertion(eNB)_PRAN_DesignDocument_annex No.789
if(pdu_info_cursor_p->rf == 0)
{
LOG_E(RLC, "AM Rx PDU Error, stored SN=%d should be a PDU segment\n",pdu_info_cursor_p->sn);
return RLC_AM_DATA_PDU_STATUS_HEADER_ERROR;
}
/*
AssertFatal(pdu_info_cursor_p->rf != 0,"AM Rx PDU Error, stored SN=%d should be a PDU segment\n",pdu_info_cursor_p->sn); AssertFatal(pdu_info_cursor_p->rf != 0,"AM Rx PDU Error, stored SN=%d should be a PDU segment\n",pdu_info_cursor_p->sn);
*/
//Assertion(eNB)_PRAN_DesignDocument_annex No.790
if(((rlc_am_rx_pdu_management_t *) (cursor_p->data))->all_segments_received != 0)
{
LOG_E(RLC, "AM Rx PDU Error, stored SN=%d already fully received\n",pdu_info_cursor_p->sn);
return RLC_AM_DATA_PDU_STATUS_SN_DUPLICATE;
}
/*
AssertFatal(((rlc_am_rx_pdu_management_t *) (cursor_p->data))->all_segments_received == 0, AssertFatal(((rlc_am_rx_pdu_management_t *) (cursor_p->data))->all_segments_received == 0,
"AM Rx PDU Error, stored SN=%d already fully received\n",pdu_info_cursor_p->sn); "AM Rx PDU Error, stored SN=%d already fully received\n",pdu_info_cursor_p->sn);
*/
sdu_size_t next_waited_so = 0; sdu_size_t next_waited_so = 0;
while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (pdu_info_cursor_p->so == next_waited_so)) { while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (pdu_info_cursor_p->so == next_waited_so)) {
next_waited_so += pdu_info_cursor_p->payload_size; next_waited_so += pdu_info_cursor_p->payload_size;
...@@ -1558,7 +1649,8 @@ list2_insert_before_element ( ...@@ -1558,7 +1649,8 @@ list2_insert_before_element (
return element_to_insert_pP; return element_to_insert_pP;
} else { } else {
assert(2==1); //assert(2==1);
LOG_E(RLC, "list2_insert_before_element error. element_to_insert_pP %p, element_pP %p\n", element_to_insert_pP,element_pP);
return NULL; return NULL;
} }
} }
...@@ -1585,7 +1677,8 @@ list2_insert_after_element ( ...@@ -1585,7 +1677,8 @@ list2_insert_after_element (
return element_to_insert_pP; return element_to_insert_pP;
} else { } else {
assert(2==1); //assert(2==1);
LOG_E(RLC, "list2_insert_after_element error. element_to_insert_pP %p, element_pP %p\n", element_to_insert_pP,element_pP);
return NULL; return NULL;
} }
} }
...@@ -1635,7 +1728,12 @@ rlc_am_rx_list_display ( ...@@ -1635,7 +1728,12 @@ rlc_am_rx_list_display (
//if (cursor_p == cursor_p->next) { //if (cursor_p == cursor_p->next) {
// rlc_am_v9_3_0_test_print_trace(); // rlc_am_v9_3_0_test_print_trace();
//} //}
assert(cursor_p != cursor_p->next); //assert(cursor_p != cursor_p->next);
if(cursor_p == cursor_p->next)
{
LOG_E(RLC, "rlc_am_rx_list_display error. cursor_p %p, cursor_p->next %p\n", cursor_p, cursor_p->next);
break;
}
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
loop++; loop++;
} }
......
...@@ -299,7 +299,12 @@ void rlc_am_segment_10 ( ...@@ -299,7 +299,12 @@ void rlc_am_segment_10 (
pdu_mngt_p->sdus_index[pdu_mngt_p->nb_sdus++] = sdu_buffer_index; pdu_mngt_p->sdus_index[pdu_mngt_p->nb_sdus++] = sdu_buffer_index;
sdu_mngt_p->pdus_index[sdu_mngt_p->nb_pdus++] = rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE; sdu_mngt_p->pdus_index[sdu_mngt_p->nb_pdus++] = rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE;
assert(sdu_mngt_p->nb_pdus < RLC_AM_MAX_SDU_FRAGMENTS); //assert(sdu_mngt_p->nb_pdus < RLC_AM_MAX_SDU_FRAGMENTS);
if(sdu_mngt_p->nb_pdus >= RLC_AM_MAX_SDU_FRAGMENTS) {
LOG_E(RLC,PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] loop error. %d %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), sdu_mngt_p->nb_pdus, RLC_AM_MAX_SDU_FRAGMENTS);
break;
}
sdu_buffer_index = (sdu_buffer_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE; sdu_buffer_index = (sdu_buffer_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
} }
...@@ -462,11 +467,11 @@ void rlc_am_segment_10 ( ...@@ -462,11 +467,11 @@ void rlc_am_segment_10 (
rlc_pP->current_sdu_index = (rlc_pP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE; rlc_pP->current_sdu_index = (rlc_pP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
} }
} else { } else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
sdu_mngt_p->sdu_remaining_size, sdu_mngt_p->sdu_remaining_size,
pdu_remaining_size - sdu_mngt_p->sdu_remaining_size); pdu_remaining_size - sdu_mngt_p->sdu_remaining_size);
assert(1!=1); //assert(1!=1);
memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size); memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size);
pdu_mngt_p->payload_size += sdu_mngt_p->sdu_remaining_size; pdu_mngt_p->payload_size += sdu_mngt_p->sdu_remaining_size;
pdu_remaining_size = pdu_remaining_size - sdu_mngt_p->sdu_remaining_size; pdu_remaining_size = pdu_remaining_size - sdu_mngt_p->sdu_remaining_size;
...@@ -520,7 +525,11 @@ void rlc_am_segment_10 ( ...@@ -520,7 +525,11 @@ void rlc_am_segment_10 (
pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p; pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p;
pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size; pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size;
//#warning "why 3000: changed to RLC_SDU_MAX_SIZE " //#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE ); //assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE );
if(pdu_tb_req_p->tb_size >= RLC_SDU_MAX_SIZE) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] tb_size error. %d, %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_tb_req_p->tb_size, RLC_SDU_MAX_SIZE);
}
rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size,true); rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size,true);
//list_add_tail_eurecom (pdu_mem_p, &rlc_pP->segmentation_pdu_list); //list_add_tail_eurecom (pdu_mem_p, &rlc_pP->segmentation_pdu_list);
......
...@@ -154,7 +154,10 @@ rlc_am_write16_bit_field( ...@@ -154,7 +154,10 @@ rlc_am_write16_bit_field(
signed int bits_to_writeP, signed int bits_to_writeP,
const uint16_t valueP) const uint16_t valueP)
{ {
assert(bits_to_writeP <= 16); //assert(bits_to_writeP <= 16);
if(bits_to_writeP > 16) {
LOG_E(RLC, "bits_to_writeP error. %d\n", bits_to_writeP);
}
if (bits_to_writeP > 8) { if (bits_to_writeP > 8) {
rlc_am_write8_bit_field(data_ppP,bit_pos_pP, bits_to_writeP - 8, (uint8_t)(valueP >> 8)); rlc_am_write8_bit_field(data_ppP,bit_pos_pP, bits_to_writeP - 8, (uint8_t)(valueP >> 8));
...@@ -314,8 +317,13 @@ rlc_am_receive_process_control_pdu( ...@@ -314,8 +317,13 @@ rlc_am_receive_process_control_pdu(
// POLL_SN: // POLL_SN:
// - if t-PollRetransmit is running: // - if t-PollRetransmit is running:
// - stop and reset t-PollRetransmit. // - stop and reset t-PollRetransmit.
assert(ack_sn < RLC_AM_SN_MODULO); //assert(ack_sn < RLC_AM_SN_MODULO);
assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU); //assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU);
if(ack_sn >= RLC_AM_SN_MODULO || rlc_pP->control_pdu_info.num_nack >= RLC_AM_MAX_NACK_IN_STATUS_PDU) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" illegal ack_sn %d, num_nack %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), ack_sn, rlc_pP->control_pdu_info.num_nack);
return;
}
/* Note : ackSn can be equal to current vtA only in case the status pdu contains a list of nack_sn with same value = vtA with SOStart/SOEnd */ /* Note : ackSn can be equal to current vtA only in case the status pdu contains a list of nack_sn with same value = vtA with SOStart/SOEnd */
/* and meaning the report is not complete due to not enough ressources to fill all SOStart/SOEnd of this NACK_SN */ /* and meaning the report is not complete due to not enough ressources to fill all SOStart/SOEnd of this NACK_SN */
...@@ -618,10 +626,13 @@ rlc_am_send_status_pdu( ...@@ -618,10 +626,13 @@ rlc_am_send_status_pdu(
/* Now process all Segments of sn_cursor if PDU not fully received */ /* Now process all Segments of sn_cursor if PDU not fully received */
if ((!status_report_completed) && (all_segments_received == 0) && (sn_cursor != rlc_pP->vr_ms)) { if ((!status_report_completed) && (all_segments_received == 0) && (sn_cursor != rlc_pP->vr_ms)) {
AssertFatal (sn_nack == sn_cursor, "RLC AM Tx Status PDU Data sn_nack=%d and sn_cursor=%d should be equal LcId=%d\n",sn_nack,sn_cursor, rlc_pP->channel_id); //AssertFatal (sn_nack == sn_cursor, "RLC AM Tx Status PDU Data sn_nack=%d and sn_cursor=%d should be equal LcId=%d\n",sn_nack,sn_cursor, rlc_pP->channel_id);
if(sn_nack != sn_cursor){
LOG_E(RLC, "RLC AM Tx Status PDU Data sn_nack=%d and sn_cursor=%d should be equal LcId=%d\n",sn_nack,sn_cursor, rlc_pP->channel_id);
}
/* First ensure there is enough TBS for at least 1 SOStart/SOEnd, else break */ /* First ensure there is enough TBS for at least 1 SOStart/SOEnd, else break */
if ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1)) <= nb_bits_to_transmit) { else if ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1)) <= nb_bits_to_transmit) {
/* Init loop flags */ /* Init loop flags */
/* Check lsf */ /* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1); segment_loop_end = (pdu_info_cursor_p->lsf == 1);
...@@ -764,8 +775,14 @@ rlc_am_send_status_pdu( ...@@ -764,8 +775,14 @@ rlc_am_send_status_pdu(
} // End main while NACK_SN } // End main while NACK_SN
/* Clear E1 of last nack_sn entry */ /* Clear E1 of last nack_sn entry */
AssertFatal ((control_pdu_info.num_nack) || (all_segments_received == 0), "RLC AM Tx Status PDU Data Error no NACK_SN vrR=%d vrMS=%d lastSN_NACK=%d Completed=%d NbBytesAvailable=%d LcId=%d\n", // AssertFatal ((control_pdu_info.num_nack) || (all_segments_received == 0), "RLC AM Tx Status PDU Data Error no NACK_SN vrR=%d vrMS=%d lastSN_NACK=%d Completed=%d NbBytesAvailable=%d LcId=%d\n",
// rlc_pP->vr_r,rlc_pP->vr_ms,sn_nack,status_report_completed,(nb_bits_to_transmit >> 3),rlc_pP->channel_id);
if (!((control_pdu_info.num_nack) || (all_segments_received == 0))){
LOG_E(RLC, "RLC AM Tx Status PDU Data Error no NACK_SN vrR=%d vrMS=%d lastSN_NACK=%d Completed=%d NbBytesAvailable=%d LcId=%d\n",
rlc_pP->vr_r,rlc_pP->vr_ms,sn_nack,status_report_completed,(nb_bits_to_transmit >> 3),rlc_pP->channel_id); rlc_pP->vr_r,rlc_pP->vr_ms,sn_nack,status_report_completed,(nb_bits_to_transmit >> 3),rlc_pP->channel_id);
return;
}
if (control_pdu_info.num_nack) { if (control_pdu_info.num_nack) {
control_pdu_info.nack_list[control_pdu_info.num_nack - 1].e1 = 0; control_pdu_info.nack_list[control_pdu_info.num_nack - 1].e1 = 0;
} }
...@@ -803,8 +820,13 @@ rlc_am_send_status_pdu( ...@@ -803,8 +820,13 @@ rlc_am_send_status_pdu(
/* encode the control pdu */ /* encode the control pdu */
pdu_size = (nb_bits_transmitted + 7) >> 3; pdu_size = (nb_bits_transmitted + 7) >> 3;
AssertFatal (pdu_size <= rlc_pP->nb_bytes_requested_by_mac, "RLC AM Tx Status PDU Data size=%d bigger than remaining TBS=%d nb_bits_transmitted=%d LcId=%d\n", // AssertFatal (pdu_size <= rlc_pP->nb_bytes_requested_by_mac, "RLC AM Tx Status PDU Data size=%d bigger than remaining TBS=%d nb_bits_transmitted=%d LcId=%d\n",
// pdu_size,rlc_pP->nb_bytes_requested_by_mac,nb_bits_transmitted, rlc_pP->channel_id);
if(pdu_size > rlc_pP->nb_bytes_requested_by_mac){
LOG_E(RLC, "RLC AM Tx Status PDU Data size=%d bigger than remaining TBS=%d nb_bits_transmitted=%d LcId=%d\n",
pdu_size,rlc_pP->nb_bytes_requested_by_mac,nb_bits_transmitted, rlc_pP->channel_id); pdu_size,rlc_pP->nb_bytes_requested_by_mac,nb_bits_transmitted, rlc_pP->channel_id);
return;
}
#if TRACE_RLC_AM_STATUS_CREATION #if TRACE_RLC_AM_STATUS_CREATION
...@@ -833,8 +855,14 @@ rlc_am_send_status_pdu( ...@@ -833,8 +855,14 @@ rlc_am_send_status_pdu(
nb_bits_to_transmit >> 3); nb_bits_to_transmit >> 3);
#endif #endif
AssertFatal (pdu_size == ((nb_bits_transmitted + 7) >> 3), "RLC AM Tx Status PDU Data encoding size=%d different than expected=%d LcId=%d\n", // AssertFatal (pdu_size == ((nb_bits_transmitted + 7) >> 3), "RLC AM Tx Status PDU Data encoding size=%d different than expected=%d LcId=%d\n",
// pdu_size,((nb_bits_transmitted + 7) >> 3), rlc_pP->channel_id);
if(pdu_size != ((nb_bits_transmitted + 7) >> 3)){
LOG_E(RLC, "RLC AM Tx Status PDU Data encoding size=%d different than expected=%d LcId=%d\n",
pdu_size,((nb_bits_transmitted + 7) >> 3), rlc_pP->channel_id); pdu_size,((nb_bits_transmitted + 7) >> 3), rlc_pP->channel_id);
pdu_size = 0;
return;
}
// remaining bytes to transmit for RLC (retrans pdus and new data pdus) // remaining bytes to transmit for RLC (retrans pdus and new data pdus)
rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - pdu_size; rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - pdu_size;
......
...@@ -88,8 +88,15 @@ rlc_am_check_timer_poll_retransmit( ...@@ -88,8 +88,15 @@ rlc_am_check_timer_poll_retransmit(
/* Look for the first retransmittable PDU starting from vtS - 1 */ /* Look for the first retransmittable PDU starting from vtS - 1 */
while (sn != sn_end) { while (sn != sn_end) {
tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE]; tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d ack=%d is empty vtA=%d vtS=%d LcId=%d\n", //AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d ack=%d is empty vtA=%d vtS=%d LcId=%d\n",
// sn, tx_data_pdu_buffer_p->flags.ack,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
if(tx_data_pdu_buffer_p->mem_block == NULL){
LOG_E(RLC, "RLC AM Tpoll Retx expiry sn=%d ack=%d is empty vtA=%d vtS=%d LcId=%d\n",
sn, tx_data_pdu_buffer_p->flags.ack,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id); sn, tx_data_pdu_buffer_p->flags.ack,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
sn = RLC_AM_PREV_SN(sn);
continue;
}
if ((tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) { if ((tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
tx_data_pdu_buffer_p->flags.retransmit = 1; tx_data_pdu_buffer_p->flags.retransmit = 1;
tx_data_pdu_buffer_p->retx_payload_size = tx_data_pdu_buffer_p->payload_size; tx_data_pdu_buffer_p->retx_payload_size = tx_data_pdu_buffer_p->payload_size;
......
...@@ -70,7 +70,12 @@ rlc_am_check_timer_reordering( ...@@ -70,7 +70,12 @@ rlc_am_check_timer_reordering(
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif #endif
AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id); //AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
if(rlc_pP->vr_x == RLC_SN_UNDEFINED){
LOG_E(RLC, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
return;
}
rlc_pP->t_reordering.running = 0; rlc_pP->t_reordering.running = 0;
rlc_pP->t_reordering.timed_out = 1; rlc_pP->t_reordering.timed_out = 1;
...@@ -81,7 +86,11 @@ rlc_am_check_timer_reordering( ...@@ -81,7 +86,11 @@ rlc_am_check_timer_reordering(
cursor = rlc_pP->receiver_buffer.head; cursor = rlc_pP->receiver_buffer.head;
rlc_usn_t vr_ms_new = rlc_pP->vr_x; rlc_usn_t vr_ms_new = rlc_pP->vr_x;
AssertFatal (cursor != NULL, "RLC AM TReordering Expiry Rx PDU list empty LcId=%d\n", rlc_pP->channel_id); //AssertFatal (cursor != NULL, "RLC AM TReordering Expiry Rx PDU list empty LcId=%d\n", rlc_pP->channel_id);
if(cursor == NULL){
LOG_E(RLC, "RLC AM TReordering Expiry Rx PDU list empty LcId=%d\n", rlc_pP->channel_id);
return;
}
/* go to memblock up to vrX*/ /* go to memblock up to vrX*/
pdu_info = &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info; pdu_info = &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info;
......
...@@ -568,7 +568,13 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,cons ...@@ -568,7 +568,13 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,cons
l_rlc_p->stat_tx_data_pdu += 1; l_rlc_p->stat_tx_data_pdu += 1;
l_rlc_p->stat_tx_data_bytes += tb_size_in_bytes; l_rlc_p->stat_tx_data_bytes += tb_size_in_bytes;
AssertFatal( tb_size_in_bytes > 0 , "RLC UM PDU LENGTH %d", tb_size_in_bytes); //AssertFatal( tb_size_in_bytes > 0 , "RLC UM PDU LENGTH %d", tb_size_in_bytes);
if(tb_size_in_bytes <= 0) {
LOG_E(RLC, "RLC UM PDU LENGTH %d\n", tb_size_in_bytes);
tb_p = tb_p->next;
continue;
}
#if TRACE_RLC_UM_PDU || MESSAGE_CHART_GENERATOR #if TRACE_RLC_UM_PDU || MESSAGE_CHART_GENERATOR
rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_req*) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_req*) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
#endif #endif
......
...@@ -106,28 +106,48 @@ void config_req_rlc_um_asn1 ( ...@@ -106,28 +106,48 @@ void config_req_rlc_um_asn1 (
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
if (mbms_flagP) { if (mbms_flagP) {
AssertFatal(dl_rlc_pP, "No RLC UM DL config"); //AssertFatal(dl_rlc_pP, "No RLC UM DL config");
AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present"); if(dl_rlc_pP == NULL) {
LOG_E(RLC, "No RLC UM DL config\n");
return;
}
//AssertFatal(ul_rlc_pP == NULL, "RLC UM UL config present");
if(ul_rlc_pP != NULL) {
LOG_E(RLC, "RLC UM UL config present\n");
return;
}
key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP); key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u", //AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u",
ctxt_pP->module_id, // ctxt_pP->module_id,
ctxt_pP->rnti, // ctxt_pP->rnti,
ctxt_pP->enb_flag, // ctxt_pP->enb_flag,
mbms_service_idP, // mbms_service_idP,
mbms_session_idP); // mbms_session_idP);
if(h_rc != HASH_TABLE_OK) {
LOG_E(RLC, "RLC NOT FOUND enb id %u rnti %i enb flag %u service id %u, session id %u\n",
ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_service_idP, mbms_session_idP);
return;
}
rlc_p = &rlc_union_p->rlc.um; rlc_p = &rlc_union_p->rlc.um;
} else } else
#endif #endif
{ {
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u", //AssertFatal (h_rc == HASH_TABLE_OK, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u",
ctxt_pP->module_id, // ctxt_pP->module_id,
ctxt_pP->rnti, // ctxt_pP->rnti,
ctxt_pP->enb_flag, // ctxt_pP->enb_flag,
rb_idP, // rb_idP,
srb_flagP); // srb_flagP);
if(h_rc != HASH_TABLE_OK) {
LOG_E(RLC, "RLC NOT FOUND enb id %u ue id %i enb flag %u rb id %u, srb flag %u\n",
ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
return;
}
rlc_p = &rlc_union_p->rlc.um; rlc_p = &rlc_union_p->rlc.um;
} }
...@@ -269,7 +289,11 @@ rlc_um_init ( ...@@ -269,7 +289,11 @@ rlc_um_init (
) )
{ {
AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)"); //AssertFatal(rlc_pP, "Bad RLC UM pointer (NULL)");
if(rlc_pP == NULL) {
LOG_E(RLC, "Bad RLC UM pointer (NULL)\n");
return;
}
if (rlc_pP->initialized) { if (rlc_pP->initialized) {
LOG_D(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [INIT] ALREADY DONE, DOING NOTHING\n", LOG_D(RLC,PROTOCOL_RLC_UM_CTXT_FMT" [INIT] ALREADY DONE, DOING NOTHING\n",
......
...@@ -47,7 +47,11 @@ signed int rlc_um_get_pdu_infos( ...@@ -47,7 +47,11 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->num_li = 0; pdu_info_pP->num_li = 0;
AssertFatal( total_sizeP > 0 , "RLC UM PDU LENGTH %d", total_sizeP); //AssertFatal( total_sizeP > 0 , "RLC UM PDU LENGTH %d", total_sizeP);
if(total_sizeP <= 0) {
LOG_E(RLC, "RLC UM PDU LENGTH %d\n", total_sizeP);
return -1;
}
if (sn_lengthP == 10) { if (sn_lengthP == 10) {
pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03; pdu_info_pP->fi = (header_pP->b1 >> 3) & 0x03;
...@@ -62,7 +66,11 @@ signed int rlc_um_get_pdu_infos( ...@@ -62,7 +66,11 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->header_size = 1; pdu_info_pP->header_size = 1;
pdu_info_pP->payload = &header_pP->b2; pdu_info_pP->payload = &header_pP->b2;
} else { } else {
AssertFatal( sn_lengthP == 5 || sn_lengthP == 10, "RLC UM SN LENGTH %d", sn_lengthP); //AssertFatal( sn_lengthP == 5 || sn_lengthP == 10, "RLC UM SN LENGTH %d", sn_lengthP);
if(!(sn_lengthP == 5 || sn_lengthP == 10)) {
LOG_E(RLC, "RLC UM SN LENGTH %d\n", sn_lengthP);
return -1;
}
} }
...@@ -77,15 +85,23 @@ signed int rlc_um_get_pdu_infos( ...@@ -77,15 +85,23 @@ signed int rlc_um_get_pdu_infos(
li_length_in_bytes = li_length_in_bytes ^ 3; li_length_in_bytes = li_length_in_bytes ^ 3;
if (li_length_in_bytes == 2) { if (li_length_in_bytes == 2) {
AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b2) - (uint64_t)header_pP), //AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b2) - (uint64_t)header_pP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP); // "DECODING PDU TOO FAR PDU size %d", total_sizeP);
if(total_sizeP < ((uint64_t)(&e_li_p->b2) - (uint64_t)header_pP)) {
LOG_E(RLC, "DECODING PDU TOO FAR PDU size %d\n", total_sizeP);
return -1;
}
pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b1 << 4)) & 0x07F0; pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b1 << 4)) & 0x07F0;
pdu_info_pP->li_list[pdu_info_pP->num_li] |= (((uint8_t)(e_li_p->b2 >> 4)) & 0x000F); pdu_info_pP->li_list[pdu_info_pP->num_li] |= (((uint8_t)(e_li_p->b2 >> 4)) & 0x000F);
li_to_read = e_li_p->b1 & 0x80; li_to_read = e_li_p->b1 & 0x80;
pdu_info_pP->header_size += 2; pdu_info_pP->header_size += 2;
} else { } else {
AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP), //AssertFatal( total_sizeP >= ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP),
"DECODING PDU TOO FAR PDU size %d", total_sizeP); // "DECODING PDU TOO FAR PDU size %d", total_sizeP);
if(total_sizeP < ((uint64_t)(&e_li_p->b3) - (uint64_t)header_pP)) {
LOG_E(RLC, "DECODING PDU TOO FAR PDU size %d\n", total_sizeP);
return -1;
}
pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b2 << 8)) & 0x0700; pdu_info_pP->li_list[pdu_info_pP->num_li] = ((uint16_t)(e_li_p->b2 << 8)) & 0x0700;
pdu_info_pP->li_list[pdu_info_pP->num_li] |= e_li_p->b3; pdu_info_pP->li_list[pdu_info_pP->num_li] |= e_li_p->b3;
li_to_read = e_li_p->b2 & 0x08; li_to_read = e_li_p->b2 & 0x08;
...@@ -93,10 +109,16 @@ signed int rlc_um_get_pdu_infos( ...@@ -93,10 +109,16 @@ signed int rlc_um_get_pdu_infos(
pdu_info_pP->header_size += 1; pdu_info_pP->header_size += 1;
} }
AssertFatal( pdu_info_pP->num_li <= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU, //AssertFatal( pdu_info_pP->num_li <= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU,
PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ", // PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ",
// PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
// pdu_info_pP->sn);
if(pdu_info_pP->num_li > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs \n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
pdu_info_pP->sn); pdu_info_pP->sn);
return -1;
}
sum_li += pdu_info_pP->li_list[pdu_info_pP->num_li]; sum_li += pdu_info_pP->li_list[pdu_info_pP->num_li];
pdu_info_pP->num_li = pdu_info_pP->num_li + 1; pdu_info_pP->num_li = pdu_info_pP->num_li + 1;
...@@ -308,9 +330,17 @@ rlc_um_try_reassembly( ...@@ -308,9 +330,17 @@ rlc_um_try_reassembly(
__LINE__); __LINE__);
#endif #endif
} }
AssertFatal(size >= 0, "invalid size!"); //AssertFatal(size >= 0, "invalid size!");
AssertFatal((e==0) || (e==1), "invalid e!"); //AssertFatal((e==0) || (e==1), "invalid e!");
AssertFatal((fi >= 0) && (fi <= 3), "invalid fi!"); //AssertFatal((fi >= 0) && (fi <= 3), "invalid fi!");
if((size < 0) || ((e!=0) && (e!=1)) || ((fi < 0) || (fi > 3))){
LOG_E(RLC, "invalid size %d, e %d, fi %d\n", size, e, fi);
sn = (sn + 1) % rlc_pP->rx_sn_modulo;
if ((sn == rlc_pP->vr_uh) || (sn == end_snP)) {
continue_reassembly = 0;
}
continue;
}
if (e == RLC_E_FIXED_PART_DATA_FIELD_FOLLOW) { if (e == RLC_E_FIXED_PART_DATA_FIELD_FOLLOW) {
switch (fi) { switch (fi) {
...@@ -400,11 +430,14 @@ rlc_um_try_reassembly( ...@@ -400,11 +430,14 @@ rlc_um_try_reassembly(
break; break;
default: default:
AssertFatal( 0 , PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n", //AssertFatal( 0 , PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
fi, // fi,
__FILE__, // __FILE__,
__LINE__); // __LINE__);
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" fi=%d! TRY REASSEMBLY SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), fi, __FILE__, __LINE__);
} }
} else { } else {
if (rlc_um_read_length_indicators(&data_p, e_li_p, li_array, &num_li, &size ) >= 0) { if (rlc_um_read_length_indicators(&data_p, e_li_p, li_array, &num_li, &size ) >= 0) {
...@@ -543,11 +576,14 @@ rlc_um_try_reassembly( ...@@ -543,11 +576,14 @@ rlc_um_try_reassembly(
// data_p is already ok, done by last loop above // data_p is already ok, done by last loop above
rlc_um_reassembly (ctxt_pP, rlc_pP, data_p, size); rlc_um_reassembly (ctxt_pP, rlc_pP, data_p, size);
} else { } else {
AssertFatal( 0 !=0, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n", //AssertFatal( 0 !=0, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
size, // size,
__FILE__, // __FILE__,
__LINE__); // __LINE__);
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" size=%d! SHOULD NOT GO HERE (%s:%u)\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), size, __FILE__, __LINE__);
//rlc_pP->stat_rx_data_pdu_dropped += 1; //rlc_pP->stat_rx_data_pdu_dropped += 1;
rlc_pP->stat_rx_data_bytes_dropped += size; rlc_pP->stat_rx_data_bytes_dropped += size;
} }
......
...@@ -52,7 +52,7 @@ rlc_um_fsm_notify_event ( ...@@ -52,7 +52,7 @@ rlc_um_fsm_notify_event (
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" FSM WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE\n", LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" FSM WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP),
eventP); eventP);
AssertFatal(1==0,"RLC-UM FSM WARNING PROTOCOL ERROR - EVENT NOT EXPECTED FROM NULL_STATE"); //AssertFatal(1==0,"RLC-UM FSM WARNING PROTOCOL ERROR - EVENT NOT EXPECTED FROM NULL_STATE");
return 0; return 0;
} }
......
...@@ -411,7 +411,11 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP ...@@ -411,7 +411,11 @@ rlc_um_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP
#if TRACE_RLC_PAYLOAD #if TRACE_RLC_PAYLOAD
rlc_util_print_hex_octets(RLC, pdu_mem_p->data, data_pdu_size); rlc_util_print_hex_octets(RLC, pdu_mem_p->data, data_pdu_size);
#endif #endif
AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT10: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size); //AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT10: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size);
if(pdu_tb_req_p->tb_size <= 0) {
LOG_E(RLC, "SEGMENT10: FINAL RLC UM PDU LENGTH %d\n", pdu_tb_req_p->tb_size);
break;
}
pdu_p = NULL; pdu_p = NULL;
pdu_mem_p = NULL; pdu_mem_p = NULL;
...@@ -744,13 +748,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) ...@@ -744,13 +748,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
sdu_mngt_p = NULL; sdu_mngt_p = NULL;
} else { } else {
#if TRACE_RLC_UM_SEGMENT LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" Filling PDU with %d all remaining bytes of SDU and reduce TB size by %d bytes\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_pP),
sdu_mngt_p->sdu_remaining_size, sdu_mngt_p->sdu_remaining_size,
pdu_remaining_size - sdu_mngt_p->sdu_remaining_size); pdu_remaining_size - sdu_mngt_p->sdu_remaining_size);
#endif //assert(1!=1);
assert(1!=1);
memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size); memcpy(data, data_sdu_p, sdu_mngt_p->sdu_remaining_size);
// reduce the size of the PDU // reduce the size of the PDU
continue_fill_pdu_with_sdu = 0; continue_fill_pdu_with_sdu = 0;
...@@ -792,7 +794,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) ...@@ -792,7 +794,11 @@ rlc_um_segment_5 (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
#if TRACE_RLC_PAYLOAD #if TRACE_RLC_PAYLOAD
rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem_p->data, data_pdu_size); rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem_p->data, data_pdu_size);
#endif #endif
AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT5: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size); //AssertFatal( pdu_tb_req_p->tb_size > 0 , "SEGMENT5: FINAL RLC UM PDU LENGTH %d", pdu_tb_req_p->tb_size);
if(pdu_tb_req_p->tb_size <= 0) {
LOG_E(RLC, "SEGMENT5: FINAL RLC UM PDU LENGTH %d\n", pdu_tb_req_p->tb_size);
break;
}
pdu_p = NULL; pdu_p = NULL;
pdu_mem_p = NULL; pdu_mem_p = NULL;
......
...@@ -135,7 +135,12 @@ rlc_op_status_t rlc_stat_req ( ...@@ -135,7 +135,12 @@ rlc_op_status_t rlc_stat_req (
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE; hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc; hashtable_rc_t h_rc;
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); //AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
if(rb_idP >= NB_RB_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
return RLC_OP_STATUS_BAD_PARAMETER;
}
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
...@@ -348,13 +353,30 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -348,13 +353,30 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
#endif #endif
if (MBMS_flagP) { if (MBMS_flagP) {
AssertFatal (rb_idP < NB_RB_MBMS_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX); //AssertFatal (rb_idP < NB_RB_MBMS_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX);
if(rb_idP >= NB_RB_MBMS_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX);
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else { } else {
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); //AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
if(rb_idP >= NB_RB_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
return RLC_OP_STATUS_BAD_PARAMETER;
}
} }
DevAssert(sdu_pP != NULL); //DevAssert(sdu_pP != NULL);
DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0); if(sdu_pP == NULL){
LOG_E(RLC, "sdu_pP == NULL\n");
return RLC_OP_STATUS_BAD_PARAMETER;
}
//DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
if(sdu_sizeP <= 0) {
LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__ ,__LINE__);
return RLC_OP_STATUS_BAD_PARAMETER;
}
#if !defined(Rel10) && !defined(Rel14) #if !defined(Rel10) && !defined(Rel14)
DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0); DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0);
...@@ -386,7 +408,9 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -386,7 +408,9 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
rlc_mode = RLC_MODE_NONE; rlc_mode = RLC_MODE_NONE;
AssertFatal (0 , "RLC not configured key %ju\n", key); //AssertFatal (0 , "RLC not configured key %ju\n", key);
LOG_E(RLC, "not configured key %lu\n", key);
return RLC_OP_STATUS_OUT_OF_RESSOURCES;
} }
if (MBMS_flagP == 0) { if (MBMS_flagP == 0) {
...@@ -608,7 +632,11 @@ rlc_module_init (void) ...@@ -608,7 +632,11 @@ rlc_module_init (void)
rlc_rrc_data_conf = NULL; rlc_rrc_data_conf = NULL;
rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union); rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union);
AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed"); //AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed");
if(rlc_coll_p == NULL) {
LOG_E(RLC, "UNRECOVERABLE error, RLC hashtable_create failed\n");
return -1;
}
for (module_id1=0; module_id1 < NUMBER_OF_UE_MAX; module_id1++) { for (module_id1=0; module_id1 < NUMBER_OF_UE_MAX; module_id1++) {
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
......
...@@ -152,9 +152,17 @@ tbs_size_t mac_rlc_data_req( ...@@ -152,9 +152,17 @@ tbs_size_t mac_rlc_data_req(
#endif // DEBUG_MAC_INTERFACE #endif // DEBUG_MAC_INTERFACE
if (MBMS_flagP) { if (MBMS_flagP) {
AssertFatal (channel_idP < RLC_MAX_MBMS_LC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_MBMS_LC); //AssertFatal (channel_idP < RLC_MAX_MBMS_LC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_MBMS_LC);
if(channel_idP >= RLC_MAX_MBMS_LC){
LOG_E(RLC, "channel id is too high (%u/%d)!\n", channel_idP, RLC_MAX_MBMS_LC);
return 0;
}
} else { } else {
AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX); //AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX);
if(channel_idP >= NB_RB_MAX){
LOG_E(RLC, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX);
return 0;
}
} }
if (MBMS_flagP) { if (MBMS_flagP) {
...@@ -174,7 +182,8 @@ tbs_size_t mac_rlc_data_req( ...@@ -174,7 +182,8 @@ tbs_size_t mac_rlc_data_req(
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
rlc_mode = RLC_MODE_NONE; rlc_mode = RLC_MODE_NONE;
AssertFatal (0 , "RLC not configured lcid %u RNTI %x!\n", channel_idP, rntiP); //AssertFatal (0 , "RLC not configured lcid %u RNTI %x!\n", channel_idP, rntiP);
LOG_E(RLC, "RLC not configured lcid %u RNTI %x!\n", channel_idP, rntiP);
} }
switch (rlc_mode) { switch (rlc_mode) {
...@@ -419,7 +428,11 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( ...@@ -419,7 +428,11 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
/* Assumptions : for UE only */ /* Assumptions : for UE only */
/* At each TTI, Buffer Occupancy is first computed in mac_rlc_status_ind called by MAC ue_scheduler() function */ /* At each TTI, Buffer Occupancy is first computed in mac_rlc_status_ind called by MAC ue_scheduler() function */
/* Then this function is called during MAC multiplexing ue_get_sdu(), and it may be call several times for the same bearer if it is in AM mode and there are several PDU types to transmit */ /* Then this function is called during MAC multiplexing ue_get_sdu(), and it may be call several times for the same bearer if it is in AM mode and there are several PDU types to transmit */
AssertFatal(enb_flagP == FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP); //AssertFatal(enb_flagP == FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP);
if(enb_flagP != FALSE){
LOG_E(RLC, "Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%u\n", channel_idP);
return 0;
}
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag); key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
......
...@@ -373,7 +373,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -373,7 +373,10 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
rb_id, rb_id,
lc_id, lc_id,
RLC_MODE_UM); RLC_MODE_UM);
AssertFatal(rlc_union_p != NULL, "ADD MBMS RLC UM FAILED"); //AssertFatal(rlc_union_p != NULL, "ADD MBMS RLC UM FAILED");
if(rlc_union_p == NULL){
LOG_E(RLC, "ADD MBMS RLC UM FAILED\n");
}
} }
LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ MBMS ASN1 LC ID %u RB ID %u SESSION ID %u SERVICE ID %u\n", LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ MBMS ASN1 LC ID %u RB ID %u SESSION ID %u SERVICE ID %u\n",
...@@ -511,7 +514,11 @@ rlc_op_status_t rrc_rlc_remove_rlc ( ...@@ -511,7 +514,11 @@ rlc_op_status_t rrc_rlc_remove_rlc (
} }
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); //AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
if(rb_idP >= NB_RB_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
return RLC_OP_STATUS_BAD_PARAMETER;
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
...@@ -585,8 +592,17 @@ rlc_union_t* rrc_rlc_add_rlc ( ...@@ -585,8 +592,17 @@ rlc_union_t* rrc_rlc_add_rlc (
#endif #endif
if (MBMS_flagP == FALSE) { if (MBMS_flagP == FALSE) {
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); //AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
AssertFatal (chan_idP < RLC_MAX_LC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC); //AssertFatal (chan_idP < RLC_MAX_LC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC);
if(rb_idP >= NB_RB_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
return NULL;
}
if(chan_idP >= RLC_MAX_LC){
LOG_E(RLC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC);
return NULL;
}
} }
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
...@@ -623,7 +639,11 @@ rlc_union_t* rrc_rlc_add_rlc ( ...@@ -623,7 +639,11 @@ rlc_union_t* rrc_rlc_add_rlc (
(srb_flagP) ? "SRB" : "DRB", (srb_flagP) ? "SRB" : "DRB",
rb_idP, rb_idP,
(srb_flagP) ? "SRB" : "DRB"); (srb_flagP) ? "SRB" : "DRB");
AssertFatal(rlc_union_p->mode == rlc_modeP, "Error rrc_rlc_add_rlc , already exist but RLC mode differ"); //AssertFatal(rlc_union_p->mode == rlc_modeP, "Error rrc_rlc_add_rlc , already exist but RLC mode differ");
if(rlc_union_p->mode != rlc_modeP){
LOG_E(RLC, "Error rrc_rlc_add_rlc , already exist but RLC mode differ\n");
return NULL;
}
return rlc_union_p; return rlc_union_p;
} else if (h_rc == HASH_TABLE_KEY_NOT_EXISTS) { } else if (h_rc == HASH_TABLE_KEY_NOT_EXISTS) {
rlc_union_p = calloc(1, sizeof(rlc_union_t)); rlc_union_p = calloc(1, sizeof(rlc_union_t));
...@@ -687,7 +707,11 @@ rlc_op_status_t rrc_rlc_config_req ( ...@@ -687,7 +707,11 @@ rlc_op_status_t rrc_rlc_config_req (
PROTOCOL_CTXT_ARGS(ctxt_pP), PROTOCOL_CTXT_ARGS(ctxt_pP),
rb_idP); rb_idP);
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX); //AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
if(rb_idP >= NB_RB_MAX){
LOG_E(RLC, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
return RLC_OP_STATUS_BAD_PARAMETER;
}
switch (actionP) { switch (actionP) {
......
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