mirror of https://github.com/PentHertz/srsLTE.git
mux: fix code formatting and simplify UL-CCCH packing
This commit is contained in:
parent
4aaa0473b9
commit
a4dab1081e
|
@ -48,8 +48,8 @@ void mux::init(rlc_interface_mac *rlc_, srslte::log *log_h_, bsr_interface_mux *
|
||||||
|
|
||||||
void mux::reset()
|
void mux::reset()
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < logical_channels.size(); i++) {
|
for (auto& channel : logical_channels) {
|
||||||
logical_channels[i].Bj = 0;
|
channel.Bj = 0;
|
||||||
}
|
}
|
||||||
msg3_pending = false;
|
msg3_pending = false;
|
||||||
pending_crnti_ce = 0;
|
pending_crnti_ce = 0;
|
||||||
|
@ -72,8 +72,8 @@ void mux::step(const uint32_t tti)
|
||||||
|
|
||||||
bool mux::is_pending_any_sdu()
|
bool mux::is_pending_any_sdu()
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < logical_channels.size(); i++) {
|
for (auto& channel : logical_channels) {
|
||||||
if (rlc->has_data(logical_channels[i].lcid)) {
|
if (rlc->has_data(channel.lcid)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,8 +214,6 @@ uint8_t* mux::pdu_get(srslte::byte_buffer_t* payload, uint32_t pdu_sz)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: IMHO, it should not matter if this is a RAR UL or a normal UL, we fill the grant
|
|
||||||
if (!is_rar) {
|
|
||||||
// Update buffer states for all logical channels
|
// Update buffer states for all logical channels
|
||||||
for (auto& channel : logical_channels) {
|
for (auto& channel : logical_channels) {
|
||||||
channel.buffer_len = rlc->get_buffer_state(channel.lcid);
|
channel.buffer_len = rlc->get_buffer_state(channel.lcid);
|
||||||
|
@ -226,9 +224,6 @@ uint8_t* mux::pdu_get(srslte::byte_buffer_t* payload, uint32_t pdu_sz)
|
||||||
// data from any Logical Channel, except data from UL-CCCH;
|
// data from any Logical Channel, except data from UL-CCCH;
|
||||||
// first only those with positive Bj
|
// first only those with positive Bj
|
||||||
for (auto& channel : logical_channels) {
|
for (auto& channel : logical_channels) {
|
||||||
// FIXME: IMHO we should not care if we read from UL-CCCH, the specs say "except" but CCCH has always
|
|
||||||
// higher priority, so if there is data, it should be allocated
|
|
||||||
if (channel.lcid != 0) {
|
|
||||||
int max_sdu_sz = (channel.PBR < 0) ? -1 : channel.Bj; // this can be zero if no PBR has been allocated
|
int max_sdu_sz = (channel.PBR < 0) ? -1 : channel.Bj; // this can be zero if no PBR has been allocated
|
||||||
if (max_sdu_sz != 0) {
|
if (max_sdu_sz != 0) {
|
||||||
if (sched_sdu(&channel, &sdu_space, max_sdu_sz)) {
|
if (sched_sdu(&channel, &sdu_space, max_sdu_sz)) {
|
||||||
|
@ -236,7 +231,6 @@ uint8_t* mux::pdu_get(srslte::byte_buffer_t* payload, uint32_t pdu_sz)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print_logical_channel_state("First round of allocation:");
|
print_logical_channel_state("First round of allocation:");
|
||||||
|
|
||||||
|
@ -254,7 +248,6 @@ uint8_t* mux::pdu_get(srslte::byte_buffer_t* payload, uint32_t pdu_sz)
|
||||||
allocate_sdu(channel.lcid, &pdu_msg, channel.sched_len);
|
allocate_sdu(channel.lcid, &pdu_msg, channel.sched_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!regular_bsr) {
|
if (!regular_bsr) {
|
||||||
// Insert Padding BSR if not inserted Regular/Periodic BSR
|
// Insert Padding BSR if not inserted Regular/Periodic BSR
|
||||||
|
|
Loading…
Reference in New Issue