L2_nr_interface.c 2.59 KB
Newer Older
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * 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.1  (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
 */

22
/*! \file L2_nr_interface.c
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
23 24 25 26 27 28 29 30
 * \brief layer 2 interface, used to support different RRC sublayer
 * \author Raymond Knopp and Navid Nikaein, WEI-TAI CHEN
 * \date 2010-2014, 2018
 * \version 1.0
 * \company Eurecom, NTUST
 * \email: raymond.knopp@eurecom.fr, kroempa@gmail.com
 */

31
#include "platform_types.h"
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
32 33
#include "nr_rrc_defs.h"
#include "nr_rrc_extern.h"
Raymond Knopp's avatar
Raymond Knopp committed
34
#include "common/utils/LOG/log.h"
35
#include "common/ran_context.h"
36 37
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
38 39 40
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
41

42
#include "intertask_interface.h"
43

44 45
#include "uper_encoder.h"

Raymond Knopp's avatar
Raymond Knopp committed
46 47
#include "NR_MIB.h"
#include "NR_BCCH-BCH-Message.h"
rmagueta's avatar
rmagueta committed
48
#include "rrc_gNB_UE_context.h"
49
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
50
#include "nr_pdcp/nr_pdcp_oai_api.h"
51

Raymond Knopp's avatar
Raymond Knopp committed
52

53 54
extern RAN_CONTEXT_t RC;

55 56 57 58
int8_t nr_mac_rrc_bwp_switch_req(const module_id_t     module_idP,
                                 const frame_t         frameP,
                                 const sub_frame_t     sub_frameP,
                                 const rnti_t          rntiP,
59 60
                                 const int             dl_bwp_id,
                                 const int             ul_bwp_id) {
61
  rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context_by_rnti(RC.nrrrc[module_idP], rntiP);
62 63 64

  protocol_ctxt_t ctxt;
  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, GNB_FLAG_YES, rntiP, frameP, sub_frameP, 0);
65
  nr_rrc_reconfiguration_req(ue_context_p, &ctxt, dl_bwp_id, ul_bwp_id);
rmagueta's avatar
rmagueta committed
66 67

  return 0;
68
}