cdp_txrx_cmn_reg.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_cmn.h
  20. * @brief Define the host data path converged API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_CMN_REG_H_
  24. #define _CDP_TXRX_CMN_REG_H_
  25. #include "hif_main.h"
  26. #define MOB_DRV_LEGACY_DP 0xdeed
  27. /* Lithium device IDs */
  28. #define LITHIUM_DP 0xfffd
  29. /* Beryllium device IDs */
  30. #define BERYLLIUM_DP 0xaffe
  31. /* Use device IDs for attach in future */
  32. #if defined(DP_TXRX_SOC_ATTACH)
  33. static inline ol_txrx_soc_handle
  34. ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops)
  35. {
  36. return NULL;
  37. }
  38. #else
  39. ol_txrx_soc_handle
  40. ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops);
  41. #endif
  42. /**
  43. * dp_soc_attach_wifi3() - Attach txrx SOC
  44. * @ctrl_psoc: Opaque SOC handle from Ctrl plane
  45. * @htc_handle: Opaque HTC handle
  46. * @hif_handle: Opaque HIF handle
  47. * @qdf_osdev: QDF device
  48. * @ol_ops: Offload Operations
  49. * @device_id: Device ID
  50. *
  51. * Return: DP SOC handle on success, NULL on failure
  52. */
  53. /**
  54. * dp_soc_init_wifi3() - Initialize txrx SOC
  55. * @soc: Opaque DP SOC handle
  56. * @ctrl_psoc: Opaque SOC handle from control plane
  57. * @hif_handle: Opaque HIF handle
  58. * @htc_handle: Opaque HTC handle
  59. * @qdf_osdev: QDF device
  60. * @ol_ops: Offload Operations
  61. * @device_id: Device ID
  62. *
  63. * Return: DP SOC handle on success, NULL on failure
  64. */
  65. #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) || \
  66. defined(QCA_WIFI_QCA5018) || defined(QCA_WIFI_QCA9574)
  67. struct cdp_soc_t *
  68. dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  69. struct hif_opaque_softc *hif_handle,
  70. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  71. struct ol_if_ops *ol_ops, uint16_t device_id);
  72. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  73. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  74. struct hif_opaque_softc *hif_handle,
  75. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  76. struct ol_if_ops *ol_ops, uint16_t device_id);
  77. #else
  78. static inline struct cdp_soc_t *
  79. dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  80. struct hif_opaque_softc *hif_handle,
  81. HTC_HANDLE htc_handle,
  82. qdf_device_t qdf_osdev,
  83. struct ol_if_ops *ol_ops,
  84. uint16_t device_id)
  85. {
  86. return NULL;
  87. }
  88. static inline
  89. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  90. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  91. struct hif_opaque_softc *hif_handle,
  92. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  93. struct ol_if_ops *ol_ops, uint16_t device_id)
  94. {
  95. return NULL;
  96. }
  97. #endif /* QCA_WIFI_QCA8074 */
  98. static inline int cdp_get_arch_type_from_devid(uint16_t devid)
  99. {
  100. switch (devid) {
  101. case LITHIUM_DP: /*FIXME Add lithium devide IDs */
  102. case QCA8074_DEVICE_ID: /* Hawekeye */
  103. case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/
  104. case QCA9574_DEVICE_ID:
  105. case QCA5018_DEVICE_ID:
  106. case QCA6290_DEVICE_ID:
  107. case QCN9000_DEVICE_ID:
  108. case QCN6122_DEVICE_ID:
  109. case QCA6390_DEVICE_ID:
  110. case QCA6490_DEVICE_ID:
  111. case QCA6750_DEVICE_ID:
  112. case QCA6390_EMULATION_DEVICE_ID:
  113. case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */
  114. case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
  115. case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
  116. case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
  117. case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */
  118. case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */
  119. return LITHIUM_DP;
  120. case BERYLLIUM_DP:
  121. case WCN7850_DEVICE_ID:
  122. return BERYLLIUM_DP;
  123. default:
  124. return -1;
  125. }
  126. }
  127. static inline
  128. ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid,
  129. struct hif_opaque_softc *hif_handle,
  130. struct cdp_ctrl_objmgr_psoc *psoc,
  131. HTC_HANDLE htc_handle,
  132. qdf_device_t qdf_dev,
  133. struct ol_if_ops *dp_ol_if_ops)
  134. {
  135. switch (devid) {
  136. case LITHIUM_DP: /*FIXME Add lithium devide IDs */
  137. case BERYLLIUM_DP:
  138. case QCA8074_DEVICE_ID: /* Hawekeye */
  139. case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/
  140. case QCA5018_DEVICE_ID:
  141. case QCA6290_DEVICE_ID:
  142. case QCN9000_DEVICE_ID:
  143. case QCN6122_DEVICE_ID:
  144. case QCA6390_DEVICE_ID:
  145. case QCA6490_DEVICE_ID:
  146. case QCA6750_DEVICE_ID:
  147. case QCA6390_EMULATION_DEVICE_ID:
  148. case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */
  149. case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
  150. case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
  151. case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
  152. case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */
  153. case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */
  154. case WCN7850_DEVICE_ID:
  155. return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle,
  156. qdf_dev, dp_ol_if_ops, devid);
  157. break;
  158. default:
  159. return ol_txrx_soc_attach(psoc, dp_ol_if_ops);
  160. }
  161. return NULL;
  162. }
  163. #endif /*_CDP_TXRX_CMN_REG_H_ */