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) 2015 Danilo Abrignani | 3 * Copyright (c) 2015 Danilo Abrignani |
4 * Copyright (c) 2016 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 4 * Copyright (c) 2016 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 | 190 |
191 } | 191 } |
192 | 192 |
193 void | 193 void |
194 NoOpComponentCarrierManager::DoAddLc (LteEnbCmacSapProvider::LcInfo lcInfo, LteM
acSapUser* msu) | 194 NoOpComponentCarrierManager::DoAddLc (LteEnbCmacSapProvider::LcInfo lcInfo, LteM
acSapUser* msu) |
195 { | 195 { |
196 NS_LOG_FUNCTION (this); | 196 NS_LOG_FUNCTION (this); |
197 NS_ASSERT_MSG( m_rlcLcInstantiated.find(lcInfo.rnti) != m_rlcLcInstantiated.en
d(), "Adding lc for a user that was not yet added to component carrier manager l
ist."); | 197 NS_ASSERT_MSG( m_rlcLcInstantiated.find(lcInfo.rnti) != m_rlcLcInstantiated.en
d(), "Adding lc for a user that was not yet added to component carrier manager l
ist."); |
198 NS_UNUSED(msu); | 198 NS_UNUSED (msu); |
199 m_rlcLcInstantiated.find(lcInfo.rnti)->second.insert(std::pair <uint8_t, LteEn
bCmacSapProvider::LcInfo> (lcInfo.lcId, lcInfo)); | 199 m_rlcLcInstantiated.find(lcInfo.rnti)->second.insert(std::pair <uint8_t, LteEn
bCmacSapProvider::LcInfo> (lcInfo.lcId, lcInfo)); |
200 } | 200 } |
201 | 201 |
202 | 202 |
203 void | 203 void |
204 NoOpComponentCarrierManager::DoRemoveUe (uint16_t rnti) | 204 NoOpComponentCarrierManager::DoRemoveUe (uint16_t rnti) |
205 { | 205 { |
206 NS_LOG_FUNCTION (this); | 206 NS_LOG_FUNCTION (this); |
207 std::map<uint16_t, uint8_t>::iterator stateIt; | 207 std::map<uint16_t, uint8_t>::iterator stateIt; |
208 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator | 208 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator |
209 stateIt = m_ueState.find (rnti); | 209 stateIt = m_ueState.find (rnti); |
210 eccIt = m_enabledComponentCarrier.find (rnti); | 210 eccIt = m_enabledComponentCarrier.find (rnti); |
211 NS_ASSERT_MSG (stateIt != m_ueState.end (), "request to remove UE info with un
known rnti "); | 211 NS_ASSERT_MSG (stateIt != m_ueState.end (), "request to remove UE info with un
known rnti "); |
212 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to remove U
E info with unknown rnti "); | 212 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to remove U
E info with unknown rnti "); |
213 | 213 |
214 } | 214 } |
215 | 215 |
216 std::vector<LteCcmRrcSapProvider::LcsConfig> | 216 std::vector<LteCcmRrcSapProvider::LcsConfig> |
217 NoOpComponentCarrierManager::DoSetupDataRadioBearer (EpsBearer bearer, uint8_t b
earerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu) | 217 NoOpComponentCarrierManager::DoSetupDataRadioBearer (EpsBearer bearer, uint8_t b
earerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu) |
218 { | 218 { |
219 NS_LOG_FUNCTION (this << rnti); | 219 NS_LOG_FUNCTION (this << rnti); |
220 NS_UNUSED(bearerId); | 220 NS_UNUSED (bearerId); |
221 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator | 221 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator |
222 eccIt = m_enabledComponentCarrier.find (rnti); | 222 eccIt = m_enabledComponentCarrier.find (rnti); |
223 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "SetupDataRadioBeare
r on unknown rnti "); | 223 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "SetupDataRadioBeare
r on unknown rnti "); |
224 | 224 |
225 // enable by default all carriers | 225 // enable by default all carriers |
226 eccIt->second = static_cast<uint8_t>(m_noOfComponentCarriers); | 226 eccIt->second = static_cast<uint8_t> (m_noOfComponentCarriers); |
227 | 227 |
228 std::vector<LteCcmRrcSapProvider::LcsConfig> res; | 228 std::vector<LteCcmRrcSapProvider::LcsConfig> res; |
229 LteCcmRrcSapProvider::LcsConfig entry; | 229 LteCcmRrcSapProvider::LcsConfig entry; |
230 LteEnbCmacSapProvider::LcInfo lcinfo; | 230 LteEnbCmacSapProvider::LcInfo lcinfo; |
231 // NS_LOG_DEBUG (this << " componentCarrierEnabled " << (uint16_t) eccIt->seco
nd); | 231 // NS_LOG_DEBUG (this << " componentCarrierEnabled " << (uint16_t) eccIt->seco
nd); |
232 for (uint16_t ncc = 0; ncc < m_noOfComponentCarriers; ncc++) | 232 for (uint16_t ncc = 0; ncc < m_noOfComponentCarriers; ncc++) |
233 { | 233 { |
234 // NS_LOG_DEBUG (this << " res size " << (uint16_t) res.size ()); | 234 // NS_LOG_DEBUG (this << " res size " << (uint16_t) res.size ()); |
235 LteEnbCmacSapProvider::LcInfo lci; | 235 LteEnbCmacSapProvider::LcInfo lci; |
236 lci.rnti = rnti; | 236 lci.rnti = rnti; |
237 lci.lcId = lcid; | 237 lci.lcId = lcid; |
238 lci.lcGroup = lcGroup; | 238 lci.lcGroup = lcGroup; |
239 lci.qci = static_cast<uint8_t>(bearer.qci); | 239 lci.qci = static_cast<uint8_t> (bearer.qci); |
240 if (ncc == 0) | 240 if (ncc == 0) |
241 { | 241 { |
242 lci.isGbr = bearer.IsGbr (); | 242 lci.isGbr = bearer.IsGbr (); |
243 lci.mbrUl = bearer.gbrQosInfo.mbrUl; | 243 lci.mbrUl = bearer.gbrQosInfo.mbrUl; |
244 lci.mbrDl = bearer.gbrQosInfo.mbrDl; | 244 lci.mbrDl = bearer.gbrQosInfo.mbrDl; |
245 lci.gbrUl = bearer.gbrQosInfo.gbrUl; | 245 lci.gbrUl = bearer.gbrQosInfo.gbrUl; |
246 lci.gbrDl = bearer.gbrQosInfo.gbrDl; | 246 lci.gbrDl = bearer.gbrQosInfo.gbrDl; |
247 } | 247 } |
248 else | 248 else |
249 { | 249 { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 NS_ASSERT_MSG (sapIt != m_ueAttached.end (), "RNTI not found"); | 282 NS_ASSERT_MSG (sapIt != m_ueAttached.end (), "RNTI not found"); |
283 rntiIter = m_rlcLcInstantiated.find (rnti); | 283 rntiIter = m_rlcLcInstantiated.find (rnti); |
284 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->
second.find (lcid); | 284 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->
second.find (lcid); |
285 //std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = sapIt->second.find (lci
nfo.lcId); | 285 //std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = sapIt->second.find (lci
nfo.lcId); |
286 NS_ASSERT_MSG (rntiIter != m_rlcLcInstantiated.end (), "RNTI not found"); | 286 NS_ASSERT_MSG (rntiIter != m_rlcLcInstantiated.end (), "RNTI not found"); |
287 if (lcidIt == rntiIter->second.end ()) | 287 if (lcidIt == rntiIter->second.end ()) |
288 { | 288 { |
289 lcinfo.rnti = rnti; | 289 lcinfo.rnti = rnti; |
290 lcinfo.lcId = lcid; | 290 lcinfo.lcId = lcid; |
291 lcinfo.lcGroup = lcGroup; | 291 lcinfo.lcGroup = lcGroup; |
292 lcinfo.qci = static_cast<uint8_t>(bearer.qci); | 292 lcinfo.qci = static_cast<uint8_t> (bearer.qci); |
293 lcinfo.isGbr = bearer.IsGbr (); | 293 lcinfo.isGbr = bearer.IsGbr (); |
294 lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; | 294 lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; |
295 lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; | 295 lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; |
296 lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; | 296 lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; |
297 lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; | 297 lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; |
298 rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo>
(lcinfo.lcId, lcinfo)); | 298 rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo>
(lcinfo.lcId, lcinfo)); |
299 sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu
)); | 299 sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu
)); |
300 } | 300 } |
301 else | 301 else |
302 { | 302 { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 } | 466 } |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 | 470 |
471 void | 471 void |
472 RrComponentCarrierManager::DoUlReceiveMacCe (MacCeListElement_s bsr, uint8_t com
ponentCarrierId) | 472 RrComponentCarrierManager::DoUlReceiveMacCe (MacCeListElement_s bsr, uint8_t com
ponentCarrierId) |
473 { | 473 { |
474 NS_LOG_FUNCTION (this); | 474 NS_LOG_FUNCTION (this); |
475 NS_ASSERT_MSG (componentCarrierId == 0, "Received BSR from a ComponentCarrier
not allowed, ComponentCarrierId = " << componentCarrierId); | 475 NS_ASSERT_MSG (componentCarrierId == 0, "Received BSR from a ComponentCarrier
not allowed, ComponentCarrierId = " << componentCarrierId); |
476 (void)componentCarrierId; // make compiler happy | 476 (void)componentCarrierId; // make compiler happy |
477 NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control
Message not allowed " << bsr.m_macCeType); | 477 NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control
Message not allowed " << bsr.m_macCeType); |
478 | 478 |
479 // split traffic in uplink equally among carriers | 479 // split traffic in uplink equally among carriers |
480 uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find(bsr.m_rnti)->s
econd; | 480 uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find(bsr.m_rnti)->s
econd; |
481 | 481 |
482 if ( bsr.m_macCeType == MacCeListElement_s::BSR) | 482 if ( bsr.m_macCeType == MacCeListElement_s::BSR) |
483 { | 483 { |
484 MacCeListElement_s newBsr; | 484 MacCeListElement_s newBsr; |
485 newBsr.m_rnti = bsr.m_rnti; | 485 newBsr.m_rnti = bsr.m_rnti; |
486 // mac control element type, values can be BSR, PHR, CRNTI | 486 // mac control element type, values can be BSR, PHR, CRNTI |
(...skipping 25 matching lines...) Expand all Loading... |
512 } | 512 } |
513 } | 513 } |
514 else | 514 else |
515 { | 515 { |
516 auto ueManager = m_ccmRrcSapUser->GetUeManager (bsr.m_rnti); | 516 auto ueManager = m_ccmRrcSapUser->GetUeManager (bsr.m_rnti); |
517 m_ccmMacSapProviderMap.at (ueManager->GetComponentCarrierId ())->ReportMac
CeToScheduler (bsr); | 517 m_ccmMacSapProviderMap.at (ueManager->GetComponentCarrierId ())->ReportMac
CeToScheduler (bsr); |
518 } | 518 } |
519 } | 519 } |
520 | 520 |
521 } // end of namespace ns3 | 521 } // end of namespace ns3 |
LEFT | RIGHT |