Merge branch 'next' of github.com:softwareradiosystems/srsLTE into next

master
Ismael Gomez 7 years ago
commit 87711f55bd

@ -60,7 +60,7 @@ int srslte_enb_ul_init(srslte_enb_ul_t *q, srslte_cell_t cell,
memcpy(&q->hopping_cfg, hopping_cfg, sizeof(srslte_pusch_hopping_cfg_t)); memcpy(&q->hopping_cfg, hopping_cfg, sizeof(srslte_pusch_hopping_cfg_t));
} }
q->users = calloc(sizeof(srslte_enb_ul_user_t*), SRSLTE_SIRNTI); q->users = calloc(sizeof(srslte_enb_ul_user_t*), (1+SRSLTE_SIRNTI));
if (!q->users) { if (!q->users) {
perror("malloc"); perror("malloc");
goto clean_exit; goto clean_exit;
@ -161,7 +161,7 @@ void srslte_enb_ul_free(srslte_enb_ul_t *q)
int srslte_enb_ul_add_rnti(srslte_enb_ul_t *q, uint16_t rnti) int srslte_enb_ul_add_rnti(srslte_enb_ul_t *q, uint16_t rnti)
{ {
if (!q->users[rnti]) { if (!q->users[rnti]) {
q->users[rnti] = malloc(sizeof(srslte_enb_ul_user_t)); q->users[rnti] = calloc(1, sizeof(srslte_enb_ul_user_t));
if (srslte_pucch_set_crnti(&q->pucch, rnti)) { if (srslte_pucch_set_crnti(&q->pucch, rnti)) {
fprintf(stderr, "Error setting PUCCH rnti\n"); fprintf(stderr, "Error setting PUCCH rnti\n");

@ -54,6 +54,7 @@ public:
phch_common(uint32_t max_mutex_) : tx_mutex(max_mutex_) { phch_common(uint32_t max_mutex_) : tx_mutex(max_mutex_) {
nof_mutex = 0;
max_mutex = max_mutex_; max_mutex = max_mutex_;
params.max_prach_offset_us = 20; params.max_prach_offset_us = 20;
} }

@ -113,16 +113,6 @@ void mac::reset()
/* Setup scheduler */ /* Setup scheduler */
scheduler.reset(); scheduler.reset();
/* Setup SI-RNTI in PHY */
phy_h->add_rnti(SRSLTE_SIRNTI);
/* Setup P-RNTI in PHY */
phy_h->add_rnti(SRSLTE_PRNTI);
/* Setup RA-RNTI in PHY */
for (int i=0;i<10;i++) {
phy_h->add_rnti(1+i);
}
} }
uint32_t mac::get_unique_id() uint32_t mac::get_unique_id()

@ -20,6 +20,7 @@ namespace srsenb {
*******************************************************/ *******************************************************/
sched::sched() sched::sched()
{ {
current_tti = 0;
log_h = NULL; log_h = NULL;
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
reset(); reset();
@ -39,6 +40,7 @@ void sched::init(rrc_interface_mac *rrc_, srslte::log* log)
int sched::reset() int sched::reset()
{ {
bzero(pending_msg3, sizeof(pending_msg3_t)*10);
bzero(pending_rar, sizeof(sched_rar_t)*SCHED_MAX_PENDING_RAR); bzero(pending_rar, sizeof(sched_rar_t)*SCHED_MAX_PENDING_RAR);
bzero(pending_sibs, sizeof(sched_sib_t)*MAX_SIBS); bzero(pending_sibs, sizeof(sched_sib_t)*MAX_SIBS);
ue_db.clear(); ue_db.clear();

@ -60,7 +60,7 @@ bool phch_common::init(srslte_cell_t *cell_, srslte::radio* radio_h_, mac_interf
is_first_of_burst = true; is_first_of_burst = true;
is_first_tx = true; is_first_tx = true;
for (uint32_t i=0;i<nof_mutex;i++) { for (uint32_t i=0;i<max_mutex;i++) {
pthread_mutex_init(&tx_mutex[i], NULL); pthread_mutex_init(&tx_mutex[i], NULL);
} }
reset(); reset();

@ -110,7 +110,18 @@ void phch_worker::init(phch_common* phy_, srslte::log *log_h_)
fprintf(stderr, "Error initiating ENB DL\n"); fprintf(stderr, "Error initiating ENB DL\n");
return; return;
} }
/* Setup SI-RNTI in PHY */
add_rnti(SRSLTE_SIRNTI);
/* Setup P-RNTI in PHY */
add_rnti(SRSLTE_PRNTI);
/* Setup RA-RNTI in PHY */
for (int i=0;i<10;i++) {
add_rnti(1+i);
}
srslte_pucch_set_threshold(&enb_ul.pucch, 0.8); srslte_pucch_set_threshold(&enb_ul.pucch, 0.8);
srslte_sch_set_max_noi(&enb_ul.pusch.ul_sch, phy->params.pusch_max_its); srslte_sch_set_max_noi(&enb_ul.pusch.ul_sch, phy->params.pusch_max_its);
srslte_enb_dl_set_amp(&enb_dl, phy->params.tx_amplitude); srslte_enb_dl_set_amp(&enb_dl, phy->params.tx_amplitude);

@ -56,8 +56,9 @@ int prach_worker::init(srslte_cell_t *cell_, srslte_prach_cfg_t *prach_cfg_, mac
} }
start(priority); start(priority);
initiated = true; initiated = true;
sf_cnt = 0;
pending_tti = 0; pending_tti = 0;
processed_tti = 0; processed_tti = 0;
return 0; return 0;

@ -61,7 +61,8 @@ void rrc::init(rrc_cfg_t *cfg_,
pthread_mutex_init(&user_mutex, NULL); pthread_mutex_init(&user_mutex, NULL);
pthread_mutex_init(&paging_mutex, NULL); pthread_mutex_init(&paging_mutex, NULL);
act_monitor.start(RRC_THREAD_PRIO);
bzero(&sr_sched, sizeof(sr_sched_t)); bzero(&sr_sched, sizeof(sr_sched_t));
start(RRC_THREAD_PRIO); start(RRC_THREAD_PRIO);
@ -69,9 +70,8 @@ void rrc::init(rrc_cfg_t *cfg_,
rrc::activity_monitor::activity_monitor(rrc* parent_) rrc::activity_monitor::activity_monitor(rrc* parent_)
{ {
running = true; running = true;
parent = parent_; parent = parent_;
start(RRC_THREAD_PRIO);
} }
void rrc::activity_monitor::stop() void rrc::activity_monitor::stop()

@ -347,6 +347,7 @@ bool s1ap::setup_s1()
uint16_t tmp16; uint16_t tmp16;
srslte::byte_buffer_t msg; srslte::byte_buffer_t msg;
LIBLTE_S1AP_S1AP_PDU_STRUCT pdu; LIBLTE_S1AP_S1AP_PDU_STRUCT pdu;
bzero(&pdu, sizeof(LIBLTE_S1AP_S1AP_PDU_STRUCT));
pdu.choice_type = LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE; pdu.choice_type = LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE;

Loading…
Cancel
Save