Commit b77694e8 authored by fnabet's avatar fnabet

main AM RX process PDU changes

parent dec41a2a
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
# define RLC_AM_SDU_CONTROL_BUFFER_SIZE 128 # define RLC_AM_SDU_CONTROL_BUFFER_SIZE 128
/** Size of the retransmission buffer (number of PDUs). */ /** Size of the retransmission buffer (number of PDUs). */
# define RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE RLC_AM_SN_MODULO # define RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE RLC_AM_WINDOW_SIZE
/** PDU minimal header size in bytes. */ /** PDU minimal header size in bytes. */
# define RLC_AM_HEADER_MIN_SIZE 2 # define RLC_AM_HEADER_MIN_SIZE 2
...@@ -69,6 +69,36 @@ ...@@ -69,6 +69,36 @@
# define RLC_AM_MAX_NACK_IN_STATUS_PDU 1023 # define RLC_AM_MAX_NACK_IN_STATUS_PDU 1023
/** Max holes created by NACK_SN with segment offsets for a PDU in the retransmission buffer. */ /** Max holes created by NACK_SN with segment offsets for a PDU in the retransmission buffer. */
# define RLC_AM_MAX_HOLES_REPORT_PER_PDU 32 # define RLC_AM_MAX_HOLES_REPORT_PER_PDU 16
/** @} */ /** @} */
# endif
/* MACRO DEFINITIONS */
#define RLC_AM_NEXT_SN(sn) (((sn)+1) & ((RLC_AM_SN_MODULO)-1))
#define RLC_AM_PREV_SN(sn) (((sn)+(RLC_AM_SN_MODULO)-1) & ((RLC_AM_SN_MODULO)-1))
#define RLC_DIFF_SN(sn,snref,modulus) ((sn+(modulus)-snref) & ((modulus)-1))
#define RLC_SN_IN_WINDOW(sn,snref,modulus) ((RLC_DIFF_SN(sn,snref,modulus)) < ((modulus) >> 1))
#define RLC_AM_DIFF_SN(sn,snref) (RLC_DIFF_SN(sn,snref,RLC_AM_SN_MODULO))
#define RLC_AM_SN_IN_WINDOW(sn,snref) (RLC_SN_IN_WINDOW(sn,snref,RLC_AM_SN_MODULO))
#define RLC_SET_EVENT(x,event) ((x) |= (event))
#define RLC_GET_EVENT(x,event) ((x) & (event))
#define RLC_CLEAR_EVENT(x,event) ((x) &= (~(event)))
/* Uplink STATUS PDU trigger events */
#define RLC_AM_STATUS_NOT_TRIGGERED 0
#define RLC_AM_STATUS_TRIGGERED_POLL 0x01 /* Status Report is triggered by a received poll */
#define RLC_AM_STATUS_TRIGGERED_T_REORDERING 0x02 /* Status Report is triggered by Timer Reordering Expiry */
#define RLC_AM_STATUS_TRIGGERED_DELAYED 0x10 /* Status is delayed until SN(receivedPoll) < VR(MS) */
#define RLC_AM_STATUS_PROHIBIT 0x20 /* TimerStatusProhibit still running */
/* Status triggered (bit 5-7) will be concatenated with Poll triggered (bit 0-4) for RLCdec. RLC_AM_STATUS_TRIGGERED_DELAYED is not recorded. */
#define RLC_AM_SET_STATUS(x,event) (RLC_SET_EVENT(x,event))
#define RLC_AM_GET_STATUS(x,event) (RLC_GET_EVENT(x,event))
#define RLC_AM_CLEAR_STATUS(x,event) (RLC_CLEAR_EVENT(x,event))
#define RLC_AM_CLEAR_ALL_STATUS(x) ((x) = (RLC_AM_STATUS_NOT_TRIGGERED))
#endif
...@@ -182,7 +182,8 @@ typedef struct rlc_am_entity_s { ...@@ -182,7 +182,8 @@ typedef struct rlc_am_entity_s {
rlc_sn_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */ rlc_sn_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */
list_t segmentation_pdu_list; /*!< \brief List of "freshly" segmented PDUs. */ list_t segmentation_pdu_list; /*!< \brief List of "freshly" segmented PDUs. */
boolean_t status_requested; /*!< \brief Status requested by peer. */ uint8_t status_requested; /*!< \brief Status bitmap requested by peer. */
rlc_sn_t sn_status_triggered_delayed; /*!< \brief SN of the last received poll for which Status is delayed until SN is out of Rx Window. */
frame_t last_frame_status_indication; /*!< \brief The last frame number a MAC status indication has been received by RLC. */ frame_t last_frame_status_indication; /*!< \brief The last frame number a MAC status indication has been received by RLC. */
//----------------------------- //-----------------------------
// buffer occupancy measurements sent to MAC // buffer occupancy measurements sent to MAC
......
...@@ -74,9 +74,10 @@ rlc_am_init( ...@@ -74,9 +74,10 @@ rlc_am_init(
// RX state variables // RX state variables
//rlc_pP->vr_r = 0; //rlc_pP->vr_r = 0;
rlc_pP->vr_mr = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE; rlc_pP->vr_mr = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE;
//rlc_pP->vr_x = 0; rlc_pP->vr_x = RLC_SN_UNDEFINED;
//rlc_pP->vr_ms = 0; //rlc_pP->vr_ms = 0;
//rlc_pP->vr_h = 0; //rlc_pP->vr_h = 0;
rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
rlc_pP->last_frame_status_indication = 123456; // any value > 1 rlc_pP->last_frame_status_indication = 123456; // any value > 1
rlc_pP->first_retrans_pdu_sn = -1; rlc_pP->first_retrans_pdu_sn = -1;
...@@ -128,9 +129,11 @@ rlc_am_reestablish( ...@@ -128,9 +129,11 @@ rlc_am_reestablish(
// RX state variables // RX state variables
rlc_pP->vr_r = 0; rlc_pP->vr_r = 0;
rlc_pP->vr_mr = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE; rlc_pP->vr_mr = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE;
rlc_pP->vr_x = 0; rlc_pP->vr_x = RLC_SN_UNDEFINED;
rlc_pP->vr_ms = 0; rlc_pP->vr_ms = 0;
rlc_pP->vr_h = 0; rlc_pP->vr_h = 0;
rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
rlc_pP->status_requested = RLC_AM_STATUS_NOT_TRIGGERED;
rlc_pP->last_frame_status_indication = 123456; // any value > 1 rlc_pP->last_frame_status_indication = 123456; // any value > 1
rlc_pP->first_retrans_pdu_sn = -1; rlc_pP->first_retrans_pdu_sn = -1;
......
...@@ -49,6 +49,10 @@ rlc_am_rx_list_insert_pdu( ...@@ -49,6 +49,10 @@ rlc_am_rx_list_insert_pdu(
cursor_p = rlc_pP->receiver_buffer.head; cursor_p = rlc_pP->receiver_buffer.head;
// it is assumed this pdu is in rx window // it is assumed this pdu is in rx window
//TODO : check for duplicate
// should be rewrite
/* look for previous SN */
if (cursor_p) { if (cursor_p) {
if (rlc_pP->vr_mr < rlc_pP->vr_r) { if (rlc_pP->vr_mr < rlc_pP->vr_r) {
if (pdu_info_p->sn >= rlc_pP->vr_r) { if (pdu_info_p->sn >= rlc_pP->vr_r) {
......
...@@ -474,7 +474,7 @@ rlc_am_send_status_pdu( ...@@ -474,7 +474,7 @@ rlc_am_send_status_pdu(
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;
sn_cursor = pdu_info_cursor_p->sn; sn_cursor = pdu_info_cursor_p->sn;
while (rlc_am_in_rx_window(ctxt_pP, rlc_pP, sn_cursor) == 0) { while (!(RLC_AM_SN_IN_WINDOW(sn_cursor, rlc_pP->vr_r))) {
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
previous_sn_cursor = sn_cursor; previous_sn_cursor = sn_cursor;
......
...@@ -236,6 +236,28 @@ typedef struct rlc_am_rx_pdu_management { ...@@ -236,6 +236,28 @@ typedef struct rlc_am_rx_pdu_management {
uint8_t all_segments_received; /*!< \brief Is all segments of PDU SN have been received. */ uint8_t all_segments_received; /*!< \brief Is all segments of PDU SN have been received. */
} rlc_am_rx_pdu_management_t; } rlc_am_rx_pdu_management_t;
/** @} */ /** @} */
typedef enum rlc_am_rx_pdu_status
{
/** PDU okay. */
RLC_AM_DATA_PDU_STATUS_OK = 0,
/** SN outside RX window */
RLC_AM_DATA_PDU_STATUS_SN_OUTSIDE_WINDOW = 1,
/** SN already available */
RLC_AM_DATA_PDU_STATUS_SN_DUPLICATE = 2,
/** SN already available */
RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE = 3,
/** Buffer full */
RLC_AM_DATA_PDU_STATUS_BUFFER_FULL = 4,
/** Header Error (LI,SO...) */
RLC_AM_DATA_PDU_STATUS_HEADER_ERROR = 5,
/** Unknown bearer */
RLC_AM_DATA_PDU_STATUS_INVALID_BEARER = 6,
/** RLC in wrong state */
RLC_AM_DATA_PDU_STATUS_WRONG_STATE = 7
} rlc_am_rx_pdu_status_t;
/*! \cond PRIVATE */ /*! \cond PRIVATE */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// interlayers optimizations // interlayers optimizations
......
...@@ -64,6 +64,7 @@ enum RLC_OPERATION_MODE { TRANSMITTER_ONLY = 0x00, ...@@ -64,6 +64,7 @@ enum RLC_OPERATION_MODE { TRANSMITTER_ONLY = 0x00,
// dimensions // dimensions
# define SN_12BITS_MASK 0x0FFF # define SN_12BITS_MASK 0x0FFF
# define RLC_SN_OVERFLOW 0xFFFF # define RLC_SN_OVERFLOW 0xFFFF
# define RLC_SN_UNDEFINED RLC_SN_OVERFLOW
//---------------------------------------------------------- //----------------------------------------------------------
// DISCARD // DISCARD
//---------------------------------------------------------- //----------------------------------------------------------
......
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