5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-ccm-mac-sap.h
1// Copyright (c) 2015 Danilo Abrignani
2//
3// SPDX-License-Identifier: GPL-2.0-only
4//
5// Author: Danilo Abrignani <danilo.abrignani@unibo.it>
6
7#ifndef NR_CCM_MAC_SAP_H
8#define NR_CCM_MAC_SAP_H
9
10#include "nr-mac-sap.h"
11#include "nr-phy-mac-common.h"
12
13namespace ns3
14{
26{
27 public:
28 virtual ~NrCcmMacSapProvider() = default;
29
36
43 virtual void ReportSrToScheduler(uint16_t rnti) = 0;
44
45}; // end of class NrCcmMacSapProvider
46
59{
60 public:
67 virtual void UlReceiveMacCe(nr::MacCeListElement_s bsr, uint8_t componentCarrierId) = 0;
68
81 virtual void UlReceiveSr(uint16_t rnti, uint8_t componentCarrierId) = 0;
82
88 virtual void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId) = 0;
89
90}; // end of class NrCcmMacSapUser
91
93template <class C>
95{
96 public:
103 // inherited from NrCcmRrcSapProvider
105 void ReportSrToScheduler(uint16_t rnti) override;
106
107 private:
108 C* m_owner;
109};
110
111template <class C>
113 : m_owner(owner)
114{
115}
116
117template <class C>
118void
120{
121 m_owner->DoReportMacCeToScheduler(bsr);
122}
123
124template <class C>
125void
127{
128 m_owner->DoReportSrToScheduler(rnti);
129}
130
132template <class C>
134{
135 public:
141 MemberNrCcmMacSapUser(C* owner);
142 // inherited from NrCcmRrcSapUser
143 void UlReceiveMacCe(nr::MacCeListElement_s bsr, uint8_t componentCarrierId) override;
144 void UlReceiveSr(uint16_t rnti, uint8_t componentCarrierId) override;
145 void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId) override;
146 // inherited from NrMacSapUser
148 void ReceivePdu(NrMacSapUser::ReceivePduParameters rxPduParams) override;
149 void NotifyHarqDeliveryFailure() override;
150
151 private:
152 C* m_owner;
153};
154
155template <class C>
157 : m_owner(owner)
158{
159}
160
161template <class C>
162void
164{
165 m_owner->DoUlReceiveMacCe(bsr, componentCarrierId);
166}
167
168template <class C>
169void
170MemberNrCcmMacSapUser<C>::UlReceiveSr(uint16_t rnti, uint8_t componentCarrierId)
171{
172 m_owner->DoUlReceiveSr(rnti, componentCarrierId);
173}
174
175template <class C>
176void
177MemberNrCcmMacSapUser<C>::NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId)
178{
179 m_owner->DoNotifyPrbOccupancy(prbOccupancy, componentCarrierId);
180}
181
182template <class C>
183void
185{
186 m_owner->DoNotifyTxOpportunity(txOpParams);
187}
188
189template <class C>
190void
192{
193 m_owner->DoReceivePdu(rxPduParams);
194}
195
196template <class C>
197void
199{
200 m_owner->DoNotifyHarqDeliveryFailure();
201}
202
203} // end of namespace ns3
204
205#endif /* NR_CCM_MAC_SAP_H */
MemberNrCcmMacSapProvider class.
void ReportMacCeToScheduler(nr::MacCeListElement_s bsr) override
Add the Buffer Status Report to the list.
void ReportSrToScheduler(uint16_t rnti) override
Report SR to the right scheduler.
MemberNrCcmMacSapUser class.
void UlReceiveMacCe(nr::MacCeListElement_s bsr, uint8_t componentCarrierId) override
When the Primary Component carrier receive a buffer status report it is sent to the CCM.
void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId) override
Notifies component carrier manager about physical resource block occupancy.
void UlReceiveSr(uint16_t rnti, uint8_t componentCarrierId) override
The MAC received a SR.
void NotifyHarqDeliveryFailure() override
void NotifyTxOpportunity(NrMacSapUser::TxOpportunityParameters txOpParams) override
void ReceivePdu(NrMacSapUser::ReceivePduParameters rxPduParams) override
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM.
virtual void ReportMacCeToScheduler(nr::MacCeListElement_s bsr)=0
Add the Buffer Status Report to the list.
virtual void ReportSrToScheduler(uint16_t rnti)=0
Report SR to the right scheduler.
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM).
virtual void UlReceiveSr(uint16_t rnti, uint8_t componentCarrierId)=0
The MAC received a SR.
virtual void NotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId)=0
Notifies component carrier manager about physical resource block occupancy.
virtual void UlReceiveMacCe(nr::MacCeListElement_s bsr, uint8_t componentCarrierId)=0
When the Primary Component carrier receive a buffer status report it is sent to the CCM.
See section 4.3.14 macCEListElement.