cdp_txrx_cmn_reg.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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/*FIXME Add MCL device IDs */
  27. #define LITHIUM_DP 0xfffd/*FIXME Add Litium device ID */
  28. /* Use these device IDs for attach in future */
  29. #if defined(DP_TXRX_SOC_ATTACH)
  30. static inline ol_txrx_soc_handle
  31. ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops)
  32. {
  33. return NULL;
  34. }
  35. #else
  36. ol_txrx_soc_handle
  37. ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops);
  38. #endif
  39. /**
  40. * dp_soc_attach_wifi3() - Attach txrx SOC
  41. * @ctrl_psoc: Opaque SOC handle from Ctrl plane
  42. * @htc_handle: Opaque HTC handle
  43. * @hif_handle: Opaque HIF handle
  44. * @qdf_osdev: QDF device
  45. * @ol_ops: Offload Operations
  46. * @device_id: Device ID
  47. *
  48. * Return: DP SOC handle on success, NULL on failure
  49. */
  50. /**
  51. * dp_soc_init_wifi3() - Initialize txrx SOC
  52. * @soc: Opaque DP SOC handle
  53. * @ctrl_psoc: Opaque SOC handle from control plane
  54. * @hif_handle: Opaque HIF handle
  55. * @htc_handle: Opaque HTC handle
  56. * @qdf_osdev: QDF device
  57. * @ol_ops: Offload Operations
  58. * @device_id: Device ID
  59. *
  60. * Return: DP SOC handle on success, NULL on failure
  61. */
  62. #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) || \
  63. defined(QCA_WIFI_QCA5018)
  64. struct cdp_soc_t *
  65. dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  66. struct hif_opaque_softc *hif_handle,
  67. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  68. struct ol_if_ops *ol_ops, uint16_t device_id);
  69. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  70. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  71. struct hif_opaque_softc *hif_handle,
  72. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  73. struct ol_if_ops *ol_ops, uint16_t device_id);
  74. #else
  75. static inline struct cdp_soc_t *
  76. dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  77. struct hif_opaque_softc *hif_handle,
  78. HTC_HANDLE htc_handle,
  79. qdf_device_t qdf_osdev,
  80. struct ol_if_ops *ol_ops,
  81. uint16_t device_id)
  82. {
  83. return NULL;
  84. }
  85. static inline
  86. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  87. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  88. struct hif_opaque_softc *hif_handle,
  89. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  90. struct ol_if_ops *ol_ops, uint16_t device_id)
  91. {
  92. return NULL;
  93. }
  94. #endif /* QCA_WIFI_QCA8074 */
  95. static inline
  96. ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid,
  97. struct hif_opaque_softc *hif_handle,
  98. struct cdp_ctrl_objmgr_psoc *psoc,
  99. HTC_HANDLE htc_handle,
  100. qdf_device_t qdf_dev,
  101. struct ol_if_ops *dp_ol_if_ops)
  102. {
  103. switch (devid) {
  104. case LITHIUM_DP: /*FIXME Add lithium devide IDs */
  105. case QCA8074_DEVICE_ID: /* Hawekeye */
  106. case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/
  107. case QCA5018_DEVICE_ID:
  108. case QCA6290_DEVICE_ID:
  109. case QCN9000_DEVICE_ID:
  110. case QCN6122_DEVICE_ID:
  111. case QCA6390_DEVICE_ID:
  112. case QCA6490_DEVICE_ID:
  113. case QCA6750_DEVICE_ID:
  114. case QCA6390_EMULATION_DEVICE_ID:
  115. case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */
  116. case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
  117. case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
  118. case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
  119. case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */
  120. case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */
  121. case WCN7850_EMULATION_DEVICE_ID:
  122. case WCN7850_DEVICE_ID:
  123. return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle,
  124. qdf_dev, dp_ol_if_ops, devid);
  125. break;
  126. default:
  127. return ol_txrx_soc_attach(psoc, dp_ol_if_ops);
  128. }
  129. return NULL;
  130. }
  131. #endif /*_CDP_TXRX_CMN_REG_H_ */