src/devices/wifi/qsta-wifi-mac.cc
changeset 6331 eee2eab36748
parent 6242 803b7efd0117
child 6597 7fbc895f7361
equal deleted inserted replaced
6330:af9c574246d5 6331:eee2eab36748
   107   m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle));
   107   m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle));
   108 
   108 
   109   m_dcfManager = new DcfManager ();
   109   m_dcfManager = new DcfManager ();
   110   m_dcfManager->SetupLowListener (m_low);
   110   m_dcfManager->SetupLowListener (m_low);
   111 
   111 
       
   112   // Construct the EDCAFs. The ordering is important - highest
       
   113   // priority (see Table 9-1 in IEEE 802.11-2007) must be created
       
   114   // first.
   112   SetQueue (AC_VO);
   115   SetQueue (AC_VO);
   113   SetQueue (AC_VI);
   116   SetQueue (AC_VI);
   114   SetQueue (AC_BE);
   117   SetQueue (AC_BE);
   115   SetQueue (AC_BK);
   118   SetQueue (AC_BK);
   116 }
   119 }
   544   
   547   
   545   uint8_t tid = QosUtilsGetTidForPacket (packet);
   548   uint8_t tid = QosUtilsGetTidForPacket (packet);
   546   if (tid < 8)
   549   if (tid < 8)
   547     {
   550     {
   548       hdr.SetQosTid (tid);
   551       hdr.SetQosTid (tid);
   549       AccessClass ac = QosUtilsMapTidToAc (tid);
   552       AcIndex ac = QosUtilsMapTidToAc (tid);
   550       m_queues[ac]->Queue (packet, hdr);
   553       m_queues[ac]->Queue (packet, hdr);
   551     }
   554     }
   552   else
   555   else
   553     {
   556     {
   554       //packet is considerated belonging to BestEffort Access Class (AC_BE)
   557       //packet is considerated belonging to BestEffort Access Class (AC_BE)
   728               m_low->DestroyBlockAckAgreement (hdr->GetAddr2 (), delBaHdr.GetTid ());
   731               m_low->DestroyBlockAckAgreement (hdr->GetAddr2 (), delBaHdr.GetTid ());
   729             }
   732             }
   730           else
   733           else
   731             {
   734             {
   732               /* We must notify correct queue tear down of agreement */
   735               /* We must notify correct queue tear down of agreement */
   733               AccessClass ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
   736               AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
   734               m_queues[ac]->GotDelBaFrame (&delBaHdr, hdr->GetAddr2 ());
   737               m_queues[ac]->GotDelBaFrame (&delBaHdr, hdr->GetAddr2 ());
   735             }
   738             }
   736         }
   739         }
   737     }
   740     }
   738 }
   741 }
   783 {
   786 {
   784   return m_queues.find (AC_BK)->second;
   787   return m_queues.find (AC_BK)->second;
   785 }
   788 }
   786 
   789 
   787 void
   790 void
   788 QstaWifiMac::SetQueue (enum AccessClass ac)
   791 QstaWifiMac::SetQueue (enum AcIndex ac)
   789 {
   792 {
   790   Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
   793   Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
   791   edca->SetLow (m_low);
   794   edca->SetLow (m_low);
   792   edca->SetManager (m_dcfManager);
   795   edca->SetManager (m_dcfManager);
   793   edca->SetTypeOfStation (STA);
   796   edca->SetTypeOfStation (STA);
   794   edca->SetTxMiddle (m_txMiddle);
   797   edca->SetTxMiddle (m_txMiddle);
   795   edca->SetAccessClass (ac);
   798   edca->SetAccessCategory (ac);
   796   edca->CompleteConfig ();
   799   edca->CompleteConfig ();
   797   m_queues.insert (std::make_pair(ac, edca));
   800   m_queues.insert (std::make_pair(ac, edca));
   798 }
   801 }
   799 void
   802 void
   800 QstaWifiMac::DoStart ()
   803 QstaWifiMac::DoStart ()