more NB-IoT integration
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file asn1_msg.h
|
||||
* \brief primitives to build the asn1 messages
|
||||
* \author Raymond Knopp, Navid Nikaein and Michele Paffetti
|
||||
* \date 2011, 2017
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr ,navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
|
||||
*/
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h> /* for atoi(3) */
|
||||
#include <unistd.h> /* for getopt(3) */
|
||||
#include <string.h> /* for strerror(3) */
|
||||
#include <sysexits.h> /* for EX_* exit codes */
|
||||
#include <errno.h> /* for errno */
|
||||
#else
|
||||
#include <linux/module.h> /* Needed by all modules */
|
||||
#endif
|
||||
|
||||
#include <asn_application.h>
|
||||
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
|
||||
|
||||
|
||||
#include "RRC/LITE/defs_NB_IoT.h"
|
||||
|
||||
/*
|
||||
* The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
|
||||
* output into the chosen string buffer.
|
||||
* RETURN VALUES:
|
||||
* 0: The structure is printed.
|
||||
* -1: Problem printing the structure.
|
||||
* WARNING: No sensible error value is returned.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (eNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@param N_RB_DL Number of downlink PRBs
|
||||
@param frame radio frame number
|
||||
@return size of encoded bit stream in bytes*/
|
||||
uint8_t do_MIB_NB_IoT(
|
||||
rrc_eNB_carrier_data_NB_IoT_t *carrier,
|
||||
uint32_t N_RB_DL,
|
||||
uint32_t frame,
|
||||
uint32_t hyper_frame);
|
||||
|
||||
|
||||
/**
|
||||
\brief Generate a default configuration for SIB1-NB (eNB).
|
||||
@param Mod_id Instance of eNB
|
||||
@param CC_id Component carrier to configure
|
||||
@param carrier pointer to Carrier information
|
||||
@param configuration Pointer Configuration Request structure
|
||||
@return size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_SIB1_NB_IoT(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
rrc_eNB_carrier_data_NB_IoT_t *carrier,
|
||||
NbIoTRrcConfigurationReq *configuration,
|
||||
uint32_t frame
|
||||
);
|
||||
|
||||
/**
|
||||
\brief Generate a default configuration for SIB2/SIB3-NB in one System Information PDU (eNB).
|
||||
@param Mod_id Index of eNB (used to derive some parameters)
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of SI-NB PDU
|
||||
@param systemInformation_NB_IoT Pointer to asn1c C representation of SI-NB PDU
|
||||
@param sib2_NB Pointer (returned) to sib2_NB component withing SI-NB PDU
|
||||
@param sib3_NB Pointer (returned) to sib3_NB component withing SI-NB PDU
|
||||
@return size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
rrc_eNB_carrier_data_NB_IoT_t *carrier,
|
||||
NbIoTRrcConfigurationReq *configuration
|
||||
);
|
||||
|
||||
/**(UE-SIDE)
|
||||
\brief Generate an RRCConnectionRequest-NB UL-CCCH-Message (UE) based on random string or S-TMSI. This
|
||||
routine only generates an mo-data establishment cause.
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||
@param rv 5 byte random string or S-TMSI
|
||||
@param Mod_id
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_RRCConnectionRequest_NB_IoT(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv);
|
||||
|
||||
|
||||
/**(UE -SIDE)
|
||||
\brief Generate an RRCConnectionSetupComplete-NB UL-DCCH-Message (UE)
|
||||
@param Mod_id
|
||||
@param Transaction_id
|
||||
@param dedicatedInfoNASLength
|
||||
@param dedicatedInfoNAS
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_RRCConnectionSetupComplete_NB_IoT(uint8_t Mod_id, uint8_t* buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength,
|
||||
const char* dedicatedInfoNAS);
|
||||
|
||||
/** (UE-SIDE)
|
||||
\brief Generate an RRCConnectionReconfigurationComplete-NB UL-DCCH-Message (UE)
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||
@param ctxt_pP
|
||||
@param Transaction_id
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_RRCConnectionReconfigurationComplete_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
uint8_t* buffer,
|
||||
const uint8_t Transaction_id
|
||||
);
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionSetup-NB DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB1bis-NB) and
|
||||
PhysicalConfigDedicated-NB IEs.
|
||||
@param ctxt_pP Running context
|
||||
@param ue_context_pP UE context
|
||||
@param CC_id Component Carrier ID
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
|
||||
@param transmission_mode Transmission mode for UE (1-9)
|
||||
@param UE_id UE index for this message
|
||||
@param Transaction_id Transaction_ID for this message
|
||||
@param SRB_configList Pointer (returned) to SRB1_config/SRB1bis_config(later) IEs for this UE
|
||||
@param physicalConfigDedicated_NB Pointer (returned) to PhysicalConfigDedicated-NB IE for this UE
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_RRCConnectionSetup_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP,
|
||||
int CC_id,
|
||||
uint8_t* const buffer, //carrier[CC_id].Srb0.Tx_buffer.Payload
|
||||
const uint8_t Transaction_id,
|
||||
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed but not deleted
|
||||
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //in order to be configured--> stanno puntando alla SRB_configlist dell ue_context
|
||||
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT //in order to be configured--> stanno puntando alla physicalConfigDedicated dell ue_context
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* For which SRB is used in NB-IoT??
|
||||
\brief Generate an RRCConnectionReconfiguration-NB DL-DCCH-Message (eNB). This routine configures SRBToAddMod-NB (SRB1) and one DRBToAddMod-NB
|
||||
(DRB3). PhysicalConfigDedicated-NB is not updated.
|
||||
@param ctxt_pP Running context
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
|
||||
@param Transaction_id Transaction_ID for this message
|
||||
@param SRB_list_NB Pointer to SRB List to be added/modified (NULL if no additions/modifications)
|
||||
@param DRB_list_NB Pointer to DRB List to be added/modified (NULL if no additions/modifications)
|
||||
@param DRB_list2_NB Pointer to DRB List to be released (NULL if none to be released)
|
||||
//sps not supported by NB-IoT
|
||||
@param physicalConfigDedicated_NB Pointer to PhysicalConfigDedicated-NB to be modified (NULL if no modifications)
|
||||
//measurement not supported by NB-IoT
|
||||
@param mac_MainConfig Pointer to Mac_MainConfig(NULL if no modifications)
|
||||
//no CBA functionalities
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint16_t
|
||||
do_RRCConnectionReconfiguration_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
uint8_t *buffer,
|
||||
uint8_t Transaction_id,
|
||||
SRB_ToAddModList_NB_r13_t *SRB_list_NB_IoT,
|
||||
DRB_ToAddModList_NB_r13_t *DRB_list_NB_IoT,
|
||||
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB_IoT,
|
||||
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated,
|
||||
MAC_MainConfig_t *mac_MainConfig,
|
||||
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB_IoT);
|
||||
|
||||
/**
|
||||
* E-UTRAN applies the procedure as follows: when only for NB-IoT SRB1 and SRB1bis is established
|
||||
\brief Generate a SecurityModeCommand
|
||||
@param ctxt_pP Running context
|
||||
@param buffer Pointer to PER-encoded ASN.1 description
|
||||
@param Transaction_id Transaction_ID for this message
|
||||
@param cipheringAlgorithm
|
||||
@param integrityProtAlgorithm
|
||||
*/
|
||||
|
||||
uint8_t do_SecurityModeCommand_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t Transaction_id,
|
||||
const uint8_t cipheringAlgorithm,
|
||||
const uint8_t integrityProtAlgorithm);
|
||||
|
||||
/**
|
||||
* E-UTRAN applies the procedure as follows: when only for NB-IoT SRB1 and SRB1bis is established
|
||||
\brief Generate a SecurityModeCommand
|
||||
@param ctxt_pP Running context
|
||||
@param buffer Pointer to PER-encoded ASN.1 description
|
||||
@param Transaction_id Transaction_ID for this message
|
||||
*/
|
||||
|
||||
uint8_t do_UECapabilityEnquiry_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t Transaction_id
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* There is nothing new in this type of message for NB-IoT (only change in some nomenclature)
|
||||
\brief Generate an RRCConnectionReestablishmentReject DL-CCCH-Message (eNB).
|
||||
@param Mod_id Module ID of eNB
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t
|
||||
do_RRCConnectionReestablishmentReject_NB_IoT(
|
||||
uint8_t Mod_id,
|
||||
uint8_t* const buffer);
|
||||
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionReject-NB DL-CCCH-Message (eNB).
|
||||
@param Mod_id Module ID of eNB
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
uint8_t
|
||||
do_RRCConnectionReject_NB_IoT(
|
||||
uint8_t Mod_id,
|
||||
uint8_t* const buffer);
|
||||
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionRelease-NB DL-DCCH-Message
|
||||
@param Mod_id Module ID of eNB
|
||||
@param buffer Pointer to PER-encoded ASN.1 description
|
||||
@param transaction_id Transaction index
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
uint8_t do_RRCConnectionRelease_NB_IoT(uint8_t Mod_id, uint8_t *buffer,int Transaction_id);
|
||||
|
||||
|
||||
uint8_t do_DLInformationTransfer_NB_IoT(
|
||||
uint8_t Mod_id,
|
||||
uint8_t **buffer,
|
||||
uint8_t transaction_id,
|
||||
uint32_t pdu_length,
|
||||
uint8_t *pdu_buffer);
|
||||
|
||||
//for now not implemented since UE side
|
||||
//uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer);
|
||||
|
||||
//for now not implemented since UE side???
|
||||
//OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionReestablishment-NB DL-CCCH Message
|
||||
*@param
|
||||
*
|
||||
*/
|
||||
|
||||
uint8_t do_RRCConnectionReestablishment_NB_IoT(
|
||||
uint8_t Mod_id,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t Transaction_id,
|
||||
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed
|
||||
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT
|
||||
);
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionRelease-NB DL-DCCH-Message (eNB)
|
||||
@param Mod_id Module ID of eNB
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-DCCH-Message PDU
|
||||
@param transaction_id Transaction index
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
|
||||
//uint8_t do_RRCConnectionRelease_NB_IoT(uint8_t Mod_id, uint8_t *buffer,int Transaction_id);
|
||||
@@ -0,0 +1,570 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file RRC/LITE/defs_NB_IoT.h
|
||||
* \brief NB-IoT RRC struct definitions and function prototypes
|
||||
* \author Navid Nikaein, Raymond Knopp and Michele Paffetti
|
||||
* \date 2010 - 2014, 2017
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, michele.paffetti@studio.unibo.it
|
||||
*/
|
||||
|
||||
#ifndef __OPENAIR_RRC_DEFS_NB_IOT_H__
|
||||
#define __OPENAIR_RRC_DEFS_NB_IOT_H__
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "collection/tree.h"
|
||||
#include "rrc_types_NB_IoT.h"
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "COMMON/platform_types.h"
|
||||
#include "targets/COMMON/openairinterface5g_limits.h"
|
||||
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
|
||||
//-----NB-IoT #include files-------
|
||||
|
||||
//#include "SystemInformationBlockType1-NB.h"
|
||||
//#include "SystemInformation-NB.h"
|
||||
#include "RRCConnectionReconfiguration-NB.h"
|
||||
#include "RRCConnectionReconfigurationComplete-NB.h"
|
||||
#include "RRCConnectionSetup-NB.h"
|
||||
#include "RRCConnectionSetupComplete-NB.h"
|
||||
#include "RRCConnectionRequest-NB.h"
|
||||
#include "RRCConnectionReestablishmentRequest-NB.h"
|
||||
#include "BCCH-DL-SCH-Message-NB.h"
|
||||
#include "BCCH-BCH-Message-NB.h"
|
||||
#include "AS-Config-NB.h"
|
||||
#include "AS-Context-NB.h"
|
||||
#include "UE-Capability-NB-r13.h" //equivalent of UE-EUTRA-Capability.h
|
||||
//-------------------
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
/* TODO: be sure this include is correct.
|
||||
* It solves a problem of compilation of the RRH GW,
|
||||
* issue #186.
|
||||
*/
|
||||
#if !defined(ENABLE_ITTI)
|
||||
# include "as_message.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# include "commonDef.h"
|
||||
#endif
|
||||
|
||||
#if ENABLE_RAL
|
||||
# include "collection/hashtable/obj_hashtable.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
|
||||
|
||||
typedef unsigned int uid_NB_IoT_t;
|
||||
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NB_IoT (((NUMBER_OF_UE_MAX_NB_IoT/8)/sizeof(unsigned int)) + 1)
|
||||
|
||||
typedef struct uid_linear_allocator_NB_IoT_s {
|
||||
unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NB_IoT];
|
||||
} uid_allocator_NB_IoT_t;
|
||||
|
||||
|
||||
#define PROTOCOL_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
|
||||
#define PROTOCOL_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
|
||||
|
||||
#define PROTOCOL_RRC_CTXT_FMT PROTOCOL_CTXT_FMT
|
||||
#define PROTOCOL_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
|
||||
|
||||
|
||||
//left as they are --> used in LAYER2/epenair2_proc.c and UE side
|
||||
typedef enum UE_STATE_NB_IoT_e {
|
||||
RRC_INACTIVE_NB_IoT=0,
|
||||
RRC_IDLE_NB_IoT,
|
||||
RRC_SI_RECEIVED_NB_IoT,
|
||||
RRC_CONNECTED_NB_IoT,
|
||||
RRC_RECONFIGURED_NB_IoT,
|
||||
RRC_HO_EXECUTION_NB_IoT //maybe not needed?
|
||||
} UE_STATE_NB_IoT_t;
|
||||
|
||||
|
||||
/** @defgroup _rrc RRC
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
typedef struct UE_RRC_INFO_NB_IoT_s {
|
||||
UE_STATE_NB_IoT_t State;
|
||||
uint8_t SIB1systemInfoValueTag;
|
||||
uint32_t SIStatus;
|
||||
uint32_t SIcnt;
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
|
||||
#endif
|
||||
uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
|
||||
uint8_t handoverTarget;
|
||||
//HO_STATE_t ho_state;
|
||||
uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
|
||||
unsigned short UE_index;
|
||||
uint32_t T300_active;
|
||||
uint32_t T300_cnt;
|
||||
uint32_t T304_active;
|
||||
uint32_t T304_cnt;
|
||||
uint32_t T310_active;
|
||||
uint32_t T310_cnt;
|
||||
uint32_t N310_cnt;
|
||||
uint32_t N311_cnt;
|
||||
rnti_t rnti;
|
||||
} __attribute__ ((__packed__)) UE_RRC_INFO_NB_IoT;
|
||||
|
||||
//#define NUM_PRECONFIGURED_LCHAN (NB_CH_CX*2) //BCCH, CCCH
|
||||
|
||||
#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
|
||||
#define UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
|
||||
|
||||
|
||||
|
||||
// HO_STATE is not supported by NB-IoT
|
||||
|
||||
//#define NUMBER_OF_UE_MAX MAX_MOBILES_PER_RG
|
||||
#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; }
|
||||
#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n )
|
||||
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
|
||||
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
|
||||
|
||||
//Measurement Report not supported in NB-IoT
|
||||
|
||||
#define PAYLOAD_SIZE_MAX 1024
|
||||
#define RRC_BUF_SIZE 255
|
||||
#define UNDEF_SECURITY_MODE 0xff
|
||||
#define NO_SECURITY_MODE 0x20
|
||||
|
||||
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
|
||||
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
|
||||
typedef struct UE_S_TMSI_NB_IoT_s {
|
||||
boolean_t presence;
|
||||
mme_code_t mme_code;
|
||||
m_tmsi_t m_tmsi;
|
||||
} __attribute__ ((__packed__)) UE_S_TMSI_NB_IoT;
|
||||
|
||||
|
||||
typedef enum e_rab_satus_NB_IoT_e {
|
||||
E_RAB_STATUS_NEW_NB_IoT,
|
||||
E_RAB_STATUS_DONE_NB_IoT, // from the eNB perspective
|
||||
E_RAB_STATUS_ESTABLISHED_NB_IoT, // get the reconfigurationcomplete form UE
|
||||
E_RAB_STATUS_FAILED_NB_IoT,
|
||||
} e_rab_status_NB_IoT_t;
|
||||
|
||||
typedef struct e_rab_param_NB_IoT_s {
|
||||
e_rab_t param;
|
||||
uint8_t status;
|
||||
uint8_t xid; // transaction_id
|
||||
} __attribute__ ((__packed__)) e_rab_param_NB_IoT_t;
|
||||
|
||||
|
||||
//HANDOVER_INFO not implemented in NB-IoT delete
|
||||
|
||||
|
||||
#define RRC_HEADER_SIZE_MAX 64
|
||||
#define RRC_BUFFER_SIZE_MAX 1024
|
||||
|
||||
typedef struct {
|
||||
char Payload[RRC_BUFFER_SIZE_MAX];
|
||||
char Header[RRC_HEADER_SIZE_MAX];
|
||||
char payload_size;
|
||||
} RRC_BUFFER_NB_IoT;
|
||||
|
||||
#define RRC_BUFFER_SIZE_NB_IoT sizeof(RRC_BUFFER_NB_IoT)
|
||||
|
||||
|
||||
typedef struct RB_INFO_NB_IoT_s {
|
||||
uint16_t Rb_id; //=Lchan_id
|
||||
//LCHAN_DESC Lchan_desc[2]; no more used
|
||||
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
|
||||
} RB_INFO_NB_IoT;
|
||||
|
||||
typedef struct SRB_INFO_NB_IoT_s {
|
||||
uint16_t Srb_id; //=Lchan_id---> useful for distinguish between SRB1 and SRB1bis?
|
||||
RRC_BUFFER_NB_IoT Rx_buffer;
|
||||
RRC_BUFFER_NB_IoT Tx_buffer;
|
||||
//LCHAN_DESC Lchan_desc[2]; no more used
|
||||
unsigned int Trans_id;
|
||||
uint8_t Active;
|
||||
} SRB_INFO_NB_IoT;
|
||||
|
||||
|
||||
typedef struct RB_INFO_TABLE_ENTRY_NB_IoT_s {
|
||||
RB_INFO_NB_IoT Rb_info;
|
||||
uint8_t Active;
|
||||
uint32_t Next_check_frame;
|
||||
uint8_t Status;
|
||||
} RB_INFO_TABLE_ENTRY_NB_IoT;
|
||||
|
||||
typedef struct SRB_INFO_TABLE_ENTRY_NB_IoT_s {
|
||||
SRB_INFO_NB_IoT Srb_info;
|
||||
uint8_t Active;
|
||||
uint8_t Status;
|
||||
uint32_t Next_check_frame;
|
||||
} SRB_INFO_TABLE_ENTRY_NB_IoT;
|
||||
|
||||
//MEAS_REPORT_LIST_s not implemented in NB-IoT but is used at UE side
|
||||
//HANDOVER_INFO_UE not implemented in NB-IoT
|
||||
typedef struct HANDOVER_INFO_UE_NB_IoT_s {
|
||||
PhysCellId_t targetCellId;
|
||||
uint8_t measFlag;
|
||||
} HANDOVER_INFO_UE_NB_IoT;
|
||||
|
||||
//NB-IoT eNB_RRC_UE_NB_IoT_s--(used as a context in eNB --> ue_context in rrc_eNB_ue_context)------
|
||||
typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
|
||||
EstablishmentCause_t establishment_cause;
|
||||
uint8_t primaryCC_id;
|
||||
//in NB-IoT only SRB0, SRB1 and SRB1bis (until AS security activation) exist
|
||||
|
||||
/*MP: Concept behind List and List2
|
||||
*
|
||||
* SRB_configList --> is used for the actual list of SRBs that is managed/that should be send over the RRC message
|
||||
* SRB_configList2--> refers to all the SRBs configured for that specific transaction identifier
|
||||
* this because in a single transaction one or more SRBs could be established
|
||||
* and you want to keep memory on what happen for every transaction
|
||||
* Transaction ID (xid): is used to associate the proper RRC....Complete message received by the UE to the corresponding
|
||||
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
|
||||
* this because it could happen that more messages are transmitted at the same time
|
||||
*/
|
||||
SRB_ToAddModList_NB_r13_t* SRB_configList;//for SRB1 and SRB1bis
|
||||
SRB_ToAddModList_NB_r13_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
DRB_ToAddModList_NB_r13_t* DRB_configList; //for all the DRBs
|
||||
DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
|
||||
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
|
||||
|
||||
struct PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT;
|
||||
MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT;
|
||||
|
||||
//No SPS(semi-persistent scheduling) in NB-IoT
|
||||
//No Measurement report in NB-IoT
|
||||
|
||||
SRB_INFO_NB_IoT SI;
|
||||
SRB_INFO_NB_IoT Srb0;
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1;
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1bis;
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* KeNB as derived from KASME received from EPC */
|
||||
uint8_t kenb[32];
|
||||
#endif
|
||||
|
||||
/* Used integrity/ciphering algorithms--> maintained the same for NB-IoT */
|
||||
e_CipheringAlgorithm_r12 ciphering_algorithm; //Specs. TS 36.331 V14.1.0 pag 432 Change position of chipering enumerative w.r.t previous version
|
||||
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
|
||||
uint8_t Status;
|
||||
rnti_t rnti;
|
||||
uint64_t random_ue_identity;
|
||||
|
||||
|
||||
|
||||
/* Information from UE RRC ConnectionRequest-NB-r13_IE--> NB-IoT */
|
||||
UE_S_TMSI_NB_IoT Initialue_identity_s_TMSI;
|
||||
EstablishmentCause_NB_r13_t establishment_cause_NB_IoT; //different set for NB-IoT
|
||||
|
||||
/* Information from UE RRC ConnectionReestablishmentRequest-NB--> NB-IoT */
|
||||
ReestablishmentCause_NB_r13_t reestablishment_cause_NB_IoT; //different set for NB_IoT
|
||||
|
||||
/* UE id for initial connection to S1AP */
|
||||
uint16_t ue_initial_id;
|
||||
|
||||
/* Information from S1AP initial_context_setup_req */
|
||||
uint32_t eNB_ue_s1ap_id :24;
|
||||
|
||||
security_capabilities_t security_capabilities;
|
||||
|
||||
/* Total number of e_rab already setup in the list */ //NAS list?
|
||||
uint8_t setup_e_rabs;
|
||||
/* Number of e_rab to be setup in the list */ //NAS list?
|
||||
uint8_t nb_of_e_rabs;
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_param_NB_IoT_t e_rab[NB_RB_MAX_NB_IOT];//[S1AP_MAX_E_RAB];
|
||||
|
||||
// LG: For GTPV1 TUNNELS
|
||||
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
|
||||
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
|
||||
|
||||
//Which timers are referring to?
|
||||
uint32_t ul_failure_timer;
|
||||
uint32_t ue_release_timer;
|
||||
//threshold of the release timer--> set in RRCConnectionRelease
|
||||
uint32_t ue_release_timer_thres;
|
||||
} eNB_RRC_UE_NB_IoT_t;
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
typedef uid_NB_IoT_t ue_uid_t;
|
||||
|
||||
|
||||
//generally variable called: ue_context_pP
|
||||
typedef struct rrc_eNB_ue_context_NB_IoT_s {
|
||||
|
||||
/* Tree related data */
|
||||
RB_ENTRY(rrc_eNB_ue_context_NB_IoT_s) entries;
|
||||
|
||||
/* Uniquely identifies the UE between MME and eNB within the eNB.
|
||||
* This id is encoded on 24bits.
|
||||
*/
|
||||
rnti_t ue_id_rnti;
|
||||
|
||||
// another key for protocol layers but should not be used as a key for RB tree
|
||||
ue_uid_t local_uid;
|
||||
|
||||
/* UE id for initial connection to S1AP */
|
||||
struct eNB_RRC_UE_NB_IoT_s ue_context; //context of ue in the e-nB
|
||||
|
||||
} rrc_eNB_ue_context_NB_IoT_t;
|
||||
|
||||
|
||||
|
||||
//---NB-IoT (completely changed)-------------------------------
|
||||
//called "carrier"--> data from PHY layer
|
||||
typedef struct {
|
||||
|
||||
// buffer that contains the encoded messages
|
||||
uint8_t *MIB_NB_IoT;
|
||||
uint8_t sizeof_MIB_NB_IoT;
|
||||
|
||||
uint8_t *SIB1_NB_IoT;
|
||||
uint8_t sizeof_SIB1_NB_IoT;
|
||||
uint8_t *SIB23_NB_IoT;
|
||||
uint8_t sizeof_SIB23_NB_IoT;
|
||||
|
||||
|
||||
//not actually implemented in OAI
|
||||
uint8_t *SIB4_NB_IoT;
|
||||
uint8_t sizeof_SIB4_NB_IoT;
|
||||
uint8_t *SIB5_NB_IoT;
|
||||
uint8_t sizeof_SIB5_NB_IoT;
|
||||
uint8_t *SIB14_NB_IoT;
|
||||
uint8_t sizeof_SIB14_NB_IoT;
|
||||
uint8_t *SIB16_NB_IoT;
|
||||
uint8_t sizeof_SIB16_NB_IoT;
|
||||
|
||||
//TS 36.331 V14.2.1
|
||||
// uint8_t *SIB15_NB;
|
||||
// uint8_t sizeof_SIB15_NB;
|
||||
// uint8_t *SIB20_NB;
|
||||
// uint8_t sizeof_SIB20_NB;
|
||||
// uint8_t *SIB22_NB;
|
||||
// uint8_t sizeof_SIB22_NB;
|
||||
|
||||
//implicit parameters needed
|
||||
int Ncp; //cyclic prefix for DL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int p_eNB; //number of tx antenna port
|
||||
int p_rx_eNB; //number of receiving antenna ports
|
||||
uint32_t dl_CarrierFreq; //detected by the UE
|
||||
uint32_t ul_CarrierFreq; //detected by the UE
|
||||
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
|
||||
|
||||
//are the only static one (memory has been already allocated)
|
||||
BCCH_BCH_Message_NB_t mib_NB_IoT;
|
||||
BCCH_DL_SCH_Message_NB_t siblock1_NB_IoT; //SIB1-NB
|
||||
BCCH_DL_SCH_Message_NB_t systemInformation_NB_IoT; //SI
|
||||
|
||||
SystemInformationBlockType1_NB_t *sib1_NB_IoT;
|
||||
SystemInformationBlockType2_NB_r13_t *sib2_NB_IoT;
|
||||
SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
|
||||
//not implemented yet
|
||||
SystemInformationBlockType4_NB_r13_t *sib4_NB_IoT;
|
||||
SystemInformationBlockType5_NB_r13_t *sib5_NB_IoT;
|
||||
SystemInformationBlockType14_NB_r13_t *sib14_NB_IoT;
|
||||
SystemInformationBlockType16_NB_r13_t *sib16_NB_IoT;
|
||||
|
||||
|
||||
SRB_INFO_NB_IoT SI;
|
||||
SRB_INFO_NB_IoT Srb0;
|
||||
|
||||
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
|
||||
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
|
||||
SRB_INFO_NB_IoT MCCH_MESS[8];// MAX_MBSFN_AREA
|
||||
/*future implementation TS 36.331 V14.2.1
|
||||
SystemInformationBlockType15_NB_r14_t *sib15;
|
||||
SystemInformationBlockType20_NB_r14_t *sib20;
|
||||
SystemInformationBlockType22_NB_r14_t *sib22;
|
||||
|
||||
uint8_t SCPTM_flag;
|
||||
uint8_t sizeof_SC_MCHH_MESS[];
|
||||
SC_MCCH_Message_NB_t scptm;*/
|
||||
|
||||
|
||||
} rrc_eNB_carrier_data_NB_IoT_t;
|
||||
//---------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//---NB-IoT---(completely change)---------------------
|
||||
typedef struct eNB_RRC_INST_NB_IoT_s {
|
||||
|
||||
rrc_eNB_carrier_data_NB_IoT_t carrier[MAX_NUM_CCs];
|
||||
|
||||
uid_allocator_NB_IoT_t uid_allocator; // for rrc_ue_head
|
||||
RB_HEAD(rrc_ue_tree_NB_IoT_s, rrc_eNB_ue_context_NB_IoT_s) rrc_ue_head; // ue_context tree key search by rnti
|
||||
|
||||
uint8_t Nb_ue;
|
||||
|
||||
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
|
||||
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
|
||||
|
||||
//RRC configuration
|
||||
RrcConfigurationReq configuration; //rrc_messages_types.h
|
||||
|
||||
// other PLMN parameters
|
||||
/// Mobile country code
|
||||
int mcc;
|
||||
/// Mobile network code
|
||||
int mnc;
|
||||
/// number of mnc digits
|
||||
int mnc_digit_length;
|
||||
|
||||
// other RAN parameters //FIXME: to be checked--> depends on APP layer
|
||||
int srb1_timer_poll_retransmit;
|
||||
int srb1_max_retx_threshold;
|
||||
int srb1_timer_reordering;
|
||||
int srb1_timer_status_prohibit;
|
||||
int srs_enable[MAX_NUM_CCs];
|
||||
|
||||
|
||||
} eNB_RRC_INST_NB_IoT;
|
||||
|
||||
#define RRC_HEADER_SIZE_MAX_NB_IoT 64
|
||||
#define MAX_UE_CAPABILITY_SIZE_NB_IoT 255
|
||||
|
||||
//not needed for the moment
|
||||
typedef struct OAI_UECapability_NB_IoT_s {
|
||||
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
|
||||
uint8_t sdu_size;
|
||||
////NB-IoT------
|
||||
UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
|
||||
} OAI_UECapability_NB_IoT_t;
|
||||
|
||||
#define RRC_BUFFER_SIZE_MAX_NB_IoT 1024
|
||||
|
||||
|
||||
|
||||
typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
Rrc_State_NB_IoT_t RrcState;
|
||||
Rrc_Sub_State_NB_IoT_t RrcSubState;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
plmn_t plmnID;
|
||||
Byte_t rat;
|
||||
as_nas_info_t initialNasMsg;
|
||||
# endif
|
||||
OAI_UECapability_NB_IoT_t *UECap;
|
||||
uint8_t *UECapability;
|
||||
uint8_t UECapability_size;
|
||||
|
||||
UE_RRC_INFO_NB_IoT Info[NB_SIG_CNX_UE];
|
||||
|
||||
SRB_INFO_NB_IoT Srb0[NB_SIG_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1[NB_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb2[NB_CNX_UE];
|
||||
HANDOVER_INFO_UE_NB_IoT HandoverInfoUe;
|
||||
/*
|
||||
uint8_t *SIB1[NB_CNX_UE];
|
||||
uint8_t sizeof_SIB1[NB_CNX_UE];
|
||||
uint8_t *SI[NB_CNX_UE];
|
||||
uint8_t sizeof_SI[NB_CNX_UE];
|
||||
uint8_t SIB1Status[NB_CNX_UE];
|
||||
uint8_t SIStatus[NB_CNX_UE];
|
||||
SystemInformationBlockType1_t *sib1[NB_CNX_UE];
|
||||
SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI().
|
||||
*/
|
||||
SystemInformationBlockType2_t *sib2[NB_CNX_UE];
|
||||
/*
|
||||
SystemInformationBlockType3_t *sib3[NB_CNX_UE];
|
||||
SystemInformationBlockType4_t *sib4[NB_CNX_UE];
|
||||
SystemInformationBlockType5_t *sib5[NB_CNX_UE];
|
||||
SystemInformationBlockType6_t *sib6[NB_CNX_UE];
|
||||
SystemInformationBlockType7_t *sib7[NB_CNX_UE];
|
||||
SystemInformationBlockType8_t *sib8[NB_CNX_UE];
|
||||
SystemInformationBlockType9_t *sib9[NB_CNX_UE];
|
||||
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
|
||||
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
uint8_t MBMS_flag;
|
||||
uint8_t *MCCH_MESSAGE[NB_CNX_UE];
|
||||
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
|
||||
uint8_t MCCH_MESSAGEStatus[NB_CNX_UE];
|
||||
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
|
||||
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
|
||||
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
|
||||
#endif
|
||||
#ifdef CBA
|
||||
uint8_t num_active_cba_groups;
|
||||
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
|
||||
#endif
|
||||
uint8_t num_srb;
|
||||
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
|
||||
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
|
||||
struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8];
|
||||
rb_id_t *defaultDRB; // remember the ID of the default DRB
|
||||
MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
|
||||
struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
|
||||
*/
|
||||
struct QuantityConfig *QuantityConfig[NB_CNX_UE];
|
||||
/*
|
||||
struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID];
|
||||
MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID];
|
||||
uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells
|
||||
RSRP_Range_t s_measure;
|
||||
struct MeasConfig__speedStatePars *speedStatePars;
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE];
|
||||
struct SPS_Config *sps_Config[NB_CNX_UE];
|
||||
MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE];
|
||||
MeasGapConfig_t *measGapConfig[NB_CNX_UE];
|
||||
double filter_coeff_rsrp; // [7] ???
|
||||
double filter_coeff_rsrq; // [7] ???
|
||||
float rsrp_db[7];
|
||||
float rsrq_db[7];
|
||||
float rsrp_db_filtered[7];
|
||||
float rsrq_db_filtered[7];
|
||||
#if ENABLE_RAL
|
||||
obj_hash_table_t *ral_meas_thresholds;
|
||||
ral_transaction_id_t scan_transaction_id;
|
||||
#endif
|
||||
#if defined(ENABLE_SECURITY)
|
||||
// KeNB as computed from parameters within USIM card //
|
||||
uint8_t kenb[32];
|
||||
#endif
|
||||
|
||||
// Used integrity/ciphering algorithms //
|
||||
CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
*/
|
||||
} UE_RRC_INST_NB_IoT;
|
||||
|
||||
|
||||
#include "proto_NB_IoT.h" //should be put here otherwise compilation error
|
||||
|
||||
#endif
|
||||
/** @} */
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file vars.h
|
||||
* \brief rrc external vars
|
||||
* \author Navid Nikaein and Raymond Knopp, Michele Paffetti
|
||||
* \date 2011-2017
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
|
||||
*/
|
||||
|
||||
#ifndef __OPENAIR_RRC_EXTERN_NB_IOT_H__
|
||||
#define __OPENAIR_RRC_EXTERN_NB_IOT_H__
|
||||
#include "RRC/LITE/defs_NB_IoT.h"
|
||||
#include "PHY_INTERFACE/IF_Module_NB_IoT.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "LogicalChannelConfig-NB-r13.h"
|
||||
#include "LAYER2/MAC/defs_NB_IoT.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
|
||||
//MP: NOTE:XXX some of the parameters defined in vars_nb_iot are called by the extern.h file so not replicated here
|
||||
|
||||
extern UE_RRC_INST_NB_IoT *UE_rrc_inst_NB_IoT;
|
||||
|
||||
extern eNB_RRC_INST_NB_IoT *eNB_rrc_inst_NB_IoT;
|
||||
extern PHY_Config_NB_IoT_t *config_INFO;
|
||||
|
||||
extern rlc_info_t Rlc_info_am_NB_IoT,Rlc_info_am_config_NB_IoT;
|
||||
extern uint8_t DRB2LCHAN_NB_IoT[2];
|
||||
extern LogicalChannelConfig_NB_r13_t SRB1bis_logicalChannelConfig_defaultValue_NB_IoT;
|
||||
extern LogicalChannelConfig_NB_r13_t SRB1_logicalChannelConfig_defaultValue_NB_IoT;
|
||||
|
||||
extern uint16_t T300_NB_IoT[8];
|
||||
extern uint16_t T301_NB_IoT[8];
|
||||
extern uint16_t T310_NB_IoT[8];
|
||||
extern uint16_t T311_NB_IoT[8];
|
||||
extern uint16_t N310_NB_IoT[8];
|
||||
extern uint16_t N311_NB_IoT[8];
|
||||
extern uint8_t *get_NB_IoT_MIB(struct eNB_RRC_INST_NB_IoT_s *nb_iot_rrc);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -410,6 +410,7 @@ rrc_data_req(
|
||||
);
|
||||
|
||||
uint8_t
|
||||
|
||||
rrc_data_req_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
@@ -420,6 +421,7 @@ rrc_data_req_ue(
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file proto_NB_IoT.h
|
||||
* \brief RRC functions prototypes for eNB and UE for NB-IoT
|
||||
* \author Navid Nikaein, Raymond Knopp and Michele Paffetti
|
||||
* \date 2010 - 2014
|
||||
* \email navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
|
||||
* \version 1.0
|
||||
|
||||
*/
|
||||
/** \addtogroup _rrc
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "RRC/LITE/defs_NB_IoT.h"
|
||||
#include "pdcp.h"
|
||||
#include "rlc.h"
|
||||
#include "extern_NB_IoT.h"
|
||||
#include "LAYER2/MAC/defs_NB_IoT.h"
|
||||
/*NOTE: no static function should be declared in this header file (e.g. init_SI_NB)*/
|
||||
|
||||
/*------------------------common_nb_iot.c----------------------------------------*/
|
||||
|
||||
/** \brief configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs
|
||||
*/
|
||||
void openair_rrc_on_NB_IoT(const protocol_ctxt_t* const ctxt_pP);
|
||||
|
||||
void rrc_config_buffer_NB_IoT(SRB_INFO_NB_IoT *srb_info, uint8_t Lchan_type, uint8_t Role);
|
||||
|
||||
int L3_xface_init_NB_IoT(void);
|
||||
|
||||
void openair_rrc_top_init_eNB_NB_IoT(void);
|
||||
|
||||
//void rrc_top_cleanup(void); -->seems not to be used
|
||||
|
||||
//rrc_t310_expiration-->seems not to be used
|
||||
|
||||
/** \brief Function to update timers every subframe. For UE it updates T300,T304 and T310.
|
||||
@param ctxt_pP running context
|
||||
@param enb_index
|
||||
@param CC_id
|
||||
*/
|
||||
RRC_status_t rrc_rx_tx_NB_IoT(protocol_ctxt_t* const ctxt_pP, const uint8_t enb_index, const int CC_id);
|
||||
|
||||
//long binary_search_int(int elements[], long numElem, int value);--> seems not to be used
|
||||
//long binary_search_float(float elements[], long numElem, float value);--> used only at UE side
|
||||
|
||||
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
|
||||
//defined in L2_interface
|
||||
//called by rx_sdu only in case of CCCH message (e.g RRCConnectionRequest-NB)
|
||||
int8_t mac_rrc_data_ind_eNB_NB_IoT(
|
||||
const module_id_t module_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t sub_frameP,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,//could be skipped since always go through the CCCH channel
|
||||
const uint8_t* sduP,
|
||||
const sdu_size_t sdu_lenP
|
||||
);
|
||||
//-------------------------------------------
|
||||
|
||||
//defined in L2_interface
|
||||
void dump_ue_list_NB_IoT(UE_list_NB_IoT_t *listP, int ul_flag);
|
||||
//-------------------------------------------
|
||||
|
||||
|
||||
//defined in L2_interface
|
||||
void mac_eNB_rrc_ul_failure_NB_IoT(
|
||||
const module_id_t mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP);
|
||||
//------------------------------------------
|
||||
|
||||
//defined in eNB_scheduler_primitives.c
|
||||
int rrc_mac_remove_ue_NB_IoT(
|
||||
module_id_t mod_idP,
|
||||
rnti_t rntiP);
|
||||
//------------------------------------------
|
||||
//defined in L2_interface
|
||||
void mac_eNB_rrc_ul_in_sync_NB_IoT(
|
||||
const module_id_t mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP);
|
||||
//------------------------------------------
|
||||
//defined in L2_interface
|
||||
int mac_eNB_get_rrc_status_NB_IoT(
|
||||
const module_id_t Mod_idP,
|
||||
const rnti_t rntiP
|
||||
);
|
||||
//---------------------------
|
||||
|
||||
|
||||
/*-----------eNB procedures (rrc_eNB_nb_iot.c)---------------*/
|
||||
|
||||
//---Initialization--------------
|
||||
void openair_eNB_rrc_on_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP
|
||||
);
|
||||
|
||||
void rrc_config_buffer_NB_IoT(
|
||||
SRB_INFO_NB_IoT* Srb_info,
|
||||
uint8_t Lchan_type,
|
||||
uint8_t Role
|
||||
);
|
||||
|
||||
char openair_rrc_eNB_configuration_NB_IoT(
|
||||
const module_id_t enb_mod_idP,
|
||||
NbIoTRrcConfigurationReq* configuration
|
||||
);
|
||||
|
||||
//-----------------------------
|
||||
/**\brief RRC eNB task. (starting of the RRC state machine)
|
||||
\param void *args_p Pointer on arguments to start the task. */
|
||||
void *rrc_enb_task_NB_IoT(void *args_p);
|
||||
|
||||
/**\brief Entry routine to decode a UL-CCCH-Message-NB. Invokes PER decoder and parses message.
|
||||
\param ctxt_pP Running context
|
||||
\param Srb_info Pointer to SRB0 information structure (buffer, etc.)*/
|
||||
int rrc_eNB_decode_ccch_NB_IoT(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
const SRB_INFO_NB_IoT* const Srb_info,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
/**\brief Entry routine to decode a UL-DCCH-Message-NB. Invokes PER decoder and parses message.
|
||||
\param ctxt_pP Context
|
||||
\param Rx_sdu Pointer Received Message
|
||||
\param sdu_size Size of incoming SDU*/
|
||||
int rrc_eNB_decode_dcch_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t* const Rx_sdu,
|
||||
const sdu_size_t sdu_sizeP
|
||||
);
|
||||
|
||||
/**\brief Generate RRCConnectionReestablishmentReject-NB
|
||||
\param ctxt_pP Running context
|
||||
\param ue_context_pP UE context
|
||||
\param CC_id Component Carrier ID*/
|
||||
void rrc_eNB_generate_RRCConnectionReestablishmentReject_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
void rrc_eNB_generate_RRCConnectionReject_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
void rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* ue_context_pP,
|
||||
const uint8_t xid //transaction identifier
|
||||
);
|
||||
|
||||
|
||||
void //was under ITTI
|
||||
rrc_eNB_reconfigure_DRBs_NB_IoT(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* ue_context_pP);
|
||||
|
||||
void //was under ITTI
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP
|
||||
// const uint8_t ho_state
|
||||
);
|
||||
|
||||
void rrc_eNB_process_RRCConnectionSetupComplete_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* ue_context_pP,
|
||||
RRCConnectionSetupComplete_NB_r13_IEs_t * rrcConnectionSetupComplete_NB
|
||||
);
|
||||
|
||||
void rrc_eNB_generate_SecurityModeCommand_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP
|
||||
);
|
||||
|
||||
void rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP
|
||||
);
|
||||
|
||||
void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP
|
||||
//no HO flag
|
||||
);
|
||||
|
||||
|
||||
/// Utilities------------------------------------------------
|
||||
|
||||
void rrc_eNB_free_UE_NB_IoT(
|
||||
const module_id_t enb_mod_idP,
|
||||
const struct rrc_eNB_ue_context_NB_IoT_s* const ue_context_pP
|
||||
);
|
||||
|
||||
void rrc_eNB_free_mem_UE_context_NB_IoT(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
struct rrc_eNB_ue_context_NB_IoT_s* const ue_context_pP
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**\brief Function to get the next transaction identifier.
|
||||
\param module_idP Instance ID for CH/eNB
|
||||
\return a transaction identifier*/
|
||||
uint8_t rrc_eNB_get_next_transaction_identifier_NB_IoT(module_id_t module_idP);
|
||||
|
||||
|
||||
int rrc_init_global_param_NB_IoT(void);
|
||||
|
||||
//L2_interface.c
|
||||
int8_t mac_rrc_data_req_eNB_NB_IoT(
|
||||
const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const frame_t h_frameP,
|
||||
const sub_frame_t subframeP, //need for the case in which both SIB1-NB_IoT and SIB23-NB_IoT will be scheduled in the same frame
|
||||
const rb_id_t Srb_id,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t flag
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file rrc_types.h
|
||||
* \brief rrc types and subtypes
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2011 - 2014
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef RRC_TYPES_NB_IOT_H_
|
||||
#define RRC_TYPES_NB_IOT_H_
|
||||
|
||||
typedef enum Rrc_State_NB_IoT_e {
|
||||
RRC_STATE_INACTIVE_NB_IoT=0,
|
||||
RRC_STATE_IDLE_NB_IoT,
|
||||
RRC_STATE_CONNECTED_NB_IoT,
|
||||
|
||||
RRC_STATE_FIRST_NB_IoT = RRC_STATE_INACTIVE_NB_IoT,
|
||||
RRC_STATE_LAST_NB_IoT = RRC_STATE_CONNECTED_NB_IoT,
|
||||
} Rrc_State_NB_IoT_t;
|
||||
|
||||
typedef enum Rrc_Sub_State_NB_IoT_e {
|
||||
RRC_SUB_STATE_INACTIVE_NB_IoT=0,
|
||||
|
||||
RRC_SUB_STATE_IDLE_SEARCHING_NB_IoT,
|
||||
RRC_SUB_STATE_IDLE_RECEIVING_SIB_NB_IoT,
|
||||
RRC_SUB_STATE_IDLE_SIB_COMPLETE_NB_IoT,
|
||||
RRC_SUB_STATE_IDLE_CONNECTING_NB_IoT,
|
||||
RRC_SUB_STATE_IDLE_NB_IoT,
|
||||
|
||||
RRC_SUB_STATE_CONNECTED_NB_IoT,
|
||||
|
||||
RRC_SUB_STATE_INACTIVE_FIRST_NB_IoT = RRC_SUB_STATE_INACTIVE_NB_IoT,
|
||||
RRC_SUB_STATE_INACTIVE_LAST_NB_IoT = RRC_SUB_STATE_INACTIVE_NB_IoT,
|
||||
|
||||
RRC_SUB_STATE_IDLE_FIRST_NB_IoT = RRC_SUB_STATE_IDLE_SEARCHING_NB_IoT,
|
||||
RRC_SUB_STATE_IDLE_LAST_NB_IoT = RRC_SUB_STATE_IDLE_NB_IoT,
|
||||
|
||||
RRC_SUB_STATE_CONNECTED_FIRST_NB_IoT = RRC_SUB_STATE_CONNECTED_NB_IoT,
|
||||
RRC_SUB_STATE_CONNECTED_LAST_NB_IoT = RRC_SUB_STATE_CONNECTED_NB_IoT,
|
||||
} Rrc_Sub_State_NB_IoT_t;
|
||||
|
||||
#endif /* RRC_TYPES_H_ */
|
||||
Reference in New Issue
Block a user