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 (static_cast<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 15 matching lines...) Expand all Loading... |
335 | 335 |
336 TypeId | 336 TypeId |
337 LteEnbMac::GetTypeId (void) | 337 LteEnbMac::GetTypeId (void) |
338 { | 338 { |
339 static TypeId tid = TypeId ("ns3::LteEnbMac") | 339 static TypeId tid = TypeId ("ns3::LteEnbMac") |
340 .SetParent<Object> () | 340 .SetParent<Object> () |
341 .SetGroupName("Lte") | 341 .SetGroupName("Lte") |
342 .AddConstructor<LteEnbMac> () | 342 .AddConstructor<LteEnbMac> () |
343 .AddAttribute ("NumberOfRaPreambles", | 343 .AddAttribute ("NumberOfRaPreambles", |
344 "how many random access preambles are available for the conte
ntion based RACH process", | 344 "how many random access preambles are available for the conte
ntion based RACH process", |
345 UintegerValue (50), | 345 UintegerValue (52), |
346 MakeUintegerAccessor (&LteEnbMac::m_numberOfRaPreambles), | 346 MakeUintegerAccessor (&LteEnbMac::m_numberOfRaPreambles), |
347 MakeUintegerChecker<uint8_t> (4, 64)) | 347 MakeUintegerChecker<uint8_t> (4, 64)) |
348 .AddAttribute ("PreambleTransMax", | 348 .AddAttribute ("PreambleTransMax", |
349 "Maximum number of random access preamble transmissions", | 349 "Maximum number of random access preamble transmissions", |
350 UintegerValue (50), | 350 UintegerValue (50), |
351 MakeUintegerAccessor (&LteEnbMac::m_preambleTransMax), | 351 MakeUintegerAccessor (&LteEnbMac::m_preambleTransMax), |
352 MakeUintegerChecker<uint8_t> (3, 200)) | 352 MakeUintegerChecker<uint8_t> (3, 200)) |
353 .AddAttribute ("RaResponseWindowSize", | 353 .AddAttribute ("RaResponseWindowSize", |
354 "length of the window (in TTIs) for the reception of the rand
om access response (RAR); the resulting RAR timeout is this value + 3 ms", | 354 "length of the window (in TTIs) for the reception of the rand
om access response (RAR); the resulting RAR timeout is this value + 3 ms", |
355 UintegerValue (3), | 355 UintegerValue (3), |
(...skipping 187 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> (static_cast<
uint8_t>(rnti), 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 params.m_logicalChannelConfigList.push_back (lccle); | 885 params.m_logicalChannelConfigList.push_back (lccle); |
886 | 886 |
887 m_cschedSapProvider->CschedLcConfigReq (params); | 887 m_cschedSapProvider->CschedLcConfigReq (params); |
888 } | 888 } |
889 } | 889 } |
890 | 890 |
891 void | 891 void |
892 LteEnbMac::DoReconfigureLc (LteEnbCmacSapProvider::LcInfo lcinfo) | 892 LteEnbMac::DoReconfigureLc (LteEnbCmacSapProvider::LcInfo lcinfo) |
893 { | 893 { |
894 NS_FATAL_ERROR ("not implemented"); | 894 NS_FATAL_ERROR ("not implemented"); |
895 NS_UNUSED(lcinfo); | 895 NS_UNUSED (lcinfo); |
896 } | 896 } |
897 | 897 |
898 void | 898 void |
899 LteEnbMac::DoReleaseLc (uint16_t rnti, uint8_t lcid) | 899 LteEnbMac::DoReleaseLc (uint16_t rnti, uint8_t lcid) |
900 { | 900 { |
901 NS_LOG_FUNCTION (this); | 901 NS_LOG_FUNCTION (this); |
902 | 902 |
903 //Find user based on rnti and then erase lcid stored against the same | 903 //Find user based on rnti and then erase lcid stored against the same |
904 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_r
lcAttached.find (rnti); | 904 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_r
lcAttached.find (rnti); |
905 rntiIt->second.erase (lcid); | 905 rntiIt->second.erase (lcid); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1117 } |
1118 } | 1118 } |
1119 | 1119 |
1120 // Random Access procedure: send RARs | 1120 // Random Access procedure: send RARs |
1121 Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> (); | 1121 Ptr<RarLteControlMessage> rarMsg = Create<RarLteControlMessage> (); |
1122 // 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 |
1123 // (plus 3GPP counts subframes from 0, not 1) | 1123 // (plus 3GPP counts subframes from 0, not 1) |
1124 uint16_t raRnti; | 1124 uint16_t raRnti; |
1125 if (m_subframeNo < 3) | 1125 if (m_subframeNo < 3) |
1126 { | 1126 { |
1127 raRnti = static_cast<uint16_t>(m_subframeNo + 7); // equivalent to +10-3 | 1127 raRnti = static_cast<uint16_t> (m_subframeNo + 7); // equivalent to +10-3 |
1128 } | 1128 } |
1129 else | 1129 else |
1130 { | 1130 { |
1131 raRnti = static_cast<uint16_t>(m_subframeNo - 3); | 1131 raRnti = static_cast<uint16_t> (m_subframeNo - 3); |
1132 } | 1132 } |
1133 rarMsg->SetRaRnti (raRnti); | 1133 rarMsg->SetRaRnti (raRnti); |
1134 for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++) | 1134 for (unsigned int i = 0; i < ind.m_buildRarList.size (); i++) |
1135 { | 1135 { |
1136 std::map <uint8_t, uint32_t>::iterator itRapId = m_rapIdRntiMap.find (stat
ic_cast<uint8_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)); |
1137 if (itRapId == m_rapIdRntiMap.end ()) | 1137 if (itRapId == m_rapIdRntiMap.end ()) |
1138 { | 1138 { |
1139 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); |
1140 } | 1140 } |
1141 RarLteControlMessage::Rar rar; | 1141 RarLteControlMessage::Rar rar; |
1142 rar.rapId = static_cast<uint8_t>(itRapId->second); | 1142 rar.rapId = static_cast<uint8_t> (itRapId->second); |
1143 rar.rarPayload = ind.m_buildRarList.at (i); | 1143 rar.rarPayload = ind.m_buildRarList.at (i); |
1144 rarMsg->AddRar (rar); | 1144 rarMsg->AddRar (rar); |
1145 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); |
1146 } | 1146 } |
1147 if (ind.m_buildRarList.size () > 0) | 1147 if (ind.m_buildRarList.size () > 0) |
1148 { | 1148 { |
1149 m_enbPhySapProvider->SendLteControlMessage (rarMsg); | 1149 m_enbPhySapProvider->SendLteControlMessage (rarMsg); |
1150 } | 1150 } |
1151 m_rapIdRntiMap.clear (); | 1151 m_rapIdRntiMap.clear (); |
1152 } | 1152 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 else | 1263 else |
1264 { | 1264 { |
1265 NS_FATAL_ERROR (" HARQ functionality not implemented"); | 1265 NS_FATAL_ERROR (" HARQ functionality not implemented"); |
1266 } | 1266 } |
1267 } | 1267 } |
1268 m_dlInfoListReceived.push_back (params); | 1268 m_dlInfoListReceived.push_back (params); |
1269 } | 1269 } |
1270 | 1270 |
1271 | 1271 |
1272 } // namespace ns3 | 1272 } // namespace ns3 |
LEFT | RIGHT |