View | Details | Raw Unified | Return to bug 668
Collapse All | Expand All

(-)a/src/devices/mesh/mesh-wifi-interface-mac.cc (-2 / +2 lines)
 Lines 401-411    Link Here 
401
  if (packet->RemovePacketTag (tag))
401
  if (packet->RemovePacketTag (tag))
402
    {
402
    {
403
      hdr.SetType (WIFI_MAC_QOSDATA);
403
      hdr.SetType (WIFI_MAC_QOSDATA);
404
      hdr.SetQosTid (tag.Get ());
404
      hdr.SetQosTid (tag.GetTid ());
405
      //Aftre setting type DsFrom and DsTo fields are reset.
405
      //Aftre setting type DsFrom and DsTo fields are reset.
406
      hdr.SetDsFrom ();
406
      hdr.SetDsFrom ();
407
      hdr.SetDsTo ();
407
      hdr.SetDsTo ();
408
      ac = QosUtilsMapTidToAc (tag.Get ());
408
      ac = QosUtilsMapTidToAc (tag.GetTid ());
409
    }
409
    }
410
  m_stats.sentFrames++;
410
  m_stats.sentFrames++;
411
  m_stats.sentBytes += packet->GetSize ();
411
  m_stats.sentBytes += packet->GetSize ();
(-)a/src/devices/wifi/qos-tag.cc (-9 / +15 lines)
 Lines 31-37    Link Here 
31
    .AddConstructor<QosTag> ()
31
    .AddConstructor<QosTag> ()
32
    .AddAttribute ("tid", "The tid that indicates AC which packet belongs",
32
    .AddAttribute ("tid", "The tid that indicates AC which packet belongs",
33
                   UintegerValue (0),
33
                   UintegerValue (0),
34
                   MakeUintegerAccessor (&QosTag::Get),
34
                   MakeUintegerAccessor (&QosTag::GetTid),
35
                   MakeUintegerChecker<uint8_t> ())
35
                   MakeUintegerChecker<uint8_t> ())
36
    ;
36
    ;
37
  return tid;
37
  return tid;
 Lines 49-54    Link Here 
49
QosTag::QosTag (uint8_t tid):
49
QosTag::QosTag (uint8_t tid):
50
  m_tid (tid)
50
  m_tid (tid)
51
{}
51
{}
52
  
53
void
54
QosTag::SetTid (uint8_t tid)
55
{
56
  m_tid = tid;
57
}
58
59
void
60
QosTag::SetUserPriority (UserPriority up)
61
{
62
  m_tid = up;
63
}
52
64
53
uint32_t 
65
uint32_t 
54
QosTag::GetSerializedSize (void) const
66
QosTag::GetSerializedSize (void) const
 Lines 65-81    Link Here 
65
void
77
void
66
QosTag::Deserialize (TagBuffer i)
78
QosTag::Deserialize (TagBuffer i)
67
{
79
{
68
  m_tid = i.ReadU8 ();
80
  m_tid = (UserPriority) i.ReadU8 ();
69
}
70
71
void
72
QosTag::Set (uint8_t tid)
73
{
74
  m_tid = tid;
75
}
81
}
76
82
77
uint8_t
83
uint8_t
78
QosTag::Get () const
84
QosTag::GetTid () const
79
{
85
{
80
  return m_tid;
86
  return m_tid;
81
}
87
}
(-)a/src/devices/wifi/qos-tag.h (-3 / +61 lines)
 Lines 26-46    Link Here 
26
26
27
class Tag;
27
class Tag;
28
28
29
30
/**
31
 * As per IEEE Std. 802.11-2007, Section 6.1.1.1.1, when EDCA is used the
32
 * the Traffic ID (TID) value corresponds to one of the User Priority (UP)
33
 * values defined by the IEEE Std. 802.1D-2004, Annex G, table G-2.
34
 *
35
 * Note that this correspondence does not hold for HCCA, since in that
36
 * case the mapping between UPs and TIDs should be determined by a
37
 * TSPEC element as per IEEE Std. 802.11-2007, Section 7.3.2.30
38
 */
39
enum UserPriority {
40
  UP_BK = 1, /**< background  */
41
  UP_BE = 0, /**< best effort (default) */
42
  UP_EE = 3, /**< excellent effort  */
43
  UP_CL = 4, /**< controlled load */
44
  UP_VI = 5, /**< video, < 100ms latency and jitter */
45
  UP_VO = 6, /**< voice, < 10ms latency and jitter */
46
  UP_NC = 7  /**< network control */
47
};
48
  
49
50
  
51
  /**
52
   * The aim of the QosTag is to provide means for an Application to
53
   * specify the TID which will be used by a QoS-aware WifiMac for a
54
   * given traffic flow. Note that the current QosTag class was
55
   * designed to be completely mac/wifi specific without any attempt
56
   * at being generic. 
57
   */
29
class QosTag : public Tag
58
class QosTag : public Tag
30
{
59
{
31
public:
60
public:
32
  static TypeId GetTypeId (void);
61
  static TypeId GetTypeId (void);
33
  virtual TypeId GetInstanceTypeId (void) const;
62
  virtual TypeId GetInstanceTypeId (void) const;
34
  
63
64
  /** 
65
   * Create a QosTag with the default TID = 0 (best effort traffic) 
66
   */  
35
  QosTag ();
67
  QosTag ();
68
69
  /** 
70
   * Create a QosTag with the given TID 
71
   */  
36
  QosTag (uint8_t tid);
72
  QosTag (uint8_t tid);
73
74
  /** 
75
   * Set the TID to the given value. This assumes that the
76
   * application is aware of the QoS support provided by the MAC
77
   * layer, and is therefore able to set the correct TID. 
78
   * 
79
   * @param tid the value of the TID to set
80
   */
81
  void SetTid (uint8_t tid);
82
83
  /** 
84
   * Set the TID to the value that corresponds to the requested
85
   * UserPriority. Note that, since the mapping of UserPriority to TID
86
   * is defined for EDCA only, you should call this method only when
87
   * EDCA is used. When using HDCA, QosTag(uint8_t tid) should be used
88
   * instead.
89
   * 
90
   * @param up the requested UserPriority
91
   * 
92
   */
93
  void SetUserPriority (UserPriority up);
94
37
  virtual void Serialize (TagBuffer i) const;
95
  virtual void Serialize (TagBuffer i) const;
38
  virtual void Deserialize (TagBuffer i);
96
  virtual void Deserialize (TagBuffer i);
39
  virtual uint32_t GetSerializedSize () const;
97
  virtual uint32_t GetSerializedSize () const;
40
  virtual void Print (std::ostream &os) const;
98
  virtual void Print (std::ostream &os) const;
41
99
42
  uint8_t Get (void) const;
100
  uint8_t GetTid (void) const;
43
  void Set (uint8_t tid);
101
44
private:
102
private:
45
  uint8_t m_tid;
103
  uint8_t m_tid;
46
};
104
};
(-)a/src/devices/wifi/qos-utils.cc (-2 / +2 lines)
 Lines 61-69    Link Here 
61
  uint8_t tid = 8;
61
  uint8_t tid = 8;
62
  if (packet->PeekPacketTag (qos))
62
  if (packet->PeekPacketTag (qos))
63
    {
63
    {
64
      if (qos.Get () < 8)
64
      if (qos.GetTid () < 8)
65
        {
65
        {
66
          tid = qos.Get ();
66
          tid = qos.GetTid ();
67
        }
67
        }
68
    }
68
    }
69
  return tid;
69
  return tid;

Return to bug 668