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