cdp_txrx_cmn_reg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright (c) 2011-2019 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. struct cdp_soc_t *
  64. dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  65. struct hif_opaque_softc *hif_handle,
  66. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  67. struct ol_if_ops *ol_ops, uint16_t device_id);
  68. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  69. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  70. struct hif_opaque_softc *hif_handle,
  71. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  72. struct ol_if_ops *ol_ops, uint16_t device_id);
  73. #else
  74. static inline
  75. struct cdp_soc_t *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  76. struct hif_opaque_softc *hif_handle,
  77. HTC_HANDLE htc_handle,
  78. qdf_device_t qdf_osdev,
  79. struct ol_if_ops *ol_ops,
  80. uint16_t device_id)
  81. {
  82. return NULL;
  83. }
  84. static inline
  85. void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
  86. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  87. struct hif_opaque_softc *hif_handle,
  88. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  89. struct ol_if_ops *ol_ops, uint16_t device_id)
  90. {
  91. return NULL;
  92. }
  93. #endif /* QCA_WIFI_QCA8074 */
  94. static inline ol_txrx_soc_handle cdp_soc_attach(
  95. u_int16_t devid, void *hif_handle, void *psoc,
  96. HTC_HANDLE htc_handle, qdf_device_t qdf_dev,
  97. struct ol_if_ops *dp_ol_if_ops)
  98. {
  99. switch (devid) {
  100. case LITHIUM_DP: /*FIXME Add lithium devide IDs */
  101. case QCA8074_DEVICE_ID: /* Hawekeye */
  102. case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/
  103. case QCA6290_DEVICE_ID:
  104. case QCN9000_DEVICE_ID:
  105. case QCA6390_DEVICE_ID:
  106. case QCA6490_DEVICE_ID:
  107. case QCA6390_EMULATION_DEVICE_ID:
  108. case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */
  109. case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
  110. case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
  111. case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
  112. case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */
  113. case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */
  114. return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle,
  115. qdf_dev, dp_ol_if_ops, devid);
  116. break;
  117. default:
  118. return ol_txrx_soc_attach(psoc, dp_ol_if_ops);
  119. }
  120. return NULL;
  121. }
  122. #endif /*_CDP_TXRX_CMN_REG_H_ */