src/wifi/model/wifi-mac.cc
author Peter D. Barnes, Jr. <barnes26@llnl.gov>
Thu, 14 Nov 2013 16:58:28 -0800
changeset 10410 4d4eb8097fa3
parent 10204 7a102bb70a36
child 10652 dc18deba4502
permissions -rw-r--r--
doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7162
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     2
/*
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     3
 * Copyright (c) 2008 INRIA
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     4
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     7
 * published by the Free Software Foundation;
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     8
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    12
 * GNU General Public License for more details.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    13
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    14
 * You should have received a copy of the GNU General Public License
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    15
 * along with this program; if not, write to the Free Software
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    17
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    19
 */
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#include "wifi-mac.h"
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
    21
#include "dcf.h"
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#include "ns3/uinteger.h"
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
    23
#include "ns3/trace-source-accessor.h"
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
namespace ns3 {
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
10410
4d4eb8097fa3 doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10204
diff changeset
    27
NS_OBJECT_ENSURE_REGISTERED (WifiMac)
4d4eb8097fa3 doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10204
diff changeset
    28
  ;
4d4eb8097fa3 doxygen] Suppress "warning: Member NS_OBJECT_ENSURE_REGISTERED is not documented"
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10204
diff changeset
    29
  
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
WifiMac::GetDefaultMaxPropagationDelay (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    34
  // 1000m
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
  return Seconds (1000.0 / 300000000.0);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
WifiMac::GetDefaultSlot (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
  // 802.11-a specific
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
  return MicroSeconds (9);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
WifiMac::GetDefaultSifs (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
  // 802.11-a specific
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
  return MicroSeconds (16);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
}
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    49
Time 
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    50
WifiMac::GetDefaultRifs (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    51
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    52
  //802.11n specific
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    53
  return MicroSeconds (2);
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    54
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
WifiMac::GetDefaultEifsNoDifs (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
  return GetDefaultSifs () + GetDefaultCtsAckDelay ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
WifiMac::GetDefaultCtsAckDelay (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
  // 802.11-a specific: 6mb/s
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
  return MicroSeconds (44);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    67
WifiMac::GetDefaultCtsAckTimeout (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    68
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    69
  /* Cts_Timeout and Ack_Timeout are specified in the Annex C
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    70
     (Formal description of MAC operation, see details on the
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    71
     Trsp timer setting at page 346)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    72
  */
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    73
  Time ctsTimeout = GetDefaultSifs ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    74
  ctsTimeout += GetDefaultCtsAckDelay ();
4509
b2654e0f071d bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents: 4272
diff changeset
    75
  ctsTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
  ctsTimeout += GetDefaultSlot ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    77
  return ctsTimeout;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    78
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    79
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    80
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    81
WifiMac::GetDefaultBasicBlockAckDelay (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    82
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    83
  // This value must be rivisited
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    84
  return MicroSeconds (250);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    85
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    86
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    87
WifiMac::GetDefaultCompressedBlockAckDelay (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    88
{
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    89
  // This value must be rivisited was 68. 
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    90
 //CompressedBlockAckSize 32* 8*time it takes to transfer at the lowest rate (6Mb/s)+ aPhy-StartDelay(33)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    91
  return MicroSeconds (76);
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    92
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    93
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    94
WifiMac::GetDefaultBasicBlockAckTimeout (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    95
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    96
  Time blockAckTimeout = GetDefaultSifs ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    97
  blockAckTimeout += GetDefaultBasicBlockAckDelay ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    98
  blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    99
  blockAckTimeout += GetDefaultSlot ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   100
  return blockAckTimeout;
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   101
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   102
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   103
WifiMac::GetDefaultCompressedBlockAckTimeout (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   104
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   105
  Time blockAckTimeout = GetDefaultSifs ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   106
  blockAckTimeout += GetDefaultCompressedBlockAckDelay ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   107
  blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   108
  blockAckTimeout += GetDefaultSlot ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   109
  return blockAckTimeout;
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   110
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   111
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   112
void
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   113
WifiMac::SetBasicBlockAckTimeout (Time blockAckTimeout)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   114
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   115
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   116
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   117
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   118
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   119
WifiMac::GetBasicBlockAckTimeout (void) const
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   120
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   121
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   122
  return MicroSeconds (0);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   123
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   124
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   125
void
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   126
WifiMac::SetCompressedBlockAckTimeout (Time blockAckTimeout)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   127
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   128
  //this methos must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   129
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   130
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   131
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   132
WifiMac::GetCompressedBlockAckTimeout (void) const
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   133
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   134
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   135
  return MicroSeconds (0);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   136
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   137
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   138
TypeId
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   139
WifiMac::GetTypeId (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   140
{
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
   141
  static TypeId tid = TypeId ("ns3::WifiMac")
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   142
    .SetParent<Object> ()
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   143
    .AddAttribute ("CtsTimeout", "When this timeout expires, the RTS/CTS handshake has failed.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   144
                   TimeValue (GetDefaultCtsAckTimeout ()),
3747
789e9a21ecbe bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3599
diff changeset
   145
                   MakeTimeAccessor (&WifiMac::SetCtsTimeout,
789e9a21ecbe bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3599
diff changeset
   146
                                     &WifiMac::GetCtsTimeout),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   147
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   148
    .AddAttribute ("AckTimeout", "When this timeout expires, the DATA/ACK handshake has failed.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   149
                   TimeValue (GetDefaultCtsAckTimeout ()),
3596
6c39b712a535 move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3212
diff changeset
   150
                   MakeTimeAccessor (&WifiMac::GetAckTimeout,
6c39b712a535 move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3212
diff changeset
   151
                                     &WifiMac::SetAckTimeout),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   152
                   MakeTimeChecker ())
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   153
    .AddAttribute ("BasicBlockAckTimeout", "When this timeout expires, the BASIC_BLOCK_ACK_REQ/BASIC_BLOCK_ACK handshake has failed.",
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   154
                   TimeValue (GetDefaultBasicBlockAckTimeout ()),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   155
                   MakeTimeAccessor (&WifiMac::GetBasicBlockAckTimeout,
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   156
                                     &WifiMac::SetBasicBlockAckTimeout),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   157
                   MakeTimeChecker ())
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   158
    .AddAttribute ("CompressedBlockAckTimeout", "When this timeout expires, the COMPRESSED_BLOCK_ACK_REQ/COMPRESSED_BLOCK_ACK handshake has failed.",
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   159
                   TimeValue (GetDefaultCompressedBlockAckTimeout ()),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   160
                   MakeTimeAccessor (&WifiMac::GetCompressedBlockAckTimeout,
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   161
                                     &WifiMac::SetCompressedBlockAckTimeout),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   162
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   163
    .AddAttribute ("Sifs", "The value of the SIFS constant.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   164
                   TimeValue (GetDefaultSifs ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   165
                   MakeTimeAccessor (&WifiMac::SetSifs,
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   166
                                     &WifiMac::GetSifs),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   167
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   168
    .AddAttribute ("EifsNoDifs", "The value of EIFS-DIFS",
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   169
                   TimeValue (GetDefaultEifsNoDifs ()),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   170
                   MakeTimeAccessor (&WifiMac::SetEifsNoDifs,
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   171
                                     &WifiMac::GetEifsNoDifs),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   172
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   173
    .AddAttribute ("Slot", "The duration of a Slot.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   174
                   TimeValue (GetDefaultSlot ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   175
                   MakeTimeAccessor (&WifiMac::SetSlot,
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   176
                                     &WifiMac::GetSlot),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   177
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   178
    .AddAttribute ("Pifs", "The value of the PIFS constant.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   179
                   TimeValue (GetDefaultSifs () + GetDefaultSlot ()),
3599
721bd46c15f8 move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3596
diff changeset
   180
                   MakeTimeAccessor (&WifiMac::SetPifs,
721bd46c15f8 move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3596
diff changeset
   181
                                     &WifiMac::GetPifs),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   182
                   MakeTimeChecker ())
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   183
.AddAttribute ("Rifs", "The value of the RIFS constant.",
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   184
                   TimeValue (GetDefaultRifs ()),
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   185
                   MakeTimeAccessor (&WifiMac::SetRifs,
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   186
                                     &WifiMac::GetRifs),
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   187
                   MakeTimeChecker ())
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   188
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   189
    .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused for now.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   190
                   TimeValue (GetDefaultMaxPropagationDelay ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
                   MakeTimeAccessor (&WifiMac::m_maxPropagationDelay),
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   193
    .AddAttribute ("Ssid", "The ssid we want to belong to.",
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   194
                   SsidValue (Ssid ("default")),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   195
                   MakeSsidAccessor (&WifiMac::GetSsid,
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   196
                                     &WifiMac::SetSsid),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   197
                   MakeSsidChecker ())
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   198
    .AddTraceSource ("MacTx",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   199
                     "A packet has been received from higher layers and is being processed in preparation for "
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   200
                     "queueing for transmission.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   201
                     MakeTraceSourceAccessor (&WifiMac::m_macTxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   202
    .AddTraceSource ("MacTxDrop",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   203
                     "A packet has been dropped in the MAC layer before being queued for transmission.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   204
                     MakeTraceSourceAccessor (&WifiMac::m_macTxDropTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   205
    .AddTraceSource ("MacPromiscRx",
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   206
                     "A packet has been received by this device, has been passed up from the physical layer "
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   207
                     "and is being forwarded up the local protocol stack.  This is a promiscuous trace,",
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   208
                     MakeTraceSourceAccessor (&WifiMac::m_macPromiscRxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   209
    .AddTraceSource ("MacRx",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   210
                     "A packet has been received by this device, has been passed up from the physical layer "
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   211
                     "and is being forwarded up the local protocol stack.  This is a non-promiscuous trace,",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   212
                     MakeTraceSourceAccessor (&WifiMac::m_macRxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   213
    .AddTraceSource ("MacRxDrop",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   214
                     "A packet has been dropped in the MAC layer after it has been passed up from the physical "
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   215
                     "layer.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   216
                     MakeTraceSourceAccessor (&WifiMac::m_macRxDropTrace))
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   217
#if 0
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   218
    // Not currently implemented in this device
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   219
    .AddTraceSource ("Sniffer",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   220
                     "Trace source simulating a non-promiscuous packet sniffer attached to the device",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   221
                     MakeTraceSourceAccessor (&WifiMac::m_snifferTrace))
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   222
#endif
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   223
  ;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   224
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
  return tid;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   226
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   228
void
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
WifiMac::SetMaxPropagationDelay (Time delay)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   230
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   231
  m_maxPropagationDelay = delay;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   233
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
WifiMac::GetMsduLifetime (void) const
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   236
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   237
  return Seconds (10);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   238
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   240
WifiMac::GetMaxPropagationDelay (void) const
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   241
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   242
  return m_maxPropagationDelay;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   243
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   244
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   245
void
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   246
WifiMac::NotifyTx (Ptr<const Packet> packet)
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   247
{
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   248
  m_macTxTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   249
}
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   250
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   251
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   252
WifiMac::NotifyTxDrop (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   253
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   254
  m_macTxDropTrace (packet);
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   255
}
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   256
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   257
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   258
WifiMac::NotifyRx (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   259
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   260
  m_macRxTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   261
}
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   262
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   263
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   264
WifiMac::NotifyPromiscRx (Ptr<const Packet> packet)
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   265
{
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   266
  m_macPromiscRxTrace (packet);
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   267
}
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   268
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   269
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   270
WifiMac::NotifyRxDrop (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   271
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   272
  m_macRxDropTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   273
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   274
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   275
void
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   276
WifiMac::ConfigureStandard (enum WifiPhyStandard standard)
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   277
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   278
  switch (standard)
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   279
    {
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   280
    case WIFI_PHY_STANDARD_80211a:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   281
      Configure80211a ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   282
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   283
    case WIFI_PHY_STANDARD_80211b:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   284
      Configure80211b ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   285
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   286
    case WIFI_PHY_STANDARD_80211g:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   287
      Configure80211g ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   288
      break;
7482
35c01487f7f7 _Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents: 7385
diff changeset
   289
    case WIFI_PHY_STANDARD_80211_10MHZ:
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   290
      Configure80211_10Mhz ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   291
      break;
7482
35c01487f7f7 _Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents: 7385
diff changeset
   292
    case WIFI_PHY_STANDARD_80211_5MHZ:
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   293
      Configure80211_5Mhz ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   294
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   295
    case WIFI_PHY_STANDARD_holland:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   296
      Configure80211a ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   297
      break;
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   298
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   299
      Configure80211n_2_4Ghz ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   300
      break;
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   301
    case WIFI_PHY_STANDARD_80211n_5GHZ:
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   302
      Configure80211n_5Ghz ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   303
      break;
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   304
    default:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   305
      NS_ASSERT (false);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   306
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   307
    }
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   308
  FinishConfigureStandard (standard);
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   309
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   310
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   311
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   312
WifiMac::Configure80211a (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   313
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   314
  SetSifs (MicroSeconds (16));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   315
  SetSlot (MicroSeconds (9));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   316
  SetEifsNoDifs (MicroSeconds (16 + 44));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   317
  SetPifs (MicroSeconds (16 + 9));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   318
  SetCtsTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   319
  SetAckTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   320
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   321
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   322
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   323
WifiMac::Configure80211b (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   324
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   325
  SetSifs (MicroSeconds (10));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   326
  SetSlot (MicroSeconds (20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   327
  SetEifsNoDifs (MicroSeconds (10 + 304));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   328
  SetPifs (MicroSeconds (10 + 20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   329
  SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   330
  SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   331
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   332
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   333
void
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   334
WifiMac::Configure80211g (void)
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   335
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   336
  SetSifs (MicroSeconds (10));
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   337
  // Note no support for Short Slot Time as yet
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   338
  SetSlot (MicroSeconds (20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   339
  SetEifsNoDifs (MicroSeconds (10 + 304));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   340
  SetPifs (MicroSeconds (10 + 20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   341
  SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   342
  SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   343
}
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   344
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   345
void
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   346
WifiMac::Configure80211_10Mhz (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   347
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   348
  SetSifs (MicroSeconds (32));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   349
  SetSlot (MicroSeconds (13));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   350
  SetEifsNoDifs (MicroSeconds (32 + 88));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   351
  SetPifs (MicroSeconds (32 + 13));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   352
  SetCtsTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   353
  SetAckTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   354
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   355
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   356
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   357
WifiMac::Configure80211_5Mhz (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   358
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   359
  SetSifs (MicroSeconds (64));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   360
  SetSlot (MicroSeconds (21));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   361
  SetEifsNoDifs (MicroSeconds (64 + 176));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   362
  SetPifs (MicroSeconds (64 + 21));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   363
  SetCtsTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   364
  SetAckTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   365
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   366
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   367
void
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   368
WifiMac::Configure80211n_2_4Ghz (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   369
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   370
  Configure80211g ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   371
  SetRifs(MicroSeconds (2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   372
  SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   373
  SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   374
}
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   375
void
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   376
WifiMac::Configure80211n_5Ghz (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   377
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   378
  Configure80211a ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   379
  SetRifs(MicroSeconds (2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   380
  SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   381
  SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   382
}
5747
a171e73c4dae add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents: 4720
diff changeset
   383
a171e73c4dae add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents: 4720
diff changeset
   384
void
6331
eee2eab36748 Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents: 6183
diff changeset
   385
WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   386
{
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   387
  /* see IEE802.11 section 7.3.2.29 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   388
  switch (ac)
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   389
    {
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   390
    case AC_VO:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   391
      dcf->SetMinCw ((cwmin + 1) / 4 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   392
      dcf->SetMaxCw ((cwmin + 1) / 2 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   393
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   394
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   395
    case AC_VI:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   396
      dcf->SetMinCw ((cwmin + 1) / 2 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   397
      dcf->SetMaxCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   398
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   399
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   400
    case AC_BE:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   401
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   402
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   403
      dcf->SetAifsn (3);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   404
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   405
    case AC_BK:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   406
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   407
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   408
      dcf->SetAifsn (7);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   409
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   410
    case AC_BE_NQOS:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   411
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   412
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   413
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   414
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   415
    case AC_UNDEF:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   416
      NS_FATAL_ERROR ("I don't know what to do with this");
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   417
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   418
    }
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   419
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   420
} // namespace ns3