Left: | ||
Right: |
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 | 3 * Copyright (c) 2015 |
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 start.WriteHtolsbU32 (GetVhtCapabilitiesInfo ()); | 105 start.WriteHtolsbU32 (GetVhtCapabilitiesInfo ()); |
106 start.WriteHtolsbU64 (GetSupportedMcsAndNssSet ()); | 106 start.WriteHtolsbU64 (GetSupportedMcsAndNssSet ()); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 uint8_t | 110 uint8_t |
111 VhtCapabilities::DeserializeInformationField (Buffer::Iterator start, | 111 VhtCapabilities::DeserializeInformationField (Buffer::Iterator start, |
112 uint8_t length) | 112 uint8_t length) |
113 { | 113 { |
114 Buffer::Iterator i = start; | 114 Buffer::Iterator i = start; |
115 uint16_t vhtinfo = static_cast<uint16_t>(i.ReadLsbtohU32 ()); | 115 uint32_t vhtinfo = i.ReadLsbtohU32 (); |
S. Deronne
2017/12/17 15:39:15
very strange here, we read 32 bits but we store in
ammo6818-vandals.uidaho.edu
2017/12/20 04:16:35
vhtinfo changed to uint32_t and cast removed.
|
S. Deronne
2018/02/18 14:52:56
Good
|
116 uint64_t mcsset = i.ReadLsbtohU64 (); | 116 uint64_t mcsset = i.ReadLsbtohU64 (); |
117 SetVhtCapabilitiesInfo (vhtinfo); | 117 SetVhtCapabilitiesInfo (vhtinfo); |
118 SetSupportedMcsAndNssSet (mcsset); | 118 SetSupportedMcsAndNssSet (mcsset); |
119 return length; | 119 return length; |
120 } | 120 } |
121 | 121 |
122 void | 122 void |
123 VhtCapabilities::SetVhtCapabilitiesInfo (uint32_t ctrl) | 123 VhtCapabilities::SetVhtCapabilitiesInfo (uint32_t ctrl) |
124 { | 124 { |
125 m_maxMpduLength = ctrl & 0x03; | 125 m_maxMpduLength = ctrl & 0x03; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 { | 174 { |
175 uint16_t n; | 175 uint16_t n; |
176 for (uint8_t i = 0; i < 8; i++) | 176 for (uint8_t i = 0; i < 8; i++) |
177 { | 177 { |
178 n = i * 2; | 178 n = i * 2; |
179 m_rxMcsMap[i] = (ctrl >> n) & 0x03; | 179 m_rxMcsMap[i] = (ctrl >> n) & 0x03; |
180 } | 180 } |
181 m_rxHighestSupportedLongGuardIntervalDataRate = (ctrl >> 16) & 0x1fff; | 181 m_rxHighestSupportedLongGuardIntervalDataRate = (ctrl >> 16) & 0x1fff; |
182 for (uint8_t i = 0; i < 8; i++) | 182 for (uint8_t i = 0; i < 8; i++) |
183 { | 183 { |
184 n = (i * 2) + 32; | 184 n = (i * 2) + 32; |
S. Deronne
2018/02/18 14:52:56
Indeed, not needed to redefine n :-)
| |
185 m_txMcsMap[i] = (ctrl >> n) & 0x03; | 185 m_txMcsMap[i] = (ctrl >> n) & 0x03; |
186 } | 186 } |
187 m_txHighestSupportedLongGuardIntervalDataRate = (ctrl >> 48) & 0x1fff; | 187 m_txHighestSupportedLongGuardIntervalDataRate = (ctrl >> 48) & 0x1fff; |
188 } | 188 } |
189 | 189 |
190 uint64_t | 190 uint64_t |
191 VhtCapabilities::GetSupportedMcsAndNssSet () const | 191 VhtCapabilities::GetSupportedMcsAndNssSet () const |
192 { | 192 { |
193 uint64_t val = 0; | 193 uint64_t val = 0; |
194 uint16_t n; | 194 uint16_t n; |
195 for (uint8_t i = 0; i < 8; i++) | 195 for (uint8_t i = 0; i < 8; i++) |
196 { | 196 { |
197 n = i * 2; | 197 n = i * 2; |
198 val |= ((uint64_t)m_rxMcsMap[i] & 0x03) << n; | 198 val |= (static_cast<uint64_t> (m_rxMcsMap[i]) & 0x03) << n; |
199 } | 199 } |
200 val |= ((uint64_t)m_rxHighestSupportedLongGuardIntervalDataRate & 0x1fff) << 16; | 200 val |= (static_cast<uint64_t> (m_rxHighestSupportedLongGuardIntervalDataRate) & 0x1fff) << 16; |
201 for (uint8_t i = 0; i < 8; i++) | 201 for (uint8_t i = 0; i < 8; i++) |
202 { | 202 { |
203 n = (i * 2) + 32; | 203 n = (i * 2) + 32; |
204 val |= ((uint64_t)m_txMcsMap[i] & 0x03) << n; | 204 val |= (static_cast<uint64_t> (m_txMcsMap[i]) & 0x03) << n; |
205 } | 205 } |
206 val |= ((uint64_t)m_txHighestSupportedLongGuardIntervalDataRate & 0x1fff) << 4 8; | 206 val |= (static_cast<uint64_t> (m_txHighestSupportedLongGuardIntervalDataRate) & 0x1fff) << 48; |
207 return val; | 207 return val; |
208 } | 208 } |
209 | 209 |
210 void | 210 void |
211 VhtCapabilities::SetMaxMpduLength (uint8_t length) | 211 VhtCapabilities::SetMaxMpduLength (uint8_t length) |
212 { | 212 { |
213 m_maxMpduLength = length; | 213 m_maxMpduLength = length; |
214 } | 214 } |
215 | 215 |
216 void | 216 void |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 | 317 |
318 void | 318 void |
319 VhtCapabilities::SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate) | 319 VhtCapabilities::SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate) |
320 { | 320 { |
321 m_txHighestSupportedLongGuardIntervalDataRate = supporteddatarate; | 321 m_txHighestSupportedLongGuardIntervalDataRate = supporteddatarate; |
322 } | 322 } |
323 | 323 |
324 uint8_t | 324 uint8_t |
325 VhtCapabilities::GetMaxMpduLength () const | 325 VhtCapabilities::GetMaxMpduLength () const |
326 { | 326 { |
327 return static_cast<uint8_t>(m_maxMpduLength); | 327 return m_maxMpduLength; |
S. Deronne
2017/12/17 15:39:15
not ok, m_maxMpduLength should be 8 bits
ammo6818-vandals.uidaho.edu
2017/12/20 04:16:34
m_maxMpduLength changed from uint16_t to uint8_t
| |
328 } | 328 } |
329 | 329 |
330 uint8_t | 330 uint8_t |
331 VhtCapabilities::GetSupportedChannelWidthSet () const | 331 VhtCapabilities::GetSupportedChannelWidthSet () const |
332 { | 332 { |
333 return static_cast<uint8_t>(m_supportedChannelWidthSet); | 333 return m_supportedChannelWidthSet; |
S. Deronne
2017/12/17 15:39:15
not ok, m_supportedChannelWidthSet should be 8 bit
ammo6818-vandals.uidaho.edu
2017/12/20 04:16:34
m_supportedChannelWidthSet changed from uint16_t t
| |
334 } | 334 } |
335 | 335 |
336 uint8_t | 336 uint8_t |
337 VhtCapabilities::GetRxLdpc () const | 337 VhtCapabilities::GetRxLdpc () const |
338 { | 338 { |
339 return m_rxLdpc; | 339 return m_rxLdpc; |
340 } | 340 } |
341 | 341 |
342 uint8_t | 342 uint8_t |
343 VhtCapabilities::GetShortGuardIntervalFor80Mhz () const | 343 VhtCapabilities::GetShortGuardIntervalFor80Mhz () const |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
457 uint32_t c1; | 457 uint32_t c1; |
458 uint64_t c2; | 458 uint64_t c2; |
459 is >> c1 >> c2; | 459 is >> c1 >> c2; |
460 VhtCapabilities.SetVhtCapabilitiesInfo (c1); | 460 VhtCapabilities.SetVhtCapabilitiesInfo (c1); |
461 VhtCapabilities.SetSupportedMcsAndNssSet (c2); | 461 VhtCapabilities.SetSupportedMcsAndNssSet (c2); |
462 | 462 |
463 return is; | 463 return is; |
464 } | 464 } |
465 | 465 |
466 } //namespace ns3 | 466 } //namespace ns3 |
LEFT | RIGHT |