fixed #320 issue

This commit is contained in:
bruno mongazon
2018-06-25 18:23:36 +02:00
parent 59b31dbb2d
commit b016bc229a
74 changed files with 36 additions and 4686 deletions
@@ -128,9 +128,7 @@ boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity)
* Update sequence numbering state and Hyper Frame Number if SN has already reached
* its max value (see 5.1 PDCP Data Transfer Procedures)
*/
#if 0
LOG_D(PDCP, "Advancing RX window...\n");
#endif
if (pdcp_entity->next_pdcp_rx_sn == pdcp_calculate_max_seq_num_for_given_size(pdcp_entity->seq_num_size)) {
pdcp_entity->next_pdcp_rx_sn = 0;
@@ -152,9 +150,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_
uint16_t reordering_window = 0;
#if 0
LOG_D(PDCP, "Incoming RX Sequence number is %04d\n", seq_num);
#endif
if (pdcp_is_seq_num_size_valid(pdcp_entity) == FALSE || pdcp_is_seq_num_valid(seq_num, pdcp_entity->seq_num_size) == FALSE) {
return FALSE;
@@ -165,9 +161,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_
* (and to build PDCP Control PDU for PDCP status report)
*/
if (pdcp_mark_current_pdu_as_received(seq_num, pdcp_entity) == TRUE) {
#if 0
LOG_I(PDCP, "Received sequence number successfuly marked\n");
#endif
} else {
LOG_W(PDCP, "Cannot mark received sequence number on the bitmap!\n");
}
@@ -192,13 +186,11 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_
// same the old next_pdcp_rx_sn to revert otherwise
pdcp_entity->next_pdcp_rx_sn_before_integrity = pdcp_entity->next_pdcp_rx_sn;
#if 0
if (seq_num != pdcp_entity->next_pdcp_rx_sn) {
LOG_D(PDCP,"Re-adjusting the sequence number to %d\n", seq_num);
}
#endif
//set Next_PDCP_RX_SN to the received PDCP SN +1 ;
pdcp_entity->next_pdcp_rx_sn = seq_num;
pdcp_advance_rx_window(pdcp_entity); // + 1, and check if it is larger than Maximum_PDCP_SN:
@@ -247,9 +239,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_
//set Next_PDCP_RX_SN to the received PDCP SN +1 ;
pdcp_entity->next_pdcp_rx_sn = seq_num;
pdcp_advance_rx_window(pdcp_entity); // + 1, anc check if it is larger than Maximum_PDCP_SN:
#if 0
LOG_D(PDCP,"Re-adjusting the sequence number to %d\n", seq_num);
#endif
} else if (seq_num < pdcp_entity->next_pdcp_rx_sn) {
// use COUNT based on RX_HFN and the received PDCP SN for deciphering the PDCP PDU;
pdcp_entity->rx_hfn_offset = 0;
@@ -311,12 +301,8 @@ boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entit
/*
* Set relevant bit
*/
#if 0
LOG_D(PDCP, "Marking %d. bit of %d. octet of status bitmap\n", (seq_num % 8) + 1, octet_index);
#endif
util_mark_nth_bit_of_octet(&pdcp_entity->missing_pdu_bitmap[octet_index], seq_num % 8);
#if 0
util_print_binary_representation((uint8_t*)"Current state of relevant octet: ", pdcp_entity->missing_pdu_bitmap[octet_index]);
#endif
return TRUE;
}