ce_assignment.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /*
  2. * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /*
  27. * Implementation of the Host-side Host InterFace (HIF) API
  28. * for a Host/Target interconnect using Copy Engines over PCIe.
  29. */
  30. #ifndef __HIF_PCI_INTERNAL_H__
  31. #define __HIF_PCI_INTERNAL_H__
  32. #ifndef CONFIG_WIN
  33. #ifndef PEER_CACHEING_HOST_ENABLE
  34. #define PEER_CACHEING_HOST_ENABLE 0
  35. #endif
  36. #endif
  37. #define HIF_PCI_DEBUG ATH_DEBUG_MAKE_MODULE_MASK(0)
  38. #define HIF_PCI_IPA_UC_ASSIGNED_CE 5
  39. #if defined(WLAN_DEBUG) || defined(DEBUG)
  40. static ATH_DEBUG_MASK_DESCRIPTION g_hif_debug_description[] = {
  41. {HIF_PCI_DEBUG, "hif_pci"},
  42. };
  43. ATH_DEBUG_INSTANTIATE_MODULE_VAR(hif, "hif", "PCIe Host Interface",
  44. ATH_DEBUG_MASK_DEFAULTS | ATH_DEBUG_INFO,
  45. ATH_DEBUG_DESCRIPTION_COUNT
  46. (g_hif_debug_description),
  47. g_hif_debug_description);
  48. #endif
  49. #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
  50. /* globals are initialized to 0 by the compiler */;
  51. spinlock_t pcie_access_log_lock;
  52. unsigned int pcie_access_log_seqnum;
  53. HIF_ACCESS_LOG pcie_access_log[PCIE_ACCESS_LOG_NUM];
  54. static void hif_target_dump_access_log(void);
  55. #endif
  56. /*
  57. * Host software's Copy Engine configuration.
  58. * This table is derived from the CE_PCI TABLE, above.
  59. */
  60. #ifdef BIG_ENDIAN_HOST
  61. #define CE_ATTR_FLAGS CE_ATTR_BYTE_SWAP_DATA
  62. #else
  63. #define CE_ATTR_FLAGS 0
  64. #endif
  65. /* Maximum number of Copy Engine's supported */
  66. #define CE_HTT_H2T_MSG_SRC_NENTRIES 2048
  67. #define CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B 4096
  68. #define DIAG_CE_ID 7
  69. #define EPPING_CE_FLAGS_POLL \
  70. (CE_ATTR_DISABLE_INTR|CE_ATTR_ENABLE_POLL|CE_ATTR_FLAGS)
  71. #ifdef CONFIG_WIN
  72. #define PIPEDIR_INOUT_H2H 4
  73. #endif
  74. #ifdef QCA_WIFI_3_0
  75. static struct CE_attr host_ce_config_wlan[] = {
  76. /* host->target HTC control and raw streams */
  77. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
  78. /* target->host HTT + HTC control */
  79. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  80. /* target->host WMI */
  81. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 64, NULL,},
  82. /* host->target WMI */
  83. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
  84. /* host->target HTT */
  85. { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  86. CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
  87. /* ipa_uc->target HTC control */
  88. { /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  89. 1024, 512, 0, NULL,},
  90. /* Target autonomous HIF_memcpy */
  91. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  92. /* ce_diag, the Diagnostic Window */
  93. { /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  94. 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  95. /* Target to uMC */
  96. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  97. /* target->host HTT */
  98. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  99. /* target->host HTT */
  100. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  101. /* target -> host PKTLOG */
  102. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  103. };
  104. static struct CE_pipe_config target_ce_config_wlan[] = {
  105. /* host->target HTC control and raw streams */
  106. { /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  107. /* target->host HTT */
  108. { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  109. /* target->host WMI + HTC control */
  110. { /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0,},
  111. /* host->target WMI */
  112. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  113. /* host->target HTT */
  114. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
  115. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  116. /* NB: 50% of src nentries, since tx has 2 frags */
  117. /* ipa_uc->target */
  118. { /* CE5 */ 5, PIPEDIR_OUT, 1024, 64,
  119. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  120. /* Reserved for target autonomous HIF_memcpy */
  121. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
  122. /* CE7 used only by Host */
  123. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
  124. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  125. /* CE8 used only by IPA */
  126. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  127. /* CE9 target->host HTT */
  128. { /* CE9 */ 9, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  129. /* CE10 target->host HTT */
  130. { /* CE10 */ 10, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  131. /* Target -> host PKTLOG */
  132. { /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  133. };
  134. static struct CE_attr host_ce_config_wlan_epping_poll[] = {
  135. /* host->target HTC control and raw streams */
  136. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
  137. /* target->host EP-ping */
  138. { /* CE1 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 128, NULL,},
  139. /* target->host EP-ping */
  140. { /* CE2 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 128, NULL,},
  141. /* host->target EP-ping */
  142. { /* CE3 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  143. /* host->target EP-ping */
  144. { /* CE4 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  145. /* EP-ping heartbeat */
  146. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  147. /* unused */
  148. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  149. /* ce_diag, the Diagnostic Window */
  150. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  151. };
  152. static struct CE_attr host_ce_config_wlan_epping_irq[] = {
  153. /* host->target HTC control and raw streams */
  154. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
  155. /* target->host EP-ping */
  156. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  157. /* target->host EP-ping */
  158. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  159. /* host->target EP-ping */
  160. { /* CE3 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  161. /* host->target EP-ping */
  162. { /* CE4 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  163. /* EP-ping heartbeat */
  164. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  165. /* unused */
  166. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  167. /* ce_diag, the Diagnostic Window */
  168. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  169. };
  170. /*
  171. * EP-ping firmware's CE configuration
  172. */
  173. static struct CE_pipe_config target_ce_config_wlan_epping[] = {
  174. /* host->target HTC control and raw streams */
  175. { /* CE0 */ 0, PIPEDIR_OUT, 16, 2048, CE_ATTR_FLAGS, 0,},
  176. /* target->host EP-ping */
  177. { /* CE1 */ 1, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  178. /* target->host EP-ping */
  179. { /* CE2 */ 2, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  180. /* host->target EP-ping */
  181. { /* CE3 */ 3, PIPEDIR_OUT, 128, 2048, CE_ATTR_FLAGS, 0,},
  182. /* host->target EP-ping */
  183. { /* CE4 */ 4, PIPEDIR_OUT, 128, 2048, CE_ATTR_FLAGS, 0,},
  184. /* EP-ping heartbeat */
  185. { /* CE5 */ 5, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  186. /* unused */
  187. { /* CE6 */ 6, PIPEDIR_INOUT, 0, 0, CE_ATTR_FLAGS, 0,},
  188. /* CE7 used only by Host */
  189. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0, 0, 0,},
  190. /* CE8 used only by IPA */
  191. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}
  192. };
  193. #else
  194. static struct CE_attr host_ce_config_wlan[] = {
  195. /* host->target HTC control and raw streams */
  196. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
  197. /* target->host HTT + HTC control */
  198. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  199. /* target->host WMI */
  200. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,},
  201. /* host->target WMI */
  202. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
  203. /* host->target HTT */
  204. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  205. CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
  206. /* ipa_uc->target HTC control */
  207. { /* CE5 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  208. 1024, 512, 0, NULL,},
  209. /* Target autonomous HIF_memcpy */
  210. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  211. /* ce_diag, the Diagnostic Window */
  212. { /* CE7 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR,
  213. 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  214. };
  215. static struct CE_pipe_config target_ce_config_wlan[] = {
  216. /* host->target HTC control and raw streams */
  217. { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0,},
  218. /* target->host HTT + HTC control */
  219. { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  220. /* target->host WMI */
  221. { /* CE2 */ 2, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  222. /* host->target WMI */
  223. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  224. /* host->target HTT */
  225. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0,},
  226. /* NB: 50% of src nentries, since tx has 2 frags */
  227. /* ipa_uc->target HTC control */
  228. { /* CE5 */ 5, PIPEDIR_OUT, 1024, 64, CE_ATTR_FLAGS, 0,},
  229. /* Reserved for target autonomous HIF_memcpy */
  230. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0,},
  231. /* CE7 used only by Host */
  232. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0, 0, 0,},
  233. /* CE8 used only by IPA */
  234. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}
  235. };
  236. static struct CE_attr host_ce_config_wlan_epping_poll[] = {
  237. /* host->target HTC control and raw streams */
  238. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
  239. /* target->host EP-ping */
  240. { /* CE1 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 128, NULL,},
  241. /* target->host EP-ping */
  242. { /* CE2 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 128, NULL,},
  243. /* host->target EP-ping */
  244. { /* CE3 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  245. /* host->target EP-ping */
  246. { /* CE4 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  247. /* EP-ping heartbeat */
  248. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  249. /* unused */
  250. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  251. /* ce_diag, the Diagnostic Window */
  252. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  253. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  254. /* The following CEs are not being used yet */
  255. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  256. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  257. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  258. };
  259. static struct CE_attr host_ce_config_wlan_epping_irq[] = {
  260. /* host->target HTC control and raw streams */
  261. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
  262. /* target->host EP-ping */
  263. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  264. /* target->host EP-ping */
  265. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  266. /* host->target EP-ping */
  267. { /* CE3 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  268. /* host->target EP-ping */
  269. { /* CE4 */ CE_ATTR_FLAGS, 0, 128, 2048, 0, NULL,},
  270. /* EP-ping heartbeat */
  271. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL,},
  272. /* unused */
  273. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  274. /* ce_diag, the Diagnostic Window */
  275. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  276. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  277. /* The following CEs are not being used yet */
  278. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  279. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  280. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  281. };
  282. /*
  283. * EP-ping firmware's CE configuration
  284. */
  285. static struct CE_pipe_config target_ce_config_wlan_epping[] = {
  286. /* host->target HTC control and raw streams */
  287. { /* CE0 */ 0, PIPEDIR_OUT, 16, 256, CE_ATTR_FLAGS, 0,},
  288. /* target->host EP-ping */
  289. { /* CE1 */ 1, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  290. /* target->host EP-ping */
  291. { /* CE2 */ 2, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  292. /* host->target EP-ping */
  293. { /* CE3 */ 3, PIPEDIR_OUT, 128, 2048, CE_ATTR_FLAGS, 0,},
  294. /* host->target EP-ping */
  295. { /* CE4 */ 4, PIPEDIR_OUT, 128, 2048, CE_ATTR_FLAGS, 0,},
  296. /* EP-ping heartbeat */
  297. { /* CE5 */ 5, PIPEDIR_IN, 128, 2048, CE_ATTR_FLAGS, 0,},
  298. /* unused */
  299. { /* CE6 */ 6, PIPEDIR_INOUT, 0, 0, CE_ATTR_FLAGS, 0,},
  300. /* CE7 used only by Host */
  301. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0, 0, 0,},
  302. /* CE8 used only by IPA */
  303. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  304. { /* CE9 */ 9, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,},
  305. { /* CE10 */ 10, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,},
  306. { /* CE11 */ 11, PIPEDIR_IN, 0, 0, CE_ATTR_FLAGS, 0,},
  307. };
  308. #endif
  309. static struct CE_attr host_ce_config_wlan_ar9888[] = {
  310. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */
  311. /* could be moved to share CE3 */
  312. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */
  313. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */
  314. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */
  315. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  316. CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */
  317. #if WLAN_FEATURE_FASTPATH
  318. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */
  319. #else /* WLAN_FEATURE_FASTPATH */
  320. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */
  321. #endif /* WLAN_FEATURE_FASTPATH */
  322. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  323. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */
  324. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  325. };
  326. static struct CE_attr host_ce_config_wlan_ar900b[] = {
  327. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */
  328. /* could be moved to share CE3 */
  329. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */
  330. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */
  331. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */
  332. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  333. CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */
  334. #if WLAN_FEATURE_FASTPATH
  335. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */
  336. #else /* WLAN_FEATURE_FASTPATH */
  337. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */
  338. #endif /* WLAN_FEATURE_FASTPATH */
  339. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  340. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */
  341. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host pktlog */
  342. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  343. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  344. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  345. };
  346. static struct CE_attr host_lowdesc_ce_cfg_wlan_ar9888[] = {
  347. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */
  348. /* could be moved to share CE3 */
  349. #if WLAN_FEATURE_FASTPATH
  350. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */
  351. #else
  352. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */
  353. #endif
  354. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */
  355. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */
  356. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  357. CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */
  358. #if WLAN_FEATURE_FASTPATH
  359. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */
  360. #else /* WLAN_FEATURE_FASTPATH */
  361. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */
  362. #endif /* WLAN_FEATURE_FASTPATH */
  363. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  364. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */
  365. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  366. };
  367. static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b[] = {
  368. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */
  369. /* could be moved to share CE3 */
  370. #if WLAN_FEATURE_FASTPATH
  371. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */
  372. #else
  373. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */
  374. #endif
  375. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */
  376. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */
  377. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  378. CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */
  379. #if WLAN_FEATURE_FASTPATH
  380. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */
  381. #else /* WLAN_FEATURE_FASTPATH */
  382. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */
  383. #endif /* WLAN_FEATURE_FASTPATH */
  384. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  385. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */
  386. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host pktlog */
  387. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  388. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  389. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  390. };
  391. static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b_nopktlog[] = {
  392. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */
  393. /* could be moved to share CE3 */
  394. #if WLAN_FEATURE_FASTPATH
  395. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */
  396. #else
  397. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */
  398. #endif
  399. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */
  400. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */
  401. { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
  402. CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */
  403. #if WLAN_FEATURE_FASTPATH
  404. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */
  405. #else /* WLAN_FEATURE_FASTPATH */
  406. { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */
  407. #endif /* WLAN_FEATURE_FASTPATH */
  408. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  409. { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */
  410. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },/* target->host pktlog */
  411. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  412. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  413. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */
  414. };
  415. static struct CE_pipe_config target_ce_config_wlan_ar9888[] = {
  416. { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTC control and raw streams */
  417. { /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTC control */
  418. { /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, }, /* target->host WMI */
  419. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* host->target WMI */
  420. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTT */
  421. /* NB: 50% of src nentries, since tx has 2 frags */
  422. #if WLAN_FEATURE_FASTPATH
  423. { /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTT */
  424. #else
  425. { /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* unused */
  426. #endif
  427. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },/* Reserved for target autonomous HIF_memcpy */
  428. /* CE7 used only by Host */
  429. };
  430. static struct CE_pipe_config target_ce_config_wlan_ar900b[] = {
  431. { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTC control and raw streams */
  432. { /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTC control */
  433. { /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, }, /* target->host WMI */
  434. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* host->target WMI */
  435. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTT */
  436. /* NB: 50% of src nentries, since tx has 2 frags */
  437. #if WLAN_FEATURE_FASTPATH
  438. { /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTT */
  439. #else
  440. { /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* unused */
  441. #endif
  442. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },/* Reserved for target autonomous HIF_memcpy */
  443. { /* CE7 */ 7, PIPEDIR_INOUT, 0, 0, 0, 0, }, /* CE7 used only by Host */
  444. { /* CE8 */ 8, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS
  445. | CE_ATTR_DISABLE_INTR, 0, }, /* target->host packtlog */
  446. #if PEER_CACHEING_HOST_ENABLE
  447. { /* CE9 */ 9, PIPEDIR_INOUT, 32, 2048, CE_ATTR_FLAGS |
  448. CE_ATTR_DISABLE_INTR, 0, }, /* target autonomous qcache memcpy */
  449. #endif
  450. };
  451. static struct CE_attr host_ce_config_wlan_qca8074[] = {
  452. /* host->target HTC control and raw streams */
  453. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
  454. /* target->host HTT + HTC control */
  455. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  456. /* target->host WMI */
  457. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,},
  458. /* host->target WMI */
  459. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
  460. /* host->target HTT */
  461. { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  462. CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
  463. /* ipa_uc->target HTC control */
  464. { /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  465. 1024, 512, 0, NULL,},
  466. /* Target autonomous HIF_memcpy */
  467. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  468. /* ce_diag, the Diagnostic Window */
  469. { /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  470. 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  471. /* Target to uMC */
  472. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  473. /* target->host HTT */
  474. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  475. /* target->host HTT */
  476. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  477. /* target -> host PKTLOG */
  478. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  479. };
  480. static struct CE_pipe_config target_ce_config_wlan_qca8074[] = {
  481. /* host->target HTC control and raw streams */
  482. { /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  483. /* target->host HTT */
  484. { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  485. /* target->host WMI + HTC control */
  486. { /* CE2 */ 2, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  487. /* host->target WMI */
  488. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  489. /* host->target HTT */
  490. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
  491. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  492. /* NB: 50% of src nentries, since tx has 2 frags */
  493. /* ipa_uc->target */
  494. { /* CE5 */ 5, PIPEDIR_OUT, 1024, 64,
  495. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  496. /* Reserved for target autonomous HIF_memcpy */
  497. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
  498. /* CE7 used only by Host */
  499. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
  500. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  501. /* CE8 used only by IPA */
  502. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  503. /* CE9 target->host HTT */
  504. { /* CE9 */ 9, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  505. /* CE10 target->host HTT */
  506. { /* CE10 */ 10, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  507. /* Target -> host PKTLOG */
  508. { /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  509. };
  510. static struct CE_attr host_ce_config_wlan_qca6290[] = {
  511. /* host->target HTC control and raw streams */
  512. { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 2048, 0, NULL,},
  513. /* target->host HTT + HTC control */
  514. { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  515. /* target->host WMI */
  516. { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,},
  517. /* host->target WMI */
  518. { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
  519. /* host->target HTT */
  520. { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  521. CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
  522. /* ipa_uc->target HTC control */
  523. { /* CE5 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  524. 1024, 512, 0, NULL,},
  525. /* Target autonomous HIF_memcpy */
  526. { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  527. /* ce_diag, the Diagnostic Window */
  528. { /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
  529. 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
  530. /* Target to uMC */
  531. { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
  532. /* target->host HTT */
  533. { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  534. /* target->host HTT */
  535. { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  536. /* target -> host PKTLOG */
  537. { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
  538. };
  539. static struct CE_pipe_config target_ce_config_wlan_qca6290[] = {
  540. /* host->target HTC control and raw streams */
  541. { /* CE0 */ 0, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  542. /* target->host HTT */
  543. { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  544. /* target->host WMI + HTC control */
  545. { /* CE2 */ 2, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  546. /* host->target WMI */
  547. { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,},
  548. /* host->target HTT */
  549. { /* CE4 */ 4, PIPEDIR_OUT, 256, 256,
  550. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  551. /* NB: 50% of src nentries, since tx has 2 frags */
  552. /* ipa_uc->target */
  553. { /* CE5 */ 5, PIPEDIR_OUT, 1024, 64,
  554. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  555. /* Reserved for target autonomous HIF_memcpy */
  556. { /* CE6 */ 6, PIPEDIR_INOUT, 32, 16384, CE_ATTR_FLAGS, 0,},
  557. /* CE7 used only by Host */
  558. { /* CE7 */ 7, PIPEDIR_INOUT_H2H, 0, 0,
  559. (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,},
  560. /* CE8 used only by IPA */
  561. { /* CE8 */ 8, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  562. /* CE9 target->host HTT */
  563. { /* CE9 */ 9, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  564. /* CE10 target->host HTT */
  565. { /* CE10 */ 10, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  566. /* Target -> host PKTLOG */
  567. { /* CE11 */ 11, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,},
  568. };
  569. ;
  570. #endif /* __HIF_PCI_INTERNAL_H__ */