Commit c5e3a467 authored by Lionel Gauthier's avatar Lionel Gauthier

RAL Updates + RLC PDU dumped in ITTI msg text

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4886 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 247257f1
...@@ -132,7 +132,7 @@ struct mac_tb_req { ...@@ -132,7 +132,7 @@ struct mac_tb_req {
// BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management // BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management
unsigned char *data_ptr; unsigned char *data_ptr;
unsigned char first_bit; unsigned char first_bit;
unsigned short tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte unsigned short tb_size;
// align the tb we have to know its size // align the tb we have to know its size
// for reporting tx status to upper layers // for reporting tx status to upper layers
...@@ -225,41 +225,5 @@ struct mac_primitive { ...@@ -225,41 +225,5 @@ struct mac_primitive {
} primitive; } primitive;
}; };
# ifdef BYPASS_L1
// List element of TrCh Blocks data
struct Bypass_TrChBlk_MAC_Interface {
unsigned char first_bit; // First valid Bit in first word. 0 if word is full
unsigned char valid_checksum; // 1 if valid checksum (receive only)
unsigned char peer_trch_id;
unsigned int data_start_index;
unsigned char data[100];
};
struct Bypass_TrChData_MAC_Interface {
unsigned short tf;
unsigned char nb_blocks;
unsigned char updated;
struct Bypass_TrChBlk_MAC_Interface tb[32];
};
struct Bypass_L1 {
struct Bypass_TrChData_MAC_Interface ul_trch[JRRM_MAX_TRCH_RG]; // MT write data here. RG read here, index are rg trch ids
struct Bypass_TrChData_MAC_Interface dl_trch[JRRM_MAX_TRCH_RG]; // RG write data here. MT read here,
unsigned char mt_ack[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char rg_ack[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char mt_wrote[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char rg_wrote[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char num_mobiles;
unsigned char join_request; // act as boolean
unsigned char detach_request; // act as boolean
unsigned char join_requests[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char join_acks[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char detach_requests[JRRM_MAX_MANAGED_MOBILES_PER_RG];
unsigned char detach_acks[JRRM_MAX_MANAGED_MOBILES_PER_RG];
};
# endif
/** @} */ /** @} */
#endif #endif
...@@ -350,9 +350,9 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP,u32_t frameP) ...@@ -350,9 +350,9 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP,u32_t frameP)
rlc_pP->stat_tx_data_pdu += 1; rlc_pP->stat_tx_data_pdu += 1;
rlc_pP->stat_tx_retransmit_pdu += 1; rlc_pP->stat_tx_retransmit_pdu += 1;
rlc_pP->stat_tx_retransmit_pdu_by_status += 1; rlc_pP->stat_tx_retransmit_pdu_by_status += 1;
rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req*)(copy->data))->tb_size_in_bits >> 3); rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req*)(copy->data))->tb_size);
rlc_pP->stat_tx_retransmit_bytes += (((struct mac_tb_req*)(copy->data))->tb_size_in_bits >> 3); rlc_pP->stat_tx_retransmit_bytes += (((struct mac_tb_req*)(copy->data))->tb_size);
rlc_pP->stat_tx_retransmit_bytes_by_status += (((struct mac_tb_req*)(copy->data))->tb_size_in_bits >> 3); rlc_pP->stat_tx_retransmit_bytes_by_status += (((struct mac_tb_req*)(copy->data))->tb_size);
list_add_tail_eurecom (copy, &rlc_pP->pdus_to_mac_layer); list_add_tail_eurecom (copy, &rlc_pP->pdus_to_mac_layer);
} else { } else {
break; break;
...@@ -390,7 +390,7 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP,u32_t frameP) ...@@ -390,7 +390,7 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP,u32_t frameP)
list_add_list (&rlc_pP->segmentation_pdu_list, &rlc_pP->pdus_to_mac_layer); list_add_list (&rlc_pP->segmentation_pdu_list, &rlc_pP->pdus_to_mac_layer);
if (rlc_pP->pdus_to_mac_layer.head != NULL) { if (rlc_pP->pdus_to_mac_layer.head != NULL) {
rlc_pP->stat_tx_data_pdu += 1; rlc_pP->stat_tx_data_pdu += 1;
rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req*)(rlc_pP->pdus_to_mac_layer.head->data))->tb_size_in_bits >> 3); rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req*)(rlc_pP->pdus_to_mac_layer.head->data))->tb_size);
return; return;
} }
} }
...@@ -523,7 +523,9 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP) ...@@ -523,7 +523,9 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP)
int num_nack; int num_nack;
char message_string[9000]; char message_string[9000];
size_t message_string_size = 0; size_t message_string_size = 0;
# if defined(ENABLE_ITTI)
MessageDef *msg_p; MessageDef *msg_p;
# endif
int octet_index, index; int octet_index, index;
#endif #endif
...@@ -546,7 +548,7 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP) ...@@ -546,7 +548,7 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP)
while (tb_p != NULL) { while (tb_p != NULL) {
rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)((struct mac_tb_req *) (tb_p->data))->data_ptr; rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)((struct mac_tb_req *) (tb_p->data))->data_ptr;
tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size_in_bits >> 3; tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size;
if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
if (rlc_am_get_data_pdu_infos(frameP,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { if (rlc_am_get_data_pdu_infos(frameP,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
...@@ -610,12 +612,12 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP) ...@@ -610,12 +612,12 @@ rlc_am_mac_data_request (void *rlc_pP,u32 frameP)
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p); itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
# else # else
rlc_am_display_data_pdu_infos(l_rlc_p, frameP, pdu_info); rlc_am_display_data_pdu_infos(l_rlc_p, frameP, &pdu_info);
# endif # endif
} }
} else { } else {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &g_rlc_am_control_pdu_info) >= 0) { if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &g_rlc_am_control_pdu_info) >= 0) {
tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size_in_bits >> 3; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos! tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos!
# if defined(ENABLE_ITTI) # if defined(ENABLE_ITTI)
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id); message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id);
...@@ -667,7 +669,9 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac ...@@ -667,7 +669,9 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac
int num_nack; int num_nack;
char message_string[7000]; char message_string[7000];
size_t message_string_size = 0; size_t message_string_size = 0;
# if defined(ENABLE_ITTI)
MessageDef *msg_p; MessageDef *msg_p;
# endif
int octet_index, index; int octet_index, index;
#endif #endif
...@@ -684,9 +688,6 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac ...@@ -684,9 +688,6 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac
if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
if (rlc_am_get_data_pdu_infos(frameP,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { if (rlc_am_get_data_pdu_infos(frameP,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
# if defined(ENABLE_ITTI) # if defined(ENABLE_ITTI)
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id); message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id);
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size); message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
...@@ -746,7 +747,7 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac ...@@ -746,7 +747,7 @@ rlc_am_mac_data_indication (void *rlc_pP, u32_t frameP, u8 eNB_flagP, struct mac
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p); itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
# else # else
rlc_am_display_data_pdu_infos(l_rlc_p, frameP, pdu_info); rlc_am_display_data_pdu_infos(l_rlc_p, frameP, &pdu_info);
# endif # endif
} }
} else { } else {
......
...@@ -545,7 +545,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlcP, u32_t frame ...@@ -545,7 +545,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlcP, u32_t frame
&rlcP->pdu_retrans_buffer[snP].payload[start_offset], &rlcP->pdu_retrans_buffer[snP].payload[start_offset],
test_pdu_copy_size); test_pdu_copy_size);
((struct mac_tb_req*)(mb_sub_segment->data))->tb_size_in_bits = ((((u32_t)fill_payload)+ test_pdu_copy_size) - ((u32_t)(&pdu_sub_segment->b1))) << 3; ((struct mac_tb_req*)(mb_sub_segment->data))->tb_size = (((u64_t)fill_payload)+ test_pdu_copy_size) - ((u64_t)(&pdu_sub_segment->b1));
// set LSF // set LSF
if ((test_pdu_copy_size + start_offset) == rlcP->pdu_retrans_buffer[snP].payload_size) { if ((test_pdu_copy_size + start_offset) == rlcP->pdu_retrans_buffer[snP].payload_size) {
...@@ -553,12 +553,27 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlcP, u32_t frame ...@@ -553,12 +553,27 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlcP, u32_t frame
rlcP->pdu_retrans_buffer[snP].flags.retransmit = 0; rlcP->pdu_retrans_buffer[snP].flags.retransmit = 0;
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES LSF!\n", frame, rlcP->module_id,rlcP->rb_id, snP, start_offset, ((struct mac_tb_req*)(mb_sub_segment->data))->tb_size_in_bits >> 3, test_pdu_copy_size); LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES LSF!\n",
frame,
rlcP->module_id,rlcP->rb_id,
snP,
start_offset,
((struct mac_tb_req*)(mb_sub_segment->data))->tb_size,
test_pdu_copy_size);
} }
else { else {
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES\n", frame, rlcP->module_id,rlcP->rb_id, snP, start_offset, ((struct mac_tb_req*)(mb_sub_segment->data))->tb_size_in_bits >> 3, test_pdu_copy_size); LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES\n",
frame,
rlcP->module_id,
rlcP->rb_id,
snP,
start_offset,
((struct mac_tb_req*)(mb_sub_segment->data))->tb_size,
test_pdu_copy_size);
} }
LOG_T(RLC, "[FRAME XXXXX][RLC_AM][MOD XX][RB XX][RE-SEGMENT] *sizeP %d = *sizeP %d - test_pdu_copy_size %d\n",*sizeP - test_pdu_copy_size, *sizeP, test_pdu_copy_size); LOG_T(RLC, "[FRAME XXXXX][RLC_AM][MOD XX][RB XX][RE-SEGMENT] *sizeP %d = *sizeP %d - test_pdu_copy_size %d\n",
*sizeP - test_pdu_copy_size, *sizeP,
test_pdu_copy_size);
*sizeP = *sizeP - test_pdu_copy_size; *sizeP = *sizeP - test_pdu_copy_size;
//--------------------------------------------------------------- //---------------------------------------------------------------
...@@ -653,8 +668,8 @@ void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,u32_t frame) ...@@ -653,8 +668,8 @@ void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,u32_t frame)
rlc_am_start_timer_poll_retransmit(rlcP,frame); rlc_am_start_timer_poll_retransmit(rlcP,frame);
rlcP->stat_tx_data_pdu += 1; rlcP->stat_tx_data_pdu += 1;
rlcP->stat_tx_retransmit_pdu += 1; rlcP->stat_tx_retransmit_pdu += 1;
rlcP->stat_tx_data_bytes += (((struct mac_tb_req*)(pdu->data))->tb_size_in_bits >> 3); rlcP->stat_tx_data_bytes += ((struct mac_tb_req*)(pdu->data))->tb_size;
rlcP->stat_tx_retransmit_bytes += (((struct mac_tb_req*)(pdu->data))->tb_size_in_bits >> 3); rlcP->stat_tx_retransmit_bytes += ((struct mac_tb_req*)(pdu->data))->tb_size;
list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer); list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer);
return; return;
} }
...@@ -677,8 +692,8 @@ void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,u32_t frame) ...@@ -677,8 +692,8 @@ void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,u32_t frame)
rlc_am_start_timer_poll_retransmit(rlcP,frame); rlc_am_start_timer_poll_retransmit(rlcP,frame);
rlcP->stat_tx_data_pdu += 1; rlcP->stat_tx_data_pdu += 1;
rlcP->stat_tx_retransmit_pdu += 1; rlcP->stat_tx_retransmit_pdu += 1;
rlcP->stat_tx_data_bytes += (((struct mac_tb_req*)(pdu->data))->tb_size_in_bits >> 3); rlcP->stat_tx_data_bytes += ((struct mac_tb_req*)(pdu->data))->tb_size;
rlcP->stat_tx_retransmit_bytes += (((struct mac_tb_req*)(pdu->data))->tb_size_in_bits >> 3); rlcP->stat_tx_retransmit_bytes += ((struct mac_tb_req*)(pdu->data))->tb_size;
list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer); list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer);
return; return;
} else { } else {
......
...@@ -426,9 +426,9 @@ void rlc_am_segment_10 (rlc_am_entity_t *rlcP,u32_t frame) ...@@ -426,9 +426,9 @@ void rlc_am_segment_10 (rlc_am_entity_t *rlcP,u32_t frame)
rlcP->vt_s = (rlcP->vt_s+1) & RLC_AM_SN_MASK; rlcP->vt_s = (rlcP->vt_s+1) & RLC_AM_SN_MASK;
pdu_tb_req->data_ptr = (unsigned char*)pdu; pdu_tb_req->data_ptr = (unsigned char*)pdu;
pdu_tb_req->tb_size_in_bits = (data_pdu_size - pdu_remaining_size) << 3; pdu_tb_req->tb_size = data_pdu_size - pdu_remaining_size;
assert((pdu_tb_req->tb_size_in_bits >> 3) < 3000); assert(pdu_tb_req->tb_size < 3000);
rlc_am_pdu_polling(rlcP, frame,pdu, pdu_mngt->payload_size); rlc_am_pdu_polling(rlcP, frame,pdu, pdu_mngt->payload_size);
//list_add_tail_eurecom (pdu_mem, &rlcP->segmentation_pdu_list); //list_add_tail_eurecom (pdu_mem, &rlcP->segmentation_pdu_list);
......
...@@ -568,13 +568,13 @@ end_push_nack: ...@@ -568,13 +568,13 @@ end_push_nack:
#endif #endif
tb = get_free_mem_block(sizeof(struct mac_tb_req) + pdu_size); tb = get_free_mem_block(sizeof(struct mac_tb_req) + pdu_size);
memset(tb->data, 0, sizeof(struct mac_tb_req) + pdu_size); memset(tb->data, 0, sizeof(struct mac_tb_req) + pdu_size);
//estimation only ((struct mac_tb_req*)(tb->data))->tb_size_in_bits = pdu_size << 3; //estimation only ((struct mac_tb_req*)(tb->data))->tb_size = pdu_size;
((struct mac_tb_req*)(tb->data))->data_ptr = (u8_t*)&(tb->data[sizeof(struct mac_tb_req)]); ((struct mac_tb_req*)(tb->data))->data_ptr = (u8_t*)&(tb->data[sizeof(struct mac_tb_req)]);
// warning reuse of pdu_size // warning reuse of pdu_size
pdu_size = rlc_am_write_status_pdu(frame,(rlc_am_pdu_sn_10_t*)(((struct mac_tb_req*)(tb->data))->data_ptr), &control_pdu_info); pdu_size = rlc_am_write_status_pdu(frame,(rlc_am_pdu_sn_10_t*)(((struct mac_tb_req*)(tb->data))->data_ptr), &control_pdu_info);
((struct mac_tb_req*)(tb->data))->tb_size_in_bits = pdu_size << 3; ((struct mac_tb_req*)(tb->data))->tb_size = pdu_size;
//assert((((struct mac_tb_req*)(tb->data))->tb_size_in_bits >> 3) < 3000); //assert((((struct mac_tb_req*)(tb->data))->tb_size) < 3000);
#ifdef TRACE_STATUS_CREATION #ifdef TRACE_STATUS_CREATION
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][SEND-STATUS] SEND STATUS PDU SIZE %d, rlcP->nb_bytes_requested_by_mac %d, nb_bits_to_transmit>>3 %d\n", frame, rlcP->module_id, rlcP->rb_id, pdu_size, rlcP->nb_bytes_requested_by_mac, nb_bits_to_transmit >> 3); LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][SEND-STATUS] SEND STATUS PDU SIZE %d, rlcP->nb_bytes_requested_by_mac %d, nb_bits_to_transmit>>3 %d\n", frame, rlcP->module_id, rlcP->rb_id, pdu_size, rlcP->nb_bytes_requested_by_mac, nb_bits_to_transmit >> 3);
......
...@@ -112,7 +112,7 @@ rlc_tm_no_segment (rlc_tm_entity_t *rlcP) ...@@ -112,7 +112,7 @@ rlc_tm_no_segment (rlc_tm_entity_t *rlcP)
((struct mac_tb_req *) (pdu->data))->rlc = NULL; ((struct mac_tb_req *) (pdu->data))->rlc = NULL;
((struct mac_tb_req *) (pdu->data))->data_ptr = pdu_mngt->first_byte; ((struct mac_tb_req *) (pdu->data))->data_ptr = pdu_mngt->first_byte;
((struct mac_tb_req *) (pdu->data))->first_bit = 0; ((struct mac_tb_req *) (pdu->data))->first_bit = 0;
((struct mac_tb_req *) (pdu->data))->tb_size_in_bits = rlcP->rlc_pdu_size; ((struct mac_tb_req *) (pdu->data))->tb_size = rlcP->rlc_pdu_size >> 3;
list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer); list_add_tail_eurecom (pdu, &rlcP->pdus_to_mac_layer);
rlcP->buffer_occupancy -= (sdu_mngt->sdu_size >> 3); rlcP->buffer_occupancy -= (sdu_mngt->sdu_size >> 3);
...@@ -185,7 +185,7 @@ rlc_tm_mac_data_request (void *rlcP, u32_t frame) ...@@ -185,7 +185,7 @@ rlc_tm_mac_data_request (void *rlcP, u32_t frame)
tb = data_req.data.head; tb = data_req.data.head;
while (tb != NULL) { while (tb != NULL) {
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "%d Bytes ", rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "%d Bytes ",
((struct mac_tb_req *) (tb->data))->tb_size_in_bits>>3); ((struct mac_tb_req *) (tb->data))->tb_size);
tb = tb->next; tb = tb->next;
} }
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "BO=%d --->][MAC_%s][MOD %02d][]\n", rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "BO=%d --->][MAC_%s][MOD %02d][]\n",
......
...@@ -33,6 +33,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -33,6 +33,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#include "platform_types.h" #include "platform_types.h"
#include "platform_constants.h" #include "platform_constants.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
#include "assertions.h"
#include "rlc_um.h" #include "rlc_um.h"
#include "list.h" #include "list.h"
#include "rlc_primitives.h" #include "rlc_primitives.h"
...@@ -43,9 +47,12 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -43,9 +47,12 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#include "rlc_um_very_simple_test.h" #include "rlc_um_very_simple_test.h"
//#define DEBUG_RLC_UM_TX_STATUS 1 //#define DEBUG_RLC_UM_TX_STATUS 1
#define TRACE_RLC_UM_PDU 1
#ifdef TRACE_RLC_UM_PDU
char message_string[10000];
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_um_stat_req (rlc_um_entity_t *rlcP, void rlc_um_stat_req (rlc_um_entity_t *rlcP,
unsigned int* stat_tx_pdcp_sdu, unsigned int* stat_tx_pdcp_sdu,
...@@ -171,12 +178,19 @@ void ...@@ -171,12 +178,19 @@ void
rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP) rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_um_entity_t *l_rlc = (rlc_um_entity_t *) argP; rlc_um_entity_t *l_rlc_p = (rlc_um_entity_t *) argP;
mem_block_t *tb; #ifdef TRACE_RLC_UM_PDU
rlc_um_pdu_info_t pdu_info; mem_block_t *tb_p;
int num_li; s16_t tb_size_in_bytes;
size_t message_string_size = 0;
# if defined(ENABLE_ITTI)
MessageDef *msg_p;
# endif
rlc_um_pdu_info_t pdu_info;
int octet_index, index;
#endif
switch (l_rlc->protocol_state) { switch (l_rlc_p->protocol_state) {
case RLC_NULL_STATE: case RLC_NULL_STATE:
// from 3GPP TS 25.322 V9.2.0 p43 // from 3GPP TS 25.322 V9.2.0 p43
...@@ -186,19 +200,19 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP ...@@ -186,19 +200,19 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP
// establishment, the RLC entity: // establishment, the RLC entity:
// - is created; and // - is created; and
// - enters the DATA_TRANSFER_READY state. // - enters the DATA_TRANSFER_READY state.
LOG_N(RLC, "[RLC_UM][MOD %d] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", l_rlc->module_id); LOG_N(RLC, "[RLC_UM][MOD %d] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", l_rlc_p->module_id);
if (data_indP.data.nb_elements > 0) { /*if (data_indP.data.nb_elements > 0) {
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc->module_id, l_rlc->rb_id, frame, data_indP.data.nb_elements); LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame, data_indP.data.nb_elements);
rlc[l_rlc->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][MAC_%s][MOD %02d][][--- MAC_DATA_IND/ %d TB(s) ", rlc[l_rlc_p->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc_p->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][MAC_%s][MOD %02d][][--- MAC_DATA_IND/ %d TB(s) ",
frame, frame,
(l_rlc->is_enb) ? "eNB":"UE", (l_rlc_p->is_enb) ? "eNB":"UE",
l_rlc->module_id, l_rlc_p->module_id,
data_indP.data.nb_elements); data_indP.data.nb_elements);
tb = data_indP.data.head; tb = data_indP.data.head;
while (tb != NULL) { while (tb != NULL) {
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " SN %d %c%c%c %d Bytes ", rlc[l_rlc_p->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length], " SN %d %c%c%c %d Bytes ",
(((struct mac_tb_ind *) (tb->data))->data_ptr[1]) + (((u16_t)((((struct mac_tb_ind *) (tb->data))->data_ptr[0]) & 0x03)) << 8), (((struct mac_tb_ind *) (tb->data))->data_ptr[1]) + (((u16_t)((((struct mac_tb_ind *) (tb->data))->data_ptr[0]) & 0x03)) << 8),
(((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x10) ? '}':'{', (((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x10) ? '}':'{',
(((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x08) ? '{':'}', (((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x08) ? '{':'}',
...@@ -206,13 +220,13 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP ...@@ -206,13 +220,13 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP
((struct mac_tb_ind *) (tb->data))->size); ((struct mac_tb_ind *) (tb->data))->size);
tb = tb->next; tb = tb->next;
} }
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " DROPPED RLC NULL STATE ---X][RLC_UM][MOD %02d][RB %02d]\n", rlc[l_rlc_p->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length], " DROPPED RLC NULL STATE ---X][RLC_UM][MOD %02d][RB %02d]\n",
l_rlc->module_id, l_rlc_p->module_id,
l_rlc->rb_id); l_rlc_p->rb_id);
rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length] = 0; rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length] = 0;
LOG_D(RLC, "%s", rlc[l_rlc->module_id].m_mscgen_trace); LOG_D(RLC, "%s", rlc[l_rlc_p->module_id].m_mscgen_trace);
} }*/
list_free (&data_indP.data); list_free (&data_indP.data);
break; break;
...@@ -233,48 +247,75 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP ...@@ -233,48 +247,75 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP
// entity: // entity:
// - enters the LOCAL_SUSPEND state. // - enters the LOCAL_SUSPEND state.
data_indP.tb_size = data_indP.tb_size >> 3; data_indP.tb_size = data_indP.tb_size >> 3;
if (data_indP.data.nb_elements > 0) {
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc->module_id, l_rlc->rb_id, frame, data_indP.data.nb_elements);
rlc[l_rlc->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][MAC_%s][MOD %02d][][--- MAC_DATA_IND/ %d TB(s) ",
frame,
(l_rlc->is_enb) ? "eNB":"UE",
l_rlc->module_id,
data_indP.data.nb_elements);
tb = data_indP.data.head;
while (tb != NULL) {
rlc_um_get_pdu_infos(frame,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_ind *) (tb->data))->data_ptr, (s16_t) ((struct mac_tb_ind *) (tb->data))->size, &pdu_info);
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "\\nSN %d/%c%c%c",
pdu_info.sn,
(pdu_info.fi & 0x02) ? '}':'{',
(pdu_info.fi & 0x01) ? '}':'{',
(pdu_info.e) ? 'E':'_');
num_li = 0;
if (pdu_info.num_li > 0) {
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "/LI(");
while (num_li != (pdu_info.num_li - 1)) {
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "%d,",
pdu_info.li_list[num_li]);
num_li += 1;
}
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "%d)", pdu_info.li_list[num_li]);
}
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "/%d Bytes ",
((struct mac_tb_ind *) (tb->data))->size);
tb = tb->next; #ifdef TRACE_RLC_UM_PDU
if (data_indP.data.nb_elements > 0) {
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame, data_indP.data.nb_elements);
tb_p = data_indP.data.head;
while (tb_p != NULL) {
tb_size_in_bytes = ((struct mac_tb_ind *) (tb_p->data))->size;
rlc_um_get_pdu_infos(frame,(rlc_um_pdu_sn_10_t*) ((struct mac_tb_ind *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id);
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
if (pdu_info.e) {
message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
for (index=0; index < pdu_info.num_li; index++) {
message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
}
}
message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
if ((octet_index % 16) == 0){
if (octet_index != 0) {
message_string_size += sprintf(&message_string[message_string_size], " |\n");
}
message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
}
/*
* Print every single octet in hexadecimal form
*/
message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
/*
* Align newline and pipes according to the octets in groups of 2
*/
}
/*
* Append enough spaces and put final pipe
*/
for (index = octet_index; index < 16; ++index) {
message_string_size += sprintf(&message_string[message_string_size], " ");
}
message_string_size += sprintf(&message_string[message_string_size], " |\n");
# if defined(ENABLE_ITTI)
msg_p = itti_alloc_new_message_sized (l_rlc_p->is_enb > 0 ? TASK_RLC_ENB:TASK_RLC_UE , RLC_UM_DATA_PDU_IND, message_string_size + sizeof (IttiMsgText));
msg_p->ittiMsg.rlc_um_data_pdu_ind.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_um_data_pdu_ind.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
# else
LOG_T(RLC, "%s", message_string);
# endif
tb_p = tb_p->next;
} }
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " --->][RLC_UM][MOD %02d][RB %02d]\n",
l_rlc->module_id,
l_rlc->rb_id);
rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length] = 0;
LOG_D(RLC, "%s", rlc[l_rlc->module_id].m_mscgen_trace);
} }
#endif
rlc_um_receive (l_rlc, frame, eNB_flag, data_indP); rlc_um_receive (l_rlc_p, frame, eNB_flag, data_indP);
break; break;
case RLC_LOCAL_SUSPEND_STATE: case RLC_LOCAL_SUSPEND_STATE:
...@@ -294,18 +335,18 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP ...@@ -294,18 +335,18 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP
// - stays in the LOCAL_SUSPEND state; // - stays in the LOCAL_SUSPEND state;
// - modifies only the protocol parameters and timers as indicated by // - modifies only the protocol parameters and timers as indicated by
// upper layers. // upper layers.
LOG_N(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] RLC_LOCAL_SUSPEND_STATE\n", l_rlc->module_id, l_rlc->rb_id, frame); LOG_N(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] RLC_LOCAL_SUSPEND_STATE\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame);
if (data_indP.data.nb_elements > 0) { /*if (data_indP.data.nb_elements > 0) {
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc->module_id, l_rlc->rb_id, frame, data_indP.data.nb_elements); LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_IND %d TBs\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame, data_indP.data.nb_elements);
rlc[l_rlc->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][MAC_%s][MOD %02d][][--- MAC_DATA_IND/ %d TB(s) ", rlc[l_rlc_p->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc_p->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][MAC_%s][MOD %02d][][--- MAC_DATA_IND/ %d TB(s) ",
frame, frame,
(l_rlc->is_enb) ? "eNB":"UE", (l_rlc_p->is_enb) ? "eNB":"UE",
l_rlc->module_id, l_rlc_p->module_id,
data_indP.data.nb_elements); data_indP.data.nb_elements);
tb = data_indP.data.head; tb = data_indP.data.head;
while (tb != NULL) { while (tb != NULL) {
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " SN %d %c%c%c %d Bytes ", rlc[l_rlc_p->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length], " SN %d %c%c%c %d Bytes ",
(((struct mac_tb_ind *) (tb->data))->data_ptr[1]) + (((u16_t)((((struct mac_tb_ind *) (tb->data))->data_ptr[0]) & 0x03)) << 8), (((struct mac_tb_ind *) (tb->data))->data_ptr[1]) + (((u16_t)((((struct mac_tb_ind *) (tb->data))->data_ptr[0]) & 0x03)) << 8),
(((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x10) ? '}':'{', (((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x10) ? '}':'{',
(((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x08) ? '{':'}', (((struct mac_tb_ind *) (tb->data))->data_ptr[0] & 0x08) ? '{':'}',
...@@ -313,18 +354,18 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP ...@@ -313,18 +354,18 @@ rlc_um_rx (void *argP, u32_t frame, u8_t eNB_flag, struct mac_data_ind data_indP
((struct mac_tb_ind *) (tb->data))->size); ((struct mac_tb_ind *) (tb->data))->size);
tb = tb->next; tb = tb->next;
} }
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " DROPPED RLC LOCAL SUSPEND STATE ---X][RLC_UM][MOD %02d][RB %02d]\n", rlc[l_rlc_p->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length], " DROPPED RLC LOCAL SUSPEND STATE ---X][RLC_UM][MOD %02d][RB %02d]\n",
l_rlc->module_id, l_rlc_p->module_id,
l_rlc->rb_id); l_rlc_p->rb_id);
rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length] = 0; rlc[l_rlc_p->module_id].m_mscgen_trace[rlc[l_rlc_p->module_id].m_mscgen_trace_length] = 0;
LOG_D(RLC, "%s", rlc[l_rlc->module_id].m_mscgen_trace); LOG_D(RLC, "%s", rlc[l_rlc_p->module_id].m_mscgen_trace);
} }*/
list_free (&data_indP.data); list_free (&data_indP.data);
break; break;
default: default:
LOG_E(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] TX UNKNOWN PROTOCOL STATE %02X hex\n", l_rlc->module_id, l_rlc->rb_id, frame, l_rlc->protocol_state); LOG_E(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] TX UNKNOWN PROTOCOL STATE %02X hex\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame, l_rlc_p->protocol_state);
} }
} }
...@@ -399,48 +440,108 @@ rlc_um_mac_status_indication (void *rlcP, u32_t frame, u8_t eNB_flag, u16_t tbs_ ...@@ -399,48 +440,108 @@ rlc_um_mac_status_indication (void *rlcP, u32_t frame, u8_t eNB_flag, u16_t tbs_
struct mac_data_req struct mac_data_req
rlc_um_mac_data_request (void *rlcP,u32 frame) rlc_um_mac_data_request (void *rlcP,u32 frame)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct mac_data_req data_req; struct mac_data_req data_req;
rlc_um_entity_t *l_rlc = (rlc_um_entity_t *) rlcP; s16_t tb_size_in_bytes;
mem_block_t *tb_p;
#ifdef TRACE_RLC_UM_PDU
size_t message_string_size = 0;
# if defined(ENABLE_ITTI)
MessageDef *msg_p;
# endif
rlc_um_pdu_info_t pdu_info;
int octet_index, index;
#endif
rlc_um_entity_t *l_rlc_p = (rlc_um_entity_t *) rlcP;
rlc_um_get_pdus (rlcP,frame); rlc_um_get_pdus (rlcP,frame);
list_init (&data_req.data, NULL); list_init (&data_req.data, NULL);
list_add_list (&l_rlc->pdus_to_mac_layer, &data_req.data); list_add_list (&l_rlc_p->pdus_to_mac_layer, &data_req.data);
data_req.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (l_rlc); data_req.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (l_rlc_p);
if (data_req.buffer_occupancy_in_bytes > 0) { if (data_req.buffer_occupancy_in_bytes > 0) {
data_req.buffer_occupancy_in_bytes += l_rlc->tx_header_min_length_in_bytes; data_req.buffer_occupancy_in_bytes += l_rlc_p->tx_header_min_length_in_bytes;
} }
data_req.rlc_info.rlc_protocol_state = l_rlc->protocol_state; data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state;
if (data_req.data.nb_elements > 0) { if (data_req.data.nb_elements > 0) {
//LOG_I(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_REQUEST %d TBs\n", l_rlc->module_id, l_rlc->rb_id, frame, data_req.data.nb_elements); //LOG_I(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_REQUEST %d TBs\n", l_rlc_p->module_id, l_rlc_p->rb_id, frame, data_req.data.nb_elements);
mem_block_t *tb;
rlc[l_rlc->module_id].m_mscgen_trace_length = sprintf(rlc[l_rlc->module_id].m_mscgen_trace, "[MSC_MSG][FRAME %05d][RLC_UM][MOD %02d][RB %02d][--- MAC_DATA_REQ/ %d TB(s) ", tb_p = data_req.data.head;
frame, while (tb_p != NULL) {
l_rlc->module_id, tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size;
l_rlc->rb_id,
data_req.data.nb_elements); LOG_I(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] MAC_DATA_REQUEST TB SIZE %u\n",
l_rlc_p->module_id,
tb = data_req.data.head; l_rlc_p->rb_id,
while (tb != NULL) { frame,
l_rlc->stat_tx_data_pdu += 1; ((struct mac_tb_req *) (tb_p->data))->tb_size);
l_rlc->stat_tx_data_bytes += ((struct mac_tb_req *) (tb->data))->tb_size_in_bits>>3; l_rlc_p->stat_tx_data_pdu += 1;
l_rlc_p->stat_tx_data_bytes += tb_size_in_bytes;
rlc[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], " SN %d %d Bytes ",
(((struct mac_tb_req *) (tb->data))->data_ptr[1]) + (((u16_t)((((struct mac_tb_req *) (tb->data))->data_ptr[0]) & 0x03)) << 8), AssertFatal( tb_size_in_bytes > 0 , "RLC UM PDU LENGTH %d", tb_size_in_bytes);
((struct mac_tb_req *) (tb->data))->tb_size_in_bits>>3);
tb = tb->next; #ifdef TRACE_RLC_UM_PDU
} rlc_um_get_pdu_infos(frame,(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[l_rlc->module_id].m_mscgen_trace_length += sprintf(&rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length], "BO=%d --->][MAC_%s][MOD %02d][]\n", message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", l_rlc_p->rb_id);
data_req.buffer_occupancy_in_bytes, message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
(l_rlc->is_enb) ? "eNB":"UE", message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
l_rlc->module_id); message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
rlc[l_rlc->module_id].m_mscgen_trace[rlc[l_rlc->module_id].m_mscgen_trace_length] = 0; message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
LOG_D(RLC, "%s", rlc[l_rlc->module_id].m_mscgen_trace);
} message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
return data_req; message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
if (pdu_info.e) {
message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
for (index=0; index < pdu_info.num_li; index++) {
message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
}
}
message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
if ((octet_index % 16) == 0){
if (octet_index != 0) {
message_string_size += sprintf(&message_string[message_string_size], " |\n");
}
message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
}
/*
* Print every single octet in hexadecimal form
*/
message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
/*
* Align newline and pipes according to the octets in groups of 2
*/
}
/*
* Append enough spaces and put final pipe
*/
for (index = octet_index; index < 16; ++index) {
message_string_size += sprintf(&message_string[message_string_size], " ");
}
message_string_size += sprintf(&message_string[message_string_size], " |\n");
# if defined(ENABLE_ITTI)
msg_p = itti_alloc_new_message_sized (l_rlc_p->is_enb > 0 ? TASK_RLC_ENB:TASK_RLC_UE , RLC_UM_DATA_PDU_REQ, message_string_size + sizeof (IttiMsgText));
msg_p->ittiMsg.rlc_um_data_pdu_req.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_um_data_pdu_req.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
# else
LOG_T(RLC, "%s", message_string);
# endif
#endif
tb_p = tb_p->next;
}
}
return data_req;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -43,7 +43,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -43,7 +43,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
//#define DEBUG_RLC_UM_RX //#define DEBUG_RLC_UM_RX
//#define DEBUG_DISPLAY_NVIDIA //#define DEBUG_DISPLAY_NVIDIA
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_um_pdu_info_t* pdu_infoP) signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_um_pdu_info_t* pdu_infoP, u8_t sn_lengthP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
memset(pdu_infoP, 0, sizeof (rlc_um_pdu_info_t)); memset(pdu_infoP, 0, sizeof (rlc_um_pdu_info_t));
...@@ -51,21 +51,31 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t ...@@ -51,21 +51,31 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t
s16_t sum_li = 0; s16_t sum_li = 0;
pdu_infoP->num_li = 0; pdu_infoP->num_li = 0;
AssertFatal( total_sizeP > 0 , "RLC UM PDU LENGTH %d", total_sizeP);
if (sn_lengthP == 10) {
pdu_infoP->fi = (headerP->b1 >> 3) & 0x03;
pdu_infoP->e = (headerP->b1 >> 2) & 0x01;
pdu_infoP->sn = headerP->b2 + (((u16_t)(headerP->b1 & 0x03)) << 8);
pdu_infoP->header_size = 2;
pdu_infoP->payload = &headerP->data[0];
} else if (sn_lengthP == 5) {
pdu_infoP->fi = (headerP->b1 >> 6) & 0x03;
pdu_infoP->e = (headerP->b1 >> 5) & 0x01;
pdu_infoP->sn = headerP->b1 & 0x1F;
pdu_infoP->header_size = 1;
pdu_infoP->payload = &headerP->b2;
} else {
AssertFatal( sn_lengthP == 5 || sn_lengthP == 10, "RLC UM SN LENGTH %d", sn_lengthP);
}
pdu_infoP->fi = (headerP->b1 >> 3) & 0x03;
pdu_infoP->e = (headerP->b1 >> 2) & 0x01;
pdu_infoP->sn = headerP->b2 + (((u16_t)(headerP->b1 & 0x03)) << 8);
pdu_infoP->header_size = 2;
pdu_infoP->payload = &headerP->data[0];
if (pdu_infoP->e) { if (pdu_infoP->e) {
rlc_am_e_li_t *e_li; rlc_am_e_li_t *e_li;
unsigned int li_length_in_bytes = 1; unsigned int li_length_in_bytes = 1;
unsigned int li_to_read = 1; unsigned int li_to_read = 1;
e_li = (rlc_am_e_li_t*)(headerP->data); e_li = (rlc_am_e_li_t*)(pdu_infoP->payload);
while (li_to_read) { while (li_to_read) {
li_length_in_bytes = li_length_in_bytes ^ 3; li_length_in_bytes = li_length_in_bytes ^ 3;
...@@ -85,10 +95,10 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t ...@@ -85,10 +95,10 @@ signed int rlc_um_get_pdu_infos(u32_t frame,rlc_um_pdu_sn_10_t* headerP, s16_t t
e_li++; e_li++;
pdu_infoP->header_size += 1; pdu_infoP->header_size += 1;
} }
AssertFatal( pdu_infoP->num_li >= RLC_AM_MAX_SDU_IN_PDU, "[FRAME %05d][RLC_UM][MOD XX][RB XX][GET PDU INFO] SN %04d TOO MANY LIs ", frame, pdu_infoP->sn); AssertFatal( pdu_infoP->num_li <= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU, "[FRAME %05d][RLC_UM][MOD XX][RB XX][GET PDU INFO] SN %04d TOO MANY LIs ", frame, pdu_infoP->sn);
sum_li += pdu_infoP->li_list[pdu_infoP->num_li]; sum_li += pdu_infoP->li_list[pdu_infoP->num_li];
pdu_infoP->num_li = pdu_infoP->num_li + 1; pdu_infoP->num_li = pdu_infoP->num_li + 1;
if (pdu_infoP->num_li > RLC_AM_MAX_SDU_IN_PDU) { if (pdu_infoP->num_li > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
return -2; return -2;
} }
} }
......
...@@ -68,9 +68,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -68,9 +68,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
* \param[in] headerP RLC UM header PDU pointer. * \param[in] headerP RLC UM header PDU pointer.
* \param[in] total_sizeP Size of RLC UM PDU. * \param[in] total_sizeP Size of RLC UM PDU.
* \param[in] pdu_infoP Structure containing extracted informations from PDU. * \param[in] pdu_infoP Structure containing extracted informations from PDU.
* \param[in] sn_lengthP Sequence number length in bits in PDU header (5 or 10).
* \return 0 if no error was encountered during the parsing of the PDU, else -1; * \return 0 if no error was encountered during the parsing of the PDU, else -1;
*/ */
protected_rlc_um_dar( signed int rlc_um_get_pdu_infos(u32_t frame, rlc_um_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_um_pdu_info_t* pdu_infoP)); protected_rlc_um_dar( signed int rlc_um_get_pdu_infos(u32_t frame, rlc_um_pdu_sn_10_t* headerP, s16_t total_sizeP, rlc_um_pdu_info_t* pdu_infoP, u8_t sn_lengthP));
/*! \fn int rlc_um_read_length_indicators(unsigned char**dataP, rlc_um_e_li_t* e_liP, unsigned int* li_arrayP, unsigned int *num_liP, unsigned int *data_sizeP) /*! \fn int rlc_um_read_length_indicators(unsigned char**dataP, rlc_um_e_li_t* e_liP, unsigned int* li_arrayP, unsigned int *num_liP, unsigned int *data_sizeP)
* \brief Reset protocol variables and state variables to initial values. * \brief Reset protocol variables and state variables to initial values.
......
...@@ -35,6 +35,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -35,6 +35,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#ifdef USER_MODE #ifdef USER_MODE
#include <assert.h> #include <assert.h>
#endif #endif
#include "assertions.h"
#include "list.h" #include "list.h"
#include "rlc_um.h" #include "rlc_um.h"
#include "rlc_primitives.h" #include "rlc_primitives.h"
...@@ -202,7 +203,17 @@ rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame) ...@@ -202,7 +203,17 @@ rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame)
if (sdu_mngt->sdu_remaining_size > pdu_remaining_size) { if (sdu_mngt->sdu_remaining_size > pdu_remaining_size) {
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SEGMENT10 Filling all remaining PDU with %d bytes\n", rlcP->module_id, rlcP->rb_id, frame, pdu_remaining_size); LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SEGMENT10 Filling all remaining PDU with %d bytes\n", rlcP->module_id, rlcP->rb_id, frame, pdu_remaining_size);
LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SEGMENT10 pdu_mem %p pdu %p pdu->data %p data %p data_sdu %p pdu_remaining_size %d\n", rlcP->module_id, rlcP->rb_id, frame, pdu_mem, pdu, pdu->data, data, data_sdu,pdu_remaining_size); LOG_D(RLC, "[RLC_UM][MOD %d][RB %d][FRAME %05d] SEGMENT10 pdu_mem %p pdu_mem->data %p pdu %p pdu->data %p data %p data_sdu %p pdu_remaining_size %d\n",
rlcP->module_id,\
rlcP->rb_id,
frame,
pdu_mem,
pdu_mem->data,
pdu,
pdu->data,
data,
data_sdu,
pdu_remaining_size);
memcpy(data, data_sdu, pdu_remaining_size); memcpy(data, data_sdu, pdu_remaining_size);
sdu_mngt->sdu_remaining_size = sdu_mngt->sdu_remaining_size - pdu_remaining_size; sdu_mngt->sdu_remaining_size = sdu_mngt->sdu_remaining_size - pdu_remaining_size;
...@@ -306,9 +317,10 @@ rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame) ...@@ -306,9 +317,10 @@ rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame)
rlcP->vt_us = rlcP->vt_us+1; rlcP->vt_us = rlcP->vt_us+1;
pdu_tb_req->data_ptr = (unsigned char*)pdu; pdu_tb_req->data_ptr = (unsigned char*)pdu;
pdu_tb_req->tb_size_in_bits = (data_pdu_size - pdu_remaining_size) << 3; pdu_tb_req->tb_size = data_pdu_size - pdu_remaining_size;
list_add_tail_eurecom (pdu_mem, &rlcP->pdus_to_mac_layer); list_add_tail_eurecom (pdu_mem, &rlcP->pdus_to_mac_layer);
//rlc_util_print_hex_octets(RLC, pdu_mem->data, data_pdu_size); //rlc_util_print_hex_octets(RLC, pdu_mem->data, data_pdu_size);
AssertFatal( pdu_tb_req->tb_size > 0 , "SEGMENT10: FINAL RLC UM PDU LENGTH %d", pdu_tb_req->tb_size);
pdu = NULL; pdu = NULL;
pdu_mem = NULL; pdu_mem = NULL;
...@@ -580,9 +592,12 @@ rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame) ...@@ -580,9 +592,12 @@ rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame)
rlcP->vt_us = rlcP->vt_us+1; rlcP->vt_us = rlcP->vt_us+1;
pdu_tb_req->data_ptr = (unsigned char*)pdu; pdu_tb_req->data_ptr = (unsigned char*)pdu;
pdu_tb_req->tb_size_in_bits = (data_pdu_size - pdu_remaining_size) << 3; pdu_tb_req->tb_size = data_pdu_size - pdu_remaining_size;
list_add_tail_eurecom (pdu_mem, &rlcP->pdus_to_mac_layer); list_add_tail_eurecom (pdu_mem, &rlcP->pdus_to_mac_layer);
rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem->data, data_pdu_size); rlc_util_print_hex_octets(RLC, (unsigned char*)pdu_mem->data, data_pdu_size);
AssertFatal( pdu_tb_req->tb_size > 0 , "SEGMENT5: FINAL RLC UM PDU LENGTH %d", pdu_tb_req->tb_size);
pdu = NULL; pdu = NULL;
pdu_mem = NULL; pdu_mem = NULL;
......
...@@ -5,33 +5,33 @@ ...@@ -5,33 +5,33 @@
#ifndef __MAC_PRIMITIVES_H__ #ifndef __MAC_PRIMITIVES_H__
# define __MAC_PRIMITIVES_H__ # define __MAC_PRIMITIVES_H__
#warning including mac_primitives.h /#warning including mac_primitives.h
//
# include "platform_types.h" //# include "platform_types.h"
# include "platform_constants.h" //# include "platform_constants.h"
# include "list.h" //# include "list.h"
# include "mem_block.h" //# include "mem_block.h"
//
# define MAC_DCCH 0xCC //# define MAC_DCCH 0xCC
# define MAC_DTCH 0xDC //# define MAC_DTCH 0xDC
//---------------------------------------------------------- ////----------------------------------------------------------
// primitives //// primitives
//---------------------------------------------------------- ////----------------------------------------------------------
# define MAC_DATA_REQ 0x01 //# define MAC_DATA_REQ 0x01
# define MAC_DATA_IND 0x02 //# define MAC_DATA_IND 0x02
# define MAC_STATUS_IND 0x04 //# define MAC_STATUS_IND 0x04
# define MAC_STATUS_RESP 0x08 //# define MAC_STATUS_RESP 0x08
//---------------------------------------------------------- ////----------------------------------------------------------
// primitives definition //// primitives definition
//---------------------------------------------------------- ////----------------------------------------------------------
# define UE_ID_TYPE_U_RNTI 0xFF //# define UE_ID_TYPE_U_RNTI 0xFF
// should not be used ? // // should not be used ?
# define UE_ID_TYPE_C_RNTI 0xCC //# define UE_ID_TYPE_C_RNTI 0xCC
//
# define MAC_TX_STATUS_SUCCESSFUL 0x0F //# define MAC_TX_STATUS_SUCCESSFUL 0x0F
# define MAC_TX_STATUS_UNSUCCESSFUL 0xF0 //# define MAC_TX_STATUS_UNSUCCESSFUL 0xF0
//
# define MAC_HEADER_MAX_SIZE 6 //# define MAC_HEADER_MAX_SIZE 6
// from 3GPP TS 25.321 V4.2.0 // from 3GPP TS 25.321 V4.2.0
// MAC-DATA-Req/Ind: // MAC-DATA-Req/Ind:
// - MAC-DATA-Req primitive is used to request that an upper layer PDU be sent using the // - MAC-DATA-Req primitive is used to request that an upper layer PDU be sent using the
...@@ -97,209 +97,100 @@ ...@@ -97,209 +97,100 @@
// on its mode and the amount of data that could be transmitted at the next TTI. This primitive // on its mode and the amount of data that could be transmitted at the next TTI. This primitive
// is meant to insure that MAC can perform TFC selection. // is meant to insure that MAC can perform TFC selection.
#ifdef USER_MODE //#ifdef USER_MODE
struct rlc_entity_info { //struct rlc_entity_info {
u8_t rlc_protocol_state; // u8_t rlc_protocol_state;
}; //};
//
struct mac_tx_tb_management { //struct mac_tx_tb_management {
// BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tb_req // // BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tb_req
u8_t *data_ptr; // u8_t *data_ptr;
u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc. // u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc.
// Previously designed for interlayers optimizations, (avoid aligning on byte boundary) // // Previously designed for interlayers optimizations, (avoid aligning on byte boundary)
// but not used by L1 !, so extra cost for alignement in MAC. // // but not used by L1 !, so extra cost for alignement in MAC.
u16_t tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte // u16_t tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte
// align the tb we have to know its size // // align the tb we have to know its size
//
// for reporting tx status to upper layers // // for reporting tx status to upper layers
void *rlc; // void *rlc;
void (*rlc_callback) (void *rlcP, u16_t rlc_tb_type); // void (*rlc_callback) (void *rlcP, u16_t rlc_tb_type);
u16_t rlc_tb_type; // u16_t rlc_tb_type;
//
u16_t log_ch_interface_src; // index of the logical channel interface from which the tb was submitted // u16_t log_ch_interface_src; // index of the logical channel interface from which the tb was submitted
u8_t mac_header[MAC_HEADER_MAX_SIZE]; // worst case : tctf(5bits)+UE-Id type(2bits)+UE-Id(16 or 32bits)+C/T(4bits)=43bits max // u8_t mac_header[MAC_HEADER_MAX_SIZE]; // worst case : tctf(5bits)+UE-Id type(2bits)+UE-Id(16 or 32bits)+C/T(4bits)=43bits max
}; //};
//
struct mac_rx_tb_management { //struct mac_rx_tb_management {
u8_t *data_ptr; // u8_t *data_ptr;
u16_t tb_size; // in bits // u16_t tb_size; // in bits
u8_t valid_checksum; // u8_t valid_checksum;
u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc // u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
}; //};
//
struct mac_tb_req { //struct mac_tb_req {
// BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management // // BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management
u8_t *data_ptr; // u8_t *data_ptr;
u8_t first_bit; // u8_t first_bit;
u16_t tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte // u16_t tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte
// align the tb we have to know its size // // align the tb we have to know its size
//
// for reporting tx status to upper layers // // for reporting tx status to upper layers
void *rlc; // void *rlc;
void (*rlc_callback) (void *rlcP, u16_t rlc_tb_type); // void (*rlc_callback) (void *rlcP, u16_t rlc_tb_type);
u16_t rlc_tb_type; // u16_t rlc_tb_type;
//
u8_t mac_header[MAC_HEADER_MAX_SIZE]; // worst case : tctf(5bits)+UE-Id type(2bits)+UE-Id(16 or 32bits)+C/T(4bits)=43bits max // u8_t mac_header[MAC_HEADER_MAX_SIZE]; // worst case : tctf(5bits)+UE-Id type(2bits)+UE-Id(16 or 32bits)+C/T(4bits)=43bits max
}; //};
//
struct mac_status_ind { //struct mac_status_ind {
u16_t no_pdu; // u16_t no_pdu;
u16_t tx_status; // successful, unsuccessful // u16_t tx_status; // successful, unsuccessful
}; //};
//
struct mac_tb_ind { //struct mac_tb_ind {
u8_t *data_ptr; // u8_t *data_ptr;
u16_t size; // u16_t size;
u8_t error_indication; // u8_t error_indication;
//u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc // //u8_t first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
}; //};
//--------------------- ////---------------------
struct mac_data_req { //struct mac_data_req {
list_t data; // list_t data;
u32_t buffer_occupancy_in_bytes; // u32_t buffer_occupancy_in_bytes;
u16_t buffer_occupancy_in_pdus; // u16_t buffer_occupancy_in_pdus;
struct rlc_entity_info rlc_info; // struct rlc_entity_info rlc_info;
u8_t ue_id_type_indicator; // u8_t ue_id_type_indicator;
}; //};
//--------------------- ////---------------------
struct mac_data_ind { //struct mac_data_ind {
list_t data; // list_t data;
u16_t no_tb; // u16_t no_tb;
u16_t tb_size; // in bits // u16_t tb_size; // in bits
//u8_t error_indication; // //u8_t error_indication;
//u8_t rx_timing_deviation; // //u8_t rx_timing_deviation;
}; //};
//--------------------- ////---------------------
struct mac_status_resp { //struct mac_status_resp {
u32_t buffer_occupancy_in_bytes; // u32_t buffer_occupancy_in_bytes;
u32_t buffer_occupancy_in_pdus; // u32_t buffer_occupancy_in_pdus;
struct rlc_entity_info rlc_info; // struct rlc_entity_info rlc_info;
}; //};
//--------------------- ////---------------------
struct mac_primitive { //struct mac_primitive {
u8_t primitive_type; // u8_t primitive_type;
union { // union {
struct mac_data_req data_req; // struct mac_data_req data_req;
struct mac_status_resp status_resp; // struct mac_status_resp status_resp;
struct mac_data_ind data_ind; // struct mac_data_ind data_ind;
//struct mac_status_ind status_ind; // //struct mac_status_ind status_ind;
} primitive; // } primitive;
}; //};
#endif //USER_MODE #endif //USER_MODE
typedef u8_t transport_format_id_t;
typedef u32_t transport_block_size_bit_t;
typedef u8_t flow_id_t;
# ifdef BYPASS_L1
// in bytes
#define MAC_BYPASS_TB_MAX_SIZE 100
typedef struct mac_bypass_flow_info_t {
u8_t flow_id __attribute__ ((packed));
transport_format_id_t transport_format __attribute__ ((packed));
u8_t num_transport_blocks __attribute__ ((packed));
transport_block_size_bit_t transport_block_size __attribute__ ((packed));
}mac_bypass_flow_info_t;
/*
typedef struct mac_bypass_cell_info_t {
u8_t num_cells;
rg_id_t cells_id_list[MAC_BYPASS_MAX_CELLS];
}mac_bypass_cell_info_t;
typedef struct mac_bypass_mobile_info_t {
mobile_id_t mobile_id;
}mac_bypass_mobile_info_t;
typedef struct mac_bypass_flows_info_t {
u8_t num_flows;
}mac_bypass_flows_info_t;
typedef struct mac_bypass_flow_info_t {
u8_t flow_id __attribute__ ((packed));
transport_format_id_t transport_format __attribute__ ((packed));
u8_t num_transport_blocks __attribute__ ((packed));
transport_block_size_bit_t transport_block_size __attribute__ ((packed));
}mac_bypass_flow_info_t;
typedef struct mac_bypass_rg_msg_data_header_t {
mac_bypass_cell_info_t cell_info __attribute__ ((packed));
mac_bypass_flows_info_t flows_info __attribute__ ((packed));
} mac_bypass_rg_msg_data_header_t;
typedef struct mac_bypass_rg_msg_cx_resp_header_t {
mac_bypass_random_ue_id_t random_ue_id __attribute__ ((packed));
mac_bypass_ue_id_t ue_id __attribute__ ((packed));
} mac_bypass_rg_msg_cx_resp_header_t;
typedef struct mac_bypass_rg_msg_header_t {
mac_bypass_message_type_t message_type __attribute__ ((packed));
union {
mac_bypass_rg_msg_data_header_t data_header;
mac_bypass_rg_msg_cx_resp_header_t cx_resp_header;
} select;
} mac_bypass_rg_msg_header_t;
typedef struct mac_bypass_mt_msg_data_header_t {
mac_bypass_mobile_info_t mobile_info __attribute__ ((packed));
mac_bypass_flows_info_t flows_info __attribute__ ((packed));
} mac_bypass_mt_msg_data_header_t;
typedef struct mac_bypass_mt_msg_cx_req_header_t {
mac_bypass_random_ue_id_t random_ue_id __attribute__ ((packed));
} mac_bypass_mt_msg_cx_req_header_t;
typedef struct mac_bypass_mt_msg_header_t {
mac_bypass_message_type_t message_type __attribute__ ((packed));
union {
mac_bypass_mt_msg_data_header_t data_header;
mac_bypass_mt_msg_cx_req_header_t cx_req_header;
} select;
} mac_bypass_mt_msg_header_t;
*/
/*
// List element of TrCh Blocks data
struct Bypass_TrChBlk_MAC_Interface {
u8_t first_bit; // First valid Bit in first word. 0 if word is full
u8_t valid_checksum; // 1 if valid checksum (receive only)
u8_t peer_trch_id;
u32_t data_start_index;
u8_t data[100];
};
struct Bypass_TrChData_MAC_Interface {
u16_t tf;
u8_t nb_blocks;
u8_t updated;
struct Bypass_TrChBlk_MAC_Interface tb[32];
};
struct Bypass_L1 {
struct Bypass_TrChData_MAC_Interface ul_trch[JRRM_MAX_TRCH_RG]; // MT write data here. RG read here, index are rg trch ids
struct Bypass_TrChData_MAC_Interface dl_trch[JRRM_MAX_TRCH_RG]; // RG write data here. MT read here,
u8_t mt_ack[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t rg_ack[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t mt_wrote[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t rg_wrote[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t num_mobiles;
u8_t join_request; // act as boolean
u8_t detach_request; // act as boolean
u8_t join_requests[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t join_acks[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t detach_requests[JRRM_MAX_MANAGED_MOBILES_PER_RG];
u8_t detach_acks[JRRM_MAX_MANAGED_MOBILES_PER_RG];
};
*/
# endif # endif
#endif #endif
...@@ -67,7 +67,7 @@ tbs_size_t mac_rlc_serialize_tb (char* bufferP, list_t transport_blocksP) { ...@@ -67,7 +67,7 @@ tbs_size_t mac_rlc_serialize_tb (char* bufferP, list_t transport_blocksP) {
while (transport_blocksP.nb_elements > 0) { while (transport_blocksP.nb_elements > 0) {
tb = list_remove_head (&transport_blocksP); tb = list_remove_head (&transport_blocksP);
if (tb != NULL) { if (tb != NULL) {
tb_size = ((struct mac_tb_req *) (tb->data))->tb_size_in_bits>>3; tb_size = ((struct mac_tb_req *) (tb->data))->tb_size;
#ifdef DEBUG_MAC_INTERFACE #ifdef DEBUG_MAC_INTERFACE
LOG_T(RLC, "[MAC-RLC] DUMP TX PDU(%d bytes):\n", tb_size); LOG_T(RLC, "[MAC-RLC] DUMP TX PDU(%d bytes):\n", tb_size);
rlc_util_print_hex_octets(RLC, ((struct mac_tb_req *) (tb->data))->data_ptr, tb_size); rlc_util_print_hex_octets(RLC, ((struct mac_tb_req *) (tb->data))->data_ptr, tb_size);
......
...@@ -137,7 +137,7 @@ static int rrc_set_state (u8 Mod_id, Rrc_State_t state) { ...@@ -137,7 +137,7 @@ static int rrc_set_state (u8 Mod_id, Rrc_State_t state) {
} }
static int rrc_set_sub_state (u8 Mod_id, Rrc_Sub_State_t subState) { static int rrc_set_sub_state (u8 Mod_id, Rrc_Sub_State_t subState) {
#if (defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) #if (defined(ENABLE_ITTI) && (defined(ENABLE_USE_MME) || defined(ENABLE_RAL)))
switch (UE_rrc_inst[Mod_id].RrcState) { switch (UE_rrc_inst[Mod_id].RrcState) {
case RRC_STATE_INACTIVE: case RRC_STATE_INACTIVE:
AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST), AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST),
...@@ -3001,9 +3001,9 @@ void *rrc_ue_task(void *args_p) { ...@@ -3001,9 +3001,9 @@ void *rrc_ue_task(void *args_p) {
&PHY_MEAS_REPORT_IND(msg_p).threshold, &PHY_MEAS_REPORT_IND(msg_p).threshold,
sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).threshold)); sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).threshold));
memcpy(&RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param_type, memcpy(&RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param,
&PHY_MEAS_REPORT_IND(msg_p).link_param_type, &PHY_MEAS_REPORT_IND(msg_p).link_param,
sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param_type)); sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param));
itti_send_msg_to_task(TASK_RAL_UE, instance, message_p); itti_send_msg_to_task(TASK_RAL_UE, instance, message_p);
break; break;
......
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