halmac_tx_desc_nic.h 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. ******************************************************************************/
  15. #ifndef _HALMAC_TX_DESC_NIC_H_
  16. #define _HALMAC_TX_DESC_NIC_H_
  17. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  18. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  19. HALMAC_8812F_SUPPORT)
  20. /*TXDESC_WORD0*/
  21. #define SET_TX_DESC_DISQSELSEQ(txdesc, value) \
  22. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 31, 1, value)
  23. #define GET_TX_DESC_DISQSELSEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 31, 1)
  24. #endif
  25. #if (HALMAC_8814B_SUPPORT)
  26. #define SET_TX_DESC_IE_END_BODY(txdesc, value) \
  27. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 31, 1, value)
  28. #define GET_TX_DESC_IE_END_BODY(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 31, 1)
  29. #endif
  30. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  31. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  32. HALMAC_8812F_SUPPORT)
  33. #define SET_TX_DESC_GF(txdesc, value) \
  34. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 30, 1, value)
  35. #define GET_TX_DESC_GF(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 30, 1)
  36. #endif
  37. #if (HALMAC_8814B_SUPPORT)
  38. #define SET_TX_DESC_AGG_EN_V1(txdesc, value) \
  39. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 30, 1, value)
  40. #define GET_TX_DESC_AGG_EN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 30, 1)
  41. #endif
  42. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  43. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  44. HALMAC_8812F_SUPPORT)
  45. #define SET_TX_DESC_NO_ACM(txdesc, value) \
  46. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 29, 1, value)
  47. #define GET_TX_DESC_NO_ACM(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 29, 1)
  48. #endif
  49. #if (HALMAC_8814B_SUPPORT)
  50. #define SET_TX_DESC_BK_V1(txdesc, value) \
  51. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 29, 1, value)
  52. #define GET_TX_DESC_BK_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 29, 1)
  53. #endif
  54. #if (HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || HALMAC_8821C_SUPPORT || \
  55. HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  56. #define SET_TX_DESC_BCNPKT_TSF_CTRL(txdesc, value) \
  57. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 28, 1, value)
  58. #define GET_TX_DESC_BCNPKT_TSF_CTRL(txdesc) \
  59. LE_BITS_TO_4BYTE(txdesc + 0x00, 28, 1)
  60. #endif
  61. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  62. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  63. HALMAC_8812F_SUPPORT)
  64. #define SET_TX_DESC_AMSDU_PAD_EN(txdesc, value) \
  65. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 27, 1, value)
  66. #define GET_TX_DESC_AMSDU_PAD_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 27, 1)
  67. #define SET_TX_DESC_LS(txdesc, value) \
  68. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 26, 1, value)
  69. #define GET_TX_DESC_LS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 26, 1)
  70. #define SET_TX_DESC_HTC(txdesc, value) \
  71. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 25, 1, value)
  72. #define GET_TX_DESC_HTC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 25, 1)
  73. #define SET_TX_DESC_BMC(txdesc, value) \
  74. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 24, 1, value)
  75. #define GET_TX_DESC_BMC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 24, 1)
  76. #endif
  77. #if (HALMAC_8814B_SUPPORT)
  78. #define SET_TX_DESC_PKT_OFFSET_V1(txdesc, value) \
  79. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 24, 5, value)
  80. #define GET_TX_DESC_PKT_OFFSET_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 24, 5)
  81. #endif
  82. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  83. HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
  84. HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  85. #define SET_TX_DESC_OFFSET(txdesc, value) \
  86. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 16, 8, value)
  87. #define GET_TX_DESC_OFFSET(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 16, 8)
  88. #define SET_TX_DESC_TXPKTSIZE(txdesc, value) \
  89. SET_BITS_TO_LE_4BYTE(txdesc + 0x00, 0, 16, value)
  90. #define GET_TX_DESC_TXPKTSIZE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x00, 0, 16)
  91. #endif
  92. #if (HALMAC_8198F_SUPPORT)
  93. /*WORD1*/
  94. #define SET_TX_DESC_HW_AES_IV_V2(txdesc, value) \
  95. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 31, 1, value)
  96. #define GET_TX_DESC_HW_AES_IV_V2(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 31, 1)
  97. #endif
  98. #if (HALMAC_8814B_SUPPORT)
  99. #define SET_TX_DESC_AMSDU(txdesc, value) \
  100. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 30, 1, value)
  101. #define GET_TX_DESC_AMSDU(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 30, 1)
  102. #endif
  103. #if (HALMAC_8198F_SUPPORT)
  104. #define SET_TX_DESC_FTM_EN_V1(txdesc, value) \
  105. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 30, 1, value)
  106. #define GET_TX_DESC_FTM_EN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 30, 1)
  107. #endif
  108. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  109. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  110. HALMAC_8812F_SUPPORT)
  111. #define SET_TX_DESC_MOREDATA(txdesc, value) \
  112. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 29, 1, value)
  113. #define GET_TX_DESC_MOREDATA(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 29, 1)
  114. #endif
  115. #if (HALMAC_8814B_SUPPORT)
  116. #define SET_TX_DESC_HW_AES_IV_V1(txdesc, value) \
  117. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 29, 1, value)
  118. #define GET_TX_DESC_HW_AES_IV_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 29, 1)
  119. #define SET_TX_DESC_MHR_CP(txdesc, value) \
  120. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 25, 1, value)
  121. #define GET_TX_DESC_MHR_CP(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 25, 1)
  122. #endif
  123. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  124. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  125. HALMAC_8812F_SUPPORT)
  126. #define SET_TX_DESC_PKT_OFFSET(txdesc, value) \
  127. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 24, 5, value)
  128. #define GET_TX_DESC_PKT_OFFSET(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 24, 5)
  129. #endif
  130. #if (HALMAC_8814B_SUPPORT)
  131. #define SET_TX_DESC_SMH_EN_V1(txdesc, value) \
  132. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 24, 1, value)
  133. #define GET_TX_DESC_SMH_EN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 24, 1)
  134. #endif
  135. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  136. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  137. HALMAC_8812F_SUPPORT)
  138. #define SET_TX_DESC_SEC_TYPE(txdesc, value) \
  139. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 22, 2, value)
  140. #define GET_TX_DESC_SEC_TYPE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 22, 2)
  141. #define SET_TX_DESC_EN_DESC_ID(txdesc, value) \
  142. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 21, 1, value)
  143. #define GET_TX_DESC_EN_DESC_ID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 21, 1)
  144. #define SET_TX_DESC_RATE_ID(txdesc, value) \
  145. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 16, 5, value)
  146. #define GET_TX_DESC_RATE_ID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 16, 5)
  147. #endif
  148. #if (HALMAC_8814B_SUPPORT)
  149. #define SET_TX_DESC_SMH_CAM(txdesc, value) \
  150. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 16, 8, value)
  151. #define GET_TX_DESC_SMH_CAM(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 16, 8)
  152. #endif
  153. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  154. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  155. HALMAC_8812F_SUPPORT)
  156. #define SET_TX_DESC_PIFS(txdesc, value) \
  157. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 15, 1, value)
  158. #define GET_TX_DESC_PIFS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 15, 1)
  159. #define SET_TX_DESC_LSIG_TXOP_EN(txdesc, value) \
  160. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 14, 1, value)
  161. #define GET_TX_DESC_LSIG_TXOP_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 14, 1)
  162. #define SET_TX_DESC_RD_NAV_EXT(txdesc, value) \
  163. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 13, 1, value)
  164. #define GET_TX_DESC_RD_NAV_EXT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 13, 1)
  165. #endif
  166. #if (HALMAC_8814B_SUPPORT)
  167. #define SET_TX_DESC_EXT_EDCA(txdesc, value) \
  168. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 13, 1, value)
  169. #define GET_TX_DESC_EXT_EDCA(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 13, 1)
  170. #endif
  171. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  172. HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
  173. HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  174. #define SET_TX_DESC_QSEL(txdesc, value) \
  175. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 8, 5, value)
  176. #define GET_TX_DESC_QSEL(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 8, 5)
  177. #endif
  178. #if (HALMAC_8198F_SUPPORT)
  179. #define SET_TX_DESC_SPECIAL_CW(txdesc, value) \
  180. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 7, 1, value)
  181. #define GET_TX_DESC_SPECIAL_CW(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 7, 1)
  182. #endif
  183. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  184. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  185. HALMAC_8812F_SUPPORT)
  186. #define SET_TX_DESC_MACID(txdesc, value) \
  187. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 0, 7, value)
  188. #define GET_TX_DESC_MACID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 0, 7)
  189. #endif
  190. #if (HALMAC_8814B_SUPPORT)
  191. #define SET_TX_DESC_MACID_V1(txdesc, value) \
  192. SET_BITS_TO_LE_4BYTE(txdesc + 0x04, 0, 7, value)
  193. #define GET_TX_DESC_MACID_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x04, 0, 7)
  194. #endif
  195. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  196. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  197. /*TXDESC_WORD2*/
  198. #define SET_TX_DESC_HW_AES_IV(txdesc, value) \
  199. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 31, 1, value)
  200. #define GET_TX_DESC_HW_AES_IV(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 31, 1)
  201. #endif
  202. #if (HALMAC_8814B_SUPPORT)
  203. #define SET_TX_DESC_CHK_EN_V1(txdesc, value) \
  204. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 31, 1, value)
  205. #define GET_TX_DESC_CHK_EN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 31, 1)
  206. #endif
  207. #if (HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || HALMAC_8821C_SUPPORT || \
  208. HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  209. #define SET_TX_DESC_FTM_EN(txdesc, value) \
  210. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 30, 1, value)
  211. #define GET_TX_DESC_FTM_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 30, 1)
  212. #endif
  213. #if (HALMAC_8198F_SUPPORT)
  214. #define SET_TX_DESC_ANTCEL_D_V1(txdesc, value) \
  215. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 28, 4, value)
  216. #define GET_TX_DESC_ANTCEL_D_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 28, 4)
  217. #endif
  218. #if (HALMAC_8814B_SUPPORT)
  219. #define SET_TX_DESC_DMA_PRI(txdesc, value) \
  220. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 27, 1, value)
  221. #define GET_TX_DESC_DMA_PRI(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 27, 1)
  222. #endif
  223. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  224. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  225. #define SET_TX_DESC_G_ID(txdesc, value) \
  226. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 24, 6, value)
  227. #define GET_TX_DESC_G_ID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 24, 6)
  228. #endif
  229. #if (HALMAC_8814B_SUPPORT)
  230. #define SET_TX_DESC_MAX_AMSDU_MODE(txdesc, value) \
  231. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 24, 3, value)
  232. #define GET_TX_DESC_MAX_AMSDU_MODE(txdesc) \
  233. LE_BITS_TO_4BYTE(txdesc + 0x08, 24, 3)
  234. #endif
  235. #if (HALMAC_8198F_SUPPORT)
  236. #define SET_TX_DESC_ANTSEL_C_V1(txdesc, value) \
  237. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 24, 4, value)
  238. #define GET_TX_DESC_ANTSEL_C_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 24, 4)
  239. #endif
  240. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  241. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  242. HALMAC_8812F_SUPPORT)
  243. #define SET_TX_DESC_BT_NULL(txdesc, value) \
  244. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 23, 1, value)
  245. #define GET_TX_DESC_BT_NULL(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 23, 1)
  246. #define SET_TX_DESC_AMPDU_DENSITY(txdesc, value) \
  247. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 20, 3, value)
  248. #define GET_TX_DESC_AMPDU_DENSITY(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 20, 3)
  249. #define SET_TX_DESC_SPE_RPT(txdesc, value) \
  250. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 19, 1, value)
  251. #define GET_TX_DESC_SPE_RPT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 19, 1)
  252. #define SET_TX_DESC_RAW(txdesc, value) \
  253. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 18, 1, value)
  254. #define GET_TX_DESC_RAW(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 18, 1)
  255. #define SET_TX_DESC_MOREFRAG(txdesc, value) \
  256. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 17, 1, value)
  257. #define GET_TX_DESC_MOREFRAG(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 17, 1)
  258. #define SET_TX_DESC_BK(txdesc, value) \
  259. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 16, 1, value)
  260. #define GET_TX_DESC_BK(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 16, 1)
  261. #endif
  262. #if (HALMAC_8814B_SUPPORT)
  263. #define SET_TX_DESC_DMA_TXAGG_NUM_V1(txdesc, value) \
  264. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 16, 8, value)
  265. #define GET_TX_DESC_DMA_TXAGG_NUM_V1(txdesc) \
  266. LE_BITS_TO_4BYTE(txdesc + 0x08, 16, 8)
  267. #endif
  268. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  269. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  270. HALMAC_8812F_SUPPORT)
  271. #define SET_TX_DESC_NULL_1(txdesc, value) \
  272. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 15, 1, value)
  273. #define GET_TX_DESC_NULL_1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 15, 1)
  274. #define SET_TX_DESC_NULL_0(txdesc, value) \
  275. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 14, 1, value)
  276. #define GET_TX_DESC_NULL_0(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 14, 1)
  277. #define SET_TX_DESC_RDG_EN(txdesc, value) \
  278. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 13, 1, value)
  279. #define GET_TX_DESC_RDG_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 13, 1)
  280. #define SET_TX_DESC_AGG_EN(txdesc, value) \
  281. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 12, 1, value)
  282. #define GET_TX_DESC_AGG_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 12, 1)
  283. #define SET_TX_DESC_CCA_RTS(txdesc, value) \
  284. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 10, 2, value)
  285. #define GET_TX_DESC_CCA_RTS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 10, 2)
  286. #endif
  287. #if (HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || HALMAC_8821C_SUPPORT || \
  288. HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  289. #define SET_TX_DESC_TRI_FRAME(txdesc, value) \
  290. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 9, 1, value)
  291. #define GET_TX_DESC_TRI_FRAME(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 9, 1)
  292. #endif
  293. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  294. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  295. HALMAC_8812F_SUPPORT)
  296. #define SET_TX_DESC_P_AID(txdesc, value) \
  297. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 0, 9, value)
  298. #define GET_TX_DESC_P_AID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x08, 0, 9)
  299. #endif
  300. #if (HALMAC_8814B_SUPPORT)
  301. #define SET_TX_DESC_TXDESC_CHECKSUM_V1(txdesc, value) \
  302. SET_BITS_TO_LE_4BYTE(txdesc + 0x08, 0, 16, value)
  303. #define GET_TX_DESC_TXDESC_CHECKSUM_V1(txdesc) \
  304. LE_BITS_TO_4BYTE(txdesc + 0x08, 0, 16)
  305. #endif
  306. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  307. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  308. HALMAC_8812F_SUPPORT)
  309. /*TXDESC_WORD3*/
  310. #define SET_TX_DESC_AMPDU_MAX_TIME(txdesc, value) \
  311. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 24, 8, value)
  312. #define GET_TX_DESC_AMPDU_MAX_TIME(txdesc) \
  313. LE_BITS_TO_4BYTE(txdesc + 0x0C, 24, 8)
  314. #define SET_TX_DESC_NDPA(txdesc, value) \
  315. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 22, 2, value)
  316. #define GET_TX_DESC_NDPA(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 22, 2)
  317. #define SET_TX_DESC_MAX_AGG_NUM(txdesc, value) \
  318. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 17, 5, value)
  319. #define GET_TX_DESC_MAX_AGG_NUM(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 17, 5)
  320. #define SET_TX_DESC_USE_MAX_TIME_EN(txdesc, value) \
  321. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 16, 1, value)
  322. #define GET_TX_DESC_USE_MAX_TIME_EN(txdesc) \
  323. LE_BITS_TO_4BYTE(txdesc + 0x0C, 16, 1)
  324. #endif
  325. #if (HALMAC_8814B_SUPPORT)
  326. #define SET_TX_DESC_OFFLOAD_SIZE(txdesc, value) \
  327. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 16, 15, value)
  328. #define GET_TX_DESC_OFFLOAD_SIZE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 16, 15)
  329. #endif
  330. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  331. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  332. HALMAC_8812F_SUPPORT)
  333. #define SET_TX_DESC_NAVUSEHDR(txdesc, value) \
  334. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 15, 1, value)
  335. #define GET_TX_DESC_NAVUSEHDR(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 15, 1)
  336. #define SET_TX_DESC_CHK_EN(txdesc, value) \
  337. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 14, 1, value)
  338. #define GET_TX_DESC_CHK_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 14, 1)
  339. #define SET_TX_DESC_HW_RTS_EN(txdesc, value) \
  340. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 13, 1, value)
  341. #define GET_TX_DESC_HW_RTS_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 13, 1)
  342. #define SET_TX_DESC_RTSEN(txdesc, value) \
  343. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 12, 1, value)
  344. #define GET_TX_DESC_RTSEN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 12, 1)
  345. #define SET_TX_DESC_CTS2SELF(txdesc, value) \
  346. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 11, 1, value)
  347. #define GET_TX_DESC_CTS2SELF(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 11, 1)
  348. #endif
  349. #if (HALMAC_8814B_SUPPORT)
  350. #define SET_TX_DESC_CHANNEL_DMA(txdesc, value) \
  351. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 11, 5, value)
  352. #define GET_TX_DESC_CHANNEL_DMA(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 11, 5)
  353. #endif
  354. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  355. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  356. HALMAC_8812F_SUPPORT)
  357. #define SET_TX_DESC_DISDATAFB(txdesc, value) \
  358. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 10, 1, value)
  359. #define GET_TX_DESC_DISDATAFB(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 10, 1)
  360. #define SET_TX_DESC_DISRTSFB(txdesc, value) \
  361. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 9, 1, value)
  362. #define GET_TX_DESC_DISRTSFB(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 9, 1)
  363. #define SET_TX_DESC_USE_RATE(txdesc, value) \
  364. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 8, 1, value)
  365. #define GET_TX_DESC_USE_RATE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 8, 1)
  366. #define SET_TX_DESC_HW_SSN_SEL(txdesc, value) \
  367. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 6, 2, value)
  368. #define GET_TX_DESC_HW_SSN_SEL(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 6, 2)
  369. #endif
  370. #if (HALMAC_8814B_SUPPORT)
  371. #define SET_TX_DESC_IE_CNT(txdesc, value) \
  372. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 6, 3, value)
  373. #define GET_TX_DESC_IE_CNT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 6, 3)
  374. #define SET_TX_DESC_IE_CNT_EN(txdesc, value) \
  375. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 5, 1, value)
  376. #define GET_TX_DESC_IE_CNT_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 5, 1)
  377. #endif
  378. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  379. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  380. HALMAC_8812F_SUPPORT)
  381. #define SET_TX_DESC_WHEADER_LEN(txdesc, value) \
  382. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 0, 5, value)
  383. #define GET_TX_DESC_WHEADER_LEN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 0, 5)
  384. #endif
  385. #if (HALMAC_8814B_SUPPORT)
  386. #define SET_TX_DESC_WHEADER_LEN_V1(txdesc, value) \
  387. SET_BITS_TO_LE_4BYTE(txdesc + 0x0C, 0, 5, value)
  388. #define GET_TX_DESC_WHEADER_LEN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x0C, 0, 5)
  389. #endif
  390. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  391. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  392. HALMAC_8812F_SUPPORT)
  393. /*TXDESC_WORD4*/
  394. #define SET_TX_DESC_PCTS_MASK_IDX(txdesc, value) \
  395. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 30, 2, value)
  396. #define GET_TX_DESC_PCTS_MASK_IDX(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 30, 2)
  397. #define SET_TX_DESC_PCTS_EN(txdesc, value) \
  398. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 29, 1, value)
  399. #define GET_TX_DESC_PCTS_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 29, 1)
  400. #define SET_TX_DESC_RTSRATE(txdesc, value) \
  401. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 24, 5, value)
  402. #define GET_TX_DESC_RTSRATE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 24, 5)
  403. #define SET_TX_DESC_RTS_DATA_RTY_LMT(txdesc, value) \
  404. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 18, 6, value)
  405. #define GET_TX_DESC_RTS_DATA_RTY_LMT(txdesc) \
  406. LE_BITS_TO_4BYTE(txdesc + 0x10, 18, 6)
  407. #define SET_TX_DESC_RTY_LMT_EN(txdesc, value) \
  408. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 17, 1, value)
  409. #define GET_TX_DESC_RTY_LMT_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 17, 1)
  410. #define SET_TX_DESC_RTS_RTY_LOWEST_RATE(txdesc, value) \
  411. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 13, 4, value)
  412. #define GET_TX_DESC_RTS_RTY_LOWEST_RATE(txdesc) \
  413. LE_BITS_TO_4BYTE(txdesc + 0x10, 13, 4)
  414. #define SET_TX_DESC_DATA_RTY_LOWEST_RATE(txdesc, value) \
  415. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 8, 5, value)
  416. #define GET_TX_DESC_DATA_RTY_LOWEST_RATE(txdesc) \
  417. LE_BITS_TO_4BYTE(txdesc + 0x10, 8, 5)
  418. #define SET_TX_DESC_TRY_RATE(txdesc, value) \
  419. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 7, 1, value)
  420. #define GET_TX_DESC_TRY_RATE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 7, 1)
  421. #define SET_TX_DESC_DATARATE(txdesc, value) \
  422. SET_BITS_TO_LE_4BYTE(txdesc + 0x10, 0, 7, value)
  423. #define GET_TX_DESC_DATARATE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x10, 0, 7)
  424. /*TXDESC_WORD5*/
  425. #define SET_TX_DESC_POLLUTED(txdesc, value) \
  426. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 31, 1, value)
  427. #define GET_TX_DESC_POLLUTED(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 31, 1)
  428. #endif
  429. #if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  430. #define SET_TX_DESC_ANTSEL_EN_V1(txdesc, value) \
  431. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 30, 1, value)
  432. #define GET_TX_DESC_ANTSEL_EN_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 30, 1)
  433. #endif
  434. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  435. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT)
  436. #define SET_TX_DESC_TXPWR_OFSET(txdesc, value) \
  437. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 28, 3, value)
  438. #define GET_TX_DESC_TXPWR_OFSET(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 28, 3)
  439. #endif
  440. #if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  441. #define SET_TX_DESC_TXPWR_OFSET_TYPE(txdesc, value) \
  442. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 28, 2, value)
  443. #define GET_TX_DESC_TXPWR_OFSET_TYPE(txdesc) \
  444. LE_BITS_TO_4BYTE(txdesc + 0x14, 28, 2)
  445. #endif
  446. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  447. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  448. #define SET_TX_DESC_TX_ANT(txdesc, value) \
  449. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 24, 4, value)
  450. #define GET_TX_DESC_TX_ANT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 24, 4)
  451. #endif
  452. #if (HALMAC_8198F_SUPPORT)
  453. #define SET_TX_DESC_DROP_ID(txdesc, value) \
  454. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 24, 2, value)
  455. #define GET_TX_DESC_DROP_ID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 24, 2)
  456. #endif
  457. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  458. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  459. HALMAC_8812F_SUPPORT)
  460. #define SET_TX_DESC_PORT_ID(txdesc, value) \
  461. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 21, 3, value)
  462. #define GET_TX_DESC_PORT_ID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 21, 3)
  463. #endif
  464. #if (HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || HALMAC_8821C_SUPPORT || \
  465. HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  466. #define SET_TX_DESC_MULTIPLE_PORT(txdesc, value) \
  467. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 18, 3, value)
  468. #define GET_TX_DESC_MULTIPLE_PORT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 18, 3)
  469. #endif
  470. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  471. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  472. HALMAC_8812F_SUPPORT)
  473. #define SET_TX_DESC_SIGNALING_TAPKT_EN(txdesc, value) \
  474. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 17, 1, value)
  475. #define GET_TX_DESC_SIGNALING_TAPKT_EN(txdesc) \
  476. LE_BITS_TO_4BYTE(txdesc + 0x14, 17, 1)
  477. #endif
  478. #if (HALMAC_8814A_SUPPORT || HALMAC_8197F_SUPPORT || HALMAC_8198F_SUPPORT)
  479. #define SET_TX_DESC_RTS_SC(txdesc, value) \
  480. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 13, 4, value)
  481. #define GET_TX_DESC_RTS_SC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 13, 4)
  482. #endif
  483. #if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || \
  484. HALMAC_8812F_SUPPORT)
  485. #define SET_TX_DESC_SIGNALING_TA_PKT_SC(txdesc, value) \
  486. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 13, 4, value)
  487. #define GET_TX_DESC_SIGNALING_TA_PKT_SC(txdesc) \
  488. LE_BITS_TO_4BYTE(txdesc + 0x14, 13, 4)
  489. #endif
  490. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  491. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  492. HALMAC_8812F_SUPPORT)
  493. #define SET_TX_DESC_RTS_SHORT(txdesc, value) \
  494. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 12, 1, value)
  495. #define GET_TX_DESC_RTS_SHORT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 12, 1)
  496. #define SET_TX_DESC_VCS_STBC(txdesc, value) \
  497. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 10, 2, value)
  498. #define GET_TX_DESC_VCS_STBC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 10, 2)
  499. #define SET_TX_DESC_DATA_STBC(txdesc, value) \
  500. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 8, 2, value)
  501. #define GET_TX_DESC_DATA_STBC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 8, 2)
  502. #define SET_TX_DESC_DATA_LDPC(txdesc, value) \
  503. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 7, 1, value)
  504. #define GET_TX_DESC_DATA_LDPC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 7, 1)
  505. #define SET_TX_DESC_DATA_BW(txdesc, value) \
  506. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 5, 2, value)
  507. #define GET_TX_DESC_DATA_BW(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 5, 2)
  508. #define SET_TX_DESC_DATA_SHORT(txdesc, value) \
  509. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 4, 1, value)
  510. #define GET_TX_DESC_DATA_SHORT(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 4, 1)
  511. #define SET_TX_DESC_DATA_SC(txdesc, value) \
  512. SET_BITS_TO_LE_4BYTE(txdesc + 0x14, 0, 4, value)
  513. #define GET_TX_DESC_DATA_SC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x14, 0, 4)
  514. #endif
  515. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  516. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  517. /*TXDESC_WORD6*/
  518. #define SET_TX_DESC_ANTSEL_D(txdesc, value) \
  519. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 30, 2, value)
  520. #define GET_TX_DESC_ANTSEL_D(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 30, 2)
  521. #endif
  522. #if (HALMAC_8198F_SUPPORT)
  523. #define SET_TX_DESC_ANT_MAPD_V1(txdesc, value) \
  524. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 30, 2, value)
  525. #define GET_TX_DESC_ANT_MAPD_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 30, 2)
  526. #endif
  527. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  528. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  529. #define SET_TX_DESC_ANT_MAPD(txdesc, value) \
  530. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 28, 2, value)
  531. #define GET_TX_DESC_ANT_MAPD(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 28, 2)
  532. #endif
  533. #if (HALMAC_8198F_SUPPORT)
  534. #define SET_TX_DESC_ANT_MAPC_V1(txdesc, value) \
  535. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 28, 2, value)
  536. #define GET_TX_DESC_ANT_MAPC_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 28, 2)
  537. #endif
  538. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  539. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  540. #define SET_TX_DESC_ANT_MAPC(txdesc, value) \
  541. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 26, 2, value)
  542. #define GET_TX_DESC_ANT_MAPC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 26, 2)
  543. #endif
  544. #if (HALMAC_8198F_SUPPORT)
  545. #define SET_TX_DESC_ANT_MAPB_V1(txdesc, value) \
  546. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 26, 2, value)
  547. #define GET_TX_DESC_ANT_MAPB_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 26, 2)
  548. #endif
  549. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  550. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  551. #define SET_TX_DESC_ANT_MAPB(txdesc, value) \
  552. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 24, 2, value)
  553. #define GET_TX_DESC_ANT_MAPB(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 24, 2)
  554. #endif
  555. #if (HALMAC_8198F_SUPPORT)
  556. #define SET_TX_DESC_ANT_MAPA_V1(txdesc, value) \
  557. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 24, 2, value)
  558. #define GET_TX_DESC_ANT_MAPA_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 24, 2)
  559. #endif
  560. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  561. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  562. #define SET_TX_DESC_ANT_MAPA(txdesc, value) \
  563. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 22, 2, value)
  564. #define GET_TX_DESC_ANT_MAPA(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 22, 2)
  565. #define SET_TX_DESC_ANTSEL_C(txdesc, value) \
  566. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 20, 2, value)
  567. #define GET_TX_DESC_ANTSEL_C(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 20, 2)
  568. #endif
  569. #if (HALMAC_8198F_SUPPORT)
  570. #define SET_TX_DESC_ANTSEL_B_V1(txdesc, value) \
  571. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 20, 4, value)
  572. #define GET_TX_DESC_ANTSEL_B_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 20, 4)
  573. #endif
  574. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  575. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  576. #define SET_TX_DESC_ANTSEL_B(txdesc, value) \
  577. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 18, 2, value)
  578. #define GET_TX_DESC_ANTSEL_B(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 18, 2)
  579. #define SET_TX_DESC_ANTSEL_A(txdesc, value) \
  580. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 16, 2, value)
  581. #define GET_TX_DESC_ANTSEL_A(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 16, 2)
  582. #endif
  583. #if (HALMAC_8198F_SUPPORT)
  584. #define SET_TX_DESC_ANTSEL_A_V1(txdesc, value) \
  585. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 16, 4, value)
  586. #define GET_TX_DESC_ANTSEL_A_V1(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 16, 4)
  587. #endif
  588. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  589. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  590. HALMAC_8812F_SUPPORT)
  591. #define SET_TX_DESC_MBSSID(txdesc, value) \
  592. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 12, 4, value)
  593. #define GET_TX_DESC_MBSSID(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 12, 4)
  594. #endif
  595. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  596. HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
  597. #define SET_TX_DESC_SW_DEFINE(txdesc, value) \
  598. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 0, 12, value)
  599. #define GET_TX_DESC_SW_DEFINE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 0, 12)
  600. #endif
  601. #if (HALMAC_8198F_SUPPORT)
  602. #define SET_TX_DESC_SWPS_SEQ(txdesc, value) \
  603. SET_BITS_TO_LE_4BYTE(txdesc + 0x18, 0, 12, value)
  604. #define GET_TX_DESC_SWPS_SEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x18, 0, 12)
  605. #endif
  606. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  607. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  608. HALMAC_8812F_SUPPORT)
  609. /*TXDESC_WORD7*/
  610. #define SET_TX_DESC_DMA_TXAGG_NUM(txdesc, value) \
  611. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 24, 8, value)
  612. #define GET_TX_DESC_DMA_TXAGG_NUM(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 24, 8)
  613. #define SET_TX_DESC_FINAL_DATA_RATE(txdesc, value) \
  614. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 24, 8, value)
  615. #define GET_TX_DESC_FINAL_DATA_RATE(txdesc) \
  616. LE_BITS_TO_4BYTE(txdesc + 0x1C, 24, 8)
  617. #define SET_TX_DESC_NTX_MAP(txdesc, value) \
  618. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 20, 4, value)
  619. #define GET_TX_DESC_NTX_MAP(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 20, 4)
  620. #endif
  621. #if (HALMAC_8198F_SUPPORT)
  622. #define SET_TX_DESC_ANTSEL_EN(txdesc, value) \
  623. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 19, 1, value)
  624. #define GET_TX_DESC_ANTSEL_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 19, 1)
  625. #define SET_TX_DESC_MBSSID_EX(txdesc, value) \
  626. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 16, 3, value)
  627. #define GET_TX_DESC_MBSSID_EX(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 16, 3)
  628. #endif
  629. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  630. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  631. HALMAC_8812F_SUPPORT)
  632. #define SET_TX_DESC_TX_BUFF_SIZE(txdesc, value) \
  633. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 0, 16, value)
  634. #define GET_TX_DESC_TX_BUFF_SIZE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 0, 16)
  635. #define SET_TX_DESC_TXDESC_CHECKSUM(txdesc, value) \
  636. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 0, 16, value)
  637. #define GET_TX_DESC_TXDESC_CHECKSUM(txdesc) \
  638. LE_BITS_TO_4BYTE(txdesc + 0x1C, 0, 16)
  639. #define SET_TX_DESC_TIMESTAMP(txdesc, value) \
  640. SET_BITS_TO_LE_4BYTE(txdesc + 0x1C, 0, 16, value)
  641. #define GET_TX_DESC_TIMESTAMP(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x1C, 0, 16)
  642. /*TXDESC_WORD8*/
  643. #define SET_TX_DESC_TXWIFI_CP(txdesc, value) \
  644. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 31, 1, value)
  645. #define GET_TX_DESC_TXWIFI_CP(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 31, 1)
  646. #define SET_TX_DESC_MAC_CP(txdesc, value) \
  647. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 30, 1, value)
  648. #define GET_TX_DESC_MAC_CP(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 30, 1)
  649. #define SET_TX_DESC_STW_PKTRE_DIS(txdesc, value) \
  650. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 29, 1, value)
  651. #define GET_TX_DESC_STW_PKTRE_DIS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 29, 1)
  652. #define SET_TX_DESC_STW_RB_DIS(txdesc, value) \
  653. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 28, 1, value)
  654. #define GET_TX_DESC_STW_RB_DIS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 28, 1)
  655. #define SET_TX_DESC_STW_RATE_DIS(txdesc, value) \
  656. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 27, 1, value)
  657. #define GET_TX_DESC_STW_RATE_DIS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 27, 1)
  658. #define SET_TX_DESC_STW_ANT_DIS(txdesc, value) \
  659. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 26, 1, value)
  660. #define GET_TX_DESC_STW_ANT_DIS(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 26, 1)
  661. #define SET_TX_DESC_STW_EN(txdesc, value) \
  662. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 25, 1, value)
  663. #define GET_TX_DESC_STW_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 25, 1)
  664. #define SET_TX_DESC_SMH_EN(txdesc, value) \
  665. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 24, 1, value)
  666. #define GET_TX_DESC_SMH_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 24, 1)
  667. #define SET_TX_DESC_TAILPAGE_L(txdesc, value) \
  668. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 24, 8, value)
  669. #define GET_TX_DESC_TAILPAGE_L(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 24, 8)
  670. #define SET_TX_DESC_SDIO_DMASEQ(txdesc, value) \
  671. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 16, 8, value)
  672. #define GET_TX_DESC_SDIO_DMASEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 16, 8)
  673. #define SET_TX_DESC_NEXTHEADPAGE_L(txdesc, value) \
  674. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 16, 8, value)
  675. #define GET_TX_DESC_NEXTHEADPAGE_L(txdesc) \
  676. LE_BITS_TO_4BYTE(txdesc + 0x20, 16, 8)
  677. #endif
  678. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  679. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT)
  680. #define SET_TX_DESC_EN_HWSEQ(txdesc, value) \
  681. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 15, 1, value)
  682. #define GET_TX_DESC_EN_HWSEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 15, 1)
  683. #define SET_TX_DESC_EN_HWEXSEQ(txdesc, value) \
  684. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 14, 1, value)
  685. #define GET_TX_DESC_EN_HWEXSEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 14, 1)
  686. #endif
  687. #if (HALMAC_8812F_SUPPORT)
  688. #define SET_TX_DESC_EN_HWSEQ_MODE(txdesc, value) \
  689. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 14, 2, value)
  690. #define GET_TX_DESC_EN_HWSEQ_MODE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 14, 2)
  691. #endif
  692. #if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
  693. HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
  694. HALMAC_8812F_SUPPORT)
  695. #define SET_TX_DESC_DATA_RC(txdesc, value) \
  696. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 8, 6, value)
  697. #define GET_TX_DESC_DATA_RC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 8, 6)
  698. #define SET_TX_DESC_BAR_RTY_TH(txdesc, value) \
  699. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 6, 2, value)
  700. #define GET_TX_DESC_BAR_RTY_TH(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 6, 2)
  701. #define SET_TX_DESC_RTS_RC(txdesc, value) \
  702. SET_BITS_TO_LE_4BYTE(txdesc + 0x20, 0, 6, value)
  703. #define GET_TX_DESC_RTS_RC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x20, 0, 6)
  704. /*TXDESC_WORD9*/
  705. #define SET_TX_DESC_TAILPAGE_H(txdesc, value) \
  706. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 28, 4, value)
  707. #define GET_TX_DESC_TAILPAGE_H(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x24, 28, 4)
  708. #define SET_TX_DESC_NEXTHEADPAGE_H(txdesc, value) \
  709. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 24, 4, value)
  710. #define GET_TX_DESC_NEXTHEADPAGE_H(txdesc) \
  711. LE_BITS_TO_4BYTE(txdesc + 0x24, 24, 4)
  712. #define SET_TX_DESC_SW_SEQ(txdesc, value) \
  713. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 12, 12, value)
  714. #define GET_TX_DESC_SW_SEQ(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x24, 12, 12)
  715. #define SET_TX_DESC_TXBF_PATH(txdesc, value) \
  716. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 11, 1, value)
  717. #define GET_TX_DESC_TXBF_PATH(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x24, 11, 1)
  718. #define SET_TX_DESC_PADDING_LEN(txdesc, value) \
  719. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 0, 11, value)
  720. #define GET_TX_DESC_PADDING_LEN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x24, 0, 11)
  721. #define SET_TX_DESC_GROUP_BIT_IE_OFFSET(txdesc, value) \
  722. SET_BITS_TO_LE_4BYTE(txdesc + 0x24, 0, 8, value)
  723. #define GET_TX_DESC_GROUP_BIT_IE_OFFSET(txdesc) \
  724. LE_BITS_TO_4BYTE(txdesc + 0x24, 0, 8)
  725. #endif
  726. #if (HALMAC_8812F_SUPPORT)
  727. /*WORD10*/
  728. #define SET_TX_DESC_HT_DATA_SND(txdesc, value) \
  729. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 31, 1, value)
  730. #define GET_TX_DESC_HT_DATA_SND(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 31, 1)
  731. #define SET_TX_DESC_SHCUT_CAM(txdesc, value) \
  732. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 16, 6, value)
  733. #define GET_TX_DESC_SHCUT_CAM(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 16, 6)
  734. #endif
  735. #if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || \
  736. HALMAC_8812F_SUPPORT)
  737. #define SET_TX_DESC_MU_DATARATE(txdesc, value) \
  738. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 8, 8, value)
  739. #define GET_TX_DESC_MU_DATARATE(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 8, 8)
  740. #define SET_TX_DESC_MU_RC(txdesc, value) \
  741. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 4, 4, value)
  742. #define GET_TX_DESC_MU_RC(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 4, 4)
  743. #endif
  744. #if (HALMAC_8812F_SUPPORT)
  745. #define SET_TX_DESC_NDPA_RATE_SEL(txdesc, value) \
  746. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 3, 1, value)
  747. #define GET_TX_DESC_NDPA_RATE_SEL(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 3, 1)
  748. #define SET_TX_DESC_HW_NDPA_EN(txdesc, value) \
  749. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 2, 1, value)
  750. #define GET_TX_DESC_HW_NDPA_EN(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 2, 1)
  751. #endif
  752. #if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || \
  753. HALMAC_8812F_SUPPORT)
  754. #define SET_TX_DESC_SND_PKT_SEL(txdesc, value) \
  755. SET_BITS_TO_LE_4BYTE(txdesc + 0x28, 0, 2, value)
  756. #define GET_TX_DESC_SND_PKT_SEL(txdesc) LE_BITS_TO_4BYTE(txdesc + 0x28, 0, 2)
  757. #endif
  758. #endif