Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(189)

Unified Diff: src/wifi/model/regular-wifi-mac.cc

Issue 4664057: Netdevice queue feedback support
Patch Set: Netdevice queue support Created 12 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wifi/model/regular-wifi-mac.cc
===================================================================
--- a/src/wifi/model/regular-wifi-mac.cc
+++ b/src/wifi/model/regular-wifi-mac.cc
@@ -31,6 +31,7 @@
#include "dcf.h"
#include "dcf-manager.h"
#include "wifi-phy.h"
+#include "wifi-mac-queue.h"
#include "msdu-aggregator.h"
@@ -59,6 +60,8 @@
m_dca->SetManager (m_dcfManager);
m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
+ m_dca->SetTxQueueStartCallback (MakeCallback (&RegularWifiMac::TxQueueStart, this));
+ m_dca->SetTxQueueStopCallback (MakeCallback (&RegularWifiMac::TxQueueStop, this));
// Construct the EDCAFs. The ordering is important - highest
// priority (see Table 9-1 in IEEE 802.11-2007) must be created
@@ -151,6 +154,8 @@
edca->SetTxMiddle (m_txMiddle);
edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
+ edca->SetTxQueueStartCallback (MakeCallback (&RegularWifiMac::TxQueueStart, this));
+ edca->SetTxQueueStopCallback (MakeCallback (&RegularWifiMac::TxQueueStop, this));
edca->SetAccessCategory (ac);
edca->CompleteConfig ();
m_edca.insert (std::make_pair (ac, edca));
@@ -233,6 +238,47 @@
}
void
+RegularWifiMac::SetTxQueueStartCallback (Callback<bool,uint32_t> queueStart)
+{
+ NS_LOG_FUNCTION (this);
+ m_queueStart = queueStart;
+}
+
+void
+RegularWifiMac::SetTxQueueStopCallback (Callback<bool,uint32_t> queueStop)
+{
+ NS_LOG_FUNCTION (this);
+ m_queueStop = queueStop;
+}
+
+QueueState
+RegularWifiMac::GetQueueState (uint32_t index)
+{
+ NS_ASSERT (index < GetNQueues ());
+
+ QueueState qs;
+
+ if (index == 0)
+ {
+ qs.IsStopped = m_dca->IsQueueStopped ();
+ qs.size = m_dca->GetQueue ()->GetSize ();
+ }
+ else
+ {
+ qs.IsStopped = m_edca[QosUtilsMapTidToAc (index-1)]->IsQueueStopped ();
+ qs.size = m_edca[QosUtilsMapTidToAc (index-1)]->GetQueue ()->GetSize ();
+ }
+
+ return qs;
+}
+
+uint32_t
+RegularWifiMac::GetNQueues (void)
+{
+ return m_edca.size () + 1;
+}
+
+void
RegularWifiMac::SetQosSupported (bool enable)
{
NS_LOG_FUNCTION (this);
@@ -700,4 +746,19 @@
m_txErrCallback (hdr);
}
+void
+RegularWifiMac::TxQueueStart(uint32_t index)
+{
+ NS_ASSERT (index < GetNQueues ());
+
+ m_queueStart(index);
+}
+void
+RegularWifiMac::TxQueueStop(uint32_t index)
+{
+ NS_ASSERT (index < GetNQueues ());
+
+ m_queueStop(index);
+}
+
} // namespace ns3

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b