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