Restored SR-transMax to MAC.

master
ismagom 10 years ago
commit ee2e193b8a

@ -26,6 +26,7 @@
*/ */
#include <errno.h>
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
@ -70,7 +71,7 @@ bool threads_new_rt_cpu(pthread_t *thread, void *(*start_routine) (void*), void
} }
int err = pthread_create(thread, &attr, start_routine, arg); int err = pthread_create(thread, &attr, start_routine, arg);
if (err) { if (err) {
if (1 == err) { if (EPERM == err) {
perror("Failed to create thread - permission error. Running with root permissions?"); perror("Failed to create thread - permission error. Running with root permissions?");
} }
perror("pthread_create"); perror("pthread_create");

@ -81,6 +81,7 @@ public:
void setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD); void setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD);
void set_param(mac_params::mac_param_t param, int64_t value); void set_param(mac_params::mac_param_t param, int64_t value);
int64_t get_param(mac_params::mac_param_t param);
void reconfiguration(); void reconfiguration();
void reset(); void reset();

@ -150,6 +150,12 @@ void demux::process_pdu(sch_pdu *pdu_msg)
dest_lch->send(pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_sdu_nbytes()*8); dest_lch->send(pdu_msg->get()->get_sdu_ptr(), pdu_msg->get()->get_sdu_nbytes()*8);
Info("Sent MAC SDU len=%d bytes to lchid=%d\n", Info("Sent MAC SDU len=%d bytes to lchid=%d\n",
pdu_msg->get()->get_sdu_nbytes(), pdu_msg->get()->get_sdu_lcid()); pdu_msg->get()->get_sdu_nbytes(), pdu_msg->get()->get_sdu_lcid());
if (sdu_handler_) {
sdu_handler_->notify_new_sdu(pdu_msg->get()->get_sdu_lcid());
Info("Notified SDU handler len=%d bytes to lchid=%d\n",
pdu_msg->get()->get_sdu_nbytes(), pdu_msg->get()->get_sdu_lcid());
}
} else { } else {
Error("Getting destination channel LCID=%d\n", pdu_msg->get()->get_sdu_lcid()); Error("Getting destination channel LCID=%d\n", pdu_msg->get()->get_sdu_lcid());
} }
@ -163,15 +169,6 @@ void demux::process_pdu(sch_pdu *pdu_msg)
} }
} }
} }
/* notify handler if registred */
if (sdu_handler_) {
pdu_msg->reset();
while(pdu_msg->next()) {
if (pdu_msg->get()->is_sdu()) {
sdu_handler_->notify_new_sdu(pdu_msg->get()->get_sdu_lcid());
}
}
}
} }

@ -544,6 +544,11 @@ void mac::set_param(mac_params::mac_param_t param, int64_t value)
params_db.set_param((uint32_t) param, value); params_db.set_param((uint32_t) param, value);
} }
int64_t mac::get_param(mac_params::mac_param_t param)
{
return params_db.get_param((uint32_t) param);
}
void mac::setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD) void mac::setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD)
{ {
mux_unit.set_priority(mac_io::MAC_LCH_CCCH_UL+lcid, priority, PBR_x_tti, BSD); mux_unit.set_priority(mac_io::MAC_LCH_CCCH_UL+lcid, priority, PBR_x_tti, BSD);

@ -112,6 +112,7 @@ public:
bool status_is_rxtx(); bool status_is_rxtx();
void set_param(phy_params::phy_param_t param, int64_t value); void set_param(phy_params::phy_param_t param, int64_t value);
int64_t get_param(phy_params::phy_param_t param);
uint32_t get_current_tti(); uint32_t get_current_tti();
static uint32_t tti_to_SFN(uint32_t tti); static uint32_t tti_to_SFN(uint32_t tti);

@ -155,6 +155,10 @@ void phy::set_param(phy_params::phy_param_t param, int64_t value) {
params_db.set_param((uint32_t) param, value); params_db.set_param((uint32_t) param, value);
} }
int64_t phy::get_param(phy_params::phy_param_t param) {
return params_db.get_param((uint32_t) param);
}
// FIXME: Add PRACH power control // FIXME: Add PRACH power control
bool phy::send_prach(uint32_t preamble_idx) { bool phy::send_prach(uint32_t preamble_idx) {
return send_prach(preamble_idx, -1, 0); return send_prach(preamble_idx, -1, 0);

Loading…
Cancel
Save