LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 { | 473 { |
474 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; | 474 (*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM; |
475 } | 475 } |
476 | 476 |
477 // RACH Allocation | 477 // RACH Allocation |
478 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); | 478 m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0); |
479 uint8_t rbStart = 0; | 479 uint8_t rbStart = 0; |
480 std::vector <struct RachListElement_s>::iterator itRach; | 480 std::vector <struct RachListElement_s>::iterator itRach; |
481 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) | 481 for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++) |
482 { | 482 { |
483 NS_ASSERT_MSG (m_amc->GetTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig.m
_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not allow
to send RACH messages"); | 483 NS_ASSERT_MSG (m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, m_cschedCellConfig
.m_ulBandwidth) > (*itRach).m_estimatedSize, " Default UL Grant MCS does not all
ow to send RACH messages"); |
484 BuildRarListElement_s newRar; | 484 BuildRarListElement_s newRar; |
485 newRar.m_rnti = (*itRach).m_rnti; | 485 newRar.m_rnti = (*itRach).m_rnti; |
486 // DL-RACH Allocation | 486 // DL-RACH Allocation |
487 // Ideal: no needs of configuring m_dci | 487 // Ideal: no needs of configuring m_dci |
488 // UL-RACH Allocation | 488 // UL-RACH Allocation |
489 newRar.m_grant.m_rnti = newRar.m_rnti; | 489 newRar.m_grant.m_rnti = newRar.m_rnti; |
490 newRar.m_grant.m_mcs = m_ulGrantMcs; | 490 newRar.m_grant.m_mcs = m_ulGrantMcs; |
491 uint8_t rbLen = 1; | 491 uint8_t rbLen = 1; |
492 uint16_t tbSizeBits = 0; | 492 uint16_t tbSizeBits = 0; |
493 // find lowest TB size that fits UL grant estimated size | 493 // find lowest TB size that fits UL grant estimated size |
494 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) | 494 while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < m_cs
chedCellConfig.m_ulBandwidth)) |
495 { | 495 { |
496 rbLen++; | 496 rbLen++; |
497 tbSizeBits = m_amc->GetTbSizeFromMcs (m_ulGrantMcs, rbLen); | 497 tbSizeBits = m_amc->GetUlTbSizeFromMcs (m_ulGrantMcs, rbLen); |
498 } | 498 } |
499 if (tbSizeBits < (*itRach).m_estimatedSize) | 499 if (tbSizeBits < (*itRach).m_estimatedSize) |
500 { | 500 { |
501 // no more allocation space: finish allocation | 501 // no more allocation space: finish allocation |
502 break; | 502 break; |
503 } | 503 } |
504 newRar.m_grant.m_rbStart = rbStart; | 504 newRar.m_grant.m_rbStart = rbStart; |
505 newRar.m_grant.m_rbLen = rbLen; | 505 newRar.m_grant.m_rbLen = rbLen; |
506 newRar.m_grant.m_tbSize = tbSizeBits / 8; | 506 newRar.m_grant.m_tbSize = tbSizeBits / 8; |
507 newRar.m_grant.m_hopping = false; | 507 newRar.m_grant.m_hopping = false; |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 { | 976 { |
977 if (itCqi == m_p10CqiRxed.end ()) | 977 if (itCqi == m_p10CqiRxed.end ()) |
978 { | 978 { |
979 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS | 979 newDci.m_mcs.push_back (0); // no info on this user -> lowest MCS |
980 } | 980 } |
981 else | 981 else |
982 { | 982 { |
983 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); | 983 newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); |
984 } | 984 } |
985 } | 985 } |
986 int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (0), rbgPerTb * rbg
Size) / 8); | 986 int tbSize = (m_amc->GetDlTbSizeFromMcs (newDci.m_mcs.at (0), rbgPerTb * r
bgSize) / 8); |
987 uint16_t rlcPduSize = static_cast<uint16_t>(tbSize / lcNum); | 987 uint16_t rlcPduSize = static_cast<uint16_t>(tbSize / lcNum); |
988 while ((*it).m_rnti == newEl.m_rnti) | 988 while ((*it).m_rnti == newEl.m_rnti) |
989 { | 989 { |
990 if ( ((*it).m_rlcTransmissionQueueSize > 0) | 990 if ( ((*it).m_rlcTransmissionQueueSize > 0) |
991 || ((*it).m_rlcRetransmissionQueueSize > 0) | 991 || ((*it).m_rlcRetransmissionQueueSize > 0) |
992 || ((*it).m_rlcStatusPduSize > 0) ) | 992 || ((*it).m_rlcStatusPduSize > 0) ) |
993 { | 993 { |
994 std::vector <struct RlcPduListElement_s> newRlcPduLe; | 994 std::vector <struct RlcPduListElement_s> newRlcPduLe; |
995 for (uint8_t j = 0; j < nLayer; j++) | 995 for (uint8_t j = 0; j < nLayer; j++) |
996 { | 996 { |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 NS_LOG_DEBUG (this << " UE discared for CQI=0, RNTI " << uldci.m_r
nti); | 1412 NS_LOG_DEBUG (this << " UE discared for CQI=0, RNTI " << uldci.m_r
nti); |
1413 // remove UE from allocation map | 1413 // remove UE from allocation map |
1414 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) | 1414 for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_r
bLen; i++) |
1415 { | 1415 { |
1416 rbgAllocationMap.at (i) = 0; | 1416 rbgAllocationMap.at (i) = 0; |
1417 } | 1417 } |
1418 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) | 1418 continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 3
6.213) |
1419 } | 1419 } |
1420 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); | 1420 uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); |
1421 } | 1421 } |
1422 uldci.m_tbSize = m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8; //
MCS 0 -> UL-AMC TBD | 1422 uldci.m_tbSize = (m_amc->GetUlTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8);
// MCS 0 -> UL-AMC TBD |
1423 | 1423 |
1424 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); | 1424 UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
1425 uldci.m_ndi = 1; | 1425 uldci.m_ndi = 1; |
1426 uldci.m_cceIndex = 0; | 1426 uldci.m_cceIndex = 0; |
1427 uldci.m_aggrLevel = 1; | 1427 uldci.m_aggrLevel = 1; |
1428 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF | 1428 uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
1429 uldci.m_hopping = false; | 1429 uldci.m_hopping = false; |
1430 uldci.m_n2Dmrs = 0; | 1430 uldci.m_n2Dmrs = 0; |
1431 uldci.m_tpc = 0; // no power control | 1431 uldci.m_tpc = 0; // no power control |
1432 uldci.m_cqiRequest = false; // only period CQI at this stage | 1432 uldci.m_cqiRequest = false; // only period CQI at this stage |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); | 1836 NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
1837 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; | 1837 FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
1838 params.m_rnti = rnti; | 1838 params.m_rnti = rnti; |
1839 params.m_transmissionMode = txMode; | 1839 params.m_transmissionMode = txMode; |
1840 m_cschedSapUser->CschedUeConfigUpdateInd (params); | 1840 m_cschedSapUser->CschedUeConfigUpdateInd (params); |
1841 } | 1841 } |
1842 | 1842 |
1843 | 1843 |
1844 | 1844 |
1845 } | 1845 } |
LEFT | RIGHT |