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