---
apiVersion: v1
kind: ConfigMap 
metadata:
  name: srsenb-configmap
data:
  enb.conf: |
    [enb]
    enb_id = 0x19B
    # following parameters seems deprecated in srsLTE
    #cell_id = 0x01
    #phy_cell_id = 1
    #tac = 0x0007
    mcc = 001
    mnc = 01
    mme_addr = 127.0.1.100
    gtp_bind_addr = 127.0.1.1
    s1c_bind_addr = 127.0.1.1
    n_prb = 25   
    # starting with SISO
    tm = 1
    nof_ports = 1

    [enb_files]
    sib_config = sib.conf
    rr_config  = rr.conf
    drb_config = drb.conf

    [rf]
    dl_earfcn = 3400
    tx_gain = 80
    rx_gain = 40
    [log]
    all_level = warning
    all_hex_limit = 32
    filename = /tmp/enb.log
    file_max_size = -1

    [gui]
    enable = false
    [scheduler]
    #pdsch_mcs        = -1
    #pdsch_max_mcs    = -1
    #pusch_mcs        = -1
    pusch_max_mcs    = 16
    # deprecated
    #nof_ctrl_symbols = 3
    # new variables 
    #min_nof_ctrl_symbols = 1
    #max_nof_ctrl_symbols = 3
    [embms]
    enable = false
    #m1u_multiaddr = 239.255.0.1
    #m1u_if_addr = 127.0.1.201
  drb.conf: |
    qci_config = (

    {
      qci=7;
      pdcp_config = {
        discard_timer = 100;                
        pdcp_sn_size = 12;                  
      }
      rlc_config = {
        ul_um = {
          sn_field_length = 10; 
        };
        dl_um = {
          sn_field_length = 10; 
          t_reordering    = 45;             
        };
      };
      logical_channel_config = {
        priority = 13; 
        prioritized_bit_rate   = -1; 
        bucket_size_duration  = 100; 
        log_chan_group = 2; 
      };
    },
    {
      qci=9;
      pdcp_config = {
        discard_timer = -1;
        status_report_required = true;
      }
      rlc_config = {
        ul_am = {
          t_poll_retx = 120;
          poll_pdu = 64;
          poll_byte = 750;
          max_retx_thresh = 16;
        };
        dl_am = {
          t_reordering = 50;
          t_status_prohibit = 50;
        };
      };
      logical_channel_config = {
        priority = 11; 
        prioritized_bit_rate   = -1; 
        bucket_size_duration  = 100; 
        log_chan_group = 3; 
      };
    }

    );
  rr.conf: |
    mac_cnfg =
    {
      phr_cnfg = 
      {
        dl_pathloss_change = "dB3"; // Valid: 1, 3, 6 or INFINITY
        periodic_phr_timer = 50;
        prohibit_phr_timer = 0;
      };
      ulsch_cnfg = 
      {
        max_harq_tx = 4;
        periodic_bsr_timer = 20; // in ms
        retx_bsr_timer = 320;   // in ms
      };
      
      time_alignment_timer = -1; // -1 is infinity
    };

    phy_cnfg =
    {
      phich_cnfg = 
      {
        duration  = "Normal";
        resources = "1/6"; 
      };

      pusch_cnfg_ded =
      {
        beta_offset_ack_idx = 6;
        beta_offset_ri_idx  = 6;
        beta_offset_cqi_idx = 6;
      };
      
      // PUCCH-SR resources are scheduled on time-frequeny domain first, then multiplexed in the same resource. 
      sched_request_cnfg =
      {
        dsr_trans_max = 64;
        period = 20;       // in ms
        subframe = [1];    // vector of subframe indices allowed for SR transmissions 
        nof_prb = 2;       // number of PRBs on each extreme used for SR (total prb is twice this number)
      };
      cqi_report_cnfg =
      { 
        mode = "periodic";
        simultaneousAckCQI = true; 
        period = 40; // in ms
        subframe = [0];
        nof_prb = 2; 
      };
    }
      sib.conf: |
        sib1 =
        {
            intra_freq_reselection = "Allowed";
            q_rx_lev_min = -65;
            //p_max = 3;
            cell_barred = "NotBarred"
            si_window_length = 20;
            sched_info =
            (
                {
                    si_periodicity = 16;
                    si_mapping_info = []; // comma-separated array of SIB-indexes (from 3 to 13). 
                    // Leave empty or commented to just scheduler sib2
                }
            );
            system_info_value_tag = 0;
        };

        sib2 = 
        {
            rr_config_common_sib =
            {
                rach_cnfg = 
                {
                    num_ra_preambles = 52;
                    preamble_init_rx_target_pwr = -104;
                    pwr_ramping_step = 6;  // in dB
                    preamble_trans_max = 10;
                    ra_resp_win_size = 10;  // in ms
                    mac_con_res_timer = 64; // in ms
                    max_harq_msg3_tx = 4;
                };
                bcch_cnfg = 
                {
                    modification_period_coeff = 16; // in ms
                };
                pcch_cnfg = 
                {
                    default_paging_cycle = 32; // in rf
                    nB = "1";
                };
                prach_cnfg =
                {
                    root_sequence_index = 128;
                    prach_cnfg_info =
                    {
                        high_speed_flag = false;
                        prach_config_index = 3;
                        prach_freq_offset = 2;
                        zero_correlation_zone_config = 5;
                    };
                };
                pdsch_cnfg = 
                {
                    /* Warning: Currently disabled and forced to p_b=1 for TM2/3/4 and p_b=0 for TM1
                     */
                    p_b = 1;
                    rs_power = 0;
                };
                pusch_cnfg = 
                {
                    n_sb = 1;
                    hopping_mode = "inter-subframe";
                    pusch_hopping_offset = 2;
                    enable_64_qam = false; // 64QAM PUSCH is not currently enabled
                    ul_rs = 
                    {
                        cyclic_shift = 0; 
                        group_assignment_pusch = 0;
                        group_hopping_enabled = false; 
                        sequence_hopping_enabled = false; 
                    };
                };
                pucch_cnfg =
                {
                    delta_pucch_shift = 2;
                    n_rb_cqi = 2;
                    n_cs_an = 0;
                    n1_pucch_an = 12;
                };
                ul_pwr_ctrl =
                {
                    p0_nominal_pusch = -85;
                    alpha = 0.7;
                    p0_nominal_pucch = -107;
                    delta_flist_pucch =
                    {
                        format_1  = 0;
                        format_1b = 3; 
                        format_2  = 1;
                        format_2a = 2;
                        format_2b = 2;
                    };
                    delta_preamble_msg3 = 6;
                };
                ul_cp_length = "len1";
            };

            ue_timers_and_constants =
            {
                t300 = 2000; // in ms
                t301 = 100;  // in ms
                t310 = 1000; // in ms
                n310 = 1;
                t311 = 1000; // in ms
                n311 = 1;
            };

            freqInfo = 
            {
                ul_carrier_freq_present = true; 
                ul_bw_present = true; 
                additional_spectrum_emission = 1; 
            };

            time_alignment_timer = "INFINITY"; // use "sf500", "sf750", etc.
        };


  
