AssertFatal(lcid_buffer_occupancy_new==UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],"LCID=%d RLC has BO %d bytes but MAC has stored %d bytes\n",
AssertFatal(lcid_buffer_occupancy_new<=UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],"LCID=%d RLC has more BO %d bytes than BSR = %d bytes\n",
AssertFatal(UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]>=sdu_lengths[num_sdus],"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
AssertFatal(sdu_lengths[num_sdus]<MAX_ULSCH_PAYLOAD_BYTES,"LCID=%d RLC PDU size = %d is too big\n",
lcid,sdu_lengths[num_sdus]);
AssertFatal(UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]>=sdu_lengths[num_sdus],"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
uint32_tpollByte_tab[PollByte_spare1]={25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,10000};// What is PollByte_kBinfinity??? 10000 for now
uint32_tpollByte_tab[PollByte_spare1]={25000,50000,75000,100000,125000,250000,375000,500000,750000,1000000,1250000,1500000,2000000,3000000,RLC_AM_POLL_BYTE_INFINITE};// PollByte_kBinfinity is chosen to 0xFFFFFFFF for now
if ((tx_data_pdu_management->retx_count >= 0) && (rlc_pP->nb_bytes_requested_by_mac < RLC_AM_MIN_SEGMENT_SIZE_REQUEST)) {
#if TRACE_RLC_AM_TX
msg ("[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BREAK LOOP ON RETRANSMISSION BECAUSE ONLY %d BYTES ALLOWED TO TRANSMIT BY MAC\n",ctxt_pP->frame, ((rlc_am_entity_t *) rlc_pP)->module_id,((rlc_am_entity_t *) rlc_pP)->rb_id, rlc_pP->nb_bytes_requested_by_mac);
// For eNB scheduler : Add Max RLC header size for new PDU
// For UE : do not add RLC header part to be compliant with BSR definition in 36.321
if(enb_flagP==ENB_FLAG_YES){
uint32_tmax_li_overhead=0;
uint32_theader_overhead=0;
if(rlc->nb_sdu_no_segmented>1){
/* This computation assumes there is no SDU with size greater than 2047 bytes, otherwise a new PDU must be built except for LI15 configuration from Rel12*/
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission.
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
* \param[in] enb_flagP eNB or UE flag indication.
* \return The maximum number of bytes that can be served by RLC instance to MAC.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] enb_flagP eNB or UE flag
* \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
boolean_tis_data_plane;/*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
rlc_buffer_occupancy_tsdu_buffer_occupancy;/*!< \brief Number of bytes of unsegmented SDUs. */
rlc_buffer_occupancy_tretransmission_buffer_occupancy;/*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
rlc_buffer_occupancy_tstatus_buffer_occupancy;/*!< \brief Number of bytes of control PDUs waiting for transmission. */
signedintnb_sdu;/*!< \brief Total number of valid rlc_am_tx_sdu_management_t in input_sdus[]. */
signedintnb_sdu_no_segmented;/*!< \brief Total number of SDUs not segmented and partially segmented. */
signedintnb_sdu_no_segmented;/*!< \brief Total number of SDUs not segmented and partially segmented. nb_sdu_no_segmented = next_sdu_index - current_sdu_index */
signedintnext_sdu_index;/*!< \brief Next SDU index in input_sdus array where for a new incoming SDU. */
signedintcurrent_sdu_index;/*!< \brief Current SDU index in input_sdus array to be segmented. */
signedintcurrent_sdu_index;/*!< \brief Current SDU index in input_sdus array to be segmented which is not segmented or partially segmented. */
rlc_am_tx_data_pdu_management_t*tx_data_pdu_buffer;/*!< \brief Transmission PDU data buffer. Used also for retransmissions */
signedintretrans_num_pdus;/*!< \brief Number of PDUs in the retransmission buffer. */
signedintretrans_num_bytes;/*!< \brief Number of bytes in the retransmission buffer. */
signedintretrans_num_bytes_to_retransmit;/*!< \brief Number of bytes in the retransmission buffer to be retransmitted. */
unsignedintnum_nack_so;/*!< \brief Number of segment offsets asked to be retransmitted by peer RLC entity. */
unsignedintnum_nack_sn;/*!< \brief Number of segment asked to be retransmitted by peer RLC entity. */
signedintretrans_num_bytes_to_retransmit;/*!< \brief Number of bytes in the retransmission buffer to be retransmitted. Only payload is taken into account */
boolean_tforce_poll;/*!< \brief force poll due to t_poll_retransmit time-out. */
uint16_tmax_retx_threshold;/*!< \brief This parameter is used by the transmitting side of each AM RLC entity to limit the number of retransmissions of an AMD PDU. */
uint16_tpoll_pdu;/*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollPDU PDUs. */
uint16_tpoll_byte;/*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollByte bytes. */
uint32_tpoll_byte;/*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollByte bytes. */
* \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] tb_pP RLC AM PDU embedded in a mem_block_t.
* \param[in] free_rlc_pdu Flag for freeing RLC AM PDU after reassembly.
* \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] snP Sequence number of the PDU that is negative acknowledged.
* \param[in] prev_nack_snP Sequence number of previous PDU that is negative acknowledged.
* \param[in] so_startP Start of the segment offset of the PDU that .
* \param[in] so_endP Transport blocks received from MAC layer.
* \return OK/KO
* \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
* \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU.
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",
/* This computation assumes there is no SDU with size greater than 2047 bytes, otherwise a new PDU must be built except for LI15 configuration from Rel12*/
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);
/* First ensure there is enough TBS for at least 1 SOStart/SOEnd, else break */
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",
LOG_D(RLC,PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK %04d NUM NACK %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
__LINE__,
control_pdu_info.ack_sn,
control_pdu_info.num_nack);
#endif
/* encode the control pdu */
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",
sdu_size_thole_so_start[RLC_AM_MAX_HOLES_REPORT_PER_PDU];/*!< \brief Array containing the start segment offsets for marking a hole (negative acknowledged area) in the PDU. */
sdu_size_thole_so_stop[RLC_AM_MAX_HOLES_REPORT_PER_PDU];/*!< \brief Array containing the stop segment offsets for marking a hole (negative acknowledged area) in the PDU. */
uint8_tnum_holes;/*!< \brief Number of registereg holes in hole_so_start[], hole_so_stop[]. */
uint8_tretx_hole_index;/*!< \brief Next index of registered holes to retransmit. */
sdu_size_theader_and_payload_size;/*!< \brief Size of the PDU in bytes, including header and payload. */
sdu_size_tpayload_size;/*!< \brief Size of the PDU payload in bytes. */
sdu_size_tretx_payload_size;/*!< \brief Size of the PDU payload to be retransmitted in bytes including all Segment portions. */
rlc_sn_tsn;/*!< \brief Sequence number of the PDU. */
sdu_size_tnack_so_start;/*!< \brief Lowest NACK start segment offset, must be set to 0 if global NACK. */
sdu_size_tnack_so_stop;/*!< \brief Highest NACK stop segment offset, must be set to data_size if global NACK */
sdu_size_tnack_so_stop;/*!< \brief Highest NACK stop segment offset, must be set to data_size - 1 if global NACK */
int8_tnb_sdus;/*!< \brief Number of sdu having segments in this pdu. */
int8_t
retx_count;/*!< \brief Counts the number of retransmissions of an AMD PDU (see subclause 5.2.1). There is one RETX_COUNT counter per PDU that needs to be retransmitted. there is one VT(DAT) for each PDU and it is incremented each time the PDU is transmitted. */
int8_tretx_count;/*!< \brief Counts the number of already occurred retransmissions of an AMD PDU (see subclause 5.2.1). */
int8_tretx_count_next;/*!< \brief Counts the number of already occurred retransmissions plus the latest pending one. */
pdu_management_flags_tflags;/*!< \brief PDU variables related to its retransmission. */
* \param[in] rlc_pP RLC UM protocol instance pointer.
* \param[in] enb_flagP eNB or UE flag.
* \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
* \brief Interface with MAC layer, deserialize the transport blocks sent by MAC, then map data indication to the RLC instance corresponding to the radio bearer identifier.
...
...
@@ -457,18 +458,31 @@ public_rlc_mac(tbs_size_t mac_rlc_data_req (const module_id_t, co
* \brief Interface with MAC layer, request and set the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
* \brief Interface with MAC layer, UE only: request and get the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
/* 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 */
AssertFatal(enb_flagP==FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n",channel_idP);