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 ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops); 34 35 /** 36 * dp_soc_attach_wifi3() - Attach txrx SOC 37 * @ctrl_psoc: Opaque SOC handle from Ctrl plane 38 * @htc_handle: Opaque HTC handle 39 * @hif_handle: Opaque HIF handle 40 * @qdf_osdev: QDF device 41 * @ol_ops: Offload Operations 42 * @device_id: Device ID 43 * 44 * Return: DP SOC handle on success, NULL on failure 45 */ 46 47 /** 48 * dp_soc_init_wifi3() - Initialize txrx SOC 49 * @soc: Opaque DP SOC handle 50 * @ctrl_psoc: Opaque SOC handle from control plane 51 * @hif_handle: Opaque HIF handle 52 * @htc_handle: Opaque HTC handle 53 * @qdf_osdev: QDF device 54 * @ol_ops: Offload Operations 55 * @device_id: Device ID 56 * 57 * Return: DP SOC handle on success, NULL on failure 58 */ 59 #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) 60 void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, 61 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, 62 struct ol_if_ops *ol_ops, uint16_t device_id); 63 void *dp_soc_init_wifi3(void *soc, void *ctrl_psoc, void *hif_handle, 64 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, 65 struct ol_if_ops *ol_ops, uint16_t device_id); 66 #else 67 static inline void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, 68 HTC_HANDLE htc_handle, 69 qdf_device_t qdf_osdev, 70 struct ol_if_ops *ol_ops, 71 uint16_t device_id) 72 { 73 return NULL; 74 } 75 76 static inline 77 void *dp_soc_init_wifi3(void *soc, void *ctrl_psoc, void *hif_handle, 78 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, 79 struct ol_if_ops *ol_ops, uint16_t device_id) 80 { 81 return NULL; 82 } 83 #endif /* QCA_WIFI_QCA8074 */ 84 85 static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, 86 void *hif_handle, void *psoc, void *htc_handle, 87 qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops) 88 { 89 switch (devid) { 90 case LITHIUM_DP: /*FIXME Add lithium devide IDs */ 91 case QCA8074_DEVICE_ID: /* Hawekeye */ 92 case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/ 93 case QCA6290_DEVICE_ID: 94 case QCA6390_DEVICE_ID: 95 case QCA6390_EMULATION_DEVICE_ID: 96 case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */ 97 case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */ 98 case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */ 99 case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */ 100 case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */ 101 case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */ 102 return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle, 103 qdf_dev, dp_ol_if_ops, devid); 104 break; 105 default: 106 return ol_txrx_soc_attach(psoc, dp_ol_if_ops); 107 } 108 return NULL; 109 } 110 111 #endif /*_CDP_TXRX_CMN_REG_H_ */ 112