View | Details | Raw Unified | Return to bug 2731
Collapse All | Expand All

(-)lte-rlc-am-old.cc (-15 / +56 lines)
 Lines 2023-2047    Link Here 
2023
    {
2023
    {
2024
      NS_LOG_INFO ("txonBuffer and retxBuffer empty. Move PDUs up to = " << m_vtS.GetValue () - 1 << " to retxBuffer");
2024
      NS_LOG_INFO ("txonBuffer and retxBuffer empty. Move PDUs up to = " << m_vtS.GetValue () - 1 << " to retxBuffer");
2025
      uint16_t sn = 0;
2025
      uint16_t sn = 0;
2026
      for ( sn = m_vtA.GetValue(); sn < m_vtS.GetValue (); sn++ )
2026
      uint16_t acked =  m_vtA.GetValue();
2027
      uint16_t sent = m_vtS.GetValue ();
2028
      if(acked <= sent) //If no overflow, no change.
2027
        {
2029
        {
2028
          bool pduAvailable = m_txedBuffer.at (sn).m_pdu != 0;
2030
 		  for ( sn = m_vtA.GetValue(); sn < m_vtS.GetValue (); sn++ )
2029
2031
 			{
2030
           if ( pduAvailable )
2032
 			  bool pduAvailable = m_txedBuffer.at (sn).m_pdu != 0;
2031
             {
2033
2032
               NS_LOG_INFO ("Move PDU " << sn << " from txedBuffer to retxBuffer");
2034
 			   if ( pduAvailable )
2033
               m_retxBuffer.at (sn).m_pdu = m_txedBuffer.at (sn).m_pdu->Copy ();
2035
 				 {
2034
               m_retxBuffer.at (sn).m_retxCount = m_txedBuffer.at (sn).m_retxCount;
2036
 				   NS_LOG_INFO ("Move PDU " << sn << " from txedBuffer to retxBuffer");
2035
               m_retxBufferSize += m_retxBuffer.at (sn).m_pdu->GetSize ();
2037
 				   m_retxBuffer.at (sn).m_pdu = m_txedBuffer.at (sn).m_pdu->Copy ();
2036
2038
 				   m_retxBuffer.at (sn).m_retxCount = m_txedBuffer.at (sn).m_retxCount;
2037
               m_txedBufferSize -= m_txedBuffer.at (sn).m_pdu->GetSize ();
2039
 				   m_retxBufferSize += m_retxBuffer.at (sn).m_pdu->GetSize ();
2038
               m_txedBuffer.at (sn).m_pdu = 0;
2040
2039
               m_txedBuffer.at (sn).m_retxCount = 0;
2041
 				   m_txedBufferSize -= m_txedBuffer.at (sn).m_pdu->GetSize ();
2040
             }
2042
 				   m_txedBuffer.at (sn).m_pdu = 0;
2043
 				   m_txedBuffer.at (sn).m_retxCount = 0;
2044
 				 }
2045
 			 }
2046
         }
2047
       else//If overflow happened, we retransmit from acked sequence to 1023, then from 0 to sent sequence.
2048
         {
2049
 		   for ( sn = m_vtA.GetValue(); sn < 1024; sn++ )
2050
 		     {
2051
 			   bool pduAvailable = m_txedBuffer.at (sn).m_pdu != 0;
2052
2053
 			   if ( pduAvailable )
2054
 				 {
2055
 				   NS_LOG_INFO ("Move PDU " << sn << " from txedBuffer to retxBuffer");
2056
 				   m_retxBuffer.at (sn).m_pdu = m_txedBuffer.at (sn).m_pdu->Copy ();
2057
 				   m_retxBuffer.at (sn).m_retxCount = m_txedBuffer.at (sn).m_retxCount;
2058
 				   m_retxBufferSize += m_retxBuffer.at (sn).m_pdu->GetSize ();
2059
2060
 				   m_txedBufferSize -= m_txedBuffer.at (sn).m_pdu->GetSize ();
2061
 				   m_txedBuffer.at (sn).m_pdu = 0;
2062
 				   m_txedBuffer.at (sn).m_retxCount = 0;
2063
 				 }
2064
 			}
2065
2066
 		  for ( sn = 0; sn < m_vtS.GetValue (); sn++ )
2067
 			{
2068
 			  bool pduAvailable = m_txedBuffer.at (sn).m_pdu != 0;
2069
2070
 			   if ( pduAvailable )
2071
 				 {
2072
 				   NS_LOG_INFO ("Move PDU " << sn << " from txedBuffer to retxBuffer");
2073
 				   m_retxBuffer.at (sn).m_pdu = m_txedBuffer.at (sn).m_pdu->Copy ();
2074
 				   m_retxBuffer.at (sn).m_retxCount = m_txedBuffer.at (sn).m_retxCount;
2075
 				   m_retxBufferSize += m_retxBuffer.at (sn).m_pdu->GetSize ();
2076
2077
 				   m_txedBufferSize -= m_txedBuffer.at (sn).m_pdu->GetSize ();
2078
 				   m_txedBuffer.at (sn).m_pdu = 0;
2079
 				   m_txedBuffer.at (sn).m_retxCount = 0;
2080
 				 }
2081
 			}
2041
        }
2082
        }
2042
    }
2083
    }
2043
2084
2044
  DoReportBufferStatus ();  
2085
  DoReportBufferStatus ();
2045
}
2086
}
2046
2087
2047
2088

Return to bug 2731