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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 void | 300 void |
301 EnbMacMemberLteEnbPhySapUser::ReceiveLteControlMessage (Ptr<LteControlMessage> m
sg) | 301 EnbMacMemberLteEnbPhySapUser::ReceiveLteControlMessage (Ptr<LteControlMessage> m
sg) |
302 { | 302 { |
303 m_mac->DoReceiveLteControlMessage (msg); | 303 m_mac->DoReceiveLteControlMessage (msg); |
304 } | 304 } |
305 | 305 |
306 void | 306 void |
307 EnbMacMemberLteEnbPhySapUser::ReceiveRachPreamble (uint32_t prachId) | 307 EnbMacMemberLteEnbPhySapUser::ReceiveRachPreamble (uint32_t prachId) |
308 { | 308 { |
309 m_mac->DoReceiveRachPreamble ((uint8_t)prachId); | 309 m_mac->DoReceiveRachPreamble (static_cast<uint8_t>(prachId)); |
310 } | 310 } |
311 | 311 |
312 void | 312 void |
313 EnbMacMemberLteEnbPhySapUser::UlCqiReport (FfMacSchedSapProvider::SchedUlCqiInfo
ReqParameters ulcqi) | 313 EnbMacMemberLteEnbPhySapUser::UlCqiReport (FfMacSchedSapProvider::SchedUlCqiInfo
ReqParameters ulcqi) |
314 { | 314 { |
315 m_mac->DoUlCqiReport (ulcqi); | 315 m_mac->DoUlCqiReport (ulcqi); |
316 } | 316 } |
317 | 317 |
318 void | 318 void |
319 EnbMacMemberLteEnbPhySapUser::UlInfoListElementHarqFeeback (UlInfoListElement_s
params) | 319 EnbMacMemberLteEnbPhySapUser::UlInfoListElementHarqFeeback (UlInfoListElement_s
params) |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 else | 543 else |
544 { | 544 { |
545 rnti = m_cmacSapUser->AllocateTemporaryCellRnti (); | 545 rnti = m_cmacSapUser->AllocateTemporaryCellRnti (); |
546 NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": alloc
ated T-C-RNTI " << (uint32_t) rnti << ", sending RAR"); | 546 NS_LOG_INFO ("preambleId " << (uint32_t) it->first << ": alloc
ated T-C-RNTI " << (uint32_t) rnti << ", sending RAR"); |
547 } | 547 } |
548 | 548 |
549 RachListElement_s rachLe; | 549 RachListElement_s rachLe; |
550 rachLe.m_rnti = rnti; | 550 rachLe.m_rnti = rnti; |
551 rachLe.m_estimatedSize = 144; // to be confirmed | 551 rachLe.m_estimatedSize = 144; // to be confirmed |
552 rachInfoReqParams.m_rachList.push_back (rachLe); | 552 rachInfoReqParams.m_rachList.push_back (rachLe); |
553 m_rapIdRntiMap.insert (std::pair <uint8_t, uint32_t> ((uint8_t)rnt
i, it->first)); | 553 m_rapIdRntiMap.insert (std::pair <uint8_t, uint32_t> (static_cast<
uint8_t>(rnti), it->first)); |
554 } | 554 } |
555 } | 555 } |
556 m_schedSapProvider->SchedDlRachInfoReq (rachInfoReqParams); | 556 m_schedSapProvider->SchedDlRachInfoReq (rachInfoReqParams); |
557 m_receivedRachPreambleCount.clear (); | 557 m_receivedRachPreambleCount.clear (); |
558 } | 558 } |
559 // Get downlink transmission opportunities | 559 // Get downlink transmission opportunities |
560 uint32_t dlSchedFrameNo = m_frameNo; | 560 uint32_t dlSchedFrameNo = m_frameNo; |
561 uint32_t dlSchedSubframeNo = m_subframeNo; | 561 uint32_t dlSchedSubframeNo = m_subframeNo; |
562 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo); | 562 // NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo); |
563 if (dlSchedSubframeNo + m_macChTtiDelay > 10) | 563 if (dlSchedSubframeNo + m_macChTtiDelay > 10) |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 // SCHED SAP | 1016 // SCHED SAP |
1017 // //////////////////////////////////////////// | 1017 // //////////////////////////////////////////// |
1018 | 1018 |
1019 | 1019 |
1020 | 1020 |
1021 void | 1021 void |
1022 LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
) | 1022 LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
) |
1023 { | 1023 { |
1024 NS_LOG_FUNCTION (this); | 1024 NS_LOG_FUNCTION (this); |
1025 // Create DL PHY PDU | 1025 // Create DL PHY PDU |
1026 Ptr<PacketBurst> pb = CreateObject<PacketBurst> (); | |
1027 std::map <LteFlowId_t, LteMacSapUser* >::iterator it; | |
1028 | 1026 |
1029 for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++) | 1027 for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++) |
1030 { | 1028 { |
1031 for (uint16_t layer = 0; layer < ind.m_buildDataList.at (i).m_dci.m_ndi.si
ze (); layer++) | 1029 for (uint16_t layer = 0; layer < ind.m_buildDataList.at (i).m_dci.m_ndi.si
ze (); layer++) |
1032 { | 1030 { |
1033 if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (layer) == 1) | 1031 if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (layer) == 1) |
1034 { | 1032 { |
1035 // new data -> force emptying correspondent harq pkt buffer | 1033 // new data -> force emptying correspondent harq pkt buffer |
1036 std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it1 = m_miD
lHarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti); | 1034 std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDl
HarqProcessesPackets.find (ind.m_buildDataList.at (i).m_rnti); |
1037 NS_ASSERT (it1 != m_miDlHarqProcessesPackets.end ()); | 1035 NS_ASSERT (it != m_miDlHarqProcessesPackets.end ()); |
1038 for (uint16_t lcId = 0; lcId < (*it1).second.size (); lcId++) | 1036 for (uint16_t lcId = 0; lcId < (*it).second.size (); lcId++) |
1039 { | 1037 { |
1040 pb = CreateObject <PacketBurst> (); | 1038 Ptr<PacketBurst> pb = CreateObject <PacketBurst> (); |
1041 (*it1).second.at (lcId).at (ind.m_buildDataList.at (i).m_dci.m
_harqProcess) = pb; | 1039 (*it).second.at (lcId).at (ind.m_buildDataList.at (i).m_dci.m_
harqProcess) = pb; |
1042 } | 1040 } |
1043 } | 1041 } |
1044 } | 1042 } |
| 1043 Ptr<PacketBurst> pb = CreateObject<PacketBurst> (); |
1045 for (unsigned int j = 0; j < ind.m_buildDataList.at (i).m_rlcPduList.size
(); j++) | 1044 for (unsigned int j = 0; j < ind.m_buildDataList.at (i).m_rlcPduList.size
(); j++) |
1046 { | 1045 { |
1047 for (uint16_t k = 0; k < ind.m_buildDataList.at (i).m_rlcPduList.at (j
).size (); k++) | 1046 for (uint8_t k = 0; k < ind.m_buildDataList.at (i).m_rlcPduList.at (j)
.size (); k++) |
1048 { | 1047 { |
1049 if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (k) == 1) | 1048 if (ind.m_buildDataList.at (i).m_dci.m_ndi.at (k) == 1) |
1050 { | 1049 { |
1051 // New Data -> retrieve it from RLC | 1050 // New Data -> retrieve it from RLC |
1052 uint16_t rnti = ind.m_buildDataList.at (i).m_rnti; | 1051 uint16_t rnti = ind.m_buildDataList.at (i).m_rnti; |
1053 uint8_t lcid = ind.m_buildDataList.at (i).m_rlcPduList.at (j).
at (k).m_logicalChannelIdentity; | 1052 uint8_t lcid = ind.m_buildDataList.at (i).m_rlcPduList.at (j).
at (k).m_logicalChannelIdentity; |
1054 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::itera
tor rntiIt = m_rlcAttached.find (rnti); | 1053 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::itera
tor rntiIt = m_rlcAttached.find (rnti); |
1055 NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find
RNTI" << rnti); | 1054 NS_ASSERT_MSG (rntiIt != m_rlcAttached.end (), "could not find
RNTI" << rnti); |
1056 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->s
econd.find (lcid); | 1055 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->s
econd.find (lcid); |
1057 NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not fin
d LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId); | 1056 NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not fin
d LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 } | 1117 } |
1119 } | 1118 } |
1120 | 1119 |
1121 // Random Access procedure: send RARs | 1120 // Random Access procedure: send RARs |
1122 Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> (); | 1121 Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> (); |
1123 // see TS 36.321 5.1.4; preambles were sent two frames ago | 1122 // see TS 36.321 5.1.4; preambles were sent two frames ago |
1124 // (plus 3GPP counts subframes from 0, not 1) | 1123 // (plus 3GPP counts subframes from 0, not 1) |
1125 uint16_t raRnti; | 1124 uint16_t raRnti; |
1126 if (m_subframeNo < 3) | 1125 if (m_subframeNo < 3) |
1127 { | 1126 { |
1128 raRnti = (uint16_t)(m_subframeNo + 7); // equivalent to +10-3 | 1127 raRnti = static_cast<uint16_t>(m_subframeNo + 7); // equivalent to +10-3 |
1129 } | 1128 } |
1130 else | 1129 else |
1131 { | 1130 { |
1132 raRnti = (uint16_t)(m_subframeNo - 3); | 1131 raRnti = static_cast<uint16_t>(m_subframeNo - 3); |
1133 } | 1132 } |
1134 rarMsg->SetRaRnti (raRnti); | 1133 rarMsg->SetRaRnti (raRnti); |
1135 for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++) | 1134 for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++) |
1136 { | 1135 { |
1137 std::map <uint8_t, uint32_t>::iterator itRapId = m_rapIdRntiMap.find ((uin
t8_t)ind.m_buildRarList.at (i).m_rnti); | 1136 std::map <uint8_t, uint32_t>::iterator itRapId = m_rapIdRntiMap.find (stat
ic_cast<uint8_t>(ind.m_buildRarList.at (i).m_rnti)); |
1138 if (itRapId == m_rapIdRntiMap.end ()) | 1137 if (itRapId == m_rapIdRntiMap.end ()) |
1139 { | 1138 { |
1140 NS_FATAL_ERROR ("Unable to find rapId of RNTI " << ind.m_buildRarList.
at (i).m_rnti); | 1139 NS_FATAL_ERROR ("Unable to find rapId of RNTI " << ind.m_buildRarList.
at (i).m_rnti); |
1141 } | 1140 } |
1142 RarLteControlMessage::Rar rar; | 1141 RarLteControlMessage::Rar rar; |
1143 rar.rapId = (uint8_t)itRapId->second; | 1142 rar.rapId = static_cast<uint8_t>(itRapId->second); |
1144 rar.rarPayload = ind.m_buildRarList.at (i); | 1143 rar.rarPayload = ind.m_buildRarList.at (i); |
1145 rarMsg->AddRar (rar); | 1144 rarMsg->AddRar (rar); |
1146 NS_LOG_INFO (this << " Send RAR message to RNTI " << ind.m_buildRarList.at
(i).m_rnti << " rapId " << itRapId->second); | 1145 NS_LOG_INFO (this << " Send RAR message to RNTI " << ind.m_buildRarList.at
(i).m_rnti << " rapId " << itRapId->second); |
1147 } | 1146 } |
1148 if (ind.m_buildRarList.size () > 0) | 1147 if (ind.m_buildRarList.size () > 0) |
1149 { | 1148 { |
1150 m_enbPhySapProvider->SendLteControlMessage (rarMsg); | 1149 m_enbPhySapProvider->SendLteControlMessage (rarMsg); |
1151 } | 1150 } |
1152 m_rapIdRntiMap.clear (); | 1151 m_rapIdRntiMap.clear (); |
1153 } | 1152 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 else | 1263 else |
1265 { | 1264 { |
1266 NS_FATAL_ERROR (" HARQ functionality not implemented"); | 1265 NS_FATAL_ERROR (" HARQ functionality not implemented"); |
1267 } | 1266 } |
1268 } | 1267 } |
1269 m_dlInfoListReceived.push_back (params); | 1268 m_dlInfoListReceived.push_back (params); |
1270 } | 1269 } |
1271 | 1270 |
1272 | 1271 |
1273 } // namespace ns3 | 1272 } // namespace ns3 |
LEFT | RIGHT |