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

(-)a/src/wifi/model/ap-wifi-mac.cc (+4 lines)
 Lines 352-357   ApWifiMac::Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from Link Here 
352
    {
352
    {
353
      ForwardDown (packet, from, to);
353
      ForwardDown (packet, from, to);
354
    }
354
    }
355
  else
356
    {
357
      NotifyTxDrop (packet);
358
    }
355
}
359
}
356
360
357
void
361
void
(-)a/src/wifi/model/dca-txop.cc (+15 lines)
 Lines 142-147   DcaTxop::SetTxFailedCallback (TxFailed callback) Link Here 
142
  m_txFailedCallback = callback;
142
  m_txFailedCallback = callback;
143
}
143
}
144
144
145
void
146
DcaTxop::SetTxDroppedCallback (TxDropped callback)
147
{
148
  NS_LOG_FUNCTION (this << &callback);
149
  m_txDroppedCallback = callback;
150
  NS_ASSERT (m_queue);
151
  m_queue->TraceConnectWithoutContext ("Drop", MakeCallback (&DcaTxop::TxDroppedCallback, this));
152
}
153
154
void
155
DcaTxop::TxDroppedCallback (Ptr<const WifiMacQueueItem> item)
156
{
157
  m_txDroppedCallback (item->GetPacket ());
158
}
159
145
Ptr<WifiMacQueue >
160
Ptr<WifiMacQueue >
146
DcaTxop::GetQueue () const
161
DcaTxop::GetQueue () const
147
{
162
{
(-)a/src/wifi/model/dca-txop.h (+19 lines)
 Lines 80-85   public: Link Here 
80
   * packet transmission was failed.
80
   * packet transmission was failed.
81
   */
81
   */
82
  typedef Callback <void, const WifiMacHeader&> TxFailed;
82
  typedef Callback <void, const WifiMacHeader&> TxFailed;
83
  /**
84
   * typedef for a callback to invoke when a
85
   * packet is dropped.
86
   */
87
  typedef Callback <void, Ptr<const Packet> > TxDropped;
83
88
84
  /**
89
  /**
85
   * Check for EDCA.
90
   * Check for EDCA.
 Lines 123-128   public: Link Here 
123
   * packet transmission was completed unsuccessfully.
128
   * packet transmission was completed unsuccessfully.
124
   */
129
   */
125
  void SetTxFailedCallback (TxFailed callback);
130
  void SetTxFailedCallback (TxFailed callback);
131
  /**
132
   * \param callback the callback to invoke when a
133
   * packet is dropped.
134
   */
135
  void SetTxDroppedCallback (TxDropped callback);
126
136
127
  /**
137
  /**
128
   * Return the MacLow associated with this DcaTxop.
138
   * Return the MacLow associated with this DcaTxop.
 Lines 382-392   protected: Link Here 
382
   *         false otherwise.
392
   *         false otherwise.
383
   */
393
   */
384
  virtual bool IsLastFragment (void) const;
394
  virtual bool IsLastFragment (void) const;
395
  /**
396
   *
397
   * Pass the packet included in the wifi MAC queue item to the
398
   * packet dropped callback.
399
   *
400
   * \param item the wifi MAC queue item.
401
   */
402
  void TxDroppedCallback (Ptr<const WifiMacQueueItem> item);
385
403
386
  DcfState *m_dcf; //!< the DCF state
404
  DcfState *m_dcf; //!< the DCF state
387
  DcfManager *m_manager; //!< the DCF manager
405
  DcfManager *m_manager; //!< the DCF manager
388
  TxOk m_txOkCallback; //!< the transmit OK callback
406
  TxOk m_txOkCallback; //!< the transmit OK callback
389
  TxFailed m_txFailedCallback; //!< the transmit failed callback
407
  TxFailed m_txFailedCallback; //!< the transmit failed callback
408
  TxDropped m_txDroppedCallback; //!< the packet dropped callback
390
  Ptr<WifiMacQueue> m_queue; //!< the wifi MAC queue
409
  Ptr<WifiMacQueue> m_queue; //!< the wifi MAC queue
391
  MacTxMiddle *m_txMiddle; //!< the MacTxMiddle
410
  MacTxMiddle *m_txMiddle; //!< the MacTxMiddle
392
  Ptr <MacLow> m_low; //!< the MacLow
411
  Ptr <MacLow> m_low; //!< the MacLow
(-)a/src/wifi/model/regular-wifi-mac.cc (+2 lines)
 Lines 59-64   RegularWifiMac::RegularWifiMac () Link Here 
59
  m_dca->SetTxMiddle (m_txMiddle);
59
  m_dca->SetTxMiddle (m_txMiddle);
60
  m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
60
  m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
61
  m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
61
  m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
62
  m_dca->SetTxDroppedCallback (MakeCallback (&RegularWifiMac::NotifyTxDrop, this));
62
63
63
  //Construct the EDCAFs. The ordering is important - highest
64
  //Construct the EDCAFs. The ordering is important - highest
64
  //priority (Table 9-1 UP-to-AC mapping; IEEE 802.11-2012) must be created
65
  //priority (Table 9-1 UP-to-AC mapping; IEEE 802.11-2012) must be created
 Lines 425-430   RegularWifiMac::SetupEdcaQueue (AcIndex ac) Link Here 
425
  edca->SetTxMiddle (m_txMiddle);
426
  edca->SetTxMiddle (m_txMiddle);
426
  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
427
  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
427
  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
428
  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
429
  edca->SetTxDroppedCallback (MakeCallback (&RegularWifiMac::NotifyTxDrop, this));
428
  edca->SetAccessCategory (ac);
430
  edca->SetAccessCategory (ac);
429
  edca->CompleteConfig ();
431
  edca->CompleteConfig ();
430
432
(-)a/src/wifi/model/wifi-mac.cc (-1 / +1 lines)
 Lines 209-215   WifiMac::GetTypeId (void) Link Here 
209
                     MakeTraceSourceAccessor (&WifiMac::m_macTxTrace),
209
                     MakeTraceSourceAccessor (&WifiMac::m_macTxTrace),
210
                     "ns3::Packet::TracedCallback")
210
                     "ns3::Packet::TracedCallback")
211
    .AddTraceSource ("MacTxDrop",
211
    .AddTraceSource ("MacTxDrop",
212
                     "A packet has been dropped in the MAC layer before being queued for transmission.",
212
                     "A packet has been dropped in the MAC layer before transmission.",
213
                     MakeTraceSourceAccessor (&WifiMac::m_macTxDropTrace),
213
                     MakeTraceSourceAccessor (&WifiMac::m_macTxDropTrace),
214
                     "ns3::Packet::TracedCallback")
214
                     "ns3::Packet::TracedCallback")
215
    .AddTraceSource ("MacPromiscRx",
215
    .AddTraceSource ("MacPromiscRx",

Return to bug 1034