que_mgt.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/que_mgt.h#1
  3. */
  4. /*! \file "que_mgt.h"
  5. \brief TX/RX queues management header file
  6. The main tasks of queue management include TC-based HIF TX flow control,
  7. adaptive TC quota adjustment, HIF TX grant scheduling, Power-Save
  8. forwarding control, RX packet reordering, and RX BA agreement management.
  9. */
  10. /*
  11. ** Log: que_mgt.h
  12. *
  13. * 08 15 2011 cp.wu
  14. * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
  15. * add MT6628-specific definitions.
  16. *
  17. * 07 26 2011 eddie.chen
  18. * [WCXRP00000874] [MT5931][DRV] API for query the RX reorder queued packets counter
  19. * API for query the RX reorder queued packets counter.
  20. *
  21. * 06 14 2011 eddie.chen
  22. * [WCXRP00000753] [MT5931 Wi-Fi][DRV] Adjust QM for MT5931
  23. * Change the parameter for WMM pass.
  24. *
  25. * 05 31 2011 eddie.chen
  26. * [WCXRP00000753] [MT5931 Wi-Fi][DRV] Adjust QM for MT5931
  27. * Fix the QM quota in MT5931.
  28. *
  29. * 05 09 2011 eddie.chen
  30. * [WCXRP00000709] [MT6620 Wi-Fi][Driver] Check free number before copying broadcast packet
  31. * Check free number before copying broadcast packet.
  32. *
  33. * 04 14 2011 eddie.chen
  34. * [WCXRP00000603] [MT6620 Wi-Fi][DRV] Fix Klocwork warning
  35. * Check the SW RFB free. Fix the compile warning..
  36. *
  37. * 04 08 2011 eddie.chen
  38. * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
  39. * Fix for sigma
  40. *
  41. * 03 28 2011 eddie.chen
  42. * [WCXRP00000602] [MT6620 Wi-Fi][DRV] Fix wmm parameters in beacon for BOW
  43. * Fix wmm parameters in beacon for BOW.
  44. *
  45. * 03 15 2011 eddie.chen
  46. * [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter
  47. * Add sw debug counter for QM.
  48. *
  49. * 02 17 2011 eddie.chen
  50. * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel
  51. * 1) Change GetFrameAction decision when BSS is absent.
  52. * 2) Check channel and resource in processing ProbeRequest
  53. *
  54. * 01 12 2011 eddie.chen
  55. * [WCXRP00000322] Add WMM IE in beacon,
  56. Add per station flow control when STA is in PS
  57. * 1) Check Bss if support QoS before adding WMMIE
  58. * 2) Check if support prAdapter->rWifiVar QoS and uapsd in flow control
  59. *
  60. * 12 29 2010 eddie.chen
  61. * [WCXRP00000322] Add WMM IE in beacon,
  62. Add per station flow control when STA is in PS
  63. * 1) PS flow control event
  64. *
  65. * 2) WMM IE in beacon, assoc resp, probe resp
  66. *
  67. * 12 23 2010 george.huang
  68. * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function
  69. * 1. update WMM IE parsing, with ASSOC REQ handling
  70. * 2. extend U-APSD parameter passing from driver to FW
  71. *
  72. * 10 04 2010 cp.wu
  73. * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T
  74. * and replaced by ENUM_NETWORK_TYPE_INDEX_T only remove ENUM_NETWORK_TYPE_T definitions
  75. *
  76. * 09 21 2010 kevin.huang
  77. * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
  78. * Eliminate Linux Compile Warning
  79. *
  80. * 08 04 2010 yarco.yang
  81. * NULL
  82. * Add TX_AMPDU and ADDBA_REJECT command
  83. *
  84. * 07 22 2010 george.huang
  85. *
  86. * Update fgIsQoS information in BSS INFO by CMD
  87. *
  88. * 07 16 2010 yarco.yang
  89. *
  90. * 1. Support BSS Absence/Presence Event
  91. * 2. Support STA change PS mode Event
  92. * 3. Support BMC forwarding for AP mode.
  93. *
  94. * 07 14 2010 yarco.yang
  95. *
  96. * 1. Remove CFG_MQM_MIGRATION
  97. * 2. Add CMD_UPDATE_WMM_PARMS command
  98. *
  99. * 07 13 2010 yarco.yang
  100. *
  101. * [WPD00003849]
  102. * [MT6620 and MT5931] SW Migration, add qmGetFrameAction() API for CMD Queue Processing
  103. *
  104. * 07 09 2010 yarco.yang
  105. *
  106. * [MT6620 and MT5931] SW Migration: Add ADDBA support
  107. *
  108. * 07 08 2010 cp.wu
  109. *
  110. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  111. *
  112. * 06 29 2010 yarco.yang
  113. * [WPD00003837][MT6620]Data Path Refine
  114. * replace g_rQM with Adpater->rQM
  115. *
  116. * 06 25 2010 cp.wu
  117. * [WPD00003833][MT6620 and MT5931] Driver migration
  118. * add API in que_mgt to retrieve sta-rec index for security frames.
  119. *
  120. * 06 23 2010 yarco.yang
  121. * [WPD00003837][MT6620]Data Path Refine
  122. * Merge g_arStaRec[] into adapter->arStaRec[]
  123. *
  124. * 06 21 2010 yarco.yang
  125. * [WPD00003837][MT6620]Data Path Refine
  126. * Support CFG_MQM_MIGRATION flag
  127. *
  128. * 06 18 2010 cm.chang
  129. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  130. * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
  131. *
  132. * 06 08 2010 cp.wu
  133. * [WPD00003833][MT6620 and MT5931] Driver migration
  134. * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration
  135. *
  136. * 06 06 2010 kevin.huang
  137. * [WPD00003832][MT6620 5931] Create driver base
  138. * [MT6620 5931] Create driver base
  139. *
  140. * 03 30 2010 tehuang.liu
  141. * [WPD00001943]Create WiFi test driver framework on WinXP
  142. * Enabled adaptive TC resource control
  143. *
  144. * 03 24 2010 jeffrey.chang
  145. * [WPD00003826]Initial import for Linux port
  146. * initial import for Linux port
  147. *
  148. * 03 19 2010 tehuang.liu
  149. * [WPD00001943]Create WiFi test driver framework on WinXP
  150. * By default enabling dynamic STA_REC activation and decactivation
  151. *
  152. * 03 17 2010 tehuang.liu
  153. * [WPD00001943]Create WiFi test driver framework on WinXP
  154. * Changed STA_REC index determination rules (DA=BMCAST always --> STA_REC_INDEX_BMCAST)
  155. *
  156. * 03 11 2010 tehuang.liu
  157. * [WPD00001943]Create WiFi test driver framework on WinXP
  158. * Fixed buffer leak when processing BAR frames
  159. *
  160. * 02 25 2010 tehuang.liu
  161. * [WPD00001943]Create WiFi test driver framework on WinXP
  162. * Enabled multi-STA TX path with fairness
  163. *
  164. * 02 24 2010 tehuang.liu
  165. * [WPD00001943]Create WiFi test driver framework on WinXP
  166. * Enabled dynamically activating and deactivating STA_RECs
  167. *
  168. * 02 24 2010 tehuang.liu
  169. * [WPD00001943]Create WiFi test driver framework on WinXP
  170. * Added code for dynamic activating and deactivating STA_RECs.
  171. *
  172. * 01 13 2010 tehuang.liu
  173. * [WPD00001943]Create WiFi test driver framework on WinXP
  174. * Enabled the Burst_End Indication mechanism
  175. ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-12-09 14:04:53 GMT MTK02468
  176. ** Added RX buffer reordering function prototypes
  177. ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-12-02 22:08:44 GMT MTK02468
  178. ** Added macro QM_INIT_STA_REC for initialize a STA_REC
  179. ** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-11-23 21:58:43 GMT mtk02468
  180. ** Initial version
  181. **
  182. */
  183. #ifndef _QUE_MGT_H
  184. #define _QUE_MGT_H
  185. /*******************************************************************************
  186. * C O M P I L E R F L A G S
  187. ********************************************************************************
  188. */
  189. /*******************************************************************************
  190. * E X T E R N A L R E F E R E N C E S
  191. ********************************************************************************
  192. */
  193. /*******************************************************************************
  194. * C O N S T A N T S
  195. ********************************************************************************
  196. */
  197. /* Queue Manager Features */
  198. /* 1: Indicate the last TX packet to the FW for each burst */
  199. #define QM_BURST_END_INFO_ENABLED 1
  200. /* 1: To fairly share TX resource among active STAs */
  201. #define QM_FORWARDING_FAIRNESS 1
  202. /* 1: To adaptively adjust resource for each TC */
  203. #define QM_ADAPTIVE_TC_RESOURCE_CTRL 1
  204. /* 1: To print TC resource adjustment results */
  205. #define QM_PRINT_TC_RESOURCE_CTRL 0
  206. /* 1: If pkt with SSN is missing, auto advance the RX reordering window */
  207. #define QM_RX_WIN_SSN_AUTO_ADVANCING 1
  208. /* 1: Indicate the packets falling behind to OS before the frame with SSN is received */
  209. #define QM_RX_INIT_FALL_BEHIND_PASS 1
  210. /* 1: Count times of TC resource empty happened */
  211. #define QM_TC_RESOURCE_EMPTY_COUNTER 1
  212. /* Parameters */
  213. /*
  214. In TDLS or AP mode, peer maybe enter "sleep mode".
  215. If QM_INIT_TIME_TO_UPDATE_QUE_LEN = 60 when peer is in sleep mode,
  216. we need to wait 60 * u4TimeToAdjustTcResource = 180 packets
  217. u4TimeToAdjustTcResource = 3,
  218. then we will adjust TC resouce for VI or VO.
  219. But in TDLS test case, the throughput is very low, only 0.8Mbps in 5.7,
  220. we will to wait about 12 seconds to collect 180 packets.
  221. but the test time is only 20 seconds.
  222. */
  223. #define QM_INIT_TIME_TO_UPDATE_QUE_LEN 60 /* p: Update queue lengths when p TX packets are enqueued */
  224. #define QM_INIT_TIME_TO_UPDATE_QUE_LEN_MIN 5
  225. #define QM_INIT_TIME_TO_ADJUST_TC_RSC 3 /* s: Adjust the TC resource every s updates of queue lengths */
  226. #define QM_QUE_LEN_MOVING_AVE_FACTOR 3 /* Factor for Que Len averaging */
  227. #define QM_MIN_RESERVED_TC0_RESOURCE 1
  228. #define QM_MIN_RESERVED_TC1_RESOURCE 1
  229. #define QM_MIN_RESERVED_TC2_RESOURCE 1
  230. #define QM_MIN_RESERVED_TC3_RESOURCE 1
  231. #define QM_MIN_RESERVED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
  232. #define QM_MIN_RESERVED_TC5_RESOURCE 1
  233. #if defined(MT6620)
  234. #define QM_GUARANTEED_TC0_RESOURCE 4
  235. #define QM_GUARANTEED_TC1_RESOURCE 4
  236. #define QM_GUARANTEED_TC2_RESOURCE 9
  237. #define QM_GUARANTEED_TC3_RESOURCE 11
  238. #define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
  239. #define QM_GUARANTEED_TC5_RESOURCE 4
  240. #elif defined(MT6628)
  241. #define QM_GUARANTEED_TC0_RESOURCE 4
  242. #define QM_GUARANTEED_TC1_RESOURCE 4
  243. #define QM_GUARANTEED_TC2_RESOURCE 6
  244. #define QM_GUARANTEED_TC3_RESOURCE 6
  245. #define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
  246. #define QM_GUARANTEED_TC5_RESOURCE 4
  247. #else
  248. #error
  249. #endif
  250. #define QM_EXTRA_RESERVED_RESOURCE_WHEN_BUSY 0
  251. #define QM_TOTAL_TC_RESOURCE (\
  252. NIC_TX_BUFF_COUNT_TC0 + NIC_TX_BUFF_COUNT_TC1 +\
  253. NIC_TX_BUFF_COUNT_TC2 + NIC_TX_BUFF_COUNT_TC3 +\
  254. NIC_TX_BUFF_COUNT_TC5)
  255. #define QM_AVERAGE_TC_RESOURCE 6
  256. /* Note: QM_INITIAL_RESIDUAL_TC_RESOURCE shall not be less than 0 */
  257. /* for 6628: QM_TOTAL_TC_RESOURCE = 28, RESIDUAL = 4 4 6 6 2 4 = 26 */
  258. #define QM_INITIAL_RESIDUAL_TC_RESOURCE (QM_TOTAL_TC_RESOURCE - \
  259. (QM_GUARANTEED_TC0_RESOURCE +\
  260. QM_GUARANTEED_TC1_RESOURCE +\
  261. QM_GUARANTEED_TC2_RESOURCE +\
  262. QM_GUARANTEED_TC3_RESOURCE +\
  263. QM_GUARANTEED_TC5_RESOURCE \
  264. ))
  265. /* Hard-coded network type for Phase 3: NETWORK_TYPE_AIS/P2P/BOW */
  266. #define QM_OPERATING_NETWORK_TYPE NETWORK_TYPE_AIS
  267. #define QM_TEST_MODE 0
  268. #define QM_TEST_TRIGGER_TX_COUNT 50
  269. #define QM_TEST_STA_REC_DETERMINATION 0
  270. #define QM_TEST_STA_REC_DEACTIVATION 0
  271. #define QM_TEST_FAIR_FORWARDING 0
  272. #define QM_DEBUG_COUNTER 0
  273. /* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */
  274. /* Per-Type Queues: [0] BMCAST */
  275. #define NUM_OF_PER_STA_TX_QUEUES 5
  276. #define NUM_OF_PER_TYPE_TX_QUEUES 1
  277. /* These two constants are also used for FW to verify the STA_REC index */
  278. #define STA_REC_INDEX_BMCAST 0xFF
  279. #define STA_REC_INDEX_NOT_FOUND 0xFE
  280. /* TX Queue Index */
  281. #define TX_QUEUE_INDEX_BMCAST 0
  282. #define TX_QUEUE_INDEX_NO_STA_REC 0
  283. #define TX_QUEUE_INDEX_AC0 0
  284. #define TX_QUEUE_INDEX_AC1 1
  285. #define TX_QUEUE_INDEX_AC2 2
  286. #define TX_QUEUE_INDEX_AC3 3
  287. #define TX_QUEUE_INDEX_802_1X 4
  288. #define TX_QUEUE_INDEX_NON_QOS 1
  289. /* 1 WMM-related */
  290. /* WMM FLAGS */
  291. #define WMM_FLAG_SUPPORT_WMM BIT(0)
  292. #define WMM_FLAG_SUPPORT_WMMSA BIT(1)
  293. #define WMM_FLAG_AC_PARAM_PRESENT BIT(2)
  294. #define WMM_FLAG_SUPPORT_UAPSD BIT(3)
  295. /* WMM Admission Control Mandatory FLAGS */
  296. #define ACM_FLAG_ADM_NOT_REQUIRED 0
  297. #define ACM_FLAG_ADM_GRANTED BIT(0)
  298. #define ACM_FLAG_ADM_REQUIRED BIT(1)
  299. /* WMM Power Saving FLAGS */
  300. #define AC_FLAG_TRIGGER_ENABLED BIT(1)
  301. #define AC_FLAG_DELIVERY_ENABLED BIT(2)
  302. /* WMM-2.2.1 WMM Information Element */
  303. #define ELEM_MAX_LEN_WMM_INFO 7
  304. /* WMM-2.2.2 WMM Parameter Element */
  305. #define ELEM_MAX_LEN_WMM_PARAM 24
  306. /* WMM-2.2.1 WMM QoS Info field */
  307. #define WMM_QOS_INFO_PARAM_SET_CNT BITS(0, 3) /* Sent by AP */
  308. #define WMM_QOS_INFO_UAPSD BIT(7)
  309. #define WMM_QOS_INFO_VO_UAPSD BIT(0) /* Sent by non-AP STA */
  310. #define WMM_QOS_INFO_VI_UAPSD BIT(1)
  311. #define WMM_QOS_INFO_BK_UAPSD BIT(2)
  312. #define WMM_QOS_INFO_BE_UAPSD BIT(3)
  313. #define WMM_QOS_INFO_MAX_SP_LEN_MASK BITS(5, 6)
  314. #define WMM_QOS_INFO_MAX_SP_ALL 0
  315. #define WMM_QOS_INFO_MAX_SP_2 BIT(5)
  316. #define WMM_QOS_INFO_MAX_SP_4 BIT(6)
  317. #define WMM_QOS_INFO_MAX_SP_6 BITS(5, 6)
  318. /* -- definitions for Max SP length field */
  319. #define WMM_MAX_SP_LENGTH_ALL 0
  320. #define WMM_MAX_SP_LENGTH_2 2
  321. #define WMM_MAX_SP_LENGTH_4 4
  322. #define WMM_MAX_SP_LENGTH_6 6
  323. /* WMM-2.2.2 WMM ACI/AIFSN field */
  324. /* -- subfields in the ACI/AIFSN field */
  325. #define WMM_ACIAIFSN_AIFSN BITS(0, 3)
  326. #define WMM_ACIAIFSN_ACM BIT(4)
  327. #define WMM_ACIAIFSN_ACI BITS(5, 6)
  328. #define WMM_ACIAIFSN_ACI_OFFSET 5
  329. /* -- definitions for ACI field */
  330. #define WMM_ACI_AC_BE 0
  331. #define WMM_ACI_AC_BK BIT(5)
  332. #define WMM_ACI_AC_VI BIT(6)
  333. #define WMM_ACI_AC_VO BITS(5, 6)
  334. #define WMM_ACI(_AC) (_AC << WMM_ACIAIFSN_ACI_OFFSET)
  335. /* -- definitions for ECWmin/ECWmax field */
  336. #define WMM_ECW_WMIN_MASK BITS(0, 3)
  337. #define WMM_ECW_WMAX_MASK BITS(4, 7)
  338. #define WMM_ECW_WMAX_OFFSET 4
  339. #define TXM_DEFAULT_FLUSH_QUEUE_GUARD_TIME 0 /* Unit: 64 us */
  340. #define QM_RX_BA_ENTRY_MISS_TIMEOUT_MS (1000)
  341. /*******************************************************************************
  342. * D A T A T Y P E S
  343. ********************************************************************************
  344. */
  345. enum {
  346. QM_DBG_CNT_00 = 0,
  347. QM_DBG_CNT_01,
  348. QM_DBG_CNT_02,
  349. QM_DBG_CNT_03,
  350. QM_DBG_CNT_04,
  351. QM_DBG_CNT_05,
  352. QM_DBG_CNT_06,
  353. QM_DBG_CNT_07,
  354. QM_DBG_CNT_08,
  355. QM_DBG_CNT_09,
  356. QM_DBG_CNT_10,
  357. QM_DBG_CNT_11,
  358. QM_DBG_CNT_12,
  359. QM_DBG_CNT_13,
  360. QM_DBG_CNT_14,
  361. QM_DBG_CNT_15,
  362. QM_DBG_CNT_16,
  363. QM_DBG_CNT_17,
  364. QM_DBG_CNT_18,
  365. QM_DBG_CNT_19,
  366. QM_DBG_CNT_20,
  367. QM_DBG_CNT_21,
  368. QM_DBG_CNT_22,
  369. QM_DBG_CNT_23,
  370. QM_DBG_CNT_24,
  371. QM_DBG_CNT_25,
  372. QM_DBG_CNT_26,
  373. QM_DBG_CNT_27,
  374. QM_DBG_CNT_28,
  375. QM_DBG_CNT_29,
  376. QM_DBG_CNT_30,
  377. QM_DBG_CNT_31,
  378. QM_DBG_CNT_NUM
  379. };
  380. /* Used for MAC TX */
  381. typedef enum _ENUM_MAC_TX_QUEUE_INDEX_T {
  382. MAC_TX_QUEUE_AC0_INDEX = 0,
  383. MAC_TX_QUEUE_AC1_INDEX,
  384. MAC_TX_QUEUE_AC2_INDEX,
  385. MAC_TX_QUEUE_AC3_INDEX,
  386. MAC_TX_QUEUE_AC4_INDEX,
  387. MAC_TX_QUEUE_AC5_INDEX,
  388. MAC_TX_QUEUE_AC6_INDEX,
  389. MAC_TX_QUEUE_BCN_INDEX,
  390. MAC_TX_QUEUE_BMC_INDEX,
  391. MAC_TX_QUEUE_NUM
  392. } ENUM_MAC_TX_QUEUE_INDEX_T;
  393. typedef struct _RX_BA_ENTRY_T {
  394. BOOLEAN fgIsValid;
  395. QUE_T rReOrderQue;
  396. UINT_16 u2WinStart;
  397. UINT_16 u2WinEnd;
  398. UINT_16 u2WinSize;
  399. /* For identifying the RX BA agreement */
  400. UINT_8 ucStaRecIdx;
  401. UINT_8 ucTid;
  402. BOOLEAN fgIsWaitingForPktWithSsn;
  403. /* UINT_8 ucTxBufferSize; */
  404. /* BOOL fgIsAcConstrain; */
  405. /* BOOL fgIsBaEnabled; */
  406. } RX_BA_ENTRY_T, *P_RX_BA_ENTRY_T;
  407. /* The mailbox message (could be used for Host-To-Device or Device-To-Host Mailbox) */
  408. typedef struct _MAILBOX_MSG_T {
  409. UINT_32 u4Msg[2]; /* [0]: D2HRM0R or H2DRM0R, [1]: D2HRM1R or H2DRM1R */
  410. } MAILBOX_MSG_T, *P_MAILBOX_MSG_T;
  411. /* Used for adaptively adjusting TC resources */
  412. typedef struct _TC_RESOURCE_CTRL_T {
  413. /* TC0, TC1, TC2, TC3, TC5 */
  414. UINT_32 au4AverageQueLen[TC_NUM - 1];
  415. } TC_RESOURCE_CTRL_T, *P_TC_RESOURCE_CTRL_T;
  416. typedef struct _QUE_MGT_T { /* Queue Management Control Info */
  417. /* Per-Type Queues: [0] BMCAST or UNKNOWN-STA packets */
  418. QUE_T arTxQueue[NUM_OF_PER_TYPE_TX_QUEUES];
  419. #if 0
  420. /* For TX Scheduling */
  421. UINT_8 arRemainingTxOppt[NUM_OF_PER_STA_TX_QUEUES];
  422. UINT_8 arCurrentTxStaIndex[NUM_OF_PER_STA_TX_QUEUES];
  423. #endif
  424. /* Reordering Queue Parameters */
  425. RX_BA_ENTRY_T arRxBaTable[CFG_NUM_OF_RX_BA_AGREEMENTS];
  426. /* Current number of activated RX BA agreements <= CFG_NUM_OF_RX_BA_AGREEMENTS */
  427. UINT_8 ucRxBaCount;
  428. #if QM_TEST_MODE
  429. UINT_32 u4PktCount;
  430. P_ADAPTER_T prAdapter;
  431. #if QM_TEST_FAIR_FORWARDING
  432. UINT_32 u4CurrentStaRecIndexToEnqueue;
  433. #endif
  434. #endif
  435. #if QM_FORWARDING_FAIRNESS
  436. /* The current TX count for a STA with respect to a TC index */
  437. UINT_32 au4ForwardCount[NUM_OF_PER_STA_TX_QUEUES];
  438. /* The current serving STA with respect to a TC index */
  439. UINT_32 au4HeadStaRecIndex[NUM_OF_PER_STA_TX_QUEUES];
  440. #endif
  441. #if QM_ADAPTIVE_TC_RESOURCE_CTRL
  442. UINT_32 au4AverageQueLen[TC_NUM];
  443. UINT_32 au4CurrentTcResource[TC_NUM];
  444. UINT_32 au4MinReservedTcResource[TC_NUM]; /* The minimum amount of resource no matter busy or idle */
  445. UINT_32 au4GuaranteedTcResource[TC_NUM]; /* The minimum amount of resource when extremely busy */
  446. UINT_32 u4TimeToAdjustTcResource;
  447. UINT_32 u4TimeToUpdateQueLen;
  448. UINT_32 u4TxNumOfVi, u4TxNumOfVo; /* number of VI/VO packets */
  449. /* Set to TRUE if the last TC adjustment has not been completely applied (i.e., waiting more TX-Done events
  450. to align the TC quotas to the TC resource assignment) */
  451. BOOLEAN fgTcResourcePostAnnealing;
  452. #endif
  453. #if QM_DEBUG_COUNTER
  454. UINT_32 au4QmDebugCounters[QM_DBG_CNT_NUM];
  455. #endif
  456. #if QM_TC_RESOURCE_EMPTY_COUNTER
  457. UINT_32 au4QmTcResourceEmptyCounter[NET_TYPE_NUM][TC_NUM];
  458. #endif
  459. } QUE_MGT_T, *P_QUE_MGT_T;
  460. typedef struct _EVENT_RX_ADDBA_T {
  461. /* Event header */
  462. UINT_16 u2Length;
  463. UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
  464. UINT_8 ucEID;
  465. UINT_8 ucSeqNum;
  466. UINT_8 aucReserved2[2];
  467. /* Fields not present in the received ADDBA_REQ */
  468. UINT_8 ucStaRecIdx;
  469. /* Fields that are present in the received ADDBA_REQ */
  470. UINT_8 ucDialogToken; /* Dialog Token chosen by the sender */
  471. UINT_16 u2BAParameterSet; /* BA policy, TID, buffer size */
  472. UINT_16 u2BATimeoutValue;
  473. UINT_16 u2BAStartSeqCtrl; /* SSN */
  474. } EVENT_RX_ADDBA_T, *P_EVENT_RX_ADDBA_T;
  475. typedef struct _EVENT_RX_DELBA_T {
  476. /* Event header */
  477. UINT_16 u2Length;
  478. UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
  479. UINT_8 ucEID;
  480. UINT_8 ucSeqNum;
  481. UINT_8 aucReserved2[2];
  482. /* Fields not present in the received ADDBA_REQ */
  483. UINT_8 ucStaRecIdx;
  484. UINT_8 ucTid;
  485. } EVENT_RX_DELBA_T, *P_EVENT_RX_DELBA_T;
  486. typedef struct _EVENT_BSS_ABSENCE_PRESENCE_T {
  487. /* Event header */
  488. UINT_16 u2Length;
  489. UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
  490. UINT_8 ucEID;
  491. UINT_8 ucSeqNum;
  492. UINT_8 aucReserved2[2];
  493. /* Event Body */
  494. UINT_8 ucNetTypeIdx;
  495. BOOLEAN fgIsAbsent;
  496. UINT_8 ucBssFreeQuota;
  497. UINT_8 aucReserved[1];
  498. } EVENT_BSS_ABSENCE_PRESENCE_T, *P_EVENT_BSS_ABSENCE_PRESENCE_T;
  499. typedef struct _EVENT_STA_CHANGE_PS_MODE_T {
  500. /* Event header */
  501. UINT_16 u2Length;
  502. UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
  503. UINT_8 ucEID;
  504. UINT_8 ucSeqNum;
  505. UINT_8 aucReserved2[2];
  506. /* Event Body */
  507. UINT_8 ucStaRecIdx;
  508. BOOLEAN fgIsInPs;
  509. UINT_8 ucUpdateMode;
  510. UINT_8 ucFreeQuota;
  511. } EVENT_STA_CHANGE_PS_MODE_T, *P_EVENT_STA_CHANGE_PS_MODE_T;
  512. /* The free quota is used by PS only now */
  513. /* The event may be used by per STA flow conttrol in general */
  514. typedef struct _EVENT_STA_UPDATE_FREE_QUOTA_T {
  515. /* Event header */
  516. UINT_16 u2Length;
  517. UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
  518. UINT_8 ucEID;
  519. UINT_8 ucSeqNum;
  520. UINT_8 aucReserved2[2];
  521. /* Event Body */
  522. UINT_8 ucStaRecIdx;
  523. UINT_8 ucUpdateMode;
  524. UINT_8 ucFreeQuota;
  525. UINT_8 aucReserved[1];
  526. } EVENT_STA_UPDATE_FREE_QUOTA_T, *P_EVENT_STA_UPDATE_FREE_QUOTA_T;
  527. /* WMM-2.2.1 WMM Information Element */
  528. typedef struct _IE_WMM_INFO_T {
  529. UINT_8 ucId; /* Element ID */
  530. UINT_8 ucLength; /* Length */
  531. UINT_8 aucOui[3]; /* OUI */
  532. UINT_8 ucOuiType; /* OUI Type */
  533. UINT_8 ucOuiSubtype; /* OUI Subtype */
  534. UINT_8 ucVersion; /* Version */
  535. UINT_8 ucQosInfo; /* QoS Info field */
  536. UINT_8 ucDummy[3]; /* Dummy for pack */
  537. } IE_WMM_INFO_T, *P_IE_WMM_INFO_T;
  538. /* WMM-2.2.2 WMM Parameter Element */
  539. typedef struct _IE_WMM_PARAM_T {
  540. UINT_8 ucId; /* Element ID */
  541. UINT_8 ucLength; /* Length */
  542. /* IE Body */
  543. UINT_8 aucOui[3]; /* OUI */
  544. UINT_8 ucOuiType; /* OUI Type */
  545. UINT_8 ucOuiSubtype; /* OUI Subtype */
  546. UINT_8 ucVersion; /* Version */
  547. /* WMM IE Body */
  548. UINT_8 ucQosInfo; /* QoS Info field */
  549. UINT_8 ucReserved;
  550. /* AC Parameters */
  551. UINT_8 ucAciAifsn_BE;
  552. UINT_8 ucEcw_BE;
  553. UINT_8 aucTxopLimit_BE[2];
  554. UINT_8 ucAciAifsn_BG;
  555. UINT_8 ucEcw_BG;
  556. UINT_8 aucTxopLimit_BG[2];
  557. UINT_8 ucAciAifsn_VI;
  558. UINT_8 ucEcw_VI;
  559. UINT_8 aucTxopLimit_VI[2];
  560. UINT_8 ucAciAifsn_VO;
  561. UINT_8 ucEcw_VO;
  562. UINT_8 aucTxopLimit_VO[2];
  563. } IE_WMM_PARAM_T, *P_IE_WMM_PARAM_T;
  564. typedef struct _IE_WMM_TSPEC_T {
  565. UINT_8 ucId; /* Element ID */
  566. UINT_8 ucLength; /* Length */
  567. UINT_8 aucOui[3]; /* OUI */
  568. UINT_8 ucOuiType; /* OUI Type */
  569. UINT_8 ucOuiSubtype; /* OUI Subtype */
  570. UINT_8 ucVersion; /* Version */
  571. /* WMM TSPEC body */
  572. UINT_8 aucTsInfo[3]; /* TS Info */
  573. UINT_8 aucTspecBodyPart[1]; /* Note: Utilize PARAM_QOS_TSPEC to fill (memory copy) */
  574. } IE_WMM_TSPEC_T, *P_IE_WMM_TSPEC_T;
  575. typedef struct _IE_WMM_HDR_T {
  576. UINT_8 ucId; /* Element ID */
  577. UINT_8 ucLength; /* Length */
  578. UINT_8 aucOui[3]; /* OUI */
  579. UINT_8 ucOuiType; /* OUI Type */
  580. UINT_8 ucOuiSubtype; /* OUI Subtype */
  581. UINT_8 ucVersion; /* Version */
  582. UINT_8 aucBody[1]; /* IE body */
  583. } IE_WMM_HDR_T, *P_IE_WMM_HDR_T;
  584. typedef struct _AC_QUE_PARMS_T {
  585. UINT_16 u2CWmin; /*!< CWmin */
  586. UINT_16 u2CWmax; /*!< CWmax */
  587. UINT_16 u2TxopLimit; /*!< TXOP limit */
  588. UINT_16 u2Aifsn; /*!< AIFSN */
  589. UINT_8 ucGuradTime; /*!< GuardTime for STOP/FLUSH. */
  590. BOOLEAN fgIsACMSet;
  591. } AC_QUE_PARMS_T, *P_AC_QUE_PARMS_T;
  592. /* WMM ACI (AC index) */
  593. typedef enum _ENUM_WMM_ACI_T {
  594. WMM_AC_BE_INDEX = 0,
  595. WMM_AC_BK_INDEX,
  596. WMM_AC_VI_INDEX,
  597. WMM_AC_VO_INDEX,
  598. WMM_AC_INDEX_NUM
  599. } ENUM_WMM_ACI_T, *P_ENUM_WMM_ACI_T;
  600. /* Used for CMD Queue Operation */
  601. typedef enum _ENUM_FRAME_ACTION_T {
  602. FRAME_ACTION_DROP_PKT = 0,
  603. FRAME_ACTION_QUEUE_PKT,
  604. FRAME_ACTION_TX_PKT,
  605. FRAME_ACTION_NUM
  606. } ENUM_FRAME_ACTION_T;
  607. typedef enum _ENUM_FRAME_TYPE_IN_CMD_Q_T {
  608. FRAME_TYPE_802_1X = 0,
  609. FRAME_TYPE_MMPDU,
  610. FRAME_TYPE_NUM
  611. } ENUM_FRAME_TYPE_IN_CMD_Q_T;
  612. typedef enum _ENUM_FREE_QUOTA_MODET_T {
  613. FREE_QUOTA_UPDATE_MODE_INIT = 0,
  614. FREE_QUOTA_UPDATE_MODE_OVERWRITE,
  615. FREE_QUOTA_UPDATE_MODE_INCREASE,
  616. FREE_QUOTA_UPDATE_MODE_DECREASE
  617. } ENUM_FREE_QUOTA_MODET_T, *P_ENUM_FREE_QUOTA_MODET_T;
  618. typedef struct _CMD_UPDATE_WMM_PARMS_T {
  619. AC_QUE_PARMS_T arACQueParms[AC_NUM];
  620. UINT_8 ucNetTypeIndex;
  621. UINT_8 fgIsQBSS;
  622. UINT_8 aucReserved[2];
  623. } CMD_UPDATE_WMM_PARMS_T, *P_CMD_UPDATE_WMM_PARMS_T;
  624. typedef struct _CMD_TX_AMPDU_T {
  625. BOOLEAN fgEnable;
  626. UINT_8 aucReserved[3];
  627. } CMD_TX_AMPDU_T, *P_CMD_TX_AMPDU_T;
  628. typedef struct _CMD_ADDBA_REJECT {
  629. BOOLEAN fgEnable;
  630. UINT_8 aucReserved[3];
  631. } CMD_ADDBA_REJECT_T, *P_CMD_ADDBA_REJECT_T;
  632. /*******************************************************************************
  633. * P U B L I C D A T A
  634. ********************************************************************************
  635. */
  636. /*******************************************************************************
  637. * P R I V A T E D A T A
  638. ********************************************************************************
  639. */
  640. /*******************************************************************************
  641. * M A C R O S
  642. ********************************************************************************
  643. */
  644. #define QM_TX_SET_NEXT_MSDU_INFO(_prMsduInfoPreceding, _prMsduInfoNext) \
  645. ((((_prMsduInfoPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prMsduInfoNext))
  646. #define QM_TX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \
  647. ((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext))
  648. #define QM_TX_GET_NEXT_MSDU_INFO(_prMsduInfo) \
  649. ((P_MSDU_INFO_T)(((_prMsduInfo)->rQueEntry).prNext))
  650. #define QM_RX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \
  651. ((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext))
  652. #define QM_RX_GET_NEXT_SW_RFB(_prSwRfb) \
  653. ((P_SW_RFB_T)(((_prSwRfb)->rQueEntry).prNext))
  654. #if 0
  655. #define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \
  656. ((((_ucIndex) != STA_REC_INDEX_BMCAST) && ((_ucIndex) != STA_REC_INDEX_NOT_FOUND)) ?\
  657. &(_prAdapter->arStaRec[_ucIndex]) : NULL)
  658. #endif
  659. #define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \
  660. cnmGetStaRecByIndex(_prAdapter, _ucIndex)
  661. #define QM_TX_SET_MSDU_INFO_FOR_DATA_PACKET(\
  662. _prMsduInfo,\
  663. _ucTC,\
  664. _ucPacketType,\
  665. _ucFormatID,\
  666. _fgIs802_1x,\
  667. _fgIs802_11,\
  668. _u2PalLLH,\
  669. _u2AclSN,\
  670. _ucPsForwardingType,\
  671. _ucPsSessionID\
  672. ) \
  673. {\
  674. ASSERT(_prMsduInfo);\
  675. (_prMsduInfo)->ucTC = (_ucTC);\
  676. (_prMsduInfo)->ucPacketType = (_ucPacketType);\
  677. (_prMsduInfo)->ucFormatID = (_ucFormatID);\
  678. (_prMsduInfo)->fgIs802_1x = (_fgIs802_1x);\
  679. (_prMsduInfo)->fgIs802_11 = (_fgIs802_11);\
  680. (_prMsduInfo)->u2PalLLH = (_u2PalLLH);\
  681. (_prMsduInfo)->u2AclSN = (_u2AclSN);\
  682. (_prMsduInfo)->ucPsForwardingType = (_ucPsForwardingType);\
  683. (_prMsduInfo)->ucPsSessionID = (_ucPsSessionID);\
  684. (_prMsduInfo)->fgIsBurstEnd = (FALSE);\
  685. }
  686. #define QM_INIT_STA_REC(\
  687. _prStaRec,\
  688. _fgIsValid,\
  689. _fgIsQoS,\
  690. _pucMacAddr\
  691. )\
  692. {\
  693. ASSERT(_prStaRec);\
  694. (_prStaRec)->fgIsValid = (_fgIsValid);\
  695. (_prStaRec)->fgIsQoS = (_fgIsQoS);\
  696. (_prStaRec)->fgIsInPS = FALSE; \
  697. (_prStaRec)->ucPsSessionID = 0xFF;\
  698. COPY_MAC_ADDR((_prStaRec)->aucMacAddr, (_pucMacAddr));\
  699. }
  700. #if QM_ADAPTIVE_TC_RESOURCE_CTRL
  701. #define QM_GET_TX_QUEUE_LEN(_prAdapter, _u4QueIdx) \
  702. ((_prAdapter->rQM.au4AverageQueLen[(_u4QueIdx)] >> QM_QUE_LEN_MOVING_AVE_FACTOR))
  703. #endif
  704. #define WMM_IE_OUI_TYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiType)
  705. #define WMM_IE_OUI_SUBTYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiSubtype)
  706. #define WMM_IE_OUI(fp) (((P_IE_WMM_HDR_T)(fp))->aucOui)
  707. #if QM_DEBUG_COUNTER
  708. #define QM_DBG_CNT_INC(_prQM, _index) { (_prQM)->au4QmDebugCounters[(_index)]++; }
  709. #else
  710. #define QM_DBG_CNT_INC(_prQM, _index) {}
  711. #endif
  712. /*******************************************************************************
  713. * F U N C T I O N D E C L A R A T I O N S
  714. ********************************************************************************
  715. */
  716. /*----------------------------------------------------------------------------*/
  717. /* Queue Management and STA_REC Initialization */
  718. /*----------------------------------------------------------------------------*/
  719. VOID qmInit(IN P_ADAPTER_T prAdapter);
  720. #if QM_TEST_MODE
  721. VOID qmTestCases(IN P_ADAPTER_T prAdapter);
  722. #endif
  723. VOID qmActivateStaRec(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
  724. VOID qmDeactivateStaRec(IN P_ADAPTER_T prAdapter, IN UINT_32 u4StaRecIdx);
  725. /*----------------------------------------------------------------------------*/
  726. /* TX-Related Queue Management */
  727. /*----------------------------------------------------------------------------*/
  728. P_MSDU_INFO_T qmFlushTxQueues(IN P_ADAPTER_T prAdapter);
  729. P_MSDU_INFO_T qmFlushStaTxQueues(IN P_ADAPTER_T prAdapter, IN UINT_32 u4StaRecIdx);
  730. P_MSDU_INFO_T qmEnqueueTxPackets(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
  731. P_MSDU_INFO_T qmDequeueTxPackets(IN P_ADAPTER_T prAdapter, IN P_TX_TCQ_STATUS_T prTcqStatus);
  732. VOID qmAdjustTcQuotas(IN P_ADAPTER_T prAdapter, OUT P_TX_TCQ_ADJUST_T prTcqAdjust, IN P_TX_TCQ_STATUS_T prTcqStatus);
  733. #if QM_ADAPTIVE_TC_RESOURCE_CTRL
  734. VOID qmReassignTcResource(IN P_ADAPTER_T prAdapter);
  735. VOID qmUpdateAverageTxQueLen(IN P_ADAPTER_T prAdapter);
  736. #endif
  737. /*----------------------------------------------------------------------------*/
  738. /* RX-Related Queue Management */
  739. /*----------------------------------------------------------------------------*/
  740. VOID qmInitRxQueues(IN P_ADAPTER_T prAdapter);
  741. P_SW_RFB_T qmFlushRxQueues(IN P_ADAPTER_T prAdapter);
  742. P_SW_RFB_T qmHandleRxPackets(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfbListHead);
  743. VOID qmProcessPktWithReordering(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT P_QUE_T prReturnedQue);
  744. VOID qmProcessBarFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT P_QUE_T prReturnedQue);
  745. VOID
  746. qmInsertFallWithinReorderPkt(IN P_SW_RFB_T prSwRfb, IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
  747. VOID qmInsertFallAheadReorderPkt(IN P_SW_RFB_T prSwRfb, IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
  748. BOOLEAN
  749. qmPopOutDueToFallWithin(IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue, OUT BOOLEAN *fgIsTimeout);
  750. VOID qmPopOutDueToFallAhead(IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
  751. VOID qmHandleMailboxRxMessage(IN MAILBOX_MSG_T prMailboxRxMsg);
  752. BOOLEAN qmCompareSnIsLessThan(IN UINT_32 u4SnLess, IN UINT_32 u4SnGreater);
  753. VOID qmHandleEventRxAddBa(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
  754. VOID qmHandleEventRxDelBa(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
  755. P_RX_BA_ENTRY_T qmLookupRxBaEntry(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid);
  756. BOOLEAN
  757. qmAddRxBaEntry(IN P_ADAPTER_T prAdapter,
  758. IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid, IN UINT_16 u2WinStart, IN UINT_16 u2WinSize);
  759. VOID qmDelRxBaEntry(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid, IN BOOLEAN fgFlushToHost);
  760. VOID mqmProcessAssocRsp(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength);
  761. VOID
  762. mqmParseEdcaParameters(IN P_ADAPTER_T prAdapter,
  763. IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength, IN BOOLEAN fgForceOverride);
  764. VOID mqmFillAcQueParam(IN P_IE_WMM_PARAM_T prIeWmmParam, IN UINT_32 u4AcOffset, OUT P_AC_QUE_PARMS_T prAcQueParams);
  765. VOID mqmProcessScanResult(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prScanResult, OUT P_STA_RECORD_T prStaRec);
  766. /* Utility function: for deciding STA-REC index */
  767. UINT_8 qmGetStaRecIdx(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucEthDestAddr, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType);
  768. UINT_32
  769. mqmGenerateWmmInfoIEByParam(BOOLEAN fgSupportUAPSD,
  770. UINT_8 ucBmpDeliveryAC, UINT_8 ucBmpTriggerAC, UINT_8 ucUapsdSp, UINT_8 *pOutBuf);
  771. VOID mqmGenerateWmmInfoIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
  772. UINT_32 mqmGenerateWmmParamIEByParam(P_ADAPTER_T prAdapter,
  773. P_BSS_INFO_T prBssInfo, UINT_8 *pOutBuf, ENUM_OP_MODE_T ucOpMode);
  774. VOID mqmGenerateWmmParamIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
  775. ENUM_FRAME_ACTION_T
  776. qmGetFrameAction(IN P_ADAPTER_T prAdapter,
  777. IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType,
  778. IN UINT_8 ucStaRecIdx, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_FRAME_TYPE_IN_CMD_Q_T eFrameType);
  779. VOID qmHandleEventBssAbsencePresence(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
  780. VOID qmHandleEventStaChangePsMode(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
  781. VOID mqmProcessAssocReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength);
  782. VOID qmHandleEventStaUpdateFreeQuota(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
  783. VOID
  784. qmUpdateFreeQuota(IN P_ADAPTER_T prAdapter,
  785. IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUpdateMode, IN UINT_8 ucFreeQuota, IN UINT_8 ucNumOfTxDone);
  786. VOID qmFreeAllByNetType(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
  787. UINT_32 qmGetRxReorderQueuedBufferCount(IN P_ADAPTER_T prAdapter);
  788. #if ARP_MONITER_ENABLE
  789. VOID qmDetectArpNoResponse(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
  790. VOID qmResetArpDetect(VOID);
  791. VOID qmHandleRxArpPackets(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
  792. #endif
  793. /*******************************************************************************
  794. * F U N C T I O N S
  795. ********************************************************************************
  796. */
  797. #endif /* _QUE_MGT_H */