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) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 MakeTimeChecker ()) | 168 MakeTimeChecker ()) |
169 .AddAttribute ("Pifs", "The value of the PIFS constant.", | 169 .AddAttribute ("Pifs", "The value of the PIFS constant.", |
170 TimeValue (GetDefaultSifs () + GetDefaultSlot ()), | 170 TimeValue (GetDefaultSifs () + GetDefaultSlot ()), |
171 MakeTimeAccessor (&WifiMac::SetPifs, | 171 MakeTimeAccessor (&WifiMac::SetPifs, |
172 &WifiMac::GetPifs), | 172 &WifiMac::GetPifs), |
173 MakeTimeChecker ()) | 173 MakeTimeChecker ()) |
174 .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused
for now.", | 174 .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused
for now.", |
175 TimeValue (GetDefaultMaxPropagationDelay ()), | 175 TimeValue (GetDefaultMaxPropagationDelay ()), |
176 MakeTimeAccessor (&WifiMac::m_maxPropagationDelay), | 176 MakeTimeAccessor (&WifiMac::m_maxPropagationDelay), |
177 MakeTimeChecker ()) | 177 MakeTimeChecker ()) |
178 .AddAttribute ("MaxMsduSize", "The maximum size of an MSDU accepted by the M
AC layer." | |
179 "This value conforms to the specification.", | |
180 UintegerValue (2304), | |
181 MakeUintegerAccessor (&WifiMac::m_maxMsduSize), | |
182 MakeUintegerChecker<uint16_t> (1,2304)) | |
183 .AddAttribute ("Ssid", "The ssid we want to belong to.", | 178 .AddAttribute ("Ssid", "The ssid we want to belong to.", |
184 SsidValue (Ssid ("default")), | 179 SsidValue (Ssid ("default")), |
185 MakeSsidAccessor (&WifiMac::GetSsid, | 180 MakeSsidAccessor (&WifiMac::GetSsid, |
186 &WifiMac::SetSsid), | 181 &WifiMac::SetSsid), |
187 MakeSsidChecker ()) | 182 MakeSsidChecker ()) |
188 .AddTraceSource ("MacTx",· | 183 .AddTraceSource ("MacTx",· |
189 "A packet has been received from higher layers and is being
processed in preparation for " | 184 "A packet has been received from higher layers and is being
processed in preparation for " |
190 "queueing for transmission.", | 185 "queueing for transmission.", |
191 MakeTraceSourceAccessor (&WifiMac::m_macTxTrace)) | 186 MakeTraceSourceAccessor (&WifiMac::m_macTxTrace)) |
192 .AddTraceSource ("MacTxDrop",· | 187 .AddTraceSource ("MacTxDrop",· |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 WifiMac::GetMsduLifetime (void) const | 220 WifiMac::GetMsduLifetime (void) const |
226 { | 221 { |
227 return Seconds (10); | 222 return Seconds (10); |
228 } | 223 } |
229 Time | 224 Time |
230 WifiMac::GetMaxPropagationDelay (void) const | 225 WifiMac::GetMaxPropagationDelay (void) const |
231 { | 226 { |
232 return m_maxPropagationDelay; | 227 return m_maxPropagationDelay; |
233 } | 228 } |
234 | 229 |
235 uint32_t· | |
236 WifiMac::GetMaxMsduSize (void) const | |
237 { | |
238 return m_maxMsduSize; | |
239 } | |
240 | |
241 void· | 230 void· |
242 WifiMac::NotifyTx (Ptr<const Packet> packet) | 231 WifiMac::NotifyTx (Ptr<const Packet> packet) |
243 { | 232 { |
244 m_macTxTrace (packet); | 233 m_macTxTrace (packet); |
245 } | 234 } |
246 | 235 |
247 void· | 236 void· |
248 WifiMac::NotifyTxDrop (Ptr<const Packet> packet)· | 237 WifiMac::NotifyTxDrop (Ptr<const Packet> packet)· |
249 { | 238 { |
250 m_macTxDropTrace (packet); | 239 m_macTxDropTrace (packet); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 316 |
328 void | 317 void |
329 WifiMac::Configure80211g (void) | 318 WifiMac::Configure80211g (void) |
330 { | 319 { |
331 SetSifs(MicroSeconds(10)); | 320 SetSifs(MicroSeconds(10)); |
332 // Note no support for Short Slot Time as yet | 321 // Note no support for Short Slot Time as yet |
333 SetSlot(MicroSeconds(20)); | 322 SetSlot(MicroSeconds(20)); |
334 SetEifsNoDifs(MicroSeconds(10+304)); | 323 SetEifsNoDifs(MicroSeconds(10+304)); |
335 SetPifs(MicroSeconds(10+20)); | 324 SetPifs(MicroSeconds(10+20)); |
336 SetCtsTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroS
econds ()*2)); | 325 SetCtsTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroS
econds ()*2)); |
337 SetAckTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroS
econds ()*2)); | 326 SetAckTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroS
econds ()*2)); |
338 } | 327 } |
339 | 328 |
340 void | 329 void |
341 WifiMac::Configure80211_10Mhz (void) | 330 WifiMac::Configure80211_10Mhz (void) |
342 { | 331 { |
343 SetSifs(MicroSeconds(32)); | 332 SetSifs(MicroSeconds(32)); |
344 SetSlot(MicroSeconds(13));· | 333 SetSlot(MicroSeconds(13));· |
345 SetEifsNoDifs(MicroSeconds(32+88)); | 334 SetEifsNoDifs(MicroSeconds(32+88)); |
346 SetPifs(MicroSeconds(32+13)); | 335 SetPifs(MicroSeconds(32+13)); |
347 SetCtsTimeout(MicroSeconds(32+88+13+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2)); | 336 SetCtsTimeout(MicroSeconds(32+88+13+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2)); |
(...skipping 27 matching lines...) Expand all Loading... |
375 { | 364 { |
376 SetSifs(MicroSeconds(32)); | 365 SetSifs(MicroSeconds(32)); |
377 SetSlot(MicroSeconds(16));· | 366 SetSlot(MicroSeconds(16));· |
378 SetEifsNoDifs(MicroSeconds(32+88)); | 367 SetEifsNoDifs(MicroSeconds(32+88)); |
379 SetPifs(MicroSeconds(32+16)); | 368 SetPifs(MicroSeconds(32+16)); |
380 SetCtsTimeout(MicroSeconds(32+88+16+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2)); | 369 SetCtsTimeout(MicroSeconds(32+88+16+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2)); |
381 SetAckTimeout(MicroSeconds(32+88+16+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2));· | 370 SetAckTimeout(MicroSeconds(32+88+16+GetDefaultMaxPropagationDelay().GetMicroSe
conds ()*2));· |
382 } | 371 } |
383 | 372 |
384 void | 373 void |
385 WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum Access
Class ac) | 374 WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcInde
x ac) |
386 { | 375 { |
387 /* see IEE802.11 section 7.3.2.29 */ | 376 /* see IEE802.11 section 7.3.2.29 */ |
388 switch (ac) { | 377 switch (ac) { |
389 case AC_VO: | 378 case AC_VO: |
390 dcf->SetMinCw ((cwmin+1)/4-1); | 379 dcf->SetMinCw ((cwmin+1)/4-1); |
391 dcf->SetMaxCw ((cwmin+1)/2-1); | 380 dcf->SetMaxCw ((cwmin+1)/2-1); |
392 dcf->SetAifsn (2); | 381 dcf->SetAifsn (2); |
393 break; | 382 break; |
394 case AC_VI: | 383 case AC_VI: |
395 dcf->SetMinCw ((cwmin+1)/2-1); | 384 dcf->SetMinCw ((cwmin+1)/2-1); |
(...skipping 15 matching lines...) Expand all Loading... |
411 dcf->SetMaxCw (cwmax); | 400 dcf->SetMaxCw (cwmax); |
412 dcf->SetAifsn (2);···· | 401 dcf->SetAifsn (2);···· |
413 break; | 402 break; |
414 case AC_UNDEF: | 403 case AC_UNDEF: |
415 NS_FATAL_ERROR ("I don't know what to do with this"); | 404 NS_FATAL_ERROR ("I don't know what to do with this"); |
416 break; | 405 break; |
417 } | 406 } |
418 } | 407 } |
419 | 408 |
420 void | 409 void |
421 WifiMac::ConfigureCCHDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum Acc
essClass ac) | 410 WifiMac::ConfigureCCHDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcI
ndex ac) |
422 { | 411 { |
423 /* see IEEE 1609.4-2006 section 6.3.1, Table 1 */ | 412 /* see IEEE 1609.4-2006 section 6.3.1, Table 1 */ |
424 switch (ac) { | 413 switch (ac) { |
425 case AC_VO: | 414 case AC_VO: |
426 dcf->SetMinCw ((cwmin+1)/4-1); | 415 dcf->SetMinCw ((cwmin+1)/4-1); |
427 dcf->SetMaxCw ((cwmin+1)/2-1); | 416 dcf->SetMaxCw ((cwmin+1)/2-1); |
428 dcf->SetAifsn (2); | 417 dcf->SetAifsn (2); |
429 break; | 418 break; |
430 case AC_VI: | 419 case AC_VI: |
431 dcf->SetMinCw ((cwmin+1)/4-1); | 420 dcf->SetMinCw ((cwmin+1)/4-1); |
(...skipping 14 matching lines...) Expand all Loading... |
446 dcf->SetMinCw (cwmin); | 435 dcf->SetMinCw (cwmin); |
447 dcf->SetMaxCw (cwmax); | 436 dcf->SetMaxCw (cwmax); |
448 dcf->SetAifsn (2);···· | 437 dcf->SetAifsn (2);···· |
449 break; | 438 break; |
450 case AC_UNDEF: | 439 case AC_UNDEF: |
451 NS_FATAL_ERROR ("I don't know what to do with this"); | 440 NS_FATAL_ERROR ("I don't know what to do with this"); |
452 break; | 441 break; |
453 } | 442 } |
454 } | 443 } |
455 } // namespace ns3 | 444 } // namespace ns3 |
LEFT | RIGHT |