src/devices/wifi/qos-utils.h
author Mirko Banchi <mk.banchi@gmail.com>
Wed, 03 Feb 2010 20:34:51 +0100
changeset 5956 e9918be47f78
parent 4720 15221757964f
child 6331 eee2eab36748
permissions -rw-r--r--
MacLow now buffers QoS MPDUs under Block Ack
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4404
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     2
/*
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2009 MIRKO BANCHI
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     4
 *
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as 
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     8
 *
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    13
 *
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    17
 *
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    18
 * Author: Mirko Banchi <mk.banchi@gmail.com>
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    19
 */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    20
#ifndef QOS_UTILS_H
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    21
#define QOS_UTILS_H
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    22
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    23
#include "ns3/uinteger.h"
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    24
#include "ns3/ptr.h"
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    25
#include "ns3/packet.h"
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    26
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    27
namespace ns3 {
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    28
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    29
enum AccessClass {
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    30
  AC_VO = 0,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    31
  AC_VI = 1,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    32
  AC_BE = 2,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    33
  AC_BK = 3,
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4404
diff changeset
    34
  AC_BE_NQOS = 4,
4404
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    35
  AC_UNDEF
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    36
};
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    37
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    38
/* Maps TID (Traffic ID) to Access classes.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    39
 * For more details see table 9-1 of IEEE802.11 standard.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    40
 */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    41
AccessClass QosUtilsMapTidToAc (uint8_t tid);
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    42
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    43
/* If a qos tag is attached to the packet, returns a value < 8.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    44
   A value >= 8 is returned otherwise.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    45
 */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    46
uint8_t QosUtilsGetTidForPacket (Ptr<const Packet> packet);
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    47
5956
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    48
/*
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    49
 * Next function is useful to correctly sort buffered packets under block ack.
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    50
 * When an BAR is received from originator station, completed "old"
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    51
 * (see section 9.10.3 in IEEE802.11e) packets must be forwarded up before "new" packets.
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    52
 */
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    53
uint32_t QosUtilsMapSeqControlToUniqueInteger (uint16_t seqControl, uint16_t endSequence);
e9918be47f78 MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 4720
diff changeset
    54
4404
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    55
} //namespace ns3
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    56
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    57
#endif /* QOS_UTILS_H */