mirror of https://github.com/PentHertz/srsLTE.git
Added TM3 (1 layer only) eNB support at RRC
This commit is contained in:
parent
95897ceb71
commit
21355de77e
|
@ -93,7 +93,8 @@ public:
|
|||
class phy_interface_rrc
|
||||
{
|
||||
public:
|
||||
virtual void set_config_dedicated(uint16_t rnti, LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated) = 0;
|
||||
virtual void set_conf_dedicated_ack(uint16_t rnti, bool rrc_completed) = 0;
|
||||
virtual void set_config_dedicated(uint16_t rnti, LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -56,13 +56,15 @@ public:
|
|||
int read_ce_abs(float *ce_abs);
|
||||
int read_pusch_d(cf_t *pusch_d);
|
||||
void start_plot();
|
||||
|
||||
|
||||
void set_conf_dedicated_ack(uint16_t rnti,
|
||||
bool rrc_completed);
|
||||
|
||||
void set_config_dedicated(uint16_t rnti,
|
||||
srslte_uci_cfg_t *uci_cfg,
|
||||
srslte_pucch_sched_t *pucch_sched,
|
||||
srslte_refsignal_srs_cfg_t *srs_cfg,
|
||||
uint32_t I_sr, bool pucch_cqi, uint32_t pmi_idx, bool pucch_cqi_ack);
|
||||
LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated);
|
||||
|
||||
uint32_t get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]);
|
||||
|
||||
|
@ -99,13 +101,16 @@ private:
|
|||
// Class to store user information
|
||||
class ue {
|
||||
public:
|
||||
ue() : I_sr(0), I_sr_en(false), cqi_en(false), pucch_cqi_ack(false), pmi_idx(0), has_grant_tti(0) {bzero(&metrics, sizeof(phy_metrics_t));}
|
||||
ue() : I_sr(0), I_sr_en(false), cqi_en(false), pucch_cqi_ack(false), pmi_idx(0), has_grant_tti(0),
|
||||
dedicated_ack(false) {bzero(&metrics, sizeof(phy_metrics_t));}
|
||||
uint32_t I_sr;
|
||||
uint32_t pmi_idx;
|
||||
bool I_sr_en;
|
||||
bool cqi_en;
|
||||
bool pucch_cqi_ack;
|
||||
int has_grant_tti;
|
||||
LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT dedicated;
|
||||
bool dedicated_ack;
|
||||
uint32_t rnti;
|
||||
srslte_enb_ul_phich_info_t phich_info;
|
||||
void metrics_read(phy_metrics_t *metrics);
|
||||
|
|
|
@ -66,6 +66,7 @@ public:
|
|||
static uint32_t tti_to_subf(uint32_t tti);
|
||||
|
||||
void start_plot();
|
||||
void set_conf_dedicated_ack(uint16_t rnti, bool dedicated_ack);
|
||||
void set_config_dedicated(uint16_t rnti, LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated);
|
||||
|
||||
void get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]);
|
||||
|
|
|
@ -210,13 +210,28 @@ uint32_t phch_worker::get_nof_rnti() {
|
|||
return ue_db.size();
|
||||
}
|
||||
|
||||
void phch_worker::set_conf_dedicated_ack(uint16_t rnti, bool ack){
|
||||
pthread_mutex_lock(&mutex);
|
||||
if (ue_db.count(rnti)) {
|
||||
ue_db[rnti].dedicated_ack = ack;
|
||||
} else {
|
||||
Error("Setting dedicated ack: rnti=0x%x does not exist\n");
|
||||
}
|
||||
pthread_mutex_unlock(&mutex);
|
||||
}
|
||||
|
||||
void phch_worker::set_config_dedicated(uint16_t rnti,
|
||||
srslte_uci_cfg_t *uci_cfg,
|
||||
srslte_pucch_sched_t *pucch_sched,
|
||||
srslte_refsignal_srs_cfg_t *srs_cfg,
|
||||
uint32_t I_sr, bool pucch_cqi, uint32_t pmi_idx, bool pucch_cqi_ack)
|
||||
LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated)
|
||||
{
|
||||
pthread_mutex_lock(&mutex);
|
||||
uint32_t I_sr = dedicated->sched_request_cnfg.sr_cnfg_idx;
|
||||
bool pucch_cqi = dedicated->cqi_report_cnfg.report_periodic_setup_present;
|
||||
uint32_t pmi_idx = dedicated->cqi_report_cnfg.report_periodic.pmi_cnfg_idx;
|
||||
bool pucch_cqi_ack = dedicated->cqi_report_cnfg.report_periodic.simult_ack_nack_and_cqi;
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
if (ue_db.count(rnti)) {
|
||||
pucch_sched->N_pucch_1 = phy->pucch_cfg.n1_pucch_an;
|
||||
srslte_enb_ul_cfg_ue(&enb_ul, rnti, uci_cfg, pucch_sched, srs_cfg);
|
||||
|
@ -232,7 +247,9 @@ void phch_worker::set_config_dedicated(uint16_t rnti,
|
|||
ue_db[rnti].pmi_idx = 0;
|
||||
ue_db[rnti].cqi_en = false;
|
||||
}
|
||||
|
||||
|
||||
/* Copy all dedicated RRC configuration to UE */
|
||||
memcpy(&ue_db[rnti].dedicated, dedicated, sizeof(LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT));
|
||||
} else {
|
||||
Error("Setting config dedicated: rnti=0x%x does not exist\n");
|
||||
}
|
||||
|
@ -624,14 +641,25 @@ int phch_worker::encode_pdcch_ul(srslte_enb_ul_pusch_t *grants, uint32_t nof_gra
|
|||
|
||||
int phch_worker::encode_pdcch_dl(srslte_enb_dl_pdsch_t *grants, uint32_t nof_grants, uint32_t sf_idx)
|
||||
{
|
||||
/* For each grant... */
|
||||
for (uint32_t i=0;i<nof_grants;i++) {
|
||||
uint16_t rnti = grants[i].rnti;
|
||||
if (rnti) {
|
||||
srslte_dci_format_t format = SRSLTE_DCI_FORMAT1;
|
||||
bool dedicated_acknowledged = ue_db[grants[i].rnti].dedicated_ack;
|
||||
bool antenna_info_present = ue_db[grants[i].rnti].dedicated.antenna_info_present;
|
||||
LIBLTE_RRC_TRANSMISSION_MODE_ENUM tx_mode = ue_db[grants[i].rnti].dedicated.antenna_info_explicit_value.tx_mode;
|
||||
|
||||
srslte_dci_format_t format = SRSLTE_DCI_FORMAT1;
|
||||
switch(grants[i].grant.alloc_type) {
|
||||
case SRSLTE_RA_ALLOC_TYPE0:
|
||||
case SRSLTE_RA_ALLOC_TYPE1:
|
||||
format = SRSLTE_DCI_FORMAT1;
|
||||
if (dedicated_acknowledged && antenna_info_present && tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_3) {
|
||||
format = SRSLTE_DCI_FORMAT2A;
|
||||
} else if (dedicated_acknowledged && antenna_info_present && tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) {
|
||||
format = SRSLTE_DCI_FORMAT2;
|
||||
} else {
|
||||
format = SRSLTE_DCI_FORMAT1;
|
||||
}
|
||||
break;
|
||||
case SRSLTE_RA_ALLOC_TYPE2:
|
||||
format = SRSLTE_DCI_FORMAT1A;
|
||||
|
|
|
@ -207,6 +207,13 @@ void phy::get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS])
|
|||
|
||||
/***** RRC->PHY interface **********/
|
||||
|
||||
void phy::set_conf_dedicated_ack(uint16_t rnti, bool ack)
|
||||
{
|
||||
for (uint32_t i = 0; i < nof_workers; i++) {
|
||||
workers[i].set_conf_dedicated_ack(rnti, ack);
|
||||
}
|
||||
}
|
||||
|
||||
void phy::set_config_dedicated(uint16_t rnti, LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT* dedicated)
|
||||
{
|
||||
// Parse RRC config
|
||||
|
@ -225,11 +232,7 @@ void phy::set_config_dedicated(uint16_t rnti, LIBLTE_RRC_PHYSICAL_CONFIG_DEDICAT
|
|||
pucch_sched.n_pucch_sr = dedicated->sched_request_cnfg.sr_pucch_resource_idx;
|
||||
|
||||
for (uint32_t i=0;i<nof_workers;i++) {
|
||||
workers[i].set_config_dedicated(rnti, &uci_cfg, &pucch_sched, NULL,
|
||||
dedicated->sched_request_cnfg.sr_cnfg_idx,
|
||||
dedicated->cqi_report_cnfg.report_periodic_setup_present,
|
||||
dedicated->cqi_report_cnfg.report_periodic.pmi_cnfg_idx,
|
||||
dedicated->cqi_report_cnfg.report_periodic.simult_ack_nack_and_cqi);
|
||||
workers[i].set_config_dedicated(rnti, &uci_cfg, &pucch_sched, NULL, dedicated);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -862,6 +862,9 @@ void rrc::ue::handle_rrc_con_setup_complete(LIBLTE_RRC_CONNECTION_SETUP_COMPLETE
|
|||
memcpy(pdu->msg, msg->dedicated_info_nas.msg, msg->dedicated_info_nas.N_bytes);
|
||||
pdu->N_bytes = msg->dedicated_info_nas.N_bytes;
|
||||
|
||||
// Acknowledge Dedicated Configuration
|
||||
parent->phy->set_conf_dedicated_ack(rnti, true);
|
||||
|
||||
if(has_tmsi) {
|
||||
parent->s1ap->initial_ue(rnti, pdu, m_tmsi, mmec);
|
||||
} else {
|
||||
|
@ -1197,6 +1200,7 @@ void rrc::ue::send_connection_setup(bool is_setup)
|
|||
|
||||
// Configure PHY layer
|
||||
parent->phy->set_config_dedicated(rnti, phy_cfg);
|
||||
parent->phy->set_conf_dedicated_ack(rnti, false);
|
||||
parent->mac->phy_config_enabled(rnti, true);
|
||||
|
||||
rr_cfg->drb_to_add_mod_list_size = 0;
|
||||
|
|
|
@ -1438,7 +1438,9 @@ void rrc::apply_phy_config_dedicated(LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT
|
|||
if (phy_cnfg->antenna_info_present) {
|
||||
if (!phy_cnfg->antenna_info_default_value) {
|
||||
if (phy_cnfg->antenna_info_explicit_value.tx_mode != LIBLTE_RRC_TRANSMISSION_MODE_1 &&
|
||||
phy_cnfg->antenna_info_explicit_value.tx_mode != LIBLTE_RRC_TRANSMISSION_MODE_2) {
|
||||
phy_cnfg->antenna_info_explicit_value.tx_mode != LIBLTE_RRC_TRANSMISSION_MODE_2 &&
|
||||
phy_cnfg->antenna_info_explicit_value.tx_mode != LIBLTE_RRC_TRANSMISSION_MODE_3 &&
|
||||
phy_cnfg->antenna_info_explicit_value.tx_mode != LIBLTE_RRC_TRANSMISSION_MODE_4) {
|
||||
rrc_log->error("Transmission mode TM%s not currently supported by srsUE\n",
|
||||
liblte_rrc_transmission_mode_text[phy_cnfg->antenna_info_explicit_value.tx_mode]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue