OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 class UniformRandomVariable; | 41 class UniformRandomVariable; |
42 | 42 |
43 class LteUeMac : public Object | 43 class LteUeMac : public Object |
44 { | 44 { |
45 friend class UeMemberLteUeCmacSapProvider; | 45 friend class UeMemberLteUeCmacSapProvider; |
46 friend class UeMemberLteMacSapProvider; | 46 friend class UeMemberLteMacSapProvider; |
47 friend class UeMemberLteUePhySapUser; | 47 friend class UeMemberLteUePhySapUser; |
48 | 48 |
49 public: | 49 public: |
| 50 /** |
| 51 * \brief Get the type ID. |
| 52 * \return the object TypeId |
| 53 */ |
50 static TypeId GetTypeId (void); | 54 static TypeId GetTypeId (void); |
51 | 55 |
52 LteUeMac (); | 56 LteUeMac (); |
53 virtual ~LteUeMac (); | 57 virtual ~LteUeMac (); |
54 virtual void DoDispose (void); | 58 virtual void DoDispose (void); |
55 | 59 |
| 60 /** |
| 61 * \brief Get the LTE MAC SAP provider |
| 62 * \return a pointer to the LTE MAC SAP provider |
| 63 */ |
56 LteMacSapProvider* GetLteMacSapProvider (void); | 64 LteMacSapProvider* GetLteMacSapProvider (void); |
| 65 /** |
| 66 * \brief Set the LTE UE CMAC SAP user |
| 67 * \param s the LTE UE CMAC SAP User |
| 68 */ |
57 void SetLteUeCmacSapUser (LteUeCmacSapUser* s); | 69 void SetLteUeCmacSapUser (LteUeCmacSapUser* s); |
| 70 /** |
| 71 * \brief Get the LTE CMAC SAP provider |
| 72 * \return a pointer to the LTE CMAC SAP provider |
| 73 */ |
58 LteUeCmacSapProvider* GetLteUeCmacSapProvider (void); | 74 LteUeCmacSapProvider* GetLteUeCmacSapProvider (void); |
59 ·· | 75 ·· |
| 76 /** |
| 77 * \brief Set the component carried ID |
| 78 * \param index the component carrier ID |
| 79 */ |
60 void SetComponentCarrierId (uint8_t index); | 80 void SetComponentCarrierId (uint8_t index); |
61 | 81 |
62 /** | 82 /** |
63 * \brief Get the PHY SAP user | 83 * \brief Get the PHY SAP user |
64 * \return a pointer to the SAP user of the PHY | 84 * \return a pointer to the SAP user of the PHY |
65 */ | 85 */ |
66 LteUePhySapUser* GetLteUePhySapUser (); | 86 LteUePhySapUser* GetLteUePhySapUser (); |
67 | 87 |
68 /** | 88 /** |
69 * \brief Set the PHY SAP Provider | 89 * \brief Set the PHY SAP Provider |
(...skipping 14 matching lines...) Expand all Loading... |
84 * used by this model. Return the number of streams (possibly zero) that | 104 * used by this model. Return the number of streams (possibly zero) that |
85 * have been assigned. | 105 * have been assigned. |
86 * | 106 * |
87 * \param stream first stream index to use | 107 * \param stream first stream index to use |
88 * \return the number of stream indices assigned by this model | 108 * \return the number of stream indices assigned by this model |
89 */ | 109 */ |
90 int64_t AssignStreams (int64_t stream); | 110 int64_t AssignStreams (int64_t stream); |
91 | 111 |
92 private: | 112 private: |
93 // forwarded from MAC SAP | 113 // forwarded from MAC SAP |
| 114 /** |
| 115 * Transmit PDU function |
| 116 * |
| 117 * \param params LteMacSapProvider::TransmitPduParameters |
| 118 */ |
94 void DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params); | 119 void DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params); |
| 120 /** |
| 121 * Report buffers status function |
| 122 * |
| 123 * \param params LteMacSapProvider::ReportBufferStatusParameters |
| 124 */ |
95 void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters par
ams); | 125 void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters par
ams); |
96 | 126 |
97 // forwarded from UE CMAC SAP | 127 // forwarded from UE CMAC SAP |
| 128 /** |
| 129 * Configure RACH function |
| 130 * |
| 131 * \param rc LteUeCmacSapProvider::RachConfig |
| 132 */ |
98 void DoConfigureRach (LteUeCmacSapProvider::RachConfig rc); | 133 void DoConfigureRach (LteUeCmacSapProvider::RachConfig rc); |
| 134 /** |
| 135 * Start contention based random access procedure function |
| 136 */ |
99 void DoStartContentionBasedRandomAccessProcedure (); | 137 void DoStartContentionBasedRandomAccessProcedure (); |
| 138 /** |
| 139 * Set RNTI |
| 140 * |
| 141 * \param rnti the RNTI |
| 142 */ |
100 void DoSetRnti (uint16_t rnti); | 143 void DoSetRnti (uint16_t rnti); |
| 144 /** |
| 145 * Start non contention based random access procedure function |
| 146 * |
| 147 * \param rnti the RNTI |
| 148 * \param rapId the RAPID |
| 149 * \param prachMask the PRACH mask |
| 150 */ |
101 void DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t ra
pId, uint8_t prachMask); | 151 void DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t ra
pId, uint8_t prachMask); |
| 152 /** |
| 153 * Add LC function |
| 154 * |
| 155 * \param lcId the LCID |
| 156 * \param lcConfig the logical channel config |
| 157 * \param msu the MSU |
| 158 */ |
102 void DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfi
g, LteMacSapUser* msu); | 159 void DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfi
g, LteMacSapUser* msu); |
| 160 /** |
| 161 * Remove LC function |
| 162 * |
| 163 * \param lcId the LCID |
| 164 */ |
103 void DoRemoveLc (uint8_t lcId); | 165 void DoRemoveLc (uint8_t lcId); |
| 166 /// Reset function |
104 void DoReset (); | 167 void DoReset (); |
105 | 168 |
106 // forwarded from PHY SAP | 169 // forwarded from PHY SAP |
| 170 /** |
| 171 * Receive Phy PDU function |
| 172 * |
| 173 * \param p the packet |
| 174 */ |
107 void DoReceivePhyPdu (Ptr<Packet> p); | 175 void DoReceivePhyPdu (Ptr<Packet> p); |
| 176 /** |
| 177 * Receive LTE control message function |
| 178 * |
| 179 * \param msg the LTE control message |
| 180 */ |
108 void DoReceiveLteControlMessage (Ptr<LteControlMessage> msg); | 181 void DoReceiveLteControlMessage (Ptr<LteControlMessage> msg); |
109 ·· | 182 ·· |
110 // internal methods | 183 // internal methods |
| 184 /// Randomly sleect and send RA preamble function |
111 void RandomlySelectAndSendRaPreamble (); | 185 void RandomlySelectAndSendRaPreamble (); |
| 186 /** |
| 187 * Send RA preamble function |
| 188 * |
| 189 * \param contention if true randomly select and send te RA preamble |
| 190 */ |
112 void SendRaPreamble (bool contention); | 191 void SendRaPreamble (bool contention); |
| 192 /// Start waiting for RA response function |
113 void StartWaitingForRaResponse (); | 193 void StartWaitingForRaResponse (); |
| 194 /** |
| 195 * Receive the RA response function |
| 196 * |
| 197 * \param raResponse RA response received |
| 198 */ |
114 void RecvRaResponse (BuildRarListElement_s raResponse); | 199 void RecvRaResponse (BuildRarListElement_s raResponse); |
| 200 /** |
| 201 * RA response timeout function |
| 202 * |
| 203 * \param contention if true randomly select and send te RA preamble |
| 204 */ |
115 void RaResponseTimeout (bool contention); | 205 void RaResponseTimeout (bool contention); |
| 206 /// Send report buffer status |
116 void SendReportBufferStatus (void); | 207 void SendReportBufferStatus (void); |
| 208 /// Refresh HARQ processes packet buffer function |
117 void RefreshHarqProcessesPacketBuffer (void); | 209 void RefreshHarqProcessesPacketBuffer (void); |
118 | 210 |
119 /// component carrier Id --> used to address sap | 211 /// component carrier Id --> used to address sap |
120 uint8_t m_componentCarrierId; | 212 uint8_t m_componentCarrierId; |
121 | 213 |
122 private: | 214 private: |
123 | 215 |
| 216 /// LcInfo structure |
124 struct LcInfo | 217 struct LcInfo |
125 { | 218 { |
126 LteUeCmacSapProvider::LogicalChannelConfig lcConfig; | 219 LteUeCmacSapProvider::LogicalChannelConfig lcConfig; ///< logical channel co
nfig |
127 LteMacSapUser* macSapUser; | 220 LteMacSapUser* macSapUser; ///< MAC SAP user |
128 }; | 221 }; |
129 | 222 |
130 std::map <uint8_t, LcInfo> m_lcInfoMap; | 223 std::map <uint8_t, LcInfo> m_lcInfoMap; ///< logical channel info map |
131 | 224 |
132 LteMacSapProvider* m_macSapProvider; | 225 LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider |
133 | 226 |
134 LteUeCmacSapUser* m_cmacSapUser; | 227 LteUeCmacSapUser* m_cmacSapUser; ///< CMAC SAP user |
135 LteUeCmacSapProvider* m_cmacSapProvider; | 228 LteUeCmacSapProvider* m_cmacSapProvider; ///< CMAC SAP provider |
136 | 229 |
137 LteUePhySapProvider* m_uePhySapProvider; | 230 LteUePhySapProvider* m_uePhySapProvider; ///< UE Phy SAP provider |
138 LteUePhySapUser* m_uePhySapUser; | 231 LteUePhySapUser* m_uePhySapUser; ///< UE Phy SAP user |
139 ·· | 232 ·· |
140 std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters> m_ulBsrRec
eived; // BSR received from RLC (the last one) | 233 std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters> m_ulBsrRec
eived; ///< BSR received from RLC (the last one) |
141 ·· | 234 ·· |
142 ·· | 235 ·· |
143 Time m_bsrPeriodicity; | 236 Time m_bsrPeriodicity; ///< BSR periodicity |
144 Time m_bsrLast; | 237 Time m_bsrLast; ///< BSR last |
145 ·· | 238 ·· |
146 bool m_freshUlBsr; // true when a BSR has been received in the last TTI | 239 bool m_freshUlBsr; ///< true when a BSR has been received in the last TTI |
147 | 240 |
148 uint8_t m_harqProcessId; | 241 uint8_t m_harqProcessId; ///< HARQ process ID |
149 std::vector < Ptr<PacketBurst> > m_miUlHarqProcessesPacket; // Packets under t
rasmission of the UL HARQ processes | 242 std::vector < Ptr<PacketBurst> > m_miUlHarqProcessesPacket; ///< Packets under
trasmission of the UL HARQ processes |
150 std::vector < uint8_t > m_miUlHarqProcessesPacketTimer; // timer for packet li
fe in the buffer | 243 std::vector < uint8_t > m_miUlHarqProcessesPacketTimer; ///< timer for packet
life in the buffer |
151 | 244 |
152 uint16_t m_rnti; | 245 uint16_t m_rnti; ///< RNTI |
153 | 246 |
154 bool m_rachConfigured; | 247 bool m_rachConfigured; ///< is RACH configured? |
155 LteUeCmacSapProvider::RachConfig m_rachConfig; | 248 LteUeCmacSapProvider::RachConfig m_rachConfig; ///< RACH configuration |
156 uint8_t m_raPreambleId; | 249 uint8_t m_raPreambleId; ///< RA preamble ID |
157 uint8_t m_preambleTransmissionCounter; | 250 uint8_t m_preambleTransmissionCounter; ///< preamble tranamission counter |
158 uint16_t m_backoffParameter; | 251 uint16_t m_backoffParameter; ///< backoff parameter |
159 EventId m_noRaResponseReceivedEvent; | 252 EventId m_noRaResponseReceivedEvent; ///< no RA response received event ID |
160 Ptr<UniformRandomVariable> m_raPreambleUniformVariable; | 253 Ptr<UniformRandomVariable> m_raPreambleUniformVariable; ///< RA preamble rando
m variable |
161 | 254 |
162 uint32_t m_frameNo; | 255 uint32_t m_frameNo; ///< frame number |
163 uint32_t m_subframeNo; | 256 uint32_t m_subframeNo; ///< subframe number |
164 uint8_t m_raRnti; | 257 uint8_t m_raRnti; ///< RA RNTI |
165 bool m_waitingForRaResponse; | 258 bool m_waitingForRaResponse; ///< waiting for RA response |
166 }; | 259 }; |
167 | 260 |
168 } // namespace ns3 | 261 } // namespace ns3 |
169 | 262 |
170 #endif // LTE_UE_MAC_ENTITY | 263 #endif // LTE_UE_MAC_ENTITY |
OLD | NEW |