- Fix: avoid infinite loop on mulitcast read thread if no data to read

Pre-ci test passed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4000 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Cedric Roux
2013-06-25 09:05:02 +00:00
commit 56c66c09aa
4111 changed files with 2133103 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
#ifndef __MAC_PRIMITIVES_H__
#define __MAC_PRIMITIVES_H__
//void ue_decode_chbch(unsigned char Node_id);
//void ue_scheduler(unsigned char Node_id);
//void nodeb_decode_ul_sach();
#endif
+262
View File
@@ -0,0 +1,262 @@
/***************************************************************************
mac_rlc_primitives.h - description
-------------------
***************************************************************************/
#ifndef __MAC_RLC_PRIMITIVES_H__
# define __MAC_RLC_PRIMITIVES_H__
/** @defgroup _mac_rlc_primitives_ MAC Layer Primitives for Communications with RLC
* @ingroup _openair_mac_layer_specs_
* @{
This subclause describes the primitives for communications between the RLC and MAC sub-layers.
This clause describes the primitives for communications between the RLC and MAC sub-layers. It is largely inspired by
3GPP TS 25.321 V4.2.0.
\image html mac_w3g4f_rlc_tx_sequence_diagram.png "MAC-RLC TX Sequence Diagram" width=15cm
\image latex mac_w3g4f_rlc_tx_sequence_diagram.png "MAC-RLC TX Sequence Diagram" width=15cm
MAC-STATUS-Ind (mac_status_ind} primitive indicates to RLC for each logical channel the rate at which it may transfer data to MAC. Parameters
are the number of PDUs that can be transferred in each transmission time interval and the PDU size; it is possible that MAC
would use this primitive to indicate that it expects the current buffer occupancy of the addressed logical channel in order
to provide for optimised TFC selection on transport channels with long transmission time interval. At the UE, MAC-STATUS-Ind
primitive is also used to indicate from MAC to RLC that MAC has requested data transmission by PHY (i.e. PHY-DATA-REQ has
been submitted, see Fig. 11.2.2.1), or that transmission of an RLC PDU on RACH or CPCH has failed due to exceeded preamble
ramping cycle counter.
MAC-STATUS-Resp (mac_status_resp) primitive enables RLC to acknowledge a MAC-STATUS-Ind. It is possible
that RLC would use this primitive to indicate that it has nothing to send or that it is
in a suspended state or to indicate the current buffer occupancy to MAC.
*/
# include "list.h"
# include "rrm_constants.h"
//# include "LAYER2/MAC/defs.h"
# define MAC_DCCH 0xCC
# define MAC_DTCH 0xDC
//----------------------------------------------------------
// primitives
//----------------------------------------------------------
# define MAC_DATA_REQ 0x01
# define MAC_DATA_IND 0x02
# define MAC_STATUS_IND 0x04
# define MAC_STATUS_RESP 0x08
//----------------------------------------------------------
// primitives definition
//----------------------------------------------------------
# define UE_ID_TYPE_U_RNTI 0xFF
// should not be used ?
# define UE_ID_TYPE_C_RNTI 0xCC
# define MAC_TX_STATUS_SUCCESSFUL 0x0F
# define MAC_TX_STATUS_UNSUCCESSFUL 0xF0
# define MAC_HEADER_MAX_SIZE 6
// Parameters:
// a) data:
// - it contains the RLC layer messages (RLC-PDU) to be transmitted, or the RLC layer messages
// that have been received by the MAC sub-layer.
//
// b) no_tb :
// - indicates the number of transport blocks transmitted by the peer entity within the
// transmission time interval, based on the TFI value.
//
// c) buffer_occupancy :
// - the parameter Buffer Occupancy (BO) indicates for each logical channel the amount of data
// in number of bytes that is available for transmission and retransmission in RLC layer.
// When MAC is connected to an AM RLC entity, control PDUs to be transmitted and RLC PDUs
// outside the RLC Tx window shall also be included in the BO. RLC PDUs that have been
// transmitted but not negatively acknowledged by the peer entity shall not be included in the BO.
//
// d) rx_timing_deviation, TDD only:
// - it contains the RX Timing Deviation as measured by the physical layer for the physical
// resources carrying the data of the Message Unit. This parameter is optional and only for
// Indication. It is needed for the transfer of the RX Timing Deviation measurement of RACH
// transmissions carrying CCCH data to RRC.
//
// e) no_pdu:
// - specifies the number of PDUs that the RLC is permitted to transfer to MAC within a
// transmission time interval.
//
// f) pdu_size:
// - specifies the size of PDU that can be transferred to MAC within a transmission time interval.
//
// g) UE-ID Type Indicator:
// - indicates the UE-ID type to be included in MAC for a DCCH when it is mapped onto a common
// transport channel (i.e. FACH, RACH, DSCH in FDD or CPCH). On the UE side UE-ID Type Indicator
// shall always be set to C-RNTI.
//
// h) tx_status:
// - when set to value "transmission unsuccessful" this parameter indicates to RLC that transmission
// of an RLC PDU failed in the previous Transmission Time Interval, when set to value
// "transmission successful" this parameter indicates to RLC that the requested RLC PDU(s)
// has been submitted for transmission by the physical layer.
//
// i) rlc_info
// - indicates to MAC the configuration parameters that are critical to TFC selection depending
// 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.
struct rlc_entity_info {
unsigned char rlc_protocol_state;
};
struct mac_tx_tb_management {
// BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tb_req
unsigned char *data_ptr;
unsigned char 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)
// but not used by L1 !, so extra cost for alignement in MAC.
unsigned short 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
// for reporting tx status to upper layers
void *rlc;
void (*rlc_callback) (void *rlcP, unsigned short rlc_tb_type);
unsigned short rlc_tb_type;
unsigned short log_ch_interface_src; // index of the logical channel interface from which the tb was submitted
unsigned char 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 {
unsigned char *data_ptr;
unsigned short tb_size; // in bits
unsigned char valid_checksum;
unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
};
struct mac_tb_req {
// 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 first_bit;
unsigned short 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
// for reporting tx status to upper layers
void *rlc;
void (*rlc_callback) (void *rlcP, unsigned short rlc_tb_type);
unsigned short rlc_tb_type;
unsigned char mac_header[MAC_HEADER_MAX_SIZE]; // worst case : tctf(5bits)+UE-Id type(2bits)+UE-Id(16 or 32bits)+C/T(4bits)=43bits max
};
// MAC-STATUS-Ind/Resp:
/*!\brief
MAC-STATUS-Ind primitive indicates to RLC for each logical channel the rate at which it may transfer data to MAC. Parameters
are the number of PDUs that can be transferred in each transmission time interval and the PDU size; it is possible that MAC
would use this primitive to indicate that it expects the current buffer occupancy of the addressed logical channel in order
to provide for optimised TFC selection on transport channels with long transmission time interval. At the UE, MAC-STATUS-Ind
primitive is also used to indicate from MAC to RLC that MAC has requested data transmission by PHY (i.e. PHY-DATA-REQ has
been submitted, see Fig. 11.2.2.1), or that transmission of an RLC PDU on RACH or CPCH has failed due to exceeded preamble
ramping cycle counter.*/
struct mac_status_ind {
unsigned short no_pdu; /*!< \brief PDUs number*/
unsigned short tx_status; /*!< \brief status is successful or unsuccessful*/
};
/*!\brief
MAC-STATUS-Resp primitive enables RLC to acknowledge a MAC-STATUS-Ind. It is possible
that RLC would use this primitive to indicate that it has nothing to send or that it is
in a suspended state or to indicate the current buffer occupancy to MAC.
*/
struct mac_status_resp {
unsigned int buffer_occupancy_in_bytes; /*!< \brief the parameter Buffer Occupancy (BO) indicates for each logical channel the amount of data in number of bytes that is available for transmission and retransmission in RLC layer. */
unsigned short buffer_occupancy_in_pdus; /*!< xxx*/
struct rlc_entity_info rlc_info; /*!< xxx*/
};
struct mac_tb_ind {
unsigned char *data_ptr;
unsigned short size;
unsigned char error_indication;
unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
};
// MAC-DATA-Req/Ind:
//---------------------
/*! \brief MAC-DATA-Req primitive is used to request that an upper layer PDU be sent using the
procedures for the information transfer service;
*/
struct mac_data_req {
list_t data; /*!< contains the RLC layer messages (RLC-PDU) to be transmitted*/
unsigned int buffer_occupancy_in_bytes; /*!< the parameter Buffer Occupancy (BO) indicates for each logical channel the amount of data
in number of bytes that is available for transmission and retransmission in RLC layer.
When MAC is connected to an AM RLC entity, control PDUs to be transmitted and RLC PDUs
outside the RLC Tx window shall also be included in the BO. RLC PDUs that have been
transmitted but not negatively acknowledged by the peer entity shall not be included in the BO.*/
unsigned short buffer_occupancy_in_pdus; /*!< xxx*/
struct rlc_entity_info rlc_info; /*!< indicates to MAC the configuration parameters that are critical to TFC selection depending
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.*/
unsigned char ue_id_type_indicator; /*!< indicates the UE-ID type to be included in MAC for a DCCH when it is mapped onto a common
transport channel (i.e. FACH, RACH, DSCH in FDD or CPCH). On the UE side UE-ID Type Indicator
shall always be set to C-RNTI.*/
};
//---------------------
/*! \brief MAC-DATA-Ind primitive indicates the arrival of upper layer PDUs received within one
transmission time interval by means of the information transfer service.*/
struct mac_data_ind {
list_t data; /*! the RLC layer messages that have been received by the MAC sub-layer*/
unsigned short no_tb;
unsigned short tb_size; // in bits
//unsigned char error_indication;
};
//---------------------
//---------------------
struct mac_primitive {
unsigned char primitive_type;
union {
struct mac_data_req data_req;
struct mac_status_resp status_resp;
struct mac_data_ind data_ind;
//struct mac_status_ind status_ind;
} 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
+417
View File
@@ -0,0 +1,417 @@
/*________________________mac_rrc_primitives.h________________________
Authors : Hicham Anouar, Raymond Knopp
Company : EURECOM
Emails : anouar@eurecom.fr, knopp@eurecom.fr
________________________________________________________________*/
#ifndef __MAC_RRC_PRIMITIVES_H__
# define __MAC_RRC_PRIMITIVES_H__
#ifndef OPENAIR2_IN
#include "LAYER2/RLC/rlc.h"
#endif
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "MeasGapConfig.h"
#ifdef Rel10
#include "MBSFN-AreaInfoList-r9.h"
#include "MBSFN-SubframeConfigList.h"
#endif
//#include "rrm_config_structs.h"
//#include "platform_types.h"
/** @defgroup _mac_rrc_primitives_ MAC Layer Primitives for Communications with RRC
* @ingroup _openair_mac_layer_specs_
* @{
This subclause describes the primitives for communications between the RRC and MAC sub-layers.
This subclause describes the primitives for communications between the RRC and MAC sub-layers.
The RRC sequence diagrams are shown below.
The primitives responsible for relaying of radio and traffic measurements to the radio resource manager via
RRC signaling are :
-# MAC_MEAS_REQ: enables RRC to request a measurement process in the MAC (one-shot, periodic or event-driven). This configures
a measurement process in the MAC.
-# MAC_MEAS_IND: indicates to RRC that a (periodic) measurement request is available.
-# MAC_MEAS_CONFIRM: enables RRC to acknowledge a MAC-MEAS-Ind.
These associate a set of measurements (described by the MAC_MEAS_t structure) to a particular logical channel. Each measurement has
an associated period (which can be infinite in the case of a one-shot measurement) and a set of triggers for generating event-driven
instantaneous measurement reports. The latter is typically used to signal events that correspond to degradation or loss of links with respect to
negotiated QoS values. These consequently trigger reconfiguration of services by the network. The averaging parameters used by the
MAC measurement process is described by the structure MAC_AVG_t. Note that it is the responsibility
of the MAC-layer to relay PHY measurements which are directly available to the scheduling entity in the MAC-layer.
RRC does not directly act on the PHY measurement sub-system.
The primitives responsible for logical channel MAC configuration by the radio resource manager via RRC signaling are
-# MAC_CONFIG_REQ: enables RRC to configure a new logical channel description at the MAC layer. The associated QoS
descriptor (MAC_LCHAN_DESC contains the parameters defining the logical channel resource scheduling.
-# MAC_CONFIG_CONFIRM: indicates to RRC that a given logical channel has or has not been configured.
The primitives responsible for indicating data synchronization (or loss of) to RRC are
-# MAC_SYNC : indicates to RRC that a physical link for a newly established logical channel has been used (reception) with
success. The parameter passed indicates the logical channel id. This represents the event of successfully decoding a particular logical
channel for the first time. In the event that several logical channels share the same physical resources (e.g. BCCH and CCCH), it
shall only be sent for the logical channel with the lowest id.
-# MAC_OUT_OF_SYNC : UE primitive indicating to RRC that a physical link for a particular Node-B has been lossed. The parameter
passed indicates the id of the Node-B. This represents the event of detecting an unacceptable error rate on the CHBCH of the Node-B in question.
and can be used in the case of handover between Node-B's. Note that this message is redundant since an equivalent way of obtaining the same
result could be based on an event-driven measurement report.
*/
# define NB_SIG_CNX_CH 1
# define NB_CNX_CH MAX_MOBILES_PER_RG
# define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
# define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define NUMBER_OF_MEASUREMENT_SUBBANDS 16
#define RRC_RACH_ASS_REQ 0
#define MAC_RACH_BW_REQ 1
typedef enum {
RRC_OK=0,
RRC_ConnSetup_failed,
RRC_PHY_RESYNCH
} RRC_status_t;
/*! MAC/PHY Measurement Structure*/
/*! \brief Logical Channel ID structure */
typedef struct{
unsigned short Index __attribute__ ((packed)); //QOS CLASS? /*!< \brief Index of logical channel*/
}LCHAN_ID;
typedef struct{
char Rssi; /*!< \brief RSSI (dBm) on physical resources corresponding to logical channel*/
char Sinr[NUMBER_OF_MEASUREMENT_SUBBANDS]; /*!< \brief Average SINR (dB) on physical resources corresponding to logical channel*/
u8 Harq_delay; /*!< \brief Average number of transmission rounds (times 10) on transport channel associated with
logical channel*/
unsigned short Bler; /*!< \brief Average block error rate (times 1000) on transport channel associated with logical channel*/
u8 Spec_eff; /*!< \brief Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel*/
u8 Qdepth;
//u8 Tx_rate;
//u8 Rx_rate;
}__attribute__ ((__packed__)) MAC_MEAS_T;
#define MAC_MEAS_T_SIZE sizeof(MAC_MEAS_T)
/*!\brief MAC/RLC Measurement Information
*/
typedef struct{
char Rssi; /*!< \brief RSSI (dBm) on physical resources corresponding to logical channel*/
char Sinr[NUMBER_OF_MEASUREMENT_SUBBANDS]; /*!< \brief Average SINR (dB) on physical resources corresponding to logical channel*/
u8 Harq_delay; /*!< \brief Average number of transmission rounds (times 10) on transport channel associated with
logical channel*/
unsigned short Bler; /*!< \brief Average block error rate (times 1000) on transport channel associated with logical channel*/
u8 Spec_eff; /*!< \brief Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel*/
u8 rlc_sdu_buffer_occ; /*!< \brief RLC SDU buffer occupancy */
unsigned short rlc_sdu_loss_indicator; /*!< \brief RLC SDU Loss indicator */
}__attribute__ ((__packed__)) MAC_RLC_MEAS_T;
#define MAC_RLC_MEAS_T_SIZE sizeof(MAC_RLC_MEAS_T)
/*! MAC/PHY Measurement Averaging Parameters. These are fixed-point 16-bit representations of the interval [0,1)*/
typedef struct {
unsigned short Rssi_forgetting_factor; /*!< \brief Forgetting factor for RSSI averaging*/
unsigned short Sinr_forgetting_factor; /*!< \brief Forgetting factor for SINR averaging*/
unsigned short Harq_delay_forgetting_factor; /*!< \brief Forgetting factor for HARQ delay averaging*/
unsigned short Bler_forgetting_factor; /*!< \brief Forgetting factor for block error rate (times 1000) averaging*/
unsigned short Spec_eff_forgetting_factor; /*!< \brief Forgetting factor for Spectral efficiency averaging*/
}__attribute__ ((__packed__)) MAC_AVG_T;
/*!\brief This primitive indicates to RRC that a measurement request is available */
typedef struct {
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
unsigned short Process_id; /*!< \brief Id of MAC measurement process*/
MAC_MEAS_T Meas;
char Meas_status; /*!< \brief Latest set of MAC measurements performed in the current process*/
}__attribute__ ((__packed__)) MAC_MEAS_IND;
#define MAC_MEAS_IND_SIZE sizeof(MAC_MEAS_IND)
/*!\brief This primitive indicates to MAC that a measurement request was received
*/
typedef struct {
//LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
//unsigned short Process_id; /*!< \brief Id of new MAC measurement process*/
char Meas_status; /*!< \brief Status (0-positive, 1-negative)*/
}__attribute__ ((__packed__)) MAC_MEAS_CONFIRM;
/*!\brief This primitive parametrizes a MAC measurement process
*/
typedef struct {
MAC_MEAS_T Meas_trigger; /*!< \brief Thresholds to trigger event driven measurement reports*/
MAC_AVG_T Mac_avg; /*!< \brief Set of forgetting factors for the averaging of the MAC measurement process*/
unsigned int bo_forgetting_factor; /*!< \brief Forgetting factor for RLC buffer occupancy averaging*/
unsigned int sdu_loss_trigger; /*!< \brief Trigger for RLC SDU losses*/
unsigned short Rep_amount; /*!< \brief Number of Measurements for this process, 0 means infinite*/
unsigned short Rep_interval; /*!< \brief Reporting interval between successive measurement reports in this process*/
}__attribute__ ((__packed__)) MAC_RLC_MEAS_DESC;
/*!\brief This primitive indicates to MAC that a (periodic) measurement request is requested for a particular logical channel
*/
typedef struct {
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
unsigned short UE_eNB_index;
unsigned short Process_id; /*!< \brief Id of new MAC measurement process*/
// MAC_MEAS_DESC Meas_desc;/*!< \brief Measurement descriptor associated with Logical channel*/
MAC_MEAS_T Meas_trigger; /*!< \brief Thresholds to trigger event driven measurement reports*/
MAC_AVG_T Mac_avg; /*!< \brief Set of forgetting factors for the averaging of the MAC measurement process*/
unsigned short Rep_amount; /*!< \brief Number of Measurements for this process, 0 means infinite*/
unsigned short Rep_interval; /*!< \brief Reporting interval between successive measurement reports in this process*/
MAC_MEAS_T Mac_meas; /*!< \brief Measure structure to be filled by the MAC */
}__attribute__ ((__packed__)) MAC_MEAS_REQ;
#define MAC_MEAS_REQ_SIZE sizeof(MAC_MEAS_REQ)
typedef struct MEAS_REQ_TABLE_ENTRY{
MAC_MEAS_REQ Mac_meas_req;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
u8 Status;
u8 Meas_req_status;
u8 Rx_activity;
//u8 Meas_Direction;//???
struct MEAS_REQ_TABLE_ENTRY *Next_entry;
struct MEAS_REQ_TABLE_ENTRY *Prev_entry;
}__attribute__ ((__packed__)) MAC_MEAS_REQ_ENTRY;
/*!\brief This primitive parametrizes an RLC measurement process
*/
typedef struct{
unsigned int bo_forgetting_factor; /*!< \brief Forgetting factor for buffer occupancy averaging*/
unsigned int sdu_loss_trigger; /*!< \brief Trigger for RLC sdu losses*/
}__attribute__ ((__packed__)) RLC_MEAS_DESC;
//#define NUM_MEAS_REQ_MAX 100 //from rrm
/*! \brief MAC Logical Channel Descriptor
*/
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
u8 Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/
u8 Target_bler; /*!< \brief Target Average Transport Block Error rate*/
u8 Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
}__attribute__ ((__packed__)) LCHAN_DESC;
#define LCHAN_DESC_SIZE sizeof(LCHAN_DESC)
/*!\brief This primitive indicates to RRC that a particular logical channel has been established and that successful transmission has
been received. The parameter passed is the logical channel id.
*/
typedef struct MAC_SYNC {
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
} MAC_SYNC;
/*!\brief This primitive indicates to RRC (UE) that a particular Node-B has been lossed and passes CHBCH logical channel
node_id as parameter
*/
typedef struct MAC_OUT_OF_SYNC {
unsigned short Node_id; /*!< \brief Logical Channel ID*/
} MAC_OUT_OF_SYNC;
/*!\brief This primitive enables RRC to configure a new logical channel description at the MAC layer.
*/
typedef struct{
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
// unsigned short UE_eNB_index; //ID of CH who configued the LC (Need this to identify LC in the UE side)
u8 Lchan_type; // DCCH_LCHAN, DTCH_LCHAN
LCHAN_DESC Lchan_desc[2]; /*!< \brief Logical Channel QoS Descriptor (MAC component) */
u8 L3_info_type;
u8 L3_info[16];
//#ifndef CELLULAR
unsigned short UE_eNB_index;
//#endif
}__attribute__ ((__packed__)) MAC_CONFIG_REQ;
#define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ)
/*!\brief This primitive indicates to RRC that a given logical channel has or has not been configured.
*/
typedef struct {
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
u8 Config_status; /*!< \brief Configuration status (0-positive, 1-negative)*/
}__attribute__ ((__packed__)) MAC_CONFIG_CONFIRM;
/**@}*/
/*
** @addtogroup _mac_impl_ MAC Layer (MAC) Reference Implementation
*@{
*/
//#include "LAYER2/MAC/defs.h"
typedef struct {
char Sinr_meas[NB_CNX_CH+1][NUMBER_OF_MEASUREMENT_SUBBANDS];
char Wideband_sinr;
u8 Forg_fact;
unsigned short Rep_interval;
u8 Status;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
u8 Active;
}__attribute__ ((__packed__)) DEFAULT_UE_MEAS;
#define DEFAULT_UE_MEAS_SIZE sizeof(DEFAULT_UE_MEAS)
typedef struct { //From RRC
unsigned short UE_index;
u8 Forg_fact;
unsigned short Rep_interval;;
}__attribute__ ((__packed__)) DEFAULT_MEAS_REQ;
#define DEFAULT_MEAS_REQ_SIZE sizeof(DEFAULT_MEAS_REQ)
typedef struct { //To RRC
unsigned short UE_index __attribute__ ((packed));
char Sinr_meas[NB_CNX_CH+1];
u8 Rb_active[NB_RAB_MAX];
}__attribute__ ((__packed__)) DEFAULT_MEAS_IND;
#define DEFAULT_MEAS_IND_SIZE sizeof(DEFAULT_MEAS_IND)
typedef struct {
char Sinr_meas[NB_CNX_CH+1][NUMBER_OF_MEASUREMENT_SUBBANDS];
char Wideband_sinr;
unsigned int cqi;
u8 Forg_fact;
unsigned short Rep_interval;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
u8 Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
u8 Active;
}__attribute__ ((__packed__)) DEFAULT_CH_MEAS;
#define DEFAULT_eNB_MEAS_SIZE sizeof(DEFAULT_eNB_MEAS)
#ifndef OPENAIR2_IN
#ifndef CELLULAR
//#include "L3_rrc_defs.h"
#endif
typedef struct{ //RRC_INTERFACE_FUNCTIONS
unsigned int Frame_index;
unsigned short UE_index[NB_MODULES_MAX][NB_SIG_CNX_UE];
u8 eNB_id[NB_MODULES_MAX][NB_CNX_UE];
#ifndef CELLULAR
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
u8 UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
#endif
void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(u8 );
char (*openair_rrc_UE_init)(u8, u8);
RRC_status_t (*rrc_rx_tx)(u8,u32,u8,u8);
u8 (*mac_rrc_data_ind)(u8,u32,unsigned short,char *,unsigned short,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,unsigned short,u8,char *,u8 eNB_flag, u8 eNB_index);
void (*mac_rrc_meas_ind)(u8,MAC_MEAS_REQ_ENTRY*);
void (*def_meas_ind)(u8, u8);
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
void (*fn_rrc) (void);
u8 (*get_rrc_status)(u8 Mod_id,u8 eNB_flag,u8 eNB_index);
}RRC_XFACE;
typedef struct{
//MAC_INTERFACE_FUNCTIONS
unsigned int frame;
unsigned short Node_id[NB_MODULES_MAX];
char Is_cluster_head[NB_MODULES_MAX];
void (*macphy_exit)(const char *); /* Pointer function that stops the low-level scheduler due an exit condition */
unsigned short (*mac_config_req)(u8,u8,MAC_CONFIG_REQ*);
MAC_MEAS_REQ_ENTRY* (*mac_meas_req)(u8 , MAC_MEAS_REQ*);
void (*mac_out_of_sync_ind)(u8,u32,unsigned short);
//u8 (*mac_rrc_data_ind)(u8,unsigned short,char *,u8);
//u8 (*mac_rrc_data_req)( u8, unsigned short, u8,char *);
//void (*mac_switch_node_function)(u8);
// void (*mac_rlc_exit)(void);
//RLC_INTERFACE_FUNCTIONS
// void (*pdcp_run)(unsigned int);
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
int (*rrc_mac_config_req)(u8 Mod_id,u8 eNB_flag,u8 UE_id,u8 eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
u8 *SIwindowsize,
u16 *SIperiod
#ifdef Rel10
,
u8 MBMS_Flag,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
struct PMCH_InfoList_r9 *pmch_InfoList
#endif
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
void (*mac_rlc_data_ind)(module_id_t, chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, chan_id_t, tb_size_t, num_tb_t);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
//rlc_op_status_t rrc_rlc_config_req (module_id_t, rb_id_t, rb_type_t, rlc_info_t );
//rlc_op_status_t rrc_rlc_data_req (module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, mem_block_t*);
//void rrc_rlc_register_rrc ( void(*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , mem_block_t*),void(*rrc_data_conf) (module_id_t , rb_id_t , mui_t) );
void (*mrbch_phy_sync_failure) (u8 Mod_id, u32 frame, u8 Free_ch_index);
void (*dl_phy_sync_success) (u8 Mod_id, u32 frame, u8 eNB_index);
}MAC_RLC_XFACE;
#endif
#define IDLE 0
#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
#define RADIO_CONFIG_OK 1
#define MEAS_CONFIGURED 4
#define MEAS_OK 5
#define MEAS_TRIGGER 6
#define RRC_MEAS_REPORT_REQ 7
#define MEAS_REPORT 8
#define RAB_MEAS_IND 0
#define DEF_MEAS_IND 1
#define ADD_LC 0
#define REMOVE_LC 1
#endif
+64
View File
@@ -0,0 +1,64 @@
#ifndef __openair_DEFS_H__
#define __openair_DEFS_H__
#ifndef USER_MODE
#include <linux/kernel.h>
#endif //USER_MODE
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#define msg printf
#define malloc16(x) memalign(16,x) //malloc(x)
#define free16(y,x) free(y)
#define bigmalloc malloc
#define bigmalloc16 malloc16
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
#define PAGE_MASK 0xfffff000
#define virt_to_phys(x) (x)
#else // USER_MODE
#include <rtai.h>
#define msg rt_printk
#ifdef BIGPHYSAREA
#define bigmalloc(x) (bigphys_malloc(x))
#define bigmalloc16(x) (bigphys_malloc(x))
#define malloc16(x) (bigphys_malloc(x))
#define free16(y,x)
#define bigfree(y,x)
#else // BIGPHYSAREA
#define bigmalloc(x) (dma_alloc_coherent(pdev[0],(x),&dummy_dma_ptr,0))
#define bigmalloc16(x) (dma_alloc_coherent(pdev[0],(x),&dummy_dma_ptr,0))
#define bigfree(y,x) (dma_free_coherent(pdev[0],(x),(void *)(y),dummy_dma_ptr))
#define malloc16(x) (kmalloc(x,GFP_KERNEL))
#define free16(y,x) (kfree(y))
#endif // BIGPHYSAREA
#ifdef CBMIMO1
#define openair_get_mbox() (*(unsigned int *)mbox)
#else //CBMIMO1
#define openair_get_mbox() (*(unsigned int *)PHY_vars->mbox>>1)
#endif //CBMIMO1
#endif // USERMODE
// #define bzero(s,n) (memset((s),0,(n)))
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmin(a,b) ((a<b) ? (a) : (b))
#endif // /*__openair_DEFS_H__ */
+22
View File
@@ -0,0 +1,22 @@
#ifndef __openair_TYPES_H__
#define __openair_TYPES_H__
#ifdef USER_MODE
#include <sys/types.h>
typedef unsigned char u8;
typedef char s8;
typedef unsigned short u16;
typedef short s16;
typedef unsigned int u32;
typedef int s32;
typedef unsigned long long u64;
typedef long long s64;
#else
#include <linux/types.h>
#endif
#endif /*__openair_TYPES_H__ */
+132
View File
@@ -0,0 +1,132 @@
/*
platform_constants.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#include "RRC/LITE/MESSAGES/asn1_constants.h"
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
#ifdef USER_MODE
#ifdef LARGE_SCALE
# define NB_MODULES_MAX 128
# define NB_NODE_MAX 128
#else
# define NB_MODULES_MAX 32
# define NB_NODE_MAX 32
#endif
#else
# define NB_MODULES_MAX 1
# define NB_NODE_MAX 1
#endif //PHY_EMUL
#ifdef JUMBO_FRAME
# define MAX_IP_PACKET_SIZE 9000
#else
# define MAX_IP_PACKET_SIZE 1500
#endif
// overwrite the previous deinitions
# define MAX_MODULES NB_MODULES_MAX
#ifdef LARGE_SCALE
# define MAX_MOBILES_PER_RG 128
# define MAX_RG 2
#else
# define MAX_MOBILES_PER_RG 16
# define MAX_RG 2
#endif
# define MAX_MANAGED_RG_PER_MOBILE 2
# define NB_RB_MAX 11
# define NB_RAB_MAX 8 // 4
# define RAB_SHIFT1 9
# define RAB_SHIFT2 3
# define RAB_OFFSET 0x0007
# define RAB_OFFSET1 0x7E00
# define RAB_OFFSET2 0x01F8
# define DIR_OFFSET 0x8000
# define DIR_SHIFT 15
# define CH_OFFSET 0x0004
# define CH_SHIFT 2
#ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RAB_MOBILE NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
# define MAX_RB_RG MAX_RB_MOBILE //NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
#else
# define MAX_RB_MOBILE NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RAB_MOBILE NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
# define MAX_RB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# define MAX_RAB_RG NB_RB_MAX * MAX_MOBILES_PER_RG
# //ifdef NODE_RG
# define MAX_RAB MAX_RAB_RG
# define MAX_RB MAX_RB_RG
# //else
# // ifdef NODE_MT
# // define MAX_RAB MAX_RAB_MOBILE
# // define MAX_RB MAX_RB_MOBILE
# //else
# //error NODE_RG or NODE_MT must be defined
# //endif
//# endif
#endif //MESH
// RLC_MODE
# define RLC_NONE 0
# define RLC_MODE_AM 1
# define RLC_MODE_TM 2
# define RLC_MODE_UM 3
//E_R
# define E_R_RLC_ER_RELEASE 1
# define E_R_RLC_ER_MODIFICATION 2
# define E_R_RLC_ER_RE_ESTABLISHMENT 4
# define E_R_RLC_ER_STOP 8
# define E_R_RLC_ER_CONTINUE 16
# define E_R_RLC_ER_NONE 0
// RLC_AM_SEND_MRW
# define SEND_MRW_OFF 15
# define SEND_MRW_ON 240
// RLC_SEGMENTATION_INDICATION
# define SEGMENTATION_NOT_ALLOWED 0
# define SEGMENTATION_ALLOWED 1
// RLC_DELIVERY_OF_ERRONEOUS_SDU
# define DELIVERY_OF_ERRONEOUS_SDU_NO 0
# define DELIVERY_OF_ERRONEOUS_SDU_YES 1
# define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2
// CBA constant
#define NUM_MAX_CBA_GROUP 4
# ifndef __cplusplus
# ifndef NULL
# define NULL 0
# endif
# ifndef null
# define null 0
# endif
# endif
#ifdef USER_MODE
#define printk printf
#endif
#endif
+55
View File
@@ -0,0 +1,55 @@
/*
platform_types.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PLATFORM_TYPES_H__
# define __PLATFORM_TYPES_H__
#ifndef USER_MODE
#else
#include "openair_types.h"
#endif
typedef unsigned char u8_t;
typedef unsigned short int u16_t;
typedef unsigned int u32_t;
typedef unsigned long int u64_t;
typedef signed char s8_t;
typedef signed short int s16_t;
typedef signed int s32_t;
typedef signed long int s64_t;
typedef unsigned int config_action_t;
typedef unsigned int sdu_size_t;
typedef unsigned int tbs_size_t;
typedef unsigned int tb_size_t;
typedef unsigned int rb_id_t;
typedef unsigned int module_id_t;
typedef unsigned int mui_t;
typedef unsigned int confirm_t;
typedef unsigned int rb_type_t;
typedef rb_id_t chan_id_t;
typedef unsigned int num_tb_t;
typedef unsigned int crc_t;
typedef unsigned int rlc_tx_status_t;
typedef unsigned int rlc_mode_t;
typedef signed int rlc_op_status_t;
typedef unsigned char crc8_t;
typedef unsigned short crc16_t;
typedef unsigned int crc32_t;
typedef signed char boolean_t;
// just for integration
extern unsigned int frame;
#endif
+174
View File
@@ -0,0 +1,174 @@
/*
rrm_config_structs.h
-------------------
AUTHOR : Linus GASSER modified by Lionel GAUTHIER Raymond KNOPP
COMPANY : EURECOM
EMAIL : linus.gasser@epfl.ch
EMAIL : lionel.gauthier@eurecom.fr
EMAIL : raymond.knopp@eurecom.fr
***************************************************************************/
# ifndef __RRM_CONFIG_STRUCTS_H__
# define __RRM_CONFIG_STRUCTS_H__
# include "platform_types.h"
# include "platform_constants.h"
# include "rrm_constants.h"
# include "rlc.h"
typedef volatile struct {
u32 e_r;
int timer_poll;
int timer_poll_prohibit;
int timer_discard;
int timer_poll_periodic;
int timer_status_prohibit;
int timer_status_periodic;
int timer_rst;
int timer_mrw;
int missing_pdu_indicator;
u32 pdu_size;
// int in_sequence_delivery; // not implemented
u8 max_rst;
u8 max_dat;
u16 poll_pdu;
u16 poll_sdu;
u8 poll_window;
u32 tx_window_size;
u32 rx_window_size;
u8 max_mrw;
u8 last_transmission_pdu_poll_trigger;
u8 last_retransmission_pdu_poll_trigger;
enum RLC_SDU_DISCARD_MODE sdu_discard_mode;
u32 send_mrw;
} AM;
typedef volatile struct {
u32 e_r;
u32 timer_discard;
u32 sdu_discard_mode;
u32 segmentation_indication;
u32 delivery_of_erroneous_sdu;
} TM;
typedef volatile struct {
u32 e_r;
u32 timer_discard;
u32 sdu_discard_mode;
} UM;
typedef volatile struct {
u8 logch_identity;
u8 mac_logch_priority;
} MAP_INFO;
typedef volatile struct {
u32 rlc_mode;
AM am;
TM tm;
UM um;
} RLC_INFO;
typedef volatile struct {
int header_compression_algorithm;
} PDCP_INFO;
typedef volatile struct {
rb_type_t rb_type;
RLC_INFO rlc_info;
PDCP_INFO pdcp_info;
u16 rb_id;
// Added for OPENAIR MAC
//LCHAN_DESC Lchan_desc;
} RADIOBEARER;
typedef volatile struct {
int TIMER300;
int TIMER302;
int TIMER305;
int TIMER307;
int TIMER308;
int TIMER312;
int TIMER313;
int TIMER314;
int TIMER315;
} L3TIMERS_;
typedef volatile struct {
int COUNTERN300;
int COUNTERN302;
int COUNTERN308;
int COUNTERN312;
int COUNTERN313;
} L3COUNTERS_;
typedef volatile struct {
int MaxNumRemote;
L3TIMERS_ Timers;
L3COUNTERS_ Counters;
} L3_;
typedef volatile struct {
u8 rrm_action; // ACTION_NULL,ADD,REMOVE,MODIFY
u8 rrm_element; // rb,trch,cctrch
u8 rrm_element_index; // rb/trch/cctrch index
} RRM_COMMAND_MT;
typedef volatile struct {
u8 rrm_action; // ACTION_NULL,ADD,REMOVE,MODIFY
u8 mobile;
u8 rrm_element; // rb,trch,cctrch
u8 rrm_element_index; // rb/trch/cctrch index
} RRM_COMMAND_RG;
typedef volatile struct {
u8 nb_commands;
RRM_COMMAND_RG rrm_commands[JRRM_MAX_COMMANDS_PER_TRANSACTION];
RADIOBEARER bearer[MAX_RB_RG];
L3_ L3;
} RG_CONFIG;
typedef volatile struct {
u8 nb_commands;
RRM_COMMAND_MT rrm_commands[JRRM_MAX_COMMANDS_PER_TRANSACTION];
RADIOBEARER bearer[MAX_RB_MOBILE];
L3_ L3;
} MT_CONFIG;
# ifdef NODE_RG
typedef volatile struct {
RG_CONFIG rg_config;
MT_CONFIG mt_config[MAX_MOBILES_PER_RG];
} RRM_VARS;
# else
/* NODE_RG */
typedef volatile struct {
MT_CONFIG mt_config[MAX_MANAGED_RG_PER_MOBILE];
} RRM_VARS;
# endif
/* NODE_RG */
//typedef MT_CONFIG MAIN_MOBILE ;
//typedef RG_CONFIG MAIN_RADIO_GATEWAY;
# endif
+55
View File
@@ -0,0 +1,55 @@
/*
rrm_constants.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RRM_CONSTANTS_H__
# define __RRM_CONSTANTS_H__
# include "platform_constants.h"
/*#################################################
CONSTANTS FOR L1/L2/L3 LAYERS
#################################################*/
# define RRM_CONFIG_VALID 0xFF
# define RRM_CONFIG_INVALID 0x00
# define RRM_NO_REFERENCE -1
# define TRANSACTION_NULL 0
// RRM action
# define ACTION_NULL 0
# define ACTION_ADD 1
# define ACTION_REMOVE 2
# define ACTION_MODIFY 3
# define ACTION_SET_SECURITY_MODE 4
# define ACTION_MBMS_ADD 10
# define ACTION_MBMS_MODIFY 11
# define UPLINK 1
# define DOWNLINK 2
# define SIGNALLING_RADIO_BEARER 1
# define RADIO_ACCESS_BEARER 2
# define MOBILE 7
// equipment type
# define MOBILE_TERMINAL 1
# define RADIO_GATEWAY 2
# define UNUSED_PARAMETER -1
//---------------------------
// COMMON TRCH
//---------------------------
# define PREFERED_RLC_BLOCK_SIZE 336
//(43 bytes)
# define JRRM_MAX_TTI 2
# define JRRM_MAX_COMMANDS_PER_TRANSACTION 50
# endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _RTOS_HEADER_H_
# define _RTOS_HEADER_H_
# if defined(RTAI) && !defined(USER_MODE)
// CONVERSION BETWEEN POSIX PTHREAD AND RTAI FUNCTIONS
/*
# define pthread_mutex_init pthread_mutex_init_rt
# define pthread_mutexattr_init pthread_mutexattr_init_rt
# define pthread_mutex_lock pthread_mutex_lock_rt
# define pthread_mutex_unlock pthread_mutex_unlock_rt
# define pthread_mutex_destroy pthread_mutex_destroy_rt
# define pthread_cond_init pthread_cond_init_rt
# define pthread_cond_wait pthread_cond_wait_rt
# define pthread_cond_signal pthread_cond_signal_rt
# define pthread_cond_destroy pthread_cond_destroy_rt
# define pthread_attr_init pthread_attr_init_rt
# define pthread_attr_setschedparam pthread_attr_setschedparam_rt
# define pthread_create pthread_create_rt
# define pthread_cancel pthread_cancel_rt
# define pthread_delete_np pthread_cancel_rt
# define pthread_attr_setstacksize pthread_attr_setstacksize_rt
# define pthread_self rt_whoami
*/
# include <asm/rtai.h>
# include <rtai.h>
# include <rtai_posix.h>
# include <rtai_fifos.h>
# include <rtai_sched.h>
# ifdef CONFIG_PROC_FS
# include <rtai_proc_fs.h>
# endif
# else
# ifdef USER_MODE
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <math.h>
# include <pthread.h>
# include <assert.h>
# define rtf_get read
# define rtf_put write
# endif
# endif
#endif